@volcengine/veplayer-plugin 2.6.0-rc.4 → 2.6.0-rc.5

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).__VEPLAYER_PLUGIN_FLV__={})}(this,(function(e){"use strict";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(t){return!0}},i=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),a=i,o=Function.prototype,s=o.call,u=a&&o.bind.bind(s,s),c=a?u:function(e){return function(){return s.apply(e,arguments)}},l=c({}.isPrototypeOf),f=function(e){return e&&e.Math==Math&&e},h=f("object"==typeof globalThis&&globalThis)||f("object"==typeof window&&window)||f("object"==typeof self&&self)||f("object"==typeof t&&t)||function(){return this}()||t||Function("return this")(),d=i,p=Function.prototype,v=p.apply,g=p.call,y="object"==typeof Reflect&&Reflect.apply||(d?g.bind(v):function(){return g.apply(v,arguments)}),m=c,_=m({}.toString),b=m("".slice),w=function(e){return b(_(e),8,-1)},k=w,S=c,x=function(e){if("Function"===k(e))return S(e)},E="object"==typeof document&&document.all,T={all:E,IS_HTMLDDA:void 0===E&&void 0!==E},A=T.all,L=T.IS_HTMLDDA?function(e){return"function"==typeof e||e===A}:function(e){return"function"==typeof e},C={},O=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),P=i,D=Function.prototype.call,R=P?D.bind(D):function(){return D.apply(D,arguments)},M={},U={}.propertyIsEnumerable,I=Object.getOwnPropertyDescriptor,B=I&&!U.call({1:2},1);M.f=B?function(e){var t=I(this,e);return!!t&&t.enumerable}:U;var j,F,N=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},z=n,V=w,G=Object,H=c("".split),q=z((function(){return!G("z").propertyIsEnumerable(0)}))?function(e){return"String"==V(e)?H(e,""):G(e)}:G,K=function(e){return null==e},W=K,Y=TypeError,J=function(e){if(W(e))throw Y("Can't call method on "+e);return e},Q=q,X=J,$=function(e){return Q(X(e))},Z=L,ee=T.all,te=T.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:Z(e)||e===ee}:function(e){return"object"==typeof e?null!==e:Z(e)},re={},ne=re,ie=h,ae=L,oe=function(e){return ae(e)?e:void 0},se=function(e,t){return arguments.length<2?oe(ne[e])||oe(ie[e]):ne[e]&&ne[e][t]||ie[e]&&ie[e][t]},ue="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ce=h,le=ue,fe=ce.process,he=ce.Deno,de=fe&&fe.versions||he&&he.version,pe=de&&de.v8;pe&&(F=(j=pe.split("."))[0]>0&&j[0]<4?1:+(j[0]+j[1])),!F&&le&&(!(j=le.match(/Edge\/(\d+)/))||j[1]>=74)&&(j=le.match(/Chrome\/(\d+)/))&&(F=+j[1]);var ve=F,ge=ve,ye=n,me=h.String,_e=!!Object.getOwnPropertySymbols&&!ye((function(){var e=Symbol();return!me(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ge&&ge<41})),be=_e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,we=se,ke=L,Se=l,xe=Object,Ee=be?function(e){return"symbol"==typeof e}:function(e){var t=we("Symbol");return ke(t)&&Se(t.prototype,xe(e))},Te=String,Ae=function(e){try{return Te(e)}catch(t){return"Object"}},Le=L,Ce=Ae,Oe=TypeError,Pe=function(e){if(Le(e))return e;throw Oe(Ce(e)+" is not a function")},De=Pe,Re=K,Me=function(e,t){var r=e[t];return Re(r)?void 0:De(r)},Ue=R,Ie=L,Be=te,je=TypeError,Fe={exports:{}},Ne=h,ze=Object.defineProperty,Ve=function(e,t){try{ze(Ne,e,{value:t,configurable:!0,writable:!0})}catch(r){Ne[e]=t}return t},Ge="__core-js_shared__",He=h[Ge]||Ve(Ge,{}),qe=He;(Fe.exports=function(e,t){return qe[e]||(qe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var Ke=Fe.exports,We=J,Ye=Object,Je=function(e){return Ye(We(e))},Qe=Je,Xe=c({}.hasOwnProperty),$e=Object.hasOwn||function(e,t){return Xe(Qe(e),t)},Ze=c,et=0,tt=Math.random(),rt=Ze(1..toString),nt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+rt(++et+tt,36)},it=Ke,at=$e,ot=nt,st=_e,ut=be,ct=h.Symbol,lt=it("wks"),ft=ut?ct.for||ct:ct&&ct.withoutSetter||ot,ht=function(e){return at(lt,e)||(lt[e]=st&&at(ct,e)?ct[e]:ft("Symbol."+e)),lt[e]},dt=R,pt=te,vt=Ee,gt=Me,yt=function(e,t){var r,n;if("string"===t&&Ie(r=e.toString)&&!Be(n=Ue(r,e)))return n;if(Ie(r=e.valueOf)&&!Be(n=Ue(r,e)))return n;if("string"!==t&&Ie(r=e.toString)&&!Be(n=Ue(r,e)))return n;throw je("Can't convert object to primitive value")},mt=TypeError,_t=ht("toPrimitive"),bt=function(e,t){if(!pt(e)||vt(e))return e;var r,n=gt(e,_t);if(n){if(void 0===t&&(t="default"),r=dt(n,e,t),!pt(r)||vt(r))return r;throw mt("Can't convert object to primitive value")}return void 0===t&&(t="number"),yt(e,t)},wt=Ee,kt=function(e){var t=bt(e,"string");return wt(t)?t:t+""},St=te,xt=h.document,Et=St(xt)&&St(xt.createElement),Tt=function(e){return Et?xt.createElement(e):{}},At=Tt,Lt=!O&&!n((function(){return 7!=Object.defineProperty(At("div"),"a",{get:function(){return 7}}).a})),Ct=O,Ot=R,Pt=M,Dt=N,Rt=$,Mt=kt,Ut=$e,It=Lt,Bt=Object.getOwnPropertyDescriptor;C.f=Ct?Bt:function(e,t){if(e=Rt(e),t=Mt(t),It)try{return Bt(e,t)}catch(r){}if(Ut(e,t))return Dt(!Ot(Pt.f,e,t),e[t])};var jt=n,Ft=L,Nt=/#|\.prototype\./,zt=function(e,t){var r=Gt[Vt(e)];return r==qt||r!=Ht&&(Ft(t)?jt(t):!!t)},Vt=zt.normalize=function(e){return String(e).replace(Nt,".").toLowerCase()},Gt=zt.data={},Ht=zt.NATIVE="N",qt=zt.POLYFILL="P",Kt=zt,Wt=Pe,Yt=i,Jt=x(x.bind),Qt=function(e,t){return Wt(e),void 0===t?e:Yt?Jt(e,t):function(){return e.apply(t,arguments)}},Xt={},$t=O&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Zt=te,er=String,tr=TypeError,rr=function(e){if(Zt(e))return e;throw tr(er(e)+" is not an object")},nr=O,ir=Lt,ar=$t,or=rr,sr=kt,ur=TypeError,cr=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,fr="enumerable",hr="configurable",dr="writable";Xt.f=nr?ar?function(e,t,r){if(or(e),t=sr(t),or(r),"function"==typeof e&&"prototype"===t&&"value"in r&&dr in r&&!r[dr]){var n=lr(e,t);n&&n[dr]&&(e[t]=r.value,r={configurable:hr in r?r[hr]:n[hr],enumerable:fr in r?r[fr]:n[fr],writable:!1})}return cr(e,t,r)}:cr:function(e,t,r){if(or(e),t=sr(t),or(r),ir)try{return cr(e,t,r)}catch(n){}if("get"in r||"set"in r)throw ur("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var pr=Xt,vr=N,gr=O?function(e,t,r){return pr.f(e,t,vr(1,r))}:function(e,t,r){return e[t]=r,e},yr=h,mr=y,_r=x,br=L,wr=C.f,kr=Kt,Sr=re,xr=Qt,Er=gr,Tr=$e,Ar=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 mr(e,this,arguments)};return t.prototype=e.prototype,t},Lr=function(e,t){var r,n,i,a,o,s,u,c,l,f=e.target,h=e.global,d=e.stat,p=e.proto,v=h?yr:d?yr[f]:(yr[f]||{}).prototype,g=h?Sr:Sr[f]||Er(Sr,f,{})[f],y=g.prototype;for(a in t)n=!(r=kr(h?a:f+(d?".":"#")+a,e.forced))&&v&&Tr(v,a),s=g[a],n&&(u=e.dontCallGetSet?(l=wr(v,a))&&l.value:v[a]),o=n&&u?u:t[a],n&&typeof s==typeof o||(c=e.bind&&n?xr(o,yr):e.wrap&&n?Ar(o):p&&br(o)?_r(o):o,(e.sham||o&&o.sham||s&&s.sham)&&Er(c,"sham",!0),Er(g,a,c),p&&(Tr(Sr,i=f+"Prototype")||Er(Sr,i,{}),Er(Sr[i],a,o),e.real&&y&&(r||!y[a])&&Er(y,a,o)))},Cr=w,Or=Array.isArray||function(e){return"Array"==Cr(e)},Pr=Math.ceil,Dr=Math.floor,Rr=Math.trunc||function(e){var t=+e;return(t>0?Dr:Pr)(t)},Mr=function(e){var t=+e;return t!=t||0===t?0:Rr(t)},Ur=Mr,Ir=Math.min,Br=function(e){return e>0?Ir(Ur(e),9007199254740991):0},jr=Br,Fr=function(e){return jr(e.length)},Nr=TypeError,zr=function(e){if(e>9007199254740991)throw Nr("Maximum allowed index exceeded");return e},Vr=kt,Gr=Xt,Hr=N,qr=function(e,t,r){var n=Vr(t);n in e?Gr.f(e,n,Hr(0,r)):e[n]=r},Kr={};Kr[ht("toStringTag")]="z";var Wr="[object z]"===String(Kr),Yr=Wr,Jr=L,Qr=w,Xr=ht("toStringTag"),$r=Object,Zr="Arguments"==Qr(function(){return arguments}()),en=Yr?Qr: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(r){}}(t=$r(e),Xr))?r:Zr?Qr(t):"Object"==(n=Qr(t))&&Jr(t.callee)?"Arguments":n},tn=L,rn=He,nn=c(Function.toString);tn(rn.inspectSource)||(rn.inspectSource=function(e){return nn(e)});var an=rn.inspectSource,on=c,sn=n,un=L,cn=en,ln=an,fn=function(){},hn=[],dn=se("Reflect","construct"),pn=/^\s*(?:class|function)\b/,vn=on(pn.exec),gn=!pn.exec(fn),yn=function(e){if(!un(e))return!1;try{return dn(fn,hn,e),!0}catch(t){return!1}},mn=function(e){if(!un(e))return!1;switch(cn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return gn||!!vn(pn,ln(e))}catch(t){return!0}};mn.sham=!0;var _n=!dn||sn((function(){var e;return yn(yn.call)||!yn(Object)||!yn((function(){e=!0}))||e}))?mn:yn,bn=Or,wn=_n,kn=te,Sn=ht("species"),xn=Array,En=function(e){var t;return bn(e)&&(t=e.constructor,(wn(t)&&(t===xn||bn(t.prototype))||kn(t)&&null===(t=t[Sn]))&&(t=void 0)),void 0===t?xn:t},Tn=function(e,t){return new(En(e))(0===t?0:t)},An=n,Ln=ve,Cn=ht("species"),On=function(e){return Ln>=51||!An((function(){var t=[];return(t.constructor={})[Cn]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Pn=Lr,Dn=n,Rn=Or,Mn=te,Un=Je,In=Fr,Bn=zr,jn=qr,Fn=Tn,Nn=On,zn=ve,Vn=ht("isConcatSpreadable"),Gn=zn>=51||!Dn((function(){var e=[];return e[Vn]=!1,e.concat()[0]!==e})),Hn=function(e){if(!Mn(e))return!1;var t=e[Vn];return void 0!==t?!!t:Rn(e)};Pn({target:"Array",proto:!0,arity:1,forced:!Gn||!Nn("concat")},{concat:function(e){var t,r,n,i,a,o=Un(this),s=Fn(o,0),u=0;for(t=-1,n=arguments.length;t<n;t++)if(Hn(a=-1===t?o:arguments[t]))for(i=In(a),Bn(u+i),r=0;r<i;r++,u++)r in a&&jn(s,u,a[r]);else Bn(u+1),jn(s,u++,a);return s.length=u,s}});var qn=re,Kn=function(e){return qn[e+"Prototype"]},Wn=Kn("Array").concat,Yn=l,Jn=Wn,Qn=Array.prototype,Xn=r((function(e){var t=e.concat;return e===Qn||Yn(Qn,e)&&t===Qn.concat?Jn:t})),$n=en,Zn=String,ei=function(e){if("Symbol"===$n(e))throw TypeError("Cannot convert a Symbol value to a string");return Zn(e)},ti={},ri=Mr,ni=Math.max,ii=Math.min,ai=function(e,t){var r=ri(e);return r<0?ni(r+t,0):ii(r,t)},oi=$,si=ai,ui=Fr,ci=function(e){return function(t,r,n){var i,a=oi(t),o=ui(a),s=si(n,o);if(e&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===r)return e||s||0;return!e&&-1}},li={includes:ci(!0),indexOf:ci(!1)},fi={},hi=$e,di=$,pi=li.indexOf,vi=fi,gi=c([].push),yi=function(e,t){var r,n=di(e),i=0,a=[];for(r in n)!hi(vi,r)&&hi(n,r)&&gi(a,r);for(;t.length>i;)hi(n,r=t[i++])&&(~pi(a,r)||gi(a,r));return a},mi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_i=yi,bi=mi,wi=Object.keys||function(e){return _i(e,bi)},ki=O,Si=$t,xi=Xt,Ei=rr,Ti=$,Ai=wi;ti.f=ki&&!Si?Object.defineProperties:function(e,t){Ei(e);for(var r,n=Ti(t),i=Ai(t),a=i.length,o=0;a>o;)xi.f(e,r=i[o++],n[r]);return e};var Li,Ci=se("document","documentElement"),Oi=nt,Pi=Ke("keys"),Di=function(e){return Pi[e]||(Pi[e]=Oi(e))},Ri=rr,Mi=ti,Ui=mi,Ii=fi,Bi=Ci,ji=Tt,Fi="prototype",Ni="script",zi=Di("IE_PROTO"),Vi=function(){},Gi=function(e){return"<"+Ni+">"+e+"</"+Ni+">"},Hi=function(e){e.write(Gi("")),e.close();var t=e.parentWindow.Object;return e=null,t},qi=function(){try{Li=new ActiveXObject("htmlfile")}catch(i){}var e,t,r;qi="undefined"!=typeof document?document.domain&&Li?Hi(Li):(t=ji("iframe"),r="java"+Ni+":",t.style.display="none",Bi.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(Gi("document.F=Object")),e.close(),e.F):Hi(Li);for(var n=Ui.length;n--;)delete qi[Fi][Ui[n]];return qi()};Ii[zi]=!0;var Ki=Object.create||function(e,t){var r;return null!==e?(Vi[Fi]=Ri(e),r=new Vi,Vi[Fi]=null,r[zi]=e):r=qi(),void 0===t?r:Mi.f(r,t)},Wi={},Yi=yi,Ji=mi.concat("length","prototype");Wi.f=Object.getOwnPropertyNames||function(e){return Yi(e,Ji)};var Qi={},Xi=ai,$i=Fr,Zi=qr,ea=Array,ta=Math.max,ra=function(e,t,r){for(var n=$i(e),i=Xi(t,n),a=Xi(void 0===r?n:r,n),o=ea(ta(a-i,0)),s=0;i<a;i++,s++)Zi(o,s,e[i]);return o.length=s,o},na=w,ia=$,aa=Wi.f,oa=ra,sa="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Qi.f=function(e){return sa&&"Window"==na(e)?function(e){try{return aa(e)}catch(t){return oa(sa)}}(e):aa(ia(e))};var ua={};ua.f=Object.getOwnPropertySymbols;var ca=gr,la=function(e,t,r,n){return n&&n.enumerable?e[t]=r:ca(e,t,r),e},fa=Xt,ha=function(e,t,r){return fa.f(e,t,r)},da={},pa=ht;da.f=pa;var va,ga,ya,ma=re,_a=$e,ba=da,wa=Xt.f,ka=function(e){var t=ma.Symbol||(ma.Symbol={});_a(t,e)||wa(t,e,{value:ba.f(e)})},Sa=R,xa=se,Ea=ht,Ta=la,Aa=function(){var e=xa("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=Ea("toPrimitive");t&&!t[n]&&Ta(t,n,(function(e){return Sa(r,this)}),{arity:1})},La=en,Ca=Wr?{}.toString:function(){return"[object "+La(this)+"]"},Oa=Wr,Pa=Xt.f,Da=gr,Ra=$e,Ma=Ca,Ua=ht("toStringTag"),Ia=function(e,t,r,n){if(e){var i=r?e:e.prototype;Ra(i,Ua)||Pa(i,Ua,{configurable:!0,value:t}),n&&!Oa&&Da(i,"toString",Ma)}},Ba=L,ja=h.WeakMap,Fa=Ba(ja)&&/native code/.test(String(ja)),Na=h,za=te,Va=gr,Ga=$e,Ha=He,qa=Di,Ka=fi,Wa="Object already initialized",Ya=Na.TypeError,Ja=Na.WeakMap;if(Fa||Ha.state){var Qa=Ha.state||(Ha.state=new Ja);Qa.get=Qa.get,Qa.has=Qa.has,Qa.set=Qa.set,va=function(e,t){if(Qa.has(e))throw Ya(Wa);return t.facade=e,Qa.set(e,t),t},ga=function(e){return Qa.get(e)||{}},ya=function(e){return Qa.has(e)}}else{var Xa=qa("state");Ka[Xa]=!0,va=function(e,t){if(Ga(e,Xa))throw Ya(Wa);return t.facade=e,Va(e,Xa,t),t},ga=function(e){return Ga(e,Xa)?e[Xa]:{}},ya=function(e){return Ga(e,Xa)}}var $a={set:va,get:ga,has:ya,enforce:function(e){return ya(e)?ga(e):va(e,{})},getterFor:function(e){return function(t){var r;if(!za(t)||(r=ga(t)).type!==e)throw Ya("Incompatible receiver, "+e+" required");return r}}},Za=Qt,eo=q,to=Je,ro=Fr,no=Tn,io=c([].push),ao=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,a=6==e,o=7==e,s=5==e||a;return function(u,c,l,f){for(var h,d,p=to(u),v=eo(p),g=Za(c,l),y=ro(v),m=0,_=f||no,b=t?_(u,y):r||o?_(u,0):void 0;y>m;m++)if((s||m in v)&&(d=g(h=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:io(b,h)}else switch(e){case 4:return!1;case 7:io(b,h)}return a?-1:n||i?i:b}},oo={forEach:ao(0),map:ao(1),filter:ao(2),some:ao(3),every:ao(4),find:ao(5),findIndex:ao(6),filterReject:ao(7)},so=Lr,uo=h,co=R,lo=c,fo=O,ho=_e,po=n,vo=$e,go=l,yo=rr,mo=$,_o=kt,bo=ei,wo=N,ko=Ki,So=wi,xo=Wi,Eo=Qi,To=ua,Ao=C,Lo=Xt,Co=ti,Oo=M,Po=la,Do=ha,Ro=Ke,Mo=fi,Uo=nt,Io=ht,Bo=da,jo=ka,Fo=Aa,No=Ia,zo=$a,Vo=oo.forEach,Go=Di("hidden"),Ho="Symbol",qo="prototype",Ko=zo.set,Wo=zo.getterFor(Ho),Yo=Object[qo],Jo=uo.Symbol,Qo=Jo&&Jo[qo],Xo=uo.TypeError,$o=uo.QObject,Zo=Ao.f,es=Lo.f,ts=Eo.f,rs=Oo.f,ns=lo([].push),is=Ro("symbols"),as=Ro("op-symbols"),os=Ro("wks"),ss=!$o||!$o[qo]||!$o[qo].findChild,us=fo&&po((function(){return 7!=ko(es({},"a",{get:function(){return es(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Zo(Yo,t);n&&delete Yo[t],es(e,t,r),n&&e!==Yo&&es(Yo,t,n)}:es,cs=function(e,t){var r=is[e]=ko(Qo);return Ko(r,{type:Ho,tag:e,description:t}),fo||(r.description=t),r},ls=function(e,t,r){e===Yo&&ls(as,t,r),yo(e);var n=_o(t);return yo(r),vo(is,n)?(r.enumerable?(vo(e,Go)&&e[Go][n]&&(e[Go][n]=!1),r=ko(r,{enumerable:wo(0,!1)})):(vo(e,Go)||es(e,Go,wo(1,{})),e[Go][n]=!0),us(e,n,r)):es(e,n,r)},fs=function(e,t){yo(e);var r=mo(t),n=So(r).concat(vs(r));return Vo(n,(function(t){fo&&!co(hs,r,t)||ls(e,t,r[t])})),e},hs=function(e){var t=_o(e),r=co(rs,this,t);return!(this===Yo&&vo(is,t)&&!vo(as,t))&&(!(r||!vo(this,t)||!vo(is,t)||vo(this,Go)&&this[Go][t])||r)},ds=function(e,t){var r=mo(e),n=_o(t);if(r!==Yo||!vo(is,n)||vo(as,n)){var i=Zo(r,n);return!i||!vo(is,n)||vo(r,Go)&&r[Go][n]||(i.enumerable=!0),i}},ps=function(e){var t=ts(mo(e)),r=[];return Vo(t,(function(e){vo(is,e)||vo(Mo,e)||ns(r,e)})),r},vs=function(e){var t=e===Yo,r=ts(t?as:mo(e)),n=[];return Vo(r,(function(e){!vo(is,e)||t&&!vo(Yo,e)||ns(n,is[e])})),n};ho||(Jo=function(){if(go(Qo,this))throw Xo("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?bo(arguments[0]):void 0,t=Uo(e),r=function(e){this===Yo&&co(r,as,e),vo(this,Go)&&vo(this[Go],t)&&(this[Go][t]=!1),us(this,t,wo(1,e))};return fo&&ss&&us(Yo,t,{configurable:!0,set:r}),cs(t,e)},Po(Qo=Jo[qo],"toString",(function(){return Wo(this).tag})),Po(Jo,"withoutSetter",(function(e){return cs(Uo(e),e)})),Oo.f=hs,Lo.f=ls,Co.f=fs,Ao.f=ds,xo.f=Eo.f=ps,To.f=vs,Bo.f=function(e){return cs(Io(e),e)},fo&&Do(Qo,"description",{configurable:!0,get:function(){return Wo(this).description}})),so({global:!0,constructor:!0,wrap:!0,forced:!ho,sham:!ho},{Symbol:Jo}),Vo(So(os),(function(e){jo(e)})),so({target:Ho,stat:!0,forced:!ho},{useSetter:function(){ss=!0},useSimple:function(){ss=!1}}),so({target:"Object",stat:!0,forced:!ho,sham:!fo},{create:function(e,t){return void 0===t?ko(e):fs(ko(e),t)},defineProperty:ls,defineProperties:fs,getOwnPropertyDescriptor:ds}),so({target:"Object",stat:!0,forced:!ho},{getOwnPropertyNames:ps}),Fo(),No(Jo,Ho),Mo[Go]=!0;var gs=_e&&!!Symbol.for&&!!Symbol.keyFor,ys=Lr,ms=se,_s=$e,bs=ei,ws=Ke,ks=gs,Ss=ws("string-to-symbol-registry"),xs=ws("symbol-to-string-registry");ys({target:"Symbol",stat:!0,forced:!ks},{for:function(e){var t=bs(e);if(_s(Ss,t))return Ss[t];var r=ms("Symbol")(t);return Ss[t]=r,xs[r]=t,r}});var Es=Lr,Ts=$e,As=Ee,Ls=Ae,Cs=gs,Os=Ke("symbol-to-string-registry");Es({target:"Symbol",stat:!0,forced:!Cs},{keyFor:function(e){if(!As(e))throw TypeError(Ls(e)+" is not a symbol");if(Ts(Os,e))return Os[e]}});var Ps=c([].slice),Ds=Or,Rs=L,Ms=w,Us=ei,Is=c([].push),Bs=Lr,js=se,Fs=y,Ns=R,zs=c,Vs=n,Gs=L,Hs=Ee,qs=Ps,Ks=function(e){if(Rs(e))return e;if(Ds(e)){for(var t=e.length,r=[],n=0;n<t;n++){var i=e[n];"string"==typeof i?Is(r,i):"number"!=typeof i&&"Number"!=Ms(i)&&"String"!=Ms(i)||Is(r,Us(i))}var a=r.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ds(this))return t;for(var n=0;n<a;n++)if(r[n]===e)return t}}},Ws=_e,Ys=String,Js=js("JSON","stringify"),Qs=zs(/./.exec),Xs=zs("".charAt),$s=zs("".charCodeAt),Zs=zs("".replace),eu=zs(1..toString),tu=/[\uD800-\uDFFF]/g,ru=/^[\uD800-\uDBFF]$/,nu=/^[\uDC00-\uDFFF]$/,iu=!Ws||Vs((function(){var e=js("Symbol")();return"[null]"!=Js([e])||"{}"!=Js({a:e})||"{}"!=Js(Object(e))})),au=Vs((function(){return'"\\udf06\\ud834"'!==Js("\udf06\ud834")||'"\\udead"'!==Js("\udead")})),ou=function(e,t){var r=qs(arguments),n=Ks(t);if(Gs(n)||void 0!==e&&!Hs(e))return r[1]=function(e,t){if(Gs(n)&&(t=Ns(n,this,Ys(e),t)),!Hs(t))return t},Fs(Js,null,r)},su=function(e,t,r){var n=Xs(r,t-1),i=Xs(r,t+1);return Qs(ru,e)&&!Qs(nu,i)||Qs(nu,e)&&!Qs(ru,n)?"\\u"+eu($s(e,0),16):e};Js&&Bs({target:"JSON",stat:!0,arity:3,forced:iu||au},{stringify:function(e,t,r){var n=qs(arguments),i=Fs(iu?ou:Js,null,n);return au&&"string"==typeof i?Zs(i,tu,su):i}});var uu=ua,cu=Je;Lr({target:"Object",stat:!0,forced:!_e||n((function(){uu.f(1)}))},{getOwnPropertySymbols:function(e){var t=uu.f;return t?t(cu(e)):[]}}),ka("asyncIterator"),ka("hasInstance"),ka("isConcatSpreadable"),ka("iterator"),ka("match"),ka("matchAll"),ka("replace"),ka("search"),ka("species"),ka("split");var lu=Aa;ka("toPrimitive"),lu();var fu=se,hu=Ia;ka("toStringTag"),hu(fu("Symbol"),"Symbol"),ka("unscopables"),Ia(h.JSON,"JSON",!0);var du,pu,vu,gu=re.Symbol,yu={},mu=O,_u=$e,bu=Function.prototype,wu=mu&&Object.getOwnPropertyDescriptor,ku=_u(bu,"name"),Su={EXISTS:ku,PROPER:ku&&"something"===function(){}.name,CONFIGURABLE:ku&&(!mu||mu&&wu(bu,"name").configurable)},xu=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Eu=$e,Tu=L,Au=Je,Lu=xu,Cu=Di("IE_PROTO"),Ou=Object,Pu=Ou.prototype,Du=Lu?Ou.getPrototypeOf:function(e){var t=Au(e);if(Eu(t,Cu))return t[Cu];var r=t.constructor;return Tu(r)&&t instanceof r?r.prototype:t instanceof Ou?Pu:null},Ru=n,Mu=L,Uu=te,Iu=Ki,Bu=Du,ju=la,Fu=ht("iterator"),Nu=!1;[].keys&&("next"in(vu=[].keys())?(pu=Bu(Bu(vu)))!==Object.prototype&&(du=pu):Nu=!0);var zu=!Uu(du)||Ru((function(){var e={};return du[Fu].call(e)!==e}));Mu((du=zu?{}:Iu(du))[Fu])||ju(du,Fu,(function(){return this}));var Vu={IteratorPrototype:du,BUGGY_SAFARI_ITERATORS:Nu},Gu=Vu.IteratorPrototype,Hu=Ki,qu=N,Ku=Ia,Wu=yu,Yu=function(){return this},Ju=function(e,t,r,n){var i=t+" Iterator";return e.prototype=Hu(Gu,{next:qu(+!n,r)}),Ku(e,i,!1,!0),Wu[i]=Yu,e},Qu=c,Xu=Pe,$u=L,Zu=String,ec=TypeError,tc=function(e,t,r){try{return Qu(Xu(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(n){}},rc=rr,nc=function(e){if("object"==typeof e||$u(e))return e;throw ec("Can't set "+Zu(e)+" as a prototype")},ic=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=tc(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(n){}return function(r,n){return rc(r),nc(n),t?e(r,n):r.__proto__=n,r}}():void 0),ac=Lr,oc=R,sc=Su,uc=Ju,cc=Du,lc=Ia,fc=la,hc=yu,dc=Vu,pc=sc.PROPER,vc=dc.BUGGY_SAFARI_ITERATORS,gc=ht("iterator"),yc="keys",mc="values",_c="entries",bc=function(){return this},wc=function(e,t,r,n,i,a,o){uc(r,t,n);var s,u,c,l=function(e){if(e===i&&v)return v;if(!vc&&e in d)return d[e];switch(e){case yc:case mc:case _c:return function(){return new r(this,e)}}return function(){return new r(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[gc]||d["@@iterator"]||i&&d[i],v=!vc&&p||l(i),g="Array"==t&&d.entries||p;if(g&&(s=cc(g.call(new e)))!==Object.prototype&&s.next&&(lc(s,f,!0,!0),hc[f]=bc),pc&&i==mc&&p&&p.name!==mc&&(h=!0,v=function(){return oc(p,this)}),i)if(u={values:l(mc),keys:a?v:l(yc),entries:l(_c)},o)for(c in u)(vc||h||!(c in d))&&fc(d,c,u[c]);else ac({target:t,proto:!0,forced:vc||h},u);return o&&d[gc]!==v&&fc(d,gc,v,{name:i}),hc[t]=v,u},kc=function(e,t){return{value:e,done:t}},Sc=$,xc=yu,Ec=$a;Xt.f;var Tc=wc,Ac=kc,Lc="Array Iterator",Cc=Ec.set,Oc=Ec.getterFor(Lc);Tc(Array,"Array",(function(e,t){Cc(this,{type:Lc,target:Sc(e),index:0,kind:t})}),(function(){var e=Oc(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,Ac(void 0,!0)):Ac("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),xc.Arguments=xc.Array;var Pc={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},Dc=h,Rc=en,Mc=gr,Uc=yu,Ic=ht("toStringTag");for(var Bc in Pc){var jc=Dc[Bc],Fc=jc&&jc.prototype;Fc&&Rc(Fc)!==Ic&&Mc(Fc,Ic,Bc),Uc[Bc]=Uc.Array}var Nc=gu;ka("dispose");var zc=Nc;ka("asyncDispose");var Vc=Lr,Gc=c,Hc=se("Symbol"),qc=Hc.keyFor,Kc=Gc(Hc.prototype.valueOf);Vc({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==qc(Kc(e))}catch(t){return!1}}});for(var Wc=Lr,Yc=Ke,Jc=se,Qc=c,Xc=Ee,$c=ht,Zc=Jc("Symbol"),el=Zc.isWellKnown,tl=Jc("Object","getOwnPropertyNames"),rl=Qc(Zc.prototype.valueOf),nl=Yc("wks"),il=0,al=tl(Zc),ol=al.length;il<ol;il++)try{var sl=al[il];Xc(Zc[sl])&&$c(sl)}catch(gB){}Wc({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if(el&&el(e))return!0;try{for(var t=rl(e),r=0,n=tl(nl),i=n.length;r<i;r++)if(nl[n[r]]==t)return!0}catch(gB){}return!1}}),ka("matcher"),ka("metadataKey"),ka("observable"),ka("metadata"),ka("patternMatch"),ka("replaceAll");var ul=zc,cl=r(ul),ll=c,fl=Mr,hl=ei,dl=J,pl=ll("".charAt),vl=ll("".charCodeAt),gl=ll("".slice),yl=function(e){return function(t,r){var n,i,a=hl(dl(t)),o=fl(r),s=a.length;return o<0||o>=s?e?"":void 0:(n=vl(a,o))<55296||n>56319||o+1===s||(i=vl(a,o+1))<56320||i>57343?e?pl(a,o):n:e?gl(a,o,o+2):i-56320+(n-55296<<10)+65536}},ml={codeAt:yl(!1),charAt:yl(!0)},_l=ml.charAt,bl=ei,wl=$a,kl=wc,Sl=kc,xl="String Iterator",El=wl.set,Tl=wl.getterFor(xl);kl(String,"String",(function(e){El(this,{type:xl,string:bl(e),index:0})}),(function(){var e,t=Tl(this),r=t.string,n=t.index;return n>=r.length?Sl(void 0,!0):(e=_l(r,n),t.index+=e.length,Sl(e,!1))}));var Al=da.f("iterator"),Ll=r(Al);function Cl(e){return(Cl="function"==typeof cl&&"symbol"==typeof Ll?function(e){return typeof e}:function(e){return e&&"function"==typeof cl&&e.constructor===cl&&e!==cl.prototype?"symbol":typeof e})(e)}var Ol=Je,Pl=wi;Lr({target:"Object",stat:!0,forced:n((function(){Pl(1)}))},{keys:function(e){return Pl(Ol(e))}});var Dl=r(re.Object.keys),Rl=r(re.Object.getOwnPropertySymbols),Ml=oo.filter;Lr({target:"Array",proto:!0,forced:!On("filter")},{filter:function(e){return Ml(this,e,arguments.length>1?arguments[1]:void 0)}});var Ul=Kn("Array").filter,Il=l,Bl=Ul,jl=Array.prototype,Fl=r((function(e){var t=e.filter;return e===jl||Il(jl,e)&&t===jl.filter?Bl:t})),Nl={exports:{}},zl=Lr,Vl=n,Gl=$,Hl=C.f,ql=O;zl({target:"Object",stat:!0,forced:!ql||Vl((function(){Hl(1)})),sham:!ql},{getOwnPropertyDescriptor:function(e,t){return Hl(Gl(e),t)}});var Kl=re.Object,Wl=Nl.exports=function(e,t){return Kl.getOwnPropertyDescriptor(e,t)};Kl.getOwnPropertyDescriptor.sham&&(Wl.sham=!0);var Yl=r(Nl.exports),Jl=n,Ql=function(e,t){var r=[][e];return!!r&&Jl((function(){r.call(null,t||function(){return 1},1)}))},Xl=oo.forEach,$l=Ql("forEach")?[].forEach:function(e){return Xl(this,e,arguments.length>1?arguments[1]:void 0)};Lr({target:"Array",proto:!0,forced:[].forEach!=$l},{forEach:$l});var Zl=Kn("Array").forEach,ef=en,tf=$e,rf=l,nf=Zl,af=Array.prototype,of={DOMTokenList:!0,NodeList:!0},sf=r((function(e){var t=e.forEach;return e===af||rf(af,e)&&t===af.forEach||tf(of,ef(e))?nf:t})),uf=se,cf=Wi,lf=ua,ff=rr,hf=c([].concat),df=uf("Reflect","ownKeys")||function(e){var t=cf.f(ff(e)),r=lf.f;return r?hf(t,r(e)):t},pf=df,vf=$,gf=C,yf=qr;Lr({target:"Object",stat:!0,sham:!O},{getOwnPropertyDescriptors:function(e){for(var t,r,n=vf(e),i=gf.f,a=pf(n),o={},s=0;a.length>s;)void 0!==(r=i(n,t=a[s++]))&&yf(o,t,r);return o}});var mf=r(re.Object.getOwnPropertyDescriptors),_f={exports:{}},bf=Lr,wf=O,kf=ti.f;bf({target:"Object",stat:!0,forced:Object.defineProperties!==kf,sham:!wf},{defineProperties:kf});var Sf=re.Object,xf=_f.exports=function(e,t){return Sf.defineProperties(e,t)};Sf.defineProperties.sham&&(xf.sham=!0);var Ef=r(_f.exports),Tf={exports:{}},Af=Lr,Lf=O,Cf=Xt.f;Af({target:"Object",stat:!0,forced:Object.defineProperty!==Cf,sham:!Lf},{defineProperty:Cf});var Of=re.Object,Pf=Tf.exports=function(e,t,r){return Of.defineProperty(e,t,r)};Of.defineProperty.sham&&(Pf.sham=!0);var Df=r(Tf.exports),Rf=r(ul);Lr({target:"Object",stat:!0,sham:!O},{create:Ki});var Mf=re.Object,Uf=r((function(e,t){return Mf.create(e,t)})),If=Je,Bf=Du,jf=xu;Lr({target:"Object",stat:!0,forced:n((function(){Bf(1)})),sham:!jf},{getPrototypeOf:function(e){return Bf(If(e))}});var Ff=r(re.Object.getPrototypeOf);Lr({target:"Object",stat:!0},{setPrototypeOf:ic});var Nf=r(re.Object.setPrototypeOf),zf=$e,Vf=df,Gf=C,Hf=Xt,qf=te,Kf=gr,Wf=Error,Yf=c("".replace),Jf=String(Wf("zxcasd").stack),Qf=/\n\s*at [^:]*:[^\n]*/,Xf=Qf.test(Jf),$f=N,Zf=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",$f(1,7)),7!==e.stack)})),eh=gr,th=function(e,t){if(Xf&&"string"==typeof e&&!Wf.prepareStackTrace)for(;t--;)e=Yf(e,Qf,"");return e},rh=Zf,nh=Error.captureStackTrace,ih=yu,ah=ht("iterator"),oh=Array.prototype,sh=function(e){return void 0!==e&&(ih.Array===e||oh[ah]===e)},uh=en,ch=Me,lh=K,fh=yu,hh=ht("iterator"),dh=function(e){if(!lh(e))return ch(e,hh)||ch(e,"@@iterator")||fh[uh(e)]},ph=R,vh=Pe,gh=rr,yh=Ae,mh=dh,_h=TypeError,bh=function(e,t){var r=arguments.length<2?mh(e):t;if(vh(r))return gh(ph(r,e));throw _h(yh(e)+" is not iterable")},wh=R,kh=rr,Sh=Me,xh=function(e,t,r){var n,i;kh(e);try{if(!(n=Sh(e,"return"))){if("throw"===t)throw r;return r}n=wh(n,e)}catch(gB){i=!0,n=gB}if("throw"===t)throw r;if(i)throw n;return kh(n),r},Eh=Qt,Th=R,Ah=rr,Lh=Ae,Ch=sh,Oh=Fr,Ph=l,Dh=bh,Rh=dh,Mh=xh,Uh=TypeError,Ih=function(e,t){this.stopped=e,this.result=t},Bh=Ih.prototype,jh=function(e,t,r){var n,i,a,o,s,u,c,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),v=Eh(t,l),g=function(e){return n&&Mh(n,"normal",e),new Ih(!0,e)},y=function(e){return f?(Ah(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(h)n=e.iterator;else if(d)n=e;else{if(!(i=Rh(e)))throw Uh(Lh(e)+" is not iterable");if(Ch(i)){for(a=0,o=Oh(e);o>a;a++)if((s=y(e[a]))&&Ph(Bh,s))return s;return new Ih(!1)}n=Dh(e,i)}for(u=h?e.next:n.next;!(c=Th(u,n)).done;){try{s=y(c.value)}catch(gB){Mh(n,"throw",gB)}if("object"==typeof s&&s&&Ph(Bh,s))return s}return new Ih(!1)},Fh=ei,Nh=Lr,zh=l,Vh=Du,Gh=ic,Hh=function(e,t,r){for(var n=Vf(t),i=Hf.f,a=Gf.f,o=0;o<n.length;o++){var s=n[o];zf(e,s)||r&&zf(r,s)||i(e,s,a(t,s))}},qh=Ki,Kh=gr,Wh=N,Yh=function(e,t){qf(t)&&"cause"in t&&Kf(e,"cause",t.cause)},Jh=function(e,t,r,n){rh&&(nh?nh(e,t):eh(e,"stack",th(r,n)))},Qh=jh,Xh=function(e,t){return void 0===e?arguments.length<2?"":t:Fh(e)},$h=ht("toStringTag"),Zh=Error,ed=[].push,td=function(e,t){var r,n=zh(rd,this);Gh?r=Gh(Zh(),n?Vh(this):rd):(r=n?this:qh(rd),Kh(r,$h,"Error")),void 0!==t&&Kh(r,"message",Xh(t)),Jh(r,td,r.stack,1),arguments.length>2&&Yh(r,arguments[2]);var i=[];return Qh(e,ed,{that:i}),Kh(r,"errors",i),r};Gh?Gh(td,Zh):Hh(td,Zh,{name:!0});var rd=td.prototype=qh(Zh.prototype,{constructor:Wh(1,td),message:Wh(1,""),name:Wh(1,"AggregateError")});Nh({global:!0,constructor:!0,arity:2},{AggregateError:td});var nd,id,ad,od,sd="undefined"!=typeof process&&"process"==w(process),ud=se,cd=ha,ld=O,fd=ht("species"),hd=function(e){var t=ud(e);ld&&t&&!t[fd]&&cd(t,fd,{configurable:!0,get:function(){return this}})},dd=l,pd=TypeError,vd=function(e,t){if(dd(t,e))return e;throw pd("Incorrect invocation")},gd=_n,yd=Ae,md=TypeError,_d=function(e){if(gd(e))return e;throw md(yd(e)+" is not a constructor")},bd=rr,wd=_d,kd=K,Sd=ht("species"),xd=function(e,t){var r,n=bd(e).constructor;return void 0===n||kd(r=bd(n)[Sd])?t:wd(r)},Ed=TypeError,Td=function(e,t){if(e<t)throw Ed("Not enough arguments");return e},Ad=/(?:ipad|iphone|ipod).*applewebkit/i.test(ue),Ld=h,Cd=y,Od=Qt,Pd=L,Dd=$e,Rd=n,Md=Ci,Ud=Ps,Id=Tt,Bd=Td,jd=Ad,Fd=sd,Nd=Ld.setImmediate,zd=Ld.clearImmediate,Vd=Ld.process,Gd=Ld.Dispatch,Hd=Ld.Function,qd=Ld.MessageChannel,Kd=Ld.String,Wd=0,Yd={},Jd="onreadystatechange";Rd((function(){nd=Ld.location}));var Qd=function(e){if(Dd(Yd,e)){var t=Yd[e];delete Yd[e],t()}},Xd=function(e){return function(){Qd(e)}},$d=function(e){Qd(e.data)},Zd=function(e){Ld.postMessage(Kd(e),nd.protocol+"//"+nd.host)};Nd&&zd||(Nd=function(e){Bd(arguments.length,1);var t=Pd(e)?e:Hd(e),r=Ud(arguments,1);return Yd[++Wd]=function(){Cd(t,void 0,r)},id(Wd),Wd},zd=function(e){delete Yd[e]},Fd?id=function(e){Vd.nextTick(Xd(e))}:Gd&&Gd.now?id=function(e){Gd.now(Xd(e))}:qd&&!jd?(od=(ad=new qd).port2,ad.port1.onmessage=$d,id=Od(od.postMessage,od)):Ld.addEventListener&&Pd(Ld.postMessage)&&!Ld.importScripts&&nd&&"file:"!==nd.protocol&&!Rd(Zd)?(id=Zd,Ld.addEventListener("message",$d,!1)):id=Jd in Id("script")?function(e){Md.appendChild(Id("script"))[Jd]=function(){Md.removeChild(this),Qd(e)}}:function(e){setTimeout(Xd(e),0)});var ep={set:Nd,clear:zd},tp=function(){this.head=null,this.tail=null};tp.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 rp,np,ip,ap,op,sp=tp,up=/ipad|iphone|ipod/i.test(ue)&&"undefined"!=typeof Pebble,cp=/web0s(?!.*chrome)/i.test(ue),lp=h,fp=Qt,hp=C.f,dp=ep.set,pp=sp,vp=Ad,gp=up,yp=cp,mp=sd,_p=lp.MutationObserver||lp.WebKitMutationObserver,bp=lp.document,wp=lp.process,kp=lp.Promise,Sp=hp(lp,"queueMicrotask"),xp=Sp&&Sp.value;if(!xp){var Ep=new pp,Tp=function(){var e,t;for(mp&&(e=wp.domain)&&e.exit();t=Ep.get();)try{t()}catch(gB){throw Ep.head&&rp(),gB}e&&e.enter()};vp||mp||yp||!_p||!bp?!gp&&kp&&kp.resolve?((ap=kp.resolve(void 0)).constructor=kp,op=fp(ap.then,ap),rp=function(){op(Tp)}):mp?rp=function(){wp.nextTick(Tp)}:(dp=fp(dp,lp),rp=function(){dp(Tp)}):(np=!0,ip=bp.createTextNode(""),new _p(Tp).observe(ip,{characterData:!0}),rp=function(){ip.data=np=!np}),xp=function(e){Ep.head||rp(),Ep.add(e)}}var Ap=xp,Lp=function(e){try{return{error:!1,value:e()}}catch(gB){return{error:!0,value:gB}}},Cp=h.Promise,Op="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Pp=!Op&&!sd&&"object"==typeof window&&"object"==typeof document,Dp=h,Rp=Cp,Mp=L,Up=Kt,Ip=an,Bp=ht,jp=Pp,Fp=Op,Np=ve,zp=Rp&&Rp.prototype,Vp=Bp("species"),Gp=!1,Hp=Mp(Dp.PromiseRejectionEvent),qp={CONSTRUCTOR:Up("Promise",(function(){var e=Ip(Rp),t=e!==String(Rp);if(!t&&66===Np)return!0;if(!zp.catch||!zp.finally)return!0;if(!Np||Np<51||!/native code/.test(e)){var r=new Rp((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[Vp]=n,!(Gp=r.then((function(){}))instanceof n))return!0}return!t&&(jp||Fp)&&!Hp})),REJECTION_EVENT:Hp,SUBCLASSING:Gp},Kp={},Wp=Pe,Yp=TypeError,Jp=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw Yp("Bad Promise constructor");t=e,r=n})),this.resolve=Wp(t),this.reject=Wp(r)};Kp.f=function(e){return new Jp(e)};var Qp,Xp,$p=Lr,Zp=sd,ev=h,tv=R,rv=la,nv=Ia,iv=hd,av=Pe,ov=L,sv=te,uv=vd,cv=xd,lv=ep.set,fv=Ap,hv=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(gB){}},dv=Lp,pv=sp,vv=$a,gv=Cp,yv=qp,mv=Kp,_v="Promise",bv=yv.CONSTRUCTOR,wv=yv.REJECTION_EVENT,kv=vv.getterFor(_v),Sv=vv.set,xv=gv&&gv.prototype,Ev=gv,Tv=xv,Av=ev.TypeError,Lv=ev.document,Cv=ev.process,Ov=mv.f,Pv=Ov,Dv=!!(Lv&&Lv.createEvent&&ev.dispatchEvent),Rv="unhandledrejection",Mv=function(e){var t;return!(!sv(e)||!ov(t=e.then))&&t},Uv=function(e,t){var r,n,i,a=t.value,o=1==t.state,s=o?e.ok:e.fail,u=e.resolve,c=e.reject,l=e.domain;try{s?(o||(2===t.rejection&&Nv(t),t.rejection=1),!0===s?r=a:(l&&l.enter(),r=s(a),l&&(l.exit(),i=!0)),r===e.promise?c(Av("Promise-chain cycle")):(n=Mv(r))?tv(n,r,u,c):u(r)):c(a)}catch(gB){l&&!i&&l.exit(),c(gB)}},Iv=function(e,t){e.notified||(e.notified=!0,fv((function(){for(var r,n=e.reactions;r=n.get();)Uv(r,e);e.notified=!1,t&&!e.rejection&&jv(e)})))},Bv=function(e,t,r){var n,i;Dv?((n=Lv.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),ev.dispatchEvent(n)):n={promise:t,reason:r},!wv&&(i=ev["on"+e])?i(n):e===Rv&&hv("Unhandled promise rejection",r)},jv=function(e){tv(lv,ev,(function(){var t,r=e.facade,n=e.value;if(Fv(e)&&(t=dv((function(){Zp?Cv.emit("unhandledRejection",n,r):Bv(Rv,r,n)})),e.rejection=Zp||Fv(e)?2:1,t.error))throw t.value}))},Fv=function(e){return 1!==e.rejection&&!e.parent},Nv=function(e){tv(lv,ev,(function(){var t=e.facade;Zp?Cv.emit("rejectionHandled",t):Bv("rejectionhandled",t,e.value)}))},zv=function(e,t,r){return function(n){e(t,n,r)}},Vv=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Iv(e,!0))},Gv=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Av("Promise can't be resolved itself");var n=Mv(t);n?fv((function(){var r={done:!1};try{tv(n,t,zv(Gv,r,e),zv(Vv,r,e))}catch(gB){Vv(r,gB,e)}})):(e.value=t,e.state=1,Iv(e,!1))}catch(gB){Vv({done:!1},gB,e)}}};bv&&(Tv=(Ev=function(e){uv(this,Tv),av(e),tv(Qp,this);var t=kv(this);try{e(zv(Gv,t),zv(Vv,t))}catch(gB){Vv(t,gB)}}).prototype,(Qp=function(e){Sv(this,{type:_v,done:!1,notified:!1,parent:!1,reactions:new pv,rejection:!1,state:0,value:void 0})}).prototype=rv(Tv,"then",(function(e,t){var r=kv(this),n=Ov(cv(this,Ev));return r.parent=!0,n.ok=!ov(e)||e,n.fail=ov(t)&&t,n.domain=Zp?Cv.domain:void 0,0==r.state?r.reactions.add(n):fv((function(){Uv(n,r)})),n.promise})),Xp=function(){var e=new Qp,t=kv(e);this.promise=e,this.resolve=zv(Gv,t),this.reject=zv(Vv,t)},mv.f=Ov=function(e){return e===Ev||undefined===e?new Xp(e):Pv(e)}),$p({global:!0,constructor:!0,wrap:!0,forced:bv},{Promise:Ev}),nv(Ev,_v,!1,!0),iv(_v);var Hv=ht("iterator"),qv=!1;try{var Kv=0,Wv={next:function(){return{done:!!Kv++}},return:function(){qv=!0}};Wv[Hv]=function(){return this},Array.from(Wv,(function(){throw 2}))}catch(gB){}var Yv=function(e,t){if(!t&&!qv)return!1;var r=!1;try{var n={};n[Hv]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(gB){}return r},Jv=Cp,Qv=qp.CONSTRUCTOR||!Yv((function(e){Jv.all(e).then(void 0,(function(){}))})),Xv=R,$v=Pe,Zv=Kp,eg=Lp,tg=jh;Lr({target:"Promise",stat:!0,forced:Qv},{all:function(e){var t=this,r=Zv.f(t),n=r.resolve,i=r.reject,a=eg((function(){var r=$v(t.resolve),a=[],o=0,s=1;tg(e,(function(e){var u=o++,c=!1;s++,Xv(r,t,e).then((function(e){c||(c=!0,a[u]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise}});var rg=Lr,ng=qp.CONSTRUCTOR;Cp&&Cp.prototype,rg({target:"Promise",proto:!0,forced:ng,real:!0},{catch:function(e){return this.then(void 0,e)}});var ig=R,ag=Pe,og=Kp,sg=Lp,ug=jh;Lr({target:"Promise",stat:!0,forced:Qv},{race:function(e){var t=this,r=og.f(t),n=r.reject,i=sg((function(){var i=ag(t.resolve);ug(e,(function(e){ig(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var cg=R,lg=Kp;Lr({target:"Promise",stat:!0,forced:qp.CONSTRUCTOR},{reject:function(e){var t=lg.f(this);return cg(t.reject,void 0,e),t.promise}});var fg=rr,hg=te,dg=Kp,pg=function(e,t){if(fg(e),hg(t)&&t.constructor===e)return t;var r=dg.f(e);return(0,r.resolve)(t),r.promise},vg=Lr,gg=Cp,yg=qp.CONSTRUCTOR,mg=pg,_g=se("Promise"),bg=!yg;vg({target:"Promise",stat:!0,forced:true},{resolve:function(e){return mg(bg&&this===_g?gg:this,e)}});var wg=R,kg=Pe,Sg=Kp,xg=Lp,Eg=jh;Lr({target:"Promise",stat:!0,forced:Qv},{allSettled:function(e){var t=this,r=Sg.f(t),n=r.resolve,i=r.reject,a=xg((function(){var r=kg(t.resolve),i=[],a=0,o=1;Eg(e,(function(e){var s=a++,u=!1;o++,wg(r,t,e).then((function(e){u||(u=!0,i[s]={status:"fulfilled",value:e},--o||n(i))}),(function(e){u||(u=!0,i[s]={status:"rejected",reason:e},--o||n(i))}))})),--o||n(i)}));return a.error&&i(a.value),r.promise}});var Tg=R,Ag=Pe,Lg=se,Cg=Kp,Og=Lp,Pg=jh,Dg="No one promise resolved";Lr({target:"Promise",stat:!0,forced:Qv},{any:function(e){var t=this,r=Lg("AggregateError"),n=Cg.f(t),i=n.resolve,a=n.reject,o=Og((function(){var n=Ag(t.resolve),o=[],s=0,u=1,c=!1;Pg(e,(function(e){var l=s++,f=!1;u++,Tg(n,t,e).then((function(e){f||c||(c=!0,i(e))}),(function(e){f||c||(f=!0,o[l]=e,--u||a(new r(o,Dg)))}))})),--u||a(new r(o,Dg))}));return o.error&&a(o.value),n.promise}});var Rg=Lr,Mg=Cp,Ug=n,Ig=se,Bg=L,jg=xd,Fg=pg,Ng=Mg&&Mg.prototype;Rg({target:"Promise",proto:!0,real:!0,forced:!!Mg&&Ug((function(){Ng.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=jg(this,Ig("Promise")),r=Bg(e);return this.then(r?function(r){return Fg(t,e()).then((function(){return r}))}:e,r?function(r){return Fg(t,e()).then((function(){throw r}))}:e)}});var zg=re.Promise,Vg=Kp,Gg=Lp;Lr({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Vg.f(this),r=Gg(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var Hg=r(zg),qg=Lr,Kg=Or,Wg=c([].reverse),Yg=[1,2];qg({target:"Array",proto:!0,forced:String(Yg)===String(Yg.reverse())},{reverse:function(){return Kg(this)&&(this.length=this.length),Wg(this)}});var Jg=Kn("Array").reverse,Qg=l,Xg=Jg,$g=Array.prototype,Zg=r((function(e){var t=e.reverse;return e===$g||Qg($g,e)&&t===$g.reverse?Xg:t})),ey=Lr,ty=Or,ry=_n,ny=te,iy=ai,ay=Fr,oy=$,sy=qr,uy=ht,cy=Ps,ly=On("slice"),fy=uy("species"),hy=Array,dy=Math.max;ey({target:"Array",proto:!0,forced:!ly},{slice:function(e,t){var r,n,i,a=oy(this),o=ay(a),s=iy(e,o),u=iy(void 0===t?o:t,o);if(ty(a)&&(r=a.constructor,(ry(r)&&(r===hy||ty(r.prototype))||ny(r)&&null===(r=r[fy]))&&(r=void 0),r===hy||void 0===r))return cy(a,s,u);for(n=new(void 0===r?hy:r)(dy(u-s,0)),i=0;s<u;s++,i++)s in a&&sy(n,i,a[s]);return n.length=i,n}});var py=Kn("Array").slice,vy=l,gy=py,yy=Array.prototype,my=r((function(e){var t=e.slice;return e===yy||vy(yy,e)&&t===yy.slice?gy:t})),_y=r(Al),by=c,wy=Pe,ky=te,Sy=$e,xy=Ps,Ey=i,Ty=Function,Ay=by([].concat),Ly=by([].join),Cy={},Oy=Ey?Ty.bind:function(e){var t=wy(this),r=t.prototype,n=xy(arguments,1),i=function(){var r=Ay(n,xy(arguments));return this instanceof i?function(e,t,r){if(!Sy(Cy,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";Cy[t]=Ty("C,a","return new C("+Ly(n,",")+")")}return Cy[t](e,r)}(t,r.length,r):t.apply(e,r)};return ky(r)&&(i.prototype=r),i},Py=Oy;Lr({target:"Function",proto:!0,forced:Function.bind!==Py},{bind:Py});var Dy=Kn("Function").bind,Ry=l,My=Dy,Uy=Function.prototype,Iy=r((function(e){var t=e.bind;return e===Uy||Ry(Uy,e)&&t===Uy.bind?My:t})),By=Lr,jy=y,Fy=Oy,Ny=_d,zy=rr,Vy=te,Gy=Ki,Hy=n,qy=se("Reflect","construct"),Ky=Object.prototype,Wy=[].push,Yy=Hy((function(){function e(){}return!(qy((function(){}),[],e)instanceof e)})),Jy=!Hy((function(){qy((function(){}))})),Qy=Yy||Jy;By({target:"Reflect",stat:!0,forced:Qy,sham:Qy},{construct:function(e,t){Ny(e),zy(t);var r=arguments.length<3?e:Ny(arguments[2]);if(Jy&&!Yy)return qy(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return jy(Wy,n,t),new(jy(Fy,e,n))}var i=r.prototype,a=Gy(Vy(i)?i:Ky),o=jy(e,a,t);return Vy(o)?o:a}});var Xy=r(re.Reflect.construct),$y=r(da.f("toPrimitive"));function Zy(e,t){var r=Dl(e);if(Rl){var n=Rl(e);t&&(n=Fl(n).call(n,(function(t){return Yl(e,t).enumerable}))),r.push.apply(r,n)}return r}function em(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?sf(r=Zy(Object(i),!0)).call(r,(function(t){um(e,t,i[t])})):mf?Ef(e,mf(i)):sf(n=Zy(Object(i))).call(n,(function(t){Df(e,t,Yl(i,t))}))}return e}function tm(){tm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Df||function(e,t,r){e[t]=r.value},i="function"==typeof Rf?Rf:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r){return Df(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(A){u=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var a=t&&t.prototype instanceof h?t:h,o=Uf(a.prototype),s=new x(i||[]);return n(o,"_invoke",{value:b(e,r,s)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(A){return{type:"throw",arg:A}}}e.wrap=c;var f={};function h(){}function d(){}function p(){}var v={};u(v,a,(function(){return this}));var g=Ff&&Ff(Ff(E([])));g&&g!==t&&r.call(g,a)&&(v=g);var y=p.prototype=h.prototype=Uf(v);function m(e){var t;sf(t=["next","throw","return"]).call(t,(function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(n,a,o,s){var u=l(e[n],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==Cl(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(f).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,s)}))}s(u.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function b(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=w(o,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],sf(e).call(e,k,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Nf?Nf(e,p):(e.__proto__=p,u(e,s,"GeneratorFunction")),e.prototype=Uf(y),e},e.awrap=function(e){return{__await:e}},m(_.prototype),u(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,a){void 0===a&&(a=Hg);var o=new _(c(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},m(y),u(y,s,"Generator"),u(y,a,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return Zg(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=E,x.prototype={constructor:x,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,sf(t=this.tryEntries).call(t,S),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+my(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function rm(e){return(rm="function"==typeof Rf&&"symbol"==typeof _y?function(e){return typeof e}:function(e){return e&&"function"==typeof Rf&&e.constructor===Rf&&e!==Rf.prototype?"symbol":typeof e})(e)}function nm(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(gB){return void r(gB)}s.done?t(u):Hg.resolve(u).then(n,i)}function im(e){return function(){var t=this,r=arguments;return new Hg((function(n,i){var a=e.apply(t,r);function o(e){nm(a,n,i,o,s,"next",e)}function s(e){nm(a,n,i,o,s,"throw",e)}o(void 0)}))}}function am(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function om(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),Df(e,pm(n.key),n)}}function sm(e,t,r){return t&&om(e.prototype,t),r&&om(e,r),Df(e,"prototype",{writable:!1}),e}function um(e,t,r){return(t=pm(t))in e?Df(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Uf(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Df(e,"prototype",{writable:!1}),t&&fm(e,t)}function lm(e){var t;return(lm=Nf?Iy(t=Ff).call(t):function(e){return e.__proto__||Ff(e)})(e)}function fm(e,t){var r;return(fm=Nf?Iy(r=Nf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function hm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dm(e){var t=function(){if("undefined"==typeof Reflect||!Xy)return!1;if(Xy.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Xy(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=lm(e);if(t){var i=lm(this).constructor;r=Xy(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===Cl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hm(e)}(this,r)}}function pm(e){var t=function(e,t){if("object"!==Cl(e)||null===e)return e;var r=e[$y];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Cl(t)?t:String(t)}var vm=Lr,gm=li.indexOf,ym=Ql,mm=x([].indexOf),_m=!!mm&&1/mm([1],1,-0)<0;vm({target:"Array",proto:!0,forced:_m||!ym("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return _m?mm(this,e,t)||0:gm(this,e,t)}});var bm=Kn("Array").indexOf,wm=l,km=bm,Sm=Array.prototype,xm=r((function(e){var t=e.indexOf;return e===Sm||wm(Sm,e)&&t===Sm.indexOf?km:t})),Em=Lr,Tm=oo.find,Am="find",Lm=!0;Am in[]&&Array(1)[Am]((function(){Lm=!1})),Em({target:"Array",proto:!0,forced:Lm},{find:function(e){return Tm(this,e,arguments.length>1?arguments[1]:void 0)}});var Cm=Kn("Array").find,Om=l,Pm=Cm,Dm=Array.prototype,Rm=r((function(e){var t=e.find;return e===Dm||Om(Dm,e)&&t===Dm.find?Pm:t})),Mm=O,Um=Or,Im=TypeError,Bm=Object.getOwnPropertyDescriptor,jm=Mm&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(gB){return gB instanceof TypeError}}(),Fm=Ae,Nm=TypeError,zm=function(e,t){if(!delete e[t])throw Nm("Cannot delete property "+Fm(t)+" of "+Fm(e))},Vm=Lr,Gm=Je,Hm=ai,qm=Mr,Km=Fr,Wm=jm?function(e,t){if(Um(e)&&!Bm(e,"length").writable)throw Im("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Ym=zr,Jm=Tn,Qm=qr,Xm=zm,$m=On("splice"),Zm=Math.max,e_=Math.min;Vm({target:"Array",proto:!0,forced:!$m},{splice:function(e,t){var r,n,i,a,o,s,u=Gm(this),c=Km(u),l=Hm(e,c),f=arguments.length;for(0===f?r=n=0:1===f?(r=0,n=c-l):(r=f-2,n=e_(Zm(qm(t),0),c-l)),Ym(c+r-n),i=Jm(u,n),a=0;a<n;a++)(o=l+a)in u&&Qm(i,a,u[o]);if(i.length=n,r<n){for(a=l;a<c-n;a++)s=a+r,(o=a+n)in u?u[s]=u[o]:Xm(u,s);for(a=c;a>c-n+r;a--)Xm(u,a-1)}else if(r>n)for(a=c-n;a>l;a--)s=a+r-1,(o=a+n-1)in u?u[s]=u[o]:Xm(u,s);for(a=0;a<r;a++)u[a+l]=arguments[a+2];return Wm(u,c-n+r),i}});var t_=Kn("Array").splice,r_=l,n_=t_,i_=Array.prototype,a_=r((function(e){var t=e.splice;return e===i_||r_(i_,e)&&t===i_.splice?n_:t}));Lr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var o_=r(re.Number.isNaN),s_="\t\n\v\f\r                 \u2028\u2029\ufeff",u_=J,c_=ei,l_=s_,f_=c("".replace),h_=RegExp("^["+l_+"]+"),d_=RegExp("(^|[^"+l_+"])["+l_+"]+$"),p_=function(e){return function(t){var r=c_(u_(t));return 1&e&&(r=f_(r,h_,"")),2&e&&(r=f_(r,d_,"$1")),r}},v_={start:p_(1),end:p_(2),trim:p_(3)},g_=h,y_=n,m_=c,__=ei,b_=v_.trim,w_=s_,k_=g_.parseInt,S_=g_.Symbol,x_=S_&&S_.iterator,E_=/^[+-]?0x/i,T_=m_(E_.exec),A_=8!==k_(w_+"08")||22!==k_(w_+"0x16")||x_&&!y_((function(){k_(Object(x_))}))?function(e,t){var r=b_(__(e));return k_(r,t>>>0||(T_(E_,r)?16:10))}:k_;Lr({global:!0,forced:parseInt!=A_},{parseInt:A_});var L_=r(re.parseInt),C_=oo.map;Lr({target:"Array",proto:!0,forced:!On("map")},{map:function(e){return C_(this,e,arguments.length>1?arguments[1]:void 0)}});var O_=Kn("Array").map,P_=l,D_=O_,R_=Array.prototype,M_=r((function(e){var t=e.map;return e===R_||P_(R_,e)&&t===R_.map?D_:t}));Lr({target:"Array",stat:!0},{isArray:Or});var U_=r(re.Array.isArray),I_=O,B_=c,j_=R,F_=n,N_=wi,z_=ua,V_=M,G_=Je,H_=q,q_=Object.assign,K_=Object.defineProperty,W_=B_([].concat),Y_=!q_||F_((function(){if(I_&&1!==q_({b:1},q_(K_({},"a",{enumerable:!0,get:function(){K_(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=q_({},e)[r]||N_(q_({},t)).join("")!=n}))?function(e,t){for(var r=G_(e),n=arguments.length,i=1,a=z_.f,o=V_.f;n>i;)for(var s,u=H_(arguments[i++]),c=a?W_(N_(u),a(u)):N_(u),l=c.length,f=0;l>f;)s=c[f++],I_&&!j_(o,u,s)||(r[s]=u[s]);return r}:q_,J_=Y_;Lr({target:"Object",stat:!0,arity:2,forced:Object.assign!==J_},{assign:J_});var Q_=r(re.Object.assign),X_=$e,$_=R,Z_=te,eb=rr,tb=function(e){return void 0!==e&&(X_(e,"value")||X_(e,"writable"))},rb=C,nb=Du;Lr({target:"Reflect",stat:!0},{get:function e(t,r){var n,i,a=arguments.length<3?t:arguments[2];return eb(t)===a?t[r]:(n=rb.f(t,r))?tb(n)?n.value:void 0===n.get?void 0:$_(n.get,a):Z_(i=nb(t))?e(i,r,a):void 0}});var ib=r(re.Reflect.get),ab=r(dh),ob=rr,sb=xh,ub=Qt,cb=R,lb=Je,fb=function(e,t,r,n){try{return n?t(ob(r)[0],r[1]):t(r)}catch(gB){sb(e,"throw",gB)}},hb=sh,db=_n,pb=Fr,vb=qr,gb=bh,yb=dh,mb=Array,_b=function(e){var t=lb(e),r=db(this),n=arguments.length,i=n>1?arguments[1]:void 0,a=void 0!==i;a&&(i=ub(i,n>2?arguments[2]:void 0));var o,s,u,c,l,f,h=yb(t),d=0;if(!h||this===mb&&hb(h))for(o=pb(t),s=r?new this(o):mb(o);o>d;d++)f=a?i(t[d],d):t[d],vb(s,d,f);else for(l=(c=gb(t,h)).next,s=r?new this:[];!(u=cb(l,c)).done;d++)f=a?fb(c,i,[u.value,d],!0):u.value,vb(s,d,f);return s.length=d,s},bb=_b;Lr({target:"Array",stat:!0,forced:!Yv((function(e){Array.from(e)}))},{from:bb});var wb=r(re.Array.from);function kb(e,t){var r=Dl(e);if(Rl){var n=Rl(e);t&&(n=Fl(n).call(n,(function(t){return Yl(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sb(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?sf(r=kb(Object(i),!0)).call(r,(function(t){Lb(e,t,i[t])})):mf?Ef(e,mf(i)):sf(n=kb(Object(i))).call(n,(function(t){Df(e,t,Yl(i,t))}))}return e}function xb(e){return(xb="function"==typeof Rf&&"symbol"==typeof _y?function(e){return typeof e}:function(e){return e&&"function"==typeof Rf&&e.constructor===Rf&&e!==Rf.prototype?"symbol":typeof e})(e)}function Eb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tb(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),Df(e,Pb(n.key),n)}}function Ab(e,t,r){return t&&Tb(e.prototype,t),r&&Tb(e,r),Df(e,"prototype",{writable:!1}),e}function Lb(e,t,r){return(t=Pb(t))in e?Df(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cb(e){return function(e){if(U_(e))return Ob(e)}(e)||function(e){if(void 0!==Rf&&null!=ab(e)||null!=e["@@iterator"])return wb(e)}(e)||function(e,t){var r;if(!e)return;if("string"==typeof e)return Ob(e,t);var n=my(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return wb(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ob(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ob(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pb(e){var t=function(e,t){if("object"!==Cl(e)||null===e)return e;var r=e[$y];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Cl(t)?t:String(t)}var Db={exports:{}};!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 a(e,t,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,a||e,o),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Uf&&(n.prototype=Uf(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?my(n).call(n,1):n);return Rl?Xn(i).call(i,Rl(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,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},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,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){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,a),!0;case 6:return l.fn.call(l.context,t,n,i,a,o),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),f){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,n);break;case 4:l[c].fn.call(l[c].context,t,n,i);break;default:if(!u)for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||o(this,a);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||n&&s[u].context!==n)&&c.push(s[u]);c.length?this._events[a]=1===c.length?c[0]:c:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(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}(Db);var Rb=r(Db.exports),Mb=oo.some;Lr({target:"Array",proto:!0,forced:!Ql("some")},{some:function(e){return Mb(this,e,arguments.length>1?arguments[1]:void 0)}});var Ub=Kn("Array").some,Ib=l,Bb=Ub,jb=Array.prototype,Fb=r((function(e){var t=e.some;return e===jb||Ib(jb,e)&&t===jb.some?Bb:t})),Nb=Mr,zb=ei,Vb=J,Gb=RangeError,Hb=c,qb=Br,Kb=ei,Wb=J,Yb=Hb((function(e){var t=zb(Vb(this)),r="",n=Nb(e);if(n<0||n==1/0)throw Gb("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),Jb=Hb("".slice),Qb=Math.ceil,Xb=function(e){return function(t,r,n){var i,a,o=Kb(Wb(t)),s=qb(r),u=o.length,c=void 0===n?" ":Kb(n);return s<=u||""==c?o:((a=Yb(c,Qb((i=s-u)/c.length))).length>i&&(a=Jb(a,0,i)),e?o+a:a+o)}},$b={start:Xb(!1),end:Xb(!0)},Zb=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(ue),ew=$b.start;Lr({target:"String",proto:!0,forced:Zb},{padStart:function(e){return ew(this,e,arguments.length>1?arguments[1]:void 0)}});var tw,rw=Kn("String").padStart,nw=l,iw=rw,aw=String.prototype,ow=r((function(e){var t=e.padStart;return"string"==typeof e||e===aw||nw(aw,e)&&t===aw.padStart?iw:t})),sw="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,uw=h,cw=y,lw=L,fw=sw,hw=ue,dw=Ps,pw=Td,vw=uw.Function,gw=/MSIE .\./.test(hw)||fw&&((tw=uw.Bun.version.split(".")).length<3||0==tw[0]&&(tw[1]<3||3==tw[1]&&0==tw[2])),yw=function(e,t){var r=t?2:1;return gw?function(n,i){var a=pw(arguments.length,1)>r,o=lw(n)?n:vw(n),s=a?dw(arguments,r):[],u=a?function(){cw(o,this,s)}:o;return t?e(u,i):e(u)}:e},mw=Lr,_w=h,bw=yw(_w.setInterval,!0);mw({global:!0,bind:!0,forced:_w.setInterval!==bw},{setInterval:bw});var ww=Lr,kw=h,Sw=yw(kw.setTimeout,!0);ww({global:!0,bind:!0,forced:kw.setTimeout!==Sw},{setTimeout:Sw});var xw=r(re.setInterval),Ew=r(re.setTimeout),Tw=oo.every;Lr({target:"Array",proto:!0,forced:!Ql("every")},{every:function(e){return Tw(this,e,arguments.length>1?arguments[1]:void 0)}});var Aw=Kn("Array").every,Lw=l,Cw=Aw,Ow=Array.prototype,Pw=r((function(e){var t=e.every;return e===Ow||Lw(Ow,e)&&t===Ow.every?Cw:t})),Dw=h,Rw=n,Mw=ei,Uw=v_.trim,Iw=s_,Bw=c("".charAt),jw=Dw.parseFloat,Fw=Dw.Symbol,Nw=Fw&&Fw.iterator,zw=1/jw(Iw+"-0")!=-1/0||Nw&&!Rw((function(){jw(Object(Nw))}))?function(e){var t=Uw(Mw(e)),r=jw(t);return 0===r&&"-"==Bw(t,0)?-0:r}:jw;Lr({global:!0,forced:parseFloat!=zw},{parseFloat:zw});var Vw=r(re.parseFloat),Gw=Su.PROPER,Hw=n,qw=s_,Kw=v_.trim;Lr({target:"String",proto:!0,forced:function(e){return Hw((function(){return!!qw[e]()||"​…᠎"!=="​…᠎"[e]()||Gw&&qw[e].name!==e}))}("trim")},{trim:function(){return Kw(this)}});var Ww=Kn("String").trim,Yw=l,Jw=Ww,Qw=String.prototype,Xw=r((function(e){var t=e.trim;return"string"==typeof e||e===Qw||Yw(Qw,e)&&t===Qw.trim?Jw:t})),$w=ra,Zw=Math.floor,ek=function(e,t){var r=e.length,n=Zw(r/2);return r<8?tk(e,t):rk(e,ek($w(e,0,n),t),ek($w(e,n),t),t)},tk=function(e,t){for(var r,n,i=e.length,a=1;a<i;){for(n=a,r=e[a];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==a++&&(e[n]=r)}return e},rk=function(e,t,r,n){for(var i=t.length,a=r.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?n(t[o],r[s])<=0?t[o++]:r[s++]:o<i?t[o++]:r[s++];return e},nk=ek,ik=ue.match(/firefox\/(\d+)/i),ak=!!ik&&+ik[1],ok=/MSIE|Trident/.test(ue),sk=ue.match(/AppleWebKit\/(\d+)\./),uk=!!sk&&+sk[1],ck=Lr,lk=c,fk=Pe,hk=Je,dk=Fr,pk=zm,vk=ei,gk=n,yk=nk,mk=Ql,_k=ak,bk=ok,wk=ve,kk=uk,Sk=[],xk=lk(Sk.sort),Ek=lk(Sk.push),Tk=gk((function(){Sk.sort(void 0)})),Ak=gk((function(){Sk.sort(null)})),Lk=mk("sort"),Ck=!gk((function(){if(wk)return wk<70;if(!(_k&&_k>3)){if(bk)return!0;if(kk)return kk<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++)Sk.push({k:t+n,v:r})}for(Sk.sort((function(e,t){return t.v-e.v})),n=0;n<Sk.length;n++)t=Sk[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));ck({target:"Array",proto:!0,forced:Tk||!Ak||!Lk||!Ck},{sort:function(e){void 0!==e&&fk(e);var t=hk(this);if(Ck)return void 0===e?xk(t):xk(t,e);var r,n,i=[],a=dk(t);for(n=0;n<a;n++)n in t&&Ek(i,t[n]);for(yk(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:vk(t)>vk(r)?1:-1}}(e)),r=dk(i),n=0;n<r;)t[n]=i[n++];for(;n<a;)pk(t,n++);return t}});var Ok=Kn("Array").sort,Pk=l,Dk=Ok,Rk=Array.prototype,Mk=r((function(e){var t=e.sort;return e===Rk||Pk(Rk,e)&&t===Rk.sort?Dk:t})),Uk=Lr,Ik=Date,Bk=c(Ik.prototype.getTime);Uk({target:"Date",stat:!0},{now:function(){return Bk(new Ik)}});var jk,Fk=r(re.Date.now),Nk="undefined"!=typeof window&&window.location&&xm(jk=window.location.href).call(jk,"xgplayerdebugger=1")>-1,zk="color: #525252; background-color: #90ee90;",Vk="color: #525252; background-color: red;",Gk="color: #525252; background-color: yellow; ",Hk="%c[xgplayer]",qk={config:{debug:Nk?3:0},logInfo:function(e){for(var t,r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];this.config.debug>=3&&(r=console).log.apply(r,Xn(t=[Hk,zk,e]).call(t,i))},logWarn:function(e){for(var t,r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];this.config.debug>=1&&(r=console).warn.apply(r,Xn(t=[Hk,Gk,e]).call(t,i))},logError:function(e){var t,r;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];(r=console)[n].apply(r,Xn(t=[Hk,Vk,e]).call(t,a))}}},Kk=function(){function e(t){Eb(this,e),this.bufferedList=t}return Ab(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),Wk={};Wk.createDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=document.createElement(t);return a.className=i,a.innerHTML=r,sf(e=Dl(n)).call(e,(function(e){var r=e,i=n[e];"video"===t||"audio"===t||"live-video"===t?i&&a.setAttribute(r,i):a.setAttribute(r,i)})),a},Wk.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var i=n.children;if(n=null,i.length>0){var a;if(i=i[0],r&&Wk.addClass(i,r),t)sf(a=Dl(t)).call(a,(function(e){i.setAttribute(e,t[e])}));return i}return null}catch(o){return qk.logError("util.createDomFromHtml",o),null}},Wk.hasClass=function(e,t){if(!e||!t)return!1;try{return Fb(Array.prototype).call(e.classList,(function(e){return e===t}))}catch(n){var r=e.className&&"object"===xb(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Wk.addClass=function(e,t){if(e&&t)try{var r;sf(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.add(t)}))}catch(n){Wk.hasClass(e,t)||(e.className&&"object"===xb(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Wk.removeClass=function(e,t){if(e&&t)try{var r;sf(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.remove(t)}))}catch(i){var n;if(Wk.hasClass(e,t))sf(n=t.split(/\s+/g)).call(n,(function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===xb(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")}))}},Wk.toggleClass=function(e,t){var r;e&&sf(r=t.split(/\s+/g)).call(r,(function(t){Wk.hasClass(e,t)?Wk.removeClass(e,t):Wk.addClass(e,t)}))},Wk.classNames=function(){for(var e=arguments,t=[],r=function(r){if("String"===Wk.typeOf(e[r]))t.push(e[r]);else if("Object"===Wk.typeOf(e[r])){var n;M_(n=Dl(e[r])).call(n,(function(n){e[r][n]&&t.push(n)}))}},n=0;n<arguments.length;n++)r(n);return t.join(" ")},Wk.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(r)}catch(n){qk.logError("util.findDom",n),0===xm(r).call(r,"#")&&(e=t.getElementById(my(r).call(r,1)))}return e},Wk.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Wk.padStart=function(e,t,r){for(var n=String(r),i=t>>0,a=Math.ceil(i/n.length),o=[],s=String(e);a--;)o.push(n);return o.join("").substring(0,i-s.length)+s},Wk.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=ow(Wk).call(Wk,Math.floor(e/3600),2,0),r=ow(Wk).call(Wk,Math.floor((e-3600*t)/60),2,0),n=ow(Wk).call(Wk,Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},Wk.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},Wk.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Wk.deepCopy=function(e,t){var r;if("Object"===Wk.typeOf(t)&&"Object"===Wk.typeOf(e))return sf(r=Dl(t)).call(r,(function(r){if("Object"!==Wk.typeOf(t[r])||t[r]instanceof Node)if("Array"===Wk.typeOf(t[r])){var n;e[r]="Array"===Wk.typeOf(e[r])?Xn(n=e[r]).call(n,t[r]):t[r]}else e[r]=t[r];else void 0===e[r]||void 0===e[r]?e[r]=t[r]:Wk.deepCopy(e[r],t[r])})),e},Wk.deepMerge=function(e,t){var r;return M_(r=Dl(t)).call(r,(function(r){var n;"Array"===Wk.typeOf(t[r])&&"Array"===Wk.typeOf(e[r])?"Array"===Wk.typeOf(e[r])&&(n=e[r]).push.apply(n,Cb(t[r])):Wk.typeOf(e[r])!==Wk.typeOf(t[r])||null===e[r]||"Object"!==Wk.typeOf(e[r])||t[r]instanceof window.Node?null!==t[r]&&(e[r]=t[r]):Wk.deepMerge(e[r],t[r])})),e},Wk.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},Wk.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return sf(Array.prototype).call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},Wk.setInterval=function(e,t,r,n){e._interval[t]||(e._interval[t]=xw(Iy(r).call(r,e),n))},Wk.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Wk.setTimeout=function(e,t,r){e._timers||(e._timers=[]);var n=Ew((function(){t(),Wk.clearTimeout(e,n)}),r);return e._timers.push(n),n},Wk.clearTimeout=function(e,t){var r=e._timers;if("Array"===Wk.typeOf(r)){for(var n=0;n<r.length;n++)if(r[n]===t){a_(r).call(r,n,1),clearTimeout(t);break}}else clearTimeout(t)},Wk.clearAllTimers=function(e){var t=e._timers;"Array"===Wk.typeOf(t)&&(M_(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},Wk.createImgBtn=function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,g=Wk.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(g.style.backgroundImage='url("'.concat(t,'")'),r&&n)&&(Pw(i=["px","rem","em","pt","dp","vw","vh","vm","%"]).call(i,(function(e){var t,i;return!(xm(r).call(r,e)>-1&&xm(n).call(n,e)>-1)||(l=Vw(Xw(t=my(r).call(r,0,xm(r).call(r,e))).call(t)),f=Vw(Xw(i=my(n).call(n,0,xm(n).call(n,e))).call(i)),h=e,!1)})),g.style.width=Xn(a="".concat(l)).call(a,h),g.style.height=Xn(o="".concat(f)).call(o,h),g.style.backgroundSize=Xn(s=Xn(u=Xn(c="".concat(l)).call(c,h," ")).call(u,f)).call(s,h),g.style.margin="start"===e?Xn(d=Xn(p=Xn(v="-".concat(f/2)).call(v,h," auto auto -")).call(p,l/2)).call(d,h):"auto 5px auto 5px");return g},Wk.Hex2RGBA=function(e,t){var r,n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(L_(e,16))})),Xn(r="rgba(".concat(n.join(","),", ")).call(r,t,")")):"rgba(255, 255, 255, 0.1)"},Wk.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Wk.checkIsFunction=function(e){return e&&"function"==typeof e},Wk.checkIsObject=function(e){return null!==e&&"object"===xb(e)},Wk.hide=function(e){e.style.display="none"},Wk.show=function(e,t){e.style.display=t||"block"},Wk.isUndefined=function(e){if(null==e)return!0},Wk.isNotNull=function(e){return!(null==e)},Wk.setStyleFromCsstext=function(e,t){if(t)if("String"===Wk.typeOf(t)){var r=t.replace(/\s+/g,"").split(";");M_(r).call(r,(function(t){if(t){var r=t.split(":");r.length>1&&(e.style[r[0]]=r[1])}}))}else{var n;M_(n=Dl(t)).call(n,(function(r){e.style[r]=t[r]}))}},Wk.filterStyleFromText=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),a={},o={};return M_(i).call(i,(function(e){if(e){var t=e.split(":");t.length>1&&(!function(e,t){for(var r=0,n=t.length;r<n;r++)if(xm(e).call(e,t[r])>-1)return!0;return!1}(t[0],r)?o[t[0]]=t[1]:a[t[0]]=t[1])}})),e.setAttribute("style",""),M_(t=Dl(o)).call(t,(function(t){e.style[t]=o[t]})),a},Wk.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var r=t.replace(/\s+/g,"").split(";"),n={};return M_(r).call(r,(function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},Wk.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,r&&r(e)},n.src=e}},Wk.stopPropagation=function(e){e&&e.stopPropagation()},Wk.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Wk.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Wk.checkTouchSupport=function(){return"ontouchstart"in window},Wk.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],n=0;n<e.length;n++)r.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});Mk(r).call(r,(function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var i=[];if(t)for(var a=0;a<r.length;a++){var o=i.length;if(o){var s=i[o-1].end;r[a].start-s<t?r[a].end>s&&(i[o-1].end=r[a].end):i.push(r[a])}else i.push(r[a])}else i=r;return new Kk(i)},Wk.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},Wk.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Wk.getHostFromUrl=function(e){if("String"!==Wk.typeOf(e))return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r},Wk.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Wk.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Wk.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Wk.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=L_(e)}catch(r){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=L_(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},Wk.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Wk.adjustTimeByDuration=function(e,t,r){return t&&e&&(e>t||r&&e<t)?t:e},Wk.createPositionBar=function(e,t){var r=Wk.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(r),r},Wk.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(t.scale||1),translate:Xn(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")},i=Dl(n);return sf(i).call(i,(function(e){var t,i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),a=Xn(t="".concat(e,"(")).call(t,n[e],")");i.test(r)?(i.lastIndex=-1,r=r.replace(i,a)):r+="".concat(a," ")})),r},Wk.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},Wk.getIndexByTime=function(e,t){var r=t.length,n=-1;if(r<1)return n;if(e<=t[0].end||r<2)n=0;else if(e>t[r-1].end)n=r-1;else for(var i=1;i<r;i++)if(e>t[i-1].end&&e<=t[i].end){n=i;break}return n},Wk.getOffsetCurrentTime=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=r>=0&&r<t.length?r:Wk.getIndexByTime(e,t))<0)return-1;var i=t.length,a=t[n],o=a.start,s=a.end,u=a.cTime,c=a.offset;return e<o?u:e>=o&&e<=s?e-c:e>s&&n>=i-1?s:-1},Wk.getCurrentTimeByOffset=function(e,t){var r=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){r=n;break}if(-1!==r){var i=t[r].start;return r-1<0?i+e:i+(e-t[r-1].duration)}return e};var Yk="3.0.21-rc.3",Jk={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Qk=Ab((function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};Eb(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var i,a=r.mediaError?r.mediaError:t.media.error||{},o=t.duration,s=t.currentTime,u=t.ended,c=t.src,l=t.currentSrc,f=t.media,h=f.readyState,d=f.networkState,p=r.errorCode||a.code;Jk[p]&&(p=Jk[p]);var v={playerVersion:Yk,currentTime:s,duration:o,ended:u,readyState:h,networkState:d,src:c||l,errorType:r.errorType,errorCode:p,message:r.errorMessage||a.message,mediaError:a,originError:r.originError?r.originError.stack:"",host:Wk.getHostFromUrl(c||l)};return r.ext&&M_(i=Dl(r.ext)).call(i,(function(e){v[e]=r.ext[e]})),v}if(arguments.length>1){for(var g={playerVersion:Yk,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],m=0;m<arguments.length;m++)g[y[m]]=arguments[m];return g.ex=n?(n[arguments[0]]||{}).msg:"",g}}));function Xk(e,t,r){for(var n,i=arguments.length,a=new Array(i>3?i-3:0),o=3;o<i;o++)a[o-3]=arguments[o];var s,u=t.call.apply(t,Xn(n=[e]).call(n,a));r&&"function"==typeof r&&(u&&u.then?u.then((function(){for(var t,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];r.call.apply(r,Xn(t=[e]).call(t,i))})):r.call.apply(r,Xn(s=[e]).call(s,a)))}function $k(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),Iy(r=function(){var r,i=arguments,a=this;if(n.pre)try{var o,s;(s=n.pre).call.apply(s,Xn(o=[this]).call(o,my(Array.prototype).call(arguments)))}catch(v){var u,c;throw v.message=Xn(u=Xn(c="[pluginName: ".concat(this.pluginName,":")).call(c,e,":pre error] >> ")).call(u,v.message),v}if(this.__hooks&&this.__hooks[e])try{var l,f=function(e,t,r){for(var n=arguments.length,i=new Array(n>3?n-3:0),a=3;a<n;a++)i[a-3]=arguments[a];if(e.__hooks&&U_(e.__hooks[t])){var o,s=e.__hooks[t],u=-1,c=function e(t,r,n){for(var i,a,o=arguments.length,c=new Array(o>3?o-3:0),l=3;l<o;l++)c[l-3]=arguments[l];if(u++,0===s.length||u===s.length)return n.call.apply(n,Xn(a=[t,t]).call(a,c));var f,h=s[u],d=h.call.apply(h,Xn(i=[t,t]).call(i,c));return d&&d.then?d.then((function(i){var a;return!1===i?null:e.apply(void 0,Xn(a=[t,r,n]).call(a,c))})).catch((function(e){console.warn("[runHooks]".concat(r," reject"),e.message)})):!1!==d?e.apply(void 0,Xn(f=[t,r,n]).call(f,c)):void 0};return c.apply(void 0,Xn(o=[e,t,r]).call(o,i))}var l;return r.call.apply(r,Xn(l=[e,e]).call(l,i))}(this,e,t);if(f)if(f.then)f.then((function(e){var r;!1!==e&&Xk.apply(void 0,Xn(r=[a,t,n.next]).call(r,Cb(i)))})).catch((function(e){throw e}));else Xk.apply(void 0,Xn(l=[this,t,n.next]).call(l,my(Array.prototype).call(arguments)));else if(void 0===f){var h;Xk.apply(void 0,Xn(h=[this,t,n.next]).call(h,my(Array.prototype).call(arguments)))}}catch(v){var d,p;throw v.message=Xn(d=Xn(p="[pluginName: ".concat(this.pluginName,":")).call(p,e,"] >> ")).call(d,v.message),v}else Xk.apply(void 0,Xn(r=[this,t,n.next]).call(r,my(Array.prototype).call(arguments)))}).call(r,this)}function Zk(e,t){var r=this.__hooks;if(!r||!U_(r[e]))return-1;for(var n=r[e],i=0;i<n.length;i++)if(n[i]===t)return i;return-1}function eS(e,t){var r=this.__hooks;if(r)return r.hasOwnProperty(e)?(U_(r[e])||(r[e]=[]),-1===Zk.call(this,e,t)&&r[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function tS(e,t){var r=this.__hooks;if(r){if(U_(r[e])){var n=r[e],i=Zk.call(this,e,t);-1!==i&&a_(n).call(n,i,1)}delete r[e]}}function rS(e,t){var r;qk.logError(Xn(r="[".concat(e,"] event or callback cant be undefined or null when call ")).call(r,t))}var nS=function(){function e(t){Eb(this,e),Wk.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&M_(t).call(t,(function(t){e.__hooks[t]=null})),Df(e,"hooks",{get:function(){var t;return e.__hooks&&M_(t=Dl(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return Ab(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=Wk.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):U_(e)&&sf(e).call(e,(function(e){r.__events[e]=t,r.player.on(e,t)})):rS(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):U_(e)&&sf(e).call(e,(function(n){r.__onceEvents[n]=t,r.player.once(e,t)})):rS(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):U_(e)&&sf(e).call(e,(function(n){delete r.__events[e],r.player.off(n,t)})):rS(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e,t=this;sf(e=["__events","__onceEvents"]).call(e,(function(e){var r;sf(r=Dl(t[e])).call(r,(function(r){t[e][r]&&t.off(r,t[e][r]),r&&delete t[e][r]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t,r;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(r=this.player).emit.apply(r,Xn(t=[e]).call(t,i))}}},{key:"emitUserAction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=Sb(Sb({},r),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){var r;return $k.call.apply($k,Xn(r=[this]).call(r,my(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var r,n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return eS.call.apply(eS,Xn(r=[this]).call(r,my(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var r,n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return tS.call.apply(tS,Xn(r=[this]).call(r,my(Array.prototype).call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return r&&(t.pluginName=r),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e,t=this,r=this.player,n=this.pluginName;this.offAll(),Wk.clearAllTimers(this),Wk.checkIsFunction(this.destroy)&&this.destroy(),M_(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),r.unRegisterPlugin(n),this.__hooks=null}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&Df(e,r,t[r])}},{key:"defineMethod",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&"function"==typeof t[r]&&Df(e,r,{configurable:!0,value:t[r]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),iS=Lr,aS=oo.findIndex,oS="findIndex",sS=!0;oS in[]&&Array(1)[oS]((function(){sS=!1})),iS({target:"Array",proto:!0,forced:sS},{findIndex:function(e){return aS(this,e,arguments.length>1?arguments[1]:void 0)}});var uS=Kn("Array").findIndex,cS=l,lS=uS,fS=Array.prototype,hS=r((function(e){var t=e.findIndex;return e===fS||cS(fS,e)&&t===fS.findIndex?lS:t})),dS=n,pS=ht("iterator"),vS=!dS((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!e.toJSON||!t.size&&true||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[pS]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),gS=c,yS=2147483647,mS=/[^\0-\u007E]/,_S=/[.\u3002\uFF0E\uFF61]/g,bS="Overflow: input needs wider integers to process",wS=RangeError,kS=gS(_S.exec),SS=Math.floor,xS=String.fromCharCode,ES=gS("".charCodeAt),TS=gS([].join),AS=gS([].push),LS=gS("".replace),CS=gS("".split),OS=gS("".toLowerCase),PS=function(e){return e+22+75*(e<26)},DS=function(e,t,r){var n=0;for(e=r?SS(e/700):e>>1,e+=SS(e/t);e>455;)e=SS(e/35),n+=36;return SS(n+36*e/(e+38))},RS=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=ES(e,r++);if(i>=55296&&i<=56319&&r<n){var a=ES(e,r++);56320==(64512&a)?AS(t,((1023&i)<<10)+(1023&a)+65536):(AS(t,i),r--)}else AS(t,i)}return t}(e);var r,n,i=e.length,a=128,o=0,s=72;for(r=0;r<e.length;r++)(n=e[r])<128&&AS(t,xS(n));var u=t.length,c=u;for(u&&AS(t,"-");c<i;){var l=yS;for(r=0;r<e.length;r++)(n=e[r])>=a&&n<l&&(l=n);var f=c+1;if(l-a>SS((yS-o)/f))throw wS(bS);for(o+=(l-a)*f,a=l,r=0;r<e.length;r++){if((n=e[r])<a&&++o>yS)throw wS(bS);if(n==a){for(var h=o,d=36;;){var p=d<=s?1:d>=s+26?26:d-s;if(h<p)break;var v=h-p,g=36-p;AS(t,xS(PS(p+v%g))),h=SS(v/g),d+=36}AS(t,xS(PS(h))),s=DS(o,f,c==u),o=0,c++}}o++,a++}return TS(t,"")},MS=la,US=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:MS(e,n,t[n],r);return e},IS=Lr,BS=h,jS=R,FS=c,NS=O,zS=vS,VS=la,GS=ha,HS=US,qS=Ia,KS=Ju,WS=$a,YS=vd,JS=L,QS=$e,XS=Qt,$S=en,ZS=rr,ex=te,tx=ei,rx=Ki,nx=N,ix=bh,ax=dh,ox=Td,sx=nk,ux=ht("iterator"),cx="URLSearchParams",lx=cx+"Iterator",fx=WS.set,hx=WS.getterFor(cx),dx=WS.getterFor(lx),px=Object.getOwnPropertyDescriptor,vx=function(e){if(!NS)return BS[e];var t=px(BS,e);return t&&t.value},gx=vx("fetch"),yx=vx("Request"),mx=vx("Headers"),_x=yx&&yx.prototype,bx=mx&&mx.prototype,wx=BS.RegExp,kx=BS.TypeError,Sx=BS.decodeURIComponent,xx=BS.encodeURIComponent,Ex=FS("".charAt),Tx=FS([].join),Ax=FS([].push),Lx=FS("".replace),Cx=FS([].shift),Ox=FS([].splice),Px=FS("".split),Dx=FS("".slice),Rx=/\+/g,Mx=Array(4),Ux=function(e){return Mx[e-1]||(Mx[e-1]=wx("((?:%[\\da-f]{2}){"+e+"})","gi"))},Ix=function(e){try{return Sx(e)}catch(gB){return e}},Bx=function(e){var t=Lx(e,Rx," "),r=4;try{return Sx(t)}catch(gB){for(;r;)t=Lx(t,Ux(r--),Ix);return t}},jx=/[!'()~]|%20/g,Fx={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Nx=function(e){return Fx[e]},zx=function(e){return Lx(xx(e),jx,Nx)},Vx=KS((function(e,t){fx(this,{type:lx,iterator:ix(hx(e).entries),kind:t})}),"Iterator",(function(){var e=dx(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),Gx=function(e){this.entries=[],this.url=null,void 0!==e&&(ex(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Ex(e,0)?Dx(e,1):e:tx(e)))};Gx.prototype={type:cx,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,a,o,s,u=ax(e);if(u)for(r=(t=ix(e,u)).next;!(n=jS(r,t)).done;){if(a=(i=ix(ZS(n.value))).next,(o=jS(a,i)).done||(s=jS(a,i)).done||!jS(a,i).done)throw kx("Expected sequence with length 2");Ax(this.entries,{key:tx(o.value),value:tx(s.value)})}else for(var c in e)QS(e,c)&&Ax(this.entries,{key:c,value:tx(e[c])})},parseQuery:function(e){if(e)for(var t,r,n=Px(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=Px(t,"="),Ax(this.entries,{key:Bx(Cx(r)),value:Bx(Tx(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],Ax(r,zx(e.key)+"="+zx(e.value));return Tx(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Hx=function(){YS(this,qx);var e=fx(this,new Gx(arguments.length>0?arguments[0]:void 0));NS||(this.length=e.entries.length)},qx=Hx.prototype;if(HS(qx,{append:function(e,t){ox(arguments.length,2);var r=hx(this);Ax(r.entries,{key:tx(e),value:tx(t)}),NS||this.length++,r.updateURL()},delete:function(e){ox(arguments.length,1);for(var t=hx(this),r=t.entries,n=tx(e),i=0;i<r.length;)r[i].key===n?Ox(r,i,1):i++;NS||(this.length=r.length),t.updateURL()},get:function(e){ox(arguments.length,1);for(var t=hx(this).entries,r=tx(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){ox(arguments.length,1);for(var t=hx(this).entries,r=tx(e),n=[],i=0;i<t.length;i++)t[i].key===r&&Ax(n,t[i].value);return n},has:function(e){ox(arguments.length,1);for(var t=hx(this).entries,r=tx(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){ox(arguments.length,1);for(var r,n=hx(this),i=n.entries,a=!1,o=tx(e),s=tx(t),u=0;u<i.length;u++)(r=i[u]).key===o&&(a?Ox(i,u--,1):(a=!0,r.value=s));a||Ax(i,{key:o,value:s}),NS||(this.length=i.length),n.updateURL()},sort:function(){var e=hx(this);sx(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=hx(this).entries,n=XS(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new Vx(this,"keys")},values:function(){return new Vx(this,"values")},entries:function(){return new Vx(this,"entries")}},{enumerable:!0}),VS(qx,ux,qx.entries,{name:"entries"}),VS(qx,"toString",(function(){return hx(this).serialize()}),{enumerable:!0}),NS&&GS(qx,"size",{get:function(){return hx(this).entries.length},configurable:!0,enumerable:!0}),qS(Hx,cx),IS({global:!0,constructor:!0,forced:!zS},{URLSearchParams:Hx}),!zS&&JS(mx)){var Kx=FS(bx.has),Wx=FS(bx.set),Yx=function(e){if(ex(e)){var t,r=e.body;if($S(r)===cx)return t=e.headers?new mx(e.headers):new mx,Kx(t,"content-type")||Wx(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),rx(e,{body:nx(0,tx(r)),headers:nx(0,t)})}return e};if(JS(gx)&&IS({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return gx(e,arguments.length>1?Yx(arguments[1]):{})}}),JS(yx)){var Jx=function(e){return YS(this,_x),new yx(e,arguments.length>1?Yx(arguments[1]):{})};_x.constructor=Jx,Jx.prototype=_x,IS({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Jx})}}var Qx,Xx=Lr,$x=O,Zx=vS,eE=h,tE=Qt,rE=c,nE=la,iE=ha,aE=vd,oE=$e,sE=Y_,uE=_b,cE=ra,lE=ml.codeAt,fE=function(e){var t,r,n=[],i=CS(LS(OS(e),_S,"."),".");for(t=0;t<i.length;t++)r=i[t],AS(n,kS(mS,r)?"xn--"+RS(r):r);return TS(n,".")},hE=ei,dE=Ia,pE=Td,vE={URLSearchParams:Hx,getState:hx},gE=$a,yE=gE.set,mE=gE.getterFor("URL"),_E=vE.URLSearchParams,bE=vE.getState,wE=eE.URL,kE=eE.TypeError,SE=eE.parseInt,xE=Math.floor,EE=Math.pow,TE=rE("".charAt),AE=rE(/./.exec),LE=rE([].join),CE=rE(1..toString),OE=rE([].pop),PE=rE([].push),DE=rE("".replace),RE=rE([].shift),ME=rE("".split),UE=rE("".slice),IE=rE("".toLowerCase),BE=rE([].unshift),jE="Invalid scheme",FE="Invalid host",NE="Invalid port",zE=/[a-z]/i,VE=/[\d+-.a-z]/i,GE=/\d/,HE=/^0x/i,qE=/^[0-7]+$/,KE=/^\d+$/,WE=/^[\da-f]+$/i,YE=/[\0\t\n\r #%/:<>?@[\\\]^|]/,JE=/[\0\t\n\r #/:<>?@[\\\]^|]/,QE=/^[\u0000-\u0020]+/,XE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,$E=/[\t\n\r]/g,ZE=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)BE(t,e%256),e=xE(e/256);return LE(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,a=0;a<8;a++)0!==e[a]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=CE(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},eT={},tT=sE({},eT,{" ":1,'"':1,"<":1,">":1,"`":1}),rT=sE({},tT,{"#":1,"?":1,"{":1,"}":1}),nT=sE({},rT,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),iT=function(e,t){var r=lE(e,0);return r>32&&r<127&&!oE(t,e)?e:encodeURIComponent(e)},aT={ftp:21,file:null,http:80,https:443,ws:80,wss:443},oT=function(e,t){var r;return 2==e.length&&AE(zE,TE(e,0))&&(":"==(r=TE(e,1))||!t&&"|"==r)},sT=function(e){var t;return e.length>1&&oT(UE(e,0,2))&&(2==e.length||"/"===(t=TE(e,2))||"\\"===t||"?"===t||"#"===t)},uT=function(e){return"."===e||"%2e"===IE(e)},cT={},lT={},fT={},hT={},dT={},pT={},vT={},gT={},yT={},mT={},_T={},bT={},wT={},kT={},ST={},xT={},ET={},TT={},AT={},LT={},CT={},OT=function(e,t,r){var n,i,a,o=hE(e);if(t){if(i=this.parse(o))throw kE(i);this.searchParams=null}else{if(void 0!==r&&(n=new OT(r,!0)),i=this.parse(o,null,n))throw kE(i);(a=bE(new _E)).bindURL(this),this.searchParams=a}};OT.prototype={type:"URL",parse:function(e,t,r){var n,i,a,o,s,u=this,c=t||cT,l=0,f="",h=!1,d=!1,p=!1;for(e=hE(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=DE(e,QE,""),e=DE(e,XE,"$1")),e=DE(e,$E,""),n=uE(e);l<=n.length;){switch(i=n[l],c){case cT:if(!i||!AE(zE,i)){if(t)return jE;c=fT;continue}f+=IE(i),c=lT;break;case lT:if(i&&(AE(VE,i)||"+"==i||"-"==i||"."==i))f+=IE(i);else{if(":"!=i){if(t)return jE;f="",c=fT,l=0;continue}if(t&&(u.isSpecial()!=oE(aT,f)||"file"==f&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=f,t)return void(u.isSpecial()&&aT[u.scheme]==u.port&&(u.port=null));f="","file"==u.scheme?c=kT:u.isSpecial()&&r&&r.scheme==u.scheme?c=hT:u.isSpecial()?c=gT:"/"==n[l+1]?(c=dT,l++):(u.cannotBeABaseURL=!0,PE(u.path,""),c=AT)}break;case fT:if(!r||r.cannotBeABaseURL&&"#"!=i)return jE;if(r.cannotBeABaseURL&&"#"==i){u.scheme=r.scheme,u.path=cE(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,c=CT;break}c="file"==r.scheme?kT:pT;continue;case hT:if("/"!=i||"/"!=n[l+1]){c=pT;continue}c=yT,l++;break;case dT:if("/"==i){c=mT;break}c=TT;continue;case pT:if(u.scheme=r.scheme,i==Qx)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=cE(r.path),u.query=r.query;else if("/"==i||"\\"==i&&u.isSpecial())c=vT;else if("?"==i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=cE(r.path),u.query="",c=LT;else{if("#"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=cE(r.path),u.path.length--,c=TT;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=cE(r.path),u.query=r.query,u.fragment="",c=CT}break;case vT:if(!u.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,c=TT;continue}c=mT}else c=yT;break;case gT:if(c=yT,"/"!=i||"/"!=TE(f,l+1))continue;l++;break;case yT:if("/"!=i&&"\\"!=i){c=mT;continue}break;case mT:if("@"==i){h&&(f="%40"+f),h=!0,a=uE(f);for(var v=0;v<a.length;v++){var g=a[v];if(":"!=g||p){var y=iT(g,nT);p?u.password+=y:u.username+=y}else p=!0}f=""}else if(i==Qx||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(h&&""==f)return"Invalid authority";l-=uE(f).length+1,f="",c=_T}else f+=i;break;case _T:case bT:if(t&&"file"==u.scheme){c=xT;continue}if(":"!=i||d){if(i==Qx||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(u.isSpecial()&&""==f)return FE;if(t&&""==f&&(u.includesCredentials()||null!==u.port))return;if(o=u.parseHost(f))return o;if(f="",c=ET,t)return;continue}"["==i?d=!0:"]"==i&&(d=!1),f+=i}else{if(""==f)return FE;if(o=u.parseHost(f))return o;if(f="",c=wT,t==bT)return}break;case wT:if(!AE(GE,i)){if(i==Qx||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()||t){if(""!=f){var m=SE(f,10);if(m>65535)return NE;u.port=u.isSpecial()&&m===aT[u.scheme]?null:m,f=""}if(t)return;c=ET;continue}return NE}f+=i;break;case kT:if(u.scheme="file","/"==i||"\\"==i)c=ST;else{if(!r||"file"!=r.scheme){c=TT;continue}if(i==Qx)u.host=r.host,u.path=cE(r.path),u.query=r.query;else if("?"==i)u.host=r.host,u.path=cE(r.path),u.query="",c=LT;else{if("#"!=i){sT(LE(cE(n,l),""))||(u.host=r.host,u.path=cE(r.path),u.shortenPath()),c=TT;continue}u.host=r.host,u.path=cE(r.path),u.query=r.query,u.fragment="",c=CT}}break;case ST:if("/"==i||"\\"==i){c=xT;break}r&&"file"==r.scheme&&!sT(LE(cE(n,l),""))&&(oT(r.path[0],!0)?PE(u.path,r.path[0]):u.host=r.host),c=TT;continue;case xT:if(i==Qx||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&oT(f))c=TT;else if(""==f){if(u.host="",t)return;c=ET}else{if(o=u.parseHost(f))return o;if("localhost"==u.host&&(u.host=""),t)return;f="",c=ET}continue}f+=i;break;case ET:if(u.isSpecial()){if(c=TT,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=Qx&&(c=TT,"/"!=i))continue}else u.fragment="",c=CT;else u.query="",c=LT;break;case TT:if(i==Qx||"/"==i||"\\"==i&&u.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=IE(s=f))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(u.shortenPath(),"/"==i||"\\"==i&&u.isSpecial()||PE(u.path,"")):uT(f)?"/"==i||"\\"==i&&u.isSpecial()||PE(u.path,""):("file"==u.scheme&&!u.path.length&&oT(f)&&(u.host&&(u.host=""),f=TE(f,0)+":"),PE(u.path,f)),f="","file"==u.scheme&&(i==Qx||"?"==i||"#"==i))for(;u.path.length>1&&""===u.path[0];)RE(u.path);"?"==i?(u.query="",c=LT):"#"==i&&(u.fragment="",c=CT)}else f+=iT(i,rT);break;case AT:"?"==i?(u.query="",c=LT):"#"==i?(u.fragment="",c=CT):i!=Qx&&(u.path[0]+=iT(i,eT));break;case LT:t||"#"!=i?i!=Qx&&("'"==i&&u.isSpecial()?u.query+="%27":u.query+="#"==i?"%23":iT(i,eT)):(u.fragment="",c=CT);break;case CT:i!=Qx&&(u.fragment+=iT(i,tT))}l++}},parseHost:function(e){var t,r,n;if("["==TE(e,0)){if("]"!=TE(e,e.length-1))return FE;if(t=function(e){var t,r,n,i,a,o,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,f=0,h=function(){return TE(e,f)};if(":"==h()){if(":"!=TE(e,1))return;f+=2,l=++c}for(;h();){if(8==c)return;if(":"!=h()){for(t=r=0;r<4&&AE(WE,h());)t=16*t+SE(h(),16),f++,r++;if("."==h()){if(0==r)return;if(f-=r,c>6)return;for(n=0;h();){if(i=null,n>0){if(!("."==h()&&n<4))return;f++}if(!AE(GE,h()))return;for(;AE(GE,h());){if(a=SE(h(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}u[c]=256*u[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;u[c++]=t}else{if(null!==l)return;f++,l=++c}}if(null!==l)for(o=c-l,c=7;0!=c&&o>0;)s=u[c],u[c--]=u[l+o-1],u[l+--o]=s;else if(8!=c)return;return u}(UE(e,1,-1)),!t)return FE;this.host=t}else if(this.isSpecial()){if(e=fE(e),AE(YE,e))return FE;if(t=function(e){var t,r,n,i,a,o,s,u=ME(e,".");if(u.length&&""==u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=u[n]))return e;if(a=10,i.length>1&&"0"==TE(i,0)&&(a=AE(HE,i)?16:8,i=UE(i,8==a?1:2)),""===i)o=0;else{if(!AE(10==a?KE:8==a?qE:WE,i))return e;o=SE(i,a)}PE(r,o)}for(n=0;n<t;n++)if(o=r[n],n==t-1){if(o>=EE(256,5-t))return null}else if(o>255)return null;for(s=OE(r),n=0;n<r.length;n++)s+=r[n]*EE(256,3-n);return s}(e),null===t)return FE;this.host=t}else{if(AE(JE,e))return FE;for(t="",r=uE(e),n=0;n<r.length;n++)t+=iT(r[n],eT);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return oE(aT,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&oT(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,a=e.port,o=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=ZE(i),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+LE(o,"/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},setHref:function(e){var t=this.parse(e);if(t)throw kE(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new PT(e.path[0]).origin}catch(gB){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+ZE(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(hE(e)+":",cT)},getUsername:function(){return this.username},setUsername:function(e){var t=uE(hE(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=iT(t[r],nT)}},getPassword:function(){return this.password},setPassword:function(e){var t=uE(hE(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=iT(t[r],nT)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ZE(e):ZE(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,_T)},getHostname:function(){var e=this.host;return null===e?"":ZE(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,bT)},getPort:function(){var e=this.port;return null===e?"":hE(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=hE(e))?this.port=null:this.parse(e,wT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+LE(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,ET))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=hE(e))?this.query=null:("?"==TE(e,0)&&(e=UE(e,1)),this.query="",this.parse(e,LT)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=hE(e))?("#"==TE(e,0)&&(e=UE(e,1)),this.fragment="",this.parse(e,CT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var PT=function(e){var t=aE(this,DT),r=pE(arguments.length,1)>1?arguments[1]:void 0,n=yE(t,new OT(e,!1,r));$x||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},DT=PT.prototype,RT=function(e,t){return{get:function(){return mE(this)[e]()},set:t&&function(e){return mE(this)[t](e)},configurable:!0,enumerable:!0}};if($x&&(iE(DT,"href",RT("serialize","setHref")),iE(DT,"origin",RT("getOrigin")),iE(DT,"protocol",RT("getProtocol","setProtocol")),iE(DT,"username",RT("getUsername","setUsername")),iE(DT,"password",RT("getPassword","setPassword")),iE(DT,"host",RT("getHost","setHost")),iE(DT,"hostname",RT("getHostname","setHostname")),iE(DT,"port",RT("getPort","setPort")),iE(DT,"pathname",RT("getPathname","setPathname")),iE(DT,"search",RT("getSearch","setSearch")),iE(DT,"searchParams",RT("getSearchParams")),iE(DT,"hash",RT("getHash","setHash"))),nE(DT,"toJSON",(function(){return mE(this).serialize()}),{enumerable:!0}),nE(DT,"toString",(function(){return mE(this).serialize()}),{enumerable:!0}),wE){var MT=wE.createObjectURL,UT=wE.revokeObjectURL;MT&&nE(PT,"createObjectURL",tE(MT,wE)),UT&&nE(PT,"revokeObjectURL",tE(UT,wE))}dE(PT,"URL"),Xx({global:!0,constructor:!0,forced:!Zx,sham:!$x},{URL:PT});var IT=Lr,BT=n,jT=Td,FT=ei,NT=vS,zT=se("URL");IT({target:"URL",stat:!0,forced:!(NT&&BT((function(){zT.canParse()})))},{canParse:function(e){var t=jT(arguments.length,1),r=FT(e),n=t<2||void 0===arguments[1]?void 0:FT(arguments[1]);try{return!!new zT(r,n)}catch(gB){return!1}}});var VT=r(re.URL),GT=re,HT=y;GT.JSON||(GT.JSON={stringify:JSON.stringify});var qT=function(e,t,r){return HT(GT.JSON.stringify,null,arguments)},KT=r(qT),WT=te,YT=w,JT=ht("match"),QT=function(e){var t;return WT(e)&&(void 0!==(t=e[JT])?!!t:"RegExp"==YT(e))},XT=TypeError,$T=ht("match"),ZT=li.includes;Lr({target:"Array",proto:!0,forced:n((function(){return!Array(1).includes()}))},{includes:function(e){return ZT(this,e,arguments.length>1?arguments[1]:void 0)}});var eA=Kn("Array").includes,tA=Lr,rA=function(e){if(QT(e))throw XT("The method doesn't accept regular expressions");return e},nA=J,iA=ei,aA=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[$T]=!1,"/./"[e](t)}catch(n){}}return!1},oA=c("".indexOf);tA({target:"String",proto:!0,forced:!aA("includes")},{includes:function(e){return!!~oA(iA(nA(this)),iA(rA(e)),arguments.length>1?arguments[1]:void 0)}});var sA=Kn("String").includes,uA=l,cA=eA,lA=sA,fA=Array.prototype,hA=String.prototype,dA=r((function(e){var t=e.includes;return e===fA||uA(fA,e)&&t===fA.includes?cA:"string"==typeof e||e===hA||uA(hA,e)&&t===hA.includes?lA:t})),pA={exports:{}},vA=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),gA=n,yA=te,mA=w,_A=vA,bA=Object.isExtensible,wA=gA((function(){bA(1)}))||_A?function(e){return!!yA(e)&&((!_A||"ArrayBuffer"!=mA(e))&&(!bA||bA(e)))}:bA,kA=!n((function(){return Object.isExtensible(Object.preventExtensions({}))})),SA=Lr,xA=c,EA=fi,TA=te,AA=$e,LA=Xt.f,CA=Wi,OA=Qi,PA=wA,DA=kA,RA=!1,MA=nt("meta"),UA=0,IA=function(e){LA(e,MA,{value:{objectID:"O"+UA++,weakData:{}}})},BA=pA.exports={enable:function(){BA.enable=function(){},RA=!0;var e=CA.f,t=xA([].splice),r={};r[MA]=1,e(r).length&&(CA.f=function(r){for(var n=e(r),i=0,a=n.length;i<a;i++)if(n[i]===MA){t(n,i,1);break}return n},SA({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:OA.f}))},fastKey:function(e,t){if(!TA(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!AA(e,MA)){if(!PA(e))return"F";if(!t)return"E";IA(e)}return e[MA].objectID},getWeakData:function(e,t){if(!AA(e,MA)){if(!PA(e))return!0;if(!t)return!1;IA(e)}return e[MA].weakData},onFreeze:function(e){return DA&&RA&&PA(e)&&!AA(e,MA)&&IA(e),e}};EA[MA]=!0;var jA=pA.exports,FA=Lr,NA=h,zA=jA,VA=n,GA=gr,HA=jh,qA=vd,KA=L,WA=te,YA=Ia,JA=Xt.f,QA=oo.forEach,XA=O,$A=$a.set,ZA=$a.getterFor,eL=function(e,t,r){var n,i=-1!==e.indexOf("Map"),a=-1!==e.indexOf("Weak"),o=i?"set":"add",s=NA[e],u=s&&s.prototype,c={};if(XA&&KA(s)&&(a||u.forEach&&!VA((function(){(new s).entries().next()})))){var l=(n=t((function(t,r){$A(qA(t,l),{type:e,collection:new s}),null!=r&&HA(r,t[o],{that:t,AS_ENTRIES:i})}))).prototype,f=ZA(e);QA(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in u)||a&&"clear"==e||GA(l,e,(function(r,n){var i=f(this).collection;if(!t&&a&&!WA(r))return"get"==e&&void 0;var o=i[e](0===r?0:r,n);return t?this:o}))})),a||JA(l,"size",{configurable:!0,get:function(){return f(this).collection.size}})}else n=r.getConstructor(t,e,i,o),zA.enable();return YA(n,e,!1,!0),c[e]=n,FA({global:!0,forced:!0},c),a||r.setStrong(n,e,i),n},tL=Ki,rL=ha,nL=US,iL=Qt,aL=vd,oL=K,sL=jh,uL=wc,cL=kc,lL=hd,fL=O,hL=jA.fastKey,dL=$a.set,pL=$a.getterFor,vL={getConstructor:function(e,t,r,n){var i=e((function(e,i){aL(e,a),dL(e,{type:t,index:tL(null),first:void 0,last:void 0,size:0}),fL||(e.size=0),oL(i)||sL(i,e[n],{that:e,AS_ENTRIES:r})})),a=i.prototype,o=pL(t),s=function(e,t,r){var n,i,a=o(e),s=u(e,t);return s?s.value=r:(a.last=s={index:i=hL(t,!0),key:t,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=s),n&&(n.next=s),fL?a.size++:e.size++,"F"!==i&&(a.index[i]=s)),e},u=function(e,t){var r,n=o(e),i=hL(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return nL(a,{clear:function(){for(var e=o(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,fL?e.size=0:this.size=0},delete:function(e){var t=this,r=o(t),n=u(t,e);if(n){var i=n.next,a=n.previous;delete r.index[n.index],n.removed=!0,a&&(a.next=i),i&&(i.previous=a),r.first==n&&(r.first=i),r.last==n&&(r.last=a),fL?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=o(this),n=iL(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!!u(this,e)}}),nL(a,r?{get:function(e){var t=u(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)}}),fL&&rL(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=pL(t),a=pL(n);uL(e,t,(function(e,t){dL(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(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)?cL("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,cL(void 0,!0))}),r?"entries":"values",!r,!0),lL(t)}};eL("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),vL);var gL=re.Map,yL=Qt,mL=R,_L=Pe,bL=_d,wL=K,kL=jh,SL=[].push,xL=function(e){var t,r,n,i,a=arguments.length,o=a>1?arguments[1]:void 0;return bL(this),(t=void 0!==o)&&_L(o),wL(e)?new this:(r=[],t?(n=0,i=yL(o,a>2?arguments[2]:void 0),kL(e,(function(e){mL(SL,r,i(e,n++))}))):kL(e,SL,{that:r}),new this(r))};Lr({target:"Map",stat:!0,forced:!0},{from:xL});var EL=Ps,TL=function(){return new this(EL(arguments))};Lr({target:"Map",stat:!0,forced:!0},{of:TL});var AL=Ae,LL=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 TypeError(AL(e)+" is not a map")},CL=function(e,t){return 1==t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},OL=CL,PL=se("Map"),DL={Map:PL,set:OL("set",2),get:OL("get",1),has:OL("has",1),remove:OL("delete",1),proto:PL.prototype},RL=LL,ML=DL.remove;Lr({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=RL(this),r=!0,n=0,i=arguments.length;n<i;n++)e=ML(t,arguments[n]),r=r&&e;return!!r}});var UL=LL,IL=DL.get,BL=DL.has,jL=DL.set;Lr({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,i=UL(this);return BL(i,e)?(r=IL(i,e),"update"in t&&(r=t.update(r,e,i),jL(i,e,r)),r):(n=t.insert(e,i),jL(i,e,n),n)}});var FL=R,NL=function(e,t,r){for(var n,i,a=r||e.next;!(n=FL(a,e)).done;)if(void 0!==(i=t(n.value)))return i},zL=NL,VL=function(e,t,r){return r?zL(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},GL=Qt,HL=LL,qL=VL;Lr({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=HL(this),r=GL(e,arguments.length>1?arguments[1]:void 0);return!1!==qL(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var KL=Qt,WL=LL,YL=VL,JL=DL.Map,QL=DL.set;Lr({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=WL(this),r=KL(e,arguments.length>1?arguments[1]:void 0),n=new JL;return YL(t,(function(e,i){r(e,i,t)&&QL(n,i,e)})),n}});var XL=Qt,$L=LL,ZL=VL;Lr({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=$L(this),r=XL(e,arguments.length>1?arguments[1]:void 0),n=ZL(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var eC=Qt,tC=LL,rC=VL;Lr({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=tC(this),r=eC(e,arguments.length>1?arguments[1]:void 0),n=rC(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var nC=Lr,iC=R,aC=L,oC=Pe,sC=jh,uC=DL.Map,cC=c([].push);nC({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var r=new(aC(this)?this:uC);oC(t);var n=oC(r.has),i=oC(r.get),a=oC(r.set);return sC(e,(function(e){var o=t(e);iC(n,r,o)?cC(iC(i,r,o),e):iC(a,r,o,[e])})),r}});var lC=function(e,t){return e===t||e!=e&&t!=t},fC=LL,hC=VL;Lr({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===hC(fC(this),(function(t){if(lC(t,e))return!0}),!0)}});var dC=R,pC=jh,vC=L,gC=Pe,yC=DL.Map;Lr({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(vC(this)?this:yC);gC(t);var n=gC(r.set);return pC(e,(function(e){dC(n,r,t(e),e)})),r}});var mC=LL,_C=VL;Lr({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=_C(mC(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var bC=Qt,wC=LL,kC=VL,SC=DL.Map,xC=DL.set;Lr({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=wC(this),r=bC(e,arguments.length>1?arguments[1]:void 0),n=new SC;return kC(t,(function(e,i){xC(n,r(e,i,t),e)})),n}});var EC=Qt,TC=LL,AC=VL,LC=DL.Map,CC=DL.set;Lr({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=TC(this),r=EC(e,arguments.length>1?arguments[1]:void 0),n=new LC;return AC(t,(function(e,i){CC(n,i,r(e,i,t))})),n}});var OC=LL,PC=jh,DC=DL.set;Lr({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=OC(this),r=arguments.length,n=0;n<r;)PC(arguments[n++],(function(e,r){DC(t,e,r)}),{AS_ENTRIES:!0});return t}});var RC=Pe,MC=LL,UC=VL,IC=TypeError;Lr({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=MC(this),r=arguments.length<2,n=r?void 0:arguments[1];if(RC(e),UC(t,(function(i,a){r?(r=!1,n=i):n=e(n,i,a,t)})),r)throw IC("Reduce of empty map with no initial value");return n}});var BC=Qt,jC=LL,FC=VL;Lr({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=jC(this),r=BC(e,arguments.length>1?arguments[1]:void 0);return!0===FC(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var NC=Pe,zC=LL,VC=TypeError,GC=DL.get,HC=DL.has,qC=DL.set;Lr({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=zC(this),n=arguments.length;NC(t);var i=HC(r,e);if(!i&&n<3)throw VC("Updating absent value");var a=i?GC(r,e):NC(n>2?arguments[2]:void 0)(e,r);return qC(r,e,t(a,e,r)),r}});var KC=R,WC=Pe,YC=L,JC=rr,QC=TypeError,XC=function(e,t){var r,n=JC(this),i=WC(n.get),a=WC(n.has),o=WC(n.set),s=arguments.length>2?arguments[2]:void 0;if(!YC(t)&&!YC(s))throw QC("At least one callback required");return KC(a,n,e)?(r=KC(i,n,e),YC(t)&&(r=t(r),KC(o,n,e,r))):YC(s)&&(r=s(),KC(o,n,e,r)),r};Lr({target:"Map",proto:!0,real:!0,forced:!0},{upsert:XC}),Lr({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:XC});var $C=r(gL);function ZC(e,t){var r=Dl(e);if(Rl){var n=Rl(e);t&&(n=Fl(n).call(n,(function(t){return Yl(e,t).enumerable}))),r.push.apply(r,n)}return r}function eO(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?sf(r=ZC(Object(i),!0)).call(r,(function(t){uO(e,t,i[t])})):mf?Ef(e,mf(i)):sf(n=ZC(Object(i))).call(n,(function(t){Df(e,t,Yl(i,t))}))}return e}function tO(){tO=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Df||function(e,t,r){e[t]=r.value},i="function"==typeof Rf?Rf:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r){return Df(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(A){u=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var a=t&&t.prototype instanceof h?t:h,o=Uf(a.prototype),s=new x(i||[]);return n(o,"_invoke",{value:b(e,r,s)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(A){return{type:"throw",arg:A}}}e.wrap=c;var f={};function h(){}function d(){}function p(){}var v={};u(v,a,(function(){return this}));var g=Ff&&Ff(Ff(E([])));g&&g!==t&&r.call(g,a)&&(v=g);var y=p.prototype=h.prototype=Uf(v);function m(e){var t;sf(t=["next","throw","return"]).call(t,(function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(n,a,o,s){var u=l(e[n],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==Cl(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(f).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,s)}))}s(u.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function b(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=w(o,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],sf(e).call(e,k,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Nf?Nf(e,p):(e.__proto__=p,u(e,s,"GeneratorFunction")),e.prototype=Uf(y),e},e.awrap=function(e){return{__await:e}},m(_.prototype),u(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,a){void 0===a&&(a=Hg);var o=new _(c(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},m(y),u(y,s,"Generator"),u(y,a,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return Zg(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=E,x.prototype={constructor:x,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,sf(t=this.tryEntries).call(t,S),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+my(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function rO(e){return(rO="function"==typeof Rf&&"symbol"==typeof _y?function(e){return typeof e}:function(e){return e&&"function"==typeof Rf&&e.constructor===Rf&&e!==Rf.prototype?"symbol":typeof e})(e)}function nO(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(gB){return void r(gB)}s.done?t(u):Hg.resolve(u).then(n,i)}function iO(e){return function(){var t=this,r=arguments;return new Hg((function(n,i){var a=e.apply(t,r);function o(e){nO(a,n,i,o,s,"next",e)}function s(e){nO(a,n,i,o,s,"throw",e)}o(void 0)}))}}function aO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oO(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),Df(e,wO(n.key),n)}}function sO(e,t,r){return t&&oO(e.prototype,t),r&&oO(e,r),Df(e,"prototype",{writable:!1}),e}function uO(e,t,r){return(t=wO(t))in e?Df(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Uf(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Df(e,"prototype",{writable:!1}),t&&fO(e,t)}function lO(e){var t;return(lO=Nf?Iy(t=Ff).call(t):function(e){return e.__proto__||Ff(e)})(e)}function fO(e,t){var r;return(fO=Nf?Iy(r=Nf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function hO(){if("undefined"==typeof Reflect||!Xy)return!1;if(Xy.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Xy(Boolean,[],(function(){}))),!0}catch(e){return!1}}function dO(e,t,r){var n;hO()?dO=Iy(n=Xy).call(n):dO=function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Iy(Function).apply(e,n));return r&&fO(i,r.prototype),i};return dO.apply(null,arguments)}function pO(e){var t="function"==typeof $C?new $C:void 0;return pO=function(e){if(null===e||(r=e,-1===xm(n=Function.toString.call(r)).call(n,"[native code]")))return e;var r,n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return dO(e,arguments,lO(this).constructor)}return i.prototype=Uf(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),fO(i,e)},pO(e)}function vO(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Dl(e);for(n=0;n<a.length;n++)r=a[n],xm(t).call(t,r)>=0||(i[r]=e[r]);return i}(e,t);if(Rl){var a=Rl(e);for(n=0;n<a.length;n++)r=a[n],xm(t).call(t,r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function gO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yO(e){var t=hO();return function(){var r,n=lO(e);if(t){var i=lO(this).constructor;r=Xy(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===Cl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gO(e)}(this,r)}}function mO(){var e;"undefined"!=typeof Reflect&&ib?mO=Iy(e=ib).call(e):mO=function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=lO(e)););return e}(e,t);if(n){var i=Yl(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}};return mO.apply(this,arguments)}function _O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bO(e,t){var r=void 0!==Rf&&ab(e)||e["@@iterator"];if(!r){if(U_(e)||(r=function(e,t){var r;if(e){if("string"==typeof e)return _O(e,t);var n=my(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?wb(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_O(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function wO(e){var t=function(e,t){if("object"!==Cl(e)||null===e)return e;var r=e[$y];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Cl(t)?t:String(t)}var kO=Pe,SO=Je,xO=q,EO=Fr,TO=TypeError,AO=function(e){return function(t,r,n,i){kO(r);var a=SO(t),o=xO(a),s=EO(a),u=e?s-1:0,c=e?-1:1;if(n<2)for(;;){if(u in o){i=o[u],u+=c;break}if(u+=c,e?u<0:s<=u)throw TO("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=c)u in o&&(i=r(i,o[u],u,a));return i}},LO={left:AO(!1),right:AO(!0)}.left;Lr({target:"Array",proto:!0,forced:!sd&&ve>79&&ve<83||!Ql("reduce")},{reduce:function(e){var t=arguments.length;return LO(this,e,t,t>1?arguments[1]:void 0)}});var CO,OO=Kn("Array").reduce,PO=l,DO=OO,RO=Array.prototype,MO=r((function(e){var t=e.reduce;return e===RO||PO(RO,e)&&t===RO.reduce?DO:t})),UO=function(){function e(){aO(this,e)}return sO(e,null,[{key:"start",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6||1===e.length&&e.start(0)<0?0:e.start(0):0}},{key:"end",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6?0:e.end(e.length-1):0}},{key:"get",value:function(e){if(e)try{return e.buffered}catch(gB){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,i=e.length;n<i;n++){var a=r.length;if(a&&t){var o=r[a-1],s=o[1];if(e.start(n)-s<=t){var u=e.end(n);u>s&&(o[1]=u)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"totalLength",value:function(e){return e&&e.length?MO(e).call(e,(function(e,t){return e+(t[1]-t[0])}),0):0}},{key:"info",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t.length)return{start:0,end:0,buffers:[]};for(var i=0,a=0,o=0,s=0,u=0,c=0,l=0,f=e.buffers(t,n),h=0,d=f.length;h<d;h++){var p=f[h];if(r+n>=p[0]&&r<=p[1])i=p[0],a=p[1],o=h;else{if(r+n<p[0]){s=p[0],u=p[1];break}r+n>p[1]&&(c=p[0],l=p[1])}}return{start:i,end:a,index:o,buffers:f,nextStart:s,nextEnd:u,prevStart:c,prevEnd:l,currentTime:r,behind:r-i,remaining:a?a-r:0,length:e.totalLength&&e.totalLength(f)}}},{key:"isBuffered",value:function(t,r){if(t){var n=e.get(t);if(null!=n&&n.length)for(var i=0;i<n.length;i++)if(r>=n.start(i)&&r<=n.end(i))return!0}return!1}}]),e}(),IO="undefined"!=typeof window,BO="network",jO="network_timeout",FO="network_forbidden",NO="network_notfound",zO="network_range_not_satisfiable",VO="demux",GO="remux",HO="media",qO="drm",KO="other",WO="runtime",YO={FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",MSE_FULL:"MSE_FULL",MSE_CHANGE_TYPE:"MSE_CHANGE_TYPE",OPTION:"OPTION",DASH:"DASH",LICENSE:"LICENSE",CUSTOM_LICENSE:"CUSTOM_LICENSE",MSE_HIJACK:"MSE_HIJACK",EME_HIJACK:"EME_HIJACK",SIDX:"SIDX",NO_CANPLAY_ERROR:"NO_CANPLAY_ERROR",BUFFERBREAK_ERROR:"BUFFERBREAK_ERROR",WAITING_TIMEOUT_ERROR:"WAITING_TIMEOUT_ERROR",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_CODEC_NOT_SUPPORTED:"MEDIA_ERR_CODEC_NOT_SUPPORTED",MEDIA_ERR_URL_EMPTY:"MEDIA_ERR_URL_EMPTY"},JO=(uO(CO={},"manifest",{HLS:1100,DASH:1200}),uO(CO,BO,2100),uO(CO,jO,2101),uO(CO,FO,2103),uO(CO,NO,2104),uO(CO,zO,2116),uO(CO,VO,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),uO(CO,GO,{FMP4:4100,MP4:4200}),uO(CO,HO,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,MSE_CHANGE_TYPE:5205,EME_HIJACK:5301}),uO(CO,qO,{LICENSE:7100,CUSTOM_LICENSE:7200}),uO(CO,KO,8e3),uO(CO,WO,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),CO),QO=function(e){cO(r,e);var t=yO(r);function r(e,n,i,a,o){var s;return aO(this,r),(s=t.call(this,o||(null==i?void 0:i.message))).errorType=e===jO?BO:e,s.originError=i,s.ext=a,s.errorCode=JO[e][n]||JO[e],s.errorMessage=s.message,s.errorCode||(s.errorType=KO,s.errorCode=JO[s.errorType]),s}return sO(r,null,[{key:"create",value:function(e,t,n,i,a){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=KO),new r(e,t,n,i,a))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?jO:BO,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),r}(pO(Error)),XO=1,$O=2,ZO=3,eP=4,tP=["Boolean","Number","String","Undefined","Null","Date","Object"],rP=function(){function e(t,r){aO(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return sO(e,[{key:"debug",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,Xn(t=[XO]).call(t,a)),e.disabled||(n=console).debug.apply(n,Xn(r=["[".concat(nP(),"]"),this._prefix]).call(r,a))}},{key:"log",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,Xn(t=[$O]).call(t,a)),e.disabled||(n=console).log.apply(n,Xn(r=["[".concat(nP(),"]"),this._prefix]).call(r,a))}},{key:"warn",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,Xn(t=[ZO]).call(t,a)),e.disabled||(n=console).warn.apply(n,Xn(r=["[".concat(nP(),"]"),this._prefix]).call(r,a))}},{key:"error",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,Xn(t=[eP]).call(t,a)),e.disabled||(n=console).error.apply(n,Xn(r=["[".concat(nP(),"]"),this._prefix]).call(r,a))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var a=M_(n).call(n,(function(e){return aP(e)}));t="[".concat(nP(),"]")+this._prefix+KT(a)}catch(s){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var o=this.logTextArray.shift();this.logSize-=o.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function nP(){return(new Date).toLocaleString()}function iP(e){var t;if("object"!==rO(e))return e;var r=my(t=Object.prototype.toString.call(e)).call(t,8,-1);switch(r){case"Array":case"Uint8Array":case"ArrayBuffer":return r+"["+e.length+"]";case"Object":return"{}";default:return r}}function aP(e,t,r){var n;r||(r=1),t||(t=2);var i={};if(!e||"object"!==rO(e))return e;var a=my(n=Object.prototype.toString.call(e)).call(n,8,-1);if(!dA(tP).call(tP,a))return a;if(!(r>t)){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r===t?i[o]=iP(e[o]):"object"===rO(e[o])?i[o]=aP(e[o],t,r+1):i[o]=e[o]);return i}}function oP(){var e,t,r=new Hg((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}function sP(){try{return L_(performance.now(),10)}catch(e){return(new Date).getTime()}}uO(rP,"disabled",!0);var uP=function(e){try{return KT(e)}catch(t){return""}};function cP(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{return IO?e&&"undefined"!=typeof ManagedMediaSource?ManagedMediaSource:window.MediaSource:null}catch(t){}}function lP(e){return/ManagedMediaSource/gi.test(Object.prototype.toString.call(e))}var fP="appendBuffer",hP="removeBuffer",dP="updateDuration",pP=function(){function e(t,r){var n=this;aO(this,e),uO(this,"media",null),uO(this,"mediaSource",null),uO(this,"_openPromise",oP()),uO(this,"_queue",Uf(null)),uO(this,"_sourceBuffer",Uf(null)),uO(this,"_mseFullFlag",{}),uO(this,"_st",0),uO(this,"_opst",0),uO(this,"_logger",null),uO(this,"_config",null),uO(this,"_url",null),uO(this,"_onStartStreaming",(function(){n._logger.debug("startstreaming")})),uO(this,"_onEndStreaming",(function(){n._logger.debug("endstreaming")})),uO(this,"_onSBUpdateEnd",(function(e){var t=n._queue[e];if(t){var r=t[0];if((null==r?void 0:r.opName)!==dP&&t.shift(),r){var i,a,o,s=sP()-n._opst;n._logger.debug(Xn(i="UpdateEnd(".concat(e,"/")).call(i,r.opName,")"),uP(function(e){var t=[];if(e instanceof TimeRanges)for(var r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}(null===(a=n._sourceBuffer[e])||void 0===a?void 0:a.buffered)),s,r.context),r.promise.resolve({name:r.opName,context:r.context,costtime:s});var u=null===(o=r.context)||void 0===o?void 0:o.callback;u&&"function"==typeof u&&u(r.context),n._startQueue(e)}}})),uO(this,"_onSBUpdateError",(function(e,t){var r=n._queue[e];if(r){var i=r[0];i&&(n._logger.error("UpdateError",e,i.opName,i.context),i.promise.reject(new QO(HO,YO.MSE_APPEND_BUFFER,t)))}})),this._config=Q_(e.getDefaultConfig(),r),t&&this.bindMedia(t),this._logger=new rP("MSE"),this._config.openLog&&rP.enable()}var t,r,n;return sO(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"hasOpTasks",get:function(){var e,t=this,r=!1;return sf(e=Dl(this._queue)).call(e,(function(e){var n=t._queue[e];U_(n)&&(r||(r=n.length>0))})),r}},{key:"url",get:function(){return this._url}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"isEnded",get:function(){return!!this.mediaSource&&"ended"===this.mediaSource.readyState}},{key:"streaming",get:function(){return!lP(this.mediaSource)||this.mediaSource.streaming}},{key:"isFull",value:function(t){return t?this._mseFullFlag[t]:this._mseFullFlag[e.VIDEO]}},{key:"updateDuration",value:function(e){var t=this,r=this.mediaSource&&this.mediaSource.duration>e;if(this.mediaSource&&this.mediaSource.duration>e){var n,i=0;if(sf(n=Dl(this._sourceBuffer)).call(n,(function(e){try{i=Math.max(t.bufferEnd(e)||0,i)}catch(gB){}})),e<i)return Hg.resolve()}return this._enqueueBlockingOp((function(){t.isEnded?t._logger.debug("setDuration but ended"):t.mediaSource&&(t.mediaSource.duration=e,t._logger.debug("setDuration",e))}),dP,{isReduceDuration:r})}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){var n=sP()-e._st;e._logger.debug("sourceopen",n),t.removeEventListener("sourceopen",r),e._openPromise.resolve({costtime:n})})),this._openPromise=oP()}return this._openPromise}},{key:"bindMedia",value:(n=iO(tO().mark((function e(t){var r,n,i,a,o=this;return tO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mediaSource&&!this.media){e.next=3;break}return e.next=3,this.unbindMedia();case 3:if(r=cP(this._config.preferMMS),t&&r){e.next=6;break}throw new Error("Param media or MediaSource does not exist");case 6:return this.media=t,n=this.mediaSource=new r,i=lP(n),this._st=sP(),a=function e(){var r=sP()-o._st;o._logger.debug("sourceopen"),n.removeEventListener("sourceopen",e),VT.revokeObjectURL(t.src),o._openPromise.resolve({costtime:r})},n.addEventListener("sourceopen",a),i&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming)),this._url=VT.createObjectURL(n),t.src=this._url,t.disableRemotePlayback=i,e.abrupt("return",this._openPromise);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unbindMedia",value:(r=iO(tO().mark((function e(){var t,r,n,i=this;return tO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){var a,o;if(sf(a=Dl(this._queue)).call(a,(function(e){var t=i._queue[e];t&&sf(t).call(t,(function(e){var t,r;return null===(t=e.promise)||void 0===t||null===(r=t.resolve)||void 0===r?void 0:r.call(t)}))})),r=!!this.media&&this.media.readyState>=1,n="open"===t.readyState,r&&n)try{t.endOfStream()}catch(gB){}sf(o=Dl(this._sourceBuffer)).call(o,(function(e){try{t.removeSourceBuffer(i._sourceBuffer[e])}catch(gB){}})),lP(t)&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming))}if(this.media){this.media.disableRemotePlayback=!1,this.media.removeAttribute("src");try{this.media.load()}catch(gB){}this.media=null}this.mediaSource=null,this._openPromise=oP(),this._queue=Uf(null),this._sourceBuffer=Uf(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){var r,n;if(!this._sourceBuffer[e]&&this.mediaSource){var i;try{i=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(gB){throw new QO(HO,YO.MSE_ADD_SB,gB)}i.mimeType=t,i.addEventListener("updateend",Iy(r=this._onSBUpdateEnd).call(r,this,e)),i.addEventListener("error",Iy(n=this._onSBUpdateError).call(n,this,e))}}},{key:"changeType",value:function(e,t){var r=this,n=this._sourceBuffer[e];return this.mediaSource&&n&&n.mimeType!==t?"function"!=typeof n.changeType?Hg.reject(new QO(HO,YO.MSE_CHANGE_TYPE,new Error("changeType is not a function"))):this._enqueueOp(e,(function(){try{n.changeType(t)}catch(i){throw new QO(HO,YO.MSE_CHANGE_TYPE,i)}n.mimeType=t,r._onSBUpdateEnd(e)}),"changeType",{mimeType:t}):Hg.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t,r){var n=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){var i;n.mediaSource&&!n.media.error&&(n._logger.debug("MSE APPEND START",r),n._opst=sP(),null===(i=n._sourceBuffer[e])||void 0===i||i.appendBuffer(t))}),fP,r):Hg.resolve()}},{key:"remove",value:function(e,t,r,n){var i=this,a=!1;return this._mseFullFlag[e]&&(a=!0),this._enqueueOp(e,(function(){if(i.mediaSource&&!i.media.error){var a=i._sourceBuffer[e];t>=r||!a?i._onSBUpdateEnd(e):(i._opst=sP(),i._logger.debug("MSE REMOVE START",e,t,r,n),a.remove(t,r))}}),hP,n,a)}},{key:"clearBuffer",value:function(e,t){var r,n,i=this;return sf(r=Dl(this._sourceBuffer)).call(r,(function(r){n=i.remove(r,e,t)})),n||Hg.resolve()}},{key:"clearAllBuffer",value:function(){var e,t,r=this;return sf(e=Dl(this._sourceBuffer)).call(e,(function(e){var n=r._sourceBuffer[e];t=r.remove(e,0,UO.end(UO.get(n)))})),t}},{key:"clearOpQueues",value:function(e,t){var r;this._logger.debug("MSE clearOpQueue START");var n=this._queue[e];if(t&&n)this._queue[e]=[];else if(n&&n[e]&&!(n.length<5)){var i=[];sf(n).call(n,(function(e){e.context&&e.context.isinit&&i.push(e)})),this._queue[e]=my(n).call(n,0,2),i.length>0&&(r=this._queue[e]).push.apply(r,i)}}},{key:"endOfStream",value:function(e){var t=this;return this.mediaSource&&"open"===this.mediaSource.readyState?this._enqueueBlockingOp((function(){var r=t.mediaSource;r&&"open"===r.readyState&&(t._logger.debug("MSE endOfStream START"),e?r.endOfStream(e):r.endOfStream())}),"endOfStream"):Hg.resolve()}},{key:"setLiveSeekableRange",value:function(e,t){var r=this.mediaSource;e<0||t<e||null==r||!r.setLiveSeekableRange||"open"!==r.readyState||r.setLiveSeekableRange(e,t)}},{key:"getSourceBuffer",value:function(e){return this._sourceBuffer[e]}},{key:"buffered",value:function(e){return UO.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return UO.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return UO.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t,r,n,i){var a=this;if(!this.mediaSource)return Hg.resolve();var o=this._queue[e]=this._queue[e]||[],s={exec:t,promise:oP(),opName:r,context:n};return i?(a_(o).call(o,0,0,s),this._mseFullFlag[e]=!1,this._startQueue(e)):o.push(s),this.isOpened||this.isEnded?1===o.length&&this._startQueue(e):this._openPromise.then((function(){1===o.length&&a._startQueue(e)})),s.promise}},{key:"_enqueueBlockingOp",value:(t=iO(tO().mark((function e(t,r,n){var i,a,o=this;return tO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",Hg.resolve());case 2:if((i=Dl(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return a=[],sf(i).call(i,(function(e){var t=o._queue[e],i=oP();a.push(i),t.push({exec:function(){i.resolve()},promise:i,opName:r,context:n}),1===t.length&&o._startQueue(e)})),e.abrupt("return",Hg.all(a).then((function(){try{return t()}finally{sf(i).call(i,(function(e){var t=o._queue[e],r=o._sourceBuffer[e];null==t||t.shift(),r&&r.updating||o._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r&&!this._mseFullFlag[e])try{r.exec()}catch(gB){var n;gB&&gB.message&&xm(n=gB.message).call(n,"SourceBuffer is full")>=0?(this._mseFullFlag[e]=!0,r.context&&"object"===rO(r.context)&&(r.context.isFull=!0),this._logger.error("[MSE error], context,",r.context," ,name,",r.opName,",err,SourceBuffer is full"),r.promise.reject(new QO(HO,YO.MSE_FULL,gB))):(this._logger.error(gB),r.promise.reject(gB.constructor===QO?gB:new QO(HO,YO.MSE_OTHER,gB)),t.shift(),this._startQueue(e))}}}},{key:"setTimeoffset",value:function(e,t,r){var n=this;return this._enqueueOp(e,(function(){t<0&&(t+=.001),n._sourceBuffer[e].timestampOffset=t,n._onSBUpdateEnd(e)}),"setTimeoffset",r)}},{key:"abort",value:function(e,t){var r=this;return this.isOpened?this._enqueueOp(e,(function(){r._sourceBuffer[e].abort(),r._onSBUpdateEnd(e)}),"abort",t):Hg.resolve()}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"',t=cP();if(!t)return!1;try{return t.isTypeSupported(e)}catch(gB){return this._logger.error(e,gB),!1}}},{key:"isMMSOnly",value:function(){return"undefined"!=typeof ManagedMediaSource&&"undefined"==typeof MediaSource}},{key:"getDefaultConfig",value:function(){return{openLog:!1,preferMMS:!1}}}]),e}();uO(pP,"VIDEO","video"),uO(pP,"AUDIO","audio");var vP="fetch",gP="xhr",yP="arraybuffer",mP="text",_P="json",bP=function(e){cO(r,e);var t=yO(r);function r(e,n,i,a){var o;return aO(this,r),uO(gO(o=t.call(this,a)),"retryCount",0),uO(gO(o),"isTimeout",!1),uO(gO(o),"loaderType",vP),uO(gO(o),"startTime",0),uO(gO(o),"endTime",0),uO(gO(o),"options",{}),o.url=e,o.request=n,o.response=i,o}return sO(r)}(pO(Error)),wP=Object.prototype.toString;function kP(e){if("[object Object]"!==wP.call(e))return!1;var t=Ff(e);return null===t||t===Object.prototype}function SP(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function xP(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function EP(e,t){var r,n;if(e){if(!t)return e;var i,a=Fl(r=M_(n=Dl(t)).call(n,(function(e){if(null!=(i=t[e]))return U_(i)?e+="[]":i=[i],M_(i).call(i,(function(t){var r,n;return n=t,"[object Date]"===wP.call(n)?t=t.toISOString():function(e){return null!==e&&"object"===rO(e)}(t)&&(t=KT(t)),Xn(r="".concat(xP(e),"=")).call(r,xP(t))})).join("&")}))).call(r,Boolean).join("&");if(a){var o=xm(e).call(e,"#");-1!==o&&(e=my(e).call(e,0,o)),e+=(-1===xm(e).call(e,"?")?"?":"&")+a}return e}}function TP(e,t,r,n,i,a,o,s,u,c,l){return i=null!=i?Vw(i):null,n=L_(n||"0",10),o_(n)&&(n=0),{data:e,done:t,options:{range:u,vid:c,index:s,contentLength:n,age:i,startTime:a,firstByteTime:o,endTime:Fk(),priOptions:l},response:r}}function AP(e,t){return Math.round(8*e*1e3/t/1024)}var LP="error",CP="core.ttfb",OP="core.loadstart",PP="core.loadresponseheaders",DP="core.loadcomplete",RP="core.loadretry",MP="core.sourcebuffercreated",UP="core.analyzedurationexceeded",IP="core.appendbuffer",BP="core.removebuffer",jP="core.buffereos",FP="core.keyframe",NP="core.chaseframe",zP="core.metadataparsed",VP="core.sei",GP="core.seiintime",HP="core.flvscriptdata",qP="core.lowdecode",KP="core.switchurlsuccess",WP="core.switchurlfailed",YP="core.demuxedtrack",JP="core.streamexception",QP="LARGE_AV_FIRST_FRAME_GAP_DETECT",XP="LARGE_VIDEO_DTS_GAP_DETECT",$P="LARGE_AUDIO_DTS_GAP_DETECT",ZP="AUDIO_GAP_DETECT",eD="AUDIO_OVERLAP_DETECT",tD="MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT",rD="real_time_speed",nD=2097152,iD=function(e){cO(n,e);var t,r=yO(n);function n(){var e;return aO(this,n),uO(gO(e=r.call(this)),"_abortController",null),uO(gO(e),"_timeoutTimer",null),uO(gO(e),"_reader",null),uO(gO(e),"_response",null),uO(gO(e),"_aborted",!1),uO(gO(e),"_index",-1),uO(gO(e),"_range",null),uO(gO(e),"_receivedLength",0),uO(gO(e),"_running",!1),uO(gO(e),"_logger",null),uO(gO(e),"_vid",""),uO(gO(e),"_onProcessMinLen",0),uO(gO(e),"_onCancel",null),uO(gO(e),"_priOptions",null),e}return sO(n,[{key:"load",value:function(e){var t,r=this,n=e.url,i=e.vid,a=e.timeout,o=e.responseType,s=e.onProgress,u=e.index,c=e.onTimeout,l=e.onCancel,f=e.range,h=e.transformResponse,d=e.request,p=e.params,v=e.logger,g=e.method,y=e.headers,m=e.body,_=e.mode,b=e.credentials,w=e.cache,k=e.redirect,S=e.referrer,x=e.referrerPolicy,E=e.onProcessMinLen,T=e.priOptions;this._logger=v,this._aborted=!1,this._onProcessMinLen=E,this._onCancel=l,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=u,this._range=f||[0,0],this._vid=i||n,this._priOptions=T||{};var A={method:g,headers:y,body:m,mode:_,credentials:b,cache:w,redirect:k,referrer:S,referrerPolicy:x,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},L=!1;clearTimeout(this._timeoutTimer),n=EP(n,p);var C=SP(f);C&&(y=d?d.headers:A.headers=A.headers||(Headers?new Headers:{}),Headers&&y instanceof Headers?y.append("Range",C):y.Range=C),a&&(this._timeoutTimer=Ew((function(){if(L=!0,r.cancel(),c){var e=new bP(n,A,null,"timeout");e.isTimeout=!0,c(e,{index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions})}}),a));var O=Fk();return this._logger.debug("[fetch load start], index,",u,",range,",f),new Hg((function(e,t){fetch(d||n,d?void 0:A).then(function(){var i=iO(tO().mark((function i(a){var c,l,d,p;return tO().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=a,!r._aborted&&r._running){i.next=4;break}return i.abrupt("return");case 4:if(h&&(a=h(a,n)||a),a.ok){i.next=7;break}throw new bP(n,A,a,"bad network response");case 7:if(c=Fk(),o!==mP){i.next=15;break}return i.next=11,a.text();case 11:l=i.sent,r._running=!1,i.next=37;break;case 15:if(o!==_P){i.next=22;break}return i.next=18,a.json();case 18:l=i.sent,r._running=!1,i.next=37;break;case 22:if(!s){i.next=29;break}return r.resolve=e,r.reject=t,r._loadChunk(a,s,O,c),i.abrupt("return");case 29:return i.next=31,a.arrayBuffer();case 31:l=i.sent,l=new Uint8Array(l),r._running=!1,d=Fk()-O,p=AP(l.byteLength,d),r.emit(rD,{speed:p,len:l.byteLength,time:d,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions});case 37:r._logger.debug("[fetch load end], index,",u,",range,",f),e(TP(l,!0,a,a.headers.get("Content-Length"),a.headers.get("age"),O,c,u,f,r._vid,r._priOptions));case 39:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){var i;clearTimeout(r._timeoutTimer),r._running=!1,r._aborted&&!L||((e=e instanceof bP?e:new bP(n,A,null,null===(i=e)||void 0===i?void 0:i.message)).startTime=O,e.endTime=Fk(),e.isTimeout=L,e.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},t(e))}))}))}},{key:"cancel",value:(t=iO(tO().mark((function e(){return tO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(gB){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,r,n){var i=this;if(!e.body||!e.body.getReader){this._running=!1;var a=new bP(e.url,"",e,"onProgress of bad response.body.getReader");return a.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(a)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(nD),this._writeIdx=0);var o,s,u,c=this._reader=e.body.getReader(),l=function(){var a=iO(tO().mark((function a(){var f,h,d,p,v,g,y,m;return tO().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return s=Fk(),a.prev=1,a.next=4,c.read();case 4:o=a.sent,u=Fk(),a.next=13;break;case 8:return a.prev=8,a.t0=a.catch(1),u=Fk(),i._aborted||(i._running=!1,a.t0.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},i.reject(a.t0)),a.abrupt("return");case 13:if(h=(null===(f=i._range)||void 0===f?void 0:f.length)>0?i._range[0]:0,d=h+i._receivedLength,!i._aborted){a.next=19;break}return i._running=!1,t(void 0,!1,{range:[d,d],vid:i._vid,index:i._index,startTime:s,endTime:u,st:r,firstByteTime:n,priOptions:i._priOptions},e),a.abrupt("return");case 19:var _;if(p=o.value?o.value.byteLength:0,i._receivedLength+=p,i._logger.debug("【fetchLoader,onProgress call】,task,",i._range,", start,",d,", end,",h+i._receivedLength,", done,",o.done),i._onProcessMinLen>0){if(i._writeIdx+p>=i._onProcessMinLen||o.done)(v=new Uint8Array(i._writeIdx+p)).set(my(_=i._cache).call(_,0,i._writeIdx),0),p>0&&v.set(o.value,i._writeIdx),i._writeIdx=0,i._logger.debug("【fetchLoader,onProgress enough】,done,",o.done,",len,",v.byteLength,", writeIdx,",i._writeIdx);else if(p>0&&i._writeIdx+p<nD)i._cache.set(o.value,i._writeIdx),i._writeIdx+=p,i._logger.debug("【fetchLoader,onProgress cache】,len,",p,", writeIdx,",i._writeIdx);else if(p>0){var b;g=new Uint8Array(i._writeIdx+p+2048),i._logger.debug("【fetchLoader,onProgress extra start】,size,",i._writeIdx+p+2048,", datalen,",p,", writeIdx,",i._writeIdx),g.set(my(b=i._cache).call(b,0,i._writeIdx),0),p>0&&g.set(o.value,i._writeIdx),i._writeIdx+=p,delete i._cache,i._cache=g,i._logger.debug("【fetchLoader,onProgress extra end】,len,",p,", writeIdx,",i._writeIdx)}}else v=o.value;(v&&v.byteLength>0||o.done)&&t(v,o.done,{range:[i._range[0]+i._receivedLength-(v?v.byteLength:0),i._range[0]+i._receivedLength],vid:i._vid,index:i._index,startTime:s,endTime:u,st:r,firstByteTime:n,priOptions:i._priOptions},e),o.done?(y=Fk()-r,m=AP(i._receivedLength,y),i.emit(rD,{speed:m,len:i._receivedLength,time:y,vid:i._vid,index:i._index,range:i._range,priOptions:i._priOptions}),i._running=!1,i._logger.debug("[fetchLoader onProgress end],task,",i._range,",done,",o.done),i.resolve(TP(o,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),r,n,i._index,i._range,i._vid,i._priOptions))):l();case 25:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(){return a.apply(this,arguments)}}();l()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),n}(Rb);var aD=function(e){cO(r,e);var t=yO(r);function r(){var e;return aO(this,r),uO(gO(e=t.call(this)),"_xhr",null),uO(gO(e),"_aborted",!1),uO(gO(e),"_timeoutTimer",null),uO(gO(e),"_range",null),uO(gO(e),"_receivedLength",0),uO(gO(e),"_url",null),uO(gO(e),"_onProgress",null),uO(gO(e),"_index",-1),uO(gO(e),"_headers",null),uO(gO(e),"_currentChunkSizeKB",384),uO(gO(e),"_timeout",null),uO(gO(e),"_xhr",null),uO(gO(e),"_withCredentials",null),uO(gO(e),"_startTime",-1),uO(gO(e),"_loadCompleteResolve",null),uO(gO(e),"_loadCompleteReject",null),uO(gO(e),"_runing",!1),uO(gO(e),"_logger",!1),uO(gO(e),"_vid",""),uO(gO(e),"_responseType",void 0),uO(gO(e),"_credentials",void 0),uO(gO(e),"_method",void 0),uO(gO(e),"_transformResponse",void 0),uO(gO(e),"_firstRtt",void 0),uO(gO(e),"_onCancel",null),uO(gO(e),"_priOptions",null),e}return sO(r,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=EP(e.url,e.params);var r=Fk();return new Hg((function(e,r){t._loadCompleteResolve=e,t._loadCompleteReject=r,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof bP?e:new bP(t._url,t._request)).startTime=r,e.endTime=Fk(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===yP&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,r=this._range[0]+this._receivedLength,n=this._range[1];t<this._range[1]-r&&(n=r+t),e=[r,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{var r,n;this._startTime=Fk();var i=this._xhr=new XMLHttpRequest;i.open(this._method||"GET",this._url,!0),i.responseType=this._responseType,this._timeout&&(i.timeout=this._timeout),i.withCredentials=this._withCredentials,i.onload=Iy(r=this._onLoad).call(r,this),i.onreadystatechange=Iy(n=this._onReadyStatechange).call(n,this),i.onerror=function(e){var r,n,i;t._running=!1;var a=new bP(t._url,t._request,null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.response,"xhr.onerror.status:"+(null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.status)+",statusText,"+(null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.statusText));a.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(a)},i.ontimeout=function(e){t.cancel();var r=new bP(t._url,t._request,{status:408},"timeout");t._onTimeout&&(r.isTimeout=!0,t._onTimeout(r,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),r.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(r)};var a,o=this._headers||{},s=SP(e);if(s&&(o.Range=s),o)sf(a=Dl(o)).call(a,(function(e){i.setRequestHeader(e,o[e])}));this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),i.send(this._body)}catch(u){u.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(u)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Fk())}},{key:"_onLoad",value:function(e){var t,r=e.target.status;if(r<200||r>299){var n=new bP(this._url,null,eO(eO({},e.target.response),{},{status:r}),"bad response,status:"+r);return n.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(n)}var i,a=null,o=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===yP){var u,c=new Uint8Array(e.target.response);if(i=s+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var l=Fk()-this._startTime,f=AP(this._receivedLength,l);this.emit(rD,{speed:f,len:this._receivedLength,time:l,vid:this._vid,index:this._index,range:[i,s+this._receivedLength],priOptions:this._priOptions})}a=c,o=!((null===(u=this._range)||void 0===u?void 0:u.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",i,"end ",s+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",o)}else o=!0,a=e.target.response;var h={ok:r>=200&&r<300,status:r,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(h=this._transformResponse(h,this._url)||h),this._onProgress&&this._onProgress(a,o,{index:this._index,vid:this._vid,range:[i,s+this._receivedLength],startTime:this._startTime,endTime:Fk(),priOptions:this._priOptions},h),o?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(TP(this._onProgress?null:a,o,h,h.headers["content-length"],h.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,mO(lO(r.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,r,n={},i=bO(Xw(t=e.getAllResponseHeaders()).call(t).split("\r\n"));try{for(i.s();!(r=i.n()).done;){var a=r.value.split(": ");n[a[0].toLowerCase()]=my(a).call(a,1).join(": ")}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),r}(Rb),oD=["retry","retryDelay","onRetryError","transformError"],sD=function(){function e(t,r){aO(this,e),this.promise=oP(),this.alive=!!r.onProgress,!r.logger&&(r.logger=new rP("Loader")),this._loaderType=t,this._loader=t===vP&&"undefined"!=typeof fetch?new iD:new aD,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=r.retryCheckFunc,this._logger=r.logger}var t;return sO(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,n=t.retryDelay,i=t.onRetryError,a=t.transformError,o=vO(t,oD),s=function(){var t=iO(tO().mark((function t(){var u,c,l;return tO().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(o);case 3:u=t.sent,e.promise.resolve(u),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,a&&(c=a(c)||c),i&&e._retryCount>0&&i(c,e._retryCount,{index:o.index,vid:o.vid,range:o.range,priOptions:o.priOptions}),e._retryCount++,l=!0,e._retryCheckFunc&&(l=e._retryCheckFunc(t.t0)),!(l&&e._retryCount<=r)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",o.range),e._retryTimer=Ew(s,n),t.abrupt("return");case 26:e.promise.reject(c);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=iO(tO().mark((function e(){return tO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function uD(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=Fl(t).call(t,Boolean)).length<2)return t[0];var n=new Uint8Array(MO(t).call(t,(function(e,t){return e+t.byteLength}),0)),i=0;return sf(t).call(t,(function(e){n.set(e,i),i+=e.byteLength})),n}function cD(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Hg((function(t){return Ew(t,e)}))}var lD=function(e){cO(n,e);var t,r=yO(n);function n(e){var t;return aO(this,n),uO(gO(t=r.call(this,e)),"type",vP),uO(gO(t),"_queue",[]),uO(gO(t),"_alive",[]),uO(gO(t),"_currentTask",null),uO(gO(t),"_finnalUrl",""),uO(gO(t),"_config",void 0),t._config=function(e){return eO({loaderType:vP,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:mP,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),t._config.loaderType!==gP&&iD.isSupported()||(t.type=gP),t.log=e.logger,t}return sO(n,[{key:"isFetch",value:function(){return this.type===vP}},{key:"load",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?r=e:r.url=e||r.url||this._config.url,(r=Q_({},this._config,r)).params&&(r.params=Q_({},r.params)),r.headers&&kP(r.headers)&&(r.headers=Q_({},r.headers)),r.body&&kP(r.body)&&(r.body=Q_({},r.body)),r.transformRequest&&(r=r.transformRequest(r)||r),r.logger=this.log;var n=new sD(this.type,r);return n.loader.on(rD,(function(e){t.emit(rD,e)})),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(t=iO(tO().mark((function e(){var t;return tO().wrap((function(e){for(var r,n,i;;)switch(e.prev=e.next){case 0:return t=Xn(r=M_(n=this._queue).call(n,(function(e){return e.cancel()}))).call(r,M_(i=this._alive).call(i,(function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Hg.all(t);case 6:return e.next=8,cD();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,r,n;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(r=e._alive)||void 0===r?void 0:r.length)>0&&(e._alive=Fl(n=e._alive).call(n,(function(t){return t&&t!==e._currentTask})));e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return iD.isSupported()}}]),n}(Rb),fD=function(){function e(){aO(this,e),uO(this,"_prevCurrentTime",0)}return sO(e,[{key:"do",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e){var i=e.currentTime,a=0;if(this._prevCurrentTime===i){var o=UO.info(UO.get(e),i);if(!o.buffers.length)return;r&&o.nextStart||o.nextStart&&o.nextStart-i<t?a=o.nextStart+.1:o.end&&o.end-i>n&&!e.seeking&&(a=i+.1)}this._prevCurrentTime=i,a&&i!==a&&(e.currentTime=a)}}}]),e}();eL("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),vL);var hD=re.Set,dD=Ae,pD=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"add"in e&&"delete"in e&&"keys"in e)return e;throw TypeError(dD(e)+" is not a set")},vD=CL,gD=se("Set"),yD=gD.prototype,mD={Set:gD,add:vD("add",1),has:vD("has",1),remove:vD("delete",1),proto:yD},_D=NL,bD=function(e,t,r){return r?_D(e.keys(),t):e.forEach(t)},wD=bD,kD=mD.Set,SD=mD.add,xD=function(e){var t=new kD;return wD(e,(function(e){SD(t,e)})),t},ED=function(e){return e.size},TD=Pe,AD=rr,LD=R,CD=Mr,OD=TypeError,PD=Math.max,DD=function(e,t,r,n){this.set=e,this.size=t,this.has=r,this.keys=n};DD.prototype={getIterator:function(){return AD(LD(this.keys,this.set))},includes:function(e){return LD(this.has,this.set,e)}};var RD=function(e){AD(e);var t=+e.size;if(t!=t)throw OD("Invalid size");return new DD(e,PD(CD(t),0),TD(e.has),TD(e.keys))},MD=pD,UD=xD,ID=ED,BD=RD,jD=bD,FD=NL,ND=mD.has,zD=mD.remove,VD=function(e){var t=MD(this),r=BD(e),n=UD(t);return ID(t)<=r.size?jD(t,(function(e){r.includes(e)&&zD(n,e)})):FD(r.getIterator(),(function(e){ND(t,e)&&zD(n,e)})),n},GD=function(){return!1},HD=VD;Lr({target:"Set",proto:!0,real:!0,forced:!GD()},{difference:HD});var qD=pD,KD=ED,WD=RD,YD=bD,JD=NL,QD=mD.Set,XD=mD.add,$D=mD.has,ZD=function(e){var t=qD(this),r=WD(e),n=new QD;return KD(t)>r.size?JD(r.getIterator(),(function(e){$D(t,e)&&XD(n,e)})):YD(t,(function(e){r.includes(e)&&XD(n,e)})),n},eR=ZD;Lr({target:"Set",proto:!0,real:!0,forced:!GD()},{intersection:eR});var tR=pD,rR=mD.has,nR=ED,iR=RD,aR=bD,oR=NL,sR=xh,uR=function(e){var t=tR(this),r=iR(e);if(nR(t)<=r.size)return!1!==aR(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==oR(n,(function(e){if(rR(t,e))return sR(n,"normal",!1)}))},cR=uR;Lr({target:"Set",proto:!0,real:!0,forced:!GD()},{isDisjointFrom:cR});var lR=pD,fR=ED,hR=bD,dR=RD,pR=function(e){var t=lR(this),r=dR(e);return!(fR(t)>r.size)&&!1!==hR(t,(function(e){if(!r.includes(e))return!1}),!0)},vR=pR;Lr({target:"Set",proto:!0,real:!0,forced:!GD()},{isSubsetOf:vR});var gR=pD,yR=mD.has,mR=ED,_R=RD,bR=NL,wR=xh,kR=function(e){var t=gR(this),r=_R(e);if(mR(t)<r.size)return!1;var n=r.getIterator();return!1!==bR(n,(function(e){if(!yR(t,e))return wR(n,"normal",!1)}))},SR=kR;Lr({target:"Set",proto:!0,real:!0,forced:!GD()},{isSupersetOf:SR});var xR=pD,ER=xD,TR=RD,AR=NL,LR=mD.add,CR=mD.has,OR=mD.remove,PR=function(e){var t=xR(this),r=TR(e).getIterator(),n=ER(t);return AR(r,(function(e){CR(t,e)?OR(n,e):LR(n,e)})),n},DR=PR;Lr({target:"Set",proto:!0,real:!0,forced:!GD()},{symmetricDifference:DR});var RR=pD,MR=mD.add,UR=xD,IR=RD,BR=NL,jR=function(e){var t=RR(this),r=IR(e).getIterator(),n=UR(t);return BR(r,(function(e){MR(n,e)})),n},FR=jR;Lr({target:"Set",proto:!0,real:!0,forced:!GD()},{union:FR});var NR=hD;Lr({target:"Set",stat:!0,forced:!0},{from:xL}),Lr({target:"Set",stat:!0,forced:!0},{of:TL});var zR=pD,VR=mD.add;Lr({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=zR(this),t=0,r=arguments.length;t<r;t++)VR(e,arguments[t]);return e}});var GR=pD,HR=mD.remove;Lr({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=GR(this),r=!0,n=0,i=arguments.length;n<i;n++)e=HR(t,arguments[n]),r=r&&e;return!!r}});var qR=Qt,KR=pD,WR=bD;Lr({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=KR(this),r=qR(e,arguments.length>1?arguments[1]:void 0);return!1!==WR(t,(function(e){if(!r(e,e,t))return!1}),!0)}});var YR=en,JR=$e,QR=K,XR=yu,$R=ht("iterator"),ZR=Object,eM=L,tM=function(e){if(QR(e))return!1;var t=ZR(e);return void 0!==t[$R]||"@@iterator"in t||JR(XR,YR(t))},rM=te,nM=se("Set"),iM=function(e){return function(e){return rM(e)&&"number"==typeof e.size&&eM(e.has)&&eM(e.keys)}(e)?e:tM(e)?new nM(e):e},aM=R,oM=iM,sM=VD;Lr({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return aM(sM,this,oM(e))}});var uM=Qt,cM=pD,lM=bD,fM=mD.Set,hM=mD.add;Lr({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=cM(this),r=uM(e,arguments.length>1?arguments[1]:void 0),n=new fM;return lM(t,(function(e){r(e,e,t)&&hM(n,e)})),n}});var dM=Qt,pM=pD,vM=bD;Lr({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=pM(this),r=dM(e,arguments.length>1?arguments[1]:void 0),n=vM(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}});var gM=R,yM=iM,mM=ZD;Lr({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return gM(mM,this,yM(e))}});var _M=R,bM=iM,wM=uR;Lr({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return _M(wM,this,bM(e))}});var kM=R,SM=iM,xM=pR;Lr({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return kM(xM,this,SM(e))}});var EM=R,TM=iM,AM=kR;Lr({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return EM(AM,this,TM(e))}});var LM=Lr,CM=c,OM=pD,PM=bD,DM=ei,RM=CM([].join),MM=CM([].push);LM({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=OM(this),r=void 0===e?",":DM(e),n=[];return PM(t,(function(e){MM(n,e)})),RM(n,r)}});var UM=Qt,IM=pD,BM=bD,jM=mD.Set,FM=mD.add;Lr({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=IM(this),r=UM(e,arguments.length>1?arguments[1]:void 0),n=new jM;return BM(t,(function(e){FM(n,r(e,e,t))})),n}});var NM=Pe,zM=pD,VM=bD,GM=TypeError;Lr({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=zM(this),r=arguments.length<2,n=r?void 0:arguments[1];if(NM(e),VM(t,(function(i){r?(r=!1,n=i):n=e(n,i,i,t)})),r)throw GM("Reduce of empty set with no initial value");return n}});var HM=Qt,qM=pD,KM=bD;Lr({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=qM(this),r=HM(e,arguments.length>1?arguments[1]:void 0);return!0===KM(t,(function(e){if(r(e,e,t))return!0}),!0)}});var WM=R,YM=iM,JM=PR;Lr({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return WM(JM,this,YM(e))}});var QM=R,XM=iM,$M=jR;Lr({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return QM($M,this,XM(e))}});var ZM=r(NR),eU=function(){function e(t){var r=this;aO(this,e),uO(this,"_seiSet",new ZM),this.emitter=t,t.on(VP,(function(e){e&&r._seiSet.add(e)}))}return sO(e,[{key:"throw",value:function(e,t){var r,n,i=this;if(null!=e&&this._seiSet.size){var a=e-.2,o=e+.2,s=[];sf(r=this._seiSet).call(r,(function(e){e.time>=a&&e.time<=o&&s.push(e)})),sf(s).call(s,(function(e){i._seiSet.delete(e),i.emitter.emit(GP,e)})),t&&sf(n=this._seiSet).call(n,(function(t){t.time<e-5&&i._seiSet.delete(t)}))}}},{key:"reset",value:function(){this._seiSet.clear()}}]),e}(),tU=function(){function e(t){aO(this,e),uO(this,"_chunkSpeed",0),uO(this,"_chunkCache",[]),uO(this,"_speeds",[]),uO(this,"_totalSize",0),uO(this,"_totalCost",0),this._opts=t||{}}return sO(e,[{key:"addRecord",value:function(e,t){var r;e&&t&&(this._speeds.push(8e3*e/t),this._speeds=my(r=this._speeds).call(r,-3))}},{key:"addChunkRecord",value:function(e,t){var r,n;if(e&&t&&!(e<((null===(r=this._opts)||void 0===r?void 0:r.skipChunkSize)||1e3))){this._totalSize+=e,this._totalCost+=t,this._chunkSpeed=8e3*e/t,this._chunkCache.push({size:e,duration:t,timestamp:performance.now()});var i,a=(null===(n=this._opts)||void 0===n?void 0:n.chunkCountForSpeed)||50;if(this._chunkCache.length>a)this._chunkCache=my(i=this._chunkCache).call(i,-a)}}},{key:"getAvgSpeed",value:function(){var e,t,r,n;if(!this._chunkCache.length&&!this._speeds.length)return 0;if(this._speeds.length)return MO(n=this._speeds).call(n,(function(e,t){return e+t}))/this._speeds.length;var i=this._chunkCache[this._chunkCache.length-1],a=performance.now()-i.timestamp;return a>((null===(r=this._opts)||void 0===r?void 0:r.longtimeNoReceived)||3e3)&&this._chunkCache.push({size:0,duration:a,timestamp:performance.now()}),8e3*MO(e=this._chunkCache).call(e,(function(e,t){return e+t.size}),0)/MO(t=this._chunkCache).call(t,(function(e,t){return e+t.duration}),0)}},{key:"getLatestSpeed",value:function(){return this._chunkCache.length||this._speeds.length?this._speeds.length?this._speeds[this._speeds.length-1]:this._chunkSpeed:0}},{key:"getTotalSize",value:function(){return this._totalSize}},{key:"getTotalCost",value:function(){return this._totalCost}},{key:"reset",value:function(){this._chunkCache=[],this._speeds=[],this._totalSize=0,this._totalCost=0}}]),e}(),rU=function(){function e(t){aO(this,e),uO(this,"encodeType",""),uO(this,"audioCodec",""),uO(this,"videoCodec",""),uO(this,"domain",""),uO(this,"fps",0),uO(this,"bitrate",0),uO(this,"width",0),uO(this,"height",0),uO(this,"samplerate",0),uO(this,"channelCount",0),uO(this,"gop",0),uO(this,"_bitsAccumulateSize",0),uO(this,"_bitsAccumulateDuration",0),uO(this,"_startGopId",-1),this._timescale=t}return sO(e,[{key:"getStats",value:function(){return{encodeType:this.encodeType,audioCodec:this.audioCodec,videoCodec:this.videoCodec,domain:this.domain,fps:this.fps,bitrate:this.bitrate,width:this.width,height:this.height,samplerate:this.samplerate,channelCount:this.channelCount,gop:this.gop}}},{key:"setEncodeType",value:function(e){this.encodeType=e}},{key:"setFpsFromScriptData",value:function(e){var t,r=e.data,n=null==r||null===(t=r.onMetaData)||void 0===t?void 0:t.framerate;n&&n>0&&n<100&&(this.fps=n)}},{key:"setVideoMeta",value:function(e){if(this.width=e.width,this.height=e.height,this.videoCodec=e.codec,this.encodeType=e.codecType,e.fpsNum&&e.fpsDen){var t=e.fpsNum/e.fpsDen;t>0&&t<100&&(this.fps=t)}}},{key:"setAudioMeta",value:function(e){this.audioCodec=e.codec,this.samplerate=e.sampleRate,this.channelCount=e.channelCount}},{key:"setDomain",value:function(e){var t;this.domain=my(t=e.split("/")).call(t,2,3)[0]}},{key:"updateBitrate",value:function(e){var t=this;if((!this.fps||this.fps>=100)&&e.length){var r=MO(e).call(e,(function(e,t){return e+t.duration}),0)/e.length;this.fps=Math.round(this._timescale/r)}sf(e).call(e,(function(e){var r;-1===t._startGopId&&(t._startGopId=e.gopId),e.gopId===t._startGopId&&t.gop++,t._bitsAccumulateDuration+=e.duration/(t._timescale/1e3),t._bitsAccumulateSize+=MO(r=e.units).call(r,(function(e,t){return e+t.length}),0),t._bitsAccumulateDuration>=1e3&&(t.bitrate=8*t._bitsAccumulateSize,t._bitsAccumulateDuration=0,t._bitsAccumulateSize=0)}))}}]),e}(),nU=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;aO(this,e),uO(this,"_core",null),uO(this,"_samples",[]),this._core=t,this._timescale=r,this._stats=new rU(r),this._bindEvents()}return sO(e,[{key:"getStats",value:function(){var e,t,r,n,i,a,o,s,u,c,l,f=(null===(e=this._core)||void 0===e?void 0:e.media)||{},h=f.currentTime,d=void 0===h?0:h,p=f.decodeFps,v=void 0===p?0:p;return eO(eO({},this._stats.getStats()),{},{downloadSpeed:(null===(t=this._core)||void 0===t||null===(r=t.speedInfo)||void 0===r?void 0:r.call(t).speed)||0,avgSpeed:(null===(n=this._core)||void 0===n||null===(i=n.speedInfo)||void 0===i?void 0:i.call(n).avgSpeed)||0,totalReceivedByte:(null===(a=this._core)||void 0===a||null===(o=a.speedInfo)||void 0===o?void 0:o.call(a).totalSize)||0,totalReceivedCost:(null===(s=this._core)||void 0===s||null===(u=s.speedInfo)||void 0===u?void 0:u.call(s).totalCost)||0,currentTime:d,bufferEnd:(null===(c=this._core)||void 0===c||null===(l=c.bufferInfo())||void 0===l?void 0:l.remaining)||0,decodeFps:v})}},{key:"_bindEvents",value:function(){var e=this;this._core.on(YP,(function(t){var r=t.videoTrack;return e._stats.updateBitrate(r.samples)})),this._core.on(HP,(function(t){e._stats.setFpsFromScriptData(t)})),this._core.on(zP,(function(t){"video"===t.type?e._stats.setVideoMeta(t.track):e._stats.setAudioMeta(t.track)})),this._core.on(CP,(function(t){e._stats.setDomain(t.responseUrl)}))}},{key:"reset",value:function(){this._samples=[],this._stats=new rU(this._timescale)}}]),e}();function iU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aU(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),Df(e,yU(n.key),n)}}function oU(e,t,r){return t&&aU(e.prototype,t),r&&aU(e,r),Df(e,"prototype",{writable:!1}),e}function sU(e,t,r){return(t=yU(t))in e?Df(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Uf(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Df(e,"prototype",{writable:!1}),t&&lU(e,t)}function cU(e){var t;return(cU=Nf?Iy(t=Ff).call(t):function(e){return e.__proto__||Ff(e)})(e)}function lU(e,t){var r;return(lU=Nf?Iy(r=Nf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function fU(e,t){if(t&&("object"===Cl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function hU(e){var t=function(){if("undefined"==typeof Reflect||!Xy)return!1;if(Xy.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Xy(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=cU(e);if(t){var i=cU(this).constructor;r=Xy(n,arguments,i)}else r=n.apply(this,arguments);return fU(this,r)}}function dU(e,t){return function(e){if(U_(e))return e}(e)||function(e,t){var r=null==e?null:void 0!==Rf&&ab(e)||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||vU(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pU(e){return function(e){if(U_(e))return gU(e)}(e)||function(e){if(void 0!==Rf&&null!=ab(e)||null!=e["@@iterator"])return wb(e)}(e)||vU(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vU(e,t){var r;if(e){if("string"==typeof e)return gU(e,t);var n=my(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?wb(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gU(e,t):void 0}}function gU(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yU(e){var t=function(e,t){if("object"!==Cl(e)||null===e)return e;var r=e[$y];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Cl(t)?t:String(t)}var mU="video",_U="audio",bU="metadata",wU="avc",kU="hevc",SU="aac",xU="g7110a",EU="g7110m",TU="opus",AU="mp3",LU="LARGE_AV_SHIFT",CU="LARGE_VIDEO_GAP",OU="LARGE_VIDEO_GAP_BETWEEN_CHUNK",PU="LARGE_AUDIO_GAP",DU="AUDIO_FILLED",RU="AUDIO_DROPPED",MU=function(){function e(){iU(this,e),sU(this,"id",1),sU(this,"type",mU),sU(this,"codecType",wU),sU(this,"pid",-1),sU(this,"hvcC",void 0),sU(this,"codec",""),sU(this,"timescale",0),sU(this,"formatTimescale",0),sU(this,"sequenceNumber",0),sU(this,"baseMediaDecodeTime",0),sU(this,"baseDts",0),sU(this,"duration",0),sU(this,"warnings",[]),sU(this,"samples",[]),sU(this,"pps",[]),sU(this,"sps",[]),sU(this,"vps",[]),sU(this,"fpsNum",0),sU(this,"fpsDen",0),sU(this,"sarRatio",[]),sU(this,"width",0),sU(this,"height",0),sU(this,"nalUnitSize",4),sU(this,"present",!1),sU(this,"isVideoEncryption",!1),sU(this,"isAudioEncryption",!1),sU(this,"isVideo",!0),sU(this,"lastKeyFrameDts",0),sU(this,"kid",null),sU(this,"pssh",null),sU(this,"ext",void 0)}return oU(e,[{key:"reset",value:function(){this.sequenceNumber=this.width=this.height=this.fpsDen=this.fpsNum=this.duration=this.baseMediaDecodeTime=this.timescale=0,this.codec="",this.present=!1,this.pid=-1,this.pps=[],this.sps=[],this.vps=[],this.sarRatio=[],this.samples=[],this.warnings=[],this.hvcC=null}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}},{key:"exist",value:function(){return!!/av01/.test(this.codec)||!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isVideoEncryption}}]),e}(),UU=function(){function e(){iU(this,e),sU(this,"id",2),sU(this,"type",_U),sU(this,"codecType",SU),sU(this,"pid",-1),sU(this,"codec",""),sU(this,"container",""),sU(this,"sequenceNumber",0),sU(this,"sampleDuration",0),sU(this,"timescale",0),sU(this,"formatTimescale",0),sU(this,"baseMediaDecodeTime",0),sU(this,"duration",0),sU(this,"warnings",[]),sU(this,"samples",[]),sU(this,"baseDts",0),sU(this,"sampleSize",16),sU(this,"sampleRate",0),sU(this,"channelCount",0),sU(this,"objectType",0),sU(this,"sampleRateIndex",0),sU(this,"config",[]),sU(this,"present",!1),sU(this,"isVideoEncryption",!1),sU(this,"isAudioEncryption",!1),sU(this,"kid",null),sU(this,"ext",void 0)}return oU(e,[{key:"reset",value:function(){this.sequenceNumber=0,this.timescale=0,this.sampleDuration=0,this.sampleRate=0,this.channelCount=0,this.baseMediaDecodeTime=0,this.present=!1,this.pid=-1,this.codec="",this.samples=[],this.config=[],this.warnings=[]}},{key:"exist",value:function(){return!(!this.sampleRate||!this.channelCount||!this.codec&&!this.container||this.codecType!==SU&&this.codecType!==xU&&this.codecType!==EU&&this.codecType!==TU&&this.codecType!==AU)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isAudioEncryption}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}}]),e}(),IU=function(){function e(t,r,n){iU(this,e),sU(this,"flag",{}),sU(this,"keyframe",!1),sU(this,"gopId",0),sU(this,"duration",0),sU(this,"size",0),sU(this,"units",[]),sU(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return oU(e,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),e}(),BU=oU((function e(t,r,n,i){iU(this,e),sU(this,"duration",1024),sU(this,"flag",{dependsOn:2,isNonSyncSample:0}),sU(this,"keyframe",!0),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,this.sampleOffset=i,n&&(this.duration=n)})),jU=oU((function e(t,r){iU(this,e),sU(this,"time",0),this.data=t,this.originPts=this.pts=r})),FU=function(e){uU(r,e);var t=hU(r);function r(){return iU(this,r),t.apply(this,arguments)}return oU(r)}(jU),NU=function(e){uU(r,e);var t=hU(r);function r(){return iU(this,r),t.apply(this,arguments)}return oU(r)}(jU),zU=function(){function e(){iU(this,e),sU(this,"id",3),sU(this,"type",bU),sU(this,"timescale",0),sU(this,"flvScriptSamples",[]),sU(this,"seiSamples",[])}return oU(e,[{key:"exist",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length||!this.timescale)}},{key:"reset",value:function(){this.timescale=0,this.flvScriptSamples=[],this.seiSamples=[]}},{key:"hasSample",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length)}}]),e}(),VU=h.isFinite;Lr({target:"Number",stat:!0},{isFinite:Number.isFinite||function(e){return"number"==typeof e&&VU(e)}});var GU=r(re.Number.isFinite),HU=function(){function e(t){iU(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return oU(e,[{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).warn.apply(r,Xn(t=[this._prefix]).call(t,i))}}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();sU(HU,"disabled",!0);var qU="undefined"!=typeof window,KU=qU&&navigator.userAgent.toLocaleLowerCase(),WU=qU&&/^((?!chrome|android).)*safari/.test(KU),YU=qU&&dA(KU).call(KU,"firefox"),JU=qU&&dA(KU).call(KU,"android"),QU=function(){function e(){iU(this,e)}return oU(e,null,[{key:"getRateIndexByRate",value:function(t){var r;return xm(r=e.FREQ).call(r,t)}},{key:"parseADTS",value:function(t,r){for(var n=t.length,i=0;i+2<n&&(255!==t[i]||240!=(246&t[i+1]));)i++;if(!(i>=n)){var a=i,o=[],s=(60&t[i+2])>>>2,u=e.FREQ[s];if(!u)throw new Error("Invalid sampling index: ".concat(s));for(var c,l,f=1+((192&t[i+2])>>>6),h=(1&t[i+2])<<2|(192&t[i+3])>>>6,d=e._getConfig(s,h,f),p=d.config,v=d.codec,g=0,y=e.getFrameDuration(u);i+7<n;)if(255===t[i]&&240==(246&t[i+1])){if(!(l=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5)||n-i<l)break;c=2*(1&~t[i+1]),o.push({pts:r+g*y,data:t.subarray(i+7+c,i+l)}),g++,i+=l}else i++;return{skip:a,remaining:i>=n?void 0:t.subarray(i),frames:o,samplingFrequencyIndex:s,sampleRate:u,objectType:f,channelCount:h,codec:v,config:p,originCodec:"mp4a.40.".concat(f)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var r=t[0]>>>3,n=(7&t[0])<<1|t[1]>>>7,i=(120&t[1])>>>3,a=e.FREQ[n];if(a){var o=e._getConfig(n,i,r);return{samplingFrequencyIndex:n,sampleRate:a,objectType:r,channelCount:i,config:o.config,codec:o.codec,originCodec:"mp4a.40.".concat(r)}}}}},{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"_getConfig",value:function(e,t,r){var n,i,a=[];return YU?e>=6?(n=5,i=e-3):(n=2,i=e):JU?(n=2,i=e):(n=2===r||5===r?r:5,i=e,e>=6?i=e-3:1===t&&(n=2,i=e)),a[0]=n<<3,a[0]|=(14&e)>>1,a[1]=(1&e)<<7,a[1]|=t<<3,5===n&&(a[1]|=(14&i)>>1,a[2]=(1&i)<<7,a[2]|=8,a[3]=0),{config:a,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),e}();sU(QU,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var XU=Lr,$U=c,ZU=ai,eI=RangeError,tI=String.fromCharCode,rI=String.fromCodePoint,nI=$U([].join);XU({target:"String",stat:!0,arity:1,forced:!!rI&&1!=rI.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],ZU(t,1114111)!==t)throw eI(t+" is not a valid code point");r[i]=t<65536?tI(t):tI(55296+((t-=65536)>>10),t%1024+56320)}return nI(r,"")}});var iI=r(re.String.fromCodePoint),aI=function(){function e(){iU(this,e)}return oU(e,null,[{key:"getFrameDuration",value:function(e){return 20}},{key:"parseHeaderPackets",value:function(e){if(e.length){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r="",n=0;n<8;n++)r+=iI(e[n]);if("OpusHead"!==r)throw new Error("Invalid Opus MagicSignature");var i=e[9];console.log("Pre-skip",e[10],e[11]);var a=t.getUint32(12,!0),o=t.getInt16(16,!0);if(a){return{outputGain:o,sampleRate:a,channelCount:i,config:new Uint8Array(e.buffer,e.byteOffset+8,e.byteLength-8),codec:"opus",originCodec:"opus"}}}}}]),e}(),oI=1e3,sI=5e3,uI=function(){function e(t,r,n){iU(this,e),this.videoTrack=t,this.audioTrack=r,this.metadataTrack=n,this._baseDts=-1,this._baseDtsInited=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastVideoDuration=0,this._keyFrameInNextChunk=!1,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0}return oU(e,[{key:"fix",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=Math.round(1e3*t);var i=this.videoTrack,a=this.audioTrack;if(!r&&n||(this._videoLastSample=null,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0),r&&!n&&(this._baseDtsInited=!1),this._baseDtsInited||this._calculateBaseDts(a,i),!n&&t&&(this._audioNextPts=this._videoNextDts=t),this._baseDtsInited&&(this._videoTimestampBreak||!this.videoTrack.exist())&&(this._audioTimestampBreak||!this.audioTrack.exist())&&this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(a),this._keyFrameInNextChunk=!1,this._fixVideo(i),this.metadataTrack.exist()){var o,s,u=this.metadataTrack.timescale;sf(o=this.metadataTrack.seiSamples).call(o,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/u})),sf(s=this.metadataTrack.flvScriptSamples).call(s,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/u}))}i.samples.length&&(i.baseMediaDecodeTime=i.samples[0].dts),a.samples.length&&(a.baseMediaDecodeTime=a.samples[0].pts*a.timescale/1e3)}},{key:"_fixVideo",value:function(e){var t=this,r=e.samples;if(r.length){var n;if(sf(r).call(r,(function(e){e.dts-=t._baseDts,e.pts-=t._baseDts,e.keyframe&&(t._keyFrameInNextChunk=!0)})),e.fpsNum&&e.fpsDen)n=e.timescale*(e.fpsDen/e.fpsNum);else if(e.length>1){var i=e.samples[0],a=e.samples[r.length-1];n=Math.floor((a.dts-i.dts)/(r.length-1))}else n=this._lastVideoDuration||40;var o=r.pop();if(this._videoLastSample&&r.unshift(this._videoLastSample),this._videoLastSample=o,r.length){if(void 0===this._videoNextDts){var s=r[0];this._videoNextDts=s.dts}var u=r.length,c=0,l=r[0],f=this._videoNextDts-l.dts;if(Math.abs(f)>200){var h;if(Math.abs(l.dts-this._lastVideoExceptionChunkFirstDtsDot)>5e3)this._lastVideoExceptionChunkFirstDtsDot=l.dts,e.warnings.push({type:OU,nextDts:this._videoNextDts,firstSampleDts:l.dts,nextSampleDts:null===(h=r[1])||void 0===h?void 0:h.dts,sampleDuration:f});this._videoTimestampBreak>=5?(this._videoNextDts=l.dts,this._videoTimestampBreak=0):(l.dts+=f,l.pts+=f,this.audioTrack.exist()||(this._videoTimestampBreak=1))}for(var d=0;d<u;d++){var p=r[d].dts,v=r[d+1];((c=d<u-1?v.dts-p:o?o.dts-p:n)>1e3||c<0)&&(this._videoTimestampBreak++,Math.abs(p-this._lastVideoExceptionLargeGapDot)>5e3&&(this._lastVideoExceptionLargeGapDot=p,e.warnings.push({type:CU,time:p/e.timescale,dts:p,originDts:r[d].originDts,nextDts:this._videoNextDts,sampleDuration:c,refSampleDuration:n})),c=n),r[d].duration=c,this._videoNextDts+=c,this._lastVideoDuration=c}}}}},{key:"_fixAudio",value:function(e){var t=this,r=e.samples;r.length&&(sf(r).call(r,(function(e){e.dts=e.pts-=t._baseDts})),this._doFixAudioInternal(e,r,1e3))}},{key:"_calculateBaseDts",value:function(e,t){var r=e.samples,n=t.samples;if(!r.length&&!n.length)return!1;var i=1/0,a=1/0;r.length&&(e.baseDts=i=r[0].pts),n.length&&(t.baseDts=a=n[0].dts),this._baseDts=Math.min(i,a);var o=a-i;return GU(o)&&Math.abs(o)>500&&t.warnings.push({type:LU,videoBaseDts:a,audioBasePts:i,baseDts:this._baseDts,delta:o}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){this._calculateBaseDts(this.audioTrack,this.videoTrack)&&(this.audioTrack.exist()?this.videoTrack.exist()?this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts):this._baseDts-=this._audioNextPts:this._baseDts-=this._videoNextDts,this._videoTimestampBreak=0,this._audioTimestampBreak=0)}},{key:"_doFixAudioInternal",value:function(e,t,r){if(!e.sampleDuration)switch(e.codecType){case SU:e.sampleDuration=QU.getFrameDuration(e.timescale,r);break;case TU:e.sampleDuration=aI.getFrameDuration(e.samples,r);break;case xU:case EU:e.sampleDuration=this._getG711Duration(e);break;default:console.error("can't fix audio codecType:",e.codecType)}var n=e.sampleDuration,i=e.codecType===TU?20:e.codecType===SU?1024:n*e.timescale/1e3;if(void 0===this._audioNextPts){var a=t[0];this._audioNextPts=a.pts}for(var o=0;o<t.length;o++){var s=this._audioNextPts,u=t[o],c=u.pts-s;if(0===o&&this._audioTimestampBreak>=5&&this._keyFrameInNextChunk&&(s=this._audioNextPts=u.dts,c=0,this._audioTimestampBreak=0),!this._audioTimestampBreak&&c>=3*n&&c<=oI&&!WU){var l=this._getSilentFrame(e)||t[0].data.subarray(),f=Math.floor(c/n);Math.abs(u.pts-this._lastAudioExceptionGapDot)>sI&&(this._lastAudioExceptionGapDot=u.pts,e.warnings.push({type:DU,pts:u.pts,originPts:u.originPts,count:f,nextPts:s,refSampleDuration:n}));for(var h=0;h<f;h++){var d=new BU(Math.floor(this._audioNextPts+n)-Math.floor(this._audioNextPts),l,i);d.originPts=Math.floor(this._baseDts+s),a_(t).call(t,o,0,d),this._audioNextPts+=n,o++}o--}else if(c<=-3*n&&c>=-1e3)Math.abs(u.pts-this._lastAudioExceptionOverlapDot)>sI&&(this._lastAudioExceptionOverlapDot=u.pts,e.warnings.push({type:RU,pts:u.pts,originPts:u.originPts,nextPts:s,refSampleDuration:n})),a_(t).call(t,o,1),o--;else{if(Math.abs(c)>oI&&(this._audioTimestampBreak++,Math.abs(u.pts-this._lastAudioExceptionLargeGapDot)>sI&&(this._lastAudioExceptionLargeGapDot=u.pts,e.warnings.push({type:PU,time:u.pts/1e3,pts:u.pts,originPts:u.originPts,nextPts:s,sampleDuration:c,refSampleDuration:n}))),e.codecType===TU){var p=t[t.length-1];p&&(p.duration=u.pts-p.pts)}else u.dts=u.pts=s,u.duration=i;this._audioNextPts+=n}}}},{key:"_getG711Duration",value:function(e){var t=e.sampleSize,r=e.channelCount,n=e.sampleRate,i=e.samples[0];if(i)return 2*i.data.byteLength/r/(t/8)/n*1e3}},{key:"_getSilentFrame",value:function(e){return e.codecType===SU?QU.getSilentFrame(e.codec,e.channelCount):new Uint8Array(8*e.sampleDuration*e.channelCount)}}]),e}();function cI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=Fl(t).call(t,Boolean);var n=new Uint8Array(MO(t).call(t,(function(e,t){return e+t.byteLength}),0)),i=0;return sf(t).call(t,(function(e){n.set(e,i),i+=e.byteLength})),n}function lI(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function fI(e){for(var t,r="avc1.",n=0;n<3;n++)(t=e[n].toString(16)).length<2&&(t="0".concat(t)),r+=t;return r}function hI(e){if(!U_(e)){for(var t=[],r="",n=0;n<e.length;n++)n%2&&(r=e[n-1]+e[n],t.push(L_(r,16)),r="");return t}return M_(e).call(e,(function(e){return L_(e,16)}))}var dI=function(){function e(){iU(this,e)}return oU(e,null,[{key:"parseAnnexB",value:function(e){for(var t=e.length,r=2,n=0;null!==e[r]&&void 0!==e[r]&&1!==e[r];)r++;if((n=++r+2)>=t)return[];for(var i=[];n<t;)switch(e[n]){case 0:if(0!==e[n-1]){n+=2;break}if(0!==e[n-2]){n++;break}r!==n-2&&i.push(e.subarray(r,n-2));do{n++}while(1!==e[n]&&n<t);n=(r=n+1)+2;break;case 1:if(0!==e[n-1]||0!==e[n-2]){n+=3;break}r!==n-2&&i.push(e.subarray(r,n-2)),n=(r=n+1)+2;break;default:n+=3}return r<t&&i.push(e.subarray(r)),i}},{key:"parseAvcC",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var r,n=e.length,i=[],a=0;a+t<n;)if(r=lI(e,a),3===t&&(r>>>=8),a+=t,r){if(a+r>n)break;i.push(e.subarray(a,a+r)),a+=r}return i}}},{key:"parseSEI",value:function(e,t){for(var r=e.length,n=t?2:1,i=0,a=0,o="";255===e[n];)i+=255,n++;for(i+=e[n++];255===e[n];)a+=255,n++;if(a+=e[n++],5===i&&r>n+16)for(var s=0;s<16;s++)o+=e[n].toString(16),n++;return{payload:e.subarray(n,n+a),type:i,size:a,uuid:o}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,r=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(!r.length)return e;var i=t-r.length,a=new Uint8Array(i),o=0;for(n=0;n<i;o++,n++)o===r[0]&&(o++,r.shift()),a[n]=e[o];return a}}]),e}(),pI=function(){function e(t){if(iU(this,e),sU(this,"_bytesAvailable",void 0),sU(this,"_bitsAvailable",0),sU(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return oU(e,[{key:"bitsAvailable",get:function(){return this._bitsAvailable}},{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw new Error("No bytes available");var r=new Uint8Array(4);r.set(this._data.subarray(e,e+t)),this._word=new DataView(r.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{e-=this._bitsAvailable;var t=Math.floor(e/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw new Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),r=this._word>>>32-t;return this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable?r<<t|this.readBits(t):r}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if(0!=(this._word&2147483648>>>e))return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,r=8,n=0;n<e;n++)0!==r&&(r=(t+this.readEG()+256)%256),t=0===r?t:r}}]),e}(),vI=function(){function e(){iU(this,e)}return oU(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var r,n,i=1+(3&t[4]),a=[],o=[],s=6,u=31&t[5],c=0;c<u;c++)if(n=t[s]<<8|t[s+1],s+=2,n){var l=t.subarray(s,s+n);s+=n,a.push(l),r||(r=e.parseSPS(dI.removeEPB(l)))}var f,h=t[s];s++;for(var d=0;d<h;d++)f=t[s]<<8|t[s+1],s+=2,f&&(o.push(t.subarray(s,s+f)),s+=f);return{sps:r,spsArr:a,ppsArr:o,nalUnitSize:i}}}},{key:"parseSPS",value:function(e){var t=new pI(e);t.readUByte();var r=t.readUByte(),n=t.readUByte(),i=t.readUByte();t.skipUEG();var a=420;if(100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r){var o=t.readUEG();if(o<=3&&(a=[0,420,422,444][o]),3===o&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var s=3!==o?8:12,u=0;u<s;u++)t.readBool()&&(u<6?t.skipScalingList(16):t.skipScalingList(64))}t.skipUEG();var c=t.readUEG();if(0===c)t.readUEG();else if(1===c){t.skipBits(1),t.skipUEG(),t.skipUEG();for(var l=t.readUEG(),f=0;f<l;f++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var h=t.readUEG(),d=t.readUEG(),p=t.readBits(1);0===p&&t.skipBits(1),t.skipBits(1);var v,g,y,m,_,b=0,w=0,k=0,S=0;if(t.readBool()&&(b=t.readUEG(),w=t.readUEG(),k=t.readUEG(),S=t.readUEG()),t.readBool()){if(t.readBool())switch(t.readUByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUByte()<<8|t.readUByte(),t.readUByte()<<8|t.readUByte()]}if(t.readBool()&&t.readBool(),t.readBool()&&(t.readBits(4),t.readBool()&&t.readBits(24)),t.readBool()&&(t.readUEG(),t.readUEG()),t.readBool()){var x=t.readBits(32),E=t.readBits(32);g=t.readBool(),_=(y=E)/(m=2*x)}}return{codec:fI(e.subarray(1,4)),profileIdc:r,profileCompatibility:n,levelIdc:i,chromaFormat:a,width:Math.ceil(16*(h+1)-2*(b+w)),height:(2-p)*(d+1)*16-(p?2:4)*(k+S),sarRatio:v,fpsNum:y,fpsDen:m,fps:_,fixedFrame:g}}}]),e}(),gI=function(){function e(){iU(this,e)}return oU(e,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t.length<23)){r=r||{};for(var n,i,a,o,s,u=1+(3&t[21]),c=[],l=[],f=[],h=23,d=t[22],p=0;p<d;p++){a=63&t[h],o=t[h+1]<<8|t[h+2],h+=3;for(var v=0;v<o;v++)if(s=t[h]<<8|t[h+1],h+=2,s){switch(a){case 32:var g=t.subarray(h,h+s);n||(n=e.parseVPS(dI.removeEPB(g),r)),f.push(g);break;case 33:var y=t.subarray(h,h+s);i||(i=e.parseSPS(dI.removeEPB(y),r)),c.push(y);break;case 34:l.push(t.subarray(h,h+s))}h+=s}}return{hvcC:r,sps:i,spsArr:c,ppsArr:l,vpsArr:f,nalUnitSize:u}}}},{key:"parseVPS",value:function(t,r){r=r||{};var n=new pI(t);n.readUByte(),n.readUByte(),n.readBits(12);var i=n.readBits(3);return r.numTemporalLayers=Math.max(r.numTemporalLayers||0,i+1),n.readBits(17),e._parseProfileTierLevel(n,i,r),r}},{key:"parseSPS",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=r||{};var n=new pI(t);n.readUByte(),n.readUByte(),n.readBits(4);var i=n.readBits(3);r.numTemporalLayers=Math.max(i+1,r.numTemporalLayers||0),r.temporalIdNested=n.readBits(1),e._parseProfileTierLevel(n,i,r),n.readUEG();var a=r.chromaFormatIdc=n.readUEG(),o=420;a<=3&&(o=[0,420,422,444][a]);var s=0;3===a&&(s=n.readBits(1));var u,c,l,f,h=n.readUEG(),d=n.readUEG(),p=n.readBits(1);(1===p&&(u=n.readUEG(),c=n.readUEG(),l=n.readUEG(),f=n.readUEG()),r.bitDepthLumaMinus8=n.readUEG(),r.bitDepthChromaMinus8=n.readUEG(),1===p)&&(h-=(1!==a&&2!==a||0!==s?1:2)*(c+u),d-=(1===a&&0===s?2:1)*(f+l));return{codec:"hev1.1.6.L93.B0",width:h,height:d,chromaFormat:o,hvcC:r}}},{key:"_parseProfileTierLevel",value:function(e,t,r){var n=r.generalTierFlag||0;r.generalProfileSpace=e.readBits(2),r.generalTierFlag=Math.max(e.readBits(1),n),r.generalProfileIdc=Math.max(e.readBits(5),r.generalProfileIdc||0),r.generalProfileCompatibilityFlags=e.readBits(32),r.generalConstraintIndicatorFlags=[e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8)];var i=e.readBits(8);n<r.generalTierFlag?r.generalLevelIdc=i:r.generalLevelIdc=Math.max(i,r.generalLevelIdc||0);var a=[],o=[];if(t>e.bitsAvailable)throw new Error("maxSubLayersMinus inavlid size ".concat(t));for(var s=0;s<t;s++)a[s]=e.readBits(1),o[s]=e.readBits(1);t>0&&e.readBits(2*(8-t));for(var u=0;u<t;u++)0!==a[u]&&(e.readBits(2),e.readBits(1),e.readBits(5),e.readBits(16),e.readBits(16),e.readBits(4),e.readBits(16),e.readBits(16),e.readBits(12)),0!==o[u]&&e.readBits(8)}}]),e}(),yI=function(){function e(){iU(this,e)}return oU(e,null,[{key:"decode",value:function(t){for(var r=[],n=t,i=0,a=t.length;i<a;)if(n[i]<128)r.push(String.fromCharCode(n[i])),++i;else{if(n[i]<192);else if(n[i]<224){if(e._checkContinuation(n,i,1)){var o=(31&n[i])<<6|63&n[i+1];if(o>=128){r.push(String.fromCharCode(65535&o)),i+=2;continue}}}else if(n[i]<240){if(e._checkContinuation(n,i,2)){var s=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(s>=2048&&55296!=(63488&s)){r.push(String.fromCharCode(65535&s)),i+=3;continue}}}else if(n[i]<248&&e._checkContinuation(n,i,3)){var u=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3];if(u>65536&&u<1114112){u-=65536,r.push(String.fromCharCode(u>>>10|55296)),r.push(String.fromCharCode(1023&u|56320)),i+=4;continue}}r.push(String.fromCharCode(65533)),++i}return r.join("")}},{key:"_checkContinuation",value:function(e,t,r){var n=e;if(t+r<n.length){for(;r--;)if(128!=(192&n[++t]))return!1;return!0}return!1}}]),e}(),mI=function(){function e(){iU(this,e)}return oU(e,null,[{key:"parse",value:function(t){if(!(t.length<3)){var r={},n=e._parseValue(new DataView(t.buffer,t.byteOffset,t.byteLength)),i=e._parseValue(new DataView(t.buffer,t.byteOffset+n.size,t.byteLength-n.size));return r[n.data]=i.data,r}}},{key:"_parseValue",value:function(t){var r,n=t.byteLength,i=1,a=!1;switch(t.getUint8(0)){case 0:r=t.getFloat64(1),i+=8;break;case 1:r=!!t.getUint8(1),i+=1;break;case 2:var o=e._parseString(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i));r=o.data,i+=o.size;break;case 3:r={};var s=0;for(9==(16777215&t.getUint32(n-4))&&(s=3);i<n-4;){var u=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-s)),c=u.size,l=u.data;if(u.isEnd)break;r[l.name]=l.value,i+=c}if(i<=n-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 8:r={},i+=4;var f=0;for(9==(16777215&t.getUint32(n-4))&&(f=3);i<n-8;){var h=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-f)),d=h.size,p=h.data;if(h.isEnd)break;r[p.name]=p.value,i+=d}if(i<=n-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 9:r=void 0,i=1,a=!0;break;case 10:r=[];var v=t.getUint32(1);i+=4;for(var g=0;g<v;g++){var y=e._parseValue(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i)),m=y.data,_=y.size;r.push(m),i+=_}break;case 11:var b=t.getFloat64(i)+6e4*t.getInt16(i+8);r=new Date(b),i+=10;break;case 12:var w=t.getUint32(1);i+=4,r="",w>0&&(r=yI.decode(new Uint8Array(t.buffer,t.byteOffset+i,w))),i+=w;break;default:i=n}return{data:r,size:i,isEnd:a}}},{key:"_parseString",value:function(e){var t=e.getUint16(0),r="";return t>0&&(r=yI.decode(new Uint8Array(e.buffer,e.byteOffset+2,t))),{data:r,size:2+t}}},{key:"_parseObject",value:function(t){if(!(t.byteLength<3)){var r=e._parseString(t),n=e._parseValue(new DataView(t.buffer,t.byteOffset+r.size,t.byteLength-r.size));return{data:{name:r.data,value:n.data},size:r.size+n.size,isEnd:n.isEnd}}}}]),e}(),_I=7,bI=8,wI=10,kI=13,SI=new HU("FlvDemuxer"),xI=function(){function e(t,r,n){iU(this,e),sU(this,"_headerParsed",!1),sU(this,"_remainingData",null),sU(this,"_gopId",0),sU(this,"_needAddMetaBeforeKeyFrameNal",!0),this.videoTrack=t||new MU,this.audioTrack=r||new UU,this.metadataTrack=n||new zU,this._fixer=new uI(this.videoTrack,this.audioTrack,this.metadataTrack)}return oU(e,[{key:"demux",value:function(t){var r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3?arguments[3]:void 0,o=this.audioTrack,s=this.videoTrack,u=this.metadataTrack;if(!n&&i||(this._remainingData=null),n&&(this._headerParsed=!1),n?(s.reset(),o.reset(),u.reset()):(s.samples=[],o.samples=[],u.seiSamples=[],u.flvScriptSamples=[],s.warnings=[],o.warnings=[],this._remainingData&&(t=cI(this._remainingData,t),this._remainingData=null)),!t.length)return{videoTrack:s,audioTrack:o,metadataTrack:u};var c=0;if(!this._headerParsed){if(!e.probe(t))throw new Error("Invalid flv file");o.present=(4&t[4])>>>2!=0,s.present=0!=(1&t[4]),this._headerParsed=!0,c=lI(t,5)+4}for(var l,f,h,d,p,v=t.length;c+15<v&&(l=t[c],!(c+15+(f=t[c+1]<<16|t[c+2]<<8|t[c+3])>v));){var g;h=(t[c+7]<<24>>>0)+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6],c+=11,d=t.subarray(c,c+f),8===l?this._parseAudio(d,h):9===l?(a&&(this.seamlessLoadingSwitching=!0),this._parseVideo(d,h)):18===l?this._parseScript(d,h):SI.warn("Invalid tag type: ".concat(l)),(p=lI(t,c+=f))!==11+f&&SI.warn(Xn(g="Invalid PrevTagSize ".concat(p," (")).call(g,11+f,")")),c+=4}c<v&&(this._remainingData=t.subarray(c)),o.formatTimescale=s.formatTimescale=s.timescale=u.timescale=1e3,o.timescale=o.codecType===TU?1e3:o.sampleRate||0,!o.exist()&&o.hasSample()&&o.reset(),!s.exist()&&s.hasSample()&&s.reset();var y=u.flvScriptSamples[u.flvScriptSamples.length-1],m=null==y||null===(r=y.data)||void 0===r?void 0:r.onMetaData;return m&&(null!=s&&s.exist()&&(m.hasOwnProperty("duration")&&(s.duration=1e3*m.duration),m.hasOwnProperty("width")&&m.hasOwnProperty("height")&&(s.width=m.width,s.height=m.height)),null!=o&&o.exist()&&m.hasOwnProperty("duration")&&(o.duration=1e3*m.duration)),{videoTrack:s,audioTrack:o,metadataTrack:u}}},{key:"fix",value:function(e,t,r){return this._fixer.fix(e,t,r),{videoTrack:this.videoTrack,audioTrack:this.audioTrack,metadataTrack:this.metadataTrack}}},{key:"demuxAndFix",value:function(e,t,r,n,i){return this.demux(e,t,r,i),this.fix(n,t,r)}},{key:"_parseAudio",value:function(t,r){if(t.length){var n=(240&t[0])>>>4,i=this.audioTrack;if(n!==wI&&n!==_I&&n!==bI&&n!==kI)return SI.warn("Unsupported sound format: ".concat(n)),void i.reset();if(n!==wI&&n!==kI){var a=(12&t[0])>>2,o=(2&t[0])>>1,s=1&t[0];i.sampleRate=e.AUDIO_RATE[a],i.sampleSize=o?16:8,i.channelCount=s+1}switch(n){case _I:case bI:this._parseG711(t,r,n);break;case wI:this._parseAac(t,r);break;case kI:this._parseOpus(t,r)}}}},{key:"_parseOpus",value:function(e,t){var r=this.audioTrack,n=e[1];switch(r.codecType=TU,n){case 0:var i=aI.parseHeaderPackets(e.subarray(2));i?(r.codec=i.codec,r.channelCount=i.channelCount,r.sampleRate=i.sampleRate,r.config=i.config,r.sampleDuration=aI.getFrameDuration([],r.timescale)):(r.reset(),SI.warn("Cannot parse AudioSpecificConfig",e));break;case 1:if(null==t)return;var a=new BU(t,e.subarray(2),r.sampleDuration);r.samples.push(a);break;default:SI.warn("Unknown OpusPacketType: ".concat(n))}}},{key:"_parseG711",value:function(e,t,r){var n=this.audioTrack;n.codecType=7===r?xU:EU,n.sampleRate=8e3,n.codec=n.codecType,n.samples.push(new BU(t,e.subarray(1)))}},{key:"_parseAac",value:function(e,t){var r=this.audioTrack;if(r.codecType=SU,0===e[1]){var n=QU.parseAudioSpecificConfig(e.subarray(2));n?(r.codec=n.codec,r.channelCount=n.channelCount,r.sampleRate=n.sampleRate,r.config=n.config,r.objectType=n.objectType,r.sampleRateIndex=n.samplingFrequencyIndex):(r.reset(),SI.warn("Cannot parse AudioSpecificConfig",e))}else if(1===e[1]){if(null==t)return;r.samples.push(new BU(t,e.subarray(2)))}else SI.warn("Unknown AACPacketType: ".concat(e[1]))}},{key:"_parseVideo",value:function(e,t){var r=this;if(!(e.length<6)){var n=(240&e[0])>>>4,i=15&e[0],a=this.videoTrack;if(7!==i&&12!==i)return a.reset(),void SI.warn("Unsupported codecId: ".concat(i));var o=12===i;a.codecType=o?kU:wU;var s=e[1],u=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===s){var c=e.subarray(5),l=o?gI.parseHEVCDecoderConfigurationRecord(c):vI.parseAVCDecoderConfigurationRecord(c);if(l){var f=l.hvcC,h=l.sps,d=l.ppsArr,p=l.spsArr,v=l.vpsArr,g=l.nalUnitSize;f&&(a.hvcC=a.hvcC||f),h&&(a.codec=h.codec,a.width=h.width,a.height=h.height,a.sarRatio=h.sarRatio,a.fpsNum=h.fpsNum,a.fpsDen=h.fpsDen),p.length&&(a.sps=p),d.length&&(a.pps=d),v&&v.length&&(a.vps=v),g&&(a.nalUnitSize=g)}else SI.warn("Cannot parse ".concat(o?"HEVC":"AVC","DecoderConfigurationRecord"),e)}else if(1===s){var y=dI.parseAvcC(e.subarray(5),a.nalUnitSize);if((y=this._checkAddMetaNalToUnits(o,y,a))&&y.length){var m=new IU(t+u,t,y);if(this.seamlessLoadingSwitching&&t<a.lastKeyFrameDts)return;this.seamlessLoadingSwitching=!1,1===n&&(m.setToKeyframe(),a.lastKeyFrameDts=t),a.samples.push(m),sf(y).call(y,(function(e){var n=o?e[0]>>>1&63:31&e[0];switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!o&&5!==n||o&&5===n)break;m.setToKeyframe();break;case 6:case 39:case 40:if(!o&&6!==n||o&&6===n)break;r.metadataTrack.seiSamples.push(new NU(dI.parseSEI(dI.removeEPB(e),o),t+u))}})),m.keyframe&&this._gopId++,m.gopId=this._gopId}else SI.warn("Cannot parse NALUs",e)}else 2===s||SI.warn("Unknown AVCPacketType: ".concat(s))}}},{key:"_checkAddMetaNalToUnits",value:function(e,t,r){if(!e||!this._needAddMetaBeforeKeyFrameNal)return this._needAddMetaBeforeKeyFrameNal=!1,t;var n=M_(t).call(t,(function(e){return e[0]>>>1&63}));return dA(n).call(n,32)?(this._needAddMetaBeforeKeyFrameNal=!1,t):(t.unshift(r.pps[0]),t.unshift(r.sps[0]),t.unshift(r.vps[0]),Fl(t).call(t,Boolean))}},{key:"_parseScript",value:function(e,t){this.metadataTrack.flvScriptSamples.push(new FU(mI.parse(e),t))}}],[{key:"probe",value:function(e){return 70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]&&lI(e,5)>=9}}]),e}();sU(xI,"AUDIO_RATE",[5500,11e3,22e3,44e3]);var EI=rr,TI=R,AI=$e,LI=l,CI=function(){var e=EI(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},OI=RegExp.prototype,PI=l,DI=function(e){var t=e.flags;return void 0!==t||"flags"in OI||AI(e,"flags")||!LI(OI,e)?t:TI(CI,e)},RI=RegExp.prototype,MI=r((function(e){return e===RI||PI(RI,e)?DI(e):e.flags})),UI=Kn("Array").entries,II=en,BI=$e,jI=l,FI=UI,NI=Array.prototype,zI={DOMTokenList:!0,NodeList:!0},VI=r((function(e){var t=e.entries;return e===NI||jI(NI,e)&&t===NI.entries||BI(zI,II(e))?FI:t}));var GI,HI=function(){function e(){iU(this,e),this.buffer=new Uint8Array(0)}return oU(e,[{key:"write",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];sf(r).call(r,(function(t){t?e.buffer=function(e){for(var t=0,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];sf(n).call(n,(function(e){t+=e.length}));var a=new e(t),o=0;return sf(n).call(n,(function(e){a.set(e,o),o+=e.length})),a}(Uint8Array,e.buffer,t):window.console.warn(t)}))}}],[{key:"writeUint16",value:function(e){return new Uint8Array([e>>8&255,255&e])}},{key:"writeUint32",value:function(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}}]),e}(),qI=Math.pow(2,32)-1,KI=function(){function e(){iU(this,e)}return oU(e,null,[{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r=Fl(r).call(r,Boolean);var i=8+MO(r).call(r,(function(e,t){return e+t.byteLength}),0),a=new Uint8Array(i);a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=255&i,a.set(e,4);var o=8;return sf(r).call(r,(function(e){a.set(e,o),o+=e.byteLength})),a}},{key:"ftyp",value:function(t){return Rm(t).call(t,(function(e){return e.type===mU&&e.codecType===kU}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return cI(e.ftyp(t),e.moov(t))}},{key:"pssh",value:function(t){var r,n=new Uint8Array(Xn(r=[1,0,0,0]).call(r,[16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75],[0,0,0,1],hI(t.kid),[0,0,0,0]));return e.box(e.types.pssh,n)}},{key:"moov",value:function(t){if(t[0].useEME&&(t[0].encv||t[0].enca)){var r;t[0].pssh||(t[0].pssh={kid:t[0].kid});var n=this.pssh(t[0].pssh);return e.box.apply(e,Xn(r=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale),e.mvex(t)]).call(r,pU(M_(t).call(t,(function(t){return e.trak(t)}))),[n]))}var i;return e.box.apply(e,Xn(i=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale)]).call(i,pU(M_(t).call(t,(function(t){return e.trak(t)}))),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.tkhdDuration||0,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]))}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===mU?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){var r=[];return t&&t.ext&&t.ext.stss&&r.push(e.stss(VI(t.ext.stss))),e.box(e.types.stbl,e.stsd(t),e.STTS,r[0],e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){var r;return r="audio"===t.type?t.useEME&&t.enca?e.enca(t):t.codecType===TU?e.opus(t):e.mp4a(t):t.useEME&&t.encv?e.encv(t):t.av1C?e.av01(t):e.avc1hev1(t),e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),r)}},{key:"enca",value:function(t){var r=t.enca.channelCount,n=t.enca.sampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>8&255,255&n,0,0]),a=e.esds(t.config),o=e.sinf(t.enca);return e.box(e.types.enca,i,a,o)}},{key:"encv",value:function(t){var r,n,i,a=t.sps.length>0?t.sps[0]:[],o=t.pps.length>0?t.pps[0]:[],s=t.width,u=t.height,c=t.sarRatio[0],l=t.sarRatio[1],f=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h=new Uint8Array(Xn(n=Xn(r=Xn(i=[1,a[1],a[2],a[3],255,225,a.length>>>8&255,255&a.length]).apply(i,pU(a))).call(r,[1,o.length>>>8&255,255&o.length])).apply(n,pU(o))),d=new Uint8Array([0,0,88,57,0,15,200,192,0,4,86,72]),p=e.sinf(t.encv),v=new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,l>>24,l>>16&255,l>>8&255,255&l]);return e.box(e.types.encv,f,e.box(e.types.avcC,h),e.box(e.types.btrt,d),p,e.box(e.types.pasp,v))}},{key:"schi",value:function(t){var r=new Uint8Array([]),n=e.tenc(t);return e.box(e.types.schi,r,n)}},{key:"tenc",value:function(t){var r,n=new Uint8Array(Xn(r=[0,0,0,0,0,0,255&t.default_IsEncrypted,255&t.default_IV_size]).call(r,hI(t.default_KID)));return e.box(e.types.tenc,n)}},{key:"sinf",value:function(t){var r=new Uint8Array([]),n=new Uint8Array([t.data_format.charCodeAt(0),t.data_format.charCodeAt(1),t.data_format.charCodeAt(2),t.data_format.charCodeAt(3)]),i=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0]),a=e.schi(t);return e.box(e.types.sinf,r,e.box(e.types.frma,n),e.box(e.types.schm,i),a)}},{key:"av01",value:function(t){return e.box(e.types.av01,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t.av1C,t.colr)}},{key:"avc1hev1",value:function(t){var r,n=t.codecType===kU,i=n?e.types.hvc1:e.types.avc1,a=n?e.hvcC(t):e.avcC(t),o=[new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a];return n?o.push(e.box(e.types.fiel,new Uint8Array([1,0]))):t.sarRatio&&t.sarRatio.length>1&&o.push(e.pasp(t.sarRatio)),e.box.apply(e,Xn(r=[i]).call(r,o))}},{key:"avcC",value:function(t){var r,n,i,a,o,s,u=[],c=[];return sf(r=t.sps).call(r,(function(e){s=e.byteLength,u.push(s>>>8&255),u.push(255&s),u.push.apply(u,pU(e))})),sf(n=t.pps).call(n,(function(e){s=e.byteLength,c.push(s>>>8&255),c.push(255&s),c.push.apply(c,pU(e))})),e.box(e.types.avcC,new Uint8Array(Xn(a=Xn(i=Xn(o=[1,u[3],u[4],u[5],255,224|t.sps.length]).apply(o,u)).call(i,[t.pps.length])).apply(a,c)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer||r instanceof Uint8Array)return r;var n,i=t.vps,a=t.sps,o=t.pps;if(r){var s=r.generalProfileCompatibilityFlags,u=r.generalConstraintIndicatorFlags,c=(i.length&&1)+(a.length&&1)+(o.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,s>>>24,s>>>16,s>>>8,s,u[0],u[1],u[2],u[3],u[4],u[5],r.generalLevelIdc,240,0,252,252|r.chromaFormatIdc,248|r.bitDepthLumaMinus8,248|r.bitDepthChromaMinus8,0,0,r.numTemporalLayers<<3|r.temporalIdNested<<2|3,c];var l=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,pU(e))};i.length&&(n.push(160,0,i.length),sf(i).call(i,l)),a.length&&(n.push(161,0,a.length),sf(a).call(a,l)),o.length&&(n.push(162,0,o.length),sf(o).call(o,l))}else n=[1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var r=dU(t,2),n=r[0],i=r[1];return e.box(e.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var r,n,i,a=t.length;return e.box(e.types.esds,new Uint8Array(Xn(r=Xn(n=Xn(i=[0,0,0,0,3,23+a,0,0,0,4,15+a,64,21,0,6,0,0,0,218,192,0,0,218,192,5]).call(i,[a])).call(n,t)).call(r,[6,1,2])))}},{key:"opus",value:function(t){var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),n=t.config.length?e.dOps(t):[];return e.box(e.types.Opus,r,n)}},{key:"dOps",value:function(t){if(t.config)return t.config[4]=t.sampleRate>>>24&255,t.config[5]=t.sampleRate>>>16&255,t.config[6]=t.sampleRate>>>8&255,t.config[7]=255&t.sampleRate,e.box(e.types.dOps,t.config)}},{key:"mvex",value:function(t){var r;return e.box.apply(e,Xn(r=[e.types.mvex]).call(r,pU(M_(t).call(t,(function(t){return e.trex(t.id)})))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trex1",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,2,0,0,0,0,0,0,1,0,0]))}},{key:"trex2",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,4,0,0,0,0,0,2,0,0,0]))}},{key:"moof",value:function(t){var r;return e.box.apply(e,Xn(r=[e.types.moof,e.mfhd(t[0].samples?t[0].samples[0].gopId:0)]).call(r,pU(M_(t).call(t,(function(t){return e.traf(t)})))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){var r,n=e.tfhd(t.id),i=e.tfdt(t,t.baseMediaDecodeTime),a=0;if(t.isVideo&&t.videoSenc&&(r=t.videoSenc,sf(r).call(r,(function(e){a+=8,e.subsamples&&e.subsamples.length&&(a+=2,a+=6*e.subsamples.length)}))),t.videoSencLength=a,t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)){if(t.isVideoEncryption){if(t.isVideo){var o=e.saiz(t),s=e.saio(t),u=e.trun1(t),c=e.senc(t);return e.box(e.types.traf,n,i,o,s,u,c)}if(t.isAudioEncryption){var l=e.sbgp(),f=e.saiz(t),h=e.saio(t),d=e.senc(t),p=e.trun1(t);return e.box(e.types.traf,n,i,l,f,h,d,p)}var v=e.sbgp(),g=e.trun1(t);return e.box(e.types.traf,n,i,v,g)}if(t.isVideo){var y=e.trun1(t);return e.box(e.types.traf,n,i,y)}var m=e.sbgp(),_=e.saiz(t),b=e.saio(t),w=e.senc(t),k=e.trun1(t);return e.box(e.types.traf,n,i,m,_,b,w,k)}var S=e.sdtp(t);return e.box(e.types.traf,n,i,S,e.trun(t.samples,S.byteLength+76))}},{key:"sdtp",value:function(t){var r,n=new HI;return sf(r=t.samples).call(r,(function(e){n.write(new Uint8Array(t.isVideo?[e.keyframe?32:16]:[16]))})),e.box(e.types.sdtp,this.extension(0,0),n.buffer)}},{key:"trun1",value:function(t){var r,n=new HI,i=HI.writeUint32(t.samples.length),a=null;if(t.isVideo){var o=t.videoSencLength;a=HI.writeUint32(16*t.samples.length+o+149),!t.isVideoEncryption&&t.isAudioEncryption&&(a=HI.writeUint32(16*t.samples.length+92))}else{var s=12*t.samples.length+124;t.isAudioEncryption&&(s=12*t.samples.length+8*t.audioSenc.length+177),a=HI.writeUint32(s)}return sf(r=t.samples).call(r,(function(e){n.write(HI.writeUint32(e.duration)),n.write(HI.writeUint32(e.size)),n.write(HI.writeUint32(e.keyframe?33554432:65536)),t.isVideo&&n.write(HI.writeUint32(e.cts?e.cts:0))})),e.box(e.types.trun,this.extension(0,MI(t)),i,a,n.buffer)}},{key:"senc",value:function(t){var r=new HI,n=t.samples.length,i=t.isVideo?16:8,a=t.isVideo?2:0,o=[],s=0;return t.isVideo?(o=t.videoSenc,s=t.videoSencLength):o=t.audioSenc,s=s||i*n,r.write(HI.writeUint32(16+s),e.types.senc,this.extension(0,a)),r.write(HI.writeUint32(n)),sf(o).call(o,(function(e){for(var t=0;t<e.InitializationVector.length;t++)r.write(new Uint8Array([e.InitializationVector[t]]));var n;e.subsamples&&e.subsamples.length&&(r.write(HI.writeUint16(e.subsamples.length)),sf(n=e.subsamples).call(n,(function(e){r.write(HI.writeUint16(e.BytesOfClearData)),r.write(HI.writeUint32(e.BytesOfProtectedData))})))})),r.buffer}},{key:"saio",value:function(t){var r=12*t.samples.length+141;!t.isVideo&&t.isAudioEncryption&&(r=149);var n=new Uint8Array([1,0,0,0,0,0,0,1,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saio,n)}},{key:"saiz",value:function(t){var r=t.samples.length,n=new Uint8Array([0,0,0,0,16,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saiz,n)}},{key:"sbgp",value:function(){var t=new Uint8Array([114,111,108,108,0,0,0,1,0,0,1,25,0,0,0,1]);return e.box(e.types.sbgp,this.extension(0,0),t)}},{key:"extension",value:function(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t,r){var n=Math.floor(r/(qI+1)),i=Math.floor(r%(qI+1));return t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)?e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])):e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"trun",value:function(t,r){var n=t.length,i=12+16*n;r+=8+i;var a=new Uint8Array(i);a.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var o=0;o<n;o++){var s=t[o],u=s.duration,c=s.size,l=s.flag,f=void 0===l?{}:l,h=s.cts,d=void 0===h?0:h;a.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,c>>>24&255,c>>>16&255,c>>>8&255,255&c,f.isLeading<<2|(null===f.dependsOn||void 0===f.dependsOn?1:f.dependsOn),f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|(null===f.isNonSyncSample||void 0===f.isNonSyncSample?1:f.isNonSyncSample),61440&f.degradationPriority,15&f.degradationPriority,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*o)}return e.box(e.types.trun,a)}},{key:"moovMP4",value:function(t){var r;return e.box.apply(e,Xn(r=[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)]).call(r,pU(M_(t).call(t,(function(t){return e.trackMP4(t)})))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===mU?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r,n=t.ext,i=[e.stsd(t),e.stts(n.stts),e.stsc(n.stsc),e.stsz(n.stsz),e.stco(n.stco)];return n.stss.length&&i.push(e.stss(n.stss)),n.ctts.length&&i.push(e.ctts(n.ctts)),e.box.apply(e,Xn(r=[e.types.stbl]).call(r,i))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return sf(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.stts,cI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(t){var r=t.length,n=new Uint8Array(12*r),i=0;return sf(t).call(t,(function(e){var t=e.firstChunk,r=e.samplesPerChunk,a=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a],i),i+=12})),e.box(e.types.stsc,cI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return sf(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stsz,cI(new Uint8Array([0,0,0,0,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stco",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return sf(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stco,cI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return sf(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stss,cI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return sf(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.ctts,cI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"styp",value:function(){return e.box(e.types.styp,new Uint8Array([109,115,100,104,0,0,0,0,109,115,100,104,109,115,105,120]))}},{key:"sidx",value:function(t){var r,n=t.timescale,i=t.samples[0].duration,a=i*t.samples.length,o=t.samples[0].sampleOffset*i,s=8;sf(r=t.samples).call(r,(function(e){s+=e.size}));var u=0;if(t.isVideo){var c,l=0;t.videoSenc&&(c=t.videoSenc),t.isVideo&&sf(c).call(c,(function(e){l+=8,e.subsamples&&e.subsamples.length&&(l+=2,l+=6*e.subsamples.length)})),t.videoSencLength=l,u=s+141+16*t.samples.length+l,t.useEME&&t.isAudioEncryption&&!t.isVideoEncryption&&(u=s+16*t.samples.length+84)}else u=s+116+12*t.samples.length,t.useEME&&t.isAudioEncryption&&(u=s+169+12*t.samples.length+8*t.audioSenc.length);var f=new Uint8Array([0,0,0,0,0,0,0,255&t.id,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,1,0,u>>16&255,u>>8&255,255&u,a>>24&255,a>>16&255,a>>8&255,255&a,144,0,0,0]);return e.box(e.types.sidx,f)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();sU(KI,"types",MO(GI=["Opus","dOps","av01","av1C","avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trex","tkhd","vmhd","smhd","ctts","stss","styp","pssh","sidx","sbgp","saiz","saio","senc","trun","encv","enca","sinf","btrt","frma","tenc","schm","schi","mehd","fiel","sdtp"]).call(GI,(function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),Uf(null))),sU(KI,"HDLR_TYPES",{video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),sU(KI,"FTYPAVC1",KI.box(KI.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),sU(KI,"FTYPHEV1",KI.box(KI.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),sU(KI,"DINF",KI.box(KI.types.dinf,KI.box(KI.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),sU(KI,"VMHD",KI.box(KI.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),sU(KI,"SMHD",KI.box(KI.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),sU(KI,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),sU(KI,"STTS",KI.box(KI.types.stts,KI.StblTable)),sU(KI,"STSC",KI.box(KI.types.stsc,KI.StblTable)),sU(KI,"STSZ",KI.box(KI.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),sU(KI,"STCO",KI.box(KI.types.stco,KI.StblTable));var WI=function(){function e(t,r){iU(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=r}return oU(e,[{key:"debug",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).debug.apply(r,Xn(t=[this._prefix]).call(t,i))}}},{key:"log",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).log.apply(r,Xn(t=[this._prefix]).call(t,i))}}},{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).warn.apply(r,Xn(t=[this._prefix]).call(t,i))}}},{key:"error",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).error.apply(r,Xn(t=[this._prefix]).call(t,i))}}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();sU(WI,"disabled",!0);var YI=function(){function e(t,r,n){iU(this,e),this.videoTrack=t,this.audioTrack=r;var i=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=i&&Number(i[1])<50,this.log=new WI("FMP4Remuxer",!n||!n.openLog||!n.openLog)}return oU(e,[{key:"remux",value:function(){var e,t,r,n,i,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.videoTrack,u=this.audioTrack,c=s.exist(),l=u.exist(),f=[];return a&&(o&&o.initMerge?(c&&f.push(this.videoTrack),l&&f.push(this.audioTrack),r=KI.initSegment(f)):(c&&(e=KI.initSegment([this.videoTrack])),l&&(t=KI.initSegment([this.audioTrack])))),c&&s.hasSample()&&(n=this._remuxVideo()),l&&u.hasSample()&&(i=this._remuxAudio()),s.samples=[],u.samples=[],{initSegment:r,videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:i}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack;this.forceFirstIDR&&(e.samples[0].flag={dependsOn:2,isNonSyncSample:0});var t=e.samples,r=/av01/.test(e.codec),n=0;r?sf(t).call(t,(function(e){n+=e.data.byteLength})):sf(t).call(t,(function(e){var t;n+=MO(t=e.units).call(t,(function(e,t){return e+t.byteLength}),0),n+=4*e.units.length}));var i=new Uint8Array(n);if(r)for(var a,o=0,s=t.length,u=0;o<s;o++)a=t[o],i.set(a.data,u),a.size=a.data.byteLength,u+=a.size;else for(var c,l=new DataView(i.buffer),f=function(e,r){var n;r=t[h];var a=0;sf(n=r.units).call(n,(function(t){l.setUint32(e,t.byteLength),e+=4,i.set(t,e),e+=t.byteLength,a+=4+t.byteLength})),r.size=a,p=e,c=r},h=0,d=t.length,p=0;h<d;h++)f(p,c);var v=KI.mdat(i);return cI(KI.moof([e]),v)}},{key:"_remuxAudio",value:function(){var e,t,r=this.audioTrack,n=new Uint8Array(MO(e=r.samples).call(e,(function(e,t){return e+t.size}),0));MO(t=r.samples).call(t,(function(e,t){return n.set(t.data,e),e+t.size}),0);var i=KI.mdat(n);return cI(KI.moof([r]),i)}},{key:"reset",value:function(){this.videoTrack.reset(),this.audioTrack.reset()}}]),e}(),JI=function(){function e(){am(this,e),um(this,"_ttfb",0),um(this,"_demuxStart",0),um(this,"_demuxEnd",0),um(this,"_demuxCost",0),um(this,"_remuxStart",0),um(this,"_remuxEnd",0),um(this,"_remuxCost",0),um(this,"_appendStart",0),um(this,"_appendEnd",0),um(this,"_appendCost",0)}return sm(e,[{key:"set",value:function(e,t){this["_".concat(e)]=t}},{key:"start",value:function(e){this["_".concat(e,"Start")]=Fk()}},{key:"end",value:function(e){this["_".concat(e,"End")]=Fk(),this["_".concat(e,"Cost")]=this["_".concat(e,"Cost")]+(this["_".concat(e,"End")]-this["_".concat(e,"Start")])}},{key:"transferCost",get:function(){return{ttfbCost:this._ttfb,demuxCost:this._demuxCost,remuxCost:this._remuxCost,appendCost:this._appendCost}}}]),e}(),QI="ttfb",XI="demux",$I="remux",ZI="append",eB=new rP("BufferService"),tB=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};am(this,e),um(this,"flv",null),um(this,"_demuxer",new xI),um(this,"_remuxer",null),um(this,"_mse",null),um(this,"_softVideo",null),um(this,"_sourceCreated",!1),um(this,"_needInitSegment",!0),um(this,"_discontinuity",!0),um(this,"_contiguous",!1),um(this,"_initSegmentId",""),um(this,"_cachedBuffer",null),um(this,"_demuxStartTime",0),um(this,"_opts",null),this.flv=t,this._opts=n,r?this._softVideo=r:(this._remuxer=new YI(this._demuxer.videoTrack,this._demuxer.audioTrack),this._mse=new pP(null,{preferMMS:"boolean"==typeof n.preferMMS?n.preferMMS:!!n.perferMMS}),this._mse.bindMedia(t.media))}var t,r,n,i,a,o;return sm(e,[{key:"baseDts",get:function(){var e,t;return null===(e=this._demuxer)||void 0===e||null===(t=e._fixer)||void 0===t?void 0:t._baseDts}},{key:"blobUrl",get:function(){var e;return null===(e=this._mse)||void 0===e?void 0:e.url}},{key:"isFull",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pP.VIDEO;return this._mse.isFull(e)}},{key:"seamlessSwitch",value:function(){this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!0,this._initSegmentId=""}},{key:"unContiguous",value:function(e){this._contiguous=!1,this._demuxStartTime=e}},{key:"reset",value:(o=im(tm().mark((function e(){var t,r=arguments;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0],!this._mse||t){e.next=6;break}return e.next=4,this._mse.unbindMedia();case 4:return e.next=6,this._mse.bindMedia(this.flv.media);case 6:this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!1,this._sourceCreated=!1,this._initSegmentId="",this.resetSeamlessSwitchStats();case 12:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"resetSeamlessSwitchStats",value:function(){this.seamlessLoadingSwitch=null,this.seamlessLoadingSwitching=!1,this._demuxer&&(this._demuxer.seamlessLoadingSwitching=!1)}},{key:"endOfStream",value:(a=im(tm().mark((function e(){return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(!this._sourceCreated){e.next=5;break}return e.next=4,this._mse.endOfStream();case 4:this.flv.emit(jP);case 5:e.next=8;break;case 7:this._softVideo&&this._softVideo.endOfStream();case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateDuration",value:(i=im(tm().mark((function e(t){return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(this._mse.isOpened){e.next=4;break}return e.next=4,this._mse.open();case 4:return eB.debug("update duration",t),e.next=7,this._mse.updateDuration(t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"destroy",value:(n=im(tm().mark((function e(){return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=3;break}return e.next=3,this._mse.unbindMedia();case 3:this._mse=null,this._softVideo=null,this._demuxer=null,this._remuxer=null;case 7:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"appendBuffer",value:(r=im(tm().mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v,g,y,m,_=this;return tm().wrap((function(e){for(var b,w,k,S,x,E;;)switch(e.prev=e.next){case 0:if(r=!1,this._cachedBuffer&&(t=uD(this._cachedBuffer,t),this._cachedBuffer=null),n=this._demuxer,t&&t.length&&n){e.next=5;break}return e.abrupt("return");case 5:e.prev=5,this.flv._transferCost.start(XI),n.demuxAndFix(t,this.seamlessLoadingSwitching||this._discontinuity,this._contiguous,this._demuxStartTime,this.seamlessLoadingSwitching),this.seamlessLoadingSwitching=!1,this.flv._transferCost.end(XI),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(5),new QO(VO,YO.FLV,e.t0);case 15:if(i=n.videoTrack,a=n.audioTrack,o=n.metadataTrack,!this.seamlessLoadingSwitch){e.next=25;break}if(!((s=hS(b=i.samples).call(b,(function(e){return e.originDts===i.lastKeyFrameDts})))>=0)){e.next=25;break}return a_(w=i.samples).call(w,s),e.next=22,this.seamlessLoadingSwitch();case 22:this.seamlessLoadingSwitch=null,t=null,r=!0;case 25:if(u=i.exist(),c=a.exist(),this._opts.onlyAudio&&(u=!1,i.present=!1),this._opts.onlyVideo&&(c=!1,a.present=!1),!(!u&&i.present||!c&&a.present)){e.next=42;break}if(l=0,(f=u?i:c?a:void 0)&&f.samples.length&&(l=(f.samples[f.samples.length-1].originPts-f.samples[0].originPts)/f.timescale*1e3),!(l>this._opts.analyzeDuration)){e.next=40;break}eB.warn("analyze duration exceeded, ".concat(l,"ms"),f),i.present=u,a.present=c,this.flv.emit(UP,{duration:l}),e.next=42;break;case 40:return this._cachedBuffer=t,e.abrupt("return");case 42:if(h=i.type,d=a.type,this._fireEvents(i,a,o),r||(this._discontinuity=!1,this._contiguous=!0,this._demuxStartTime=0),p=this._mse,v=function(){var e,t;null!==(e=_.flv)&&void 0!==e&&e.emit&&(null===(t=_.flv)||void 0===t||t.emit(IP,{}))},this.flv.emit(YP,{videoTrack:i}),(g=Xn(k=Xn(S=Xn(x=Xn(E="".concat(i.codec,"/")).call(E,i.width,"/")).call(x,i.height,"/")).call(S,a.codec,"/")).call(k,a.config))!==this._initSegmentId&&(this._needInitSegment=!0,this._initSegmentId=g,this._emitMetaParsedEvent(i,a)),!p){e.next=81;break}if(this._sourceCreated){e.next=59;break}return e.next=55,p.open();case 55:u&&(eB.log("codec: video/mp4;codecs=".concat(i.codec)),p.createSource(h,"video/mp4;codecs=".concat(i.codec))),c&&(eB.log("codec: audio/mp4;codecs=".concat(a.codec)),p.createSource(d,"audio/mp4;codecs=".concat(a.codec))),this._sourceCreated=!0,this.flv.emit(MP);case 59:e.prev=59,this._needInitSegment&&!this._opts.mseLowLatency&&(i.duration=this._opts.durationForMSELowLatencyOff*i.timescale,a.duration=this._opts.durationForMSELowLatencyOff*c.timescale),this.flv._transferCost.start($I),y=this._remuxer.remux(this._needInitSegment),this.flv._transferCost.end($I),e.next=69;break;case 66:throw e.prev=66,e.t1=e.catch(59),new QO(GO,YO.FMP4,e.t1);case 69:if(!this._needInitSegment||y.videoInitSegment||y.audioInitSegment){e.next=71;break}return e.abrupt("return");case 71:return this._needInitSegment=!1,m=[],y.videoInitSegment&&m.push(p.append(h,y.videoInitSegment)),y.audioInitSegment&&m.push(p.append(d,y.audioInitSegment)),y.videoSegment&&m.push(p.append(h,y.videoSegment)),y.audioSegment&&m.push(p.append(d,y.audioSegment)),this.flv._transferCost.start(ZI),e.abrupt("return",Hg.all(m).then(v).then((function(){_.flv._transferCost.end(ZI),v()})));case 81:this._softVideo&&(this._softVideo.appendBuffer(i,a),v());case 82:case"end":return e.stop()}}),e,this,[[5,12],[59,66]])}))),function(e){return r.apply(this,arguments)})},{key:"evictBuffer",value:(t=im(tm().mark((function e(t){var r,n,i,a=this;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.flv.media,this._mse&&this._demuxer&&r&&t&&!(t<0)){e.next=3;break}return e.abrupt("return");case 3:if(n=r.currentTime,!((i=n-t)<=0)){e.next=7;break}return e.abrupt("return");case 7:if(!(UO.start(UO.get(r))+1>=i)){e.next=10;break}return e.abrupt("return");case 10:return e.abrupt("return",this._mse.clearBuffer(0,i).then((function(){return a.flv.emit(BP,{removeEnd:i})})));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_emitMetaParsedEvent",value:function(e,t){e.exist()&&this.flv.emit(zP,{type:"video",track:e,meta:{codec:e.codec,timescale:e.timescale,width:e.width,height:e.height,sarRatio:e.sarRatio,baseDts:e.baseDts}}),t.exist()&&this.flv.emit(zP,{type:"audio",track:t,meta:{codec:t.codec,channelCount:t.channelCount,sampleRate:t.sampleRate,timescale:t.timescale,baseDts:t.baseDts}}),eB.debug("track parsed",e,t)}},{key:"_fireEvents",value:function(e,t,r){var n,i,a,o,s,u,c=this;eB.debug(Xn(n="videoTrack samples count: ".concat(e.samples.length,", audioTrack samples count: ")).call(n,t.samples.length)),sf(i=r.flvScriptSamples).call(i,(function(e){c.flv.emit(HP,e),eB.debug("flvScriptData",e)})),sf(a=e.samples).call(a,(function(e){e.keyframe&&c.flv.emit(FP,{pts:e.originPts})})),sf(o=e.warnings).call(o,(function(e){var t;switch(e.type){case LU:t=QP;break;case CU:t=XP;break;case OU:t=tD}t&&c.flv.emit(JP,em(em({},e),{},{type:t})),eB.warn("video exception",e)})),sf(s=t.warnings).call(s,(function(e){var t;switch(e.type){case PU:t=$P;break;case DU:t=ZP;break;case RU:t=eD}t&&c.flv.emit(JP,em(em({},e),{},{type:t})),eB.warn("audio exception",e)})),sf(u=r.seiSamples).call(u,(function(e){c.flv.emit(VP,em(em({},e),{},{sei:{code:e.data.type,content:e.data.payload,dts:e.pts}}))}))}}]),e}();function rB(e,t){var r=0,n=e.length-1,i=0,a=0,o=n;for(t<e[0]&&(r=0,a=o+1);a<=o;){if((i=a+Math.floor((o-a)/2))===n||t>=e[i]&&t<e[i+1]){r=i;break}e[i]<t?a=i+1:o=i-1}return r}var nB=new rP("flv"),iB=.1,aB=function(e){cm(c,e);var t,r,n,i,a,o,s,u=dm(c);function c(e){var t,r;return am(this,c),um(hm(t=u.call(this)),"media",null),um(hm(t),"_loading",!1),um(hm(t),"_opts",null),um(hm(t),"_bufferService",null),um(hm(t),"_gapService",null),um(hm(t),"_stats",null),um(hm(t),"_mediaLoader",null),um(hm(t),"_maxChunkWaitTimer",null),um(hm(t),"_tickTimer",null),um(hm(t),"_tickInterval",500),um(hm(t),"_urlSwitching",!1),um(hm(t),"_seamlessSwitching",!1),um(hm(t),"_disconnectRetryCount",0),um(hm(t),"_preLoadEndPoint",0),um(hm(t),"_keyframes",null),um(hm(t),"_acceptRanges",!0),um(hm(t),"_onProgress",function(){var e=im(tm().mark((function e(r,n,i,a){var o,s,u,c,l,f,h,d,p,v;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.startTime,s=i.endTime,u=i.st,c=i.firstByteTime,t._loading=!n,t._firstProgressEmit){e.next=13;break}if(t.media){e.next=6;break}return null===(l=t._mediaLoader)||void 0===l||l.cancel(),e.abrupt("return");case 6:f=a.headers,h=u?c-u:s-o,t.emit(CP,{url:t._opts.url,responseUrl:a.url,elapsed:h}),t.emit(PP,{headers:f}),t._transferCost.set(QI,h),t._acceptRanges=!(null==f||!f.get("Accept-Ranges"))||!(null==f||!f.get("Content-Range")),t._firstProgressEmit=!0;case 13:if(t._bufferService){e.next=15;break}return e.abrupt("return");case 15:return clearTimeout(t._maxChunkWaitTimer),t._bandwidthService.addChunkRecord(null==r?void 0:r.byteLength,s-o),e.prev=17,e.next=20,t._bufferService.appendBuffer(r);case 20:null===(d=t._bufferService)||void 0===d||d.evictBuffer(t._opts.bufferBehind),e.next=33;break;case 23:if(e.prev=23,e.t0=e.catch(17),t.isLive||!t._bufferService.isFull()){e.next=32;break}return e.next=28,t._mediaLoader.cancel();case 28:return t._loading=!1,p=t.bufferInfo().remaining,t._opts.preloadTime=L_(p)/2,e.abrupt("return");case 32:return e.abrupt("return",t._emitError(QO.create(e.t0)));case 33:if(t._urlSwitching&&(t._urlSwitching=!1,t.emit(KP,{url:t._opts.url})),t._seamlessSwitching&&(t._seamlessSwitching=!1,t._tick()),!n||t.media.seeking){e.next=40;break}return t.emit(DP),nB.debug("load done"),t.isLive&&t._disconnectRetryCount<=0&&t._end(),e.abrupt("return");case 40:if(t.isLive){e.next=42;break}return e.abrupt("return");case 42:(v=t._opts.maxReaderInterval)&&t._firstProgressEmit&&(clearTimeout(t._maxChunkWaitTimer),t._maxChunkWaitTimer=Ew((function(){if(t._disconnectRetryCount)return t._disconnectRetryCount--,void t.load();nB.debug("onMaxChunkWait",v),t._end()}),v));case 44:case"end":return e.stop()}}),e,null,[[17,23]])})));return function(t,r,n,i){return e.apply(this,arguments)}}()),um(hm(t),"_onRetryError",(function(e,r){nB.debug("load retry",e,r),t.emit(RP,{error:QO.network(e),retryTime:r})})),um(hm(t),"_end",(function(){t._clear(),t._bufferService&&t._bufferService.endOfStream(),nB.debug("end stream")})),um(hm(t),"_resetDisconnectCount",(function(){t._disconnectRetryCount=t._opts.disconnectRetryCount})),um(hm(t),"_tick",(function(){clearTimeout(t._tickTimer);var e=hm(t).media;if(e){t._tickTimer=Ew(t._tick,t._tickInterval);var r=UO.end(UO.get(e));if(!(r<iB)&&e.readyState){var n=t._opts;if(function(e){return e&&!e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState}(e)&&e.currentTime)t._gapService&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3);else{if(!e.currentTime&&t._gapService&&n.enableStartGapJump)return void((t._opts.mseLowLatency||!1===t._opts.mseLowLatency&&t.bufferInfo(.3).nextStart)&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3));n.isLive&&4===e.readyState&&r-e.currentTime>n.disconnectTime&&t.disconnect()}}}})),um(hm(t),"_onPlay",(function(){var e,r,n=t._opts.softDecode||(null===(e=t.media)||void 0===e||null===(r=e.buffered)||void 0===r?void 0:r.length);if(t.isLive)!t._loading&&n&&t.replay(void 0,!0);else{var i=t.bufferInfo();(i.start||i.nextStart)>iB&&t._tick()}})),um(hm(t),"_onLoadeddata",(function(){t.isLive&&!t._opts.mseLowLatency&&t.media.duration!==1/0&&t._bufferService.updateDuration(1/0).catch((function(e){}))})),um(hm(t),"_onSeeking",im(tm().mark((function e(){return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!t.isLive&&t.seekable&&(t._preLoadEndPoint=-1,t._checkPreload());case 1:case"end":return e.stop()}}),e)})))),um(hm(t),"_onTimeupdate",(function(){if(t.media){var e=t._opts,r=t.media.currentTime;if(e.isLive&&e.maxLatency&&e.targetLatency){var n=UO.end(UO.get(t.media));n-r>=e.maxLatency&&(t.media.currentTime=n-e.targetLatency,t.emit(NP,{currentTime:t.media.currentTime,latency:e.targetLatency}))}t._seiService.throw(r,!0),e.isLive||!t.seekable||t._loading||t._checkPreload()}})),um(hm(t),"_onWaiting",(function(){t.isLive&&!t._loading&&t._disconnectRetryCount&&(t._disconnectRetryCount--,t.load())})),um(hm(t),"_onBufferUpdate",(function(){if(!t._opts.isLive){var e=t.bufferInfo(),r=e.end,n=e.nextEnd;Math.abs((r||n)-t.media.duration)<1&&(t._end(),t.media.readyState<=2&&t._tick())}})),um(hm(t),"_checkPreload",im(tm().mark((function e(){var r,n,i,a,o,s,u,c,l,f;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.bufferInfo(),n=r.remaining,i=void 0===n?0:n,a=t._opts,o=t._keyframes.filepositions,s=t._keyframes.times,u=t.media.currentTime,!(i<a.preloadTime)){e.next=19;break}if(c=rB(t._keyframes.times,u+i+iB),(l=rB(t._keyframes.times,u+i+t._opts.preloadTime))===c&&(l=c+1),t._preLoadEndPoint!==l){e.next=11;break}return e.abrupt("return");case 11:if(null!=(f=o[c])){e.next=14;break}return e.abrupt("return");case 14:return e.next=16,t._mediaLoader.cancel();case 16:t._loadData(null,[f,o[l]]),t._preLoadEndPoint=l,t._bufferService.unContiguous(s[c]);case 19:case"end":return e.stop()}}),e)})))),um(hm(t),"_onFlvScriptData",(function(e){var r,n,i,a,o=null===(r=e.data)||void 0===r||null===(n=r.onMetaData)||void 0===n?void 0:n.keyframes,s=null===(i=e.data)||void 0===i||null===(a=i.onMetaData)||void 0===a?void 0:a.duration;o&&(t._keyframes=o),!t._opts.isLive&&s&&t._bufferService.updateDuration(s)})),t._opts=((r=em({retryCount:3,retryDelay:1e3,disconnectRetryCount:0,loadTimeout:1e4,maxReaderInterval:5e3,preloadTime:5,defaultVodLoadSize:1e7,isLive:!1,softDecode:!1,bufferBehind:10,maxJumpDistance:3,analyzeDuration:2e4,seamlesslyReload:!1,keepStatusAfterSwitch:!0,onlyVideo:!1,onlyAudio:!1,preferMMS:!1,mseLowLatency:!0,durationForMSELowLatencyOff:6,chunkCountForSpeed:50,skipChunkSize:1e3,longtimeNoReceived:3e3,enableStartGapJump:!0},e)).isLive&&r.preloadTime&&(r.maxLatency||(r.maxLatency=2*r.preloadTime),r.targetLatency||(r.targetLatency=r.preloadTime),null!==r.disconnectTime&&void 0!==r.disconnectTime||(r.disconnectTime=r.maxLatency)),r),t.media=t._opts.media||document.createElement("video"),t._opts.media=null,t._firstProgressEmit=!1,t._mediaLoader=new lD(em(em({},t._opts.fetchOptions),{},{retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onRetryError,onProgress:t._onProgress,responseType:"arraybuffer"})),t._disconnectRetryCount=t._opts.disconnectRetryCount,t._transferCost=new JI,t._bufferService=new tB(hm(t),t._opts.softDecode?t.media:void 0,t._opts),t._seiService=new eU(hm(t)),t._bandwidthService=new tU({chunkCountForSpeed:t._opts.chunkCountForSpeed,skipChunkSize:t._opts.skipChunkSize,longtimeNoReceived:t._opts.longtimeNoReceived}),t._stats=new nU(hm(t)),t._opts.softDecode||(t._gapService=new fD),t.media.addEventListener("play",t._onPlay),t.media.addEventListener("loadeddata",t._onLoadeddata),t.media.addEventListener("seeking",t._onSeeking),t.media.addEventListener("timeupdate",t._onTimeupdate),t.media.addEventListener("progress",t._onBufferUpdate),t.media.addEventListener("waiting",t._onWaiting),t.on(HP,t._onFlvScriptData),t}return sm(c,[{key:"version",get:function(){return"3.0.21-rc.3"}},{key:"isLive",get:function(){return this._opts.isLive}},{key:"baseDts",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.baseDts}},{key:"seekable",get:function(){return!!this._keyframes&&this._acceptRanges}},{key:"loader",get:function(){return this._mediaLoader}},{key:"blobUrl",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.blobUrl}},{key:"speedInfo",value:function(){return{speed:this._bandwidthService.getLatestSpeed(),avgSpeed:this._bandwidthService.getAvgSpeed(),totalSize:this._bandwidthService.getTotalSize(),totalCost:this._bandwidthService.getTotalCost()}}},{key:"getStats",value:function(){return this._stats.getStats()}},{key:"bufferInfo",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:iB;return UO.info(UO.get(this.media),null===(e=this.media)||void 0===e?void 0:e.currentTime,t)}},{key:"playbackQuality",value:function(){return function(e){if(!e)return{};if("function"==typeof e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();return{droppedVideoFrames:t.droppedVideoFrames||t.corruptedVideoFrames,totalVideoFrames:t.totalVideoFrames,creationTime:t.creationTime}}return{droppedVideoFrames:e.webkitDroppedFrameCount,totalVideoFrames:e.webkitDecodedFrameCount,creationTime:performance.now()}}(this.media)}},{key:"load",value:(s=im(tm().mark((function e(t){var r,n=arguments;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>1&&void 0!==n[1]&&n[1],this._bufferService){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this._reset(r);case 5:this._loadData(t,this._opts.isLive?[]:[0,this._opts.defaultVodLoadSize]),clearTimeout(this._tickTimer),this._tickTimer=Ew(this._tick,this._tickInterval);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"replay",value:(o=im(tm().mark((function e(){var t,r,n=this,i=arguments;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:this._opts.seamlesslyReload,r=i.length>1?i[1]:void 0,this.media){e.next=4;break}return e.abrupt("return");case 4:if(this._resetDisconnectCount(),!t){e.next=11;break}return e.next=8,this._clear();case 8:Ew((function(){n._seamlessSwitching=!0,n._loadData(n._opts.url),n._bufferService.seamlessSwitch()})),e.next=13;break;case 11:return e.next=13,this.load();case 13:return e.abrupt("return",this.media.play(!r).catch((function(){})));case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"disconnect",value:function(){var e;return nB.debug("disconnect!"),null===(e=this._bufferService)||void 0===e||e.resetSeamlessSwitchStats(),this._clear()}},{key:"switchURL",value:(a=im(tm().mark((function e(t,r){var n=this;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._bufferService){e.next=2;break}return e.abrupt("return");case 2:if(this._resetDisconnectCount(),!this._loading||!r){e.next=6;break}return this._bufferService.seamlessLoadingSwitch=function(){var e=im(tm().mark((function e(r){return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._clear();case 2:n._bufferService.seamlessLoadingSwitching=!0,n._urlSwitching=!0,n._seamlessSwitching=!0,n._bufferService.seamlessSwitch(),n._loadData(t);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return");case 6:if(r&&this._opts.isLive){e.next=11;break}return e.next=9,this.load(t);case 9:return this._urlSwitching=!0,e.abrupt("return",this.media.play(!0).catch((function(){})));case 11:return e.next=13,this._clear();case 13:Ew((function(){n._urlSwitching=!0,n._seamlessSwitching=!0,n._loadData(t),n._bufferService.seamlessSwitch()}));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"destroy",value:(i=im(tm().mark((function e(){return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.media){e.next=2;break}return e.abrupt("return");case 2:return this.removeAllListeners(),this._seiService.reset(),this.media.removeEventListener("play",this._onPlay),this.media.removeEventListener("loadeddata",this._onLoadeddata),this.media.removeEventListener("seeking",this._onSeeking),this.media.removeEventListener("timeupdate",this._onTimeupdate),this.media.removeEventListener("waiting",this._onWaiting),this.media.removeEventListener("progress",this._onBufferUpdate),e.next=12,Hg.all([this._clear(),this._bufferService.destroy()]);case 12:this.media=null,this._bufferService=null;case 14:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"_emitError",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];nB.table(e),nB.error(e),nB.error(null===(t=this.media)||void 0===t?void 0:t.error),this._urlSwitching&&(this._urlSwitching=!1,this._seamlessSwitching=!1,this.emit(WP,e)),this.emit(LP,e),r&&(this._seiService.reset(),this._end())}},{key:"_reset",value:(n=im(tm().mark((function e(){var t,r=arguments;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],this._seiService.reset(),this._bandwidthService.reset(),this._stats.reset(),e.next=6,this._clear();case 6:return e.next=8,this._bufferService.reset(t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_loadData",value:(r=im(tm().mark((function e(t,r){var n;return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&(this._opts.url=t),n=t=this._opts.url,t){e.next=4;break}throw new Error("Source url is missing");case 4:if(this._opts.preProcessUrl&&(n=this._opts.preProcessUrl(t).url),this._mediaLoader.finnalUrl=n,this.emit(OP,{url:n,seamlessSwitching:this._seamlessSwitching}),nB.debug("load data, loading:",this._loading,n),!this._loading){e.next=11;break}return e.next=11,this._mediaLoader.cancel();case 11:return this._loading=!0,e.prev=12,e.next=15,this._mediaLoader.load({url:n,range:r});case 15:e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(12),this._loading=!1,e.abrupt("return",this._emitError(QO.network(e.t0),!1));case 21:case"end":return e.stop()}}),e,this,[[12,17]])}))),function(e,t){return r.apply(this,arguments)})},{key:"_clear",value:(t=im(tm().mark((function e(){return tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mediaLoader){e.next=3;break}return e.next=3,this._mediaLoader.cancel();case 3:clearTimeout(this._maxChunkWaitTimer),clearTimeout(this._tickTimer),this._loading=!1,this._firstProgressEmit=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"isSupported",value:function(e){return e&&"video"!==e&&"audio"!==e?"undefined"!=typeof WebAssembly:pP.isSupported()}},{key:"enableLogger",value:function(){rP.enable(),HU.enable()}},{key:"disableLogger",value:function(){rP.disable(),HU.disable()}}]),c}(Rb);try{localStorage.getItem("xgd")?aB.enableLogger():aB.disableLogger()}catch(gB){}var oB=function(){function e(t,r){var n=this;am(this,e),um(this,"_onLowDecode",(function(){var e,t,r,i,a=n._opts,o=a.media,s=a.innerDegrade,u=a.backupURL;null===(e=n._plugin)||void 0===e||null===(t=e.player)||void 0===t||t.emit("lowdecode",o.degradeInfo),null===(r=n._plugin)||void 0===r||null===(i=r.player)||void 0===i||i.emit("core_event",em(em({},o.degradeInfo),{},{eventName:qP})),1!==s&&3!==s||!u||n._degrade(u)})),um(this,"_degrade",(function(e){var t=n._plugin.player,r=t.video;if("MVideo"===(null==r?void 0:r.TAG)){var i=t.video.degradeVideo;t.video=i,r.degrade(e),e&&(t.config.url=e);var a=t.root.firstChild;"MVideo"===a.TAG&&t.root.replaceChild(i,a);var o=n._plugin.constructor.pluginName.toLowerCase();t.unRegisterPlugin(o),t.once("canplay",(function(){t.play()}))}})),um(this,"forceDegradeToVideo",(function(e){var t=n._opts.innerDegrade;1!==t&&3!==t||n._degrade(e)})),this._opts=t,this._plugin=r,this._init()}return sm(e,[{key:"_init",value:function(){var e=this._opts,t=e.media,r=e.isLive,n=e.preloadTime,i=e.innerDegrade,a=e.decodeMode;t&&(r||!t.setPlayMode?(i&&t.setAttribute("innerdegrade",i),n&&t.setAttribute("preloadtime",n),t.setDecodeMode&&t.setDecodeMode(a),this._bindEvents()):t.setPlayMode("VOD"))}},{key:"_bindEvents",value:function(){this._opts.media.addEventListener("lowdecode",this._onLowDecode)}},{key:"destroy",value:function(){var e,t;null===(e=this._opts)||void 0===e||null===(t=e.media)||void 0===t||t.removeEventListener("lowdecode",this._onLowDecode),this._plugin=null}}]),e}(),sB=function(e){cm(r,e);var t=dm(r);function r(){var e,n;am(this,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return um(hm(n=t.call.apply(t,Xn(e=[this]).call(e,a))),"logger",nB),um(hm(n),"flv",null),um(hm(n),"pluginExtension",null),um(hm(n),"getStats",(function(){var e;return null===(e=n.flv)||void 0===e?void 0:e.getStats()})),um(hm(n),"destroy",(function(){var e;n.flv&&(n.flv.destroy(),n.flv=null),null===(e=n.pluginExtension)||void 0===e||e.destroy(),n.pluginExtension=null})),um(hm(n),"_onSwitchURL",(function(e,t){var r,i;n.flv&&(n.player.config.url=e,"object"===rm(t)&&(t=t.seamless),n.flv.switchURL(e,t),!t&&null!==(r=n.player.config)&&void 0!==r&&null!==(i=r.flv)&&void 0!==i&&i.keepStatusAfterSwitch&&n._keepPauseStatus())})),um(hm(n),"_keepPauseStatus",(function(){n.player.paused&&n.player.once("canplay",(function(){n.player.pause()}))})),um(hm(n),"_onDefinitionChange",(function(e){var t=e.to;n.flv&&n.flv.switchURL(t)})),n}return sm(r,[{key:"core",get:function(){return this.flv}},{key:"version",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.version}},{key:"softDecode",get:function(){var e,t,r=null===(e=this.player)||void 0===e||null===(t=e.config)||void 0===t?void 0:t.mediaType;return!!r&&"video"!==r&&"audio"!==r}},{key:"loader",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.loader}},{key:"transferCost",get:function(){return this.flv._transferCost.transferCost}},{key:"beforePlayerInit",value:function(){var e=this,t=this.player.config,r=this.player.media||this.player.video;if(t.url){this.flv&&this.flv.destroy(),this.player.switchURL=this._onSwitchURL;var n,i=t.flv||{};if(null!==i.disconnectTime&&void 0!==i.disconnectTime||(i.disconnectTime=0),this.flv=new aB(em({softDecode:this.softDecode,isLive:t.isLive,media:r,preProcessUrl:function(t,r){var n,i;return(null===(n=e.player)||void 0===n||null===(i=n.preProcessUrl)||void 0===i?void 0:i.call(n,t,r))||{url:t,ext:r}}},i)),this.softDecode||nS.defineGetterOrSetter(this.player,{url:{get:function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.blobUrl},configurable:!0}}),this.softDecode&&(this.pluginExtension=new oB(em({media:this.player.video,isLive:t.isLive},t.flv),this),this.player.forceDegradeToVideo=function(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return null===(t=e.pluginExtension)||void 0===t?void 0:t.forceDegradeToVideo.apply(t,n)}),t.isLive)null===(n=this.player)||void 0===n||n.useHooks("replay",(function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.replay()}));this.on("urlchange",this._onSwitchURL),this.on("destroy",this.destroy),this._transError(),this._transCoreEvent(CP),this._transCoreEvent(OP),this._transCoreEvent(PP),this._transCoreEvent(DP),this._transCoreEvent(RP),this._transCoreEvent(MP),this._transCoreEvent(UP),this._transCoreEvent(IP),this._transCoreEvent(BP),this._transCoreEvent(jP),this._transCoreEvent(FP),this._transCoreEvent(NP),this._transCoreEvent(zP),this._transCoreEvent(VP),this._transCoreEvent(GP),this._transCoreEvent(HP),this._transCoreEvent(JP),this._transCoreEvent(KP),this._transCoreEvent(WP),this.flv.load(t.url,!0)}}},{key:"_transError",value:function(){var e=this;this.flv.on(LP,(function(t){e.player&&e.player.emit("error",new Qk(e.player,t))}))}},{key:"_transCoreEvent",value:function(e){var t=this;this.flv.on(e,(function(r){t.player&&t.player.emit("core_event",em(em({},r),{},{eventName:e}))}))}}],[{key:"pluginName",get:function(){return"flv"}},{key:"isSupported",value:function(e,t){return aB.isSupported(e,t)}},{key:"isSupportedMMS",value:function(){return"undefined"!=typeof ManagedMediaSource}}]),r}(nS);function uB(e,t,r){return t=hB(t),function(e,t){if(t&&("object"===Cl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cB()?Xy(t,r||[],hB(e).constructor):t.apply(e,r))}function cB(){try{var e=!Boolean.prototype.valueOf.call(Xy(Boolean,[],(function(){})))}catch(t){}return(cB=function(){return!!e})()}function lB(e){var t=function(e,t){if("object"!=Cl(e)||!e)return e;var r=e[$y];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Cl(t)?t:String(t)}function fB(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),Df(e,lB(n.key),n)}}function hB(e){var t;return(hB=Nf?Iy(t=Ff).call(t):function(e){return e.__proto__||Ff(e)})(e)}function dB(e,t){var r;return(dB=Nf?Iy(r=Nf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}um(sB,"Flv",aB);var pB=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),uB(this,t,arguments)}var r,n,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Uf(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Df(e,"prototype",{writable:!1}),t&&dB(e,t)}(t,e),r=t,i=[{key:"pluginName",get:function(){return"adaptive"}},{key:"defaultConfig",get:function(){return{hurryEndMs:1800,hurryStartMs:2500,hurrySpeed:1.1}}}],(n=[{key:"afterCreate",value:function(){var e;this.on("timeupdate",Iy(e=this.onTimeUpdate).call(e,this))}},{key:"onTimeUpdate",value:function(){var e=this.bufferLength;this.speed===this.config.hurrySpeed?e<=this.config.hurryEndMs&&(this.speed=1):1===this.speed&&e>=this.config.hurryStartMs&&(this.speed=this.config.hurrySpeed)}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,r=e[1]-Math.max(e[0],t);return r=Math.round(1e3*Math.max(0,r))}},{key:"speed",get:function(){return this.player.playbackRate},set:function(e){this.speed!==e&&(this.player.playbackRate=e)}}])&&fB(r.prototype,n),i&&fB(r,i),Df(r,"prototype",{writable:!1}),t}(nS),vB=window.VePlayer.DynamicModule;VePlayer.registerPlugin(vB.PluginFlv,{FlvPlugin:sB,Adaptive:pB}),e.Adaptive=pB,e.FlvPlugin=sB}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).__VEPLAYER_PLUGIN_FLV__={})}(this,(function(e){"use strict";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={exports:{}},i=function(e){return e&&e.Math==Math&&e},a=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||t||Function("return this")(),o=function(e){try{return!!e()}catch(t){return!0}},s=!o((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),u=s,c=Function.prototype,l=c.apply,f=c.call,h="object"==typeof Reflect&&Reflect.apply||(u?f.bind(l):function(){return f.apply(l,arguments)}),d=s,p=Function.prototype,v=p.call,y=d&&p.bind.bind(v,v),g=d?y:function(e){return function(){return v.apply(e,arguments)}},m=g,_=m({}.toString),b=m("".slice),w=function(e){return b(_(e),8,-1)},k=w,S=g,x=function(e){if("Function"===k(e))return S(e)},E="object"==typeof document&&document.all,T={all:E,IS_HTMLDDA:void 0===E&&void 0!==E},A=T.all,L=T.IS_HTMLDDA?function(e){return"function"==typeof e||e===A}:function(e){return"function"==typeof e},C={},O=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),P=s,R=Function.prototype.call,D=P?R.bind(R):function(){return R.apply(R,arguments)},U={},M={}.propertyIsEnumerable,I=Object.getOwnPropertyDescriptor,j=I&&!M.call({1:2},1);U.f=j?function(e){var t=I(this,e);return!!t&&t.enumerable}:M;var B,F,N=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},z=o,V=w,G=Object,H=g("".split),q=z((function(){return!G("z").propertyIsEnumerable(0)}))?function(e){return"String"==V(e)?H(e,""):G(e)}:G,K=function(e){return null==e},W=K,Y=TypeError,J=function(e){if(W(e))throw Y("Can't call method on "+e);return e},Q=q,X=J,$=function(e){return Q(X(e))},Z=L,ee=T.all,te=T.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:Z(e)||e===ee}:function(e){return"object"==typeof e?null!==e:Z(e)},re={},ne=re,ie=a,ae=L,oe=function(e){return ae(e)?e:void 0},se=function(e,t){return arguments.length<2?oe(ne[e])||oe(ie[e]):ne[e]&&ne[e][t]||ie[e]&&ie[e][t]},ue=g({}.isPrototypeOf),ce="undefined"!=typeof navigator&&String(navigator.userAgent)||"",le=a,fe=ce,he=le.process,de=le.Deno,pe=he&&he.versions||de&&de.version,ve=pe&&pe.v8;ve&&(F=(B=ve.split("."))[0]>0&&B[0]<4?1:+(B[0]+B[1])),!F&&fe&&(!(B=fe.match(/Edge\/(\d+)/))||B[1]>=74)&&(B=fe.match(/Chrome\/(\d+)/))&&(F=+B[1]);var ye=F,ge=ye,me=o,_e=a.String,be=!!Object.getOwnPropertySymbols&&!me((function(){var e=Symbol();return!_e(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ge&&ge<41})),we=be&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ke=se,Se=L,xe=ue,Ee=Object,Te=we?function(e){return"symbol"==typeof e}:function(e){var t=ke("Symbol");return Se(t)&&xe(t.prototype,Ee(e))},Ae=String,Le=function(e){try{return Ae(e)}catch(t){return"Object"}},Ce=L,Oe=Le,Pe=TypeError,Re=function(e){if(Ce(e))return e;throw Pe(Oe(e)+" is not a function")},De=Re,Ue=K,Me=function(e,t){var r=e[t];return Ue(r)?void 0:De(r)},Ie=D,je=L,Be=te,Fe=TypeError,Ne={exports:{}},ze=a,Ve=Object.defineProperty,Ge=function(e,t){try{Ve(ze,e,{value:t,configurable:!0,writable:!0})}catch(r){ze[e]=t}return t},He="__core-js_shared__",qe=a[He]||Ge(He,{}),Ke=qe;(Ne.exports=function(e,t){return Ke[e]||(Ke[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var We=Ne.exports,Ye=J,Je=Object,Qe=function(e){return Je(Ye(e))},Xe=Qe,$e=g({}.hasOwnProperty),Ze=Object.hasOwn||function(e,t){return $e(Xe(e),t)},et=g,tt=0,rt=Math.random(),nt=et(1..toString),it=function(e){return"Symbol("+(void 0===e?"":e)+")_"+nt(++tt+rt,36)},at=We,ot=Ze,st=it,ut=be,ct=we,lt=a.Symbol,ft=at("wks"),ht=ct?lt.for||lt:lt&&lt.withoutSetter||st,dt=function(e){return ot(ft,e)||(ft[e]=ut&&ot(lt,e)?lt[e]:ht("Symbol."+e)),ft[e]},pt=D,vt=te,yt=Te,gt=Me,mt=function(e,t){var r,n;if("string"===t&&je(r=e.toString)&&!Be(n=Ie(r,e)))return n;if(je(r=e.valueOf)&&!Be(n=Ie(r,e)))return n;if("string"!==t&&je(r=e.toString)&&!Be(n=Ie(r,e)))return n;throw Fe("Can't convert object to primitive value")},_t=TypeError,bt=dt("toPrimitive"),wt=function(e,t){if(!vt(e)||yt(e))return e;var r,n=gt(e,bt);if(n){if(void 0===t&&(t="default"),r=pt(n,e,t),!vt(r)||yt(r))return r;throw _t("Can't convert object to primitive value")}return void 0===t&&(t="number"),mt(e,t)},kt=Te,St=function(e){var t=wt(e,"string");return kt(t)?t:t+""},xt=te,Et=a.document,Tt=xt(Et)&&xt(Et.createElement),At=function(e){return Tt?Et.createElement(e):{}},Lt=At,Ct=!O&&!o((function(){return 7!=Object.defineProperty(Lt("div"),"a",{get:function(){return 7}}).a})),Ot=O,Pt=D,Rt=U,Dt=N,Ut=$,Mt=St,It=Ze,jt=Ct,Bt=Object.getOwnPropertyDescriptor;C.f=Ot?Bt:function(e,t){if(e=Ut(e),t=Mt(t),jt)try{return Bt(e,t)}catch(r){}if(It(e,t))return Dt(!Pt(Rt.f,e,t),e[t])};var Ft=o,Nt=L,zt=/#|\.prototype\./,Vt=function(e,t){var r=Ht[Gt(e)];return r==Kt||r!=qt&&(Nt(t)?Ft(t):!!t)},Gt=Vt.normalize=function(e){return String(e).replace(zt,".").toLowerCase()},Ht=Vt.data={},qt=Vt.NATIVE="N",Kt=Vt.POLYFILL="P",Wt=Vt,Yt=Re,Jt=s,Qt=x(x.bind),Xt=function(e,t){return Yt(e),void 0===t?e:Jt?Qt(e,t):function(){return e.apply(t,arguments)}},$t={},Zt=O&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),er=te,tr=String,rr=TypeError,nr=function(e){if(er(e))return e;throw rr(tr(e)+" is not an object")},ir=O,ar=Ct,or=Zt,sr=nr,ur=St,cr=TypeError,lr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,hr="enumerable",dr="configurable",pr="writable";$t.f=ir?or?function(e,t,r){if(sr(e),t=ur(t),sr(r),"function"==typeof e&&"prototype"===t&&"value"in r&&pr in r&&!r[pr]){var n=fr(e,t);n&&n[pr]&&(e[t]=r.value,r={configurable:dr in r?r[dr]:n[dr],enumerable:hr in r?r[hr]:n[hr],writable:!1})}return lr(e,t,r)}:lr:function(e,t,r){if(sr(e),t=ur(t),sr(r),ar)try{return lr(e,t,r)}catch(n){}if("get"in r||"set"in r)throw cr("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var vr=$t,yr=N,gr=O?function(e,t,r){return vr.f(e,t,yr(1,r))}:function(e,t,r){return e[t]=r,e},mr=a,_r=h,br=x,wr=L,kr=C.f,Sr=Wt,xr=re,Er=Xt,Tr=gr,Ar=Ze,Lr=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 _r(e,this,arguments)};return t.prototype=e.prototype,t},Cr=function(e,t){var r,n,i,a,o,s,u,c,l,f=e.target,h=e.global,d=e.stat,p=e.proto,v=h?mr:d?mr[f]:(mr[f]||{}).prototype,y=h?xr:xr[f]||Tr(xr,f,{})[f],g=y.prototype;for(a in t)n=!(r=Sr(h?a:f+(d?".":"#")+a,e.forced))&&v&&Ar(v,a),s=y[a],n&&(u=e.dontCallGetSet?(l=kr(v,a))&&l.value:v[a]),o=n&&u?u:t[a],n&&typeof s==typeof o||(c=e.bind&&n?Er(o,mr):e.wrap&&n?Lr(o):p&&wr(o)?br(o):o,(e.sham||o&&o.sham||s&&s.sham)&&Tr(c,"sham",!0),Tr(y,a,c),p&&(Ar(xr,i=f+"Prototype")||Tr(xr,i,{}),Tr(xr[i],a,o),e.real&&g&&(r||!g[a])&&Tr(g,a,o)))},Or=Cr,Pr=O,Rr=$t.f;Or({target:"Object",stat:!0,forced:Object.defineProperty!==Rr,sham:!Pr},{defineProperty:Rr});var Dr=re.Object,Ur=n.exports=function(e,t,r){return Dr.defineProperty(e,t,r)};Dr.defineProperty.sham&&(Ur.sham=!0);var Mr=n.exports,Ir=r(Mr),jr=w,Br=Array.isArray||function(e){return"Array"==jr(e)},Fr=Math.ceil,Nr=Math.floor,zr=Math.trunc||function(e){var t=+e;return(t>0?Nr:Fr)(t)},Vr=function(e){var t=+e;return t!=t||0===t?0:zr(t)},Gr=Vr,Hr=Math.min,qr=function(e){return e>0?Hr(Gr(e),9007199254740991):0},Kr=qr,Wr=function(e){return Kr(e.length)},Yr=TypeError,Jr=function(e){if(e>9007199254740991)throw Yr("Maximum allowed index exceeded");return e},Qr=St,Xr=$t,$r=N,Zr=function(e,t,r){var n=Qr(t);n in e?Xr.f(e,n,$r(0,r)):e[n]=r},en={};en[dt("toStringTag")]="z";var tn="[object z]"===String(en),rn=tn,nn=L,an=w,on=dt("toStringTag"),sn=Object,un="Arguments"==an(function(){return arguments}()),cn=rn?an: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(r){}}(t=sn(e),on))?r:un?an(t):"Object"==(n=an(t))&&nn(t.callee)?"Arguments":n},ln=L,fn=qe,hn=g(Function.toString);ln(fn.inspectSource)||(fn.inspectSource=function(e){return hn(e)});var dn=fn.inspectSource,pn=g,vn=o,yn=L,gn=cn,mn=dn,_n=function(){},bn=[],wn=se("Reflect","construct"),kn=/^\s*(?:class|function)\b/,Sn=pn(kn.exec),xn=!kn.exec(_n),En=function(e){if(!yn(e))return!1;try{return wn(_n,bn,e),!0}catch(t){return!1}},Tn=function(e){if(!yn(e))return!1;switch(gn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return xn||!!Sn(kn,mn(e))}catch(t){return!0}};Tn.sham=!0;var An=!wn||vn((function(){var e;return En(En.call)||!En(Object)||!En((function(){e=!0}))||e}))?Tn:En,Ln=Br,Cn=An,On=te,Pn=dt("species"),Rn=Array,Dn=function(e){var t;return Ln(e)&&(t=e.constructor,(Cn(t)&&(t===Rn||Ln(t.prototype))||On(t)&&null===(t=t[Pn]))&&(t=void 0)),void 0===t?Rn:t},Un=function(e,t){return new(Dn(e))(0===t?0:t)},Mn=o,In=ye,jn=dt("species"),Bn=function(e){return In>=51||!Mn((function(){var t=[];return(t.constructor={})[jn]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Fn=Cr,Nn=o,zn=Br,Vn=te,Gn=Qe,Hn=Wr,qn=Jr,Kn=Zr,Wn=Un,Yn=Bn,Jn=ye,Qn=dt("isConcatSpreadable"),Xn=Jn>=51||!Nn((function(){var e=[];return e[Qn]=!1,e.concat()[0]!==e})),$n=function(e){if(!Vn(e))return!1;var t=e[Qn];return void 0!==t?!!t:zn(e)};Fn({target:"Array",proto:!0,arity:1,forced:!Xn||!Yn("concat")},{concat:function(e){var t,r,n,i,a,o=Gn(this),s=Wn(o,0),u=0;for(t=-1,n=arguments.length;t<n;t++)if($n(a=-1===t?o:arguments[t]))for(i=Hn(a),qn(u+i),r=0;r<i;r++,u++)r in a&&Kn(s,u,a[r]);else qn(u+1),Kn(s,u++,a);return s.length=u,s}});var Zn=cn,ei=String,ti=function(e){if("Symbol"===Zn(e))throw TypeError("Cannot convert a Symbol value to a string");return ei(e)},ri={},ni=Vr,ii=Math.max,ai=Math.min,oi=function(e,t){var r=ni(e);return r<0?ii(r+t,0):ai(r,t)},si=$,ui=oi,ci=Wr,li=function(e){return function(t,r,n){var i,a=si(t),o=ci(a),s=ui(n,o);if(e&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===r)return e||s||0;return!e&&-1}},fi={includes:li(!0),indexOf:li(!1)},hi={},di=Ze,pi=$,vi=fi.indexOf,yi=hi,gi=g([].push),mi=function(e,t){var r,n=pi(e),i=0,a=[];for(r in n)!di(yi,r)&&di(n,r)&&gi(a,r);for(;t.length>i;)di(n,r=t[i++])&&(~vi(a,r)||gi(a,r));return a},_i=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bi=mi,wi=_i,ki=Object.keys||function(e){return bi(e,wi)},Si=O,xi=Zt,Ei=$t,Ti=nr,Ai=$,Li=ki;ri.f=Si&&!xi?Object.defineProperties:function(e,t){Ti(e);for(var r,n=Ai(t),i=Li(t),a=i.length,o=0;a>o;)Ei.f(e,r=i[o++],n[r]);return e};var Ci,Oi=se("document","documentElement"),Pi=it,Ri=We("keys"),Di=function(e){return Ri[e]||(Ri[e]=Pi(e))},Ui=nr,Mi=ri,Ii=_i,ji=hi,Bi=Oi,Fi=At,Ni="prototype",zi="script",Vi=Di("IE_PROTO"),Gi=function(){},Hi=function(e){return"<"+zi+">"+e+"</"+zi+">"},qi=function(e){e.write(Hi("")),e.close();var t=e.parentWindow.Object;return e=null,t},Ki=function(){try{Ci=new ActiveXObject("htmlfile")}catch(i){}var e,t,r;Ki="undefined"!=typeof document?document.domain&&Ci?qi(Ci):(t=Fi("iframe"),r="java"+zi+":",t.style.display="none",Bi.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(Hi("document.F=Object")),e.close(),e.F):qi(Ci);for(var n=Ii.length;n--;)delete Ki[Ni][Ii[n]];return Ki()};ji[Vi]=!0;var Wi=Object.create||function(e,t){var r;return null!==e?(Gi[Ni]=Ui(e),r=new Gi,Gi[Ni]=null,r[Vi]=e):r=Ki(),void 0===t?r:Mi.f(r,t)},Yi={},Ji=mi,Qi=_i.concat("length","prototype");Yi.f=Object.getOwnPropertyNames||function(e){return Ji(e,Qi)};var Xi={},$i=oi,Zi=Wr,ea=Zr,ta=Array,ra=Math.max,na=function(e,t,r){for(var n=Zi(e),i=$i(t,n),a=$i(void 0===r?n:r,n),o=ta(ra(a-i,0)),s=0;i<a;i++,s++)ea(o,s,e[i]);return o.length=s,o},ia=w,aa=$,oa=Yi.f,sa=na,ua="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Xi.f=function(e){return ua&&"Window"==ia(e)?function(e){try{return oa(e)}catch(t){return sa(ua)}}(e):oa(aa(e))};var ca={};ca.f=Object.getOwnPropertySymbols;var la=gr,fa=function(e,t,r,n){return n&&n.enumerable?e[t]=r:la(e,t,r),e},ha=$t,da=function(e,t,r){return ha.f(e,t,r)},pa={},va=dt;pa.f=va;var ya,ga,ma,_a=re,ba=Ze,wa=pa,ka=$t.f,Sa=function(e){var t=_a.Symbol||(_a.Symbol={});ba(t,e)||ka(t,e,{value:wa.f(e)})},xa=D,Ea=se,Ta=dt,Aa=fa,La=function(){var e=Ea("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=Ta("toPrimitive");t&&!t[n]&&Aa(t,n,(function(e){return xa(r,this)}),{arity:1})},Ca=cn,Oa=tn?{}.toString:function(){return"[object "+Ca(this)+"]"},Pa=tn,Ra=$t.f,Da=gr,Ua=Ze,Ma=Oa,Ia=dt("toStringTag"),ja=function(e,t,r,n){if(e){var i=r?e:e.prototype;Ua(i,Ia)||Ra(i,Ia,{configurable:!0,value:t}),n&&!Pa&&Da(i,"toString",Ma)}},Ba=L,Fa=a.WeakMap,Na=Ba(Fa)&&/native code/.test(String(Fa)),za=a,Va=te,Ga=gr,Ha=Ze,qa=qe,Ka=Di,Wa=hi,Ya="Object already initialized",Ja=za.TypeError,Qa=za.WeakMap;if(Na||qa.state){var Xa=qa.state||(qa.state=new Qa);Xa.get=Xa.get,Xa.has=Xa.has,Xa.set=Xa.set,ya=function(e,t){if(Xa.has(e))throw Ja(Ya);return t.facade=e,Xa.set(e,t),t},ga=function(e){return Xa.get(e)||{}},ma=function(e){return Xa.has(e)}}else{var $a=Ka("state");Wa[$a]=!0,ya=function(e,t){if(Ha(e,$a))throw Ja(Ya);return t.facade=e,Ga(e,$a,t),t},ga=function(e){return Ha(e,$a)?e[$a]:{}},ma=function(e){return Ha(e,$a)}}var Za={set:ya,get:ga,has:ma,enforce:function(e){return ma(e)?ga(e):ya(e,{})},getterFor:function(e){return function(t){var r;if(!Va(t)||(r=ga(t)).type!==e)throw Ja("Incompatible receiver, "+e+" required");return r}}},eo=Xt,to=q,ro=Qe,no=Wr,io=Un,ao=g([].push),oo=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,a=6==e,o=7==e,s=5==e||a;return function(u,c,l,f){for(var h,d,p=ro(u),v=to(p),y=eo(c,l),g=no(v),m=0,_=f||io,b=t?_(u,g):r||o?_(u,0):void 0;g>m;m++)if((s||m in v)&&(d=y(h=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:ao(b,h)}else switch(e){case 4:return!1;case 7:ao(b,h)}return a?-1:n||i?i:b}},so={forEach:oo(0),map:oo(1),filter:oo(2),some:oo(3),every:oo(4),find:oo(5),findIndex:oo(6),filterReject:oo(7)},uo=Cr,co=a,lo=D,fo=g,ho=O,po=be,vo=o,yo=Ze,go=ue,mo=nr,_o=$,bo=St,wo=ti,ko=N,So=Wi,xo=ki,Eo=Yi,To=Xi,Ao=ca,Lo=C,Co=$t,Oo=ri,Po=U,Ro=fa,Do=da,Uo=We,Mo=hi,Io=it,jo=dt,Bo=pa,Fo=Sa,No=La,zo=ja,Vo=Za,Go=so.forEach,Ho=Di("hidden"),qo="Symbol",Ko="prototype",Wo=Vo.set,Yo=Vo.getterFor(qo),Jo=Object[Ko],Qo=co.Symbol,Xo=Qo&&Qo[Ko],$o=co.TypeError,Zo=co.QObject,es=Lo.f,ts=Co.f,rs=To.f,ns=Po.f,is=fo([].push),as=Uo("symbols"),os=Uo("op-symbols"),ss=Uo("wks"),us=!Zo||!Zo[Ko]||!Zo[Ko].findChild,cs=ho&&vo((function(){return 7!=So(ts({},"a",{get:function(){return ts(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=es(Jo,t);n&&delete Jo[t],ts(e,t,r),n&&e!==Jo&&ts(Jo,t,n)}:ts,ls=function(e,t){var r=as[e]=So(Xo);return Wo(r,{type:qo,tag:e,description:t}),ho||(r.description=t),r},fs=function(e,t,r){e===Jo&&fs(os,t,r),mo(e);var n=bo(t);return mo(r),yo(as,n)?(r.enumerable?(yo(e,Ho)&&e[Ho][n]&&(e[Ho][n]=!1),r=So(r,{enumerable:ko(0,!1)})):(yo(e,Ho)||ts(e,Ho,ko(1,{})),e[Ho][n]=!0),cs(e,n,r)):ts(e,n,r)},hs=function(e,t){mo(e);var r=_o(t),n=xo(r).concat(ys(r));return Go(n,(function(t){ho&&!lo(ds,r,t)||fs(e,t,r[t])})),e},ds=function(e){var t=bo(e),r=lo(ns,this,t);return!(this===Jo&&yo(as,t)&&!yo(os,t))&&(!(r||!yo(this,t)||!yo(as,t)||yo(this,Ho)&&this[Ho][t])||r)},ps=function(e,t){var r=_o(e),n=bo(t);if(r!==Jo||!yo(as,n)||yo(os,n)){var i=es(r,n);return!i||!yo(as,n)||yo(r,Ho)&&r[Ho][n]||(i.enumerable=!0),i}},vs=function(e){var t=rs(_o(e)),r=[];return Go(t,(function(e){yo(as,e)||yo(Mo,e)||is(r,e)})),r},ys=function(e){var t=e===Jo,r=rs(t?os:_o(e)),n=[];return Go(r,(function(e){!yo(as,e)||t&&!yo(Jo,e)||is(n,as[e])})),n};po||(Qo=function(){if(go(Xo,this))throw $o("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?wo(arguments[0]):void 0,t=Io(e),r=function(e){this===Jo&&lo(r,os,e),yo(this,Ho)&&yo(this[Ho],t)&&(this[Ho][t]=!1),cs(this,t,ko(1,e))};return ho&&us&&cs(Jo,t,{configurable:!0,set:r}),ls(t,e)},Ro(Xo=Qo[Ko],"toString",(function(){return Yo(this).tag})),Ro(Qo,"withoutSetter",(function(e){return ls(Io(e),e)})),Po.f=ds,Co.f=fs,Oo.f=hs,Lo.f=ps,Eo.f=To.f=vs,Ao.f=ys,Bo.f=function(e){return ls(jo(e),e)},ho&&Do(Xo,"description",{configurable:!0,get:function(){return Yo(this).description}})),uo({global:!0,constructor:!0,wrap:!0,forced:!po,sham:!po},{Symbol:Qo}),Go(xo(ss),(function(e){Fo(e)})),uo({target:qo,stat:!0,forced:!po},{useSetter:function(){us=!0},useSimple:function(){us=!1}}),uo({target:"Object",stat:!0,forced:!po,sham:!ho},{create:function(e,t){return void 0===t?So(e):hs(So(e),t)},defineProperty:fs,defineProperties:hs,getOwnPropertyDescriptor:ps}),uo({target:"Object",stat:!0,forced:!po},{getOwnPropertyNames:vs}),No(),zo(Qo,qo),Mo[Ho]=!0;var gs=be&&!!Symbol.for&&!!Symbol.keyFor,ms=Cr,_s=se,bs=Ze,ws=ti,ks=We,Ss=gs,xs=ks("string-to-symbol-registry"),Es=ks("symbol-to-string-registry");ms({target:"Symbol",stat:!0,forced:!Ss},{for:function(e){var t=ws(e);if(bs(xs,t))return xs[t];var r=_s("Symbol")(t);return xs[t]=r,Es[r]=t,r}});var Ts=Cr,As=Ze,Ls=Te,Cs=Le,Os=gs,Ps=We("symbol-to-string-registry");Ts({target:"Symbol",stat:!0,forced:!Os},{keyFor:function(e){if(!Ls(e))throw TypeError(Cs(e)+" is not a symbol");if(As(Ps,e))return Ps[e]}});var Rs=g([].slice),Ds=Br,Us=L,Ms=w,Is=ti,js=g([].push),Bs=Cr,Fs=se,Ns=h,zs=D,Vs=g,Gs=o,Hs=L,qs=Te,Ks=Rs,Ws=function(e){if(Us(e))return e;if(Ds(e)){for(var t=e.length,r=[],n=0;n<t;n++){var i=e[n];"string"==typeof i?js(r,i):"number"!=typeof i&&"Number"!=Ms(i)&&"String"!=Ms(i)||js(r,Is(i))}var a=r.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ds(this))return t;for(var n=0;n<a;n++)if(r[n]===e)return t}}},Ys=be,Js=String,Qs=Fs("JSON","stringify"),Xs=Vs(/./.exec),$s=Vs("".charAt),Zs=Vs("".charCodeAt),eu=Vs("".replace),tu=Vs(1..toString),ru=/[\uD800-\uDFFF]/g,nu=/^[\uD800-\uDBFF]$/,iu=/^[\uDC00-\uDFFF]$/,au=!Ys||Gs((function(){var e=Fs("Symbol")();return"[null]"!=Qs([e])||"{}"!=Qs({a:e})||"{}"!=Qs(Object(e))})),ou=Gs((function(){return'"\\udf06\\ud834"'!==Qs("\udf06\ud834")||'"\\udead"'!==Qs("\udead")})),su=function(e,t){var r=Ks(arguments),n=Ws(t);if(Hs(n)||void 0!==e&&!qs(e))return r[1]=function(e,t){if(Hs(n)&&(t=zs(n,this,Js(e),t)),!qs(t))return t},Ns(Qs,null,r)},uu=function(e,t,r){var n=$s(r,t-1),i=$s(r,t+1);return Xs(nu,e)&&!Xs(iu,i)||Xs(iu,e)&&!Xs(nu,n)?"\\u"+tu(Zs(e,0),16):e};Qs&&Bs({target:"JSON",stat:!0,arity:3,forced:au||ou},{stringify:function(e,t,r){var n=Ks(arguments),i=Ns(au?su:Qs,null,n);return ou&&"string"==typeof i?eu(i,ru,uu):i}});var cu=ca,lu=Qe;Cr({target:"Object",stat:!0,forced:!be||o((function(){cu.f(1)}))},{getOwnPropertySymbols:function(e){var t=cu.f;return t?t(lu(e)):[]}}),Sa("asyncIterator"),Sa("hasInstance"),Sa("isConcatSpreadable"),Sa("iterator"),Sa("match"),Sa("matchAll"),Sa("replace"),Sa("search"),Sa("species"),Sa("split");var fu=La;Sa("toPrimitive"),fu();var hu=se,du=ja;Sa("toStringTag"),du(hu("Symbol"),"Symbol"),Sa("unscopables"),ja(a.JSON,"JSON",!0);var pu,vu,yu,gu=re.Symbol,mu={},_u=O,bu=Ze,wu=Function.prototype,ku=_u&&Object.getOwnPropertyDescriptor,Su=bu(wu,"name"),xu={EXISTS:Su,PROPER:Su&&"something"===function(){}.name,CONFIGURABLE:Su&&(!_u||_u&&ku(wu,"name").configurable)},Eu=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Tu=Ze,Au=L,Lu=Qe,Cu=Eu,Ou=Di("IE_PROTO"),Pu=Object,Ru=Pu.prototype,Du=Cu?Pu.getPrototypeOf:function(e){var t=Lu(e);if(Tu(t,Ou))return t[Ou];var r=t.constructor;return Au(r)&&t instanceof r?r.prototype:t instanceof Pu?Ru:null},Uu=o,Mu=L,Iu=te,ju=Wi,Bu=Du,Fu=fa,Nu=dt("iterator"),zu=!1;[].keys&&("next"in(yu=[].keys())?(vu=Bu(Bu(yu)))!==Object.prototype&&(pu=vu):zu=!0);var Vu=!Iu(pu)||Uu((function(){var e={};return pu[Nu].call(e)!==e}));Mu((pu=Vu?{}:ju(pu))[Nu])||Fu(pu,Nu,(function(){return this}));var Gu={IteratorPrototype:pu,BUGGY_SAFARI_ITERATORS:zu},Hu=Gu.IteratorPrototype,qu=Wi,Ku=N,Wu=ja,Yu=mu,Ju=function(){return this},Qu=function(e,t,r,n){var i=t+" Iterator";return e.prototype=qu(Hu,{next:Ku(+!n,r)}),Wu(e,i,!1,!0),Yu[i]=Ju,e},Xu=g,$u=Re,Zu=L,ec=String,tc=TypeError,rc=function(e,t,r){try{return Xu($u(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(n){}},nc=nr,ic=function(e){if("object"==typeof e||Zu(e))return e;throw tc("Can't set "+ec(e)+" as a prototype")},ac=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=rc(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(n){}return function(r,n){return nc(r),ic(n),t?e(r,n):r.__proto__=n,r}}():void 0),oc=Cr,sc=D,uc=xu,cc=Qu,lc=Du,fc=ja,hc=fa,dc=mu,pc=Gu,vc=uc.PROPER,yc=pc.BUGGY_SAFARI_ITERATORS,gc=dt("iterator"),mc="keys",_c="values",bc="entries",wc=function(){return this},kc=function(e,t,r,n,i,a,o){cc(r,t,n);var s,u,c,l=function(e){if(e===i&&v)return v;if(!yc&&e in d)return d[e];switch(e){case mc:case _c:case bc:return function(){return new r(this,e)}}return function(){return new r(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[gc]||d["@@iterator"]||i&&d[i],v=!yc&&p||l(i),y="Array"==t&&d.entries||p;if(y&&(s=lc(y.call(new e)))!==Object.prototype&&s.next&&(fc(s,f,!0,!0),dc[f]=wc),vc&&i==_c&&p&&p.name!==_c&&(h=!0,v=function(){return sc(p,this)}),i)if(u={values:l(_c),keys:a?v:l(mc),entries:l(bc)},o)for(c in u)(yc||h||!(c in d))&&hc(d,c,u[c]);else oc({target:t,proto:!0,forced:yc||h},u);return o&&d[gc]!==v&&hc(d,gc,v,{name:i}),dc[t]=v,u},Sc=function(e,t){return{value:e,done:t}},xc=$,Ec=mu,Tc=Za;$t.f;var Ac=kc,Lc=Sc,Cc="Array Iterator",Oc=Tc.set,Pc=Tc.getterFor(Cc);Ac(Array,"Array",(function(e,t){Oc(this,{type:Cc,target:xc(e),index:0,kind:t})}),(function(){var e=Pc(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,Lc(void 0,!0)):Lc("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),Ec.Arguments=Ec.Array;var Rc={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},Dc=a,Uc=cn,Mc=gr,Ic=mu,jc=dt("toStringTag");for(var Bc in Rc){var Fc=Dc[Bc],Nc=Fc&&Fc.prototype;Nc&&Uc(Nc)!==jc&&Mc(Nc,jc,Bc),Ic[Bc]=Ic.Array}var zc=gu;Sa("dispose");var Vc=zc;Sa("asyncDispose");var Gc=Cr,Hc=g,qc=se("Symbol"),Kc=qc.keyFor,Wc=Hc(qc.prototype.valueOf);Gc({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==Kc(Wc(e))}catch(t){return!1}}});for(var Yc=Cr,Jc=We,Qc=se,Xc=g,$c=Te,Zc=dt,el=Qc("Symbol"),tl=el.isWellKnown,rl=Qc("Object","getOwnPropertyNames"),nl=Xc(el.prototype.valueOf),il=Jc("wks"),al=0,ol=rl(el),sl=ol.length;al<sl;al++)try{var ul=ol[al];$c(el[ul])&&Zc(ul)}catch(Vj){}Yc({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if(tl&&tl(e))return!0;try{for(var t=nl(e),r=0,n=rl(il),i=n.length;r<i;r++)if(il[n[r]]==t)return!0}catch(Vj){}return!1}}),Sa("matcher"),Sa("metadataKey"),Sa("observable"),Sa("metadata"),Sa("patternMatch"),Sa("replaceAll");var cl=Vc,ll=r(cl),fl=g,hl=Vr,dl=ti,pl=J,vl=fl("".charAt),yl=fl("".charCodeAt),gl=fl("".slice),ml=function(e){return function(t,r){var n,i,a=dl(pl(t)),o=hl(r),s=a.length;return o<0||o>=s?e?"":void 0:(n=yl(a,o))<55296||n>56319||o+1===s||(i=yl(a,o+1))<56320||i>57343?e?vl(a,o):n:e?gl(a,o,o+2):i-56320+(n-55296<<10)+65536}},_l={codeAt:ml(!1),charAt:ml(!0)},bl=_l.charAt,wl=ti,kl=Za,Sl=kc,xl=Sc,El="String Iterator",Tl=kl.set,Al=kl.getterFor(El);Sl(String,"String",(function(e){Tl(this,{type:El,string:wl(e),index:0})}),(function(){var e,t=Al(this),r=t.string,n=t.index;return n>=r.length?xl(void 0,!0):(e=bl(r,n),t.index+=e.length,xl(e,!1))}));var Ll=pa.f("iterator"),Cl=r(Ll);function Ol(e){return(Ol="function"==typeof ll&&"symbol"==typeof Cl?function(e){return typeof e}:function(e){return e&&"function"==typeof ll&&e.constructor===ll&&e!==ll.prototype?"symbol":typeof e})(e)}var Pl=pa.f("toPrimitive"),Rl=r(Pl);function Dl(e){var t=function(e,t){if("object"!==Ol(e)||null===e)return e;var r=e[Rl];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ol(t)?t:String(t)}function Ul(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),Ir(e,Dl(n.key),n)}}function Ml(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Il=Ze,jl=D,Bl=te,Fl=nr,Nl=function(e){return void 0!==e&&(Il(e,"value")||Il(e,"writable"))},zl=C,Vl=Du;Cr({target:"Reflect",stat:!0},{get:function e(t,r){var n,i,a=arguments.length<3?t:arguments[2];return Fl(t)===a?t[r]:(n=zl.f(t,r))?Nl(n)?n.value:void 0===n.get?void 0:jl(n.get,a):Bl(i=Vl(t))?e(i,r,a):void 0}});var Gl=re.Reflect.get,Hl=r(Gl),ql=g,Kl=Re,Wl=te,Yl=Ze,Jl=Rs,Ql=s,Xl=Function,$l=ql([].concat),Zl=ql([].join),ef={},tf=Ql?Xl.bind:function(e){var t=Kl(this),r=t.prototype,n=Jl(arguments,1),i=function(){var r=$l(n,Jl(arguments));return this instanceof i?function(e,t,r){if(!Yl(ef,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";ef[t]=Xl("C,a","return new C("+Zl(n,",")+")")}return ef[t](e,r)}(t,r.length,r):t.apply(e,r)};return Wl(r)&&(i.prototype=r),i},rf=tf;Cr({target:"Function",proto:!0,forced:Function.bind!==rf},{bind:rf});var nf=re,af=function(e){return nf[e+"Prototype"]},of=af("Function").bind,sf=ue,uf=of,cf=Function.prototype,lf=function(e){var t=e.bind;return e===cf||sf(cf,e)&&t===cf.bind?uf:t},ff=r(lf),hf={exports:{}},df=Cr,pf=o,vf=$,yf=C.f,gf=O;df({target:"Object",stat:!0,forced:!gf||pf((function(){yf(1)})),sham:!gf},{getOwnPropertyDescriptor:function(e,t){return yf(vf(e),t)}});var mf=re.Object,_f=hf.exports=function(e,t){return mf.getOwnPropertyDescriptor(e,t)};mf.getOwnPropertyDescriptor.sham&&(_f.sham=!0);var bf=hf.exports,wf=r(bf);Cr({target:"Object",stat:!0},{setPrototypeOf:ac});var kf=re.Object.setPrototypeOf,Sf=r(kf),xf=Qe,Ef=Du,Tf=Eu;Cr({target:"Object",stat:!0,forced:o((function(){Ef(1)})),sham:!Tf},{getPrototypeOf:function(e){return Ef(xf(e))}});var Af=re.Object.getPrototypeOf,Lf=r(Af);function Cf(e){var t;return(Cf=Sf?ff(t=Lf).call(t):function(e){return e.__proto__||Lf(e)})(e)}function Of(){var e;"undefined"!=typeof Reflect&&Hl?Of=ff(e=Hl).call(e):Of=function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Cf(e)););return e}(e,t);if(n){var i=wf(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}};return Of.apply(this,arguments)}Cr({target:"Object",stat:!0,sham:!O},{create:Wi});var Pf=re.Object,Rf=function(e,t){return Pf.create(e,t)},Df=r(Rf);function Uf(e,t){var r;return(Uf=Sf?ff(r=Sf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}var Mf=An,If=Le,jf=TypeError,Bf=function(e){if(Mf(e))return e;throw jf(If(e)+" is not a constructor")},Ff=Cr,Nf=h,zf=tf,Vf=Bf,Gf=nr,Hf=te,qf=Wi,Kf=o,Wf=se("Reflect","construct"),Yf=Object.prototype,Jf=[].push,Qf=Kf((function(){function e(){}return!(Wf((function(){}),[],e)instanceof e)})),Xf=!Kf((function(){Wf((function(){}))})),$f=Qf||Xf;Ff({target:"Reflect",stat:!0,forced:$f,sham:$f},{construct:function(e,t){Vf(e),Gf(t);var r=arguments.length<3?e:Vf(arguments[2]);if(Xf&&!Qf)return Wf(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return Nf(Jf,n,t),new(Nf(zf,e,n))}var i=r.prototype,a=qf(Hf(i)?i:Yf),o=Nf(e,a,t);return Hf(o)?o:a}});var Zf=re.Reflect.construct,eh=r(Zf);function th(e){var t=function(){if("undefined"==typeof Reflect||!eh)return!1;if(eh.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(eh(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Cf(e);if(t){var i=Cf(this).constructor;r=eh(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===Ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ml(e)}(this,r)}}var rh=af("Array").concat,nh=ue,ih=rh,ah=Array.prototype,oh=r((function(e){var t=e.concat;return e===ah||nh(ah,e)&&t===ah.concat?ih:t})),sh=Qe,uh=ki;Cr({target:"Object",stat:!0,forced:o((function(){uh(1)}))},{keys:function(e){return uh(sh(e))}});var ch=r(re.Object.keys),lh=r(re.Object.getOwnPropertySymbols),fh=so.filter;Cr({target:"Array",proto:!0,forced:!Bn("filter")},{filter:function(e){return fh(this,e,arguments.length>1?arguments[1]:void 0)}});var hh=af("Array").filter,dh=ue,ph=hh,vh=Array.prototype,yh=r((function(e){var t=e.filter;return e===vh||dh(vh,e)&&t===vh.filter?ph:t})),gh=r(bf),mh=o,_h=function(e,t){var r=[][e];return!!r&&mh((function(){r.call(null,t||function(){return 1},1)}))},bh=so.forEach,wh=_h("forEach")?[].forEach:function(e){return bh(this,e,arguments.length>1?arguments[1]:void 0)};Cr({target:"Array",proto:!0,forced:[].forEach!=wh},{forEach:wh});var kh=af("Array").forEach,Sh=cn,xh=Ze,Eh=ue,Th=kh,Ah=Array.prototype,Lh={DOMTokenList:!0,NodeList:!0},Ch=r((function(e){var t=e.forEach;return e===Ah||Eh(Ah,e)&&t===Ah.forEach||xh(Lh,Sh(e))?Th:t})),Oh=se,Ph=Yi,Rh=ca,Dh=nr,Uh=g([].concat),Mh=Oh("Reflect","ownKeys")||function(e){var t=Ph.f(Dh(e)),r=Rh.f;return r?Uh(t,r(e)):t},Ih=Mh,jh=$,Bh=C,Fh=Zr;Cr({target:"Object",stat:!0,sham:!O},{getOwnPropertyDescriptors:function(e){for(var t,r,n=jh(e),i=Bh.f,a=Ih(n),o={},s=0;a.length>s;)void 0!==(r=i(n,t=a[s++]))&&Fh(o,t,r);return o}});var Nh=r(re.Object.getOwnPropertyDescriptors),zh={exports:{}},Vh=Cr,Gh=O,Hh=ri.f;Vh({target:"Object",stat:!0,forced:Object.defineProperties!==Hh,sham:!Gh},{defineProperties:Hh});var qh=re.Object,Kh=zh.exports=function(e,t){return qh.defineProperties(e,t)};qh.defineProperties.sham&&(Kh.sham=!0);var Wh=r(zh.exports),Yh=r(Mr),Jh=r(cl),Qh=r(Rf),Xh=r(Af),$h=r(kf),Zh=Ze,ed=Mh,td=C,rd=$t,nd=te,id=gr,ad=Error,od=g("".replace),sd=String(ad("zxcasd").stack),ud=/\n\s*at [^:]*:[^\n]*/,cd=ud.test(sd),ld=N,fd=!o((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",ld(1,7)),7!==e.stack)})),hd=gr,dd=function(e,t){if(cd&&"string"==typeof e&&!ad.prepareStackTrace)for(;t--;)e=od(e,ud,"");return e},pd=fd,vd=Error.captureStackTrace,yd=mu,gd=dt("iterator"),md=Array.prototype,_d=function(e){return void 0!==e&&(yd.Array===e||md[gd]===e)},bd=cn,wd=Me,kd=K,Sd=mu,xd=dt("iterator"),Ed=function(e){if(!kd(e))return wd(e,xd)||wd(e,"@@iterator")||Sd[bd(e)]},Td=D,Ad=Re,Ld=nr,Cd=Le,Od=Ed,Pd=TypeError,Rd=function(e,t){var r=arguments.length<2?Od(e):t;if(Ad(r))return Ld(Td(r,e));throw Pd(Cd(e)+" is not iterable")},Dd=D,Ud=nr,Md=Me,Id=function(e,t,r){var n,i;Ud(e);try{if(!(n=Md(e,"return"))){if("throw"===t)throw r;return r}n=Dd(n,e)}catch(Vj){i=!0,n=Vj}if("throw"===t)throw r;if(i)throw n;return Ud(n),r},jd=Xt,Bd=D,Fd=nr,Nd=Le,zd=_d,Vd=Wr,Gd=ue,Hd=Rd,qd=Ed,Kd=Id,Wd=TypeError,Yd=function(e,t){this.stopped=e,this.result=t},Jd=Yd.prototype,Qd=function(e,t,r){var n,i,a,o,s,u,c,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),v=jd(t,l),y=function(e){return n&&Kd(n,"normal",e),new Yd(!0,e)},g=function(e){return f?(Fd(e),p?v(e[0],e[1],y):v(e[0],e[1])):p?v(e,y):v(e)};if(h)n=e.iterator;else if(d)n=e;else{if(!(i=qd(e)))throw Wd(Nd(e)+" is not iterable");if(zd(i)){for(a=0,o=Vd(e);o>a;a++)if((s=g(e[a]))&&Gd(Jd,s))return s;return new Yd(!1)}n=Hd(e,i)}for(u=h?e.next:n.next;!(c=Bd(u,n)).done;){try{s=g(c.value)}catch(Vj){Kd(n,"throw",Vj)}if("object"==typeof s&&s&&Gd(Jd,s))return s}return new Yd(!1)},Xd=ti,$d=Cr,Zd=ue,ep=Du,tp=ac,rp=function(e,t,r){for(var n=ed(t),i=rd.f,a=td.f,o=0;o<n.length;o++){var s=n[o];Zh(e,s)||r&&Zh(r,s)||i(e,s,a(t,s))}},np=Wi,ip=gr,ap=N,op=function(e,t){nd(t)&&"cause"in t&&id(e,"cause",t.cause)},sp=function(e,t,r,n){pd&&(vd?vd(e,t):hd(e,"stack",dd(r,n)))},up=Qd,cp=function(e,t){return void 0===e?arguments.length<2?"":t:Xd(e)},lp=dt("toStringTag"),fp=Error,hp=[].push,dp=function(e,t){var r,n=Zd(pp,this);tp?r=tp(fp(),n?ep(this):pp):(r=n?this:np(pp),ip(r,lp,"Error")),void 0!==t&&ip(r,"message",cp(t)),sp(r,dp,r.stack,1),arguments.length>2&&op(r,arguments[2]);var i=[];return up(e,hp,{that:i}),ip(r,"errors",i),r};tp?tp(dp,fp):rp(dp,fp,{name:!0});var pp=dp.prototype=np(fp.prototype,{constructor:ap(1,dp),message:ap(1,""),name:ap(1,"AggregateError")});$d({global:!0,constructor:!0,arity:2},{AggregateError:dp});var vp,yp,gp,mp,_p="undefined"!=typeof process&&"process"==w(process),bp=se,wp=da,kp=O,Sp=dt("species"),xp=function(e){var t=bp(e);kp&&t&&!t[Sp]&&wp(t,Sp,{configurable:!0,get:function(){return this}})},Ep=ue,Tp=TypeError,Ap=function(e,t){if(Ep(t,e))return e;throw Tp("Incorrect invocation")},Lp=nr,Cp=Bf,Op=K,Pp=dt("species"),Rp=function(e,t){var r,n=Lp(e).constructor;return void 0===n||Op(r=Lp(n)[Pp])?t:Cp(r)},Dp=TypeError,Up=function(e,t){if(e<t)throw Dp("Not enough arguments");return e},Mp=/(?:ipad|iphone|ipod).*applewebkit/i.test(ce),Ip=a,jp=h,Bp=Xt,Fp=L,Np=Ze,zp=o,Vp=Oi,Gp=Rs,Hp=At,qp=Up,Kp=Mp,Wp=_p,Yp=Ip.setImmediate,Jp=Ip.clearImmediate,Qp=Ip.process,Xp=Ip.Dispatch,$p=Ip.Function,Zp=Ip.MessageChannel,ev=Ip.String,tv=0,rv={},nv="onreadystatechange";zp((function(){vp=Ip.location}));var iv=function(e){if(Np(rv,e)){var t=rv[e];delete rv[e],t()}},av=function(e){return function(){iv(e)}},ov=function(e){iv(e.data)},sv=function(e){Ip.postMessage(ev(e),vp.protocol+"//"+vp.host)};Yp&&Jp||(Yp=function(e){qp(arguments.length,1);var t=Fp(e)?e:$p(e),r=Gp(arguments,1);return rv[++tv]=function(){jp(t,void 0,r)},yp(tv),tv},Jp=function(e){delete rv[e]},Wp?yp=function(e){Qp.nextTick(av(e))}:Xp&&Xp.now?yp=function(e){Xp.now(av(e))}:Zp&&!Kp?(mp=(gp=new Zp).port2,gp.port1.onmessage=ov,yp=Bp(mp.postMessage,mp)):Ip.addEventListener&&Fp(Ip.postMessage)&&!Ip.importScripts&&vp&&"file:"!==vp.protocol&&!zp(sv)?(yp=sv,Ip.addEventListener("message",ov,!1)):yp=nv in Hp("script")?function(e){Vp.appendChild(Hp("script"))[nv]=function(){Vp.removeChild(this),iv(e)}}:function(e){setTimeout(av(e),0)});var uv={set:Yp,clear:Jp},cv=function(){this.head=null,this.tail=null};cv.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 lv,fv,hv,dv,pv,vv=cv,yv=/ipad|iphone|ipod/i.test(ce)&&"undefined"!=typeof Pebble,gv=/web0s(?!.*chrome)/i.test(ce),mv=a,_v=Xt,bv=C.f,wv=uv.set,kv=vv,Sv=Mp,xv=yv,Ev=gv,Tv=_p,Av=mv.MutationObserver||mv.WebKitMutationObserver,Lv=mv.document,Cv=mv.process,Ov=mv.Promise,Pv=bv(mv,"queueMicrotask"),Rv=Pv&&Pv.value;if(!Rv){var Dv=new kv,Uv=function(){var e,t;for(Tv&&(e=Cv.domain)&&e.exit();t=Dv.get();)try{t()}catch(Vj){throw Dv.head&&lv(),Vj}e&&e.enter()};Sv||Tv||Ev||!Av||!Lv?!xv&&Ov&&Ov.resolve?((dv=Ov.resolve(void 0)).constructor=Ov,pv=_v(dv.then,dv),lv=function(){pv(Uv)}):Tv?lv=function(){Cv.nextTick(Uv)}:(wv=_v(wv,mv),lv=function(){wv(Uv)}):(fv=!0,hv=Lv.createTextNode(""),new Av(Uv).observe(hv,{characterData:!0}),lv=function(){hv.data=fv=!fv}),Rv=function(e){Dv.head||lv(),Dv.add(e)}}var Mv=Rv,Iv=function(e){try{return{error:!1,value:e()}}catch(Vj){return{error:!0,value:Vj}}},jv=a.Promise,Bv="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Fv=!Bv&&!_p&&"object"==typeof window&&"object"==typeof document,Nv=a,zv=jv,Vv=L,Gv=Wt,Hv=dn,qv=dt,Kv=Fv,Wv=Bv,Yv=ye,Jv=zv&&zv.prototype,Qv=qv("species"),Xv=!1,$v=Vv(Nv.PromiseRejectionEvent),Zv={CONSTRUCTOR:Gv("Promise",(function(){var e=Hv(zv),t=e!==String(zv);if(!t&&66===Yv)return!0;if(!Jv.catch||!Jv.finally)return!0;if(!Yv||Yv<51||!/native code/.test(e)){var r=new zv((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[Qv]=n,!(Xv=r.then((function(){}))instanceof n))return!0}return!t&&(Kv||Wv)&&!$v})),REJECTION_EVENT:$v,SUBCLASSING:Xv},ey={},ty=Re,ry=TypeError,ny=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw ry("Bad Promise constructor");t=e,r=n})),this.resolve=ty(t),this.reject=ty(r)};ey.f=function(e){return new ny(e)};var iy,ay,oy=Cr,sy=_p,uy=a,cy=D,ly=fa,fy=ja,hy=xp,dy=Re,py=L,vy=te,yy=Ap,gy=Rp,my=uv.set,_y=Mv,by=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(Vj){}},wy=Iv,ky=vv,Sy=Za,xy=jv,Ey=Zv,Ty=ey,Ay="Promise",Ly=Ey.CONSTRUCTOR,Cy=Ey.REJECTION_EVENT,Oy=Sy.getterFor(Ay),Py=Sy.set,Ry=xy&&xy.prototype,Dy=xy,Uy=Ry,My=uy.TypeError,Iy=uy.document,jy=uy.process,By=Ty.f,Fy=By,Ny=!!(Iy&&Iy.createEvent&&uy.dispatchEvent),zy="unhandledrejection",Vy=function(e){var t;return!(!vy(e)||!py(t=e.then))&&t},Gy=function(e,t){var r,n,i,a=t.value,o=1==t.state,s=o?e.ok:e.fail,u=e.resolve,c=e.reject,l=e.domain;try{s?(o||(2===t.rejection&&Yy(t),t.rejection=1),!0===s?r=a:(l&&l.enter(),r=s(a),l&&(l.exit(),i=!0)),r===e.promise?c(My("Promise-chain cycle")):(n=Vy(r))?cy(n,r,u,c):u(r)):c(a)}catch(Vj){l&&!i&&l.exit(),c(Vj)}},Hy=function(e,t){e.notified||(e.notified=!0,_y((function(){for(var r,n=e.reactions;r=n.get();)Gy(r,e);e.notified=!1,t&&!e.rejection&&Ky(e)})))},qy=function(e,t,r){var n,i;Ny?((n=Iy.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),uy.dispatchEvent(n)):n={promise:t,reason:r},!Cy&&(i=uy["on"+e])?i(n):e===zy&&by("Unhandled promise rejection",r)},Ky=function(e){cy(my,uy,(function(){var t,r=e.facade,n=e.value;if(Wy(e)&&(t=wy((function(){sy?jy.emit("unhandledRejection",n,r):qy(zy,r,n)})),e.rejection=sy||Wy(e)?2:1,t.error))throw t.value}))},Wy=function(e){return 1!==e.rejection&&!e.parent},Yy=function(e){cy(my,uy,(function(){var t=e.facade;sy?jy.emit("rejectionHandled",t):qy("rejectionhandled",t,e.value)}))},Jy=function(e,t,r){return function(n){e(t,n,r)}},Qy=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Hy(e,!0))},Xy=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw My("Promise can't be resolved itself");var n=Vy(t);n?_y((function(){var r={done:!1};try{cy(n,t,Jy(Xy,r,e),Jy(Qy,r,e))}catch(Vj){Qy(r,Vj,e)}})):(e.value=t,e.state=1,Hy(e,!1))}catch(Vj){Qy({done:!1},Vj,e)}}};Ly&&(Uy=(Dy=function(e){yy(this,Uy),dy(e),cy(iy,this);var t=Oy(this);try{e(Jy(Xy,t),Jy(Qy,t))}catch(Vj){Qy(t,Vj)}}).prototype,(iy=function(e){Py(this,{type:Ay,done:!1,notified:!1,parent:!1,reactions:new ky,rejection:!1,state:0,value:void 0})}).prototype=ly(Uy,"then",(function(e,t){var r=Oy(this),n=By(gy(this,Dy));return r.parent=!0,n.ok=!py(e)||e,n.fail=py(t)&&t,n.domain=sy?jy.domain:void 0,0==r.state?r.reactions.add(n):_y((function(){Gy(n,r)})),n.promise})),ay=function(){var e=new iy,t=Oy(e);this.promise=e,this.resolve=Jy(Xy,t),this.reject=Jy(Qy,t)},Ty.f=By=function(e){return e===Dy||undefined===e?new ay(e):Fy(e)}),oy({global:!0,constructor:!0,wrap:!0,forced:Ly},{Promise:Dy}),fy(Dy,Ay,!1,!0),hy(Ay);var $y=dt("iterator"),Zy=!1;try{var eg=0,tg={next:function(){return{done:!!eg++}},return:function(){Zy=!0}};tg[$y]=function(){return this},Array.from(tg,(function(){throw 2}))}catch(Vj){}var rg=function(e,t){if(!t&&!Zy)return!1;var r=!1;try{var n={};n[$y]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(Vj){}return r},ng=jv,ig=Zv.CONSTRUCTOR||!rg((function(e){ng.all(e).then(void 0,(function(){}))})),ag=D,og=Re,sg=ey,ug=Iv,cg=Qd;Cr({target:"Promise",stat:!0,forced:ig},{all:function(e){var t=this,r=sg.f(t),n=r.resolve,i=r.reject,a=ug((function(){var r=og(t.resolve),a=[],o=0,s=1;cg(e,(function(e){var u=o++,c=!1;s++,ag(r,t,e).then((function(e){c||(c=!0,a[u]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise}});var lg=Cr,fg=Zv.CONSTRUCTOR;jv&&jv.prototype,lg({target:"Promise",proto:!0,forced:fg,real:!0},{catch:function(e){return this.then(void 0,e)}});var hg=D,dg=Re,pg=ey,vg=Iv,yg=Qd;Cr({target:"Promise",stat:!0,forced:ig},{race:function(e){var t=this,r=pg.f(t),n=r.reject,i=vg((function(){var i=dg(t.resolve);yg(e,(function(e){hg(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var gg=D,mg=ey;Cr({target:"Promise",stat:!0,forced:Zv.CONSTRUCTOR},{reject:function(e){var t=mg.f(this);return gg(t.reject,void 0,e),t.promise}});var _g=nr,bg=te,wg=ey,kg=function(e,t){if(_g(e),bg(t)&&t.constructor===e)return t;var r=wg.f(e);return(0,r.resolve)(t),r.promise},Sg=Cr,xg=jv,Eg=Zv.CONSTRUCTOR,Tg=kg,Ag=se("Promise"),Lg=!Eg;Sg({target:"Promise",stat:!0,forced:true},{resolve:function(e){return Tg(Lg&&this===Ag?xg:this,e)}});var Cg=D,Og=Re,Pg=ey,Rg=Iv,Dg=Qd;Cr({target:"Promise",stat:!0,forced:ig},{allSettled:function(e){var t=this,r=Pg.f(t),n=r.resolve,i=r.reject,a=Rg((function(){var r=Og(t.resolve),i=[],a=0,o=1;Dg(e,(function(e){var s=a++,u=!1;o++,Cg(r,t,e).then((function(e){u||(u=!0,i[s]={status:"fulfilled",value:e},--o||n(i))}),(function(e){u||(u=!0,i[s]={status:"rejected",reason:e},--o||n(i))}))})),--o||n(i)}));return a.error&&i(a.value),r.promise}});var Ug=D,Mg=Re,Ig=se,jg=ey,Bg=Iv,Fg=Qd,Ng="No one promise resolved";Cr({target:"Promise",stat:!0,forced:ig},{any:function(e){var t=this,r=Ig("AggregateError"),n=jg.f(t),i=n.resolve,a=n.reject,o=Bg((function(){var n=Mg(t.resolve),o=[],s=0,u=1,c=!1;Fg(e,(function(e){var l=s++,f=!1;u++,Ug(n,t,e).then((function(e){f||c||(c=!0,i(e))}),(function(e){f||c||(f=!0,o[l]=e,--u||a(new r(o,Ng)))}))})),--u||a(new r(o,Ng))}));return o.error&&a(o.value),n.promise}});var zg=Cr,Vg=jv,Gg=o,Hg=se,qg=L,Kg=Rp,Wg=kg,Yg=Vg&&Vg.prototype;zg({target:"Promise",proto:!0,real:!0,forced:!!Vg&&Gg((function(){Yg.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Kg(this,Hg("Promise")),r=qg(e);return this.then(r?function(r){return Wg(t,e()).then((function(){return r}))}:e,r?function(r){return Wg(t,e()).then((function(){throw r}))}:e)}});var Jg=re.Promise,Qg=ey,Xg=Iv;Cr({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Qg.f(this),r=Xg(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var $g=r(Jg),Zg=Cr,em=Br,tm=g([].reverse),rm=[1,2];Zg({target:"Array",proto:!0,forced:String(rm)===String(rm.reverse())},{reverse:function(){return em(this)&&(this.length=this.length),tm(this)}});var nm=af("Array").reverse,im=ue,am=nm,om=Array.prototype,sm=r((function(e){var t=e.reverse;return e===om||im(om,e)&&t===om.reverse?am:t})),um=Cr,cm=Br,lm=An,fm=te,hm=oi,dm=Wr,pm=$,vm=Zr,ym=dt,gm=Rs,mm=Bn("slice"),_m=ym("species"),bm=Array,wm=Math.max;um({target:"Array",proto:!0,forced:!mm},{slice:function(e,t){var r,n,i,a=pm(this),o=dm(a),s=hm(e,o),u=hm(void 0===t?o:t,o);if(cm(a)&&(r=a.constructor,(lm(r)&&(r===bm||cm(r.prototype))||fm(r)&&null===(r=r[_m]))&&(r=void 0),r===bm||void 0===r))return gm(a,s,u);for(n=new(void 0===r?bm:r)(wm(u-s,0)),i=0;s<u;s++,i++)s in a&&vm(n,i,a[s]);return n.length=i,n}});var km=af("Array").slice,Sm=ue,xm=km,Em=Array.prototype,Tm=r((function(e){var t=e.slice;return e===Em||Sm(Em,e)&&t===Em.slice?xm:t})),Am=r(Ll),Lm=r(lf),Cm=r(Zf),Om=r(Pl);function Pm(e,t){var r=ch(e);if(lh){var n=lh(e);t&&(n=yh(n).call(n,(function(t){return gh(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rm(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Ch(r=Pm(Object(i),!0)).call(r,(function(t){Nm(e,t,i[t])})):Nh?Wh(e,Nh(i)):Ch(n=Pm(Object(i))).call(n,(function(t){Yh(e,t,gh(i,t))}))}return e}function Dm(){Dm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Yh||function(e,t,r){e[t]=r.value},i="function"==typeof Jh?Jh:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r){return Yh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(A){u=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var a=t&&t.prototype instanceof h?t:h,o=Qh(a.prototype),s=new x(i||[]);return n(o,"_invoke",{value:b(e,r,s)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(A){return{type:"throw",arg:A}}}e.wrap=c;var f={};function h(){}function d(){}function p(){}var v={};u(v,a,(function(){return this}));var y=Xh&&Xh(Xh(E([])));y&&y!==t&&r.call(y,a)&&(v=y);var g=p.prototype=h.prototype=Qh(v);function m(e){var t;Ch(t=["next","throw","return"]).call(t,(function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(n,a,o,s){var u=l(e[n],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==Ol(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(f).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,s)}))}s(u.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function b(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=w(o,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],Ch(e).call(e,k,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return d.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return $h?$h(e,p):(e.__proto__=p,u(e,s,"GeneratorFunction")),e.prototype=Qh(g),e},e.awrap=function(e){return{__await:e}},m(_.prototype),u(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,a){void 0===a&&(a=$g);var o=new _(c(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},m(g),u(g,s,"Generator"),u(g,a,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return sm(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=E,x.prototype={constructor:x,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,Ch(t=this.tryEntries).call(t,S),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+Tm(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function Um(e){return(Um="function"==typeof Jh&&"symbol"==typeof Am?function(e){return typeof e}:function(e){return e&&"function"==typeof Jh&&e.constructor===Jh&&e!==Jh.prototype?"symbol":typeof e})(e)}function Mm(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(Vj){return void r(Vj)}s.done?t(u):$g.resolve(u).then(n,i)}function Im(e){return function(){var t=this,r=arguments;return new $g((function(n,i){var a=e.apply(t,r);function o(e){Mm(a,n,i,o,s,"next",e)}function s(e){Mm(a,n,i,o,s,"throw",e)}o(void 0)}))}}function jm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bm(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),Yh(e,Km(n.key),n)}}function Fm(e,t,r){return t&&Bm(e.prototype,t),r&&Bm(e,r),Yh(e,"prototype",{writable:!1}),e}function Nm(e,t,r){return(t=Km(t))in e?Yh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Qh(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Yh(e,"prototype",{writable:!1}),t&&Gm(e,t)}function Vm(e){var t;return(Vm=$h?Lm(t=Xh).call(t):function(e){return e.__proto__||Xh(e)})(e)}function Gm(e,t){var r;return(Gm=$h?Lm(r=$h).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function Hm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qm(e){var t=function(){if("undefined"==typeof Reflect||!Cm)return!1;if(Cm.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Cm(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Vm(e);if(t){var i=Vm(this).constructor;r=Cm(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===Ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hm(e)}(this,r)}}function Km(e){var t=function(e,t){if("object"!==Ol(e)||null===e)return e;var r=e[Om];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ol(t)?t:String(t)}var Wm=Cr,Ym=fi.indexOf,Jm=_h,Qm=x([].indexOf),Xm=!!Qm&&1/Qm([1],1,-0)<0;Wm({target:"Array",proto:!0,forced:Xm||!Jm("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Xm?Qm(this,e,t)||0:Ym(this,e,t)}});var $m=af("Array").indexOf,Zm=ue,e_=$m,t_=Array.prototype,r_=r((function(e){var t=e.indexOf;return e===t_||Zm(t_,e)&&t===t_.indexOf?e_:t})),n_=Cr,i_=so.find,a_="find",o_=!0;a_ in[]&&Array(1)[a_]((function(){o_=!1})),n_({target:"Array",proto:!0,forced:o_},{find:function(e){return i_(this,e,arguments.length>1?arguments[1]:void 0)}});var s_=af("Array").find,u_=ue,c_=s_,l_=Array.prototype,f_=r((function(e){var t=e.find;return e===l_||u_(l_,e)&&t===l_.find?c_:t})),h_=O,d_=Br,p_=TypeError,v_=Object.getOwnPropertyDescriptor,y_=h_&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(Vj){return Vj instanceof TypeError}}(),g_=Le,m_=TypeError,__=function(e,t){if(!delete e[t])throw m_("Cannot delete property "+g_(t)+" of "+g_(e))},b_=Cr,w_=Qe,k_=oi,S_=Vr,x_=Wr,E_=y_?function(e,t){if(d_(e)&&!v_(e,"length").writable)throw p_("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},T_=Jr,A_=Un,L_=Zr,C_=__,O_=Bn("splice"),P_=Math.max,R_=Math.min;b_({target:"Array",proto:!0,forced:!O_},{splice:function(e,t){var r,n,i,a,o,s,u=w_(this),c=x_(u),l=k_(e,c),f=arguments.length;for(0===f?r=n=0:1===f?(r=0,n=c-l):(r=f-2,n=R_(P_(S_(t),0),c-l)),T_(c+r-n),i=A_(u,n),a=0;a<n;a++)(o=l+a)in u&&L_(i,a,u[o]);if(i.length=n,r<n){for(a=l;a<c-n;a++)s=a+r,(o=a+n)in u?u[s]=u[o]:C_(u,s);for(a=c;a>c-n+r;a--)C_(u,a-1)}else if(r>n)for(a=c-n;a>l;a--)s=a+r-1,(o=a+n-1)in u?u[s]=u[o]:C_(u,s);for(a=0;a<r;a++)u[a+l]=arguments[a+2];return E_(u,c-n+r),i}});var D_=af("Array").splice,U_=ue,M_=D_,I_=Array.prototype,j_=r((function(e){var t=e.splice;return e===I_||U_(I_,e)&&t===I_.splice?M_:t}));Cr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var B_=r(re.Number.isNaN),F_="\t\n\v\f\r                 \u2028\u2029\ufeff",N_=J,z_=ti,V_=F_,G_=g("".replace),H_=RegExp("^["+V_+"]+"),q_=RegExp("(^|[^"+V_+"])["+V_+"]+$"),K_=function(e){return function(t){var r=z_(N_(t));return 1&e&&(r=G_(r,H_,"")),2&e&&(r=G_(r,q_,"$1")),r}},W_={start:K_(1),end:K_(2),trim:K_(3)},Y_=a,J_=o,Q_=g,X_=ti,$_=W_.trim,Z_=F_,eb=Y_.parseInt,tb=Y_.Symbol,rb=tb&&tb.iterator,nb=/^[+-]?0x/i,ib=Q_(nb.exec),ab=8!==eb(Z_+"08")||22!==eb(Z_+"0x16")||rb&&!J_((function(){eb(Object(rb))}))?function(e,t){var r=$_(X_(e));return eb(r,t>>>0||(ib(nb,r)?16:10))}:eb;Cr({global:!0,forced:parseInt!=ab},{parseInt:ab});var ob=r(re.parseInt),sb=so.map;Cr({target:"Array",proto:!0,forced:!Bn("map")},{map:function(e){return sb(this,e,arguments.length>1?arguments[1]:void 0)}});var ub=af("Array").map,cb=ue,lb=ub,fb=Array.prototype,hb=r((function(e){var t=e.map;return e===fb||cb(fb,e)&&t===fb.map?lb:t}));Cr({target:"Array",stat:!0},{isArray:Br});var db=r(re.Array.isArray),pb=O,vb=g,yb=D,gb=o,mb=ki,_b=ca,bb=U,wb=Qe,kb=q,Sb=Object.assign,xb=Object.defineProperty,Eb=vb([].concat),Tb=!Sb||gb((function(){if(pb&&1!==Sb({b:1},Sb(xb({},"a",{enumerable:!0,get:function(){xb(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=Sb({},e)[r]||mb(Sb({},t)).join("")!=n}))?function(e,t){for(var r=wb(e),n=arguments.length,i=1,a=_b.f,o=bb.f;n>i;)for(var s,u=kb(arguments[i++]),c=a?Eb(mb(u),a(u)):mb(u),l=c.length,f=0;l>f;)s=c[f++],pb&&!yb(o,u,s)||(r[s]=u[s]);return r}:Sb,Ab=Tb;Cr({target:"Object",stat:!0,arity:2,forced:Object.assign!==Ab},{assign:Ab});var Lb=r(re.Object.assign),Cb=r(Gl),Ob=r(Ed),Pb=nr,Rb=Id,Db=Xt,Ub=D,Mb=Qe,Ib=function(e,t,r,n){try{return n?t(Pb(r)[0],r[1]):t(r)}catch(Vj){Rb(e,"throw",Vj)}},jb=_d,Bb=An,Fb=Wr,Nb=Zr,zb=Rd,Vb=Ed,Gb=Array,Hb=function(e){var t=Mb(e),r=Bb(this),n=arguments.length,i=n>1?arguments[1]:void 0,a=void 0!==i;a&&(i=Db(i,n>2?arguments[2]:void 0));var o,s,u,c,l,f,h=Vb(t),d=0;if(!h||this===Gb&&jb(h))for(o=Fb(t),s=r?new this(o):Gb(o);o>d;d++)f=a?i(t[d],d):t[d],Nb(s,d,f);else for(l=(c=zb(t,h)).next,s=r?new this:[];!(u=Ub(l,c)).done;d++)f=a?Ib(c,i,[u.value,d],!0):u.value,Nb(s,d,f);return s.length=d,s},qb=Hb;Cr({target:"Array",stat:!0,forced:!rg((function(e){Array.from(e)}))},{from:qb});var Kb=r(re.Array.from);function Wb(e,t){var r=ch(e);if(lh){var n=lh(e);t&&(n=yh(n).call(n,(function(t){return gh(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yb(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Ch(r=Wb(Object(i),!0)).call(r,(function(t){Zb(e,t,i[t])})):Nh?Wh(e,Nh(i)):Ch(n=Wb(Object(i))).call(n,(function(t){Yh(e,t,gh(i,t))}))}return e}function Jb(e){return(Jb="function"==typeof Jh&&"symbol"==typeof Am?function(e){return typeof e}:function(e){return e&&"function"==typeof Jh&&e.constructor===Jh&&e!==Jh.prototype?"symbol":typeof e})(e)}function Qb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xb(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),Yh(e,rw(n.key),n)}}function $b(e,t,r){return t&&Xb(e.prototype,t),r&&Xb(e,r),Yh(e,"prototype",{writable:!1}),e}function Zb(e,t,r){return(t=rw(t))in e?Yh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ew(e){return function(e){if(db(e))return tw(e)}(e)||function(e){if(void 0!==Jh&&null!=Ob(e)||null!=e["@@iterator"])return Kb(e)}(e)||function(e,t){var r;if(!e)return;if("string"==typeof e)return tw(e,t);var n=Tm(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Kb(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tw(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rw(e){var t=function(e,t){if("object"!==Ol(e)||null===e)return e;var r=e[Om];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ol(t)?t:String(t)}var nw={exports:{}};!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 a(e,t,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,a||e,o),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Qh&&(n.prototype=Qh(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?Tm(n).call(n,1):n);return lh?oh(i).call(i,lh(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,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},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,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){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,a),!0;case 6:return l.fn.call(l.context,t,n,i,a,o),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),f){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,n);break;case 4:l[c].fn.call(l[c].context,t,n,i);break;default:if(!u)for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||o(this,a);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||n&&s[u].context!==n)&&c.push(s[u]);c.length?this._events[a]=1===c.length?c[0]:c:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(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}(nw);var iw=r(nw.exports),aw=so.some;Cr({target:"Array",proto:!0,forced:!_h("some")},{some:function(e){return aw(this,e,arguments.length>1?arguments[1]:void 0)}});var ow=af("Array").some,sw=ue,uw=ow,cw=Array.prototype,lw=r((function(e){var t=e.some;return e===cw||sw(cw,e)&&t===cw.some?uw:t})),fw=Vr,hw=ti,dw=J,pw=RangeError,vw=g,yw=qr,gw=ti,mw=J,_w=vw((function(e){var t=hw(dw(this)),r="",n=fw(e);if(n<0||n==1/0)throw pw("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),bw=vw("".slice),ww=Math.ceil,kw=function(e){return function(t,r,n){var i,a,o=gw(mw(t)),s=yw(r),u=o.length,c=void 0===n?" ":gw(n);return s<=u||""==c?o:((a=_w(c,ww((i=s-u)/c.length))).length>i&&(a=bw(a,0,i)),e?o+a:a+o)}},Sw={start:kw(!1),end:kw(!0)},xw=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(ce),Ew=Sw.start;Cr({target:"String",proto:!0,forced:xw},{padStart:function(e){return Ew(this,e,arguments.length>1?arguments[1]:void 0)}});var Tw,Aw=af("String").padStart,Lw=ue,Cw=Aw,Ow=String.prototype,Pw=r((function(e){var t=e.padStart;return"string"==typeof e||e===Ow||Lw(Ow,e)&&t===Ow.padStart?Cw:t})),Rw="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Dw=a,Uw=h,Mw=L,Iw=Rw,jw=ce,Bw=Rs,Fw=Up,Nw=Dw.Function,zw=/MSIE .\./.test(jw)||Iw&&((Tw=Dw.Bun.version.split(".")).length<3||0==Tw[0]&&(Tw[1]<3||3==Tw[1]&&0==Tw[2])),Vw=function(e,t){var r=t?2:1;return zw?function(n,i){var a=Fw(arguments.length,1)>r,o=Mw(n)?n:Nw(n),s=a?Bw(arguments,r):[],u=a?function(){Uw(o,this,s)}:o;return t?e(u,i):e(u)}:e},Gw=Cr,Hw=a,qw=Vw(Hw.setInterval,!0);Gw({global:!0,bind:!0,forced:Hw.setInterval!==qw},{setInterval:qw});var Kw=Cr,Ww=a,Yw=Vw(Ww.setTimeout,!0);Kw({global:!0,bind:!0,forced:Ww.setTimeout!==Yw},{setTimeout:Yw});var Jw=r(re.setInterval),Qw=r(re.setTimeout),Xw=so.every;Cr({target:"Array",proto:!0,forced:!_h("every")},{every:function(e){return Xw(this,e,arguments.length>1?arguments[1]:void 0)}});var $w=af("Array").every,Zw=ue,ek=$w,tk=Array.prototype,rk=r((function(e){var t=e.every;return e===tk||Zw(tk,e)&&t===tk.every?ek:t})),nk=a,ik=o,ak=ti,ok=W_.trim,sk=F_,uk=g("".charAt),ck=nk.parseFloat,lk=nk.Symbol,fk=lk&&lk.iterator,hk=1/ck(sk+"-0")!=-1/0||fk&&!ik((function(){ck(Object(fk))}))?function(e){var t=ok(ak(e)),r=ck(t);return 0===r&&"-"==uk(t,0)?-0:r}:ck;Cr({global:!0,forced:parseFloat!=hk},{parseFloat:hk});var dk=r(re.parseFloat),pk=xu.PROPER,vk=o,yk=F_,gk=W_.trim;Cr({target:"String",proto:!0,forced:function(e){return vk((function(){return!!yk[e]()||"​…᠎"!=="​…᠎"[e]()||pk&&yk[e].name!==e}))}("trim")},{trim:function(){return gk(this)}});var mk=af("String").trim,_k=ue,bk=mk,wk=String.prototype,kk=r((function(e){var t=e.trim;return"string"==typeof e||e===wk||_k(wk,e)&&t===wk.trim?bk:t})),Sk=na,xk=Math.floor,Ek=function(e,t){var r=e.length,n=xk(r/2);return r<8?Tk(e,t):Ak(e,Ek(Sk(e,0,n),t),Ek(Sk(e,n),t),t)},Tk=function(e,t){for(var r,n,i=e.length,a=1;a<i;){for(n=a,r=e[a];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==a++&&(e[n]=r)}return e},Ak=function(e,t,r,n){for(var i=t.length,a=r.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?n(t[o],r[s])<=0?t[o++]:r[s++]:o<i?t[o++]:r[s++];return e},Lk=Ek,Ck=ce.match(/firefox\/(\d+)/i),Ok=!!Ck&&+Ck[1],Pk=/MSIE|Trident/.test(ce),Rk=ce.match(/AppleWebKit\/(\d+)\./),Dk=!!Rk&&+Rk[1],Uk=Cr,Mk=g,Ik=Re,jk=Qe,Bk=Wr,Fk=__,Nk=ti,zk=o,Vk=Lk,Gk=_h,Hk=Ok,qk=Pk,Kk=ye,Wk=Dk,Yk=[],Jk=Mk(Yk.sort),Qk=Mk(Yk.push),Xk=zk((function(){Yk.sort(void 0)})),$k=zk((function(){Yk.sort(null)})),Zk=Gk("sort"),eS=!zk((function(){if(Kk)return Kk<70;if(!(Hk&&Hk>3)){if(qk)return!0;if(Wk)return Wk<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++)Yk.push({k:t+n,v:r})}for(Yk.sort((function(e,t){return t.v-e.v})),n=0;n<Yk.length;n++)t=Yk[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));Uk({target:"Array",proto:!0,forced:Xk||!$k||!Zk||!eS},{sort:function(e){void 0!==e&&Ik(e);var t=jk(this);if(eS)return void 0===e?Jk(t):Jk(t,e);var r,n,i=[],a=Bk(t);for(n=0;n<a;n++)n in t&&Qk(i,t[n]);for(Vk(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:Nk(t)>Nk(r)?1:-1}}(e)),r=Bk(i),n=0;n<r;)t[n]=i[n++];for(;n<a;)Fk(t,n++);return t}});var tS=af("Array").sort,rS=ue,nS=tS,iS=Array.prototype,aS=r((function(e){var t=e.sort;return e===iS||rS(iS,e)&&t===iS.sort?nS:t})),oS=Cr,sS=Date,uS=g(sS.prototype.getTime);oS({target:"Date",stat:!0},{now:function(){return uS(new sS)}});var cS,lS=r(re.Date.now),fS="undefined"!=typeof window&&window.location&&r_(cS=window.location.href).call(cS,"xgplayerdebugger=1")>-1,hS="color: #525252; background-color: #90ee90;",dS="color: #525252; background-color: red;",pS="color: #525252; background-color: yellow; ",vS="%c[xgplayer]",yS={config:{debug:fS?3:0},logInfo:function(e){for(var t,r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];this.config.debug>=3&&(r=console).log.apply(r,oh(t=[vS,hS,e]).call(t,i))},logWarn:function(e){for(var t,r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];this.config.debug>=1&&(r=console).warn.apply(r,oh(t=[vS,pS,e]).call(t,i))},logError:function(e){var t,r;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];(r=console)[n].apply(r,oh(t=[vS,dS,e]).call(t,a))}}},gS=function(){function e(t){Qb(this,e),this.bufferedList=t}return $b(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),mS={};mS.createDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=document.createElement(t);return a.className=i,a.innerHTML=r,Ch(e=ch(n)).call(e,(function(e){var r=e,i=n[e];"video"===t||"audio"===t||"live-video"===t?i&&a.setAttribute(r,i):a.setAttribute(r,i)})),a},mS.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var i=n.children;if(n=null,i.length>0){var a;if(i=i[0],r&&mS.addClass(i,r),t)Ch(a=ch(t)).call(a,(function(e){i.setAttribute(e,t[e])}));return i}return null}catch(o){return yS.logError("util.createDomFromHtml",o),null}},mS.hasClass=function(e,t){if(!e||!t)return!1;try{return lw(Array.prototype).call(e.classList,(function(e){return e===t}))}catch(n){var r=e.className&&"object"===Jb(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},mS.addClass=function(e,t){if(e&&t)try{var r;Ch(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.add(t)}))}catch(n){mS.hasClass(e,t)||(e.className&&"object"===Jb(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},mS.removeClass=function(e,t){if(e&&t)try{var r;Ch(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.remove(t)}))}catch(i){var n;if(mS.hasClass(e,t))Ch(n=t.split(/\s+/g)).call(n,(function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Jb(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")}))}},mS.toggleClass=function(e,t){var r;e&&Ch(r=t.split(/\s+/g)).call(r,(function(t){mS.hasClass(e,t)?mS.removeClass(e,t):mS.addClass(e,t)}))},mS.classNames=function(){for(var e=arguments,t=[],r=function(r){if("String"===mS.typeOf(e[r]))t.push(e[r]);else if("Object"===mS.typeOf(e[r])){var n;hb(n=ch(e[r])).call(n,(function(n){e[r][n]&&t.push(n)}))}},n=0;n<arguments.length;n++)r(n);return t.join(" ")},mS.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(r)}catch(n){yS.logError("util.findDom",n),0===r_(r).call(r,"#")&&(e=t.getElementById(Tm(r).call(r,1)))}return e},mS.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},mS.padStart=function(e,t,r){for(var n=String(r),i=t>>0,a=Math.ceil(i/n.length),o=[],s=String(e);a--;)o.push(n);return o.join("").substring(0,i-s.length)+s},mS.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Pw(mS).call(mS,Math.floor(e/3600),2,0),r=Pw(mS).call(mS,Math.floor((e-3600*t)/60),2,0),n=Pw(mS).call(mS,Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},mS.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},mS.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},mS.deepCopy=function(e,t){var r;if("Object"===mS.typeOf(t)&&"Object"===mS.typeOf(e))return Ch(r=ch(t)).call(r,(function(r){if("Object"!==mS.typeOf(t[r])||t[r]instanceof Node)if("Array"===mS.typeOf(t[r])){var n;e[r]="Array"===mS.typeOf(e[r])?oh(n=e[r]).call(n,t[r]):t[r]}else e[r]=t[r];else void 0===e[r]||void 0===e[r]?e[r]=t[r]:mS.deepCopy(e[r],t[r])})),e},mS.deepMerge=function(e,t){var r;return hb(r=ch(t)).call(r,(function(r){var n;"Array"===mS.typeOf(t[r])&&"Array"===mS.typeOf(e[r])?"Array"===mS.typeOf(e[r])&&(n=e[r]).push.apply(n,ew(t[r])):mS.typeOf(e[r])!==mS.typeOf(t[r])||null===e[r]||"Object"!==mS.typeOf(e[r])||t[r]instanceof window.Node?null!==t[r]&&(e[r]=t[r]):mS.deepMerge(e[r],t[r])})),e},mS.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},mS.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Ch(Array.prototype).call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},mS.setInterval=function(e,t,r,n){e._interval[t]||(e._interval[t]=Jw(Lm(r).call(r,e),n))},mS.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},mS.setTimeout=function(e,t,r){e._timers||(e._timers=[]);var n=Qw((function(){t(),mS.clearTimeout(e,n)}),r);return e._timers.push(n),n},mS.clearTimeout=function(e,t){var r=e._timers;if("Array"===mS.typeOf(r)){for(var n=0;n<r.length;n++)if(r[n]===t){j_(r).call(r,n,1),clearTimeout(t);break}}else clearTimeout(t)},mS.clearAllTimers=function(e){var t=e._timers;"Array"===mS.typeOf(t)&&(hb(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},mS.createImgBtn=function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,y=mS.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(y.style.backgroundImage='url("'.concat(t,'")'),r&&n)&&(rk(i=["px","rem","em","pt","dp","vw","vh","vm","%"]).call(i,(function(e){var t,i;return!(r_(r).call(r,e)>-1&&r_(n).call(n,e)>-1)||(l=dk(kk(t=Tm(r).call(r,0,r_(r).call(r,e))).call(t)),f=dk(kk(i=Tm(n).call(n,0,r_(n).call(n,e))).call(i)),h=e,!1)})),y.style.width=oh(a="".concat(l)).call(a,h),y.style.height=oh(o="".concat(f)).call(o,h),y.style.backgroundSize=oh(s=oh(u=oh(c="".concat(l)).call(c,h," ")).call(u,f)).call(s,h),y.style.margin="start"===e?oh(d=oh(p=oh(v="-".concat(f/2)).call(v,h," auto auto -")).call(p,l/2)).call(d,h):"auto 5px auto 5px");return y},mS.Hex2RGBA=function(e,t){var r,n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(ob(e,16))})),oh(r="rgba(".concat(n.join(","),", ")).call(r,t,")")):"rgba(255, 255, 255, 0.1)"},mS.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},mS.checkIsFunction=function(e){return e&&"function"==typeof e},mS.checkIsObject=function(e){return null!==e&&"object"===Jb(e)},mS.hide=function(e){e.style.display="none"},mS.show=function(e,t){e.style.display=t||"block"},mS.isUndefined=function(e){if(null==e)return!0},mS.isNotNull=function(e){return!(null==e)},mS.setStyleFromCsstext=function(e,t){if(t)if("String"===mS.typeOf(t)){var r=t.replace(/\s+/g,"").split(";");hb(r).call(r,(function(t){if(t){var r=t.split(":");r.length>1&&(e.style[r[0]]=r[1])}}))}else{var n;hb(n=ch(t)).call(n,(function(r){e.style[r]=t[r]}))}},mS.filterStyleFromText=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),a={},o={};return hb(i).call(i,(function(e){if(e){var t=e.split(":");t.length>1&&(!function(e,t){for(var r=0,n=t.length;r<n;r++)if(r_(e).call(e,t[r])>-1)return!0;return!1}(t[0],r)?o[t[0]]=t[1]:a[t[0]]=t[1])}})),e.setAttribute("style",""),hb(t=ch(o)).call(t,(function(t){e.style[t]=o[t]})),a},mS.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var r=t.replace(/\s+/g,"").split(";"),n={};return hb(r).call(r,(function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},mS.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,r&&r(e)},n.src=e}},mS.stopPropagation=function(e){e&&e.stopPropagation()},mS.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},mS.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},mS.checkTouchSupport=function(){return"ontouchstart"in window},mS.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],n=0;n<e.length;n++)r.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});aS(r).call(r,(function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var i=[];if(t)for(var a=0;a<r.length;a++){var o=i.length;if(o){var s=i[o-1].end;r[a].start-s<t?r[a].end>s&&(i[o-1].end=r[a].end):i.push(r[a])}else i.push(r[a])}else i=r;return new gS(i)},mS.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},mS.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},mS.getHostFromUrl=function(e){if("String"!==mS.typeOf(e))return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r},mS.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},mS.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},mS.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},mS.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=ob(e)}catch(r){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=ob(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},mS.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},mS.adjustTimeByDuration=function(e,t,r){return t&&e&&(e>t||r&&e<t)?t:e},mS.createPositionBar=function(e,t){var r=mS.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(r),r},mS.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(t.scale||1),translate:oh(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")},i=ch(n);return Ch(i).call(i,(function(e){var t,i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),a=oh(t="".concat(e,"(")).call(t,n[e],")");i.test(r)?(i.lastIndex=-1,r=r.replace(i,a)):r+="".concat(a," ")})),r},mS.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},mS.getIndexByTime=function(e,t){var r=t.length,n=-1;if(r<1)return n;if(e<=t[0].end||r<2)n=0;else if(e>t[r-1].end)n=r-1;else for(var i=1;i<r;i++)if(e>t[i-1].end&&e<=t[i].end){n=i;break}return n},mS.getOffsetCurrentTime=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=r>=0&&r<t.length?r:mS.getIndexByTime(e,t))<0)return-1;var i=t.length,a=t[n],o=a.start,s=a.end,u=a.cTime,c=a.offset;return e<o?u:e>=o&&e<=s?e-c:e>s&&n>=i-1?s:-1},mS.getCurrentTimeByOffset=function(e,t){var r=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){r=n;break}if(-1!==r){var i=t[r].start;return r-1<0?i+e:i+(e-t[r-1].duration)}return e};var _S="3.0.21-rc.5",bS={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},wS=$b((function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};Qb(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var i,a=r.mediaError?r.mediaError:t.media.error||{},o=t.duration,s=t.currentTime,u=t.ended,c=t.src,l=t.currentSrc,f=t.media,h=f.readyState,d=f.networkState,p=r.errorCode||a.code;bS[p]&&(p=bS[p]);var v={playerVersion:_S,currentTime:s,duration:o,ended:u,readyState:h,networkState:d,src:c||l,errorType:r.errorType,errorCode:p,message:r.errorMessage||a.message,mediaError:a,originError:r.originError?r.originError.stack:"",host:mS.getHostFromUrl(c||l)};return r.ext&&hb(i=ch(r.ext)).call(i,(function(e){v[e]=r.ext[e]})),v}if(arguments.length>1){for(var y={playerVersion:_S,domain:document.domain},g=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],m=0;m<arguments.length;m++)y[g[m]]=arguments[m];return y.ex=n?(n[arguments[0]]||{}).msg:"",y}}));function kS(e,t,r){for(var n,i=arguments.length,a=new Array(i>3?i-3:0),o=3;o<i;o++)a[o-3]=arguments[o];var s,u=t.call.apply(t,oh(n=[e]).call(n,a));r&&"function"==typeof r&&(u&&u.then?u.then((function(){for(var t,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];r.call.apply(r,oh(t=[e]).call(t,i))})):r.call.apply(r,oh(s=[e]).call(s,a)))}function SS(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),Lm(r=function(){var r,i=arguments,a=this;if(n.pre)try{var o,s;(s=n.pre).call.apply(s,oh(o=[this]).call(o,Tm(Array.prototype).call(arguments)))}catch(v){var u,c;throw v.message=oh(u=oh(c="[pluginName: ".concat(this.pluginName,":")).call(c,e,":pre error] >> ")).call(u,v.message),v}if(this.__hooks&&this.__hooks[e])try{var l,f=function(e,t,r){for(var n=arguments.length,i=new Array(n>3?n-3:0),a=3;a<n;a++)i[a-3]=arguments[a];if(e.__hooks&&db(e.__hooks[t])){var o,s=e.__hooks[t],u=-1,c=function e(t,r,n){for(var i,a,o=arguments.length,c=new Array(o>3?o-3:0),l=3;l<o;l++)c[l-3]=arguments[l];if(u++,0===s.length||u===s.length)return n.call.apply(n,oh(a=[t,t]).call(a,c));var f,h=s[u],d=h.call.apply(h,oh(i=[t,t]).call(i,c));return d&&d.then?d.then((function(i){var a;return!1===i?null:e.apply(void 0,oh(a=[t,r,n]).call(a,c))})).catch((function(e){console.warn("[runHooks]".concat(r," reject"),e.message)})):!1!==d?e.apply(void 0,oh(f=[t,r,n]).call(f,c)):void 0};return c.apply(void 0,oh(o=[e,t,r]).call(o,i))}var l;return r.call.apply(r,oh(l=[e,e]).call(l,i))}(this,e,t);if(f)if(f.then)f.then((function(e){var r;!1!==e&&kS.apply(void 0,oh(r=[a,t,n.next]).call(r,ew(i)))})).catch((function(e){throw e}));else kS.apply(void 0,oh(l=[this,t,n.next]).call(l,Tm(Array.prototype).call(arguments)));else if(void 0===f){var h;kS.apply(void 0,oh(h=[this,t,n.next]).call(h,Tm(Array.prototype).call(arguments)))}}catch(v){var d,p;throw v.message=oh(d=oh(p="[pluginName: ".concat(this.pluginName,":")).call(p,e,"] >> ")).call(d,v.message),v}else kS.apply(void 0,oh(r=[this,t,n.next]).call(r,Tm(Array.prototype).call(arguments)))}).call(r,this)}function xS(e,t){var r=this.__hooks;if(!r||!db(r[e]))return-1;for(var n=r[e],i=0;i<n.length;i++)if(n[i]===t)return i;return-1}function ES(e,t){var r=this.__hooks;if(r)return r.hasOwnProperty(e)?(db(r[e])||(r[e]=[]),-1===xS.call(this,e,t)&&r[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function TS(e,t){var r=this.__hooks;if(r){if(db(r[e])){var n=r[e],i=xS.call(this,e,t);-1!==i&&j_(n).call(n,i,1)}delete r[e]}}function AS(e,t){var r;yS.logError(oh(r="[".concat(e,"] event or callback cant be undefined or null when call ")).call(r,t))}var LS=function(){function e(t){Qb(this,e),mS.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&hb(t).call(t,(function(t){e.__hooks[t]=null})),Yh(e,"hooks",{get:function(){var t;return e.__hooks&&hb(t=ch(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return $b(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=mS.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):db(e)&&Ch(e).call(e,(function(e){r.__events[e]=t,r.player.on(e,t)})):AS(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):db(e)&&Ch(e).call(e,(function(n){r.__onceEvents[n]=t,r.player.once(e,t)})):AS(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):db(e)&&Ch(e).call(e,(function(n){delete r.__events[e],r.player.off(n,t)})):AS(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e,t=this;Ch(e=["__events","__onceEvents"]).call(e,(function(e){var r;Ch(r=ch(t[e])).call(r,(function(r){t[e][r]&&t.off(r,t[e][r]),r&&delete t[e][r]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t,r;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(r=this.player).emit.apply(r,oh(t=[e]).call(t,i))}}},{key:"emitUserAction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=Yb(Yb({},r),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){var r;return SS.call.apply(SS,oh(r=[this]).call(r,Tm(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var r,n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return ES.call.apply(ES,oh(r=[this]).call(r,Tm(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var r,n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return TS.call.apply(TS,oh(r=[this]).call(r,Tm(Array.prototype).call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return r&&(t.pluginName=r),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e,t=this,r=this.player,n=this.pluginName;this.offAll(),mS.clearAllTimers(this),mS.checkIsFunction(this.destroy)&&this.destroy(),hb(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),r.unRegisterPlugin(n),this.__hooks=null}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&Yh(e,r,t[r])}},{key:"defineMethod",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&"function"==typeof t[r]&&Yh(e,r,{configurable:!0,value:t[r]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),CS=Cr,OS=so.findIndex,PS="findIndex",RS=!0;PS in[]&&Array(1)[PS]((function(){RS=!1})),CS({target:"Array",proto:!0,forced:RS},{findIndex:function(e){return OS(this,e,arguments.length>1?arguments[1]:void 0)}});var DS=af("Array").findIndex,US=ue,MS=DS,IS=Array.prototype,jS=r((function(e){var t=e.findIndex;return e===IS||US(IS,e)&&t===IS.findIndex?MS:t})),BS=o,FS=dt("iterator"),NS=!BS((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!e.toJSON||!t.size&&true||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[FS]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),zS=g,VS=2147483647,GS=/[^\0-\u007E]/,HS=/[.\u3002\uFF0E\uFF61]/g,qS="Overflow: input needs wider integers to process",KS=RangeError,WS=zS(HS.exec),YS=Math.floor,JS=String.fromCharCode,QS=zS("".charCodeAt),XS=zS([].join),$S=zS([].push),ZS=zS("".replace),ex=zS("".split),tx=zS("".toLowerCase),rx=function(e){return e+22+75*(e<26)},nx=function(e,t,r){var n=0;for(e=r?YS(e/700):e>>1,e+=YS(e/t);e>455;)e=YS(e/35),n+=36;return YS(n+36*e/(e+38))},ix=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=QS(e,r++);if(i>=55296&&i<=56319&&r<n){var a=QS(e,r++);56320==(64512&a)?$S(t,((1023&i)<<10)+(1023&a)+65536):($S(t,i),r--)}else $S(t,i)}return t}(e);var r,n,i=e.length,a=128,o=0,s=72;for(r=0;r<e.length;r++)(n=e[r])<128&&$S(t,JS(n));var u=t.length,c=u;for(u&&$S(t,"-");c<i;){var l=VS;for(r=0;r<e.length;r++)(n=e[r])>=a&&n<l&&(l=n);var f=c+1;if(l-a>YS((VS-o)/f))throw KS(qS);for(o+=(l-a)*f,a=l,r=0;r<e.length;r++){if((n=e[r])<a&&++o>VS)throw KS(qS);if(n==a){for(var h=o,d=36;;){var p=d<=s?1:d>=s+26?26:d-s;if(h<p)break;var v=h-p,y=36-p;$S(t,JS(rx(p+v%y))),h=YS(v/y),d+=36}$S(t,JS(rx(h))),s=nx(o,f,c==u),o=0,c++}}o++,a++}return XS(t,"")},ax=fa,ox=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:ax(e,n,t[n],r);return e},sx=Cr,ux=a,cx=D,lx=g,fx=O,hx=NS,dx=fa,px=da,vx=ox,yx=ja,gx=Qu,mx=Za,_x=Ap,bx=L,wx=Ze,kx=Xt,Sx=cn,xx=nr,Ex=te,Tx=ti,Ax=Wi,Lx=N,Cx=Rd,Ox=Ed,Px=Up,Rx=Lk,Dx=dt("iterator"),Ux="URLSearchParams",Mx=Ux+"Iterator",Ix=mx.set,jx=mx.getterFor(Ux),Bx=mx.getterFor(Mx),Fx=Object.getOwnPropertyDescriptor,Nx=function(e){if(!fx)return ux[e];var t=Fx(ux,e);return t&&t.value},zx=Nx("fetch"),Vx=Nx("Request"),Gx=Nx("Headers"),Hx=Vx&&Vx.prototype,qx=Gx&&Gx.prototype,Kx=ux.RegExp,Wx=ux.TypeError,Yx=ux.decodeURIComponent,Jx=ux.encodeURIComponent,Qx=lx("".charAt),Xx=lx([].join),$x=lx([].push),Zx=lx("".replace),eE=lx([].shift),tE=lx([].splice),rE=lx("".split),nE=lx("".slice),iE=/\+/g,aE=Array(4),oE=function(e){return aE[e-1]||(aE[e-1]=Kx("((?:%[\\da-f]{2}){"+e+"})","gi"))},sE=function(e){try{return Yx(e)}catch(Vj){return e}},uE=function(e){var t=Zx(e,iE," "),r=4;try{return Yx(t)}catch(Vj){for(;r;)t=Zx(t,oE(r--),sE);return t}},cE=/[!'()~]|%20/g,lE={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fE=function(e){return lE[e]},hE=function(e){return Zx(Jx(e),cE,fE)},dE=gx((function(e,t){Ix(this,{type:Mx,iterator:Cx(jx(e).entries),kind:t})}),"Iterator",(function(){var e=Bx(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),pE=function(e){this.entries=[],this.url=null,void 0!==e&&(Ex(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Qx(e,0)?nE(e,1):e:Tx(e)))};pE.prototype={type:Ux,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,a,o,s,u=Ox(e);if(u)for(r=(t=Cx(e,u)).next;!(n=cx(r,t)).done;){if(a=(i=Cx(xx(n.value))).next,(o=cx(a,i)).done||(s=cx(a,i)).done||!cx(a,i).done)throw Wx("Expected sequence with length 2");$x(this.entries,{key:Tx(o.value),value:Tx(s.value)})}else for(var c in e)wx(e,c)&&$x(this.entries,{key:c,value:Tx(e[c])})},parseQuery:function(e){if(e)for(var t,r,n=rE(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=rE(t,"="),$x(this.entries,{key:uE(eE(r)),value:uE(Xx(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],$x(r,hE(e.key)+"="+hE(e.value));return Xx(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var vE=function(){_x(this,yE);var e=Ix(this,new pE(arguments.length>0?arguments[0]:void 0));fx||(this.length=e.entries.length)},yE=vE.prototype;if(vx(yE,{append:function(e,t){Px(arguments.length,2);var r=jx(this);$x(r.entries,{key:Tx(e),value:Tx(t)}),fx||this.length++,r.updateURL()},delete:function(e){Px(arguments.length,1);for(var t=jx(this),r=t.entries,n=Tx(e),i=0;i<r.length;)r[i].key===n?tE(r,i,1):i++;fx||(this.length=r.length),t.updateURL()},get:function(e){Px(arguments.length,1);for(var t=jx(this).entries,r=Tx(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Px(arguments.length,1);for(var t=jx(this).entries,r=Tx(e),n=[],i=0;i<t.length;i++)t[i].key===r&&$x(n,t[i].value);return n},has:function(e){Px(arguments.length,1);for(var t=jx(this).entries,r=Tx(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Px(arguments.length,1);for(var r,n=jx(this),i=n.entries,a=!1,o=Tx(e),s=Tx(t),u=0;u<i.length;u++)(r=i[u]).key===o&&(a?tE(i,u--,1):(a=!0,r.value=s));a||$x(i,{key:o,value:s}),fx||(this.length=i.length),n.updateURL()},sort:function(){var e=jx(this);Rx(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=jx(this).entries,n=kx(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new dE(this,"keys")},values:function(){return new dE(this,"values")},entries:function(){return new dE(this,"entries")}},{enumerable:!0}),dx(yE,Dx,yE.entries,{name:"entries"}),dx(yE,"toString",(function(){return jx(this).serialize()}),{enumerable:!0}),fx&&px(yE,"size",{get:function(){return jx(this).entries.length},configurable:!0,enumerable:!0}),yx(vE,Ux),sx({global:!0,constructor:!0,forced:!hx},{URLSearchParams:vE}),!hx&&bx(Gx)){var gE=lx(qx.has),mE=lx(qx.set),_E=function(e){if(Ex(e)){var t,r=e.body;if(Sx(r)===Ux)return t=e.headers?new Gx(e.headers):new Gx,gE(t,"content-type")||mE(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Ax(e,{body:Lx(0,Tx(r)),headers:Lx(0,t)})}return e};if(bx(zx)&&sx({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return zx(e,arguments.length>1?_E(arguments[1]):{})}}),bx(Vx)){var bE=function(e){return _x(this,Hx),new Vx(e,arguments.length>1?_E(arguments[1]):{})};Hx.constructor=bE,bE.prototype=Hx,sx({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:bE})}}var wE,kE=Cr,SE=O,xE=NS,EE=a,TE=Xt,AE=g,LE=fa,CE=da,OE=Ap,PE=Ze,RE=Tb,DE=Hb,UE=na,ME=_l.codeAt,IE=function(e){var t,r,n=[],i=ex(ZS(tx(e),HS,"."),".");for(t=0;t<i.length;t++)r=i[t],$S(n,WS(GS,r)?"xn--"+ix(r):r);return XS(n,".")},jE=ti,BE=ja,FE=Up,NE={URLSearchParams:vE,getState:jx},zE=Za,VE=zE.set,GE=zE.getterFor("URL"),HE=NE.URLSearchParams,qE=NE.getState,KE=EE.URL,WE=EE.TypeError,YE=EE.parseInt,JE=Math.floor,QE=Math.pow,XE=AE("".charAt),$E=AE(/./.exec),ZE=AE([].join),eT=AE(1..toString),tT=AE([].pop),rT=AE([].push),nT=AE("".replace),iT=AE([].shift),aT=AE("".split),oT=AE("".slice),sT=AE("".toLowerCase),uT=AE([].unshift),cT="Invalid scheme",lT="Invalid host",fT="Invalid port",hT=/[a-z]/i,dT=/[\d+-.a-z]/i,pT=/\d/,vT=/^0x/i,yT=/^[0-7]+$/,gT=/^\d+$/,mT=/^[\da-f]+$/i,_T=/[\0\t\n\r #%/:<>?@[\\\]^|]/,bT=/[\0\t\n\r #/:<>?@[\\\]^|]/,wT=/^[\u0000-\u0020]+/,kT=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ST=/[\t\n\r]/g,xT=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)uT(t,e%256),e=JE(e/256);return ZE(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,a=0;a<8;a++)0!==e[a]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=eT(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},ET={},TT=RE({},ET,{" ":1,'"':1,"<":1,">":1,"`":1}),AT=RE({},TT,{"#":1,"?":1,"{":1,"}":1}),LT=RE({},AT,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),CT=function(e,t){var r=ME(e,0);return r>32&&r<127&&!PE(t,e)?e:encodeURIComponent(e)},OT={ftp:21,file:null,http:80,https:443,ws:80,wss:443},PT=function(e,t){var r;return 2==e.length&&$E(hT,XE(e,0))&&(":"==(r=XE(e,1))||!t&&"|"==r)},RT=function(e){var t;return e.length>1&&PT(oT(e,0,2))&&(2==e.length||"/"===(t=XE(e,2))||"\\"===t||"?"===t||"#"===t)},DT=function(e){return"."===e||"%2e"===sT(e)},UT={},MT={},IT={},jT={},BT={},FT={},NT={},zT={},VT={},GT={},HT={},qT={},KT={},WT={},YT={},JT={},QT={},XT={},$T={},ZT={},eA={},tA=function(e,t,r){var n,i,a,o=jE(e);if(t){if(i=this.parse(o))throw WE(i);this.searchParams=null}else{if(void 0!==r&&(n=new tA(r,!0)),i=this.parse(o,null,n))throw WE(i);(a=qE(new HE)).bindURL(this),this.searchParams=a}};tA.prototype={type:"URL",parse:function(e,t,r){var n,i,a,o,s,u=this,c=t||UT,l=0,f="",h=!1,d=!1,p=!1;for(e=jE(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=nT(e,wT,""),e=nT(e,kT,"$1")),e=nT(e,ST,""),n=DE(e);l<=n.length;){switch(i=n[l],c){case UT:if(!i||!$E(hT,i)){if(t)return cT;c=IT;continue}f+=sT(i),c=MT;break;case MT:if(i&&($E(dT,i)||"+"==i||"-"==i||"."==i))f+=sT(i);else{if(":"!=i){if(t)return cT;f="",c=IT,l=0;continue}if(t&&(u.isSpecial()!=PE(OT,f)||"file"==f&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=f,t)return void(u.isSpecial()&&OT[u.scheme]==u.port&&(u.port=null));f="","file"==u.scheme?c=WT:u.isSpecial()&&r&&r.scheme==u.scheme?c=jT:u.isSpecial()?c=zT:"/"==n[l+1]?(c=BT,l++):(u.cannotBeABaseURL=!0,rT(u.path,""),c=$T)}break;case IT:if(!r||r.cannotBeABaseURL&&"#"!=i)return cT;if(r.cannotBeABaseURL&&"#"==i){u.scheme=r.scheme,u.path=UE(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,c=eA;break}c="file"==r.scheme?WT:FT;continue;case jT:if("/"!=i||"/"!=n[l+1]){c=FT;continue}c=VT,l++;break;case BT:if("/"==i){c=GT;break}c=XT;continue;case FT:if(u.scheme=r.scheme,i==wE)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=UE(r.path),u.query=r.query;else if("/"==i||"\\"==i&&u.isSpecial())c=NT;else if("?"==i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=UE(r.path),u.query="",c=ZT;else{if("#"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=UE(r.path),u.path.length--,c=XT;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=UE(r.path),u.query=r.query,u.fragment="",c=eA}break;case NT:if(!u.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,c=XT;continue}c=GT}else c=VT;break;case zT:if(c=VT,"/"!=i||"/"!=XE(f,l+1))continue;l++;break;case VT:if("/"!=i&&"\\"!=i){c=GT;continue}break;case GT:if("@"==i){h&&(f="%40"+f),h=!0,a=DE(f);for(var v=0;v<a.length;v++){var y=a[v];if(":"!=y||p){var g=CT(y,LT);p?u.password+=g:u.username+=g}else p=!0}f=""}else if(i==wE||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(h&&""==f)return"Invalid authority";l-=DE(f).length+1,f="",c=HT}else f+=i;break;case HT:case qT:if(t&&"file"==u.scheme){c=JT;continue}if(":"!=i||d){if(i==wE||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(u.isSpecial()&&""==f)return lT;if(t&&""==f&&(u.includesCredentials()||null!==u.port))return;if(o=u.parseHost(f))return o;if(f="",c=QT,t)return;continue}"["==i?d=!0:"]"==i&&(d=!1),f+=i}else{if(""==f)return lT;if(o=u.parseHost(f))return o;if(f="",c=KT,t==qT)return}break;case KT:if(!$E(pT,i)){if(i==wE||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()||t){if(""!=f){var m=YE(f,10);if(m>65535)return fT;u.port=u.isSpecial()&&m===OT[u.scheme]?null:m,f=""}if(t)return;c=QT;continue}return fT}f+=i;break;case WT:if(u.scheme="file","/"==i||"\\"==i)c=YT;else{if(!r||"file"!=r.scheme){c=XT;continue}if(i==wE)u.host=r.host,u.path=UE(r.path),u.query=r.query;else if("?"==i)u.host=r.host,u.path=UE(r.path),u.query="",c=ZT;else{if("#"!=i){RT(ZE(UE(n,l),""))||(u.host=r.host,u.path=UE(r.path),u.shortenPath()),c=XT;continue}u.host=r.host,u.path=UE(r.path),u.query=r.query,u.fragment="",c=eA}}break;case YT:if("/"==i||"\\"==i){c=JT;break}r&&"file"==r.scheme&&!RT(ZE(UE(n,l),""))&&(PT(r.path[0],!0)?rT(u.path,r.path[0]):u.host=r.host),c=XT;continue;case JT:if(i==wE||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&PT(f))c=XT;else if(""==f){if(u.host="",t)return;c=QT}else{if(o=u.parseHost(f))return o;if("localhost"==u.host&&(u.host=""),t)return;f="",c=QT}continue}f+=i;break;case QT:if(u.isSpecial()){if(c=XT,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=wE&&(c=XT,"/"!=i))continue}else u.fragment="",c=eA;else u.query="",c=ZT;break;case XT:if(i==wE||"/"==i||"\\"==i&&u.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=sT(s=f))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(u.shortenPath(),"/"==i||"\\"==i&&u.isSpecial()||rT(u.path,"")):DT(f)?"/"==i||"\\"==i&&u.isSpecial()||rT(u.path,""):("file"==u.scheme&&!u.path.length&&PT(f)&&(u.host&&(u.host=""),f=XE(f,0)+":"),rT(u.path,f)),f="","file"==u.scheme&&(i==wE||"?"==i||"#"==i))for(;u.path.length>1&&""===u.path[0];)iT(u.path);"?"==i?(u.query="",c=ZT):"#"==i&&(u.fragment="",c=eA)}else f+=CT(i,AT);break;case $T:"?"==i?(u.query="",c=ZT):"#"==i?(u.fragment="",c=eA):i!=wE&&(u.path[0]+=CT(i,ET));break;case ZT:t||"#"!=i?i!=wE&&("'"==i&&u.isSpecial()?u.query+="%27":u.query+="#"==i?"%23":CT(i,ET)):(u.fragment="",c=eA);break;case eA:i!=wE&&(u.fragment+=CT(i,TT))}l++}},parseHost:function(e){var t,r,n;if("["==XE(e,0)){if("]"!=XE(e,e.length-1))return lT;if(t=function(e){var t,r,n,i,a,o,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,f=0,h=function(){return XE(e,f)};if(":"==h()){if(":"!=XE(e,1))return;f+=2,l=++c}for(;h();){if(8==c)return;if(":"!=h()){for(t=r=0;r<4&&$E(mT,h());)t=16*t+YE(h(),16),f++,r++;if("."==h()){if(0==r)return;if(f-=r,c>6)return;for(n=0;h();){if(i=null,n>0){if(!("."==h()&&n<4))return;f++}if(!$E(pT,h()))return;for(;$E(pT,h());){if(a=YE(h(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}u[c]=256*u[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;u[c++]=t}else{if(null!==l)return;f++,l=++c}}if(null!==l)for(o=c-l,c=7;0!=c&&o>0;)s=u[c],u[c--]=u[l+o-1],u[l+--o]=s;else if(8!=c)return;return u}(oT(e,1,-1)),!t)return lT;this.host=t}else if(this.isSpecial()){if(e=IE(e),$E(_T,e))return lT;if(t=function(e){var t,r,n,i,a,o,s,u=aT(e,".");if(u.length&&""==u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=u[n]))return e;if(a=10,i.length>1&&"0"==XE(i,0)&&(a=$E(vT,i)?16:8,i=oT(i,8==a?1:2)),""===i)o=0;else{if(!$E(10==a?gT:8==a?yT:mT,i))return e;o=YE(i,a)}rT(r,o)}for(n=0;n<t;n++)if(o=r[n],n==t-1){if(o>=QE(256,5-t))return null}else if(o>255)return null;for(s=tT(r),n=0;n<r.length;n++)s+=r[n]*QE(256,3-n);return s}(e),null===t)return lT;this.host=t}else{if($E(bT,e))return lT;for(t="",r=DE(e),n=0;n<r.length;n++)t+=CT(r[n],ET);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return PE(OT,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&PT(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,a=e.port,o=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=xT(i),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+ZE(o,"/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},setHref:function(e){var t=this.parse(e);if(t)throw WE(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new rA(e.path[0]).origin}catch(Vj){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+xT(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(jE(e)+":",UT)},getUsername:function(){return this.username},setUsername:function(e){var t=DE(jE(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=CT(t[r],LT)}},getPassword:function(){return this.password},setPassword:function(e){var t=DE(jE(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=CT(t[r],LT)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?xT(e):xT(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HT)},getHostname:function(){var e=this.host;return null===e?"":xT(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,qT)},getPort:function(){var e=this.port;return null===e?"":jE(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=jE(e))?this.port=null:this.parse(e,KT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+ZE(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,QT))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=jE(e))?this.query=null:("?"==XE(e,0)&&(e=oT(e,1)),this.query="",this.parse(e,ZT)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=jE(e))?("#"==XE(e,0)&&(e=oT(e,1)),this.fragment="",this.parse(e,eA)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var rA=function(e){var t=OE(this,nA),r=FE(arguments.length,1)>1?arguments[1]:void 0,n=VE(t,new tA(e,!1,r));SE||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},nA=rA.prototype,iA=function(e,t){return{get:function(){return GE(this)[e]()},set:t&&function(e){return GE(this)[t](e)},configurable:!0,enumerable:!0}};if(SE&&(CE(nA,"href",iA("serialize","setHref")),CE(nA,"origin",iA("getOrigin")),CE(nA,"protocol",iA("getProtocol","setProtocol")),CE(nA,"username",iA("getUsername","setUsername")),CE(nA,"password",iA("getPassword","setPassword")),CE(nA,"host",iA("getHost","setHost")),CE(nA,"hostname",iA("getHostname","setHostname")),CE(nA,"port",iA("getPort","setPort")),CE(nA,"pathname",iA("getPathname","setPathname")),CE(nA,"search",iA("getSearch","setSearch")),CE(nA,"searchParams",iA("getSearchParams")),CE(nA,"hash",iA("getHash","setHash"))),LE(nA,"toJSON",(function(){return GE(this).serialize()}),{enumerable:!0}),LE(nA,"toString",(function(){return GE(this).serialize()}),{enumerable:!0}),KE){var aA=KE.createObjectURL,oA=KE.revokeObjectURL;aA&&LE(rA,"createObjectURL",TE(aA,KE)),oA&&LE(rA,"revokeObjectURL",TE(oA,KE))}BE(rA,"URL"),kE({global:!0,constructor:!0,forced:!xE,sham:!SE},{URL:rA});var sA=Cr,uA=o,cA=Up,lA=ti,fA=NS,hA=se("URL");sA({target:"URL",stat:!0,forced:!(fA&&uA((function(){hA.canParse()})))},{canParse:function(e){var t=cA(arguments.length,1),r=lA(e),n=t<2||void 0===arguments[1]?void 0:lA(arguments[1]);try{return!!new hA(r,n)}catch(Vj){return!1}}});var dA=r(re.URL),pA=re,vA=h;pA.JSON||(pA.JSON={stringify:JSON.stringify});var yA=function(e,t,r){return vA(pA.JSON.stringify,null,arguments)},gA=r(yA),mA=te,_A=w,bA=dt("match"),wA=function(e){var t;return mA(e)&&(void 0!==(t=e[bA])?!!t:"RegExp"==_A(e))},kA=TypeError,SA=dt("match"),xA=fi.includes;Cr({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(e){return xA(this,e,arguments.length>1?arguments[1]:void 0)}});var EA=af("Array").includes,TA=Cr,AA=function(e){if(wA(e))throw kA("The method doesn't accept regular expressions");return e},LA=J,CA=ti,OA=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[SA]=!1,"/./"[e](t)}catch(n){}}return!1},PA=g("".indexOf);TA({target:"String",proto:!0,forced:!OA("includes")},{includes:function(e){return!!~PA(CA(LA(this)),CA(AA(e)),arguments.length>1?arguments[1]:void 0)}});var RA=af("String").includes,DA=ue,UA=EA,MA=RA,IA=Array.prototype,jA=String.prototype,BA=r((function(e){var t=e.includes;return e===IA||DA(IA,e)&&t===IA.includes?UA:"string"==typeof e||e===jA||DA(jA,e)&&t===jA.includes?MA:t})),FA={exports:{}},NA=o((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),zA=o,VA=te,GA=w,HA=NA,qA=Object.isExtensible,KA=zA((function(){qA(1)}))||HA?function(e){return!!VA(e)&&((!HA||"ArrayBuffer"!=GA(e))&&(!qA||qA(e)))}:qA,WA=!o((function(){return Object.isExtensible(Object.preventExtensions({}))})),YA=Cr,JA=g,QA=hi,XA=te,$A=Ze,ZA=$t.f,eL=Yi,tL=Xi,rL=KA,nL=WA,iL=!1,aL=it("meta"),oL=0,sL=function(e){ZA(e,aL,{value:{objectID:"O"+oL++,weakData:{}}})},uL=FA.exports={enable:function(){uL.enable=function(){},iL=!0;var e=eL.f,t=JA([].splice),r={};r[aL]=1,e(r).length&&(eL.f=function(r){for(var n=e(r),i=0,a=n.length;i<a;i++)if(n[i]===aL){t(n,i,1);break}return n},YA({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:tL.f}))},fastKey:function(e,t){if(!XA(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!$A(e,aL)){if(!rL(e))return"F";if(!t)return"E";sL(e)}return e[aL].objectID},getWeakData:function(e,t){if(!$A(e,aL)){if(!rL(e))return!0;if(!t)return!1;sL(e)}return e[aL].weakData},onFreeze:function(e){return nL&&iL&&rL(e)&&!$A(e,aL)&&sL(e),e}};QA[aL]=!0;var cL=FA.exports,lL=Cr,fL=a,hL=cL,dL=o,pL=gr,vL=Qd,yL=Ap,gL=L,mL=te,_L=ja,bL=$t.f,wL=so.forEach,kL=O,SL=Za.set,xL=Za.getterFor,EL=function(e,t,r){var n,i=-1!==e.indexOf("Map"),a=-1!==e.indexOf("Weak"),o=i?"set":"add",s=fL[e],u=s&&s.prototype,c={};if(kL&&gL(s)&&(a||u.forEach&&!dL((function(){(new s).entries().next()})))){var l=(n=t((function(t,r){SL(yL(t,l),{type:e,collection:new s}),null!=r&&vL(r,t[o],{that:t,AS_ENTRIES:i})}))).prototype,f=xL(e);wL(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in u)||a&&"clear"==e||pL(l,e,(function(r,n){var i=f(this).collection;if(!t&&a&&!mL(r))return"get"==e&&void 0;var o=i[e](0===r?0:r,n);return t?this:o}))})),a||bL(l,"size",{configurable:!0,get:function(){return f(this).collection.size}})}else n=r.getConstructor(t,e,i,o),hL.enable();return _L(n,e,!1,!0),c[e]=n,lL({global:!0,forced:!0},c),a||r.setStrong(n,e,i),n},TL=Wi,AL=da,LL=ox,CL=Xt,OL=Ap,PL=K,RL=Qd,DL=kc,UL=Sc,ML=xp,IL=O,jL=cL.fastKey,BL=Za.set,FL=Za.getterFor,NL={getConstructor:function(e,t,r,n){var i=e((function(e,i){OL(e,a),BL(e,{type:t,index:TL(null),first:void 0,last:void 0,size:0}),IL||(e.size=0),PL(i)||RL(i,e[n],{that:e,AS_ENTRIES:r})})),a=i.prototype,o=FL(t),s=function(e,t,r){var n,i,a=o(e),s=u(e,t);return s?s.value=r:(a.last=s={index:i=jL(t,!0),key:t,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=s),n&&(n.next=s),IL?a.size++:e.size++,"F"!==i&&(a.index[i]=s)),e},u=function(e,t){var r,n=o(e),i=jL(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return LL(a,{clear:function(){for(var e=o(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,IL?e.size=0:this.size=0},delete:function(e){var t=this,r=o(t),n=u(t,e);if(n){var i=n.next,a=n.previous;delete r.index[n.index],n.removed=!0,a&&(a.next=i),i&&(i.previous=a),r.first==n&&(r.first=i),r.last==n&&(r.last=a),IL?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=o(this),n=CL(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!!u(this,e)}}),LL(a,r?{get:function(e){var t=u(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)}}),IL&&AL(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=FL(t),a=FL(n);DL(e,t,(function(e,t){BL(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(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)?UL("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,UL(void 0,!0))}),r?"entries":"values",!r,!0),ML(t)}};EL("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),NL);var zL=re.Map,VL=Xt,GL=D,HL=Re,qL=Bf,KL=K,WL=Qd,YL=[].push,JL=function(e){var t,r,n,i,a=arguments.length,o=a>1?arguments[1]:void 0;return qL(this),(t=void 0!==o)&&HL(o),KL(e)?new this:(r=[],t?(n=0,i=VL(o,a>2?arguments[2]:void 0),WL(e,(function(e){GL(YL,r,i(e,n++))}))):WL(e,YL,{that:r}),new this(r))};Cr({target:"Map",stat:!0,forced:!0},{from:JL});var QL=Rs,XL=function(){return new this(QL(arguments))};Cr({target:"Map",stat:!0,forced:!0},{of:XL});var $L=Le,ZL=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 TypeError($L(e)+" is not a map")},eC=function(e,t){return 1==t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},tC=eC,rC=se("Map"),nC={Map:rC,set:tC("set",2),get:tC("get",1),has:tC("has",1),remove:tC("delete",1),proto:rC.prototype},iC=ZL,aC=nC.remove;Cr({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=iC(this),r=!0,n=0,i=arguments.length;n<i;n++)e=aC(t,arguments[n]),r=r&&e;return!!r}});var oC=ZL,sC=nC.get,uC=nC.has,cC=nC.set;Cr({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,i=oC(this);return uC(i,e)?(r=sC(i,e),"update"in t&&(r=t.update(r,e,i),cC(i,e,r)),r):(n=t.insert(e,i),cC(i,e,n),n)}});var lC=D,fC=function(e,t,r){for(var n,i,a=r||e.next;!(n=lC(a,e)).done;)if(void 0!==(i=t(n.value)))return i},hC=fC,dC=function(e,t,r){return r?hC(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},pC=Xt,vC=ZL,yC=dC;Cr({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=vC(this),r=pC(e,arguments.length>1?arguments[1]:void 0);return!1!==yC(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var gC=Xt,mC=ZL,_C=dC,bC=nC.Map,wC=nC.set;Cr({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=mC(this),r=gC(e,arguments.length>1?arguments[1]:void 0),n=new bC;return _C(t,(function(e,i){r(e,i,t)&&wC(n,i,e)})),n}});var kC=Xt,SC=ZL,xC=dC;Cr({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=SC(this),r=kC(e,arguments.length>1?arguments[1]:void 0),n=xC(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var EC=Xt,TC=ZL,AC=dC;Cr({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=TC(this),r=EC(e,arguments.length>1?arguments[1]:void 0),n=AC(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var LC=Cr,CC=D,OC=L,PC=Re,RC=Qd,DC=nC.Map,UC=g([].push);LC({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var r=new(OC(this)?this:DC);PC(t);var n=PC(r.has),i=PC(r.get),a=PC(r.set);return RC(e,(function(e){var o=t(e);CC(n,r,o)?UC(CC(i,r,o),e):CC(a,r,o,[e])})),r}});var MC=function(e,t){return e===t||e!=e&&t!=t},IC=ZL,jC=dC;Cr({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===jC(IC(this),(function(t){if(MC(t,e))return!0}),!0)}});var BC=D,FC=Qd,NC=L,zC=Re,VC=nC.Map;Cr({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(NC(this)?this:VC);zC(t);var n=zC(r.set);return FC(e,(function(e){BC(n,r,t(e),e)})),r}});var GC=ZL,HC=dC;Cr({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=HC(GC(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var qC=Xt,KC=ZL,WC=dC,YC=nC.Map,JC=nC.set;Cr({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=KC(this),r=qC(e,arguments.length>1?arguments[1]:void 0),n=new YC;return WC(t,(function(e,i){JC(n,r(e,i,t),e)})),n}});var QC=Xt,XC=ZL,$C=dC,ZC=nC.Map,eO=nC.set;Cr({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=XC(this),r=QC(e,arguments.length>1?arguments[1]:void 0),n=new ZC;return $C(t,(function(e,i){eO(n,i,r(e,i,t))})),n}});var tO=ZL,rO=Qd,nO=nC.set;Cr({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=tO(this),r=arguments.length,n=0;n<r;)rO(arguments[n++],(function(e,r){nO(t,e,r)}),{AS_ENTRIES:!0});return t}});var iO=Re,aO=ZL,oO=dC,sO=TypeError;Cr({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aO(this),r=arguments.length<2,n=r?void 0:arguments[1];if(iO(e),oO(t,(function(i,a){r?(r=!1,n=i):n=e(n,i,a,t)})),r)throw sO("Reduce of empty map with no initial value");return n}});var uO=Xt,cO=ZL,lO=dC;Cr({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=cO(this),r=uO(e,arguments.length>1?arguments[1]:void 0);return!0===lO(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var fO=Re,hO=ZL,dO=TypeError,pO=nC.get,vO=nC.has,yO=nC.set;Cr({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=hO(this),n=arguments.length;fO(t);var i=vO(r,e);if(!i&&n<3)throw dO("Updating absent value");var a=i?pO(r,e):fO(n>2?arguments[2]:void 0)(e,r);return yO(r,e,t(a,e,r)),r}});var gO=D,mO=Re,_O=L,bO=nr,wO=TypeError,kO=function(e,t){var r,n=bO(this),i=mO(n.get),a=mO(n.has),o=mO(n.set),s=arguments.length>2?arguments[2]:void 0;if(!_O(t)&&!_O(s))throw wO("At least one callback required");return gO(a,n,e)?(r=gO(i,n,e),_O(t)&&(r=t(r),gO(o,n,e,r))):_O(s)&&(r=s(),gO(o,n,e,r)),r};Cr({target:"Map",proto:!0,real:!0,forced:!0},{upsert:kO}),Cr({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:kO});var SO=r(zL);function xO(e,t){var r=ch(e);if(lh){var n=lh(e);t&&(n=yh(n).call(n,(function(t){return gh(e,t).enumerable}))),r.push.apply(r,n)}return r}function EO(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Ch(r=xO(Object(i),!0)).call(r,(function(t){DO(e,t,i[t])})):Nh?Wh(e,Nh(i)):Ch(n=xO(Object(i))).call(n,(function(t){Yh(e,t,gh(i,t))}))}return e}function TO(){TO=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Yh||function(e,t,r){e[t]=r.value},i="function"==typeof Jh?Jh:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r){return Yh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(A){u=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var a=t&&t.prototype instanceof h?t:h,o=Qh(a.prototype),s=new x(i||[]);return n(o,"_invoke",{value:b(e,r,s)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(A){return{type:"throw",arg:A}}}e.wrap=c;var f={};function h(){}function d(){}function p(){}var v={};u(v,a,(function(){return this}));var y=Xh&&Xh(Xh(E([])));y&&y!==t&&r.call(y,a)&&(v=y);var g=p.prototype=h.prototype=Qh(v);function m(e){var t;Ch(t=["next","throw","return"]).call(t,(function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(n,a,o,s){var u=l(e[n],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==Ol(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(f).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,s)}))}s(u.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function b(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=w(o,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],Ch(e).call(e,k,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return d.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return $h?$h(e,p):(e.__proto__=p,u(e,s,"GeneratorFunction")),e.prototype=Qh(g),e},e.awrap=function(e){return{__await:e}},m(_.prototype),u(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,a){void 0===a&&(a=$g);var o=new _(c(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},m(g),u(g,s,"Generator"),u(g,a,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return sm(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=E,x.prototype={constructor:x,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,Ch(t=this.tryEntries).call(t,S),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+Tm(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function AO(e){return(AO="function"==typeof Jh&&"symbol"==typeof Am?function(e){return typeof e}:function(e){return e&&"function"==typeof Jh&&e.constructor===Jh&&e!==Jh.prototype?"symbol":typeof e})(e)}function LO(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(Vj){return void r(Vj)}s.done?t(u):$g.resolve(u).then(n,i)}function CO(e){return function(){var t=this,r=arguments;return new $g((function(n,i){var a=e.apply(t,r);function o(e){LO(a,n,i,o,s,"next",e)}function s(e){LO(a,n,i,o,s,"throw",e)}o(void 0)}))}}function OO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PO(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),Yh(e,KO(n.key),n)}}function RO(e,t,r){return t&&PO(e.prototype,t),r&&PO(e,r),Yh(e,"prototype",{writable:!1}),e}function DO(e,t,r){return(t=KO(t))in e?Yh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Qh(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Yh(e,"prototype",{writable:!1}),t&&IO(e,t)}function MO(e){var t;return(MO=$h?Lm(t=Xh).call(t):function(e){return e.__proto__||Xh(e)})(e)}function IO(e,t){var r;return(IO=$h?Lm(r=$h).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function jO(){if("undefined"==typeof Reflect||!Cm)return!1;if(Cm.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Cm(Boolean,[],(function(){}))),!0}catch(e){return!1}}function BO(e,t,r){var n;jO()?BO=Lm(n=Cm).call(n):BO=function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Lm(Function).apply(e,n));return r&&IO(i,r.prototype),i};return BO.apply(null,arguments)}function FO(e){var t="function"==typeof SO?new SO:void 0;return FO=function(e){if(null===e||(r=e,-1===r_(n=Function.toString.call(r)).call(n,"[native code]")))return e;var r,n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return BO(e,arguments,MO(this).constructor)}return i.prototype=Qh(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),IO(i,e)},FO(e)}function NO(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=ch(e);for(n=0;n<a.length;n++)r=a[n],r_(t).call(t,r)>=0||(i[r]=e[r]);return i}(e,t);if(lh){var a=lh(e);for(n=0;n<a.length;n++)r=a[n],r_(t).call(t,r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function zO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VO(e){var t=jO();return function(){var r,n=MO(e);if(t){var i=MO(this).constructor;r=Cm(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===Ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zO(e)}(this,r)}}function GO(){var e;"undefined"!=typeof Reflect&&Cb?GO=Lm(e=Cb).call(e):GO=function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=MO(e)););return e}(e,t);if(n){var i=gh(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}};return GO.apply(this,arguments)}function HO(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qO(e,t){var r=void 0!==Jh&&Ob(e)||e["@@iterator"];if(!r){if(db(e)||(r=function(e,t){var r;if(e){if("string"==typeof e)return HO(e,t);var n=Tm(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Kb(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HO(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function KO(e){var t=function(e,t){if("object"!==Ol(e)||null===e)return e;var r=e[Om];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ol(t)?t:String(t)}var WO=Re,YO=Qe,JO=q,QO=Wr,XO=TypeError,$O=function(e){return function(t,r,n,i){WO(r);var a=YO(t),o=JO(a),s=QO(a),u=e?s-1:0,c=e?-1:1;if(n<2)for(;;){if(u in o){i=o[u],u+=c;break}if(u+=c,e?u<0:s<=u)throw XO("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=c)u in o&&(i=r(i,o[u],u,a));return i}},ZO={left:$O(!1),right:$O(!0)}.left;Cr({target:"Array",proto:!0,forced:!_p&&ye>79&&ye<83||!_h("reduce")},{reduce:function(e){var t=arguments.length;return ZO(this,e,t,t>1?arguments[1]:void 0)}});var eP,tP=af("Array").reduce,rP=ue,nP=tP,iP=Array.prototype,aP=r((function(e){var t=e.reduce;return e===iP||rP(iP,e)&&t===iP.reduce?nP:t})),oP=function(){function e(){OO(this,e)}return RO(e,null,[{key:"start",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6||1===e.length&&e.start(0)<0?0:e.start(0):0}},{key:"end",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6?0:e.end(e.length-1):0}},{key:"get",value:function(e){if(e)try{return e.buffered}catch(Vj){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,i=e.length;n<i;n++){var a=r.length;if(a&&t){var o=r[a-1],s=o[1];if(e.start(n)-s<=t){var u=e.end(n);u>s&&(o[1]=u)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"totalLength",value:function(e){return e&&e.length?aP(e).call(e,(function(e,t){return e+(t[1]-t[0])}),0):0}},{key:"info",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t.length)return{start:0,end:0,buffers:[]};for(var i=0,a=0,o=0,s=0,u=0,c=0,l=0,f=e.buffers(t,n),h=0,d=f.length;h<d;h++){var p=f[h];if(r+n>=p[0]&&r<=p[1])i=p[0],a=p[1],o=h;else{if(r+n<p[0]){s=p[0],u=p[1];break}r+n>p[1]&&(c=p[0],l=p[1])}}return{start:i,end:a,index:o,buffers:f,nextStart:s,nextEnd:u,prevStart:c,prevEnd:l,currentTime:r,behind:r-i,remaining:a?a-r:0,length:e.totalLength&&e.totalLength(f)}}},{key:"isBuffered",value:function(t,r){if(t){var n=e.get(t);if(null!=n&&n.length)for(var i=0;i<n.length;i++)if(r>=n.start(i)&&r<=n.end(i))return!0}return!1}}]),e}(),sP="undefined"!=typeof window,uP="network",cP="network_timeout",lP="network_forbidden",fP="network_notfound",hP="network_range_not_satisfiable",dP="demux",pP="remux",vP="media",yP="drm",gP="other",mP="runtime",_P={FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",MSE_FULL:"MSE_FULL",MSE_CHANGE_TYPE:"MSE_CHANGE_TYPE",OPTION:"OPTION",DASH:"DASH",LICENSE:"LICENSE",CUSTOM_LICENSE:"CUSTOM_LICENSE",MSE_HIJACK:"MSE_HIJACK",EME_HIJACK:"EME_HIJACK",SIDX:"SIDX",NO_CANPLAY_ERROR:"NO_CANPLAY_ERROR",BUFFERBREAK_ERROR:"BUFFERBREAK_ERROR",WAITING_TIMEOUT_ERROR:"WAITING_TIMEOUT_ERROR",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_CODEC_NOT_SUPPORTED:"MEDIA_ERR_CODEC_NOT_SUPPORTED",MEDIA_ERR_URL_EMPTY:"MEDIA_ERR_URL_EMPTY"},bP=(DO(eP={},"manifest",{HLS:1100,DASH:1200}),DO(eP,uP,2100),DO(eP,cP,2101),DO(eP,lP,2103),DO(eP,fP,2104),DO(eP,hP,2116),DO(eP,dP,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),DO(eP,pP,{FMP4:4100,MP4:4200}),DO(eP,vP,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,MSE_CHANGE_TYPE:5205,EME_HIJACK:5301}),DO(eP,yP,{LICENSE:7100,CUSTOM_LICENSE:7200}),DO(eP,gP,8e3),DO(eP,mP,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),eP),wP=function(e){UO(r,e);var t=VO(r);function r(e,n,i,a,o){var s;return OO(this,r),(s=t.call(this,o||(null==i?void 0:i.message))).errorType=e===cP?uP:e,s.originError=i,s.ext=a,s.errorCode=bP[e][n]||bP[e],s.errorMessage=s.message,s.errorCode||(s.errorType=gP,s.errorCode=bP[s.errorType]),s}return RO(r,null,[{key:"create",value:function(e,t,n,i,a){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=gP),new r(e,t,n,i,a))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?cP:uP,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),r}(FO(Error)),kP=1,SP=2,xP=3,EP=4,TP=["Boolean","Number","String","Undefined","Null","Date","Object"],AP=function(){function e(t,r){OO(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return RO(e,[{key:"debug",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,oh(t=[kP]).call(t,a)),e.disabled||(n=console).debug.apply(n,oh(r=["[".concat(LP(),"]"),this._prefix]).call(r,a))}},{key:"log",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,oh(t=[SP]).call(t,a)),e.disabled||(n=console).log.apply(n,oh(r=["[".concat(LP(),"]"),this._prefix]).call(r,a))}},{key:"warn",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,oh(t=[xP]).call(t,a)),e.disabled||(n=console).warn.apply(n,oh(r=["[".concat(LP(),"]"),this._prefix]).call(r,a))}},{key:"error",value:function(){for(var t,r,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];this.logCache.apply(this,oh(t=[EP]).call(t,a)),e.disabled||(n=console).error.apply(n,oh(r=["[".concat(LP(),"]"),this._prefix]).call(r,a))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var a=hb(n).call(n,(function(e){return OP(e)}));t="[".concat(LP(),"]")+this._prefix+gA(a)}catch(s){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var o=this.logTextArray.shift();this.logSize-=o.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function LP(){return(new Date).toLocaleString()}function CP(e){var t;if("object"!==AO(e))return e;var r=Tm(t=Object.prototype.toString.call(e)).call(t,8,-1);switch(r){case"Array":case"Uint8Array":case"ArrayBuffer":return r+"["+e.length+"]";case"Object":return"{}";default:return r}}function OP(e,t,r){var n;r||(r=1),t||(t=2);var i={};if(!e||"object"!==AO(e))return e;var a=Tm(n=Object.prototype.toString.call(e)).call(n,8,-1);if(!BA(TP).call(TP,a))return a;if(!(r>t)){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r===t?i[o]=CP(e[o]):"object"===AO(e[o])?i[o]=OP(e[o],t,r+1):i[o]=e[o]);return i}}function PP(){var e,t,r=new $g((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}function RP(){try{return ob(performance.now(),10)}catch(e){return(new Date).getTime()}}DO(AP,"disabled",!0);var DP=function(e){try{return gA(e)}catch(t){return""}};function UP(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{return sP?e&&"undefined"!=typeof ManagedMediaSource?ManagedMediaSource:window.MediaSource:null}catch(t){}}function MP(e){return/ManagedMediaSource/gi.test(Object.prototype.toString.call(e))}var IP="appendBuffer",jP="removeBuffer",BP="updateDuration",FP=function(){function e(t,r){var n=this;OO(this,e),DO(this,"media",null),DO(this,"mediaSource",null),DO(this,"_openPromise",PP()),DO(this,"_queue",Qh(null)),DO(this,"_sourceBuffer",Qh(null)),DO(this,"_mseFullFlag",{}),DO(this,"_st",0),DO(this,"_opst",0),DO(this,"_logger",null),DO(this,"_config",null),DO(this,"_url",null),DO(this,"_onStartStreaming",(function(){n._logger.debug("startstreaming")})),DO(this,"_onEndStreaming",(function(){n._logger.debug("endstreaming")})),DO(this,"_onSBUpdateEnd",(function(e){var t=n._queue[e];if(t){var r=t[0];if((null==r?void 0:r.opName)!==BP&&t.shift(),r){var i,a,o,s=RP()-n._opst;n._logger.debug(oh(i="UpdateEnd(".concat(e,"/")).call(i,r.opName,")"),DP(function(e){var t=[];if(e instanceof TimeRanges)for(var r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}(null===(a=n._sourceBuffer[e])||void 0===a?void 0:a.buffered)),s,r.context),r.promise.resolve({name:r.opName,context:r.context,costtime:s});var u=null===(o=r.context)||void 0===o?void 0:o.callback;u&&"function"==typeof u&&u(r.context),n._startQueue(e)}}})),DO(this,"_onSBUpdateError",(function(e,t){var r=n._queue[e];if(r){var i=r[0];i&&(n._logger.error("UpdateError",e,i.opName,i.context),i.promise.reject(new wP(vP,_P.MSE_APPEND_BUFFER,t)))}})),this._config=Lb(e.getDefaultConfig(),r),t&&this.bindMedia(t),this._logger=new AP("MSE"),this._config.openLog&&AP.enable()}var t,r,n;return RO(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"hasOpTasks",get:function(){var e,t=this,r=!1;return Ch(e=ch(this._queue)).call(e,(function(e){var n=t._queue[e];db(n)&&(r||(r=n.length>0))})),r}},{key:"url",get:function(){return this._url}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"isEnded",get:function(){return!!this.mediaSource&&"ended"===this.mediaSource.readyState}},{key:"streaming",get:function(){return!MP(this.mediaSource)||this.mediaSource.streaming}},{key:"isFull",value:function(t){return t?this._mseFullFlag[t]:this._mseFullFlag[e.VIDEO]}},{key:"updateDuration",value:function(e){var t=this,r=this.mediaSource&&this.mediaSource.duration>e;if(this.mediaSource&&this.mediaSource.duration>e){var n,i=0;if(Ch(n=ch(this._sourceBuffer)).call(n,(function(e){try{i=Math.max(t.bufferEnd(e)||0,i)}catch(Vj){}})),e<i)return $g.resolve()}return this._enqueueBlockingOp((function(){t.isEnded?t._logger.debug("setDuration but ended"):t.mediaSource&&(t.mediaSource.duration=e,t._logger.debug("setDuration",e))}),BP,{isReduceDuration:r})}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){var n=RP()-e._st;e._logger.debug("sourceopen",n),t.removeEventListener("sourceopen",r),e._openPromise.resolve({costtime:n})})),this._openPromise=PP()}return this._openPromise}},{key:"bindMedia",value:(n=CO(TO().mark((function e(t){var r,n,i,a,o=this;return TO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mediaSource&&!this.media){e.next=3;break}return e.next=3,this.unbindMedia();case 3:if(r=UP(this._config.preferMMS),t&&r){e.next=6;break}throw new Error("Param media or MediaSource does not exist");case 6:return this.media=t,n=this.mediaSource=new r,i=MP(n),this._st=RP(),a=function e(){var r=RP()-o._st;o._logger.debug("sourceopen"),n.removeEventListener("sourceopen",e),dA.revokeObjectURL(t.src),o._openPromise.resolve({costtime:r})},n.addEventListener("sourceopen",a),i&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming)),this._url=dA.createObjectURL(n),t.src=this._url,t.disableRemotePlayback=i,e.abrupt("return",this._openPromise);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unbindMedia",value:(r=CO(TO().mark((function e(){var t,r,n,i=this;return TO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){var a,o;if(Ch(a=ch(this._queue)).call(a,(function(e){var t=i._queue[e];t&&Ch(t).call(t,(function(e){var t,r;return null===(t=e.promise)||void 0===t||null===(r=t.resolve)||void 0===r?void 0:r.call(t)}))})),r=!!this.media&&this.media.readyState>=1,n="open"===t.readyState,r&&n)try{t.endOfStream()}catch(Vj){}Ch(o=ch(this._sourceBuffer)).call(o,(function(e){try{t.removeSourceBuffer(i._sourceBuffer[e])}catch(Vj){}})),MP(t)&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming))}if(this.media){this.media.disableRemotePlayback=!1,this.media.removeAttribute("src");try{this.media.load()}catch(Vj){}this.media=null}this.mediaSource=null,this._openPromise=PP(),this._queue=Qh(null),this._sourceBuffer=Qh(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){var r,n;if(!this._sourceBuffer[e]&&this.mediaSource){var i;try{i=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(Vj){throw new wP(vP,_P.MSE_ADD_SB,Vj)}i.mimeType=t,i.addEventListener("updateend",Lm(r=this._onSBUpdateEnd).call(r,this,e)),i.addEventListener("error",Lm(n=this._onSBUpdateError).call(n,this,e))}}},{key:"changeType",value:function(e,t){var r=this,n=this._sourceBuffer[e];return this.mediaSource&&n&&n.mimeType!==t?"function"!=typeof n.changeType?$g.reject(new wP(vP,_P.MSE_CHANGE_TYPE,new Error("changeType is not a function"))):this._enqueueOp(e,(function(){try{n.changeType(t)}catch(i){throw new wP(vP,_P.MSE_CHANGE_TYPE,i)}n.mimeType=t,r._onSBUpdateEnd(e)}),"changeType",{mimeType:t}):$g.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t,r){var n=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){var i;n.mediaSource&&!n.media.error&&(n._logger.debug("MSE APPEND START",r),n._opst=RP(),null===(i=n._sourceBuffer[e])||void 0===i||i.appendBuffer(t))}),IP,r):$g.resolve()}},{key:"remove",value:function(e,t,r,n){var i=this,a=!1;return this._mseFullFlag[e]&&(a=!0),this._enqueueOp(e,(function(){if(i.mediaSource&&!i.media.error){var a=i._sourceBuffer[e];t>=r||!a?i._onSBUpdateEnd(e):(i._opst=RP(),i._logger.debug("MSE REMOVE START",e,t,r,n),a.remove(t,r))}}),jP,n,a)}},{key:"clearBuffer",value:function(e,t){var r,n,i=this;return Ch(r=ch(this._sourceBuffer)).call(r,(function(r){n=i.remove(r,e,t)})),n||$g.resolve()}},{key:"clearAllBuffer",value:function(){var e,t,r=this;return Ch(e=ch(this._sourceBuffer)).call(e,(function(e){var n=r._sourceBuffer[e];t=r.remove(e,0,oP.end(oP.get(n)))})),t}},{key:"clearOpQueues",value:function(e,t){var r;this._logger.debug("MSE clearOpQueue START");var n=this._queue[e];if(t&&n)this._queue[e]=[];else if(n&&n[e]&&!(n.length<5)){var i=[];Ch(n).call(n,(function(e){e.context&&e.context.isinit&&i.push(e)})),this._queue[e]=Tm(n).call(n,0,2),i.length>0&&(r=this._queue[e]).push.apply(r,i)}}},{key:"endOfStream",value:function(e){var t=this;return this.mediaSource&&"open"===this.mediaSource.readyState?this._enqueueBlockingOp((function(){var r=t.mediaSource;r&&"open"===r.readyState&&(t._logger.debug("MSE endOfStream START"),e?r.endOfStream(e):r.endOfStream())}),"endOfStream"):$g.resolve()}},{key:"setLiveSeekableRange",value:function(e,t){var r=this.mediaSource;e<0||t<e||null==r||!r.setLiveSeekableRange||"open"!==r.readyState||r.setLiveSeekableRange(e,t)}},{key:"getSourceBuffer",value:function(e){return this._sourceBuffer[e]}},{key:"buffered",value:function(e){return oP.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return oP.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return oP.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t,r,n,i){var a=this;if(!this.mediaSource)return $g.resolve();var o=this._queue[e]=this._queue[e]||[],s={exec:t,promise:PP(),opName:r,context:n};return i?(j_(o).call(o,0,0,s),this._mseFullFlag[e]=!1,this._startQueue(e)):o.push(s),this.isOpened||this.isEnded?1===o.length&&this._startQueue(e):this._openPromise.then((function(){1===o.length&&a._startQueue(e)})),s.promise}},{key:"_enqueueBlockingOp",value:(t=CO(TO().mark((function e(t,r,n){var i,a,o=this;return TO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",$g.resolve());case 2:if((i=ch(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return a=[],Ch(i).call(i,(function(e){var t=o._queue[e],i=PP();a.push(i),t.push({exec:function(){i.resolve()},promise:i,opName:r,context:n}),1===t.length&&o._startQueue(e)})),e.abrupt("return",$g.all(a).then((function(){try{return t()}finally{Ch(i).call(i,(function(e){var t=o._queue[e],r=o._sourceBuffer[e];null==t||t.shift(),r&&r.updating||o._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r&&!this._mseFullFlag[e])try{r.exec()}catch(Vj){var n;Vj&&Vj.message&&r_(n=Vj.message).call(n,"SourceBuffer is full")>=0?(this._mseFullFlag[e]=!0,r.context&&"object"===AO(r.context)&&(r.context.isFull=!0),this._logger.error("[MSE error], context,",r.context," ,name,",r.opName,",err,SourceBuffer is full"),r.promise.reject(new wP(vP,_P.MSE_FULL,Vj))):(this._logger.error(Vj),r.promise.reject(Vj.constructor===wP?Vj:new wP(vP,_P.MSE_OTHER,Vj)),t.shift(),this._startQueue(e))}}}},{key:"setTimeoffset",value:function(e,t,r){var n=this;return this._enqueueOp(e,(function(){t<0&&(t+=.001),n._sourceBuffer[e].timestampOffset=t,n._onSBUpdateEnd(e)}),"setTimeoffset",r)}},{key:"abort",value:function(e,t){var r=this;return this.isOpened?this._enqueueOp(e,(function(){r._sourceBuffer[e].abort(),r._onSBUpdateEnd(e)}),"abort",t):$g.resolve()}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"',t=UP();if(!t)return!1;try{return t.isTypeSupported(e)}catch(Vj){return this._logger.error(e,Vj),!1}}},{key:"isMMSOnly",value:function(){return"undefined"!=typeof ManagedMediaSource&&"undefined"==typeof MediaSource}},{key:"getDefaultConfig",value:function(){return{openLog:!1,preferMMS:!1}}}]),e}();DO(FP,"VIDEO","video"),DO(FP,"AUDIO","audio");var NP="fetch",zP="xhr",VP="arraybuffer",GP="text",HP="json",qP=function(e){UO(r,e);var t=VO(r);function r(e,n,i,a){var o;return OO(this,r),DO(zO(o=t.call(this,a)),"retryCount",0),DO(zO(o),"isTimeout",!1),DO(zO(o),"loaderType",NP),DO(zO(o),"startTime",0),DO(zO(o),"endTime",0),DO(zO(o),"options",{}),o.url=e,o.request=n,o.response=i,o}return RO(r)}(FO(Error)),KP=Object.prototype.toString;function WP(e){if("[object Object]"!==KP.call(e))return!1;var t=Xh(e);return null===t||t===Object.prototype}function YP(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function JP(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function QP(e,t){var r,n;if(e){if(!t)return e;var i,a=yh(r=hb(n=ch(t)).call(n,(function(e){if(null!=(i=t[e]))return db(i)?e+="[]":i=[i],hb(i).call(i,(function(t){var r,n;return n=t,"[object Date]"===KP.call(n)?t=t.toISOString():function(e){return null!==e&&"object"===AO(e)}(t)&&(t=gA(t)),oh(r="".concat(JP(e),"=")).call(r,JP(t))})).join("&")}))).call(r,Boolean).join("&");if(a){var o=r_(e).call(e,"#");-1!==o&&(e=Tm(e).call(e,0,o)),e+=(-1===r_(e).call(e,"?")?"?":"&")+a}return e}}function XP(e,t,r,n,i,a,o,s,u,c,l){return i=null!=i?dk(i):null,n=ob(n||"0",10),B_(n)&&(n=0),{data:e,done:t,options:{range:u,vid:c,index:s,contentLength:n,age:i,startTime:a,firstByteTime:o,endTime:lS(),priOptions:l},response:r}}function $P(e,t){return Math.round(8*e*1e3/t/1024)}var ZP="error",eR="core.ttfb",tR="core.loadstart",rR="core.loadresponseheaders",nR="core.loadcomplete",iR="core.loadretry",aR="core.sourcebuffercreated",oR="core.analyzedurationexceeded",sR="core.appendbuffer",uR="core.removebuffer",cR="core.buffereos",lR="core.keyframe",fR="core.chaseframe",hR="core.metadataparsed",dR="core.sei",pR="core.seiintime",vR="core.flvscriptdata",yR="core.lowdecode",gR="core.switchurlsuccess",mR="core.switchurlfailed",_R="core.demuxedtrack",bR="core.streamexception",wR="LARGE_AV_FIRST_FRAME_GAP_DETECT",kR="LARGE_VIDEO_DTS_GAP_DETECT",SR="LARGE_AUDIO_DTS_GAP_DETECT",xR="AUDIO_GAP_DETECT",ER="AUDIO_OVERLAP_DETECT",TR="MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT",AR="real_time_speed",LR=2097152,CR=function(e){UO(n,e);var t,r=VO(n);function n(){var e;return OO(this,n),DO(zO(e=r.call(this)),"_abortController",null),DO(zO(e),"_timeoutTimer",null),DO(zO(e),"_reader",null),DO(zO(e),"_response",null),DO(zO(e),"_aborted",!1),DO(zO(e),"_index",-1),DO(zO(e),"_range",null),DO(zO(e),"_receivedLength",0),DO(zO(e),"_running",!1),DO(zO(e),"_logger",null),DO(zO(e),"_vid",""),DO(zO(e),"_onProcessMinLen",0),DO(zO(e),"_onCancel",null),DO(zO(e),"_priOptions",null),e}return RO(n,[{key:"load",value:function(e){var t,r=this,n=e.url,i=e.vid,a=e.timeout,o=e.responseType,s=e.onProgress,u=e.index,c=e.onTimeout,l=e.onCancel,f=e.range,h=e.transformResponse,d=e.request,p=e.params,v=e.logger,y=e.method,g=e.headers,m=e.body,_=e.mode,b=e.credentials,w=e.cache,k=e.redirect,S=e.referrer,x=e.referrerPolicy,E=e.onProcessMinLen,T=e.priOptions;this._logger=v,this._aborted=!1,this._onProcessMinLen=E,this._onCancel=l,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=u,this._range=f||[0,0],this._vid=i||n,this._priOptions=T||{};var A={method:y,headers:g,body:m,mode:_,credentials:b,cache:w,redirect:k,referrer:S,referrerPolicy:x,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},L=!1;clearTimeout(this._timeoutTimer),n=QP(n,p);var C=YP(f);C&&(g=d?d.headers:A.headers=A.headers||(Headers?new Headers:{}),Headers&&g instanceof Headers?g.append("Range",C):g.Range=C),a&&(this._timeoutTimer=Qw((function(){if(L=!0,r.cancel(),c){var e=new qP(n,A,null,"timeout");e.isTimeout=!0,c(e,{index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions})}}),a));var O=lS();return this._logger.debug("[fetch load start], index,",u,",range,",f),new $g((function(e,t){fetch(d||n,d?void 0:A).then(function(){var i=CO(TO().mark((function i(a){var c,l,d,p;return TO().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=a,!r._aborted&&r._running){i.next=4;break}return i.abrupt("return");case 4:if(h&&(a=h(a,n)||a),a.ok){i.next=7;break}throw new qP(n,A,a,"bad network response");case 7:if(c=lS(),o!==GP){i.next=15;break}return i.next=11,a.text();case 11:l=i.sent,r._running=!1,i.next=37;break;case 15:if(o!==HP){i.next=22;break}return i.next=18,a.json();case 18:l=i.sent,r._running=!1,i.next=37;break;case 22:if(!s){i.next=29;break}return r.resolve=e,r.reject=t,r._loadChunk(a,s,O,c),i.abrupt("return");case 29:return i.next=31,a.arrayBuffer();case 31:l=i.sent,l=new Uint8Array(l),r._running=!1,d=lS()-O,p=$P(l.byteLength,d),r.emit(AR,{speed:p,len:l.byteLength,time:d,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions});case 37:r._logger.debug("[fetch load end], index,",u,",range,",f),e(XP(l,!0,a,a.headers.get("Content-Length"),a.headers.get("age"),O,c,u,f,r._vid,r._priOptions));case 39:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){var i;clearTimeout(r._timeoutTimer),r._running=!1,r._aborted&&!L||((e=e instanceof qP?e:new qP(n,A,null,null===(i=e)||void 0===i?void 0:i.message)).startTime=O,e.endTime=lS(),e.isTimeout=L,e.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},t(e))}))}))}},{key:"cancel",value:(t=CO(TO().mark((function e(){return TO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(Vj){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,r,n){var i=this;if(!e.body||!e.body.getReader){this._running=!1;var a=new qP(e.url,"",e,"onProgress of bad response.body.getReader");return a.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(a)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(LR),this._writeIdx=0);var o,s,u,c=this._reader=e.body.getReader(),l=function(){var a=CO(TO().mark((function a(){var f,h,d,p,v,y,g,m;return TO().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return s=lS(),a.prev=1,a.next=4,c.read();case 4:o=a.sent,u=lS(),a.next=13;break;case 8:return a.prev=8,a.t0=a.catch(1),u=lS(),i._aborted||(i._running=!1,a.t0.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},i.reject(a.t0)),a.abrupt("return");case 13:if(h=(null===(f=i._range)||void 0===f?void 0:f.length)>0?i._range[0]:0,d=h+i._receivedLength,!i._aborted){a.next=19;break}return i._running=!1,t(void 0,!1,{range:[d,d],vid:i._vid,index:i._index,startTime:s,endTime:u,st:r,firstByteTime:n,priOptions:i._priOptions},e),a.abrupt("return");case 19:var _;if(p=o.value?o.value.byteLength:0,i._receivedLength+=p,i._logger.debug("【fetchLoader,onProgress call】,task,",i._range,", start,",d,", end,",h+i._receivedLength,", done,",o.done),i._onProcessMinLen>0){if(i._writeIdx+p>=i._onProcessMinLen||o.done)(v=new Uint8Array(i._writeIdx+p)).set(Tm(_=i._cache).call(_,0,i._writeIdx),0),p>0&&v.set(o.value,i._writeIdx),i._writeIdx=0,i._logger.debug("【fetchLoader,onProgress enough】,done,",o.done,",len,",v.byteLength,", writeIdx,",i._writeIdx);else if(p>0&&i._writeIdx+p<LR)i._cache.set(o.value,i._writeIdx),i._writeIdx+=p,i._logger.debug("【fetchLoader,onProgress cache】,len,",p,", writeIdx,",i._writeIdx);else if(p>0){var b;y=new Uint8Array(i._writeIdx+p+2048),i._logger.debug("【fetchLoader,onProgress extra start】,size,",i._writeIdx+p+2048,", datalen,",p,", writeIdx,",i._writeIdx),y.set(Tm(b=i._cache).call(b,0,i._writeIdx),0),p>0&&y.set(o.value,i._writeIdx),i._writeIdx+=p,delete i._cache,i._cache=y,i._logger.debug("【fetchLoader,onProgress extra end】,len,",p,", writeIdx,",i._writeIdx)}}else v=o.value;(v&&v.byteLength>0||o.done)&&t(v,o.done,{range:[i._range[0]+i._receivedLength-(v?v.byteLength:0),i._range[0]+i._receivedLength],vid:i._vid,index:i._index,startTime:s,endTime:u,st:r,firstByteTime:n,priOptions:i._priOptions},e),o.done?(g=lS()-r,m=$P(i._receivedLength,g),i.emit(AR,{speed:m,len:i._receivedLength,time:g,vid:i._vid,index:i._index,range:i._range,priOptions:i._priOptions}),i._running=!1,i._logger.debug("[fetchLoader onProgress end],task,",i._range,",done,",o.done),i.resolve(XP(o,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),r,n,i._index,i._range,i._vid,i._priOptions))):l();case 25:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(){return a.apply(this,arguments)}}();l()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),n}(iw);var OR=function(e){UO(r,e);var t=VO(r);function r(){var e;return OO(this,r),DO(zO(e=t.call(this)),"_xhr",null),DO(zO(e),"_aborted",!1),DO(zO(e),"_timeoutTimer",null),DO(zO(e),"_range",null),DO(zO(e),"_receivedLength",0),DO(zO(e),"_url",null),DO(zO(e),"_onProgress",null),DO(zO(e),"_index",-1),DO(zO(e),"_headers",null),DO(zO(e),"_currentChunkSizeKB",384),DO(zO(e),"_timeout",null),DO(zO(e),"_xhr",null),DO(zO(e),"_withCredentials",null),DO(zO(e),"_startTime",-1),DO(zO(e),"_loadCompleteResolve",null),DO(zO(e),"_loadCompleteReject",null),DO(zO(e),"_runing",!1),DO(zO(e),"_logger",!1),DO(zO(e),"_vid",""),DO(zO(e),"_responseType",void 0),DO(zO(e),"_credentials",void 0),DO(zO(e),"_method",void 0),DO(zO(e),"_transformResponse",void 0),DO(zO(e),"_firstRtt",void 0),DO(zO(e),"_onCancel",null),DO(zO(e),"_priOptions",null),e}return RO(r,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=QP(e.url,e.params);var r=lS();return new $g((function(e,r){t._loadCompleteResolve=e,t._loadCompleteReject=r,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof qP?e:new qP(t._url,t._request)).startTime=r,e.endTime=lS(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===VP&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,r=this._range[0]+this._receivedLength,n=this._range[1];t<this._range[1]-r&&(n=r+t),e=[r,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{var r,n;this._startTime=lS();var i=this._xhr=new XMLHttpRequest;i.open(this._method||"GET",this._url,!0),i.responseType=this._responseType,this._timeout&&(i.timeout=this._timeout),i.withCredentials=this._withCredentials,i.onload=Lm(r=this._onLoad).call(r,this),i.onreadystatechange=Lm(n=this._onReadyStatechange).call(n,this),i.onerror=function(e){var r,n,i;t._running=!1;var a=new qP(t._url,t._request,null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.response,"xhr.onerror.status:"+(null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.status)+",statusText,"+(null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.statusText));a.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(a)},i.ontimeout=function(e){t.cancel();var r=new qP(t._url,t._request,{status:408},"timeout");t._onTimeout&&(r.isTimeout=!0,t._onTimeout(r,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),r.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(r)};var a,o=this._headers||{},s=YP(e);if(s&&(o.Range=s),o)Ch(a=ch(o)).call(a,(function(e){i.setRequestHeader(e,o[e])}));this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),i.send(this._body)}catch(u){u.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(u)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=lS())}},{key:"_onLoad",value:function(e){var t,r=e.target.status;if(r<200||r>299){var n=new qP(this._url,null,EO(EO({},e.target.response),{},{status:r}),"bad response,status:"+r);return n.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(n)}var i,a=null,o=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===VP){var u,c=new Uint8Array(e.target.response);if(i=s+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var l=lS()-this._startTime,f=$P(this._receivedLength,l);this.emit(AR,{speed:f,len:this._receivedLength,time:l,vid:this._vid,index:this._index,range:[i,s+this._receivedLength],priOptions:this._priOptions})}a=c,o=!((null===(u=this._range)||void 0===u?void 0:u.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",i,"end ",s+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",o)}else o=!0,a=e.target.response;var h={ok:r>=200&&r<300,status:r,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(h=this._transformResponse(h,this._url)||h),this._onProgress&&this._onProgress(a,o,{index:this._index,vid:this._vid,range:[i,s+this._receivedLength],startTime:this._startTime,endTime:lS(),priOptions:this._priOptions},h),o?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(XP(this._onProgress?null:a,o,h,h.headers["content-length"],h.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,GO(MO(r.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,r,n={},i=qO(kk(t=e.getAllResponseHeaders()).call(t).split("\r\n"));try{for(i.s();!(r=i.n()).done;){var a=r.value.split(": ");n[a[0].toLowerCase()]=Tm(a).call(a,1).join(": ")}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),r}(iw),PR=["retry","retryDelay","onRetryError","transformError"],RR=function(){function e(t,r){OO(this,e),this.promise=PP(),this.alive=!!r.onProgress,!r.logger&&(r.logger=new AP("Loader")),this._loaderType=t,this._loader=t===NP&&"undefined"!=typeof fetch?new CR:new OR,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=r.retryCheckFunc,this._logger=r.logger}var t;return RO(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,n=t.retryDelay,i=t.onRetryError,a=t.transformError,o=NO(t,PR),s=function(){var t=CO(TO().mark((function t(){var u,c,l;return TO().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(o);case 3:u=t.sent,e.promise.resolve(u),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,a&&(c=a(c)||c),i&&e._retryCount>0&&i(c,e._retryCount,{index:o.index,vid:o.vid,range:o.range,priOptions:o.priOptions}),e._retryCount++,l=!0,e._retryCheckFunc&&(l=e._retryCheckFunc(t.t0)),!(l&&e._retryCount<=r)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",o.range),e._retryTimer=Qw(s,n),t.abrupt("return");case 26:e.promise.reject(c);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=CO(TO().mark((function e(){return TO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function DR(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=yh(t).call(t,Boolean)).length<2)return t[0];var n=new Uint8Array(aP(t).call(t,(function(e,t){return e+t.byteLength}),0)),i=0;return Ch(t).call(t,(function(e){n.set(e,i),i+=e.byteLength})),n}function UR(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new $g((function(t){return Qw(t,e)}))}var MR=function(e){UO(n,e);var t,r=VO(n);function n(e){var t;return OO(this,n),DO(zO(t=r.call(this,e)),"type",NP),DO(zO(t),"_queue",[]),DO(zO(t),"_alive",[]),DO(zO(t),"_currentTask",null),DO(zO(t),"_finnalUrl",""),DO(zO(t),"_config",void 0),t._config=function(e){return EO({loaderType:NP,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:GP,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),t._config.loaderType!==zP&&CR.isSupported()||(t.type=zP),t.log=e.logger,t}return RO(n,[{key:"isFetch",value:function(){return this.type===NP}},{key:"load",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?r=e:r.url=e||r.url||this._config.url,(r=Lb({},this._config,r)).params&&(r.params=Lb({},r.params)),r.headers&&WP(r.headers)&&(r.headers=Lb({},r.headers)),r.body&&WP(r.body)&&(r.body=Lb({},r.body)),r.transformRequest&&(r=r.transformRequest(r)||r),r.logger=this.log;var n=new RR(this.type,r);return n.loader.on(AR,(function(e){t.emit(AR,e)})),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(t=CO(TO().mark((function e(){var t;return TO().wrap((function(e){for(var r,n,i;;)switch(e.prev=e.next){case 0:return t=oh(r=hb(n=this._queue).call(n,(function(e){return e.cancel()}))).call(r,hb(i=this._alive).call(i,(function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,$g.all(t);case 6:return e.next=8,UR();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,r,n;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(r=e._alive)||void 0===r?void 0:r.length)>0&&(e._alive=yh(n=e._alive).call(n,(function(t){return t&&t!==e._currentTask})));e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return CR.isSupported()}}]),n}(iw),IR=function(){function e(){OO(this,e),DO(this,"_prevCurrentTime",0)}return RO(e,[{key:"do",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e){var i=e.currentTime,a=0;if(this._prevCurrentTime===i){var o=oP.info(oP.get(e),i);if(!o.buffers.length)return;r&&o.nextStart||o.nextStart&&o.nextStart-i<t?a=o.nextStart+.1:o.end&&o.end-i>n&&!e.seeking&&(a=i+.1)}this._prevCurrentTime=i,a&&i!==a&&(e.currentTime=a)}}}]),e}();EL("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),NL);var jR=re.Set,BR=Le,FR=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"add"in e&&"delete"in e&&"keys"in e)return e;throw TypeError(BR(e)+" is not a set")},NR=eC,zR=se("Set"),VR=zR.prototype,GR={Set:zR,add:NR("add",1),has:NR("has",1),remove:NR("delete",1),proto:VR},HR=fC,qR=function(e,t,r){return r?HR(e.keys(),t):e.forEach(t)},KR=qR,WR=GR.Set,YR=GR.add,JR=function(e){var t=new WR;return KR(e,(function(e){YR(t,e)})),t},QR=function(e){return e.size},XR=Re,$R=nr,ZR=D,eD=Vr,tD=TypeError,rD=Math.max,nD=function(e,t,r,n){this.set=e,this.size=t,this.has=r,this.keys=n};nD.prototype={getIterator:function(){return $R(ZR(this.keys,this.set))},includes:function(e){return ZR(this.has,this.set,e)}};var iD=function(e){$R(e);var t=+e.size;if(t!=t)throw tD("Invalid size");return new nD(e,rD(eD(t),0),XR(e.has),XR(e.keys))},aD=FR,oD=JR,sD=QR,uD=iD,cD=qR,lD=fC,fD=GR.has,hD=GR.remove,dD=function(e){var t=aD(this),r=uD(e),n=oD(t);return sD(t)<=r.size?cD(t,(function(e){r.includes(e)&&hD(n,e)})):lD(r.getIterator(),(function(e){fD(t,e)&&hD(n,e)})),n},pD=function(){return!1},vD=dD;Cr({target:"Set",proto:!0,real:!0,forced:!pD()},{difference:vD});var yD=FR,gD=QR,mD=iD,_D=qR,bD=fC,wD=GR.Set,kD=GR.add,SD=GR.has,xD=function(e){var t=yD(this),r=mD(e),n=new wD;return gD(t)>r.size?bD(r.getIterator(),(function(e){SD(t,e)&&kD(n,e)})):_D(t,(function(e){r.includes(e)&&kD(n,e)})),n},ED=xD;Cr({target:"Set",proto:!0,real:!0,forced:!pD()},{intersection:ED});var TD=FR,AD=GR.has,LD=QR,CD=iD,OD=qR,PD=fC,RD=Id,DD=function(e){var t=TD(this),r=CD(e);if(LD(t)<=r.size)return!1!==OD(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==PD(n,(function(e){if(AD(t,e))return RD(n,"normal",!1)}))},UD=DD;Cr({target:"Set",proto:!0,real:!0,forced:!pD()},{isDisjointFrom:UD});var MD=FR,ID=QR,jD=qR,BD=iD,FD=function(e){var t=MD(this),r=BD(e);return!(ID(t)>r.size)&&!1!==jD(t,(function(e){if(!r.includes(e))return!1}),!0)},ND=FD;Cr({target:"Set",proto:!0,real:!0,forced:!pD()},{isSubsetOf:ND});var zD=FR,VD=GR.has,GD=QR,HD=iD,qD=fC,KD=Id,WD=function(e){var t=zD(this),r=HD(e);if(GD(t)<r.size)return!1;var n=r.getIterator();return!1!==qD(n,(function(e){if(!VD(t,e))return KD(n,"normal",!1)}))},YD=WD;Cr({target:"Set",proto:!0,real:!0,forced:!pD()},{isSupersetOf:YD});var JD=FR,QD=JR,XD=iD,$D=fC,ZD=GR.add,eU=GR.has,tU=GR.remove,rU=function(e){var t=JD(this),r=XD(e).getIterator(),n=QD(t);return $D(r,(function(e){eU(t,e)?tU(n,e):ZD(n,e)})),n},nU=rU;Cr({target:"Set",proto:!0,real:!0,forced:!pD()},{symmetricDifference:nU});var iU=FR,aU=GR.add,oU=JR,sU=iD,uU=fC,cU=function(e){var t=iU(this),r=sU(e).getIterator(),n=oU(t);return uU(r,(function(e){aU(n,e)})),n},lU=cU;Cr({target:"Set",proto:!0,real:!0,forced:!pD()},{union:lU});var fU=jR;Cr({target:"Set",stat:!0,forced:!0},{from:JL}),Cr({target:"Set",stat:!0,forced:!0},{of:XL});var hU=FR,dU=GR.add;Cr({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=hU(this),t=0,r=arguments.length;t<r;t++)dU(e,arguments[t]);return e}});var pU=FR,vU=GR.remove;Cr({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=pU(this),r=!0,n=0,i=arguments.length;n<i;n++)e=vU(t,arguments[n]),r=r&&e;return!!r}});var yU=Xt,gU=FR,mU=qR;Cr({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=gU(this),r=yU(e,arguments.length>1?arguments[1]:void 0);return!1!==mU(t,(function(e){if(!r(e,e,t))return!1}),!0)}});var _U=cn,bU=Ze,wU=K,kU=mu,SU=dt("iterator"),xU=Object,EU=L,TU=function(e){if(wU(e))return!1;var t=xU(e);return void 0!==t[SU]||"@@iterator"in t||bU(kU,_U(t))},AU=te,LU=se("Set"),CU=function(e){return function(e){return AU(e)&&"number"==typeof e.size&&EU(e.has)&&EU(e.keys)}(e)?e:TU(e)?new LU(e):e},OU=D,PU=CU,RU=dD;Cr({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return OU(RU,this,PU(e))}});var DU=Xt,UU=FR,MU=qR,IU=GR.Set,jU=GR.add;Cr({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=UU(this),r=DU(e,arguments.length>1?arguments[1]:void 0),n=new IU;return MU(t,(function(e){r(e,e,t)&&jU(n,e)})),n}});var BU=Xt,FU=FR,NU=qR;Cr({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=FU(this),r=BU(e,arguments.length>1?arguments[1]:void 0),n=NU(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}});var zU=D,VU=CU,GU=xD;Cr({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return zU(GU,this,VU(e))}});var HU=D,qU=CU,KU=DD;Cr({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return HU(KU,this,qU(e))}});var WU=D,YU=CU,JU=FD;Cr({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return WU(JU,this,YU(e))}});var QU=D,XU=CU,$U=WD;Cr({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return QU($U,this,XU(e))}});var ZU=Cr,eM=g,tM=FR,rM=qR,nM=ti,iM=eM([].join),aM=eM([].push);ZU({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=tM(this),r=void 0===e?",":nM(e),n=[];return rM(t,(function(e){aM(n,e)})),iM(n,r)}});var oM=Xt,sM=FR,uM=qR,cM=GR.Set,lM=GR.add;Cr({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=sM(this),r=oM(e,arguments.length>1?arguments[1]:void 0),n=new cM;return uM(t,(function(e){lM(n,r(e,e,t))})),n}});var fM=Re,hM=FR,dM=qR,pM=TypeError;Cr({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=hM(this),r=arguments.length<2,n=r?void 0:arguments[1];if(fM(e),dM(t,(function(i){r?(r=!1,n=i):n=e(n,i,i,t)})),r)throw pM("Reduce of empty set with no initial value");return n}});var vM=Xt,yM=FR,gM=qR;Cr({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=yM(this),r=vM(e,arguments.length>1?arguments[1]:void 0);return!0===gM(t,(function(e){if(r(e,e,t))return!0}),!0)}});var mM=D,_M=CU,bM=rU;Cr({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return mM(bM,this,_M(e))}});var wM=D,kM=CU,SM=cU;Cr({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return wM(SM,this,kM(e))}});var xM=r(fU),EM=function(){function e(t){var r=this;OO(this,e),DO(this,"_seiSet",new xM),this.emitter=t,t.on(dR,(function(e){e&&r._seiSet.add(e)}))}return RO(e,[{key:"throw",value:function(e,t){var r,n,i=this;if(null!=e&&this._seiSet.size){var a=e-.2,o=e+.2,s=[];Ch(r=this._seiSet).call(r,(function(e){e.time>=a&&e.time<=o&&s.push(e)})),Ch(s).call(s,(function(e){i._seiSet.delete(e),i.emitter.emit(pR,e)})),t&&Ch(n=this._seiSet).call(n,(function(t){t.time<e-5&&i._seiSet.delete(t)}))}}},{key:"reset",value:function(){this._seiSet.clear()}}]),e}(),TM=function(){function e(t){OO(this,e),DO(this,"_chunkSpeed",0),DO(this,"_chunkCache",[]),DO(this,"_speeds",[]),DO(this,"_totalSize",0),DO(this,"_totalCost",0),this._opts=t||{}}return RO(e,[{key:"addRecord",value:function(e,t){var r;e&&t&&(this._speeds.push(8e3*e/t),this._speeds=Tm(r=this._speeds).call(r,-3))}},{key:"addChunkRecord",value:function(e,t){var r,n;if(e&&t&&!(e<((null===(r=this._opts)||void 0===r?void 0:r.skipChunkSize)||1e3))){this._totalSize+=e,this._totalCost+=t,this._chunkSpeed=8e3*e/t,this._chunkCache.push({size:e,duration:t,timestamp:performance.now()});var i,a=(null===(n=this._opts)||void 0===n?void 0:n.chunkCountForSpeed)||50;if(this._chunkCache.length>a)this._chunkCache=Tm(i=this._chunkCache).call(i,-a)}}},{key:"getAvgSpeed",value:function(){var e,t,r,n;if(!this._chunkCache.length&&!this._speeds.length)return 0;if(this._speeds.length)return aP(n=this._speeds).call(n,(function(e,t){return e+t}))/this._speeds.length;var i=this._chunkCache[this._chunkCache.length-1],a=performance.now()-i.timestamp;return a>((null===(r=this._opts)||void 0===r?void 0:r.longtimeNoReceived)||3e3)&&this._chunkCache.push({size:0,duration:a,timestamp:performance.now()}),8e3*aP(e=this._chunkCache).call(e,(function(e,t){return e+t.size}),0)/aP(t=this._chunkCache).call(t,(function(e,t){return e+t.duration}),0)}},{key:"getLatestSpeed",value:function(){return this._chunkCache.length||this._speeds.length?this._speeds.length?this._speeds[this._speeds.length-1]:this._chunkSpeed:0}},{key:"getTotalSize",value:function(){return this._totalSize}},{key:"getTotalCost",value:function(){return this._totalCost}},{key:"reset",value:function(){this._chunkCache=[],this._speeds=[],this._totalSize=0,this._totalCost=0}}]),e}(),AM=function(){function e(t){OO(this,e),DO(this,"encodeType",""),DO(this,"audioCodec",""),DO(this,"videoCodec",""),DO(this,"domain",""),DO(this,"fps",0),DO(this,"bitrate",0),DO(this,"width",0),DO(this,"height",0),DO(this,"samplerate",0),DO(this,"channelCount",0),DO(this,"gop",0),DO(this,"_bitsAccumulateSize",0),DO(this,"_bitsAccumulateDuration",0),DO(this,"_startGopId",-1),this._timescale=t}return RO(e,[{key:"getStats",value:function(){return{encodeType:this.encodeType,audioCodec:this.audioCodec,videoCodec:this.videoCodec,domain:this.domain,fps:this.fps,bitrate:this.bitrate,width:this.width,height:this.height,samplerate:this.samplerate,channelCount:this.channelCount,gop:this.gop}}},{key:"setEncodeType",value:function(e){this.encodeType=e}},{key:"setFpsFromScriptData",value:function(e){var t,r=e.data,n=null==r||null===(t=r.onMetaData)||void 0===t?void 0:t.framerate;n&&n>0&&n<100&&(this.fps=n)}},{key:"setVideoMeta",value:function(e){if(this.width=e.width,this.height=e.height,this.videoCodec=e.codec,this.encodeType=e.codecType,e.fpsNum&&e.fpsDen){var t=e.fpsNum/e.fpsDen;t>0&&t<100&&(this.fps=t)}}},{key:"setAudioMeta",value:function(e){this.audioCodec=e.codec,this.samplerate=e.sampleRate,this.channelCount=e.channelCount}},{key:"setDomain",value:function(e){var t;this.domain=Tm(t=e.split("/")).call(t,2,3)[0]}},{key:"updateBitrate",value:function(e){var t=this;if((!this.fps||this.fps>=100)&&e.length){var r=aP(e).call(e,(function(e,t){return e+t.duration}),0)/e.length;this.fps=Math.round(this._timescale/r)}Ch(e).call(e,(function(e){var r;-1===t._startGopId&&(t._startGopId=e.gopId),e.gopId===t._startGopId&&t.gop++,t._bitsAccumulateDuration+=e.duration/(t._timescale/1e3),t._bitsAccumulateSize+=aP(r=e.units).call(r,(function(e,t){return e+t.length}),0),t._bitsAccumulateDuration>=1e3&&(t.bitrate=8*t._bitsAccumulateSize,t._bitsAccumulateDuration=0,t._bitsAccumulateSize=0)}))}}]),e}(),LM=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;OO(this,e),DO(this,"_core",null),DO(this,"_samples",[]),this._core=t,this._timescale=r,this._stats=new AM(r),this._bindEvents()}return RO(e,[{key:"getStats",value:function(){var e,t,r,n,i,a,o,s,u,c,l,f=(null===(e=this._core)||void 0===e?void 0:e.media)||{},h=f.currentTime,d=void 0===h?0:h,p=f.decodeFps,v=void 0===p?0:p;return EO(EO({},this._stats.getStats()),{},{downloadSpeed:(null===(t=this._core)||void 0===t||null===(r=t.speedInfo)||void 0===r?void 0:r.call(t).speed)||0,avgSpeed:(null===(n=this._core)||void 0===n||null===(i=n.speedInfo)||void 0===i?void 0:i.call(n).avgSpeed)||0,totalReceivedByte:(null===(a=this._core)||void 0===a||null===(o=a.speedInfo)||void 0===o?void 0:o.call(a).totalSize)||0,totalReceivedCost:(null===(s=this._core)||void 0===s||null===(u=s.speedInfo)||void 0===u?void 0:u.call(s).totalCost)||0,currentTime:d,bufferEnd:(null===(c=this._core)||void 0===c||null===(l=c.bufferInfo())||void 0===l?void 0:l.remaining)||0,decodeFps:v})}},{key:"_bindEvents",value:function(){var e=this;this._core.on(_R,(function(t){var r=t.videoTrack;return e._stats.updateBitrate(r.samples)})),this._core.on(vR,(function(t){e._stats.setFpsFromScriptData(t)})),this._core.on(hR,(function(t){"video"===t.type?e._stats.setVideoMeta(t.track):e._stats.setAudioMeta(t.track)})),this._core.on(eR,(function(t){e._stats.setDomain(t.responseUrl)}))}},{key:"reset",value:function(){this._samples=[],this._stats=new AM(this._timescale)}}]),e}();function CM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OM(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),Yh(e,VM(n.key),n)}}function PM(e,t,r){return t&&OM(e.prototype,t),r&&OM(e,r),Yh(e,"prototype",{writable:!1}),e}function RM(e,t,r){return(t=VM(t))in e?Yh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DM(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Qh(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Yh(e,"prototype",{writable:!1}),t&&MM(e,t)}function UM(e){var t;return(UM=$h?Lm(t=Xh).call(t):function(e){return e.__proto__||Xh(e)})(e)}function MM(e,t){var r;return(MM=$h?Lm(r=$h).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function IM(e,t){if(t&&("object"===Ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function jM(e){var t=function(){if("undefined"==typeof Reflect||!Cm)return!1;if(Cm.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Cm(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=UM(e);if(t){var i=UM(this).constructor;r=Cm(n,arguments,i)}else r=n.apply(this,arguments);return IM(this,r)}}function BM(e,t){return function(e){if(db(e))return e}(e)||function(e,t){var r=null==e?null:void 0!==Jh&&Ob(e)||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||NM(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FM(e){return function(e){if(db(e))return zM(e)}(e)||function(e){if(void 0!==Jh&&null!=Ob(e)||null!=e["@@iterator"])return Kb(e)}(e)||NM(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NM(e,t){var r;if(e){if("string"==typeof e)return zM(e,t);var n=Tm(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Kb(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zM(e,t):void 0}}function zM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function VM(e){var t=function(e,t){if("object"!==Ol(e)||null===e)return e;var r=e[Om];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ol(t)?t:String(t)}var GM="video",HM="audio",qM="metadata",KM="avc",WM="hevc",YM="aac",JM="g7110a",QM="g7110m",XM="opus",$M="mp3",ZM="LARGE_AV_SHIFT",eI="LARGE_VIDEO_GAP",tI="LARGE_VIDEO_GAP_BETWEEN_CHUNK",rI="LARGE_AUDIO_GAP",nI="AUDIO_FILLED",iI="AUDIO_DROPPED",aI=function(){function e(){CM(this,e),RM(this,"id",1),RM(this,"type",GM),RM(this,"codecType",KM),RM(this,"pid",-1),RM(this,"hvcC",void 0),RM(this,"codec",""),RM(this,"timescale",0),RM(this,"formatTimescale",0),RM(this,"sequenceNumber",0),RM(this,"baseMediaDecodeTime",0),RM(this,"baseDts",0),RM(this,"duration",0),RM(this,"warnings",[]),RM(this,"samples",[]),RM(this,"pps",[]),RM(this,"sps",[]),RM(this,"vps",[]),RM(this,"fpsNum",0),RM(this,"fpsDen",0),RM(this,"sarRatio",[]),RM(this,"width",0),RM(this,"height",0),RM(this,"nalUnitSize",4),RM(this,"present",!1),RM(this,"isVideoEncryption",!1),RM(this,"isAudioEncryption",!1),RM(this,"isVideo",!0),RM(this,"lastKeyFrameDts",0),RM(this,"kid",null),RM(this,"pssh",null),RM(this,"ext",void 0)}return PM(e,[{key:"reset",value:function(){this.sequenceNumber=this.width=this.height=this.fpsDen=this.fpsNum=this.duration=this.baseMediaDecodeTime=this.timescale=0,this.codec="",this.present=!1,this.pid=-1,this.pps=[],this.sps=[],this.vps=[],this.sarRatio=[],this.samples=[],this.warnings=[],this.hvcC=null}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}},{key:"exist",value:function(){return!!/av01/.test(this.codec)||!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isVideoEncryption}}]),e}(),oI=function(){function e(){CM(this,e),RM(this,"id",2),RM(this,"type",HM),RM(this,"codecType",YM),RM(this,"pid",-1),RM(this,"codec",""),RM(this,"container",""),RM(this,"sequenceNumber",0),RM(this,"sampleDuration",0),RM(this,"timescale",0),RM(this,"formatTimescale",0),RM(this,"baseMediaDecodeTime",0),RM(this,"duration",0),RM(this,"warnings",[]),RM(this,"samples",[]),RM(this,"baseDts",0),RM(this,"sampleSize",16),RM(this,"sampleRate",0),RM(this,"channelCount",0),RM(this,"objectType",0),RM(this,"sampleRateIndex",0),RM(this,"config",[]),RM(this,"present",!1),RM(this,"isVideoEncryption",!1),RM(this,"isAudioEncryption",!1),RM(this,"kid",null),RM(this,"ext",void 0)}return PM(e,[{key:"reset",value:function(){this.sequenceNumber=0,this.timescale=0,this.sampleDuration=0,this.sampleRate=0,this.channelCount=0,this.baseMediaDecodeTime=0,this.present=!1,this.pid=-1,this.codec="",this.samples=[],this.config=[],this.warnings=[]}},{key:"exist",value:function(){return!(!this.sampleRate||!this.channelCount||!this.codec&&!this.container||this.codecType!==YM&&this.codecType!==JM&&this.codecType!==QM&&this.codecType!==XM&&this.codecType!==$M)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isAudioEncryption}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}}]),e}(),sI=function(){function e(t,r,n){CM(this,e),RM(this,"flag",{}),RM(this,"keyframe",!1),RM(this,"gopId",0),RM(this,"duration",0),RM(this,"size",0),RM(this,"units",[]),RM(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return PM(e,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),e}(),uI=PM((function e(t,r,n,i){CM(this,e),RM(this,"duration",1024),RM(this,"flag",{dependsOn:2,isNonSyncSample:0}),RM(this,"keyframe",!0),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,this.sampleOffset=i,n&&(this.duration=n)})),cI=PM((function e(t,r){CM(this,e),RM(this,"time",0),this.data=t,this.originPts=this.pts=r})),lI=function(e){DM(r,e);var t=jM(r);function r(){return CM(this,r),t.apply(this,arguments)}return PM(r)}(cI),fI=function(e){DM(r,e);var t=jM(r);function r(){return CM(this,r),t.apply(this,arguments)}return PM(r)}(cI),hI=function(){function e(){CM(this,e),RM(this,"id",3),RM(this,"type",qM),RM(this,"timescale",0),RM(this,"flvScriptSamples",[]),RM(this,"seiSamples",[])}return PM(e,[{key:"exist",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length||!this.timescale)}},{key:"reset",value:function(){this.timescale=0,this.flvScriptSamples=[],this.seiSamples=[]}},{key:"hasSample",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length)}}]),e}(),dI=a.isFinite;Cr({target:"Number",stat:!0},{isFinite:Number.isFinite||function(e){return"number"==typeof e&&dI(e)}});var pI=r(re.Number.isFinite),vI=function(){function e(t){CM(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return PM(e,[{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).warn.apply(r,oh(t=[this._prefix]).call(t,i))}}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();RM(vI,"disabled",!0);var yI="undefined"!=typeof window,gI=yI&&navigator.userAgent.toLocaleLowerCase(),mI=yI&&/^((?!chrome|android).)*safari/.test(gI),_I=yI&&BA(gI).call(gI,"firefox"),bI=yI&&BA(gI).call(gI,"android"),wI=function(){function e(){CM(this,e)}return PM(e,null,[{key:"getRateIndexByRate",value:function(t){var r;return r_(r=e.FREQ).call(r,t)}},{key:"parseADTS",value:function(t,r){for(var n=t.length,i=0;i+2<n&&(255!==t[i]||240!=(246&t[i+1]));)i++;if(!(i>=n)){var a=i,o=[],s=(60&t[i+2])>>>2,u=e.FREQ[s];if(!u)throw new Error("Invalid sampling index: ".concat(s));for(var c,l,f=1+((192&t[i+2])>>>6),h=(1&t[i+2])<<2|(192&t[i+3])>>>6,d=e._getConfig(s,h,f),p=d.config,v=d.codec,y=0,g=e.getFrameDuration(u);i+7<n;)if(255===t[i]&&240==(246&t[i+1])){if(!(l=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5)||n-i<l)break;c=2*(1&~t[i+1]),o.push({pts:r+y*g,data:t.subarray(i+7+c,i+l)}),y++,i+=l}else i++;return{skip:a,remaining:i>=n?void 0:t.subarray(i),frames:o,samplingFrequencyIndex:s,sampleRate:u,objectType:f,channelCount:h,codec:v,config:p,originCodec:"mp4a.40.".concat(f)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var r=t[0]>>>3,n=(7&t[0])<<1|t[1]>>>7,i=(120&t[1])>>>3,a=e.FREQ[n];if(a){var o=e._getConfig(n,i,r);return{samplingFrequencyIndex:n,sampleRate:a,objectType:r,channelCount:i,config:o.config,codec:o.codec,originCodec:"mp4a.40.".concat(r)}}}}},{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"_getConfig",value:function(e,t,r){var n,i,a=[];return _I?e>=6?(n=5,i=e-3):(n=2,i=e):bI?(n=2,i=e):(n=2===r||5===r?r:5,i=e,e>=6?i=e-3:1===t&&(n=2,i=e)),a[0]=n<<3,a[0]|=(14&e)>>1,a[1]=(1&e)<<7,a[1]|=t<<3,5===n&&(a[1]|=(14&i)>>1,a[2]=(1&i)<<7,a[2]|=8,a[3]=0),{config:a,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),e}();RM(wI,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var kI=Cr,SI=g,xI=oi,EI=RangeError,TI=String.fromCharCode,AI=String.fromCodePoint,LI=SI([].join);kI({target:"String",stat:!0,arity:1,forced:!!AI&&1!=AI.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],xI(t,1114111)!==t)throw EI(t+" is not a valid code point");r[i]=t<65536?TI(t):TI(55296+((t-=65536)>>10),t%1024+56320)}return LI(r,"")}});var CI=r(re.String.fromCodePoint),OI=function(){function e(){CM(this,e)}return PM(e,null,[{key:"getFrameDuration",value:function(e){return 20}},{key:"parseHeaderPackets",value:function(e){if(e.length){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r="",n=0;n<8;n++)r+=CI(e[n]);if("OpusHead"!==r)throw new Error("Invalid Opus MagicSignature");var i=e[9];console.log("Pre-skip",e[10],e[11]);var a=t.getUint32(12,!0),o=t.getInt16(16,!0);if(a){return{outputGain:o,sampleRate:a,channelCount:i,config:new Uint8Array(e.buffer,e.byteOffset+8,e.byteLength-8),codec:"opus",originCodec:"opus"}}}}}]),e}(),PI=1e3,RI=5e3,DI=function(){function e(t,r,n){CM(this,e),this.videoTrack=t,this.audioTrack=r,this.metadataTrack=n,this._baseDts=-1,this._baseDtsInited=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastVideoDuration=0,this._keyFrameInNextChunk=!1,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0}return PM(e,[{key:"fix",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=Math.round(1e3*t);var i=this.videoTrack,a=this.audioTrack;if(!r&&n||(this._videoLastSample=null,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0),r&&!n&&(this._baseDtsInited=!1),this._baseDtsInited||this._calculateBaseDts(a,i),!n&&t&&(this._audioNextPts=this._videoNextDts=t),this._baseDtsInited&&(this._videoTimestampBreak||!this.videoTrack.exist())&&(this._audioTimestampBreak||!this.audioTrack.exist())&&this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(a),this._keyFrameInNextChunk=!1,this._fixVideo(i),this.metadataTrack.exist()){var o,s,u=this.metadataTrack.timescale;Ch(o=this.metadataTrack.seiSamples).call(o,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/u})),Ch(s=this.metadataTrack.flvScriptSamples).call(s,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/u}))}i.samples.length&&(i.baseMediaDecodeTime=i.samples[0].dts),a.samples.length&&(a.baseMediaDecodeTime=a.samples[0].pts*a.timescale/1e3)}},{key:"_fixVideo",value:function(e){var t=this,r=e.samples;if(r.length){var n;if(Ch(r).call(r,(function(e){e.dts-=t._baseDts,e.pts-=t._baseDts,e.keyframe&&(t._keyFrameInNextChunk=!0)})),e.fpsNum&&e.fpsDen)n=e.timescale*(e.fpsDen/e.fpsNum);else if(e.length>1){var i=e.samples[0],a=e.samples[r.length-1];n=Math.floor((a.dts-i.dts)/(r.length-1))}else n=this._lastVideoDuration||40;var o=r.pop();if(this._videoLastSample&&r.unshift(this._videoLastSample),this._videoLastSample=o,r.length){if(void 0===this._videoNextDts){var s=r[0];this._videoNextDts=s.dts}var u=r.length,c=0,l=r[0],f=this._videoNextDts-l.dts;if(Math.abs(f)>200){var h;if(Math.abs(l.dts-this._lastVideoExceptionChunkFirstDtsDot)>5e3)this._lastVideoExceptionChunkFirstDtsDot=l.dts,e.warnings.push({type:tI,nextDts:this._videoNextDts,firstSampleDts:l.dts,nextSampleDts:null===(h=r[1])||void 0===h?void 0:h.dts,sampleDuration:f});this._videoTimestampBreak>=5?(this._videoNextDts=l.dts,this._videoTimestampBreak=0):(l.dts+=f,l.pts+=f,this.audioTrack.exist()||(this._videoTimestampBreak=1))}for(var d=0;d<u;d++){var p=r[d].dts,v=r[d+1];((c=d<u-1?v.dts-p:o?o.dts-p:n)>1e3||c<0)&&(this._videoTimestampBreak++,Math.abs(p-this._lastVideoExceptionLargeGapDot)>5e3&&(this._lastVideoExceptionLargeGapDot=p,e.warnings.push({type:eI,time:p/e.timescale,dts:p,originDts:r[d].originDts,nextDts:this._videoNextDts,sampleDuration:c,refSampleDuration:n})),c=n),r[d].duration=c,this._videoNextDts+=c,this._lastVideoDuration=c}}}}},{key:"_fixAudio",value:function(e){var t=this,r=e.samples;r.length&&(Ch(r).call(r,(function(e){e.dts=e.pts-=t._baseDts})),this._doFixAudioInternal(e,r,1e3))}},{key:"_calculateBaseDts",value:function(e,t){var r=e.samples,n=t.samples;if(!r.length&&!n.length)return!1;var i=1/0,a=1/0;r.length&&(e.baseDts=i=r[0].pts),n.length&&(t.baseDts=a=n[0].dts),this._baseDts=Math.min(i,a);var o=a-i;return pI(o)&&Math.abs(o)>500&&t.warnings.push({type:ZM,videoBaseDts:a,audioBasePts:i,baseDts:this._baseDts,delta:o}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){this._calculateBaseDts(this.audioTrack,this.videoTrack)&&(this.audioTrack.exist()?this.videoTrack.exist()?this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts):this._baseDts-=this._audioNextPts:this._baseDts-=this._videoNextDts,this._videoTimestampBreak=0,this._audioTimestampBreak=0)}},{key:"_doFixAudioInternal",value:function(e,t,r){if(!e.sampleDuration)switch(e.codecType){case YM:e.sampleDuration=wI.getFrameDuration(e.timescale,r);break;case XM:e.sampleDuration=OI.getFrameDuration(e.samples,r);break;case JM:case QM:e.sampleDuration=this._getG711Duration(e);break;default:console.error("can't fix audio codecType:",e.codecType)}var n=e.sampleDuration,i=e.codecType===XM?20:e.codecType===YM?1024:n*e.timescale/1e3;if(void 0===this._audioNextPts){var a=t[0];this._audioNextPts=a.pts}for(var o=0;o<t.length;o++){var s=this._audioNextPts,u=t[o],c=u.pts-s;if(0===o&&this._audioTimestampBreak>=5&&this._keyFrameInNextChunk&&(s=this._audioNextPts=u.dts,c=0,this._audioTimestampBreak=0),!this._audioTimestampBreak&&c>=3*n&&c<=PI&&!mI){var l=this._getSilentFrame(e)||t[0].data.subarray(),f=Math.floor(c/n);Math.abs(u.pts-this._lastAudioExceptionGapDot)>RI&&(this._lastAudioExceptionGapDot=u.pts,e.warnings.push({type:nI,pts:u.pts,originPts:u.originPts,count:f,nextPts:s,refSampleDuration:n}));for(var h=0;h<f;h++){var d=new uI(Math.floor(this._audioNextPts+n)-Math.floor(this._audioNextPts),l,i);d.originPts=Math.floor(this._baseDts+s),j_(t).call(t,o,0,d),this._audioNextPts+=n,o++}o--}else if(c<=-3*n&&c>=-1e3)Math.abs(u.pts-this._lastAudioExceptionOverlapDot)>RI&&(this._lastAudioExceptionOverlapDot=u.pts,e.warnings.push({type:iI,pts:u.pts,originPts:u.originPts,nextPts:s,refSampleDuration:n})),j_(t).call(t,o,1),o--;else{if(Math.abs(c)>PI&&(this._audioTimestampBreak++,Math.abs(u.pts-this._lastAudioExceptionLargeGapDot)>RI&&(this._lastAudioExceptionLargeGapDot=u.pts,e.warnings.push({type:rI,time:u.pts/1e3,pts:u.pts,originPts:u.originPts,nextPts:s,sampleDuration:c,refSampleDuration:n}))),e.codecType===XM){var p=t[t.length-1];p&&(p.duration=u.pts-p.pts)}else u.dts=u.pts=s,u.duration=i;this._audioNextPts+=n}}}},{key:"_getG711Duration",value:function(e){var t=e.sampleSize,r=e.channelCount,n=e.sampleRate,i=e.samples[0];if(i)return 2*i.data.byteLength/r/(t/8)/n*1e3}},{key:"_getSilentFrame",value:function(e){return e.codecType===YM?wI.getSilentFrame(e.codec,e.channelCount):new Uint8Array(8*e.sampleDuration*e.channelCount)}}]),e}();function UI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=yh(t).call(t,Boolean);var n=new Uint8Array(aP(t).call(t,(function(e,t){return e+t.byteLength}),0)),i=0;return Ch(t).call(t,(function(e){n.set(e,i),i+=e.byteLength})),n}function MI(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function II(e){for(var t,r="avc1.",n=0;n<3;n++)(t=e[n].toString(16)).length<2&&(t="0".concat(t)),r+=t;return r}function jI(e){if(!db(e)){for(var t=[],r="",n=0;n<e.length;n++)n%2&&(r=e[n-1]+e[n],t.push(ob(r,16)),r="");return t}return hb(e).call(e,(function(e){return ob(e,16)}))}var BI=function(){function e(){CM(this,e)}return PM(e,null,[{key:"parseAnnexB",value:function(e){for(var t=e.length,r=2,n=0;null!==e[r]&&void 0!==e[r]&&1!==e[r];)r++;if((n=++r+2)>=t)return[];for(var i=[];n<t;)switch(e[n]){case 0:if(0!==e[n-1]){n+=2;break}if(0!==e[n-2]){n++;break}r!==n-2&&i.push(e.subarray(r,n-2));do{n++}while(1!==e[n]&&n<t);n=(r=n+1)+2;break;case 1:if(0!==e[n-1]||0!==e[n-2]){n+=3;break}r!==n-2&&i.push(e.subarray(r,n-2)),n=(r=n+1)+2;break;default:n+=3}return r<t&&i.push(e.subarray(r)),i}},{key:"parseAvcC",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var r,n=e.length,i=[],a=0;a+t<n;)if(r=MI(e,a),3===t&&(r>>>=8),a+=t,r){if(a+r>n)break;i.push(e.subarray(a,a+r)),a+=r}return i}}},{key:"parseSEI",value:function(e,t){for(var r=e.length,n=t?2:1,i=0,a=0,o="";255===e[n];)i+=255,n++;for(i+=e[n++];255===e[n];)a+=255,n++;if(a+=e[n++],5===i&&r>n+16)for(var s=0;s<16;s++)o+=e[n].toString(16),n++;return{payload:e.subarray(n,n+a),type:i,size:a,uuid:o}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,r=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(!r.length)return e;var i=t-r.length,a=new Uint8Array(i),o=0;for(n=0;n<i;o++,n++)o===r[0]&&(o++,r.shift()),a[n]=e[o];return a}}]),e}(),FI=function(){function e(t){if(CM(this,e),RM(this,"_bytesAvailable",void 0),RM(this,"_bitsAvailable",0),RM(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return PM(e,[{key:"bitsAvailable",get:function(){return this._bitsAvailable}},{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw new Error("No bytes available");var r=new Uint8Array(4);r.set(this._data.subarray(e,e+t)),this._word=new DataView(r.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{e-=this._bitsAvailable;var t=Math.floor(e/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw new Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),r=this._word>>>32-t;return this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable?r<<t|this.readBits(t):r}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if(0!=(this._word&2147483648>>>e))return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,r=8,n=0;n<e;n++)0!==r&&(r=(t+this.readEG()+256)%256),t=0===r?t:r}}]),e}(),NI=function(){function e(){CM(this,e)}return PM(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var r,n,i=1+(3&t[4]),a=[],o=[],s=6,u=31&t[5],c=0;c<u;c++)if(n=t[s]<<8|t[s+1],s+=2,n){var l=t.subarray(s,s+n);s+=n,a.push(l),r||(r=e.parseSPS(BI.removeEPB(l)))}var f,h=t[s];s++;for(var d=0;d<h;d++)f=t[s]<<8|t[s+1],s+=2,f&&(o.push(t.subarray(s,s+f)),s+=f);return{sps:r,spsArr:a,ppsArr:o,nalUnitSize:i}}}},{key:"parseSPS",value:function(e){var t=new FI(e);t.readUByte();var r=t.readUByte(),n=t.readUByte(),i=t.readUByte();t.skipUEG();var a=420;if(100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r){var o=t.readUEG();if(o<=3&&(a=[0,420,422,444][o]),3===o&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var s=3!==o?8:12,u=0;u<s;u++)t.readBool()&&(u<6?t.skipScalingList(16):t.skipScalingList(64))}t.skipUEG();var c=t.readUEG();if(0===c)t.readUEG();else if(1===c){t.skipBits(1),t.skipUEG(),t.skipUEG();for(var l=t.readUEG(),f=0;f<l;f++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var h=t.readUEG(),d=t.readUEG(),p=t.readBits(1);0===p&&t.skipBits(1),t.skipBits(1);var v,y,g,m,_,b=0,w=0,k=0,S=0;if(t.readBool()&&(b=t.readUEG(),w=t.readUEG(),k=t.readUEG(),S=t.readUEG()),t.readBool()){if(t.readBool())switch(t.readUByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUByte()<<8|t.readUByte(),t.readUByte()<<8|t.readUByte()]}if(t.readBool()&&t.readBool(),t.readBool()&&(t.readBits(4),t.readBool()&&t.readBits(24)),t.readBool()&&(t.readUEG(),t.readUEG()),t.readBool()){var x=t.readBits(32),E=t.readBits(32);y=t.readBool(),_=(g=E)/(m=2*x)}}return{codec:II(e.subarray(1,4)),profileIdc:r,profileCompatibility:n,levelIdc:i,chromaFormat:a,width:Math.ceil(16*(h+1)-2*(b+w)),height:(2-p)*(d+1)*16-(p?2:4)*(k+S),sarRatio:v,fpsNum:g,fpsDen:m,fps:_,fixedFrame:y}}}]),e}(),zI=function(){function e(){CM(this,e)}return PM(e,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t.length<23)){r=r||{};for(var n,i,a,o,s,u=1+(3&t[21]),c=[],l=[],f=[],h=23,d=t[22],p=0;p<d;p++){a=63&t[h],o=t[h+1]<<8|t[h+2],h+=3;for(var v=0;v<o;v++)if(s=t[h]<<8|t[h+1],h+=2,s){switch(a){case 32:var y=t.subarray(h,h+s);n||(n=e.parseVPS(BI.removeEPB(y),r)),f.push(y);break;case 33:var g=t.subarray(h,h+s);i||(i=e.parseSPS(BI.removeEPB(g),r)),c.push(g);break;case 34:l.push(t.subarray(h,h+s))}h+=s}}return{hvcC:r,sps:i,spsArr:c,ppsArr:l,vpsArr:f,nalUnitSize:u}}}},{key:"parseVPS",value:function(t,r){r=r||{};var n=new FI(t);n.readUByte(),n.readUByte(),n.readBits(12);var i=n.readBits(3);return r.numTemporalLayers=Math.max(r.numTemporalLayers||0,i+1),n.readBits(17),e._parseProfileTierLevel(n,i,r),r}},{key:"parseSPS",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=r||{};var n=new FI(t);n.readUByte(),n.readUByte(),n.readBits(4);var i=n.readBits(3);r.numTemporalLayers=Math.max(i+1,r.numTemporalLayers||0),r.temporalIdNested=n.readBits(1),e._parseProfileTierLevel(n,i,r),n.readUEG();var a=r.chromaFormatIdc=n.readUEG(),o=420;a<=3&&(o=[0,420,422,444][a]);var s=0;3===a&&(s=n.readBits(1));var u,c,l,f,h=n.readUEG(),d=n.readUEG(),p=n.readBits(1);(1===p&&(u=n.readUEG(),c=n.readUEG(),l=n.readUEG(),f=n.readUEG()),r.bitDepthLumaMinus8=n.readUEG(),r.bitDepthChromaMinus8=n.readUEG(),1===p)&&(h-=(1!==a&&2!==a||0!==s?1:2)*(c+u),d-=(1===a&&0===s?2:1)*(f+l));return{codec:"hev1.1.6.L93.B0",width:h,height:d,chromaFormat:o,hvcC:r}}},{key:"_parseProfileTierLevel",value:function(e,t,r){var n=r.generalTierFlag||0;r.generalProfileSpace=e.readBits(2),r.generalTierFlag=Math.max(e.readBits(1),n),r.generalProfileIdc=Math.max(e.readBits(5),r.generalProfileIdc||0),r.generalProfileCompatibilityFlags=e.readBits(32),r.generalConstraintIndicatorFlags=[e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8)];var i=e.readBits(8);n<r.generalTierFlag?r.generalLevelIdc=i:r.generalLevelIdc=Math.max(i,r.generalLevelIdc||0);var a=[],o=[];if(t>e.bitsAvailable)throw new Error("maxSubLayersMinus inavlid size ".concat(t));for(var s=0;s<t;s++)a[s]=e.readBits(1),o[s]=e.readBits(1);t>0&&e.readBits(2*(8-t));for(var u=0;u<t;u++)0!==a[u]&&(e.readBits(2),e.readBits(1),e.readBits(5),e.readBits(16),e.readBits(16),e.readBits(4),e.readBits(16),e.readBits(16),e.readBits(12)),0!==o[u]&&e.readBits(8)}}]),e}(),VI=function(){function e(){CM(this,e)}return PM(e,null,[{key:"decode",value:function(t){for(var r=[],n=t,i=0,a=t.length;i<a;)if(n[i]<128)r.push(String.fromCharCode(n[i])),++i;else{if(n[i]<192);else if(n[i]<224){if(e._checkContinuation(n,i,1)){var o=(31&n[i])<<6|63&n[i+1];if(o>=128){r.push(String.fromCharCode(65535&o)),i+=2;continue}}}else if(n[i]<240){if(e._checkContinuation(n,i,2)){var s=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(s>=2048&&55296!=(63488&s)){r.push(String.fromCharCode(65535&s)),i+=3;continue}}}else if(n[i]<248&&e._checkContinuation(n,i,3)){var u=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3];if(u>65536&&u<1114112){u-=65536,r.push(String.fromCharCode(u>>>10|55296)),r.push(String.fromCharCode(1023&u|56320)),i+=4;continue}}r.push(String.fromCharCode(65533)),++i}return r.join("")}},{key:"_checkContinuation",value:function(e,t,r){var n=e;if(t+r<n.length){for(;r--;)if(128!=(192&n[++t]))return!1;return!0}return!1}}]),e}(),GI=function(){function e(){CM(this,e)}return PM(e,null,[{key:"parse",value:function(t){if(!(t.length<3)){var r={},n=e._parseValue(new DataView(t.buffer,t.byteOffset,t.byteLength)),i=e._parseValue(new DataView(t.buffer,t.byteOffset+n.size,t.byteLength-n.size));return r[n.data]=i.data,r}}},{key:"_parseValue",value:function(t){var r,n=t.byteLength,i=1,a=!1;switch(t.getUint8(0)){case 0:r=t.getFloat64(1),i+=8;break;case 1:r=!!t.getUint8(1),i+=1;break;case 2:var o=e._parseString(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i));r=o.data,i+=o.size;break;case 3:r={};var s=0;for(9==(16777215&t.getUint32(n-4))&&(s=3);i<n-4;){var u=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-s)),c=u.size,l=u.data;if(u.isEnd)break;r[l.name]=l.value,i+=c}if(i<=n-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 8:r={},i+=4;var f=0;for(9==(16777215&t.getUint32(n-4))&&(f=3);i<n-8;){var h=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-f)),d=h.size,p=h.data;if(h.isEnd)break;r[p.name]=p.value,i+=d}if(i<=n-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 9:r=void 0,i=1,a=!0;break;case 10:r=[];var v=t.getUint32(1);i+=4;for(var y=0;y<v;y++){var g=e._parseValue(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i)),m=g.data,_=g.size;r.push(m),i+=_}break;case 11:var b=t.getFloat64(i)+6e4*t.getInt16(i+8);r=new Date(b),i+=10;break;case 12:var w=t.getUint32(1);i+=4,r="",w>0&&(r=VI.decode(new Uint8Array(t.buffer,t.byteOffset+i,w))),i+=w;break;default:i=n}return{data:r,size:i,isEnd:a}}},{key:"_parseString",value:function(e){var t=e.getUint16(0),r="";return t>0&&(r=VI.decode(new Uint8Array(e.buffer,e.byteOffset+2,t))),{data:r,size:2+t}}},{key:"_parseObject",value:function(t){if(!(t.byteLength<3)){var r=e._parseString(t),n=e._parseValue(new DataView(t.buffer,t.byteOffset+r.size,t.byteLength-r.size));return{data:{name:r.data,value:n.data},size:r.size+n.size,isEnd:n.isEnd}}}}]),e}(),HI=7,qI=8,KI=10,WI=13,YI=new vI("FlvDemuxer"),JI=function(){function e(t,r,n){CM(this,e),RM(this,"_headerParsed",!1),RM(this,"_remainingData",null),RM(this,"_gopId",0),RM(this,"_needAddMetaBeforeKeyFrameNal",!0),this.videoTrack=t||new aI,this.audioTrack=r||new oI,this.metadataTrack=n||new hI,this._fixer=new DI(this.videoTrack,this.audioTrack,this.metadataTrack)}return PM(e,[{key:"demux",value:function(t){var r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3?arguments[3]:void 0,o=this.audioTrack,s=this.videoTrack,u=this.metadataTrack;if(!n&&i||(this._remainingData=null),n&&(this._headerParsed=!1),n?(s.reset(),o.reset(),u.reset()):(s.samples=[],o.samples=[],u.seiSamples=[],u.flvScriptSamples=[],s.warnings=[],o.warnings=[],this._remainingData&&(t=UI(this._remainingData,t),this._remainingData=null)),!t.length)return{videoTrack:s,audioTrack:o,metadataTrack:u};var c=0;if(!this._headerParsed){if(!e.probe(t))throw new Error("Invalid flv file");o.present=(4&t[4])>>>2!=0,s.present=0!=(1&t[4]),this._headerParsed=!0,c=MI(t,5)+4}for(var l,f,h,d,p,v=t.length;c+15<v&&(l=t[c],!(c+15+(f=t[c+1]<<16|t[c+2]<<8|t[c+3])>v));){var y;h=(t[c+7]<<24>>>0)+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6],c+=11,d=t.subarray(c,c+f),8===l?this._parseAudio(d,h):9===l?(a&&(this.seamlessLoadingSwitching=!0),this._parseVideo(d,h)):18===l?this._parseScript(d,h):YI.warn("Invalid tag type: ".concat(l)),(p=MI(t,c+=f))!==11+f&&YI.warn(oh(y="Invalid PrevTagSize ".concat(p," (")).call(y,11+f,")")),c+=4}c<v&&(this._remainingData=t.subarray(c)),o.formatTimescale=s.formatTimescale=s.timescale=u.timescale=1e3,o.timescale=o.codecType===XM?1e3:o.sampleRate||0,!o.exist()&&o.hasSample()&&o.reset(),!s.exist()&&s.hasSample()&&s.reset();var g=u.flvScriptSamples[u.flvScriptSamples.length-1],m=null==g||null===(r=g.data)||void 0===r?void 0:r.onMetaData;return m&&(null!=s&&s.exist()&&(m.hasOwnProperty("duration")&&(s.duration=1e3*m.duration),m.hasOwnProperty("width")&&m.hasOwnProperty("height")&&(s.width=m.width,s.height=m.height)),null!=o&&o.exist()&&m.hasOwnProperty("duration")&&(o.duration=1e3*m.duration)),{videoTrack:s,audioTrack:o,metadataTrack:u}}},{key:"fix",value:function(e,t,r){return this._fixer.fix(e,t,r),{videoTrack:this.videoTrack,audioTrack:this.audioTrack,metadataTrack:this.metadataTrack}}},{key:"demuxAndFix",value:function(e,t,r,n,i){return this.demux(e,t,r,i),this.fix(n,t,r)}},{key:"_parseAudio",value:function(t,r){if(t.length){var n=(240&t[0])>>>4,i=this.audioTrack;if(n!==KI&&n!==HI&&n!==qI&&n!==WI)return YI.warn("Unsupported sound format: ".concat(n)),void i.reset();if(n!==KI&&n!==WI){var a=(12&t[0])>>2,o=(2&t[0])>>1,s=1&t[0];i.sampleRate=e.AUDIO_RATE[a],i.sampleSize=o?16:8,i.channelCount=s+1}switch(n){case HI:case qI:this._parseG711(t,r,n);break;case KI:this._parseAac(t,r);break;case WI:this._parseOpus(t,r)}}}},{key:"_parseOpus",value:function(e,t){var r=this.audioTrack,n=e[1];switch(r.codecType=XM,n){case 0:var i=OI.parseHeaderPackets(e.subarray(2));i?(r.codec=i.codec,r.channelCount=i.channelCount,r.sampleRate=i.sampleRate,r.config=i.config,r.sampleDuration=OI.getFrameDuration([],r.timescale)):(r.reset(),YI.warn("Cannot parse AudioSpecificConfig",e));break;case 1:if(null==t)return;var a=new uI(t,e.subarray(2),r.sampleDuration);r.samples.push(a);break;default:YI.warn("Unknown OpusPacketType: ".concat(n))}}},{key:"_parseG711",value:function(e,t,r){var n=this.audioTrack,i=e.subarray(1);if(!(i.byteLength<1)){var a=new uI(t,i);n.codecType=7===r?JM:QM,n.sampleRate=8e3,n.codec=n.codecType,n.samples.push(a)}}},{key:"_parseAac",value:function(e,t){var r=this.audioTrack;if(r.codecType=YM,0===e[1]){var n=wI.parseAudioSpecificConfig(e.subarray(2));n?(r.codec=n.codec,r.channelCount=n.channelCount,r.sampleRate=n.sampleRate,r.config=n.config,r.objectType=n.objectType,r.sampleRateIndex=n.samplingFrequencyIndex):(r.reset(),YI.warn("Cannot parse AudioSpecificConfig",e))}else if(1===e[1]){if(null==t)return;r.samples.push(new uI(t,e.subarray(2)))}else YI.warn("Unknown AACPacketType: ".concat(e[1]))}},{key:"_parseVideo",value:function(e,t){var r=this;if(!(e.length<6)){var n=(240&e[0])>>>4,i=15&e[0],a=this.videoTrack;if(7!==i&&12!==i)return a.reset(),void YI.warn("Unsupported codecId: ".concat(i));var o=12===i;a.codecType=o?WM:KM;var s=e[1],u=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===s){var c=e.subarray(5),l=o?zI.parseHEVCDecoderConfigurationRecord(c):NI.parseAVCDecoderConfigurationRecord(c);if(l){var f=l.hvcC,h=l.sps,d=l.ppsArr,p=l.spsArr,v=l.vpsArr,y=l.nalUnitSize;f&&(a.hvcC=a.hvcC||f),h&&(a.codec=h.codec,a.width=h.width,a.height=h.height,a.sarRatio=h.sarRatio,a.fpsNum=h.fpsNum,a.fpsDen=h.fpsDen),p.length&&(a.sps=p),d.length&&(a.pps=d),v&&v.length&&(a.vps=v),y&&(a.nalUnitSize=y)}else YI.warn("Cannot parse ".concat(o?"HEVC":"AVC","DecoderConfigurationRecord"),e)}else if(1===s){var g=BI.parseAvcC(e.subarray(5),a.nalUnitSize);if((g=this._checkAddMetaNalToUnits(o,g,a))&&g.length){var m=new sI(t+u,t,g);if(this.seamlessLoadingSwitching&&t<a.lastKeyFrameDts)return;this.seamlessLoadingSwitching=!1,1===n&&(m.setToKeyframe(),a.lastKeyFrameDts=t),a.samples.push(m),Ch(g).call(g,(function(e){var n=o?e[0]>>>1&63:31&e[0];switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!o&&5!==n||o&&5===n)break;m.setToKeyframe();break;case 6:case 39:case 40:if(!o&&6!==n||o&&6===n)break;r.metadataTrack.seiSamples.push(new fI(BI.parseSEI(BI.removeEPB(e),o),t+u))}})),m.keyframe&&this._gopId++,m.gopId=this._gopId}else YI.warn("Cannot parse NALUs",e)}else 2===s||YI.warn("Unknown AVCPacketType: ".concat(s))}}},{key:"_checkAddMetaNalToUnits",value:function(e,t,r){if(!e||!this._needAddMetaBeforeKeyFrameNal)return this._needAddMetaBeforeKeyFrameNal=!1,t;var n=hb(t).call(t,(function(e){return e[0]>>>1&63}));return BA(n).call(n,32)?(this._needAddMetaBeforeKeyFrameNal=!1,t):(t.unshift(r.pps[0]),t.unshift(r.sps[0]),t.unshift(r.vps[0]),yh(t).call(t,Boolean))}},{key:"_parseScript",value:function(e,t){this.metadataTrack.flvScriptSamples.push(new lI(GI.parse(e),t))}}],[{key:"probe",value:function(e){return 70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]&&MI(e,5)>=9}}]),e}();RM(JI,"AUDIO_RATE",[5500,11e3,22e3,44e3]);var QI=nr,XI=D,$I=Ze,ZI=ue,ej=function(){var e=QI(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},tj=RegExp.prototype,rj=ue,nj=function(e){var t=e.flags;return void 0!==t||"flags"in tj||$I(e,"flags")||!ZI(tj,e)?t:XI(ej,e)},ij=RegExp.prototype,aj=r((function(e){return e===ij||rj(ij,e)?nj(e):e.flags})),oj=af("Array").entries,sj=cn,uj=Ze,cj=ue,lj=oj,fj=Array.prototype,hj={DOMTokenList:!0,NodeList:!0},dj=r((function(e){var t=e.entries;return e===fj||cj(fj,e)&&t===fj.entries||uj(hj,sj(e))?lj:t}));var pj,vj=function(){function e(){CM(this,e),this.buffer=new Uint8Array(0)}return PM(e,[{key:"write",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];Ch(r).call(r,(function(t){t?e.buffer=function(e){for(var t=0,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];Ch(n).call(n,(function(e){t+=e.length}));var a=new e(t),o=0;return Ch(n).call(n,(function(e){a.set(e,o),o+=e.length})),a}(Uint8Array,e.buffer,t):window.console.warn(t)}))}}],[{key:"writeUint16",value:function(e){return new Uint8Array([e>>8&255,255&e])}},{key:"writeUint32",value:function(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}}]),e}(),yj=Math.pow(2,32)-1,gj=function(){function e(){CM(this,e)}return PM(e,null,[{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r=yh(r).call(r,Boolean);var i=8+aP(r).call(r,(function(e,t){return e+t.byteLength}),0),a=new Uint8Array(i);a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=255&i,a.set(e,4);var o=8;return Ch(r).call(r,(function(e){a.set(e,o),o+=e.byteLength})),a}},{key:"ftyp",value:function(t){return f_(t).call(t,(function(e){return e.type===GM&&e.codecType===WM}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return UI(e.ftyp(t),e.moov(t))}},{key:"pssh",value:function(t){var r,n=new Uint8Array(oh(r=[1,0,0,0]).call(r,[16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75],[0,0,0,1],jI(t.kid),[0,0,0,0]));return e.box(e.types.pssh,n)}},{key:"moov",value:function(t){if(t[0].useEME&&(t[0].encv||t[0].enca)){var r;t[0].pssh||(t[0].pssh={kid:t[0].kid});var n=this.pssh(t[0].pssh);return e.box.apply(e,oh(r=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale),e.mvex(t)]).call(r,FM(hb(t).call(t,(function(t){return e.trak(t)}))),[n]))}var i;return e.box.apply(e,oh(i=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale)]).call(i,FM(hb(t).call(t,(function(t){return e.trak(t)}))),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.tkhdDuration||0,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]))}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===GM?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){var r=[];return t&&t.ext&&t.ext.stss&&r.push(e.stss(dj(t.ext.stss))),e.box(e.types.stbl,e.stsd(t),e.STTS,r[0],e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){var r;return r="audio"===t.type?t.useEME&&t.enca?e.enca(t):t.codecType===XM?e.opus(t):e.mp4a(t):t.useEME&&t.encv?e.encv(t):t.av1C?e.av01(t):e.avc1hev1(t),e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),r)}},{key:"enca",value:function(t){var r=t.enca.channelCount,n=t.enca.sampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>8&255,255&n,0,0]),a=e.esds(t.config),o=e.sinf(t.enca);return e.box(e.types.enca,i,a,o)}},{key:"encv",value:function(t){var r,n,i,a=t.sps.length>0?t.sps[0]:[],o=t.pps.length>0?t.pps[0]:[],s=t.width,u=t.height,c=t.sarRatio[0],l=t.sarRatio[1],f=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h=new Uint8Array(oh(n=oh(r=oh(i=[1,a[1],a[2],a[3],255,225,a.length>>>8&255,255&a.length]).apply(i,FM(a))).call(r,[1,o.length>>>8&255,255&o.length])).apply(n,FM(o))),d=new Uint8Array([0,0,88,57,0,15,200,192,0,4,86,72]),p=e.sinf(t.encv),v=new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,l>>24,l>>16&255,l>>8&255,255&l]);return e.box(e.types.encv,f,e.box(e.types.avcC,h),e.box(e.types.btrt,d),p,e.box(e.types.pasp,v))}},{key:"schi",value:function(t){var r=new Uint8Array([]),n=e.tenc(t);return e.box(e.types.schi,r,n)}},{key:"tenc",value:function(t){var r,n=new Uint8Array(oh(r=[0,0,0,0,0,0,255&t.default_IsEncrypted,255&t.default_IV_size]).call(r,jI(t.default_KID)));return e.box(e.types.tenc,n)}},{key:"sinf",value:function(t){var r=new Uint8Array([]),n=new Uint8Array([t.data_format.charCodeAt(0),t.data_format.charCodeAt(1),t.data_format.charCodeAt(2),t.data_format.charCodeAt(3)]),i=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0]),a=e.schi(t);return e.box(e.types.sinf,r,e.box(e.types.frma,n),e.box(e.types.schm,i),a)}},{key:"av01",value:function(t){return e.box(e.types.av01,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t.av1C,t.colr)}},{key:"avc1hev1",value:function(t){var r,n=t.codecType===WM,i=n?e.types.hvc1:e.types.avc1,a=n?e.hvcC(t):e.avcC(t),o=[new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a];return n?o.push(e.box(e.types.fiel,new Uint8Array([1,0]))):t.sarRatio&&t.sarRatio.length>1&&o.push(e.pasp(t.sarRatio)),e.box.apply(e,oh(r=[i]).call(r,o))}},{key:"avcC",value:function(t){var r,n,i,a,o,s,u=[],c=[];return Ch(r=t.sps).call(r,(function(e){s=e.byteLength,u.push(s>>>8&255),u.push(255&s),u.push.apply(u,FM(e))})),Ch(n=t.pps).call(n,(function(e){s=e.byteLength,c.push(s>>>8&255),c.push(255&s),c.push.apply(c,FM(e))})),e.box(e.types.avcC,new Uint8Array(oh(a=oh(i=oh(o=[1,u[3],u[4],u[5],255,224|t.sps.length]).apply(o,u)).call(i,[t.pps.length])).apply(a,c)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer||r instanceof Uint8Array)return r;var n,i=t.vps,a=t.sps,o=t.pps;if(r){var s=r.generalProfileCompatibilityFlags,u=r.generalConstraintIndicatorFlags,c=(i.length&&1)+(a.length&&1)+(o.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,s>>>24,s>>>16,s>>>8,s,u[0],u[1],u[2],u[3],u[4],u[5],r.generalLevelIdc,240,0,252,252|r.chromaFormatIdc,248|r.bitDepthLumaMinus8,248|r.bitDepthChromaMinus8,0,0,r.numTemporalLayers<<3|r.temporalIdNested<<2|3,c];var l=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,FM(e))};i.length&&(n.push(160,0,i.length),Ch(i).call(i,l)),a.length&&(n.push(161,0,a.length),Ch(a).call(a,l)),o.length&&(n.push(162,0,o.length),Ch(o).call(o,l))}else n=[1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var r=BM(t,2),n=r[0],i=r[1];return e.box(e.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var r,n,i,a=t.length;return e.box(e.types.esds,new Uint8Array(oh(r=oh(n=oh(i=[0,0,0,0,3,23+a,0,0,0,4,15+a,64,21,0,6,0,0,0,218,192,0,0,218,192,5]).call(i,[a])).call(n,t)).call(r,[6,1,2])))}},{key:"opus",value:function(t){var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),n=t.config.length?e.dOps(t):[];return e.box(e.types.Opus,r,n)}},{key:"dOps",value:function(t){if(t.config)return t.config[4]=t.sampleRate>>>24&255,t.config[5]=t.sampleRate>>>16&255,t.config[6]=t.sampleRate>>>8&255,t.config[7]=255&t.sampleRate,e.box(e.types.dOps,t.config)}},{key:"mvex",value:function(t){var r;return e.box.apply(e,oh(r=[e.types.mvex]).call(r,FM(hb(t).call(t,(function(t){return e.trex(t.id)})))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trex1",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,2,0,0,0,0,0,0,1,0,0]))}},{key:"trex2",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,4,0,0,0,0,0,2,0,0,0]))}},{key:"moof",value:function(t){var r;return e.box.apply(e,oh(r=[e.types.moof,e.mfhd(t[0].samples?t[0].samples[0].gopId:0)]).call(r,FM(hb(t).call(t,(function(t){return e.traf(t)})))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){var r,n=e.tfhd(t.id),i=e.tfdt(t,t.baseMediaDecodeTime),a=0;if(t.isVideo&&t.videoSenc&&(r=t.videoSenc,Ch(r).call(r,(function(e){a+=8,e.subsamples&&e.subsamples.length&&(a+=2,a+=6*e.subsamples.length)}))),t.videoSencLength=a,t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)){if(t.isVideoEncryption){if(t.isVideo){var o=e.saiz(t),s=e.saio(t),u=e.trun1(t),c=e.senc(t);return e.box(e.types.traf,n,i,o,s,u,c)}if(t.isAudioEncryption){var l=e.sbgp(),f=e.saiz(t),h=e.saio(t),d=e.senc(t),p=e.trun1(t);return e.box(e.types.traf,n,i,l,f,h,d,p)}var v=e.sbgp(),y=e.trun1(t);return e.box(e.types.traf,n,i,v,y)}if(t.isVideo){var g=e.trun1(t);return e.box(e.types.traf,n,i,g)}var m=e.sbgp(),_=e.saiz(t),b=e.saio(t),w=e.senc(t),k=e.trun1(t);return e.box(e.types.traf,n,i,m,_,b,w,k)}var S=e.sdtp(t);return e.box(e.types.traf,n,i,S,e.trun(t.samples,S.byteLength+76))}},{key:"sdtp",value:function(t){var r,n=new vj;return Ch(r=t.samples).call(r,(function(e){n.write(new Uint8Array(t.isVideo?[e.keyframe?32:16]:[16]))})),e.box(e.types.sdtp,this.extension(0,0),n.buffer)}},{key:"trun1",value:function(t){var r,n=new vj,i=vj.writeUint32(t.samples.length),a=null;if(t.isVideo){var o=t.videoSencLength;a=vj.writeUint32(16*t.samples.length+o+149),!t.isVideoEncryption&&t.isAudioEncryption&&(a=vj.writeUint32(16*t.samples.length+92))}else{var s=12*t.samples.length+124;t.isAudioEncryption&&(s=12*t.samples.length+8*t.audioSenc.length+177),a=vj.writeUint32(s)}return Ch(r=t.samples).call(r,(function(e){n.write(vj.writeUint32(e.duration)),n.write(vj.writeUint32(e.size)),n.write(vj.writeUint32(e.keyframe?33554432:65536)),t.isVideo&&n.write(vj.writeUint32(e.cts?e.cts:0))})),e.box(e.types.trun,this.extension(0,aj(t)),i,a,n.buffer)}},{key:"senc",value:function(t){var r=new vj,n=t.samples.length,i=t.isVideo?16:8,a=t.isVideo?2:0,o=[],s=0;return t.isVideo?(o=t.videoSenc,s=t.videoSencLength):o=t.audioSenc,s=s||i*n,r.write(vj.writeUint32(16+s),e.types.senc,this.extension(0,a)),r.write(vj.writeUint32(n)),Ch(o).call(o,(function(e){for(var t=0;t<e.InitializationVector.length;t++)r.write(new Uint8Array([e.InitializationVector[t]]));var n;e.subsamples&&e.subsamples.length&&(r.write(vj.writeUint16(e.subsamples.length)),Ch(n=e.subsamples).call(n,(function(e){r.write(vj.writeUint16(e.BytesOfClearData)),r.write(vj.writeUint32(e.BytesOfProtectedData))})))})),r.buffer}},{key:"saio",value:function(t){var r=12*t.samples.length+141;!t.isVideo&&t.isAudioEncryption&&(r=149);var n=new Uint8Array([1,0,0,0,0,0,0,1,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saio,n)}},{key:"saiz",value:function(t){var r=t.samples.length,n=new Uint8Array([0,0,0,0,16,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saiz,n)}},{key:"sbgp",value:function(){var t=new Uint8Array([114,111,108,108,0,0,0,1,0,0,1,25,0,0,0,1]);return e.box(e.types.sbgp,this.extension(0,0),t)}},{key:"extension",value:function(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t,r){var n=Math.floor(r/(yj+1)),i=Math.floor(r%(yj+1));return t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)?e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])):e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"trun",value:function(t,r){var n=t.length,i=12+16*n;r+=8+i;var a=new Uint8Array(i);a.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var o=0;o<n;o++){var s=t[o],u=s.duration,c=s.size,l=s.flag,f=void 0===l?{}:l,h=s.cts,d=void 0===h?0:h;a.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,c>>>24&255,c>>>16&255,c>>>8&255,255&c,f.isLeading<<2|(null===f.dependsOn||void 0===f.dependsOn?1:f.dependsOn),f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|(null===f.isNonSyncSample||void 0===f.isNonSyncSample?1:f.isNonSyncSample),61440&f.degradationPriority,15&f.degradationPriority,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*o)}return e.box(e.types.trun,a)}},{key:"moovMP4",value:function(t){var r;return e.box.apply(e,oh(r=[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)]).call(r,FM(hb(t).call(t,(function(t){return e.trackMP4(t)})))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===GM?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r,n=t.ext,i=[e.stsd(t),e.stts(n.stts),e.stsc(n.stsc),e.stsz(n.stsz),e.stco(n.stco)];return n.stss.length&&i.push(e.stss(n.stss)),n.ctts.length&&i.push(e.ctts(n.ctts)),e.box.apply(e,oh(r=[e.types.stbl]).call(r,i))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return Ch(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.stts,UI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(t){var r=t.length,n=new Uint8Array(12*r),i=0;return Ch(t).call(t,(function(e){var t=e.firstChunk,r=e.samplesPerChunk,a=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a],i),i+=12})),e.box(e.types.stsc,UI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return Ch(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stsz,UI(new Uint8Array([0,0,0,0,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stco",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return Ch(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stco,UI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return Ch(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stss,UI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return Ch(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.ctts,UI(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"styp",value:function(){return e.box(e.types.styp,new Uint8Array([109,115,100,104,0,0,0,0,109,115,100,104,109,115,105,120]))}},{key:"sidx",value:function(t){var r,n=t.timescale,i=t.samples[0].duration,a=i*t.samples.length,o=t.samples[0].sampleOffset*i,s=8;Ch(r=t.samples).call(r,(function(e){s+=e.size}));var u=0;if(t.isVideo){var c,l=0;t.videoSenc&&(c=t.videoSenc),t.isVideo&&Ch(c).call(c,(function(e){l+=8,e.subsamples&&e.subsamples.length&&(l+=2,l+=6*e.subsamples.length)})),t.videoSencLength=l,u=s+141+16*t.samples.length+l,t.useEME&&t.isAudioEncryption&&!t.isVideoEncryption&&(u=s+16*t.samples.length+84)}else u=s+116+12*t.samples.length,t.useEME&&t.isAudioEncryption&&(u=s+169+12*t.samples.length+8*t.audioSenc.length);var f=new Uint8Array([0,0,0,0,0,0,0,255&t.id,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,1,0,u>>16&255,u>>8&255,255&u,a>>24&255,a>>16&255,a>>8&255,255&a,144,0,0,0]);return e.box(e.types.sidx,f)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();RM(gj,"types",aP(pj=["Opus","dOps","av01","av1C","avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trex","tkhd","vmhd","smhd","ctts","stss","styp","pssh","sidx","sbgp","saiz","saio","senc","trun","encv","enca","sinf","btrt","frma","tenc","schm","schi","mehd","fiel","sdtp"]).call(pj,(function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),Qh(null))),RM(gj,"HDLR_TYPES",{video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),RM(gj,"FTYPAVC1",gj.box(gj.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),RM(gj,"FTYPHEV1",gj.box(gj.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),RM(gj,"DINF",gj.box(gj.types.dinf,gj.box(gj.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),RM(gj,"VMHD",gj.box(gj.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),RM(gj,"SMHD",gj.box(gj.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),RM(gj,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),RM(gj,"STTS",gj.box(gj.types.stts,gj.StblTable)),RM(gj,"STSC",gj.box(gj.types.stsc,gj.StblTable)),RM(gj,"STSZ",gj.box(gj.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),RM(gj,"STCO",gj.box(gj.types.stco,gj.StblTable));var mj=function(){function e(t,r){CM(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=r}return PM(e,[{key:"debug",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).debug.apply(r,oh(t=[this._prefix]).call(t,i))}}},{key:"log",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).log.apply(r,oh(t=[this._prefix]).call(t,i))}}},{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).warn.apply(r,oh(t=[this._prefix]).call(t,i))}}},{key:"error",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];(r=console).error.apply(r,oh(t=[this._prefix]).call(t,i))}}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();RM(mj,"disabled",!0);var _j=function(){function e(t,r,n){CM(this,e),this.videoTrack=t,this.audioTrack=r;var i=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=i&&Number(i[1])<50,this.log=new mj("FMP4Remuxer",!n||!n.openLog||!n.openLog)}return PM(e,[{key:"remux",value:function(){var e,t,r,n,i,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.videoTrack,u=this.audioTrack,c=s.exist(),l=u.exist(),f=[];return a&&(o&&o.initMerge?(c&&f.push(this.videoTrack),l&&f.push(this.audioTrack),r=gj.initSegment(f)):(c&&(e=gj.initSegment([this.videoTrack])),l&&(t=gj.initSegment([this.audioTrack])))),c&&s.hasSample()&&(n=this._remuxVideo()),l&&u.hasSample()&&(i=this._remuxAudio()),s.samples=[],u.samples=[],{initSegment:r,videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:i}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack;this.forceFirstIDR&&(e.samples[0].flag={dependsOn:2,isNonSyncSample:0});var t=e.samples,r=/av01/.test(e.codec),n=0;r?Ch(t).call(t,(function(e){n+=e.data.byteLength})):Ch(t).call(t,(function(e){var t;n+=aP(t=e.units).call(t,(function(e,t){return e+t.byteLength}),0),n+=4*e.units.length}));var i=new Uint8Array(n);if(r)for(var a,o=0,s=t.length,u=0;o<s;o++)a=t[o],i.set(a.data,u),a.size=a.data.byteLength,u+=a.size;else for(var c,l=new DataView(i.buffer),f=function(e,r){var n;r=t[h];var a=0;Ch(n=r.units).call(n,(function(t){l.setUint32(e,t.byteLength),e+=4,i.set(t,e),e+=t.byteLength,a+=4+t.byteLength})),r.size=a,p=e,c=r},h=0,d=t.length,p=0;h<d;h++)f(p,c);var v=gj.mdat(i);return UI(gj.moof([e]),v)}},{key:"_remuxAudio",value:function(){var e,t,r=this.audioTrack,n=new Uint8Array(aP(e=r.samples).call(e,(function(e,t){return e+t.size}),0));aP(t=r.samples).call(t,(function(e,t){return n.set(t.data,e),e+t.size}),0);var i=gj.mdat(n);return UI(gj.moof([r]),i)}},{key:"reset",value:function(){this.videoTrack.reset(),this.audioTrack.reset()}}]),e}(),bj=function(){function e(){jm(this,e),Nm(this,"_ttfb",0),Nm(this,"_demuxStart",0),Nm(this,"_demuxEnd",0),Nm(this,"_demuxCost",0),Nm(this,"_remuxStart",0),Nm(this,"_remuxEnd",0),Nm(this,"_remuxCost",0),Nm(this,"_appendStart",0),Nm(this,"_appendEnd",0),Nm(this,"_appendCost",0)}return Fm(e,[{key:"set",value:function(e,t){this["_".concat(e)]=t}},{key:"start",value:function(e){this["_".concat(e,"Start")]=lS()}},{key:"end",value:function(e){this["_".concat(e,"End")]=lS(),this["_".concat(e,"Cost")]=this["_".concat(e,"Cost")]+(this["_".concat(e,"End")]-this["_".concat(e,"Start")])}},{key:"transferCost",get:function(){return{ttfbCost:this._ttfb,demuxCost:this._demuxCost,remuxCost:this._remuxCost,appendCost:this._appendCost}}}]),e}(),wj="ttfb",kj="demux",Sj="remux",xj="append",Ej=new AP("BufferService"),Tj=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};jm(this,e),Nm(this,"flv",null),Nm(this,"_demuxer",new JI),Nm(this,"_remuxer",null),Nm(this,"_mse",null),Nm(this,"_softVideo",null),Nm(this,"_sourceCreated",!1),Nm(this,"_needInitSegment",!0),Nm(this,"_discontinuity",!0),Nm(this,"_contiguous",!1),Nm(this,"_initSegmentId",""),Nm(this,"_cachedBuffer",null),Nm(this,"_demuxStartTime",0),Nm(this,"_opts",null),this.flv=t,this._opts=n,r?this._softVideo=r:(this._remuxer=new _j(this._demuxer.videoTrack,this._demuxer.audioTrack),this._mse=new FP(null,{preferMMS:"boolean"==typeof n.preferMMS?n.preferMMS:!!n.perferMMS}),this._mse.bindMedia(t.media))}var t,r,n,i,a,o;return Fm(e,[{key:"baseDts",get:function(){var e,t;return null===(e=this._demuxer)||void 0===e||null===(t=e._fixer)||void 0===t?void 0:t._baseDts}},{key:"blobUrl",get:function(){var e;return null===(e=this._mse)||void 0===e?void 0:e.url}},{key:"isFull",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:FP.VIDEO;return this._mse.isFull(e)}},{key:"seamlessSwitch",value:function(){this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!0,this._initSegmentId=""}},{key:"unContiguous",value:function(e){this._contiguous=!1,this._demuxStartTime=e}},{key:"reset",value:(o=Im(Dm().mark((function e(){var t,r=arguments;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0],!this._mse||t){e.next=6;break}return e.next=4,this._mse.unbindMedia();case 4:return e.next=6,this._mse.bindMedia(this.flv.media);case 6:this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!1,this._sourceCreated=!1,this._initSegmentId="",this.resetSeamlessSwitchStats();case 12:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"resetSeamlessSwitchStats",value:function(){this.seamlessLoadingSwitch=null,this.seamlessLoadingSwitching=!1,this._demuxer&&(this._demuxer.seamlessLoadingSwitching=!1)}},{key:"endOfStream",value:(a=Im(Dm().mark((function e(){return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(!this._sourceCreated){e.next=5;break}return e.next=4,this._mse.endOfStream();case 4:this.flv.emit(cR);case 5:e.next=8;break;case 7:this._softVideo&&this._softVideo.endOfStream();case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateDuration",value:(i=Im(Dm().mark((function e(t){return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(this._mse.isOpened){e.next=4;break}return e.next=4,this._mse.open();case 4:return Ej.debug("update duration",t),e.next=7,this._mse.updateDuration(t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"destroy",value:(n=Im(Dm().mark((function e(){return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=3;break}return e.next=3,this._mse.unbindMedia();case 3:this._mse=null,this._softVideo=null,this._demuxer=null,this._remuxer=null;case 7:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"appendBuffer",value:(r=Im(Dm().mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,_=this;return Dm().wrap((function(e){for(var b,w,k,S,x,E;;)switch(e.prev=e.next){case 0:if(r=!1,this._cachedBuffer&&(t=DR(this._cachedBuffer,t),this._cachedBuffer=null),n=this._demuxer,t&&t.length&&n){e.next=5;break}return e.abrupt("return");case 5:e.prev=5,this.flv._transferCost.start(kj),n.demuxAndFix(t,this.seamlessLoadingSwitching||this._discontinuity,this._contiguous,this._demuxStartTime,this.seamlessLoadingSwitching),this.seamlessLoadingSwitching=!1,this.flv._transferCost.end(kj),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(5),new wP(dP,_P.FLV,e.t0);case 15:if(i=n.videoTrack,a=n.audioTrack,o=n.metadataTrack,!this.seamlessLoadingSwitch){e.next=25;break}if(!((s=jS(b=i.samples).call(b,(function(e){return e.originDts===i.lastKeyFrameDts})))>=0)){e.next=25;break}return j_(w=i.samples).call(w,s),e.next=22,this.seamlessLoadingSwitch();case 22:this.seamlessLoadingSwitch=null,t=null,r=!0;case 25:if(u=i.exist(),c=a.exist(),this._opts.onlyAudio&&(u=!1,i.present=!1),this._opts.onlyVideo&&(c=!1,a.present=!1),!(!u&&i.present||!c&&a.present)){e.next=42;break}if(l=0,(f=u?i:c?a:void 0)&&f.samples.length&&(l=(f.samples[f.samples.length-1].originPts-f.samples[0].originPts)/f.timescale*1e3),!(l>this._opts.analyzeDuration)){e.next=40;break}Ej.warn("analyze duration exceeded, ".concat(l,"ms"),f),i.present=u,a.present=c,this.flv.emit(oR,{duration:l}),e.next=42;break;case 40:return this._cachedBuffer=t,e.abrupt("return");case 42:if(h=i.type,d=a.type,this._fireEvents(i,a,o),r||(this._discontinuity=!1,this._contiguous=!0,this._demuxStartTime=0),p=this._mse,v=function(){var e,t;null!==(e=_.flv)&&void 0!==e&&e.emit&&(null===(t=_.flv)||void 0===t||t.emit(sR,{}))},this.flv.emit(_R,{videoTrack:i}),(y=oh(k=oh(S=oh(x=oh(E="".concat(i.codec,"/")).call(E,i.width,"/")).call(x,i.height,"/")).call(S,a.codec,"/")).call(k,a.config))!==this._initSegmentId&&(this._needInitSegment=!0,this._initSegmentId=y,this._emitMetaParsedEvent(i,a)),!p){e.next=81;break}if(this._sourceCreated){e.next=59;break}return e.next=55,p.open();case 55:u&&(Ej.log("codec: video/mp4;codecs=".concat(i.codec)),p.createSource(h,"video/mp4;codecs=".concat(i.codec))),c&&(Ej.log("codec: audio/mp4;codecs=".concat(a.codec)),p.createSource(d,"audio/mp4;codecs=".concat(a.codec))),this._sourceCreated=!0,this.flv.emit(aR);case 59:e.prev=59,this._needInitSegment&&!this._opts.mseLowLatency&&(i.duration=this._opts.durationForMSELowLatencyOff*i.timescale,a.duration=this._opts.durationForMSELowLatencyOff*c.timescale),this.flv._transferCost.start(Sj),g=this._remuxer.remux(this._needInitSegment),this.flv._transferCost.end(Sj),e.next=69;break;case 66:throw e.prev=66,e.t1=e.catch(59),new wP(pP,_P.FMP4,e.t1);case 69:if(!this._needInitSegment||g.videoInitSegment||g.audioInitSegment){e.next=71;break}return e.abrupt("return");case 71:return this._needInitSegment=!1,m=[],g.videoInitSegment&&m.push(p.append(h,g.videoInitSegment)),g.audioInitSegment&&m.push(p.append(d,g.audioInitSegment)),g.videoSegment&&m.push(p.append(h,g.videoSegment)),g.audioSegment&&m.push(p.append(d,g.audioSegment)),this.flv._transferCost.start(xj),e.abrupt("return",$g.all(m).then(v).then((function(){_.flv._transferCost.end(xj),v()})));case 81:this._softVideo&&(this._softVideo.appendBuffer(i,a),v());case 82:case"end":return e.stop()}}),e,this,[[5,12],[59,66]])}))),function(e){return r.apply(this,arguments)})},{key:"evictBuffer",value:(t=Im(Dm().mark((function e(t){var r,n,i,a=this;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.flv.media,this._mse&&this._demuxer&&r&&t&&!(t<0)){e.next=3;break}return e.abrupt("return");case 3:if(n=r.currentTime,!((i=n-t)<=0)){e.next=7;break}return e.abrupt("return");case 7:if(!(oP.start(oP.get(r))+1>=i)){e.next=10;break}return e.abrupt("return");case 10:return e.abrupt("return",this._mse.clearBuffer(0,i).then((function(){return a.flv.emit(uR,{removeEnd:i})})));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_emitMetaParsedEvent",value:function(e,t){e.exist()&&this.flv.emit(hR,{type:"video",track:e,meta:{codec:e.codec,timescale:e.timescale,width:e.width,height:e.height,sarRatio:e.sarRatio,baseDts:e.baseDts}}),t.exist()&&this.flv.emit(hR,{type:"audio",track:t,meta:{codec:t.codec,channelCount:t.channelCount,sampleRate:t.sampleRate,timescale:t.timescale,baseDts:t.baseDts}}),Ej.debug("track parsed",e,t)}},{key:"_fireEvents",value:function(e,t,r){var n,i,a,o,s,u,c=this;Ej.debug(oh(n="videoTrack samples count: ".concat(e.samples.length,", audioTrack samples count: ")).call(n,t.samples.length)),Ch(i=r.flvScriptSamples).call(i,(function(e){c.flv.emit(vR,e),Ej.debug("flvScriptData",e)})),Ch(a=e.samples).call(a,(function(e){e.keyframe&&c.flv.emit(lR,{pts:e.originPts})})),Ch(o=e.warnings).call(o,(function(e){var t;switch(e.type){case ZM:t=wR;break;case eI:t=kR;break;case tI:t=TR}t&&c.flv.emit(bR,Rm(Rm({},e),{},{type:t})),Ej.warn("video exception",e)})),Ch(s=t.warnings).call(s,(function(e){var t;switch(e.type){case rI:t=SR;break;case nI:t=xR;break;case iI:t=ER}t&&c.flv.emit(bR,Rm(Rm({},e),{},{type:t})),Ej.warn("audio exception",e)})),Ch(u=r.seiSamples).call(u,(function(e){c.flv.emit(dR,Rm(Rm({},e),{},{sei:{code:e.data.type,content:e.data.payload,dts:e.pts}}))}))}}]),e}();function Aj(e,t){var r=0,n=e.length-1,i=0,a=0,o=n;for(t<e[0]&&(r=0,a=o+1);a<=o;){if((i=a+Math.floor((o-a)/2))===n||t>=e[i]&&t<e[i+1]){r=i;break}e[i]<t?a=i+1:o=i-1}return r}var Lj=new AP("flv"),Cj=.1,Oj=function(e){zm(c,e);var t,r,n,i,a,o,s,u=qm(c);function c(e){var t,r;return jm(this,c),Nm(Hm(t=u.call(this)),"media",null),Nm(Hm(t),"_loading",!1),Nm(Hm(t),"_opts",null),Nm(Hm(t),"_bufferService",null),Nm(Hm(t),"_gapService",null),Nm(Hm(t),"_stats",null),Nm(Hm(t),"_mediaLoader",null),Nm(Hm(t),"_maxChunkWaitTimer",null),Nm(Hm(t),"_tickTimer",null),Nm(Hm(t),"_tickInterval",500),Nm(Hm(t),"_urlSwitching",!1),Nm(Hm(t),"_seamlessSwitching",!1),Nm(Hm(t),"_disconnectRetryCount",0),Nm(Hm(t),"_preLoadEndPoint",0),Nm(Hm(t),"_keyframes",null),Nm(Hm(t),"_acceptRanges",!0),Nm(Hm(t),"_onProgress",function(){var e=Im(Dm().mark((function e(r,n,i,a){var o,s,u,c,l,f,h,d,p,v;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.startTime,s=i.endTime,u=i.st,c=i.firstByteTime,t._loading=!n,t._firstProgressEmit){e.next=13;break}if(t.media){e.next=6;break}return null===(l=t._mediaLoader)||void 0===l||l.cancel(),e.abrupt("return");case 6:f=a.headers,h=u?c-u:s-o,t.emit(eR,{url:t._opts.url,responseUrl:a.url,elapsed:h}),t.emit(rR,{headers:f}),t._transferCost.set(wj,h),t._acceptRanges=!(null==f||!f.get("Accept-Ranges"))||!(null==f||!f.get("Content-Range")),t._firstProgressEmit=!0;case 13:if(t._bufferService){e.next=15;break}return e.abrupt("return");case 15:return clearTimeout(t._maxChunkWaitTimer),t._bandwidthService.addChunkRecord(null==r?void 0:r.byteLength,s-o),e.prev=17,e.next=20,t._bufferService.appendBuffer(r);case 20:null===(d=t._bufferService)||void 0===d||d.evictBuffer(t._opts.bufferBehind),e.next=33;break;case 23:if(e.prev=23,e.t0=e.catch(17),t.isLive||!t._bufferService.isFull()){e.next=32;break}return e.next=28,t._mediaLoader.cancel();case 28:return t._loading=!1,p=t.bufferInfo().remaining,t._opts.preloadTime=ob(p)/2,e.abrupt("return");case 32:return e.abrupt("return",t._emitError(wP.create(e.t0)));case 33:if(t._urlSwitching&&(t._urlSwitching=!1,t.emit(gR,{url:t._opts.url})),t._seamlessSwitching&&(t._seamlessSwitching=!1,t._tick()),!n||t.media.seeking){e.next=40;break}return t.emit(nR),Lj.debug("load done"),t.isLive&&t._disconnectRetryCount<=0&&t._end(),e.abrupt("return");case 40:if(t.isLive){e.next=42;break}return e.abrupt("return");case 42:(v=t._opts.maxReaderInterval)&&t._firstProgressEmit&&(clearTimeout(t._maxChunkWaitTimer),t._maxChunkWaitTimer=Qw((function(){if(t._disconnectRetryCount)return t._disconnectRetryCount--,void t.load();Lj.debug("onMaxChunkWait",v),t._end()}),v));case 44:case"end":return e.stop()}}),e,null,[[17,23]])})));return function(t,r,n,i){return e.apply(this,arguments)}}()),Nm(Hm(t),"_onRetryError",(function(e,r){Lj.debug("load retry",e,r),t.emit(iR,{error:wP.network(e),retryTime:r})})),Nm(Hm(t),"_end",(function(){t._clear(),t._bufferService&&t._bufferService.endOfStream(),Lj.debug("end stream")})),Nm(Hm(t),"_resetDisconnectCount",(function(){t._disconnectRetryCount=t._opts.disconnectRetryCount})),Nm(Hm(t),"_tick",(function(){clearTimeout(t._tickTimer);var e=Hm(t).media;if(e){t._tickTimer=Qw(t._tick,t._tickInterval);var r=oP.end(oP.get(e));if(!(r<Cj)&&e.readyState){var n=t._opts;if(function(e){return e&&!e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState}(e)&&e.currentTime)t._gapService&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3);else{if(!e.currentTime&&t._gapService&&n.enableStartGapJump)return void((t._opts.mseLowLatency||!1===t._opts.mseLowLatency&&t.bufferInfo(.3).nextStart)&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3));n.isLive&&4===e.readyState&&r-e.currentTime>n.disconnectTime&&t.disconnect()}}}})),Nm(Hm(t),"_onPlay",(function(){var e,r,n=t._opts.softDecode||(null===(e=t.media)||void 0===e||null===(r=e.buffered)||void 0===r?void 0:r.length);if(t.isLive)!t._loading&&n&&t.replay(void 0,!0);else{var i=t.bufferInfo();(i.start||i.nextStart)>Cj&&t._tick()}})),Nm(Hm(t),"_onLoadeddata",(function(){t.isLive&&!t._opts.mseLowLatency&&t.media.duration!==1/0&&t._bufferService.updateDuration(1/0).catch((function(e){}))})),Nm(Hm(t),"_onSeeking",Im(Dm().mark((function e(){return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!t.isLive&&t.seekable&&(t._preLoadEndPoint=-1,t._checkPreload());case 1:case"end":return e.stop()}}),e)})))),Nm(Hm(t),"_onTimeupdate",(function(){if(t.media){var e=t._opts,r=t.media.currentTime;if(e.isLive&&e.maxLatency&&e.targetLatency){var n=oP.end(oP.get(t.media));n-r>=e.maxLatency&&(t.media.currentTime=n-e.targetLatency,t.emit(fR,{currentTime:t.media.currentTime,latency:e.targetLatency}))}t._seiService.throw(r,!0),e.isLive||!t.seekable||t._loading||t._checkPreload()}})),Nm(Hm(t),"_onWaiting",(function(){t.isLive&&!t._loading&&t._disconnectRetryCount&&(t._disconnectRetryCount--,t.load())})),Nm(Hm(t),"_onBufferUpdate",(function(){if(!t._opts.isLive){var e=t.bufferInfo(),r=e.end,n=e.nextEnd;Math.abs((r||n)-t.media.duration)<1&&(t._end(),t.media.readyState<=2&&t._tick())}})),Nm(Hm(t),"_checkPreload",Im(Dm().mark((function e(){var r,n,i,a,o,s,u,c,l,f;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.bufferInfo(),n=r.remaining,i=void 0===n?0:n,a=t._opts,o=t._keyframes.filepositions,s=t._keyframes.times,u=t.media.currentTime,!(i<a.preloadTime)){e.next=19;break}if(c=Aj(t._keyframes.times,u+i+Cj),(l=Aj(t._keyframes.times,u+i+t._opts.preloadTime))===c&&(l=c+1),t._preLoadEndPoint!==l){e.next=11;break}return e.abrupt("return");case 11:if(null!=(f=o[c])){e.next=14;break}return e.abrupt("return");case 14:return e.next=16,t._mediaLoader.cancel();case 16:t._loadData(null,[f,o[l]]),t._preLoadEndPoint=l,t._bufferService.unContiguous(s[c]);case 19:case"end":return e.stop()}}),e)})))),Nm(Hm(t),"_onFlvScriptData",(function(e){var r,n,i,a,o=null===(r=e.data)||void 0===r||null===(n=r.onMetaData)||void 0===n?void 0:n.keyframes,s=null===(i=e.data)||void 0===i||null===(a=i.onMetaData)||void 0===a?void 0:a.duration;o&&(t._keyframes=o),!t._opts.isLive&&s&&t._bufferService.updateDuration(s)})),t._opts=((r=Rm({retryCount:3,retryDelay:1e3,disconnectRetryCount:0,loadTimeout:1e4,maxReaderInterval:5e3,preloadTime:5,defaultVodLoadSize:1e7,isLive:!1,softDecode:!1,bufferBehind:10,maxJumpDistance:3,analyzeDuration:2e4,seamlesslyReload:!1,keepStatusAfterSwitch:!0,onlyVideo:!1,onlyAudio:!1,preferMMS:!1,mseLowLatency:!0,durationForMSELowLatencyOff:6,chunkCountForSpeed:50,skipChunkSize:1e3,longtimeNoReceived:3e3,enableStartGapJump:!0},e)).isLive&&r.preloadTime&&(r.maxLatency||(r.maxLatency=2*r.preloadTime),r.targetLatency||(r.targetLatency=r.preloadTime),null!==r.disconnectTime&&void 0!==r.disconnectTime||(r.disconnectTime=r.maxLatency)),r),t.media=t._opts.media||document.createElement("video"),t._opts.media=null,t._firstProgressEmit=!1,t._mediaLoader=new MR(Rm(Rm({},t._opts.fetchOptions),{},{retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onRetryError,onProgress:t._onProgress,responseType:"arraybuffer"})),t._disconnectRetryCount=t._opts.disconnectRetryCount,t._transferCost=new bj,t._bufferService=new Tj(Hm(t),t._opts.softDecode?t.media:void 0,t._opts),t._seiService=new EM(Hm(t)),t._bandwidthService=new TM({chunkCountForSpeed:t._opts.chunkCountForSpeed,skipChunkSize:t._opts.skipChunkSize,longtimeNoReceived:t._opts.longtimeNoReceived}),t._stats=new LM(Hm(t)),t._opts.softDecode||(t._gapService=new IR),t.media.addEventListener("play",t._onPlay),t.media.addEventListener("loadeddata",t._onLoadeddata),t.media.addEventListener("seeking",t._onSeeking),t.media.addEventListener("timeupdate",t._onTimeupdate),t.media.addEventListener("progress",t._onBufferUpdate),t.media.addEventListener("waiting",t._onWaiting),t.on(vR,t._onFlvScriptData),t}return Fm(c,[{key:"version",get:function(){return"3.0.21-rc.5"}},{key:"isLive",get:function(){return this._opts.isLive}},{key:"baseDts",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.baseDts}},{key:"seekable",get:function(){return!!this._keyframes&&this._acceptRanges}},{key:"loader",get:function(){return this._mediaLoader}},{key:"blobUrl",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.blobUrl}},{key:"speedInfo",value:function(){return{speed:this._bandwidthService.getLatestSpeed(),avgSpeed:this._bandwidthService.getAvgSpeed(),totalSize:this._bandwidthService.getTotalSize(),totalCost:this._bandwidthService.getTotalCost()}}},{key:"getStats",value:function(){return this._stats.getStats()}},{key:"bufferInfo",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cj;return oP.info(oP.get(this.media),null===(e=this.media)||void 0===e?void 0:e.currentTime,t)}},{key:"playbackQuality",value:function(){return function(e){if(!e)return{};if("function"==typeof e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();return{droppedVideoFrames:t.droppedVideoFrames||t.corruptedVideoFrames,totalVideoFrames:t.totalVideoFrames,creationTime:t.creationTime}}return{droppedVideoFrames:e.webkitDroppedFrameCount,totalVideoFrames:e.webkitDecodedFrameCount,creationTime:performance.now()}}(this.media)}},{key:"load",value:(s=Im(Dm().mark((function e(t){var r,n=arguments;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>1&&void 0!==n[1]&&n[1],this._bufferService){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this._reset(r);case 5:this._loadData(t,this._opts.isLive?[]:[0,this._opts.defaultVodLoadSize]),clearTimeout(this._tickTimer),this._tickTimer=Qw(this._tick,this._tickInterval);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"replay",value:(o=Im(Dm().mark((function e(){var t,r,n=this,i=arguments;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:this._opts.seamlesslyReload,r=i.length>1?i[1]:void 0,this.media){e.next=4;break}return e.abrupt("return");case 4:if(this._resetDisconnectCount(),!t){e.next=11;break}return e.next=8,this._clear();case 8:Qw((function(){n._seamlessSwitching=!0,n._loadData(n._opts.url),n._bufferService.seamlessSwitch()})),e.next=13;break;case 11:return e.next=13,this.load();case 13:return e.abrupt("return",this.media.play(!r).catch((function(){})));case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"disconnect",value:function(){var e;return Lj.debug("disconnect!"),null===(e=this._bufferService)||void 0===e||e.resetSeamlessSwitchStats(),this._clear()}},{key:"switchURL",value:(a=Im(Dm().mark((function e(t,r){var n=this;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._bufferService){e.next=2;break}return e.abrupt("return");case 2:if(this._resetDisconnectCount(),!this._loading||!r){e.next=6;break}return this._bufferService.seamlessLoadingSwitch=function(){var e=Im(Dm().mark((function e(r){return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._clear();case 2:n._bufferService.seamlessLoadingSwitching=!0,n._urlSwitching=!0,n._seamlessSwitching=!0,n._bufferService.seamlessSwitch(),n._loadData(t);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return");case 6:if(r&&this._opts.isLive){e.next=11;break}return e.next=9,this.load(t);case 9:return this._urlSwitching=!0,e.abrupt("return",this.media.play(!0).catch((function(){})));case 11:return e.next=13,this._clear();case 13:Qw((function(){n._urlSwitching=!0,n._seamlessSwitching=!0,n._loadData(t),n._bufferService.seamlessSwitch()}));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"destroy",value:(i=Im(Dm().mark((function e(){return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.media){e.next=2;break}return e.abrupt("return");case 2:return this.removeAllListeners(),this._seiService.reset(),this.media.removeEventListener("play",this._onPlay),this.media.removeEventListener("loadeddata",this._onLoadeddata),this.media.removeEventListener("seeking",this._onSeeking),this.media.removeEventListener("timeupdate",this._onTimeupdate),this.media.removeEventListener("waiting",this._onWaiting),this.media.removeEventListener("progress",this._onBufferUpdate),e.next=12,$g.all([this._clear(),this._bufferService.destroy()]);case 12:this.media=null,this._bufferService=null;case 14:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"_emitError",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Lj.table(e),Lj.error(e),Lj.error(null===(t=this.media)||void 0===t?void 0:t.error),this._urlSwitching&&(this._urlSwitching=!1,this._seamlessSwitching=!1,this.emit(mR,e)),this.emit(ZP,e),r&&(this._seiService.reset(),this._end())}},{key:"_reset",value:(n=Im(Dm().mark((function e(){var t,r=arguments;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],this._seiService.reset(),this._bandwidthService.reset(),this._stats.reset(),e.next=6,this._clear();case 6:return e.next=8,this._bufferService.reset(t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_loadData",value:(r=Im(Dm().mark((function e(t,r){var n;return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&(this._opts.url=t),n=t=this._opts.url,t){e.next=4;break}throw new Error("Source url is missing");case 4:if(this._opts.preProcessUrl&&(n=this._opts.preProcessUrl(t).url),this._mediaLoader.finnalUrl=n,this.emit(tR,{url:n,seamlessSwitching:this._seamlessSwitching}),Lj.debug("load data, loading:",this._loading,n),!this._loading){e.next=11;break}return e.next=11,this._mediaLoader.cancel();case 11:return this._loading=!0,e.prev=12,e.next=15,this._mediaLoader.load({url:n,range:r});case 15:e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(12),this._loading=!1,e.abrupt("return",this._emitError(wP.network(e.t0),!1));case 21:case"end":return e.stop()}}),e,this,[[12,17]])}))),function(e,t){return r.apply(this,arguments)})},{key:"_clear",value:(t=Im(Dm().mark((function e(){return Dm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mediaLoader){e.next=3;break}return e.next=3,this._mediaLoader.cancel();case 3:clearTimeout(this._maxChunkWaitTimer),clearTimeout(this._tickTimer),this._loading=!1,this._firstProgressEmit=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"isSupported",value:function(e){return e&&"video"!==e&&"audio"!==e?"undefined"!=typeof WebAssembly:FP.isSupported()}},{key:"enableLogger",value:function(){AP.enable(),vI.enable()}},{key:"disableLogger",value:function(){AP.disable(),vI.disable()}}]),c}(iw);try{localStorage.getItem("xgd")?Oj.enableLogger():Oj.disableLogger()}catch(Vj){}var Pj=function(){function e(t,r){var n=this;jm(this,e),Nm(this,"_onLowDecode",(function(){var e,t,r,i,a=n._opts,o=a.media,s=a.innerDegrade,u=a.backupURL;null===(e=n._plugin)||void 0===e||null===(t=e.player)||void 0===t||t.emit("lowdecode",o.degradeInfo),null===(r=n._plugin)||void 0===r||null===(i=r.player)||void 0===i||i.emit("core_event",Rm(Rm({},o.degradeInfo),{},{eventName:yR})),1!==s&&3!==s||!u||n._degrade(u)})),Nm(this,"_degrade",(function(e){var t=n._plugin.player,r=t.video;if("MVideo"===(null==r?void 0:r.TAG)){var i=t.video.degradeVideo;t.video=i,r.degrade(e),e&&(t.config.url=e);var a=t.root.firstChild;"MVideo"===a.TAG&&t.root.replaceChild(i,a);var o=n._plugin.constructor.pluginName.toLowerCase();t.unRegisterPlugin(o),t.once("canplay",(function(){t.play()}))}})),Nm(this,"forceDegradeToVideo",(function(e){var t=n._opts.innerDegrade;1!==t&&3!==t||n._degrade(e)})),this._opts=t,this._plugin=r,this._init()}return Fm(e,[{key:"_init",value:function(){var e=this._opts,t=e.media,r=e.isLive,n=e.preloadTime,i=e.innerDegrade,a=e.decodeMode;t&&(r||!t.setPlayMode?(i&&t.setAttribute("innerdegrade",i),n&&t.setAttribute("preloadtime",n),t.setDecodeMode&&t.setDecodeMode(a),this._bindEvents()):t.setPlayMode("VOD"))}},{key:"_bindEvents",value:function(){this._opts.media.addEventListener("lowdecode",this._onLowDecode)}},{key:"destroy",value:function(){var e,t;null===(e=this._opts)||void 0===e||null===(t=e.media)||void 0===t||t.removeEventListener("lowdecode",this._onLowDecode),this._plugin=null}}]),e}(),Rj=function(e){zm(r,e);var t=qm(r);function r(){var e,n;jm(this,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Nm(Hm(n=t.call.apply(t,oh(e=[this]).call(e,a))),"logger",Lj),Nm(Hm(n),"flv",null),Nm(Hm(n),"pluginExtension",null),Nm(Hm(n),"getStats",(function(){var e;return null===(e=n.flv)||void 0===e?void 0:e.getStats()})),Nm(Hm(n),"destroy",(function(){var e;n.flv&&(n.flv.destroy(),n.flv=null),null===(e=n.pluginExtension)||void 0===e||e.destroy(),n.pluginExtension=null})),Nm(Hm(n),"_onSwitchURL",(function(e,t){var r,i;n.flv&&(n.player.config.url=e,"object"===Um(t)&&(t=t.seamless),n.flv.switchURL(e,t),!t&&null!==(r=n.player.config)&&void 0!==r&&null!==(i=r.flv)&&void 0!==i&&i.keepStatusAfterSwitch&&n._keepPauseStatus())})),Nm(Hm(n),"_keepPauseStatus",(function(){n.player.paused&&n.player.once("canplay",(function(){n.player.pause()}))})),Nm(Hm(n),"_onDefinitionChange",(function(e){var t=e.to;n.flv&&n.flv.switchURL(t)})),n}return Fm(r,[{key:"core",get:function(){return this.flv}},{key:"version",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.version}},{key:"softDecode",get:function(){var e,t,r=null===(e=this.player)||void 0===e||null===(t=e.config)||void 0===t?void 0:t.mediaType;return!!r&&"video"!==r&&"audio"!==r}},{key:"loader",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.loader}},{key:"transferCost",get:function(){return this.flv._transferCost.transferCost}},{key:"beforePlayerInit",value:function(){var e=this,t=this.player.config,r=this.player.media||this.player.video;if(t.url){this.flv&&this.flv.destroy(),this.player.switchURL=this._onSwitchURL;var n,i=t.flv||{};if(null!==i.disconnectTime&&void 0!==i.disconnectTime||(i.disconnectTime=0),this.flv=new Oj(Rm({softDecode:this.softDecode,isLive:t.isLive,media:r,preProcessUrl:function(t,r){var n,i;return(null===(n=e.player)||void 0===n||null===(i=n.preProcessUrl)||void 0===i?void 0:i.call(n,t,r))||{url:t,ext:r}}},i)),this.softDecode||LS.defineGetterOrSetter(this.player,{url:{get:function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.blobUrl},configurable:!0}}),this.softDecode&&(this.pluginExtension=new Pj(Rm({media:this.player.video,isLive:t.isLive},t.flv),this),this.player.forceDegradeToVideo=function(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return null===(t=e.pluginExtension)||void 0===t?void 0:t.forceDegradeToVideo.apply(t,n)}),t.isLive)null===(n=this.player)||void 0===n||n.useHooks("replay",(function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.replay()}));this.on("urlchange",this._onSwitchURL),this.on("destroy",this.destroy),this._transError(),this._transCoreEvent(eR),this._transCoreEvent(tR),this._transCoreEvent(rR),this._transCoreEvent(nR),this._transCoreEvent(iR),this._transCoreEvent(aR),this._transCoreEvent(oR),this._transCoreEvent(sR),this._transCoreEvent(uR),this._transCoreEvent(cR),this._transCoreEvent(lR),this._transCoreEvent(fR),this._transCoreEvent(hR),this._transCoreEvent(dR),this._transCoreEvent(pR),this._transCoreEvent(vR),this._transCoreEvent(bR),this._transCoreEvent(gR),this._transCoreEvent(mR),this.flv.load(t.url,!0)}}},{key:"_transError",value:function(){var e=this;this.flv.on(ZP,(function(t){e.player&&e.player.emit("error",new wS(e.player,t))}))}},{key:"_transCoreEvent",value:function(e){var t=this;this.flv.on(e,(function(r){t.player&&t.player.emit("core_event",Rm(Rm({},r),{},{eventName:e}))}))}}],[{key:"pluginName",get:function(){return"flv"}},{key:"isSupported",value:function(e,t){return Oj.isSupported(e,t)}},{key:"isSupportedMMS",value:function(){return"undefined"!=typeof ManagedMediaSource}}]),r}(LS);function Dj(e,t,r){return t=jj(t),function(e,t){if(t&&("object"===Ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Uj()?Cm(t,r||[],jj(e).constructor):t.apply(e,r))}function Uj(){try{var e=!Boolean.prototype.valueOf.call(Cm(Boolean,[],(function(){})))}catch(t){}return(Uj=function(){return!!e})()}function Mj(e){var t=function(e,t){if("object"!=Ol(e)||!e)return e;var r=e[Om];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ol(t)?t:String(t)}function Ij(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),Yh(e,Mj(n.key),n)}}function jj(e){var t;return(jj=$h?Lm(t=Xh).call(t):function(e){return e.__proto__||Xh(e)})(e)}function Bj(e,t){var r;return(Bj=$h?Lm(r=$h).call(r):function(e,t){return e.__proto__=t,e})(e,t)}Nm(Rj,"Flv",Oj);var Fj=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Dj(this,t,arguments)}var r,n,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Qh(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Yh(e,"prototype",{writable:!1}),t&&Bj(e,t)}(t,e),r=t,i=[{key:"pluginName",get:function(){return"adaptive"}},{key:"defaultConfig",get:function(){return{hurryEndMs:1800,hurryStartMs:2500,hurrySpeed:1.1}}}],(n=[{key:"afterCreate",value:function(){var e;this.on("timeupdate",Lm(e=this.onTimeUpdate).call(e,this))}},{key:"onTimeUpdate",value:function(){var e=this.bufferLength;this.speed===this.config.hurrySpeed?e<=this.config.hurryEndMs&&(this.speed=1):1===this.speed&&e>=this.config.hurryStartMs&&(this.speed=this.config.hurrySpeed)}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,r=e[1]-Math.max(e[0],t);return r=Math.round(1e3*Math.max(0,r))}},{key:"speed",get:function(){return this.player.playbackRate},set:function(e){this.speed!==e&&(this.player.playbackRate=e)}}])&&Ij(r.prototype,n),i&&Ij(r,i),Yh(r,"prototype",{writable:!1}),t}(LS),Nj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Df(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Ir(e,"prototype",{writable:!1}),t&&Uf(e,t)}(a,e);var t,r,n,i=th(a);function a(){var e,t,r,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return t=i.call.apply(i,oh(e=[this]).call(e,u)),r=Ml(t),o=void 0,(n=Dl(n="_originSwitchURL"))in r?Ir(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,t}return t=a,(r=[{key:"beforePlayerInit",value:function(){var e=this;this._originSwitchURL=this.player.switchURL;var t=this.destroy;this.destroy=function(){e.player.switchURL=e._originSwitchURL,t()},Of(Cf(a.prototype),"beforePlayerInit",this).call(this)}}])&&Ul(t.prototype,r),n&&Ul(t,n),Ir(t,"prototype",{writable:!1}),a}(Rj),zj=window.VePlayer.DynamicModule;VePlayer.registerPlugin(zj.PluginFlv,{FlvPlugin:Nj,Adaptive:Fj}),e.Adaptive=Fj,e.FlvPlugin=Nj}));