xgplayer-mp4 3.0.0-next.1 → 3.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xgplayer")):"function"==typeof define&&define.amd?define(["xgplayer"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).MP4Player=t(e.Player)}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(e){return e&&e.Math==Math&&e},n=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")(),i={},o=function(e){try{return!!e()}catch(e){return!0}},a=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={},s={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,f=c&&!s.call({1:2},1);u.f=f?function(e){var t=c(this,e);return!!t&&t.enumerable}:s;var l,h,d=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},p={}.toString,v=function(e){return p.call(e).slice(8,-1)},y=v,m="".split,g=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==y(e)?m.call(e,""):Object(e)}:Object,b=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},w=g,x=b,k=function(e){return w(x(e))},S=function(e){return"object"==typeof e?null!==e:"function"==typeof e},_=n,T=function(e){return"function"==typeof e?e:void 0},O=function(e,t){return arguments.length<2?T(_[e]):_[e]&&_[e][t]},A=O("navigator","userAgent")||"",E=n,R=A,P=E.process,j=E.Deno,I=P&&P.versions||j&&j.version,L=I&&I.v8;L?h=(l=L.split("."))[0]<4?1:l[0]+l[1]:R&&(!(l=R.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=R.match(/Chrome\/(\d+)/))&&(h=l[1]);var C=h&&+h,M=C,D=o,U=!!Object.getOwnPropertySymbols&&!D((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&M&&M<41})),B=U&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,N=O,F=B?function(e){return"symbol"==typeof e}:function(e){var t=N("Symbol");return"function"==typeof t&&Object(e)instanceof t},q=S,z={exports:{}},V=n,H=function(e,t){try{Object.defineProperty(V,e,{value:t,configurable:!0,writable:!0})}catch(r){V[e]=t}return t},Y=H,G="__core-js_shared__",$=n[G]||Y(G,{}),W=$;(z.exports=function(e,t){return W[e]||(W[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.16.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Q=b,K=function(e){return Object(Q(e))},X=K,J={}.hasOwnProperty,Z=Object.hasOwn||function(e,t){return J.call(X(e),t)},ee=0,te=Math.random(),re=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++ee+te).toString(36)},ne=n,ie=z.exports,oe=Z,ae=re,ue=U,se=B,ce=ie("wks"),fe=ne.Symbol,le=se?fe:fe&&fe.withoutSetter||ae,he=function(e){return oe(ce,e)&&(ue||"string"==typeof ce[e])||(ue&&oe(fe,e)?ce[e]=fe[e]:ce[e]=le("Symbol."+e)),ce[e]},de=S,pe=F,ve=function(e,t){var r,n;if("string"===t&&"function"==typeof(r=e.toString)&&!q(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!q(n=r.call(e)))return n;if("string"!==t&&"function"==typeof(r=e.toString)&&!q(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},ye=he("toPrimitive"),me=function(e,t){if(!de(e)||pe(e))return e;var r,n=e[ye];if(void 0!==n){if(void 0===t&&(t="default"),r=n.call(e,t),!de(r)||pe(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),ve(e,t)},ge=me,be=F,we=function(e){var t=ge(e,"string");return be(t)?t:String(t)},xe=S,ke=n.document,Se=xe(ke)&&xe(ke.createElement),_e=function(e){return Se?ke.createElement(e):{}},Te=_e,Oe=!a&&!o((function(){return 7!=Object.defineProperty(Te("div"),"a",{get:function(){return 7}}).a})),Ae=a,Ee=u,Re=d,Pe=k,je=we,Ie=Z,Le=Oe,Ce=Object.getOwnPropertyDescriptor;i.f=Ae?Ce:function(e,t){if(e=Pe(e),t=je(t),Le)try{return Ce(e,t)}catch(e){}if(Ie(e,t))return Re(!Ee.f.call(e,t),e[t])};var Me={},De=S,Ue=function(e){if(!De(e))throw TypeError(String(e)+" is not an object");return e},Be=a,Ne=Oe,Fe=Ue,qe=we,ze=Object.defineProperty;Me.f=Be?ze:function(e,t,r){if(Fe(e),t=qe(t),Fe(r),Ne)try{return ze(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Ve=Me,He=d,Ye=a?function(e,t,r){return Ve.f(e,t,He(1,r))}:function(e,t,r){return e[t]=r,e},Ge={exports:{}},$e=$,We=Function.toString;"function"!=typeof $e.inspectSource&&($e.inspectSource=function(e){return We.call(e)});var Qe,Ke,Xe,Je=$e.inspectSource,Ze=Je,et=n.WeakMap,tt="function"==typeof et&&/native code/.test(Ze(et)),rt=z.exports,nt=re,it=rt("keys"),ot=function(e){return it[e]||(it[e]=nt(e))},at={},ut=tt,st=S,ct=Ye,ft=Z,lt=$,ht=ot,dt=at,pt="Object already initialized",vt=n.WeakMap;if(ut||lt.state){var yt=lt.state||(lt.state=new vt),mt=yt.get,gt=yt.has,bt=yt.set;Qe=function(e,t){if(gt.call(yt,e))throw new TypeError(pt);return t.facade=e,bt.call(yt,e,t),t},Ke=function(e){return mt.call(yt,e)||{}},Xe=function(e){return gt.call(yt,e)}}else{var wt=ht("state");dt[wt]=!0,Qe=function(e,t){if(ft(e,wt))throw new TypeError(pt);return t.facade=e,ct(e,wt,t),t},Ke=function(e){return ft(e,wt)?e[wt]:{}},Xe=function(e){return ft(e,wt)}}var xt={set:Qe,get:Ke,has:Xe,enforce:function(e){return Xe(e)?Ke(e):Qe(e,{})},getterFor:function(e){return function(t){var r;if(!st(t)||(r=Ke(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}},kt=n,St=Ye,_t=Z,Tt=H,Ot=Je,At=xt.get,Et=xt.enforce,Rt=String(String).split("String");(Ge.exports=function(e,t,r,n){var i,o=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof t||_t(r,"name")||St(r,"name",t),(i=Et(r)).source||(i.source=Rt.join("string"==typeof t?t:""))),e!==kt?(o?!u&&e[t]&&(a=!0):delete e[t],a?e[t]=r:St(e,t,r)):a?e[t]=r:Tt(t,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&At(this).source||Ot(this)}));var Pt={},jt=Math.ceil,It=Math.floor,Lt=function(e){return isNaN(e=+e)?0:(e>0?It:jt)(e)},Ct=Lt,Mt=Math.min,Dt=function(e){return e>0?Mt(Ct(e),9007199254740991):0},Ut=Lt,Bt=Math.max,Nt=Math.min,Ft=function(e,t){var r=Ut(e);return r<0?Bt(r+t,0):Nt(r,t)},qt=k,zt=Dt,Vt=Ft,Ht=function(e){return function(t,r,n){var i,o=qt(t),a=zt(o.length),u=Vt(n,a);if(e&&r!=r){for(;a>u;)if((i=o[u++])!=i)return!0}else for(;a>u;u++)if((e||u in o)&&o[u]===r)return e||u||0;return!e&&-1}},Yt={includes:Ht(!0),indexOf:Ht(!1)},Gt=Z,$t=k,Wt=Yt.indexOf,Qt=at,Kt=function(e,t){var r,n=$t(e),i=0,o=[];for(r in n)!Gt(Qt,r)&&Gt(n,r)&&o.push(r);for(;t.length>i;)Gt(n,r=t[i++])&&(~Wt(o,r)||o.push(r));return o},Xt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Jt=Kt,Zt=Xt.concat("length","prototype");Pt.f=Object.getOwnPropertyNames||function(e){return Jt(e,Zt)};var er={};er.f=Object.getOwnPropertySymbols;var tr,rr=Pt,nr=er,ir=Ue,or=O("Reflect","ownKeys")||function(e){var t=rr.f(ir(e)),r=nr.f;return r?t.concat(r(e)):t},ar=Z,ur=or,sr=i,cr=Me,fr=function(e,t){for(var r=ur(t),n=cr.f,i=sr.f,o=0;o<r.length;o++){var a=r[o];ar(e,a)||n(e,a,i(t,a))}},lr=o,hr=/#|\.prototype\./,dr=function(e,t){var r=vr[pr(e)];return r==mr||r!=yr&&("function"==typeof t?lr(t):!!t)},pr=dr.normalize=function(e){return String(e).replace(hr,".").toLowerCase()},vr=dr.data={},yr=dr.NATIVE="N",mr=dr.POLYFILL="P",gr=dr,br=n,wr=i.f,xr=Ye,kr=Ge.exports,Sr=H,_r=fr,Tr=gr,Or=function(e,t){var r,n,i,o,a,u=e.target,s=e.global,c=e.stat;if(r=s?br:c?br[u]||Sr(u,{}):(br[u]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=wr(r,n))&&a.value:r[n],!Tr(s?n:u+(c?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;_r(o,i)}(e.sham||i&&i.sham)&&xr(o,"sham",!0),kr(r,n,o,e)}},Ar=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Er=Kt,Rr=Xt,Pr=Object.keys||function(e){return Er(e,Rr)},jr=Me,Ir=Ue,Lr=Pr,Cr=a?Object.defineProperties:function(e,t){Ir(e);for(var r,n=Lr(t),i=n.length,o=0;i>o;)jr.f(e,r=n[o++],t[r]);return e},Mr=O("document","documentElement"),Dr=Ue,Ur=Cr,Br=Xt,Nr=at,Fr=Mr,qr=_e,zr=ot("IE_PROTO"),Vr=function(){},Hr=function(e){return"<script>"+e+"</"+"script>"},Yr=function(e){e.write(Hr("")),e.close();var t=e.parentWindow.Object;return e=null,t},Gr=function(){try{tr=new ActiveXObject("htmlfile")}catch(e){}var e,t;Gr="undefined"!=typeof document?document.domain&&tr?Yr(tr):((t=qr("iframe")).style.display="none",Fr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Hr("document.F=Object")),e.close(),e.F):Yr(tr);for(var r=Br.length;r--;)delete Gr.prototype[Br[r]];return Gr()};Nr[zr]=!0;var $r=Object.create||function(e,t){var r;return null!==e?(Vr.prototype=Dr(e),r=new Vr,Vr.prototype=null,r[zr]=e):r=Gr(),void 0===t?r:Ur(r,t)},Wr=Ar,Qr=S,Kr=[].slice,Xr={},Jr=function(e,t,r){if(!(t in Xr)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";Xr[t]=Function("C,a","return new C("+n.join(",")+")")}return Xr[t](e,r)},Zr=Function.bind||function(e){var t=Wr(this),r=Kr.call(arguments,1),n=function(){var i=r.concat(Kr.call(arguments));return this instanceof n?Jr(t,i.length,i):t.apply(e,i)};return Qr(t.prototype)&&(n.prototype=t.prototype),n},en=Or,tn=Ar,rn=Ue,nn=S,on=$r,an=Zr,un=o,sn=O("Reflect","construct"),cn=un((function(){function e(){}return!(sn((function(){}),[],e)instanceof e)})),fn=!un((function(){sn((function(){}))})),ln=cn||fn;en({target:"Reflect",stat:!0,forced:ln,sham:ln},{construct:function(e,t){tn(e),rn(t);var r=arguments.length<3?e:tn(arguments[2]);if(fn&&!cn)return sn(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 n.push.apply(n,t),new(an.apply(e,n))}var i=r.prototype,o=on(nn(i)?i:Object.prototype),a=Function.apply.call(e,o,t);return nn(a)?a:o}});var hn=K,dn=Pr;Or({target:"Object",stat:!0,forced:o((function(){dn(1)}))},{keys:function(e){return dn(hn(e))}});var pn=v,vn=Array.isArray||function(e){return"Array"==pn(e)},yn=F,mn=function(e){if(yn(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},gn={},bn=k,wn=Pt.f,xn={}.toString,kn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];gn.f=function(e){return kn&&"[object Window]"==xn.call(e)?function(e){try{return wn(e)}catch(e){return kn.slice()}}(e):wn(bn(e))};var Sn={},_n=he;Sn.f=_n;var Tn=n,On=Z,An=Sn,En=Me.f,Rn=function(e){var t=Tn.Symbol||(Tn.Symbol={});On(t,e)||En(t,e,{value:An.f(e)})},Pn=Me.f,jn=Z,In=he("toStringTag"),Ln=function(e,t,r){e&&!jn(e=r?e:e.prototype,In)&&Pn(e,In,{configurable:!0,value:t})},Cn=Ar,Mn=function(e,t,r){if(Cn(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},Dn=S,Un=vn,Bn=he("species"),Nn=function(e){var t;return Un(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!Un(t.prototype)?Dn(t)&&null===(t=t[Bn])&&(t=void 0):t=void 0),void 0===t?Array:t},Fn=function(e,t){return new(Nn(e))(0===t?0:t)},qn=Mn,zn=g,Vn=K,Hn=Dt,Yn=Fn,Gn=[].push,$n=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,a=7==e,u=5==e||o;return function(s,c,f,l){for(var h,d,p=Vn(s),v=zn(p),y=qn(c,f,3),m=Hn(v.length),g=0,b=l||Yn,w=t?b(s,m):r||a?b(s,0):void 0;m>g;g++)if((u||g in v)&&(d=y(h=v[g],g,p),e))if(t)w[g]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return g;case 2:Gn.call(w,h)}else switch(e){case 4:return!1;case 7:Gn.call(w,h)}return o?-1:n||i?i:w}},Wn={forEach:$n(0),map:$n(1),filter:$n(2),some:$n(3),every:$n(4),find:$n(5),findIndex:$n(6),filterReject:$n(7)},Qn=Or,Kn=n,Xn=O,Jn=a,Zn=U,ei=o,ti=Z,ri=vn,ni=S,ii=F,oi=Ue,ai=K,ui=k,si=we,ci=mn,fi=d,li=$r,hi=Pr,di=Pt,pi=gn,vi=er,yi=i,mi=Me,gi=u,bi=Ye,wi=Ge.exports,xi=z.exports,ki=at,Si=re,_i=he,Ti=Sn,Oi=Rn,Ai=Ln,Ei=xt,Ri=Wn.forEach,Pi=ot("hidden"),ji="Symbol",Ii=_i("toPrimitive"),Li=Ei.set,Ci=Ei.getterFor(ji),Mi=Object.prototype,Di=Kn.Symbol,Ui=Xn("JSON","stringify"),Bi=yi.f,Ni=mi.f,Fi=pi.f,qi=gi.f,zi=xi("symbols"),Vi=xi("op-symbols"),Hi=xi("string-to-symbol-registry"),Yi=xi("symbol-to-string-registry"),Gi=xi("wks"),$i=Kn.QObject,Wi=!$i||!$i.prototype||!$i.prototype.findChild,Qi=Jn&&ei((function(){return 7!=li(Ni({},"a",{get:function(){return Ni(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Bi(Mi,t);n&&delete Mi[t],Ni(e,t,r),n&&e!==Mi&&Ni(Mi,t,n)}:Ni,Ki=function(e,t){var r=zi[e]=li(Di.prototype);return Li(r,{type:ji,tag:e,description:t}),Jn||(r.description=t),r},Xi=function(e,t,r){e===Mi&&Xi(Vi,t,r),oi(e);var n=si(t);return oi(r),ti(zi,n)?(r.enumerable?(ti(e,Pi)&&e[Pi][n]&&(e[Pi][n]=!1),r=li(r,{enumerable:fi(0,!1)})):(ti(e,Pi)||Ni(e,Pi,fi(1,{})),e[Pi][n]=!0),Qi(e,n,r)):Ni(e,n,r)},Ji=function(e,t){oi(e);var r=ui(t),n=hi(r).concat(ro(r));return Ri(n,(function(t){Jn&&!Zi.call(r,t)||Xi(e,t,r[t])})),e},Zi=function(e){var t=si(e),r=qi.call(this,t);return!(this===Mi&&ti(zi,t)&&!ti(Vi,t))&&(!(r||!ti(this,t)||!ti(zi,t)||ti(this,Pi)&&this[Pi][t])||r)},eo=function(e,t){var r=ui(e),n=si(t);if(r!==Mi||!ti(zi,n)||ti(Vi,n)){var i=Bi(r,n);return!i||!ti(zi,n)||ti(r,Pi)&&r[Pi][n]||(i.enumerable=!0),i}},to=function(e){var t=Fi(ui(e)),r=[];return Ri(t,(function(e){ti(zi,e)||ti(ki,e)||r.push(e)})),r},ro=function(e){var t=e===Mi,r=Fi(t?Vi:ui(e)),n=[];return Ri(r,(function(e){!ti(zi,e)||t&&!ti(Mi,e)||n.push(zi[e])})),n};(Zn||(wi((Di=function(){if(this instanceof Di)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ci(arguments[0]):void 0,t=Si(e),r=function(e){this===Mi&&r.call(Vi,e),ti(this,Pi)&&ti(this[Pi],t)&&(this[Pi][t]=!1),Qi(this,t,fi(1,e))};return Jn&&Wi&&Qi(Mi,t,{configurable:!0,set:r}),Ki(t,e)}).prototype,"toString",(function(){return Ci(this).tag})),wi(Di,"withoutSetter",(function(e){return Ki(Si(e),e)})),gi.f=Zi,mi.f=Xi,yi.f=eo,di.f=pi.f=to,vi.f=ro,Ti.f=function(e){return Ki(_i(e),e)},Jn&&(Ni(Di.prototype,"description",{configurable:!0,get:function(){return Ci(this).description}}),wi(Mi,"propertyIsEnumerable",Zi,{unsafe:!0}))),Qn({global:!0,wrap:!0,forced:!Zn,sham:!Zn},{Symbol:Di}),Ri(hi(Gi),(function(e){Oi(e)})),Qn({target:ji,stat:!0,forced:!Zn},{for:function(e){var t=ci(e);if(ti(Hi,t))return Hi[t];var r=Di(t);return Hi[t]=r,Yi[r]=t,r},keyFor:function(e){if(!ii(e))throw TypeError(e+" is not a symbol");if(ti(Yi,e))return Yi[e]},useSetter:function(){Wi=!0},useSimple:function(){Wi=!1}}),Qn({target:"Object",stat:!0,forced:!Zn,sham:!Jn},{create:function(e,t){return void 0===t?li(e):Ji(li(e),t)},defineProperty:Xi,defineProperties:Ji,getOwnPropertyDescriptor:eo}),Qn({target:"Object",stat:!0,forced:!Zn},{getOwnPropertyNames:to,getOwnPropertySymbols:ro}),Qn({target:"Object",stat:!0,forced:ei((function(){vi.f(1)}))},{getOwnPropertySymbols:function(e){return vi.f(ai(e))}}),Ui)&&Qn({target:"JSON",stat:!0,forced:!Zn||ei((function(){var e=Di();return"[null]"!=Ui([e])||"{}"!=Ui({a:e})||"{}"!=Ui(Object(e))}))},{stringify:function(e,t,r){for(var n,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=t,(ni(t)||void 0!==e)&&!ii(e))return ri(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!ii(t))return t}),i[1]=t,Ui.apply(null,i)}});Di.prototype[Ii]||bi(Di.prototype,Ii,Di.prototype.valueOf),Ai(Di,ji),ki[Pi]=!0;var no=o,io=C,oo=he("species"),ao=function(e){return io>=51||!no((function(){var t=[];return(t.constructor={})[oo]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},uo=Wn.filter;Or({target:"Array",proto:!0,forced:!ao("filter")},{filter:function(e){return uo(this,e,arguments.length>1?arguments[1]:void 0)}});var so=Or,co=o,fo=k,lo=i.f,ho=a,po=co((function(){lo(1)}));so({target:"Object",stat:!0,forced:!ho||po,sham:!ho},{getOwnPropertyDescriptor:function(e,t){return lo(fo(e),t)}});var vo={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},yo=o,mo=function(e,t){var r=[][e];return!!r&&yo((function(){r.call(null,t||function(){throw 1},1)}))},go=Wn.forEach,bo=n,wo=vo,xo=mo("forEach")?[].forEach:function(e){return go(this,e,arguments.length>1?arguments[1]:void 0)},ko=Ye;for(var So in wo){var _o=bo[So],To=_o&&_o.prototype;if(To&&To.forEach!==xo)try{ko(To,"forEach",xo)}catch(e){To.forEach=xo}}var Oo=we,Ao=Me,Eo=d,Ro=function(e,t,r){var n=Oo(t);n in e?Ao.f(e,n,Eo(0,r)):e[n]=r},Po=or,jo=k,Io=i,Lo=Ro;function Co(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Do(e,t,r){return t&&Mo(e.prototype,t),r&&Mo(e,r),e}function Uo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bo(e,t){return(Bo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function No(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bo(e,t)}function Fo(e){return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qo(e,t){if(t&&("object"===Fo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uo(e)}function zo(e){return(zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Or({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){for(var t,r,n=jo(e),i=Io.f,o=Po(n),a={},u=0;o.length>u;)void 0!==(r=i(n,t=o[u++]))&&Lo(a,t,r);return a}});var Ho=Or,Yo=o,Go=vn,$o=S,Wo=K,Qo=Dt,Ko=Ro,Xo=Fn,Jo=ao,Zo=C,ea=he("isConcatSpreadable"),ta=9007199254740991,ra="Maximum allowed index exceeded",na=Zo>=51||!Yo((function(){var e=[];return e[ea]=!1,e.concat()[0]!==e})),ia=Jo("concat"),oa=function(e){if(!$o(e))return!1;var t=e[ea];return void 0!==t?!!t:Go(e)};function aa(e,t,r,n,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,i)}function ua(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){aa(o,n,i,a,u,"next",e)}function u(e){aa(o,n,i,a,u,"throw",e)}a(void 0)}))}}function sa(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function ca(e,t,r){return(ca=sa()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Bo(i,r.prototype),i}).apply(null,arguments)}function fa(e){var t="function"==typeof Map?new Map:void 0;return(fa=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;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,n)}function n(){return ca(e,arguments,zo(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Bo(n,e)})(e)}Ho({target:"Array",proto:!0,forced:!na||!ia},{concat:function(e){var t,r,n,i,o,a=Wo(this),u=Xo(a,0),s=0;for(t=-1,n=arguments.length;t<n;t++)if(oa(o=-1===t?a:arguments[t])){if(s+(i=Qo(o.length))>ta)throw TypeError(ra);for(r=0;r<i;r++,s++)r in o&&Ko(u,s,o[r])}else{if(s>=ta)throw TypeError(ra);Ko(u,s++,o)}return u.length=s,u}});var la={exports:{}};!function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),a=new E(n||[]);return o._invoke=function(e,t,r){var n=l;return function(i,o){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return P()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=T(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var s=f(e,t,r);if("normal"===s.type){if(n=r.done?p:h,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,a),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function y(){}function m(){}function g(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(R([])));x&&x!==r&&n.call(x,o)&&(b=x);var k=g.prototype=y.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(i,o,a,u){var s=f(e[i],e,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function T(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=f(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(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 A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function R(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:P}}function P(){return{value:t,done:!0}}return m.prototype=k.constructor=g,g.constructor=m,m.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,u,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(_.prototype),_.prototype[a]=function(){return this},e.AsyncIterator=_,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new _(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(k),s(k,u,"Generator"),k[o]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},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 r=this;function i(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},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),v},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),A(r),v}},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;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(la);var ha=la.exports,da=$r,pa=Me,va=he("unscopables"),ya=Array.prototype;null==ya[va]&&pa.f(ya,va,{configurable:!0,value:da(null)});var ma,ga,ba,wa=function(e){ya[va][e]=!0},xa={},ka=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Sa=Z,_a=K,Ta=ka,Oa=ot("IE_PROTO"),Aa=Object.prototype,Ea=Ta?Object.getPrototypeOf:function(e){return e=_a(e),Sa(e,Oa)?e[Oa]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Aa:null},Ra=o,Pa=Ea,ja=Ye,Ia=Z,La=he("iterator"),Ca=!1;[].keys&&("next"in(ba=[].keys())?(ga=Pa(Pa(ba)))!==Object.prototype&&(ma=ga):Ca=!0),(null==ma||Ra((function(){var e={};return ma[La].call(e)!==e})))&&(ma={}),Ia(ma,La)||ja(ma,La,(function(){return this}));var Ma={IteratorPrototype:ma,BUGGY_SAFARI_ITERATORS:Ca},Da=Ma.IteratorPrototype,Ua=$r,Ba=d,Na=Ln,Fa=xa,qa=function(){return this},za=function(e,t,r){var n=t+" Iterator";return e.prototype=Ua(Da,{next:Ba(1,r)}),Na(e,n,!1),Fa[n]=qa,e},Va=S,Ha=Ue,Ya=function(e){if(!Va(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Ga=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return Ha(r),Ya(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),$a=Or,Wa=za,Qa=Ea,Ka=Ga,Xa=Ln,Ja=Ye,Za=Ge.exports,eu=xa,tu=Ma.IteratorPrototype,ru=Ma.BUGGY_SAFARI_ITERATORS,nu=he("iterator"),iu="keys",ou="values",au="entries",uu=function(){return this},su=function(e,t,r,n,i,o,a){Wa(r,t,n);var u,s,c,f=function(e){if(e===i&&v)return v;if(!ru&&e in d)return d[e];switch(e){case iu:case ou:case au:return function(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",h=!1,d=e.prototype,p=d[nu]||d["@@iterator"]||i&&d[i],v=!ru&&p||f(i),y="Array"==t&&d.entries||p;if(y&&(u=Qa(y.call(new e)),tu!==Object.prototype&&u.next&&(Qa(u)!==tu&&(Ka?Ka(u,tu):"function"!=typeof u[nu]&&Ja(u,nu,uu)),Xa(u,l,!0))),i==ou&&p&&p.name!==ou&&(h=!0,v=function(){return p.call(this)}),d[nu]!==v&&Ja(d,nu,v),eu[t]=v,i)if(s={values:f(ou),keys:o?v:f(iu),entries:f(au)},a)for(c in s)(ru||h||!(c in d))&&Za(d,c,s[c]);else $a({target:t,proto:!0,forced:ru||h},s);return s},cu=k,fu=wa,lu=xa,hu=xt,du=su,pu="Array Iterator",vu=hu.set,yu=hu.getterFor(pu),mu=du(Array,"Array",(function(e,t){vu(this,{type:pu,target:cu(e),index:0,kind:t})}),(function(){var e=yu(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");lu.Arguments=lu.Array,fu("keys"),fu("values"),fu("entries");var gu={};gu[he("toStringTag")]="z";var bu="[object z]"===String(gu),wu=bu,xu=v,ku=he("toStringTag"),Su="Arguments"==xu(function(){return arguments}()),_u=wu?xu:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),ku))?r:Su?xu(t):"Object"==(n=xu(t))&&"function"==typeof t.callee?"Arguments":n},Tu=_u,Ou=bu?{}.toString:function(){return"[object "+Tu(this)+"]"},Au=bu,Eu=Ge.exports,Ru=Ou;Au||Eu(Object.prototype,"toString",Ru,{unsafe:!0});var Pu=Lt,ju=mn,Iu=b,Lu=function(e){return function(t,r){var n,i,o=ju(Iu(t)),a=Pu(r),u=o.length;return a<0||a>=u?e?"":void 0:(n=o.charCodeAt(a))<55296||n>56319||a+1===u||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):n:e?o.slice(a,a+2):i-56320+(n-55296<<10)+65536}},Cu={codeAt:Lu(!1),charAt:Lu(!0)},Mu=Cu.charAt,Du=mn,Uu=xt,Bu=su,Nu="String Iterator",Fu=Uu.set,qu=Uu.getterFor(Nu);Bu(String,"String",(function(e){Fu(this,{type:Nu,string:Du(e),index:0})}),(function(){var e,t=qu(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Mu(r,n),t.index+=e.length,{value:e,done:!1})}));var zu=n,Vu=vo,Hu=mu,Yu=Ye,Gu=he,$u=Gu("iterator"),Wu=Gu("toStringTag"),Qu=Hu.values;for(var Ku in Vu){var Xu=zu[Ku],Ju=Xu&&Xu.prototype;if(Ju){if(Ju[$u]!==Qu)try{Yu(Ju,$u,Qu)}catch(e){Ju[$u]=Qu}if(Ju[Wu]||Yu(Ju,Wu,Ku),Vu[Ku])for(var Zu in Hu)if(Ju[Zu]!==Hu[Zu])try{Yu(Ju,Zu,Hu[Zu])}catch(e){Ju[Zu]=Hu[Zu]}}}var es=o,ts=he("iterator"),rs=!es((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})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ts]||"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})),ns=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},is=a,os=o,as=Pr,us=er,ss=u,cs=K,fs=g,ls=Object.assign,hs=Object.defineProperty,ds=!ls||os((function(){if(is&&1!==ls({b:1},ls(hs({},"a",{enumerable:!0,get:function(){hs(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!=ls({},e)[r]||as(ls({},t)).join("")!=n}))?function(e,t){for(var r=cs(e),n=arguments.length,i=1,o=us.f,a=ss.f;n>i;)for(var u,s=fs(arguments[i++]),c=o?as(s).concat(o(s)):as(s),f=c.length,l=0;f>l;)u=c[l++],is&&!a.call(s,u)||(r[u]=s[u]);return r}:ls,ps=Ue,vs=function(e){var t=e.return;if(void 0!==t)return ps(t.call(e)).value},ys=Ue,ms=vs,gs=xa,bs=he("iterator"),ws=Array.prototype,xs=function(e){return void 0!==e&&(gs.Array===e||ws[bs]===e)},ks=_u,Ss=xa,_s=he("iterator"),Ts=function(e){if(null!=e)return e[_s]||e["@@iterator"]||Ss[ks(e)]},Os=Mn,As=K,Es=function(e,t,r,n){try{return n?t(ys(r)[0],r[1]):t(r)}catch(t){throw ms(e),t}},Rs=xs,Ps=Dt,js=Ro,Is=Ts,Ls=function(e){var t,r,n,i,o,a,u=As(e),s="function"==typeof this?this:Array,c=arguments.length,f=c>1?arguments[1]:void 0,l=void 0!==f,h=Is(u),d=0;if(l&&(f=Os(f,c>2?arguments[2]:void 0,2)),null==h||s==Array&&Rs(h))for(r=new s(t=Ps(u.length));t>d;d++)a=l?f(u[d],d):u[d],js(r,d,a);else for(o=(i=h.call(u)).next,r=new s;!(n=o.call(i)).done;d++)a=l?Es(i,f,[n.value,d],!0):n.value,js(r,d,a);return r.length=d,r},Cs=2147483647,Ms=/[^\0-\u007E]/,Ds=/[.\u3002\uFF0E\uFF61]/g,Us="Overflow: input needs wider integers to process",Bs=Math.floor,Ns=String.fromCharCode,Fs=function(e){return e+22+75*(e<26)},qs=function(e,t,r){var n=0;for(e=r?Bs(e/700):e>>1,e+=Bs(e/t);e>455;n+=36)e=Bs(e/35);return Bs(n+36*e/(e+38))},zs=function(e){var t,r,n=[],i=(e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}(e)).length,o=128,a=0,u=72;for(t=0;t<e.length;t++)(r=e[t])<128&&n.push(Ns(r));var s=n.length,c=s;for(s&&n.push("-");c<i;){var f=Cs;for(t=0;t<e.length;t++)(r=e[t])>=o&&r<f&&(f=r);var l=c+1;if(f-o>Bs((Cs-a)/l))throw RangeError(Us);for(a+=(f-o)*l,o=f,t=0;t<e.length;t++){if((r=e[t])<o&&++a>Cs)throw RangeError(Us);if(r==o){for(var h=a,d=36;;d+=36){var p=d<=u?1:d>=u+26?26:d-u;if(h<p)break;var v=h-p,y=36-p;n.push(Ns(Fs(p+v%y))),h=Bs(v/y)}n.push(Ns(Fs(h))),u=qs(a,l,c==s),a=0,++c}}++a,++o}return n.join("")},Vs=Ge.exports,Hs=function(e,t,r){for(var n in t)Vs(e,n,t[n],r);return e},Ys=Ue,Gs=Ts,$s=Or,Ws=O,Qs=rs,Ks=Ge.exports,Xs=Hs,Js=Ln,Zs=za,ec=xt,tc=ns,rc=Z,nc=Mn,ic=_u,oc=Ue,ac=S,uc=mn,sc=$r,cc=d,fc=function(e){var t=Gs(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return Ys(t.call(e))},lc=Ts,hc=he,dc=Ws("fetch"),pc=Ws("Request"),vc=pc&&pc.prototype,yc=Ws("Headers"),mc=hc("iterator"),gc="URLSearchParams",bc="URLSearchParamsIterator",wc=ec.set,xc=ec.getterFor(gc),kc=ec.getterFor(bc),Sc=/\+/g,_c=Array(4),Tc=function(e){return _c[e-1]||(_c[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Oc=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Ac=function(e){var t=e.replace(Sc," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=t.replace(Tc(r--),Oc);return t}},Ec=/[!'()~]|%20/g,Rc={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Pc=function(e){return Rc[e]},jc=function(e){return encodeURIComponent(e).replace(Ec,Pc)},Ic=function(e,t){if(t)for(var r,n,i=t.split("&"),o=0;o<i.length;)(r=i[o++]).length&&(n=r.split("="),e.push({key:Ac(n.shift()),value:Ac(n.join("="))}))},Lc=function(e){this.entries.length=0,Ic(this.entries,e)},Cc=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Mc=Zs((function(e,t){wc(this,{type:bc,iterator:fc(xc(e).entries),kind:t})}),"Iterator",(function(){var e=kc(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})),Dc=function(){tc(this,Dc,gc);var e,t,r,n,i,o,a,u,s,c=arguments.length>0?arguments[0]:void 0,f=this,l=[];if(wc(f,{type:gc,entries:l,updateURL:function(){},updateSearchParams:Lc}),void 0!==c)if(ac(c))if("function"==typeof(e=lc(c)))for(r=(t=e.call(c)).next;!(n=r.call(t)).done;){if((a=(o=(i=fc(oc(n.value))).next).call(i)).done||(u=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");l.push({key:uc(a.value),value:uc(u.value)})}else for(s in c)rc(c,s)&&l.push({key:s,value:uc(c[s])});else Ic(l,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:uc(c))},Uc=Dc.prototype;if(Xs(Uc,{append:function(e,t){Cc(arguments.length,2);var r=xc(this);r.entries.push({key:uc(e),value:uc(t)}),r.updateURL()},delete:function(e){Cc(arguments.length,1);for(var t=xc(this),r=t.entries,n=uc(e),i=0;i<r.length;)r[i].key===n?r.splice(i,1):i++;t.updateURL()},get:function(e){Cc(arguments.length,1);for(var t=xc(this).entries,r=uc(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Cc(arguments.length,1);for(var t=xc(this).entries,r=uc(e),n=[],i=0;i<t.length;i++)t[i].key===r&&n.push(t[i].value);return n},has:function(e){Cc(arguments.length,1);for(var t=xc(this).entries,r=uc(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Cc(arguments.length,1);for(var r,n=xc(this),i=n.entries,o=!1,a=uc(e),u=uc(t),s=0;s<i.length;s++)(r=i[s]).key===a&&(o?i.splice(s--,1):(o=!0,r.value=u));o||i.push({key:a,value:u}),n.updateURL()},sort:function(){var e,t,r,n=xc(this),i=n.entries,o=i.slice();for(i.length=0,r=0;r<o.length;r++){for(e=o[r],t=0;t<r;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===r&&i.push(e)}n.updateURL()},forEach:function(e){for(var t,r=xc(this).entries,n=nc(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new Mc(this,"keys")},values:function(){return new Mc(this,"values")},entries:function(){return new Mc(this,"entries")}},{enumerable:!0}),Ks(Uc,mc,Uc.entries),Ks(Uc,"toString",(function(){for(var e,t=xc(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(jc(e.key)+"="+jc(e.value));return r.join("&")}),{enumerable:!0}),Js(Dc,gc),$s({global:!0,forced:!Qs},{URLSearchParams:Dc}),!Qs&&"function"==typeof yc){var Bc=function(e){if(ac(e)){var t,r=e.body;if(ic(r)===gc)return(t=e.headers?new yc(e.headers):new yc).has("content-type")||t.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),sc(e,{body:cc(0,String(r)),headers:cc(0,t)})}return e};if("function"==typeof dc&&$s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return dc(e,arguments.length>1?Bc(arguments[1]):{})}}),"function"==typeof pc){var Nc=function(e){return tc(this,Nc,"Request"),new pc(e,arguments.length>1?Bc(arguments[1]):{})};vc.constructor=Nc,Nc.prototype=vc,$s({global:!0,forced:!0},{Request:Nc})}}var Fc,qc={URLSearchParams:Dc,getState:xc},zc=Or,Vc=a,Hc=rs,Yc=n,Gc=Cr,$c=Ge.exports,Wc=ns,Qc=Z,Kc=ds,Xc=Ls,Jc=Cu.codeAt,Zc=function(e){var t,r,n=[],i=e.toLowerCase().replace(Ds,".").split(".");for(t=0;t<i.length;t++)r=i[t],n.push(Ms.test(r)?"xn--"+zs(r):r);return n.join(".")},ef=mn,tf=Ln,rf=qc,nf=xt,of=Yc.URL,af=rf.URLSearchParams,uf=rf.getState,sf=nf.set,cf=nf.getterFor("URL"),ff=Math.floor,lf=Math.pow,hf="Invalid scheme",df="Invalid host",pf="Invalid port",vf=/[A-Za-z]/,yf=/[\d+-.A-Za-z]/,mf=/\d/,gf=/^0x/i,bf=/^[0-7]+$/,wf=/^\d+$/,xf=/^[\dA-Fa-f]+$/,kf=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Sf=/[\0\t\n\r #/:<>?@[\\\]^|]/,_f=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Tf=/[\t\n\r]/g,Of=function(e,t){var r,n,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return df;if(!(r=Ef(t.slice(1,-1))))return df;e.host=r}else if(Df(e)){if(t=Zc(t),kf.test(t))return df;if(null===(r=Af(t)))return df;e.host=r}else{if(Sf.test(t))return df;for(r="",n=Xc(t),i=0;i<n.length;i++)r+=Cf(n[i],Pf);e.host=r}},Af=function(e){var t,r,n,i,o,a,u,s=e.split(".");if(s.length&&""==s[s.length-1]&&s.pop(),(t=s.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=s[n]))return e;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=gf.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else{if(!(10==o?wf:8==o?bf:xf).test(i))return e;a=parseInt(i,o)}r.push(a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=lf(256,5-t))return null}else if(a>255)return null;for(u=r.pop(),n=0;n<r.length;n++)u+=r[n]*lf(256,3-n);return u},Ef=function(e){var t,r,n,i,o,a,u,s=[0,0,0,0,0,0,0,0],c=0,f=null,l=0,h=function(){return e.charAt(l)};if(":"==h()){if(":"!=e.charAt(1))return;l+=2,f=++c}for(;h();){if(8==c)return;if(":"!=h()){for(t=r=0;r<4&&xf.test(h());)t=16*t+parseInt(h(),16),l++,r++;if("."==h()){if(0==r)return;if(l-=r,c>6)return;for(n=0;h();){if(i=null,n>0){if(!("."==h()&&n<4))return;l++}if(!mf.test(h()))return;for(;mf.test(h());){if(o=parseInt(h(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}s[c]=256*s[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;s[c++]=t}else{if(null!==f)return;l++,f=++c}}if(null!==f)for(a=c-f,c=7;0!=c&&a>0;)u=s[c],s[c--]=s[f+a-1],s[f+--a]=u;else if(8!=c)return;return s},Rf=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=ff(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++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+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},Pf={},jf=Kc({},Pf,{" ":1,'"':1,"<":1,">":1,"`":1}),If=Kc({},jf,{"#":1,"?":1,"{":1,"}":1}),Lf=Kc({},If,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Cf=function(e,t){var r=Jc(e,0);return r>32&&r<127&&!Qc(t,e)?e:encodeURIComponent(e)},Mf={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Df=function(e){return Qc(Mf,e.scheme)},Uf=function(e){return""!=e.username||""!=e.password},Bf=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Nf=function(e,t){var r;return 2==e.length&&vf.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},Ff=function(e){var t;return e.length>1&&Nf(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},qf=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&Nf(t[0],!0)||t.pop()},zf=function(e){return"."===e||"%2e"===e.toLowerCase()},Vf={},Hf={},Yf={},Gf={},$f={},Wf={},Qf={},Kf={},Xf={},Jf={},Zf={},el={},tl={},rl={},nl={},il={},ol={},al={},ul={},sl={},cl={},fl=function(e,t,r,n){var i,o,a,u,s,c=r||Vf,f=0,l="",h=!1,d=!1,p=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(_f,"")),t=t.replace(Tf,""),i=Xc(t);f<=i.length;){switch(o=i[f],c){case Vf:if(!o||!vf.test(o)){if(r)return hf;c=Yf;continue}l+=o.toLowerCase(),c=Hf;break;case Hf:if(o&&(yf.test(o)||"+"==o||"-"==o||"."==o))l+=o.toLowerCase();else{if(":"!=o){if(r)return hf;l="",c=Yf,f=0;continue}if(r&&(Df(e)!=Qc(Mf,l)||"file"==l&&(Uf(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,r)return void(Df(e)&&Mf[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?c=rl:Df(e)&&n&&n.scheme==e.scheme?c=Gf:Df(e)?c=Kf:"/"==i[f+1]?(c=$f,f++):(e.cannotBeABaseURL=!0,e.path.push(""),c=ul)}break;case Yf:if(!n||n.cannotBeABaseURL&&"#"!=o)return hf;if(n.cannotBeABaseURL&&"#"==o){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,c=cl;break}c="file"==n.scheme?rl:Wf;continue;case Gf:if("/"!=o||"/"!=i[f+1]){c=Wf;continue}c=Xf,f++;break;case $f:if("/"==o){c=Jf;break}c=al;continue;case Wf:if(e.scheme=n.scheme,o==Fc)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==o||"\\"==o&&Df(e))c=Qf;else if("?"==o)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",c=sl;else{if("#"!=o){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),c=al;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=cl}break;case Qf:if(!Df(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,c=al;continue}c=Jf}else c=Xf;break;case Kf:if(c=Xf,"/"!=o||"/"!=l.charAt(f+1))continue;f++;break;case Xf:if("/"!=o&&"\\"!=o){c=Jf;continue}break;case Jf:if("@"==o){h&&(l="%40"+l),h=!0,a=Xc(l);for(var v=0;v<a.length;v++){var y=a[v];if(":"!=y||p){var m=Cf(y,Lf);p?e.password+=m:e.username+=m}else p=!0}l=""}else if(o==Fc||"/"==o||"?"==o||"#"==o||"\\"==o&&Df(e)){if(h&&""==l)return"Invalid authority";f-=Xc(l).length+1,l="",c=Zf}else l+=o;break;case Zf:case el:if(r&&"file"==e.scheme){c=il;continue}if(":"!=o||d){if(o==Fc||"/"==o||"?"==o||"#"==o||"\\"==o&&Df(e)){if(Df(e)&&""==l)return df;if(r&&""==l&&(Uf(e)||null!==e.port))return;if(u=Of(e,l))return u;if(l="",c=ol,r)return;continue}"["==o?d=!0:"]"==o&&(d=!1),l+=o}else{if(""==l)return df;if(u=Of(e,l))return u;if(l="",c=tl,r==el)return}break;case tl:if(!mf.test(o)){if(o==Fc||"/"==o||"?"==o||"#"==o||"\\"==o&&Df(e)||r){if(""!=l){var g=parseInt(l,10);if(g>65535)return pf;e.port=Df(e)&&g===Mf[e.scheme]?null:g,l=""}if(r)return;c=ol;continue}return pf}l+=o;break;case rl:if(e.scheme="file","/"==o||"\\"==o)c=nl;else{if(!n||"file"!=n.scheme){c=al;continue}if(o==Fc)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==o)e.host=n.host,e.path=n.path.slice(),e.query="",c=sl;else{if("#"!=o){Ff(i.slice(f).join(""))||(e.host=n.host,e.path=n.path.slice(),qf(e)),c=al;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=cl}}break;case nl:if("/"==o||"\\"==o){c=il;break}n&&"file"==n.scheme&&!Ff(i.slice(f).join(""))&&(Nf(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),c=al;continue;case il:if(o==Fc||"/"==o||"\\"==o||"?"==o||"#"==o){if(!r&&Nf(l))c=al;else if(""==l){if(e.host="",r)return;c=ol}else{if(u=Of(e,l))return u;if("localhost"==e.host&&(e.host=""),r)return;l="",c=ol}continue}l+=o;break;case ol:if(Df(e)){if(c=al,"/"!=o&&"\\"!=o)continue}else if(r||"?"!=o)if(r||"#"!=o){if(o!=Fc&&(c=al,"/"!=o))continue}else e.fragment="",c=cl;else e.query="",c=sl;break;case al:if(o==Fc||"/"==o||"\\"==o&&Df(e)||!r&&("?"==o||"#"==o)){if(".."===(s=(s=l).toLowerCase())||"%2e."===s||".%2e"===s||"%2e%2e"===s?(qf(e),"/"==o||"\\"==o&&Df(e)||e.path.push("")):zf(l)?"/"==o||"\\"==o&&Df(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Nf(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(o==Fc||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",c=sl):"#"==o&&(e.fragment="",c=cl)}else l+=Cf(o,If);break;case ul:"?"==o?(e.query="",c=sl):"#"==o?(e.fragment="",c=cl):o!=Fc&&(e.path[0]+=Cf(o,Pf));break;case sl:r||"#"!=o?o!=Fc&&("'"==o&&Df(e)?e.query+="%27":e.query+="#"==o?"%23":Cf(o,Pf)):(e.fragment="",c=cl);break;case cl:o!=Fc&&(e.fragment+=Cf(o,jf))}f++}},ll=function(e){var t,r,n=Wc(this,ll,"URL"),i=arguments.length>1?arguments[1]:void 0,o=ef(e),a=sf(n,{type:"URL"});if(void 0!==i)if(i instanceof ll)t=cf(i);else if(r=fl(t={},ef(i)))throw TypeError(r);if(r=fl(a,o,null,t))throw TypeError(r);var u=a.searchParams=new af,s=uf(u);s.updateSearchParams(a.query),s.updateURL=function(){a.query=String(u)||null},Vc||(n.href=dl.call(n),n.origin=pl.call(n),n.protocol=vl.call(n),n.username=yl.call(n),n.password=ml.call(n),n.host=gl.call(n),n.hostname=bl.call(n),n.port=wl.call(n),n.pathname=xl.call(n),n.search=kl.call(n),n.searchParams=Sl.call(n),n.hash=_l.call(n))},hl=ll.prototype,dl=function(){var e=cf(this),t=e.scheme,r=e.username,n=e.password,i=e.host,o=e.port,a=e.path,u=e.query,s=e.fragment,c=t+":";return null!==i?(c+="//",Uf(e)&&(c+=r+(n?":"+n:"")+"@"),c+=Rf(i),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==u&&(c+="?"+u),null!==s&&(c+="#"+s),c},pl=function(){var e=cf(this),t=e.scheme,r=e.port;if("blob"==t)try{return new ll(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Df(e)?t+"://"+Rf(e.host)+(null!==r?":"+r:""):"null"},vl=function(){return cf(this).scheme+":"},yl=function(){return cf(this).username},ml=function(){return cf(this).password},gl=function(){var e=cf(this),t=e.host,r=e.port;return null===t?"":null===r?Rf(t):Rf(t)+":"+r},bl=function(){var e=cf(this).host;return null===e?"":Rf(e)},wl=function(){var e=cf(this).port;return null===e?"":String(e)},xl=function(){var e=cf(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},kl=function(){var e=cf(this).query;return e?"?"+e:""},Sl=function(){return cf(this).searchParams},_l=function(){var e=cf(this).fragment;return e?"#"+e:""},Tl=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(Vc&&Gc(hl,{href:Tl(dl,(function(e){var t=cf(this),r=ef(e),n=fl(t,r);if(n)throw TypeError(n);uf(t.searchParams).updateSearchParams(t.query)})),origin:Tl(pl),protocol:Tl(vl,(function(e){var t=cf(this);fl(t,ef(e)+":",Vf)})),username:Tl(yl,(function(e){var t=cf(this),r=Xc(ef(e));if(!Bf(t)){t.username="";for(var n=0;n<r.length;n++)t.username+=Cf(r[n],Lf)}})),password:Tl(ml,(function(e){var t=cf(this),r=Xc(ef(e));if(!Bf(t)){t.password="";for(var n=0;n<r.length;n++)t.password+=Cf(r[n],Lf)}})),host:Tl(gl,(function(e){var t=cf(this);t.cannotBeABaseURL||fl(t,ef(e),Zf)})),hostname:Tl(bl,(function(e){var t=cf(this);t.cannotBeABaseURL||fl(t,ef(e),el)})),port:Tl(wl,(function(e){var t=cf(this);Bf(t)||(""==(e=ef(e))?t.port=null:fl(t,e,tl))})),pathname:Tl(xl,(function(e){var t=cf(this);t.cannotBeABaseURL||(t.path=[],fl(t,ef(e),ol))})),search:Tl(kl,(function(e){var t=cf(this);""==(e=ef(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",fl(t,e,sl)),uf(t.searchParams).updateSearchParams(t.query)})),searchParams:Tl(Sl),hash:Tl(_l,(function(e){var t=cf(this);""!=(e=ef(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",fl(t,e,cl)):t.fragment=null}))}),$c(hl,"toJSON",(function(){return dl.call(this)}),{enumerable:!0}),$c(hl,"toString",(function(){return dl.call(this)}),{enumerable:!0}),of){var Ol=of.createObjectURL,Al=of.revokeObjectURL;Ol&&$c(ll,"createObjectURL",(function(e){return Ol.apply(of,arguments)})),Al&&$c(ll,"revokeObjectURL",(function(e){return Al.apply(of,arguments)}))}tf(ll,"URL"),zc({global:!0,forced:!Hc,sham:!Vc},{URL:ll});var El=n.Promise,Rl=O,Pl=Me,jl=a,Il=he("species"),Ll=function(e){var t=Rl(e),r=Pl.f;jl&&t&&!t[Il]&&r(t,Il,{configurable:!0,get:function(){return this}})},Cl=Ue,Ml=xs,Dl=Dt,Ul=Mn,Bl=Ts,Nl=vs,Fl=function(e,t){this.stopped=e,this.result=t},ql=he("iterator"),zl=!1;try{var Vl=0,Hl={next:function(){return{done:!!Vl++}},return:function(){zl=!0}};Hl[ql]=function(){return this},Array.from(Hl,(function(){throw 2}))}catch(e){}var Yl,Gl,$l,Wl,Ql=function(e,t){if(!t&&!zl)return!1;var r=!1;try{var n={};n[ql]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Kl=Ue,Xl=Ar,Jl=he("species"),Zl=function(e,t){var r,n=Kl(e).constructor;return void 0===n||null==(r=Kl(n)[Jl])?t:Xl(r)},eh=/(?:ipad|iphone|ipod).*applewebkit/i.test(A),th="process"==v(n.process),rh=n,nh=o,ih=Mn,oh=Mr,ah=_e,uh=eh,sh=th,ch=rh.setImmediate,fh=rh.clearImmediate,lh=rh.process,hh=rh.MessageChannel,dh=rh.Dispatch,ph=0,vh={},yh="onreadystatechange";try{Yl=rh.location}catch(e){}var mh=function(e){if(vh.hasOwnProperty(e)){var t=vh[e];delete vh[e],t()}},gh=function(e){return function(){mh(e)}},bh=function(e){mh(e.data)},wh=function(e){rh.postMessage(String(e),Yl.protocol+"//"+Yl.host)};ch&&fh||(ch=function(e){for(var t=[],r=arguments.length,n=1;r>n;)t.push(arguments[n++]);return vh[++ph]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Gl(ph),ph},fh=function(e){delete vh[e]},sh?Gl=function(e){lh.nextTick(gh(e))}:dh&&dh.now?Gl=function(e){dh.now(gh(e))}:hh&&!uh?(Wl=($l=new hh).port2,$l.port1.onmessage=bh,Gl=ih(Wl.postMessage,Wl,1)):rh.addEventListener&&"function"==typeof postMessage&&!rh.importScripts&&Yl&&"file:"!==Yl.protocol&&!nh(wh)?(Gl=wh,rh.addEventListener("message",bh,!1)):Gl=yh in ah("script")?function(e){oh.appendChild(ah("script")).onreadystatechange=function(){oh.removeChild(this),mh(e)}}:function(e){setTimeout(gh(e),0)});var xh,kh,Sh,_h,Th,Oh,Ah,Eh,Rh={set:ch,clear:fh},Ph=n,jh=/ipad|iphone|ipod/i.test(A)&&void 0!==Ph.Pebble,Ih=/web0s(?!.*chrome)/i.test(A),Lh=n,Ch=i.f,Mh=Rh.set,Dh=eh,Uh=jh,Bh=Ih,Nh=th,Fh=Lh.MutationObserver||Lh.WebKitMutationObserver,qh=Lh.document,zh=Lh.process,Vh=Lh.Promise,Hh=Ch(Lh,"queueMicrotask"),Yh=Hh&&Hh.value;Yh||(xh=function(){var e,t;for(Nh&&(e=zh.domain)&&e.exit();kh;){t=kh.fn,kh=kh.next;try{t()}catch(e){throw kh?_h():Sh=void 0,e}}Sh=void 0,e&&e.enter()},Dh||Nh||Bh||!Fh||!qh?!Uh&&Vh&&Vh.resolve?((Ah=Vh.resolve(void 0)).constructor=Vh,Eh=Ah.then,_h=function(){Eh.call(Ah,xh)}):_h=Nh?function(){zh.nextTick(xh)}:function(){Mh.call(Lh,xh)}:(Th=!0,Oh=qh.createTextNode(""),new Fh(xh).observe(Oh,{characterData:!0}),_h=function(){Oh.data=Th=!Th}));var Gh=Yh||function(e){var t={fn:e,next:void 0};Sh&&(Sh.next=t),kh||(kh=t,_h()),Sh=t},$h={},Wh=Ar,Qh=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=Wh(t),this.reject=Wh(r)};$h.f=function(e){return new Qh(e)};var Kh,Xh,Jh,Zh,ed=Ue,td=S,rd=$h,nd=function(e,t){if(ed(e),td(t)&&t.constructor===e)return t;var r=rd.f(e);return(0,r.resolve)(t),r.promise},id=n,od="object"==typeof window,ad=Or,ud=n,sd=O,cd=El,fd=Ge.exports,ld=Hs,hd=Ga,dd=Ln,pd=Ll,vd=S,yd=Ar,md=ns,gd=Je,bd=function(e,t,r){var n,i,o,a,u,s,c,f=r&&r.that,l=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_ITERATOR),d=!(!r||!r.INTERRUPTED),p=Ul(t,f,1+l+d),v=function(e){return n&&Nl(n),new Fl(!0,e)},y=function(e){return l?(Cl(e),d?p(e[0],e[1],v):p(e[0],e[1])):d?p(e,v):p(e)};if(h)n=e;else{if("function"!=typeof(i=Bl(e)))throw TypeError("Target is not iterable");if(Ml(i)){for(o=0,a=Dl(e.length);a>o;o++)if((u=y(e[o]))&&u instanceof Fl)return u;return new Fl(!1)}n=i.call(e)}for(s=n.next;!(c=s.call(n)).done;){try{u=y(c.value)}catch(e){throw Nl(n),e}if("object"==typeof u&&u&&u instanceof Fl)return u}return new Fl(!1)},wd=Ql,xd=Zl,kd=Rh.set,Sd=Gh,_d=nd,Td=function(e,t){var r=id.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))},Od=$h,Ad=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Ed=xt,Rd=gr,Pd=od,jd=th,Id=C,Ld=he("species"),Cd="Promise",Md=Ed.get,Dd=Ed.set,Ud=Ed.getterFor(Cd),Bd=cd&&cd.prototype,Nd=cd,Fd=Bd,qd=ud.TypeError,zd=ud.document,Vd=ud.process,Hd=Od.f,Yd=Hd,Gd=!!(zd&&zd.createEvent&&ud.dispatchEvent),$d="function"==typeof PromiseRejectionEvent,Wd="unhandledrejection",Qd=!1,Kd=Rd(Cd,(function(){var e=gd(Nd),t=e!==String(Nd);if(!t&&66===Id)return!0;if(Id>=51&&/native code/.test(e))return!1;var r=new Nd((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[Ld]=n,!(Qd=r.then((function(){}))instanceof n)||!t&&Pd&&!$d})),Xd=Kd||!wd((function(e){Nd.all(e).catch((function(){}))})),Jd=function(e){var t;return!(!vd(e)||"function"!=typeof(t=e.then))&&t},Zd=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;Sd((function(){for(var n=e.value,i=1==e.state,o=0;r.length>o;){var a,u,s,c=r[o++],f=i?c.ok:c.fail,l=c.resolve,h=c.reject,d=c.domain;try{f?(i||(2===e.rejection&&np(e),e.rejection=1),!0===f?a=n:(d&&d.enter(),a=f(n),d&&(d.exit(),s=!0)),a===c.promise?h(qd("Promise-chain cycle")):(u=Jd(a))?u.call(a,l,h):l(a)):h(n)}catch(e){d&&!s&&d.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&tp(e)}))}},ep=function(e,t,r){var n,i;Gd?((n=zd.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),ud.dispatchEvent(n)):n={promise:t,reason:r},!$d&&(i=ud["on"+e])?i(n):e===Wd&&Td("Unhandled promise rejection",r)},tp=function(e){kd.call(ud,(function(){var t,r=e.facade,n=e.value;if(rp(e)&&(t=Ad((function(){jd?Vd.emit("unhandledRejection",n,r):ep(Wd,r,n)})),e.rejection=jd||rp(e)?2:1,t.error))throw t.value}))},rp=function(e){return 1!==e.rejection&&!e.parent},np=function(e){kd.call(ud,(function(){var t=e.facade;jd?Vd.emit("rejectionHandled",t):ep("rejectionhandled",t,e.value)}))},ip=function(e,t,r){return function(n){e(t,n,r)}},op=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Zd(e,!0))},ap=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw qd("Promise can't be resolved itself");var n=Jd(t);n?Sd((function(){var r={done:!1};try{n.call(t,ip(ap,r,e),ip(op,r,e))}catch(t){op(r,t,e)}})):(e.value=t,e.state=1,Zd(e,!1))}catch(t){op({done:!1},t,e)}}};if(Kd&&(Fd=(Nd=function(e){md(this,Nd,Cd),yd(e),Kh.call(this);var t=Md(this);try{e(ip(ap,t),ip(op,t))}catch(e){op(t,e)}}).prototype,(Kh=function(e){Dd(this,{type:Cd,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=ld(Fd,{then:function(e,t){var r=Ud(this),n=Hd(xd(this,Nd));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=jd?Vd.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&Zd(r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),Xh=function(){var e=new Kh,t=Md(e);this.promise=e,this.resolve=ip(ap,t),this.reject=ip(op,t)},Od.f=Hd=function(e){return e===Nd||e===Jh?new Xh(e):Yd(e)},"function"==typeof cd&&Bd!==Object.prototype)){Zh=Bd.then,Qd||(fd(Bd,"then",(function(e,t){var r=this;return new Nd((function(e,t){Zh.call(r,e,t)})).then(e,t)}),{unsafe:!0}),fd(Bd,"catch",Fd.catch,{unsafe:!0}));try{delete Bd.constructor}catch(e){}hd&&hd(Bd,Fd)}ad({global:!0,wrap:!0,forced:Kd},{Promise:Nd}),dd(Nd,Cd,!1),pd(Cd),Jh=sd(Cd),ad({target:Cd,stat:!0,forced:Kd},{reject:function(e){var t=Hd(this);return t.reject.call(void 0,e),t.promise}}),ad({target:Cd,stat:!0,forced:Kd},{resolve:function(e){return _d(this,e)}}),ad({target:Cd,stat:!0,forced:Xd},{all:function(e){var t=this,r=Hd(t),n=r.resolve,i=r.reject,o=Ad((function(){var r=yd(t.resolve),o=[],a=0,u=1;bd(e,(function(e){var s=a++,c=!1;o.push(void 0),u++,r.call(t,e).then((function(e){c||(c=!0,o[s]=e,--u||n(o))}),i)})),--u||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=Hd(t),n=r.reject,i=Ad((function(){var i=yd(t.resolve);bd(e,(function(e){i.call(t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var up=Ue,sp=function(){var e=up(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},cp={},fp=o,lp=n.RegExp;cp.UNSUPPORTED_Y=fp((function(){var e=lp("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),cp.BROKEN_CARET=fp((function(){var e=lp("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var hp,dp,pp=o,vp=n.RegExp,yp=pp((function(){var e=vp(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),mp=o,gp=n.RegExp,bp=mp((function(){var e=gp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),wp=mn,xp=sp,kp=cp,Sp=z.exports,_p=$r,Tp=xt.get,Op=yp,Ap=bp,Ep=RegExp.prototype.exec,Rp=Sp("native-string-replace",String.prototype.replace),Pp=Ep,jp=(hp=/a/,dp=/b*/g,Ep.call(hp,"a"),Ep.call(dp,"a"),0!==hp.lastIndex||0!==dp.lastIndex),Ip=kp.UNSUPPORTED_Y||kp.BROKEN_CARET,Lp=void 0!==/()??/.exec("")[1];(jp||Lp||Ip||Op||Ap)&&(Pp=function(e){var t,r,n,i,o,a,u,s=this,c=Tp(s),f=wp(e),l=c.raw;if(l)return l.lastIndex=s.lastIndex,t=Pp.call(l,f),s.lastIndex=l.lastIndex,t;var h=c.groups,d=Ip&&s.sticky,p=xp.call(s),v=s.source,y=0,m=f;if(d&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),m=f.slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==f.charAt(s.lastIndex-1))&&(v="(?: "+v+")",m=" "+m,y++),r=new RegExp("^(?:"+v+")",p)),Lp&&(r=new RegExp("^"+v+"$(?!\\s)",p)),jp&&(n=s.lastIndex),i=Ep.call(d?r:s,m),d?i?(i.input=i.input.slice(y),i[0]=i[0].slice(y),i.index=s.lastIndex,s.lastIndex+=i[0].length):s.lastIndex=0:jp&&i&&(s.lastIndex=s.global?i.index+i[0].length:n),Lp&&i&&i.length>1&&Rp.call(i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&h)for(i.groups=a=_p(null),o=0;o<h.length;o++)a[(u=h[o])[0]]=i[u[1]];return i});var Cp=Pp;function Mp(){var e,t,r=new Promise((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}Or({target:"RegExp",proto:!0,forced:/./.exec!==Cp},{exec:Cp});var Dp,Up=function(){function e(){Co(this,e)}return Do(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(e){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,i=e.length;n<i;n++){var o=r.length;if(o&&t){var a=r[o-1],u=a[1];if(e.start(n)-u<=t){var s=e.end(n);s>u&&(a[1]=s)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"length",value:function(e){return e&&e.length?e.reduce((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,o=0,a=0,u=0,s=0,c=0,f=0,l=e.buffers(t,n),h=0,d=l.length;h<d;h++){var p=l[h];if(r+n>=p[0]&&r<p[1])i=p[0],o=p[1],a=h;else{if(r+n<p[0]){u=p[0],s=p[1];break}r+n>p[1]&&(c=p[0],f=p[1])}}return{start:i,end:o,index:a,buffers:l,nextStart:u,nextEnd:s,prevStart:c,prevEnd:f,currentTime:r,behind:r-i,remaining:o?o-r:0,length:e.length&&e.length(l)}}}]),e}();function Bp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}var Np="network",Fp="network_timeout",qp="demux",zp="remux",Vp="media",Hp="other",Yp={FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",OPTION:"OPTION"},Gp=(Vo(Dp={},"manifest",{HLS:1100}),Vo(Dp,Np,2100),Vo(Dp,Fp,2101),Vo(Dp,qp,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400}),Vo(Dp,zp,{FMP4:4100,MP4:4200}),Vo(Dp,Vp,{MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202}),Vo(Dp,Hp,8e3),Dp),$p=function(e){No(r,e);var t=Bp(r);function r(e,n,i,o,a){var u;return Co(this,r),(u=t.call(this,a||(null==i?void 0:i.message))).errorType=e===Fp?Np:e,u.originError=i,u.ext=o,u.errorCode=Gp[e][n]||Gp[e],u.errorMessage=u.message,u.errorCode||(u.errorType=Hp,u.errorCode=Gp[u.errorType]),u}return Do(r,null,[{key:"create",value:function(e,t,n,i,o){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=Hp),new r(e,t,n,i,o))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?Fp:Np,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}(fa(Error)),Wp="undefined"!=typeof window?window.MediaSource||window.WebKitMediaSource:null,Qp={UPDATE_ERROR:"updateError"},Kp=function(){function e(t){var r=this;Co(this,e),Vo(this,"media",null),Vo(this,"mediaSource",null),Vo(this,"_openPromise",Mp()),Vo(this,"_queue",Object.create(null)),Vo(this,"_sourceBuffer",Object.create(null)),Vo(this,"_onSBUpdateEnd",(function(e){var t=r._queue[e];if(t){var n=t.shift();n&&(n.promise.resolve(),r._startQueue(e))}})),Vo(this,"_onSBUpdateError",(function(e,t){var n=r._queue[e];if(n){var i=n[0];i&&i.promise.reject(new $p(Vp,Yp.MSE_APPEND_BUFFER,t))}})),t&&this.bindMedia(t)}var t,r,n;return Do(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"updateDuration",value:function(e){var t=this;return this._enqueueBlockingOp((function(){t.mediaSource&&(t.mediaSource.duration=e)}))}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){t.removeEventListener("sourceopen",r),e._openPromise.resolve()})),this._openPromise=Mp()}return this._openPromise}},{key:"bindMedia",value:(n=ua(ha.mark((function e(t){var r,n,i=this;return ha.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(t&&Wp){e.next=5;break}throw new Error("Param media or MediaSource does not exist");case 5:return this.media=t,r=this.mediaSource=new Wp,t.src=URL.createObjectURL(r),n=function e(){r.removeEventListener("sourceopen",e),URL.revokeObjectURL(t.src),i._openPromise.resolve()},r.addEventListener("sourceopen",n),e.abrupt("return",this._openPromise);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unbindMedia",value:(r=ua(ha.mark((function e(){var t,r=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){if(Object.keys(this._queue).forEach((function(e){var t=r._queue[e];t&&t.forEach((function(e){return e.promise.resolve}))})),"open"===t.readyState)try{t.endOfStream()}catch(e){}Object.keys(this._sourceBuffer).forEach((function(e){try{t.removeSourceBuffer(r._sourceBuffer[e])}catch(e){}}))}if(this.media){this.media.removeAttribute("src");try{this.media.load()}catch(e){}this.media=null}this.mediaSource=null,this._openPromise=Mp(),this._queue=Object.create(null),this._sourceBuffer=Object.create(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){if(!this._sourceBuffer[e]&&this.mediaSource){var r;try{r=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(e){throw new $p(Vp,Yp.MSE_ADD_SB,e)}r.mimeType=t,r.addEventListener("updateend",this._onSBUpdateEnd.bind(this,e)),r.addEventListener("error",this._onSBUpdateError.bind(this,e))}}},{key:"changeType",value:function(e,t){var r=this._sourceBuffer[e];return this.mediaSource&&r&&r.mimeType!==t&&"function"==typeof r.changeType?this._enqueueOp((function(){r.changeType(t)})):Promise.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t){var r=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){r.mediaSource&&r._sourceBuffer[e].appendBuffer(t)})):Promise.resolve()}},{key:"remove",value:function(e,t,r){var n=this;if(1!==Object.keys(this._sourceBuffer).length)return this._enqueueOp(e,(function(){if(n.mediaSource){var i=n._sourceBuffer[e];t>=r||!i?n._onSBUpdateEnd(e):i.remove(t,r)}}))}},{key:"clearBuffer",value:function(e,t){var r,n=this;return Object.keys(this._sourceBuffer).forEach((function(i){r=n._enqueueOp(i,(function(){n.mediaSource&&n._sourceBuffer[i].remove(e,t)}))})),r}},{key:"clearAllBuffer",value:function(){var e,t=this;return Object.keys(this._sourceBuffer).forEach((function(r){e=t._enqueueOp(r,(function(){if(t.mediaSource){var e=t._sourceBuffer[r];e.remove(0,Up.end(Up.get(e)))}}))})),e}},{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&&(e?r.endOfStream(e):r.endOfStream())})):Promise.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:"buffered",value:function(e){return Up.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return Up.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return Up.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t){if(!this.mediaSource)return Promise.resolve();var r=this._queue[e]=this._queue[e]||[],n={exec:t,promise:Mp()};return r.push(n),1===r.length&&this._startQueue(e),n.promise}},{key:"_enqueueBlockingOp",value:(t=ua(ha.mark((function e(t){var r,n,i=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if((r=Object.keys(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return n=[],r.forEach((function(e){var t=i._queue[e],r=Mp();n.push(r),t.push({exec:function(){return r.resolve()},promise:r}),1===t.length&&i._startQueue(e)})),e.abrupt("return",Promise.all(n).then((function(){try{return t()}finally{r.forEach((function(e){var t=i._queue[e],r=i._sourceBuffer[e];null==t||t.shift(),r&&r.updating||i._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r)try{r.exec()}catch(n){r.promise.reject(new $p(Vp,Yp.MSE_OTHER,n)),t.shift(),this._startQueue(e)}}}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!Wp)return!1;try{return Wp.isTypeSupported(e)}catch(e){return!1}}}]),e}();Vo(Kp,"VIDEO","video"),Vo(Kp,"AUDIO","audio");var Xp=ds;Or({target:"Object",stat:!0,forced:Object.assign!==Xp},{assign:Xp});var Jp=Wn.map;Or({target:"Array",proto:!0,forced:!ao("map")},{map:function(e){return Jp(this,e,arguments.length>1?arguments[1]:void 0)}});var Zp=Or,ev=El,tv=o,rv=O,nv=Zl,iv=nd,ov=Ge.exports;if(Zp({target:"Promise",proto:!0,real:!0,forced:!!ev&&tv((function(){ev.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=nv(this,rv("Promise")),r="function"==typeof e;return this.then(r?function(r){return iv(t,e()).then((function(){return r}))}:e,r?function(r){return iv(t,e()).then((function(){throw r}))}:e)}}),"function"==typeof ev){var av=rv("Promise").prototype.finally;ev.prototype.finally!==av&&ov(ev.prototype,"finally",av,{unsafe:!0})}var uv,sv,cv,fv={exports:{}},lv="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,hv=lv,dv=a,pv=n,vv=S,yv=Z,mv=_u,gv=Ye,bv=Ge.exports,wv=Me.f,xv=Ea,kv=Ga,Sv=he,_v=re,Tv=pv.Int8Array,Ov=Tv&&Tv.prototype,Av=pv.Uint8ClampedArray,Ev=Av&&Av.prototype,Rv=Tv&&xv(Tv),Pv=Ov&&xv(Ov),jv=Object.prototype,Iv=jv.isPrototypeOf,Lv=Sv("toStringTag"),Cv=_v("TYPED_ARRAY_TAG"),Mv=_v("TYPED_ARRAY_CONSTRUCTOR"),Dv=hv&&!!kv&&"Opera"!==mv(pv.opera),Uv=!1,Bv={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Nv={BigInt64Array:8,BigUint64Array:8},Fv=function(e){if(!vv(e))return!1;var t=mv(e);return yv(Bv,t)||yv(Nv,t)};for(uv in Bv)(cv=(sv=pv[uv])&&sv.prototype)?gv(cv,Mv,sv):Dv=!1;for(uv in Nv)(cv=(sv=pv[uv])&&sv.prototype)&&gv(cv,Mv,sv);if((!Dv||"function"!=typeof Rv||Rv===Function.prototype)&&(Rv=function(){throw TypeError("Incorrect invocation")},Dv))for(uv in Bv)pv[uv]&&kv(pv[uv],Rv);if((!Dv||!Pv||Pv===jv)&&(Pv=Rv.prototype,Dv))for(uv in Bv)pv[uv]&&kv(pv[uv].prototype,Pv);if(Dv&&xv(Ev)!==Pv&&kv(Ev,Pv),dv&&!yv(Pv,Lv))for(uv in Uv=!0,wv(Pv,Lv,{get:function(){return vv(this)?this[Cv]:void 0}}),Bv)pv[uv]&&gv(pv[uv],Cv,uv);var qv={NATIVE_ARRAY_BUFFER_VIEWS:Dv,TYPED_ARRAY_CONSTRUCTOR:Mv,TYPED_ARRAY_TAG:Uv&&Cv,aTypedArray:function(e){if(Fv(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(kv&&!Iv.call(Rv,e))throw TypeError("Target is not a typed array constructor");return e},exportTypedArrayMethod:function(e,t,r){if(dv){if(r)for(var n in Bv){var i=pv[n];if(i&&yv(i.prototype,e))try{delete i.prototype[e]}catch(e){}}Pv[e]&&!r||bv(Pv,e,r?t:Dv&&Ov[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(dv){if(kv){if(r)for(n in Bv)if((i=pv[n])&&yv(i,e))try{delete i[e]}catch(e){}if(Rv[e]&&!r)return;try{return bv(Rv,e,r?t:Dv&&Rv[e]||t)}catch(e){}}for(n in Bv)!(i=pv[n])||i[e]&&!r||bv(i,e,t)}},isView:function(e){if(!vv(e))return!1;var t=mv(e);return"DataView"===t||yv(Bv,t)||yv(Nv,t)},isTypedArray:Fv,TypedArray:Rv,TypedArrayPrototype:Pv},zv=n,Vv=o,Hv=Ql,Yv=qv.NATIVE_ARRAY_BUFFER_VIEWS,Gv=zv.ArrayBuffer,$v=zv.Int8Array,Wv=!Yv||!Vv((function(){$v(1)}))||!Vv((function(){new $v(-1)}))||!Hv((function(e){new $v,new $v(null),new $v(1.5),new $v(e)}),!0)||Vv((function(){return 1!==new $v(new Gv(2),1,void 0).length})),Qv=Lt,Kv=Dt,Xv=function(e){if(void 0===e)return 0;var t=Qv(e),r=Kv(t);if(t!==r)throw RangeError("Wrong length or index");return r},Jv=Math.abs,Zv=Math.pow,ey=Math.floor,ty=Math.log,ry=Math.LN2,ny=K,iy=Ft,oy=Dt,ay=function(e){for(var t=ny(this),r=oy(t.length),n=arguments.length,i=iy(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:iy(o,r);a>i;)t[i++]=e;return t},uy=n,sy=a,cy=lv,fy=Ye,ly=Hs,hy=o,dy=ns,py=Lt,vy=Dt,yy=Xv,my={pack:function(e,t,r){var n,i,o,a=new Array(r),u=8*r-t-1,s=(1<<u)-1,c=s>>1,f=23===t?Zv(2,-24)-Zv(2,-77):0,l=e<0||0===e&&1/e<0?1:0,h=0;for((e=Jv(e))!=e||e===1/0?(i=e!=e?1:0,n=s):(n=ey(ty(e)/ry),e*(o=Zv(2,-n))<1&&(n--,o*=2),(e+=n+c>=1?f/o:f*Zv(2,1-c))*o>=2&&(n++,o/=2),n+c>=s?(i=0,n=s):n+c>=1?(i=(e*o-1)*Zv(2,t),n+=c):(i=e*Zv(2,c-1)*Zv(2,t),n=0));t>=8;a[h++]=255&i,i/=256,t-=8);for(n=n<<t|i,u+=t;u>0;a[h++]=255&n,n/=256,u-=8);return a[--h]|=128*l,a},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=e[s--],f=127&c;for(c>>=7;u>0;f=256*f+e[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=t;u>0;r=256*r+e[s],s--,u-=8);if(0===f)f=1-a;else{if(f===o)return r?NaN:c?-1/0:1/0;r+=Zv(2,t),f-=a}return(c?-1:1)*r*Zv(2,f-t)}},gy=Ea,by=Ga,wy=Pt.f,xy=Me.f,ky=ay,Sy=Ln,_y=xt.get,Ty=xt.set,Oy="ArrayBuffer",Ay="DataView",Ey="Wrong index",Ry=uy.ArrayBuffer,Py=Ry,jy=uy.DataView,Iy=jy&&jy.prototype,Ly=Object.prototype,Cy=uy.RangeError,My=my.pack,Dy=my.unpack,Uy=function(e){return[255&e]},By=function(e){return[255&e,e>>8&255]},Ny=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Fy=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},qy=function(e){return My(e,23,4)},zy=function(e){return My(e,52,8)},Vy=function(e,t){xy(e.prototype,t,{get:function(){return _y(this)[t]}})},Hy=function(e,t,r,n){var i=yy(r),o=_y(e);if(i+t>o.byteLength)throw Cy(Ey);var a=_y(o.buffer).bytes,u=i+o.byteOffset,s=a.slice(u,u+t);return n?s:s.reverse()},Yy=function(e,t,r,n,i,o){var a=yy(r),u=_y(e);if(a+t>u.byteLength)throw Cy(Ey);for(var s=_y(u.buffer).bytes,c=a+u.byteOffset,f=n(+i),l=0;l<t;l++)s[c+l]=f[o?l:t-l-1]};if(cy){if(!hy((function(){Ry(1)}))||!hy((function(){new Ry(-1)}))||hy((function(){return new Ry,new Ry(1.5),new Ry(NaN),Ry.name!=Oy}))){for(var Gy,$y=(Py=function(e){return dy(this,Py),new Ry(yy(e))}).prototype=Ry.prototype,Wy=wy(Ry),Qy=0;Wy.length>Qy;)(Gy=Wy[Qy++])in Py||fy(Py,Gy,Ry[Gy]);$y.constructor=Py}by&&gy(Iy)!==Ly&&by(Iy,Ly);var Ky=new jy(new Py(2)),Xy=Iy.setInt8;Ky.setInt8(0,2147483648),Ky.setInt8(1,2147483649),!Ky.getInt8(0)&&Ky.getInt8(1)||ly(Iy,{setInt8:function(e,t){Xy.call(this,e,t<<24>>24)},setUint8:function(e,t){Xy.call(this,e,t<<24>>24)}},{unsafe:!0})}else Py=function(e){dy(this,Py,Oy);var t=yy(e);Ty(this,{bytes:ky.call(new Array(t),0),byteLength:t}),sy||(this.byteLength=t)},jy=function(e,t,r){dy(this,jy,Ay),dy(e,Py,Ay);var n=_y(e).byteLength,i=py(t);if(i<0||i>n)throw Cy("Wrong offset");if(i+(r=void 0===r?n-i:vy(r))>n)throw Cy("Wrong length");Ty(this,{buffer:e,byteLength:r,byteOffset:i}),sy||(this.buffer=e,this.byteLength=r,this.byteOffset=i)},sy&&(Vy(Py,"byteLength"),Vy(jy,"buffer"),Vy(jy,"byteLength"),Vy(jy,"byteOffset")),ly(jy.prototype,{getInt8:function(e){return Hy(this,1,e)[0]<<24>>24},getUint8:function(e){return Hy(this,1,e)[0]},getInt16:function(e){var t=Hy(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Hy(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Fy(Hy(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Fy(Hy(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Dy(Hy(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Dy(Hy(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Yy(this,1,e,Uy,t)},setUint8:function(e,t){Yy(this,1,e,Uy,t)},setInt16:function(e,t){Yy(this,2,e,By,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Yy(this,2,e,By,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Yy(this,4,e,Ny,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Yy(this,4,e,Ny,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Yy(this,4,e,qy,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Yy(this,8,e,zy,t,arguments.length>2?arguments[2]:void 0)}});Sy(Py,Oy),Sy(jy,Ay);var Jy={ArrayBuffer:Py,DataView:jy},Zy=S,em=Math.floor,tm=Lt,rm=function(e){var t=tm(e);if(t<0)throw RangeError("The argument can't be less than 0");return t},nm=function(e,t){var r=rm(e);if(r%t)throw RangeError("Wrong offset");return r},im=K,om=Dt,am=Ts,um=xs,sm=Mn,cm=qv.aTypedArrayConstructor,fm=S,lm=Ga,hm=function(e,t,r){var n,i;return lm&&"function"==typeof(n=t.constructor)&&n!==r&&fm(i=n.prototype)&&i!==r.prototype&&lm(e,i),e},dm=Or,pm=n,vm=a,ym=Wv,mm=qv,gm=Jy,bm=ns,wm=d,xm=Ye,km=function(e){return!Zy(e)&&isFinite(e)&&em(e)===e},Sm=Dt,_m=Xv,Tm=nm,Om=we,Am=Z,Em=_u,Rm=S,Pm=F,jm=$r,Im=Ga,Lm=Pt.f,Cm=function(e){var t,r,n,i,o,a,u=im(e),s=arguments.length,c=s>1?arguments[1]:void 0,f=void 0!==c,l=am(u);if(null!=l&&!um(l))for(a=(o=l.call(u)).next,u=[];!(i=a.call(o)).done;)u.push(i.value);for(f&&s>2&&(c=sm(c,arguments[2],2)),r=om(u.length),n=new(cm(this))(r),t=0;r>t;t++)n[t]=f?c(u[t],t):u[t];return n},Mm=Wn.forEach,Dm=Ll,Um=Me,Bm=i,Nm=hm,Fm=xt.get,qm=xt.set,zm=Um.f,Vm=Bm.f,Hm=Math.round,Ym=pm.RangeError,Gm=gm.ArrayBuffer,$m=gm.DataView,Wm=mm.NATIVE_ARRAY_BUFFER_VIEWS,Qm=mm.TYPED_ARRAY_CONSTRUCTOR,Km=mm.TYPED_ARRAY_TAG,Xm=mm.TypedArray,Jm=mm.TypedArrayPrototype,Zm=mm.aTypedArrayConstructor,eg=mm.isTypedArray,tg="BYTES_PER_ELEMENT",rg="Wrong length",ng=function(e,t){for(var r=0,n=t.length,i=new(Zm(e))(n);n>r;)i[r]=t[r++];return i},ig=function(e,t){zm(e,t,{get:function(){return Fm(this)[t]}})},og=function(e){var t;return e instanceof Gm||"ArrayBuffer"==(t=Em(e))||"SharedArrayBuffer"==t},ag=function(e,t){return eg(e)&&!Pm(t)&&t in e&&km(+t)&&t>=0},ug=function(e,t){return t=Om(t),ag(e,t)?wm(2,e[t]):Vm(e,t)},sg=function(e,t,r){return t=Om(t),!(ag(e,t)&&Rm(r)&&Am(r,"value"))||Am(r,"get")||Am(r,"set")||r.configurable||Am(r,"writable")&&!r.writable||Am(r,"enumerable")&&!r.enumerable?zm(e,t,r):(e[t]=r.value,e)};vm?(Wm||(Bm.f=ug,Um.f=sg,ig(Jm,"buffer"),ig(Jm,"byteOffset"),ig(Jm,"byteLength"),ig(Jm,"length")),dm({target:"Object",stat:!0,forced:!Wm},{getOwnPropertyDescriptor:ug,defineProperty:sg}),fv.exports=function(e,t,r){var n=e.match(/\d+$/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,a="set"+e,u=pm[i],s=u,c=s&&s.prototype,f={},l=function(e,t){zm(e,t,{get:function(){return function(e,t){var r=Fm(e);return r.view[o](t*n+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=Fm(e);r&&(i=(i=Hm(i))<0?0:i>255?255:255&i),o.view[a](t*n+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};Wm?ym&&(s=t((function(e,t,r,o){return bm(e,s,i),Nm(Rm(t)?og(t)?void 0!==o?new u(t,Tm(r,n),o):void 0!==r?new u(t,Tm(r,n)):new u(t):eg(t)?ng(s,t):Cm.call(s,t):new u(_m(t)),e,s)})),Im&&Im(s,Xm),Mm(Lm(u),(function(e){e in s||xm(s,e,u[e])})),s.prototype=c):(s=t((function(e,t,r,o){bm(e,s,i);var a,u,c,f=0,h=0;if(Rm(t)){if(!og(t))return eg(t)?ng(s,t):Cm.call(s,t);a=t,h=Tm(r,n);var d=t.byteLength;if(void 0===o){if(d%n)throw Ym(rg);if((u=d-h)<0)throw Ym(rg)}else if((u=Sm(o)*n)+h>d)throw Ym(rg);c=u/n}else c=_m(t),a=new Gm(u=c*n);for(qm(e,{buffer:a,byteOffset:h,byteLength:u,length:c,view:new $m(a)});f<c;)l(e,f++)})),Im&&Im(s,Xm),c=s.prototype=jm(Jm)),c.constructor!==s&&xm(c,"constructor",s),xm(c,Qm,s),Km&&xm(c,Km,i),f[i]=s,dm({global:!0,forced:s!=u,sham:!Wm},f),tg in s||xm(s,tg,n),tg in c||xm(c,tg,n),Dm(i)}):fv.exports=function(){},(0,fv.exports)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var cg=K,fg=Ft,lg=Dt,hg=Math.min,dg=[].copyWithin||function(e,t){var r=cg(this),n=lg(r.length),i=fg(e,n),o=fg(t,n),a=arguments.length>2?arguments[2]:void 0,u=hg((void 0===a?n:fg(a,n))-o,n-i),s=1;for(o<i&&i<o+u&&(s=-1,o+=u-1,i+=u-1);u-- >0;)o in r?r[i]=r[o]:delete r[i],i+=s,o+=s;return r},pg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("copyWithin",(function(e,t){return dg.call(pg(this),e,t,arguments.length>2?arguments[2]:void 0)}));var vg=Wn.every,yg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("every",(function(e){return vg(yg(this),e,arguments.length>1?arguments[1]:void 0)}));var mg=ay,gg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("fill",(function(e){return mg.apply(gg(this),arguments)}));var bg=Zl,wg=qv.TYPED_ARRAY_CONSTRUCTOR,xg=qv.aTypedArrayConstructor,kg=function(e){return xg(bg(e,e[wg]))},Sg=function(e,t){for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},_g=kg,Tg=Wn.filter,Og=function(e,t){return Sg(_g(e),t)},Ag=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("filter",(function(e){var t=Tg(Ag(this),e,arguments.length>1?arguments[1]:void 0);return Og(this,t)}));var Eg=Wn.find,Rg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("find",(function(e){return Eg(Rg(this),e,arguments.length>1?arguments[1]:void 0)}));var Pg=Wn.findIndex,jg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("findIndex",(function(e){return Pg(jg(this),e,arguments.length>1?arguments[1]:void 0)}));var Ig=Wn.forEach,Lg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("forEach",(function(e){Ig(Lg(this),e,arguments.length>1?arguments[1]:void 0)}));var Cg=Yt.includes,Mg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("includes",(function(e){return Cg(Mg(this),e,arguments.length>1?arguments[1]:void 0)}));var Dg=Yt.indexOf,Ug=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("indexOf",(function(e){return Dg(Ug(this),e,arguments.length>1?arguments[1]:void 0)}));var Bg=n,Ng=qv,Fg=mu,qg=he("iterator"),zg=Bg.Uint8Array,Vg=Fg.values,Hg=Fg.keys,Yg=Fg.entries,Gg=Ng.aTypedArray,$g=Ng.exportTypedArrayMethod,Wg=zg&&zg.prototype[qg],Qg=!!Wg&&("values"==Wg.name||null==Wg.name),Kg=function(){return Vg.call(Gg(this))};$g("entries",(function(){return Yg.call(Gg(this))})),$g("keys",(function(){return Hg.call(Gg(this))})),$g("values",Kg,!Qg),$g(qg,Kg,!Qg);var Xg=qv.aTypedArray,Jg=[].join;(0,qv.exportTypedArrayMethod)("join",(function(e){return Jg.apply(Xg(this),arguments)}));var Zg=k,eb=Lt,tb=Dt,rb=mo,nb=Math.min,ib=[].lastIndexOf,ob=!!ib&&1/[1].lastIndexOf(1,-0)<0,ab=rb("lastIndexOf"),ub=ob||!ab?function(e){if(ob)return ib.apply(this,arguments)||0;var t=Zg(this),r=tb(t.length),n=r-1;for(arguments.length>1&&(n=nb(n,eb(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:ib,sb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("lastIndexOf",(function(e){return ub.apply(sb(this),arguments)}));var cb=Wn.map,fb=kg,lb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("map",(function(e){return cb(lb(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(fb(e))(t)}))}));var hb=Ar,db=K,pb=g,vb=Dt,yb=function(e){return function(t,r,n,i){hb(r);var o=db(t),a=pb(o),u=vb(o.length),s=e?u-1:0,c=e?-1:1;if(n<2)for(;;){if(s in a){i=a[s],s+=c;break}if(s+=c,e?s<0:u<=s)throw TypeError("Reduce of empty array with no initial value")}for(;e?s>=0:u>s;s+=c)s in a&&(i=r(i,a[s],s,o));return i}},mb={left:yb(!1),right:yb(!0)},gb=mb.left,bb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("reduce",(function(e){return gb(bb(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var wb=mb.right,xb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("reduceRight",(function(e){return wb(xb(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var kb=qv.aTypedArray,Sb=qv.exportTypedArrayMethod,_b=Math.floor;Sb("reverse",(function(){for(var e,t=this,r=kb(t).length,n=_b(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}));var Tb=Dt,Ob=nm,Ab=K,Eb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("set",(function(e){Eb(this);var t=Ob(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=Ab(e),i=Tb(n.length),o=0;if(i+t>r)throw RangeError("Wrong length");for(;o<i;)this[t+o]=n[o++]}),o((function(){new Int8Array(1).set({})})));var Rb=kg,Pb=qv.aTypedArray,jb=[].slice;(0,qv.exportTypedArrayMethod)("slice",(function(e,t){for(var r=jb.call(Pb(this),e,t),n=Rb(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),o((function(){new Int8Array(1).slice()})));var Ib=Wn.some,Lb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("some",(function(e){return Ib(Lb(this),e,arguments.length>1?arguments[1]:void 0)}));var Cb=Math.floor,Mb=function(e,t){var r=e.length,n=Cb(r/2);return r<8?Db(e,t):Ub(Mb(e.slice(0,n),t),Mb(e.slice(n),t),t)},Db=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},Ub=function(e,t,r){for(var n=e.length,i=t.length,o=0,a=0,u=[];o<n||a<i;)o<n&&a<i?u.push(r(e[o],t[a])<=0?e[o++]:t[a++]):u.push(o<n?e[o++]:t[a++]);return u},Bb=Mb,Nb=A.match(/firefox\/(\d+)/i),Fb=!!Nb&&+Nb[1],qb=/MSIE|Trident/.test(A),zb=A.match(/AppleWebKit\/(\d+)\./),Vb=!!zb&&+zb[1],Hb=o,Yb=Ar,Gb=Dt,$b=Bb,Wb=Fb,Qb=qb,Kb=C,Xb=Vb,Jb=qv.aTypedArray,Zb=qv.exportTypedArrayMethod,ew=n.Uint16Array,tw=ew&&ew.prototype.sort,rw=!!tw&&!Hb((function(){var e=new ew(2);e.sort(null),e.sort({})})),nw=!!tw&&!Hb((function(){if(Kb)return Kb<74;if(Wb)return Wb<67;if(Qb)return!0;if(Xb)return Xb<602;var e,t,r=new ew(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(r.sort((function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));Zb("sort",(function(e){var t=this;if(void 0!==e&&Yb(e),nw)return tw.call(t,e);Jb(t);var r,n=Gb(t.length),i=Array(n);for(r=0;r<n;r++)i[r]=t[r];for(i=$b(t,function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e)),r=0;r<n;r++)t[r]=i[r];return t}),!nw||rw);var iw=Dt,ow=Ft,aw=kg,uw=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("subarray",(function(e,t){var r=uw(this),n=r.length,i=ow(e,n);return new(aw(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,iw((void 0===t?n:ow(t,n))-i))}));var sw=qv,cw=o,fw=n.Int8Array,lw=sw.aTypedArray,hw=sw.exportTypedArrayMethod,dw=[].toLocaleString,pw=[].slice,vw=!!fw&&cw((function(){dw.call(new fw(1))}));hw("toLocaleString",(function(){return dw.apply(vw?pw.call(lw(this)):lw(this),arguments)}),cw((function(){return[1,2].toLocaleString()!=new fw([1,2]).toLocaleString()}))||!cw((function(){fw.prototype.toLocaleString.call([1,2])})));var yw=qv.exportTypedArrayMethod,mw=o,gw=n.Uint8Array,bw=gw&&gw.prototype||{},ww=[].toString,xw=[].join;mw((function(){ww.call({})}))&&(ww=function(){return xw.call(this)});var kw=bw.toString!=ww;yw("toString",ww,kw);var Sw="fetch",_w="xhr",Tw="arraybuffer",Ow="text",Aw="json";function Ew(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}var Rw=function(e){No(r,e);var t=Ew(r);function r(e,n,i,o){var a;return Co(this,r),Vo(Uo(a=t.call(this,o)),"retryCount",0),Vo(Uo(a),"isTimeout",!1),Vo(Uo(a),"loaderType",Sw),Vo(Uo(a),"startTime",0),Vo(Uo(a),"endTime",0),a.url=e,a.request=n,a.response=i,a}return r}(fa(Error)),Pw=Ge.exports,jw=Cp,Iw=o,Lw=he,Cw=Ye,Mw=Lw("species"),Dw=RegExp.prototype,Uw=function(e,t,r,n){var i=Lw(e),o=!Iw((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!Iw((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Mw]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!a||r){var u=/./[i],s=t(i,""[e],(function(e,t,r,n,i){var a=t.exec;return a===jw||a===Dw.exec?o&&!i?{done:!0,value:u.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}));Pw(String.prototype,e,s[0]),Pw(Dw,i,s[1])}n&&Cw(Dw[i],"sham",!0)},Bw=Cu.charAt,Nw=function(e,t,r){return t+(r?Bw(e,t).length:1)},Fw=K,qw=Math.floor,zw="".replace,Vw=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Hw=/\$([$&'`]|\d{1,2})/g,Yw=v,Gw=Cp,$w=function(e,t){var r=e.exec;if("function"==typeof r){var n=r.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==Yw(e))throw TypeError("RegExp#exec called on incompatible receiver");return Gw.call(e,t)},Ww=Uw,Qw=o,Kw=Ue,Xw=Lt,Jw=Dt,Zw=mn,ex=b,tx=Nw,rx=function(e,t,r,n,i,o){var a=r+e.length,u=n.length,s=Hw;return void 0!==i&&(i=Fw(i),s=Vw),zw.call(o,s,(function(o,s){var c;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(a);case"<":c=i[s.slice(1,-1)];break;default:var f=+s;if(0===f)return o;if(f>u){var l=qw(f/10);return 0===l?o:l<=u?void 0===n[l-1]?s.charAt(1):n[l-1]+s.charAt(1):o}c=n[f-1]}return void 0===c?"":c}))},nx=$w,ix=he("replace"),ox=Math.max,ax=Math.min,ux="$0"==="a".replace(/./,"$0"),sx=!!/./[ix]&&""===/./[ix]("a","$0");Ww("replace",(function(e,t,r){var n=sx?"$":"$0";return[function(e,r){var n=ex(this),i=null==e?void 0:e[ix];return void 0!==i?i.call(e,n,r):t.call(Zw(n),e,r)},function(e,i){var o=Kw(this),a=Zw(e);if("string"==typeof i&&-1===i.indexOf(n)&&-1===i.indexOf("$<")){var u=r(t,o,a,i);if(u.done)return u.value}var s="function"==typeof i;s||(i=Zw(i));var c=o.global;if(c){var f=o.unicode;o.lastIndex=0}for(var l=[];;){var h=nx(o,a);if(null===h)break;if(l.push(h),!c)break;""===Zw(h[0])&&(o.lastIndex=tx(a,Jw(o.lastIndex),f))}for(var d,p="",v=0,y=0;y<l.length;y++){h=l[y];for(var m=Zw(h[0]),g=ox(ax(Xw(h.index),a.length),0),b=[],w=1;w<h.length;w++)b.push(void 0===(d=h[w])?d:String(d));var x=h.groups;if(s){var k=[m].concat(b,g,a);void 0!==x&&k.push(x);var S=Zw(i.apply(void 0,k))}else S=rx(m,a,g,b,x,i);g>=v&&(p+=a.slice(v,g)+S,v=g+m.length)}return p+a.slice(v)}]}),!!Qw((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!ux||sx);var cx=Or,fx=k,lx=[].join,hx=g!=Object,dx=mo("join",",");cx({target:"Array",proto:!0,forced:hx||!dx},{join:function(e){return lx.call(fx(this),void 0===e?",":e)}});var px=Or,vx=S,yx=vn,mx=Ft,gx=Dt,bx=k,wx=Ro,xx=he,kx=ao("slice"),Sx=xx("species"),_x=[].slice,Tx=Math.max;px({target:"Array",proto:!0,forced:!kx},{slice:function(e,t){var r,n,i,o=bx(this),a=gx(o.length),u=mx(e,a),s=mx(void 0===t?a:t,a);if(yx(o)&&("function"!=typeof(r=o.constructor)||r!==Array&&!yx(r.prototype)?vx(r)&&null===(r=r[Sx])&&(r=void 0):r=void 0,r===Array||void 0===r))return _x.call(o,u,s);for(n=new(void 0===r?Array:r)(Tx(s-u,0)),i=0;u<s;u++,i++)u in o&&wx(n,i,o[u]);return n.length=i,n}});var Ox=K,Ax=Ea,Ex=ka;Or({target:"Object",stat:!0,forced:o((function(){Ax(1)})),sham:!Ex},{getPrototypeOf:function(e){return Ax(Ox(e))}});var Rx=Object.prototype.toString;function Px(e){if("[object Object]"!==Rx.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function jx(e){if(e&&null!=e[0]&&(0!==e[0]||null!=e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function Ix(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Lx(e,t){if(e){if(!t)return e;var r,n=Object.keys(t).map((function(e){if(null!=(r=t[e]))return Array.isArray(r)?e+="[]":r=[r],r.map((function(t){var r;return r=t,"[object Date]"===Rx.call(r)?t=t.toISOString():function(e){return null!==e&&"object"===Fo(e)}(t)&&(t=JSON.stringify(t)),"".concat(Ix(e),"=").concat(Ix(t))})).join("&")})).filter(Boolean).join("&");if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}}function Cx(e,t,r,n,i,o){return n=null!=n?parseFloat(n):null,r=parseInt(r||"0",10),isNaN(r)&&(r=0),{data:e,response:t,contentLength:r,age:n,startTime:i,firstByteTime:o,endTime:Date.now()}}var Mx=function(){function e(){Co(this,e),Vo(this,"_abortController",null),Vo(this,"_timeoutTimer",null),Vo(this,"_reader",null),Vo(this,"_response",null),Vo(this,"_aborted",!1)}var t;return Do(e,[{key:"load",value:function(e){var t,r=this,n=e.url,i=e.timeout,o=e.responseType,a=e.onProgress,u=e.onTimeout,s=e.range,c=e.transformResponse,f=e.request,l=e.params,h=e.method,d=e.headers,p=e.body,v=e.mode,y=e.credentials,m=e.cache,g=e.redirect,b=e.referrer,w=e.referrerPolicy;this._aborted=!1,this._abortController="undefined"!=typeof AbortController&&new AbortController;var x={method:h,headers:d,body:p,mode:v,credentials:y,cache:m,redirect:g,referrer:b,referrerPolicy:w,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},k=!1;clearTimeout(this._timeoutTimer),n=Lx(n,l);var S=jx(s);S&&((d=f?f.headers:x.headers=x.headers||new Headers)instanceof Headers?d.append("Range",S):d.Range=S),i&&(this._timeoutTimer=setTimeout((function(){if(k=!0,r.cancel(),u){var e=new Rw(n,x);e.isTimeout=!0,u(e)}}),i));var _=Date.now();return fetch(f||n,f?void 0:x).then(function(){var e=ua(ha.mark((function e(t){var i,u;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=t,!r._aborted){e.next=4;break}return e.abrupt("return");case 4:if(c&&(t=c(t,n)||t),t.ok){e.next=7;break}throw new Rw(n,x,t,"bad network response");case 7:if(i=Date.now(),o!==Ow){e.next=14;break}return e.next=11,t.text();case 11:u=e.sent,e.next=28;break;case 14:if(o!==Aw){e.next=20;break}return e.next=17,t.json();case 17:u=e.sent,e.next=28;break;case 20:if(!a){e.next=24;break}r._loadChunk(t,a),e.next=28;break;case 24:return e.next=26,t.arrayBuffer();case 26:u=e.sent,u=new Uint8Array(u);case 28:return e.abrupt("return",Cx(u,t,t.headers.get("Content-Length"),t.headers.get("age"),_,i));case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){if(clearTimeout(r._timeoutTimer),!r._aborted||k)throw(e=e instanceof Rw?e:new Rw(n,x)).startTime=_,e.endTime=Date.now(),e.isTimeout=k,e}))}},{key:"cancel",value:(t=ua(ha.mark((function e(){return ha.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._response){e.next=13;break}if(e.prev=4,!this._reader){e.next=8;break}return e.next=8,this._reader.cancel();case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:this._response=this._reader=null;case 13:if(this._abortController){try{this._abortController.abort()}catch(e){}this._abortController=null}case 14:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t){var r,n,i,o=this,a=this._reader=e.body.getReader(),u=function(){var s=ua(ha.mark((function s(){return ha.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return n=Date.now(),s.prev=1,s.next=4,a.read();case 4:r=s.sent,i=Date.now(),s.next=13;break;case 8:return s.prev=8,s.t0=s.catch(1),i=Date.now(),t(void 0,!0,{startTime:n,endTime:i},e),s.abrupt("return");case 13:if(!o._aborted){s.next=16;break}return t(void 0,!0,{startTime:n,endTime:i},e),s.abrupt("return");case 16:t(r.value,r.done,{startTime:n,endTime:i},e),r.done||u();case 18:case"end":return s.stop()}}),s,null,[[1,8]])})));return function(){return s.apply(this,arguments)}}();u()}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),e}();function Dx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ux(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dx(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({loaderType:Sw,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:Ow,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},e)}function Bx(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var Nx=a,Fx=Me.f,qx=Function.prototype,zx=qx.toString,Vx=/^\s*function ([^ (]*)/,Hx="name";Nx&&!(Hx in qx)&&Fx(qx,Hx,{configurable:!0,get:function(){try{return zx.call(this).match(Vx)[1]}catch(e){return""}}});var Yx=Ls;Or({target:"Array",stat:!0,forced:!Ql((function(e){Array.from(e)}))},{from:Yx});var Gx=Or,$x=a,Wx=n,Qx=Z,Kx=S,Xx=Me.f,Jx=fr,Zx=Wx.Symbol;if($x&&"function"==typeof Zx&&(!("description"in Zx.prototype)||void 0!==Zx().description)){var ek={},tk=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof tk?new Zx(e):void 0===e?Zx():Zx(e);return""===e&&(ek[t]=!0),t};Jx(tk,Zx);var rk=tk.prototype=Zx.prototype;rk.constructor=tk;var nk=rk.toString,ik="Symbol(test)"==String(Zx("test")),ok=/^Symbol\((.*)\)[^)]+$/;Xx(rk,"description",{configurable:!0,get:function(){var e=Kx(this)?this.valueOf():this,t=nk.call(e);if(Qx(ek,e))return"";var r=ik?t.slice(7,-1):t.replace(ok,"$1");return""===r?void 0:r}}),Gx({global:!0,forced:!0},{Symbol:tk})}Rn("iterator");var ak=S,uk=v,sk=he("match"),ck=function(e){var t;return ak(e)&&(void 0!==(t=e[sk])?!!t:"RegExp"==uk(e))},fk=Uw,lk=ck,hk=Ue,dk=b,pk=Zl,vk=Nw,yk=Dt,mk=mn,gk=$w,bk=Cp,wk=o,xk=cp.UNSUPPORTED_Y,kk=[].push,Sk=Math.min,_k=4294967295;fk("split",(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=mk(dk(this)),i=void 0===r?_k:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!lk(e))return t.call(n,e,i);for(var o,a,u,s=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,l=new RegExp(e.source,c+"g");(o=bk.call(l,n))&&!((a=l.lastIndex)>f&&(s.push(n.slice(f,o.index)),o.length>1&&o.index<n.length&&kk.apply(s,o.slice(1)),u=o[0].length,f=a,s.length>=i));)l.lastIndex===o.index&&l.lastIndex++;return f===n.length?!u&&l.test("")||s.push(""):s.push(n.slice(f)),s.length>i?s.slice(0,i):s}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t,[function(t,r){var i=dk(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,r):n.call(mk(i),t,r)},function(e,i){var o=hk(this),a=mk(e),u=r(n,o,a,i,n!==t);if(u.done)return u.value;var s=pk(o,RegExp),c=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(xk?"g":"y"),l=new s(xk?"^(?:"+o.source+")":o,f),h=void 0===i?_k:i>>>0;if(0===h)return[];if(0===a.length)return null===gk(l,a)?[a]:[];for(var d=0,p=0,v=[];p<a.length;){l.lastIndex=xk?0:p;var y,m=gk(l,xk?a.slice(p):a);if(null===m||(y=Sk(yk(l.lastIndex+(xk?p:0)),a.length))===d)p=vk(a,p,c);else{if(v.push(a.slice(d,p)),v.length===h)return v;for(var g=1;g<=m.length-1;g++)if(v.push(m[g]),v.length===h)return v;p=d=y}}return v.push(a.slice(d)),v}]}),!!wk((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),xk);var Tk="\t\n\v\f\r                 \u2028\u2029\ufeff",Ok=b,Ak=mn,Ek="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Rk=RegExp("^"+Ek+Ek+"*"),Pk=RegExp(Ek+Ek+"*$"),jk=function(e){return function(t){var r=Ak(Ok(t));return 1&e&&(r=r.replace(Rk,"")),2&e&&(r=r.replace(Pk,"")),r}},Ik={start:jk(1),end:jk(2),trim:jk(3)},Lk=o,Ck=Tk,Mk=Ik.trim;function Dk(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Uk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uk(e,t)}(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 o,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function Uk(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}Or({target:"String",proto:!0,forced:function(e){return Lk((function(){return!!Ck[e]()||"​…᠎"!="​…᠎"[e]()||Ck[e].name!==e}))}("trim")},{trim:function(){return Mk(this)}});var Bk=function(){function e(){Co(this,e),Vo(this,"_xhr",null),Vo(this,"_aborted",!1),Vo(this,"_timeoutTimer",null)}return Do(e,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer);var r=e.url,n=e.params,i=e.timeout,o=e.responseType,a=e.onTimeout,u=e.transformResponse,s=e.onProgress,c=e.method,f=e.credentials,l=e.body,h=e.headers,d=e.range,p=e.request,v=!1;r=Lx(r,n);var y=Date.now();return new Promise((function(e,n){var m=t._xhr=new XMLHttpRequest;m.open(c||"GET",r,!0),m.responseType=o,m.withCredentials="include"===f||"same-origin"===f;var g=jx(d);g&&((h=h||{}).Range=g),h&&Object.keys(h).forEach((function(e){m.setRequestHeader(e,h[e])})),i&&(t._timeoutTimer=setTimeout((function(){if(v=!0,t.cancel(),a){var e=new Rw(r,p);e.isTimeout=!0,a(e)}}),i)),m.onerror=function(e){return n(e)},m.onreadystatechange=function(){if(m.readyState>=2){clearTimeout(t._timeoutTimer);var i=Date.now();if(4===m.readyState){if(m.onreadystatechange=null,t._aborted)return;var o=m.status,a={ok:o>=200&&o<300,status:o,statusText:m.statusText,url:m.responseURL,headers:t._getHeaders(m),body:m.response};if(u&&(a=u(a,r)||a),!a.ok)return n(new Rw(r,p,a,"bad network response"));var c=m.responseType===Tw,f=c?new Uint8Array(m.response):m.response;s&&s(c?f:void 0,!0,{startTime:y,endTime:Date.now()},a),e(Cx(f,a,a.headers["content-length"],a.headers.age,y,i))}}},m.send(l)})).catch((function(e){if(clearTimeout(t._timeoutTimer),!t._aborted||v)throw(e=e instanceof Rw?e:new Rw(r,p)).startTime=y,e.endTime=Date.now(),e.isTimeout=v,e}))}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._xhr?this._xhr.cancel():void 0}},{key:"_getHeaders",value:function(e){var t,r={},n=Dk(e.getAllResponseHeaders().trim().split("\r\n"));try{for(n.s();!(t=n.n()).done;){var i=t.value.split(": ");r[i[0].toLowerCase()]=i.slice(1).join(": ")}}catch(e){n.e(e)}finally{n.f()}return r}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),e}(),Nk=["retry","retryDelay","onRetryError","transformError"],Fk=function(){function e(t,r){Co(this,e),this.promise=Mp(),this.alive=!!r.onProgress,this._loaderType=t,this._loader=t===Sw?new Mx:new Bk,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1}var t;return Do(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,n=t.retryDelay,i=t.onRetryError,o=t.transformError,a=Bx(t,Nk),u=function(){var t=ua(ha.mark((function t(){var s,c;return ha.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:s=t.sent,e.promise.resolve(s),t.next=22;break;case 7:if(t.prev=7,t.t0=t.catch(0),!e._canceled){t.next=11;break}return t.abrupt("return");case 11:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,o&&(c=o(c)||c),i&&e._retryCount>0&&i(c,e._retryCount,r),e._retryCount++,!(e._retryCount<=r)){t.next=21;break}return clearTimeout(e._retryTimer),e._retryTimer=setTimeout(u,n),t.abrupt("return");case 21:e.promise.reject(c);case 22:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return u(),this.promise}},{key:"cancel",value:(t=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,e.abrupt("return",this._loader.cancel());case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();function qk(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=t.filter(Boolean)).length<2)return t[0];var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}function zk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var Vk=function(){function e(t){Co(this,e),Vo(this,"type",Sw),Vo(this,"_queue",[]),Vo(this,"_alive",[]),Vo(this,"_currentTask",null),this._config=Ux(t),this._config.loaderType!==_w&&Mx.isSupported()||(this.type=_w)}var t;return Do(e,[{key:"isFetch",value:function(){return this.type===Sw}},{key:"load",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?t=e:t.url=e||t.url||this._config.url,(t=Object.assign({},this._config,t)).params&&(t.params=Object.assign({},t.params)),t.headers&&Px(t.headers)&&(t.headers=Object.assign({},t.headers)),t.body&&Px(t.body)&&(t.body=Object.assign({},t.body)),t.transformRequest&&(t=t.transformRequest(t)||t);var r=new Fk(this.type,t);return this._queue.push(r),1===this._queue.length&&this._processTask(),r.promise}},{key:"cancel",value:(t=ua(ha.mark((function e(){var t;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,zk();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;this._currentTask=this._queue.shift(),this._currentTask&&(this._currentTask.alive&&this._alive.push(this._currentTask),this._currentTask.exec().catch((function(){})).finally((function(){e._processTask()})))}}],[{key:"isFetchSupport",value:function(){return Mx.isSupported()}}]),e}(),Hk="error",Yk="core.lowdecode",Gk={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 o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var u=new i(n,o||e,a),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],u]:e._events[s].push(u):(e._events[s]=u,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function u(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),u.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?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},u.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},u.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},u.prototype.emit=function(e,t,n,i,o,a){var u=r?r+e:e;if(!this._events[u])return!1;var s,c,f=this._events[u],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,i),!0;case 5:return f.fn.call(f.context,t,n,i,o),!0;case 6:return f.fn.call(f.context,t,n,i,o,a),!0}for(c=1,s=new Array(l-1);c<l;c++)s[c-1]=arguments[c];f.fn.apply(f.context,s)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,n);break;case 4:f[c].fn.call(f[c].context,t,n,i);break;default:if(!s)for(h=1,s=new Array(l-1);h<l;h++)s[h-1]=arguments[h];f[c].fn.apply(f[c].context,s)}}return!0},u.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var u=this._events[o];if(u.fn)u.fn!==t||i&&!u.once||n&&u.context!==n||a(this,o);else{for(var s=0,c=[],f=u.length;s<f;s++)(u[s].fn!==t||i&&!u[s].once||n&&u[s].context!==n)&&c.push(u[s]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u}(Gk);var $k=Gk.exports,Wk=Or,Qk=Wn.find,Kk=wa,Xk="find",Jk=!0;Xk in[]&&Array(1).find((function(){Jk=!1})),Wk({target:"Array",proto:!0,forced:Jk},{find:function(e){return Qk(this,e,arguments.length>1?arguments[1]:void 0)}}),Kk(Xk);var Zk=Yt.includes,eS=wa;Or({target:"Array",proto:!0},{includes:function(e){return Zk(this,e,arguments.length>1?arguments[1]:void 0)}}),eS("includes");var tS=ck,rS=he("match"),nS=function(e){if(tS(e))throw TypeError("The method doesn't accept regular expressions");return e},iS=b,oS=mn;Or({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[rS]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~oS(iS(this)).indexOf(oS(nS(e)),arguments.length>1?arguments[1]:void 0)}});var aS="video",uS="audio",sS="metadata",cS="avc",fS="hevc",lS="aac",hS="g7110a",dS="g7110m",pS=function(){function e(){Co(this,e),Vo(this,"id",1),Vo(this,"type",aS),Vo(this,"codecType",cS),Vo(this,"pid",-1),Vo(this,"hvcC",void 0),Vo(this,"codec",""),Vo(this,"timescale",0),Vo(this,"formatTimescale",0),Vo(this,"sequenceNumber",0),Vo(this,"baseMediaDecodeTime",0),Vo(this,"baseDts",0),Vo(this,"duration",0),Vo(this,"warnings",[]),Vo(this,"samples",[]),Vo(this,"pps",[]),Vo(this,"sps",[]),Vo(this,"vps",[]),Vo(this,"fpsNum",0),Vo(this,"fpsDen",0),Vo(this,"sarRatio",[]),Vo(this,"width",0),Vo(this,"height",0),Vo(this,"nalUnitSize",4),Vo(this,"present",!1),Vo(this,"ext",void 0)}return Do(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:"exist",value:function(){return!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}}]),e}(),vS=function(){function e(){Co(this,e),Vo(this,"id",2),Vo(this,"type",uS),Vo(this,"codecType",lS),Vo(this,"pid",-1),Vo(this,"codec",""),Vo(this,"sequenceNumber",0),Vo(this,"sampleDuration",0),Vo(this,"timescale",0),Vo(this,"formatTimescale",0),Vo(this,"baseMediaDecodeTime",0),Vo(this,"duration",0),Vo(this,"warnings",[]),Vo(this,"samples",[]),Vo(this,"baseDts",0),Vo(this,"sampleSize",16),Vo(this,"sampleRate",0),Vo(this,"channelCount",0),Vo(this,"objectType",0),Vo(this,"sampleRateIndex",0),Vo(this,"config",[]),Vo(this,"present",!1),Vo(this,"ext",void 0)}return Do(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.codecType===lS)}},{key:"hasSample",value:function(){return!!this.samples.length}}]),e}(),yS=function(){function e(t,r,n){Co(this,e),Vo(this,"flag",{}),Vo(this,"keyframe",!1),Vo(this,"gopId",0),Vo(this,"duration",0),Vo(this,"size",0),Vo(this,"units",[]),Vo(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return Do(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}(),mS=function e(t,r,n){Co(this,e),Vo(this,"duration",1024),Vo(this,"flag",{dependsOn:2,isNonSyncSample:0}),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,n&&(this.duration=n)},gS=function(){function e(){Co(this,e),Vo(this,"id",3),Vo(this,"type",sS),Vo(this,"timescale",0),Vo(this,"flvScriptSamples",[]),Vo(this,"seiSamples",[])}return Do(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}(),bS=a,wS=n,xS=gr,kS=Ge.exports,SS=Z,_S=v,TS=hm,OS=F,AS=me,ES=o,RS=$r,PS=Pt.f,jS=i.f,IS=Me.f,LS=Ik.trim,CS="Number",MS=wS.Number,DS=MS.prototype,US=_S(RS(DS))==CS,BS=function(e){if(OS(e))throw TypeError("Cannot convert a Symbol value to a number");var t,r,n,i,o,a,u,s,c=AS(e,"number");if("string"==typeof c&&c.length>2)if(43===(t=(c=LS(c)).charCodeAt(0))||45===t){if(88===(r=c.charCodeAt(2))||120===r)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(a=(o=c.slice(2)).length,u=0;u<a;u++)if((s=o.charCodeAt(u))<48||s>i)return NaN;return parseInt(o,n)}return+c};if(xS(CS,!MS(" 0o1")||!MS("0b1")||MS("+0x1"))){for(var NS,FS=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof FS&&(US?ES((function(){DS.valueOf.call(r)})):_S(r)!=CS)?TS(new MS(BS(t)),r,FS):BS(t)},qS=bS?PS(MS):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),zS=0;qS.length>zS;zS++)SS(MS,NS=qS[zS])&&!SS(FS,NS)&&IS(FS,NS,jS(MS,NS));FS.prototype=DS,DS.constructor=FS,kS(wS,CS,FS)}var VS=Ge.exports,HS=Ue,YS=mn,GS=o,$S=sp,WS="toString",QS=RegExp.prototype,KS=QS.toString,XS=GS((function(){return"/a/b"!=KS.call({source:"a",flags:"b"})})),JS=KS.name!=WS;(XS||JS)&&VS(RegExp.prototype,WS,(function(){var e=HS(this),t=YS(e.source),r=e.flags;return"/"+t+"/"+YS(void 0===r&&e instanceof RegExp&&!("flags"in QS)?$S.call(e):r)}),{unsafe:!0});var ZS="undefined"!=typeof window,e_=ZS&&navigator.userAgent.toLocaleLowerCase();ZS&&/^((?!chrome|android).)*safari/.test(e_);var t_=ZS&&e_.includes("firefox"),r_=ZS&&e_.includes("android");function n_(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=t.filter(Boolean);var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}var i_=Math.pow(2,32);function o_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<8)+(e[t+1]||0)}function a_(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 u_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return a_(e,t)*i_+a_(e,t+4)}var s_=function(){function e(){Co(this,e)}return Do(e,null,[{key:"getRateIndexByRate",value:function(t){return e.FREQ.indexOf(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 o=i,a=[],u=(60&t[i+2])>>>2,s=e.FREQ[u];if(!s)throw new Error("Invalid sampling index: ".concat(u));for(var c,f,l=1+((192&t[i+2])>>>6),h=(1&t[i+2])<<2|(192&t[i+3])>>>6,d=e._getConfig(u,h,l),p=d.config,v=d.codec,y=0,m=e.getFrameDuration(s);i+7<n;)if(255===t[i]&&240==(246&t[i+1])){if(n-i<(f=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5))break;c=2*(1&~t[i+1]),a.push({pts:r+y*m,data:t.subarray(i+7+c,i+f)}),y++,i+=f}else i++;return{skip:o,remaining:i>=n?void 0:t.subarray(i),frames:a,samplingFrequencyIndex:u,sampleRate:s,objectType:l,channelCount:h,codec:v,config:p,originCodec:"mp4a.40.".concat(l)}}}},{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,o=e.FREQ[n];if(!o)throw new Error("Invalid sampling index: ".concat(n));var a=e._getConfig(n,i,r);return{samplingFrequencyIndex:n,sampleRate:o,objectType:r,channelCount:i,config:a.config,codec:a.codec,originCodec:"mp4a.40.".concat(r)}}}},{key:"getFrameDuration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return 1024*t/e}},{key:"_getConfig",value:function(e,t,r){var n,i,o=[];return t_?e>=6?(n=5,i=e-3):(n=2,i=e):r_?(n=2,i=e):(n=2===r||5===r?r:5,i=e,e>=6?i=e-3:1===t&&(n=2,i=e)),o[0]=n<<3,o[0]|=(14&e)>>1,o[1]=(1&e)<<7,o[1]|=t<<3,5===n&&(o[1]|=(14&i)>>1,o[2]=(1&i)<<7,o[2]|=8,o[3]=0),{config:o,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(e,t){switch(e){case"mp4a.40.2":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]);break;default: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}();function c_(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 f_(e,t){if(e){if("string"==typeof e)return c_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c_(e,t):void 0}}function l_(e){return function(e){if(Array.isArray(e))return c_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f_(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.")}()}Vo(s_,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var h_=Lt,d_=mn,p_=b,v_=Dt,y_=mn,m_=function(e){var t=d_(p_(this)),r="",n=h_(e);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},g_=b,b_=Math.ceil,w_=function(e){return function(t,r,n){var i,o,a=y_(g_(t)),u=a.length,s=void 0===n?" ":y_(n),c=v_(r);return c<=u||""==s?a:(i=c-u,(o=m_.call(s,b_(i/s.length))).length>i&&(o=o.slice(0,i)),e?a+o:o+a)}},x_={start:w_(!1),end:w_(!0)},k_=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(A),S_=x_.start;Or({target:"String",proto:!0,forced:k_},{padStart:function(e){return S_(this,e,arguments.length>1?arguments[1]:void 0)}});var __=Me,T_=sp;a&&o((function(){return"sy"!==Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({dotAll:!0,sticky:!0})}))&&__.f(RegExp.prototype,"flags",{configurable:!0,get:T_});var O_=function(){function e(){Co(this,e)}return Do(e,null,[{key:"findBox",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[];if(!t)return i;for(var o=0,a="",u=0;t.length>7;){if(o=a_(t),a=String.fromCharCode.apply(null,t.subarray(4,8)),u=8,1===o?(o=u_(t,8),u+=8):o||(o=t.length),!r[0]||a===r[0]){var s=t.subarray(0,o);if(!(r.length<2))return e.findBox(s.subarray(u),r.slice(1),n+u);i.push({start:n,size:o,headerSize:u,type:a,data:s})}n+=o,t=t.subarray(o)}return i}},{key:"moov",value:function(t){return P_(t,!1,(function(t,r,n){t.mvhd=e.mvhd(e.findBox(r,["mvhd"],n)[0]),t.trak=e.findBox(r,["trak"],n).map((function(t){return e.trak(t)}))}))}},{key:"mvhd",value:function(e){return P_(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=a_(t,16),e.duration=u_(t,20),r+=28):(e.timescale=a_(t,8),e.duration=a_(t,12),r+=16),e.nextTrackId=a_(t,r+76)}))}},{key:"trak",value:function(t){return P_(t,!1,(function(t,r,n){t.tkhd=e.tkhd(e.findBox(r,["tkhd"],n)[0]),t.mdia=e.mdia(e.findBox(r,["mdia"],n)[0])}))}},{key:"tkhd",value:function(e){return P_(e,!0,(function(e,t){var r=0;1===e.version?(e.trackId=a_(t,16),e.duration=u_(t,24),r+=32):(e.trackId=a_(t,8),e.duration=a_(t,16),r+=20),e.width=a_(t,r+52),e.height=a_(t,r+56)}))}},{key:"mdia",value:function(t){return P_(t,!1,(function(t,r,n){t.mdhd=e.mdhd(e.findBox(r,["mdhd"],n)[0]),t.hdlr=e.hdlr(e.findBox(r,["hdlr"],n)[0]),t.minf=e.minf(e.findBox(r,["minf"],n)[0])}))}},{key:"mdhd",value:function(e){return P_(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=a_(t,16),e.duration=u_(t,20),r+=28):(e.timescale=a_(t,8),e.duration=a_(t,12),r+=16);var n=o_(t,r);e.language=String.fromCharCode(96+(n>>10&31),96+(n>>5&31),96+(31&n))}))}},{key:"hdlr",value:function(e){return P_(e,!0,(function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))}))}},{key:"minf",value:function(t){return P_(t,!1,(function(t,r,n){t.vmhd=e.vmhd(e.findBox(r,["vmhd"],n)[0]),t.smhd=e.smhd(e.findBox(r,["smhd"],n)[0]),t.stbl=e.stbl(e.findBox(r,["stbl"],n)[0])}))}},{key:"vmhd",value:function(e){return P_(e,!0,(function(e,t){e.graphicsmode=o_(t),e.opcolor=[o_(t,2),o_(t,4),o_(t,6)]}))}},{key:"smhd",value:function(e){return P_(e,!0,(function(e,t){e.balance=o_(t)}))}},{key:"stbl",value:function(t){return P_(t,!1,(function(t,r,n){t.stsd=e.stsd(e.findBox(r,["stsd"],n)[0]),t.stts=e.stts(e.findBox(r,["stts"],n)[0]),t.ctts=e.ctts(e.findBox(r,["ctts"],n)[0]),t.stsc=e.stsc(e.findBox(r,["stsc"],n)[0]),t.stsz=e.stsz(e.findBox(r,["stsz"],n)[0]),t.stco=e.stco(e.findBox(r,["stco"],n)[0]),t.stss=e.stss(e.findBox(r,["stss"],n)[0])}))}},{key:"stsd",value:function(t){return P_(t,!0,(function(t,r,n){t.entryCount=a_(r),t.entries=e.findBox(r.subarray(4),[],n+4).map((function(t){switch(t.type){case"avc1":case"avc2":case"avc3":case"avc4":return e.avc1(t);case"hvc1":case"hev1":return e.hvc1(t);case"mp4a":return e.mp4a(t);case"alaw":case"ulaw":return e.alaw(t)}})).filter(Boolean)}))}},{key:"avc1",value:function(t){return P_(t,!1,(function(t,r,n){var i=E_(t,r),o=r.subarray(i);n+=i,t.avcC=e.avcC(e.findBox(o,["avcC"],n)[0]),t.pasp=e.pasp(e.findBox(o,["pasp"],n)[0])}))}},{key:"avcC",value:function(e){return P_(e,!1,(function(e,t){e.configurationVersion=t[0],e.AVCProfileIndication=t[1],e.profileCompatibility=t[2],e.AVCLevelIndication=t[3],e.codec=function(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}([t[1],t[2],t[3]]),e.lengthSizeMinusOne=3&t[4],e.spsLength=31&t[5],e.sps=[];for(var r=6,n=0;n<e.spsLength;n++){var i=o_(t,r);r+=2,e.sps.push(t.subarray(r,r+i)),r+=i}e.ppsLength=t[r],r+=1,e.pps=[];for(var o=0;o<e.ppsLength;o++){var a=o_(t,r);r+=2,e.pps.push(t.subarray(r,r+=a)),r+=a}}))}},{key:"hvc1",value:function(t){return P_(t,!1,(function(t,r,n){var i=E_(t,r),o=r.subarray(i);n+=i,t.hvcC=e.hvcC(e.findBox(o,["hvcC"],n)[0]),t.pasp=e.pasp(e.findBox(o,["pasp"],n)[0])}))}},{key:"hvcC",value:function(e){return P_(e,!1,(function(t,r){t.data=e.data,t.codec="hev1.1.6.L93.B0",t.configurationVersion=r[0];var n=r[1];t.generalProfileSpace=n>>6,t.generalTierFlag=(32&n)>>5,t.generalProfileIdc=31&n,t.generalProfileCompatibility=a_(r,2),t.generalConstraintIndicatorFlags=r.subarray(6,12),t.generalLevelIdc=r[12],t.avgFrameRate=o_(r,19),t.numOfArrays=r[22],t.vps=[],t.sps=[],t.pps=[];for(var i=23,o=0,a=0,u=0,s=0;s<t.numOfArrays;s++){o=63&r[i],a=o_(r,i+1),i+=3;for(var c,f=[],l=0;l<a;l++)u=o_(r,i),i+=2,f.push(r.subarray(i,i+u)),i+=u;if(32===o)(c=t.vps).push.apply(c,f);else if(33===o){var h;(h=t.sps).push.apply(h,f)}else if(34===o){var d;(d=t.pps).push.apply(d,f)}}}))}},{key:"pasp",value:function(e){return P_(e,!1,(function(e,t){e.hSpacing=a_(t),e.vSpacing=a_(t,4)}))}},{key:"mp4a",value:function(t){return P_(t,!1,(function(t,r,n){var i=R_(t,r);t.esds=e.esds(e.findBox(r.subarray(i),["esds"],n+i)[0])}))}},{key:"esds",value:function(e){return P_(e,!0,(function(e,t){e.codec="mp4a.";for(var r=0,n=0,i=0,o=0;t.length;){for(o=t[r=0],n=t[r+1],r+=2;128&n;)i=(127&n)<<7,n=t[r],r+=1;if(i+=127&n,3===o)t=t.subarray(r+3);else{if(4!==o){if(5===o){var a=e.config=t.subarray(r,r+i),u=(248&a[0])>>3;return 31===u&&a.length>=2&&(u=32+((7&a[0])<<3)+((224&a[1])>>5)),e.objectType=u,void(e.codec+=u.toString(16))}return}e.codec+=(t[r].toString(16)+".").padStart(3,"0"),t=t.subarray(r+13)}}}))}},{key:"alaw",value:function(e){return P_(e,!1,(function(e,t){R_(e,t)}))}},{key:"stts",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push({count:a_(t,i),delta:a_(t,i+4)}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"ctts",value:function(e){return P_(e,!0,(function(e,t){var r=a_(t),n=[],i=4;if(1===e.version)for(var o=0;o<r;o++)n.push({count:a_(t,i),offset:a_(t,i+4)}),i+=8;else for(var a=0;a<r;a++)n.push({count:a_(t,i),offset:-(1+~a_(t,i+4))}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"stsc",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push({firstChunk:a_(t,i),samplesPerChunk:a_(t,i+4),sampleDescriptionIndex:a_(t,i+8)}),i+=12;e.entryCount=r,e.entries=n}))}},{key:"stsz",value:function(e){return P_(e,!0,(function(e,t){var r=a_(t),n=a_(t,4),i=[];if(!r)for(var o=8,a=0;a<n;a++)i.push(a_(t,o)),o+=4;e.sampleSize=r,e.sampleCount=n,e.entrySizes=i}))}},{key:"stco",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push(a_(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"stss",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push(a_(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"moof",value:function(t){return P_(t,!1,(function(t,r,n){t.mfhd=e.mfhd(e.findBox(r,["mfhd"],n)[0]),t.traf=e.findBox(r,["traf"],n).map((function(t){return e.traf(t)}))}))}},{key:"mfhd",value:function(e){return P_(e,!0,(function(e,t){e.sequenceNumber=a_(t)}))}},{key:"traf",value:function(t){return P_(t,!1,(function(t,r,n){t.tfhd=e.tfhd(e.findBox(r,["tfhd"],n)[0]),t.tfdt=e.tfdt(e.findBox(r,["tfdt"],n)[0]),t.trun=e.trun(e.findBox(r,["trun"],n)[0])}))}},{key:"tfhd",value:function(e){return P_(e,!0,(function(e,t){var r=e.flags,n=t.length;e.trackId=a_(t);var i=4;n>i&&1&r&&(e.baseDataOffset=u_(t,i),i+=8),n>i&&2&r&&(e.sampleDescriptionIndex=a_(t,i),i+=4),n>i&&8&r&&(e.defaultSampleDuration=a_(t,i),i+=4),n>i&&10&r&&(e.defaultSampleSize=a_(t,i),i+=4),n>i&&32&r&&(e.defaultSampleFlags=a_(t,i),i+=4)}))}},{key:"trun",value:function(e){return P_(e,!0,(function(e,t){var r=e.version,n=e.flags,i=t.length,o=e.sampleCount=a_(t),a=4;if(i>a&&1&n&&(e.dataOffset=-(1+~a_(t,a)),a+=4),i>a&&4&n&&(e.firstSampleFlags=a_(t,a),a+=4),e.samples=[],i>a)for(var u,s=0;s<o;s++)u={},256&n&&(u.duration=a_(t,a),a+=4),512&n&&(u.size=a_(t,a),a+=4),1024&n&&(u.flags=a_(t,a),a+=4),2048&n&&(u.cts=r?-(1+~a_(t,a+4)):a_(t,a),a+=4),e.samples.push(u)}))}},{key:"tfdt",value:function(e){return P_(e,!0,(function(e,t){1===e.version?e.baseMediaDecodeTime=u_(t):e.baseMediaDecodeTime=a_(t)}))}},{key:"probe",value:function(t){return!!e.findBox(t,["ftyp"])}},{key:"moovToTrack",value:function(e,t,r){var n,i,o=e.trak;if(o&&o.length){var a=o.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),u=o.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(a&&t){var s,c=t;null!=(null===(s=a.tkhd)||void 0===s?void 0:s.trackId)&&(c.id=a.tkhd.trackId),c.timescale=c.formatTimescale=a.mdia.mdhd.timescale,c.duration=a.mdia.mdhd.duration;var f=a.mdia.minf.stbl.stsd.entries[0];if(c.width=f.width,c.height=f.height,f.pasp&&(c.sarRatio=[f.pasp.hSpacing,f.pasp.vSpacing]),f.hvcC)c.codecType=fS,c.codec=f.hvcC.codec,c.vps=f.hvcC.vps,c.sps=f.hvcC.sps,c.pps=f.hvcC.pps,c.hvcC=f.hvcC.data;else{if(!f.avcC)throw new Error("unknown video stsd entry");c.codec=f.avcC.codec,c.sps=f.avcC.sps,c.pps=f.avcC.pps}c.present=!0}if(u&&r){var l,h=r;null!=(null===(l=u.tkhd)||void 0===l?void 0:l.trackId)&&(h.id=u.tkhd.trackId),h.timescale=h.formatTimescale=u.mdia.mdhd.timescale,h.duration=u.mdia.mdhd.duration;var d=u.mdia.minf.stbl.stsd.entries[0];switch(h.sampleSize=d.sampleSize,h.sampleRate=d.sampleRate,h.channelCount=d.channelCount,h.present=!0,d.type){case"alaw":h.codecType=h.codec=hS,h.sampleRate=8e3;break;case"ulaw":h.codecType=h.codec=dS,h.sampleRate=8e3;break;default:h.sampleDuration=s_.getFrameDuration(h.sampleRate,h.timescale),h.sampleRateIndex=s_.getRateIndexByRate(h.sampleRate),h.objectType=(null===(n=d.esds)||void 0===n?void 0:n.objectType)||2,d.esds&&(h.config=Array.from(d.esds.config)),h.codec=(null===(i=d.esds)||void 0===i?void 0:i.codec)||"mp4a.40.2"}}return{videoTrack:t,audioTrack:r}}}},{key:"evaluateDefaultDuration",value:function(e,t,r){var n,i=null==t||null===(n=t.samples)||void 0===n?void 0:n.length;return i?1024*i/t.timescale*e.timescale/r:1024}},{key:"moofToSamples",value:function(t,r,n){var i={};return t.mfhd&&(r&&(r.sequenceNumber=t.mfhd.sequenceNumber),n&&(n.sequenceNumber=t.mfhd.sequenceNumber)),t.traf.forEach((function(t){var o=t.tfhd,a=t.tfdt,u=t.trun;if(o&&u){a&&(r&&r.id===o.trackId&&(r.baseMediaDecodeTime=a.baseMediaDecodeTime),n&&n.id===o.trackId&&(n.baseMediaDecodeTime=a.baseMediaDecodeTime));var s=o.defaultSampleSize||0,c=o.defaultSampleDuration||e.evaluateDefaultDuration(r,n,u.samples.length||u.sampleCount),f=u.dataOffset||0,l=0,h=-1;if(!u.samples.length&&u.sampleCount){i[o.trackId]=[];for(var d=0;d<u.sampleCount;d++)i[o.trackId].push({offset:f,dts:l,duration:c,size:s}),l+=c,f+=s}else i[o.trackId]=u.samples.map((function(e,t){return(e={offset:f,dts:l,pts:l+(e.cts||0),duration:e.duration||c,size:e.size||s,gopId:h,keyframe:0===t||null!=e.flags&&(65536&e.flags)>>>0!=65536}).keyframe&&(h++,e.gopId=h),l+=e.duration,f+=e.size,e}))}})),i}},{key:"moovToSamples",value:function(e){var t=e.trak;if(t&&t.length){var r=t.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),n=t.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(r||n){var i,o;if(r){var a,u,s=null===(a=r.mdia)||void 0===a||null===(u=a.minf)||void 0===u?void 0:u.stbl;if(!s)return;var c=s.stts,f=s.stsc,l=s.stsz,h=s.stco,d=s.stss,p=s.ctts;if(!(c&&f&&l&&h&&d))return;i=A_(c,f,l,h,p,d)}if(n){var v,y,m,g=null===(v=n.mdia)||void 0===v||null===(y=v.minf)||void 0===y?void 0:y.stbl;if(!g)return;var b=null===(m=n.mdia.mdhd)||void 0===m?void 0:m.timescale,w=g.stts,x=g.stsc,k=g.stsz,S=g.stco;if(!(b&&w&&x&&k&&S))return;o=A_(w,x,k,S)}return{videoSamples:i,audioSamples:o}}}}}]),e}();function A_(e,t,r,n,i,o){var a,u,s,c=[],f=null==i?void 0:i.entries,l=t.entries,h=n.entries,d=r.entrySizes,p=null==o?void 0:o.entries;p&&(a={},p.forEach((function(e){a[e-1]=!0}))),f&&(u=[],f.forEach((function(e){for(var t=e.count,r=e.offset,n=0;n<t;n++)u.push(r)})));var v=-1,y=0,m=0,g=0,b=0,w=0,x=l[0].samplesPerChunk,k=l[1]?l[1].firstChunk-1:1/0;return e.entries.forEach((function(e){for(var t=e.count,n=e.delta,i=0;i<t;i++)s={dts:y,duration:n,size:d[m]||r.sampleSize,offset:h[g]+w,index:m},p&&(s.keyframe=a[m],s.keyframe&&v++,s.gopId=v),u&&u[m]&&(s.pts=s.dts+u[m]),c.push(s),y+=n,++m<x?w+=s.size:(g++,w=0,g>=k&&(b++,k=l[b+1]?l[b+1].firstChunk-1:1/0),x+=l[b].samplesPerChunk)})),c}function E_(e,t){return e.dataReferenceIndex=o_(t,6),e.width=o_(t,24),e.height=o_(t,26),e.horizresolution=a_(t,28),e.vertresolution=a_(t,32),e.frameCount=o_(t,40),e.depth=o_(t,74),78}function R_(e,t){return e.dataReferenceIndex=o_(t,6),e.channelCount=o_(t,16),e.sampleSize=o_(t,18),e.sampleRate=a_(t,24)/65536,28}function P_(e,t,r){if(e){if(e.size!==e.data.length)throw new Error("box ".concat(e.type," size !== data.length"));var n={start:e.start,size:e.size,headerSize:e.headerSize,type:e.type};return t&&(n.version=e.data[e.headerSize],n.flags=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<16)+(e[t+1]<<8)+(e[t+2]||0)}(e.data,e.headerSize+1),n.headerSize+=4),r(n,e.data.subarray(n.headerSize),n.start+n.headerSize),n}}function j_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){u=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(u)throw i}}return o}}(e,t)||f_(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.")}()}var I_=Ll,L_="ArrayBuffer",C_=Jy.ArrayBuffer;Or({global:!0,forced:n.ArrayBuffer!==C_},{ArrayBuffer:C_}),I_(L_);var M_=Math.pow(2,32)-1,D_=function(){function e(){Co(this,e)}return Do(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];var i=8+(r=r.filter(Boolean)).reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(i);o[0]=i>>24&255,o[1]=i>>16&255,o[2]=i>>8&255,o[3]=255&i,o.set(e,4);var a=8;return r.forEach((function(e){o.set(e,a),a+=e.byteLength})),o}},{key:"ftyp",value:function(t){return t.find((function(e){return e.type===aS&&e.codecType===fS}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return n_(e.ftyp(t),e.moov(t))}},{key:"moov",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(l_(t.map((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.duration,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===aS?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.STTS,e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){return e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),t.type===aS?e.avc1hev1(t):e.mp4a(t))}},{key:"avc1hev1",value:function(t){var r=t.codecType===fS,n=r?e.types.hvc1:e.types.avc1,i=r?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]),i];return t.sarRatio&&t.sarRatio.length>1&&o.push(e.pasp(t.sarRatio)),e.box.apply(e,[n].concat(o))}},{key:"avcC",value:function(t){var r,n=[],i=[];return t.sps.forEach((function(e){r=e.byteLength,n.push(r>>>8&255),n.push(255&r),n.push.apply(n,l_(e))})),t.pps.forEach((function(e){r=e.byteLength,i.push(r>>>8&255),i.push(255&r),i.push.apply(i,l_(e))})),e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(i)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer)return r;var n,i=t.vps,o=t.sps,a=t.pps;if(r){var u=r.generalProfileCompatibilityFlags,s=r.generalConstraintIndicatorFlags,c=(i.length&&1)+(o.length&&1)+(a.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,u>>>24,u>>>16,u>>>8,u,s[0],s[1],s[2],s[3],s[4],s[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 f=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,l_(e))};i.length&&(n.push(160,0,i.length),i.forEach(f)),o.length&&(n.push(161,0,o.length),o.forEach(f)),a.length&&(n.push(162,0,a.length),a.forEach(f))}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=j_(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=t.length;return e.box(e.types.esds,new Uint8Array([0,0,0,0,3,23+r,0,0,0,4,15+r,64,21,0,6,0,0,0,218,192,0,0,218,192,5].concat([r]).concat(t).concat([6,1,2])))}},{key:"mvex",value:function(t){return e.box.apply(e,[e.types.mvex].concat(l_(t.map((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:"moof",value:function(t,r){return e.box.apply(e,[e.types.moof,e.mfhd(t)].concat(l_(r.map((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){return e.box(e.types.traf,e.tfhd(t.id),e.tfdt(t.baseMediaDecodeTime),e.trun(t.samples,76))}},{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){var r=Math.floor(t/(M_+1)),n=Math.floor(t%(M_+1));return e.box(e.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n]))}},{key:"trun",value:function(t,r){var n=t.length,i=12+16*n;r+=8+i;var o=new Uint8Array(i);o.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 a=0;a<n;a++){var u=t[a],s=u.duration,c=u.size,f=u.flag,l=void 0===f?{}:f,h=u.cts,d=void 0===h?0:h;o.set([s>>>24&255,s>>>16&255,s>>>8&255,255&s,c>>>24&255,c>>>16&255,c>>>8&255,255&c,l.isLeading<<2|(null==l.dependsOn?1:l.dependsOn),l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|(null==l.isNonSyncSample?1:l.isNonSyncSample),61440&l.degradationPriority,15&l.degradationPriority,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*a)}return e.box(e.types.trun,o)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"moovMP4",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(l_(t.map((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===aS?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r=t.ext,n=[e.stsd(t),e.stts(r.stts),e.stsc(r.stsc),e.stsz(r.stsz),e.stco(r.stco)];return r.stss.length&&n.push(e.stss(r.stss)),r.ctts.length&&n.push(e.ctts(r.ctts)),e.box.apply(e,[e.types.stbl].concat(n))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((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,n_(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 t.forEach((function(e){var t=e.firstChunk,r=e.samplesPerChunk,o=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,o>>24,o>>16&255,o>>8&255,255&o],i),i+=12})),e.box(e.types.stsc,n_(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 t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stsz,n_(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 t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stco,n_(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 t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stss,n_(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 t.forEach((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,n_(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}}]),e}();Vo(D_,"types",["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","trun","trex","tkhd","vmhd","smhd","ctts","stss"].reduce((function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),Object.create(null))),Vo(D_,"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])}),Vo(D_,"FTYPAVC1",D_.box(D_.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),Vo(D_,"FTYPHEV1",D_.box(D_.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),Vo(D_,"DINF",D_.box(D_.types.dinf,D_.box(D_.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),Vo(D_,"VMHD",D_.box(D_.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),Vo(D_,"SMHD",D_.box(D_.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),Vo(D_,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),Vo(D_,"STTS",D_.box(D_.types.stts,D_.StblTable)),Vo(D_,"STSC",D_.box(D_.types.stsc,D_.StblTable)),Vo(D_,"STSZ",D_.box(D_.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),Vo(D_,"STCO",D_.box(D_.types.stco,D_.StblTable));var U_=/Chrome\/([^.]+)/.exec(navigator.userAgent),B_=U_&&Number(U_[1])<50,N_=function(){function e(t,r){Co(this,e),this.videoTrack=t,this.audioTrack=r}return Do(e,[{key:"remux",value:function(){var e,t,r,n,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.videoTrack,a=this.audioTrack,u=o.exist(),s=a.exist();return i&&(u&&(e=D_.initSegment([this.videoTrack])),s&&(t=D_.initSegment([this.audioTrack]))),u&&o.hasSample()&&(r=this._remuxVideo()),s&&a.hasSample()&&(n=this._remuxAudio()),o.samples=[],a.samples=[],{videoInitSegment:e,audioInitSegment:t,videoSegment:r,audioSegment:n}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack,t=e.samples;B_&&(t[0].flag={dependsOn:2,isNonSyncSample:0});var r=0;t.forEach((function(e){r+=e.units.reduce((function(e,t){return e+t.byteLength}),0),r+=4*e.units.length}));for(var n,i=new Uint8Array(r),o=new DataView(i.buffer),a=function(e,r,a,u){u=t[e];var s=0;u.units.forEach((function(e){o.setUint32(a,e.byteLength),a+=4,i.set(e,a),a+=e.byteLength,s+=4+e.byteLength})),u.size=s,c=a,n=u},u=0,s=t.length,c=0;u<s;u++)a(u,0,c,n);return n_(D_.moof(this.videoTrack.sequenceNumber++,[e]),D_.mdat(i))}},{key:"_remuxAudio",value:function(){var e=this.audioTrack,t=D_.moof(this.audioTrack.sequenceNumber++,[e]),r=new Uint8Array(e.samples.reduce((function(e,t){return e+t.size}),0));return e.samples.reduce((function(e,t){return r.set(t.data,e),e+t.size}),0),n_(t,D_.mdat(r))}}]),e}(),F_=function(){function e(t,r,n){Co(this,e),Vo(this,"_videoSamples",[]),Vo(this,"_audioSamples",[]),this.videoTrack=t||new pS,this.audioTrack=r||new vS,this.metadataTrack=n||new gS}return Do(e,[{key:"demux",value:function(e,t,r,n,i){if(!this._audioSamples.length&&!this._videoSamples.length){if(!i)throw new Error("moov is required");O_.moovToTrack(i,this.videoTrack,this.audioTrack);var o=O_.moovToSamples(i);if(!o)throw new Error("cannot parse samples from moov box");this._videoSamples=o.videoSamples||[],this._audioSamples=o.audioSamples||[]}var a,u,s,c=this.videoTrack,f=this.audioTrack;if(c.samples=[],f.samples=[],r){for(var l,h=0,d=r[0],p=r[1];d<=p;d++){if(!(a=this._videoSamples[d]))throw new Error("cannot found video frame #".concat(d));s=a.offset-t,u=e.subarray(s,s+a.size),(l=new yS(a.pts||a.dts,a.dts)).duration=a.duration,l.gopId=a.gopId,a.keyframe&&l.setToKeyframe();for(var v=0,y=u.length-1;v<y;)h=a_(u,v),v+=4,l.units.push(u.subarray(v,v+h)),v+=h;c.samples.push(l)}c.baseMediaDecodeTime=c.samples[0].dts}if(n){for(var m=n[0],g=n[1];m<=g;m++){if(!(a=this._audioSamples[m]))throw new Error("cannot found video frame #".concat(m));s=a.offset-t,u=e.subarray(s,s+a.size),f.samples.push(new mS(a.dts,u,a.duration))}f.baseMediaDecodeTime=f.samples[0].dts}return{videoTrack:c,audioTrack:f,metadataTrack:this.metadataTrack}}},{key:"reset",value:function(){this._videoSamples=[],this._audioSamples=[],this.videoTrack.reset(),this.audioTrack.reset(),this.metadataTrack.reset()}}],[{key:"probe",value:function(e){return O_.probe(e)}}]),e}();function q_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q_(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V_=function e(t,r){Co(this,e),this.type="file",this.message=t,this.data=r},H_=function(){function e(){Co(this,e),Vo(this,"_data",Object.create(null))}return Do(e,[{key:"set",value:function(e,t){this._data[e]=t}},{key:"get",value:function(e){return this._data[e]}},{key:"clear",value:function(){this._data=Object.create(null)}}]),e}();function Y_(e,t){var r=e.trak;if(r&&r.length){var n=r.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),i=r.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(n||i){var o,a=[],u=[];if(n){var s,c,f,l=null===(s=n.mdia)||void 0===s||null===(c=s.minf)||void 0===c?void 0:c.stbl;if(!l)return;var h=null===(f=n.mdia.mdhd)||void 0===f?void 0:f.timescale,d=l.stts,p=l.stsc,v=l.stsz,y=l.stco,m=l.stss;if(!(h&&d&&p&&v&&y&&m))return;o=(a=G_(t,h,d,p,v,y,m)).map((function(e){return e.endTime-e.startTime}))}if(i){var g,b,w,x=null===(g=i.mdia)||void 0===g||null===(b=g.minf)||void 0===b?void 0:b.stbl;if(!x)return;var k=null===(w=i.mdia.mdhd)||void 0===w?void 0:w.timescale,S=x.stts,_=x.stsc,T=x.stsz,O=x.stco;if(!(k&&S&&_&&T&&O))return;u=G_(t,k,S,_,T,O,null,o)}return{videoSegments:a,audioSegments:u}}}}function G_(e,t,r,n,i,o,a,u){var s,c,f,l=[],h=[],d=[],p=n.entries,v=o.entries,y=i.entrySizes,m=null==a?void 0:a.entries;m&&(s={},m.forEach((function(e){s[e-1]=!0})));var g=0,b=0,w=0,x=0,k=0,S=p[0].samplesPerChunk,_=p[1]?p[1].firstChunk-1:1/0;r.entries.forEach((function(e){var r=e.count,n=e.delta;f=n/t;for(var o=0;o<r;o++)c={startTime:g,duration:f,size:y[b]||i.sampleSize,offset:v[w]+k,index:b},m&&(c.keyframe=s[b],c.keyframe?(h.push([c]),d.push(c.duration)):(h[h.length-1].push(c),d[h.length-1]+=c.duration)),l.push(c),g+=f,++b<S?k+=c.size:(w++,k=0,w>=_&&(x++,_=p[x+1]?p[x+1].firstChunk-1:1/0),S+=p[x].samplesPerChunk)}));var T=l.length;if(T&&(!a||l[0].keyframe)){var O,A=[],E=[],R=0,P=function(){var e;O=E[E.length-1],A.push({index:A.length,startTime:(null===(e=A[A.length-1])||void 0===e?void 0:e.endTime)||E[0].startTime,endTime:O.startTime+O.duration,range:[E[0].offset,O.offset+O.size],frames:E}),R=0,E=[]};if(a)for(var j=0,I=0,L=h.length;I<L;I++){var C,M;if(R+=d[I],(C=E).push.apply(C,l_(h[I])),I+1<L){if((j=R+d[I+1])>=e)if(j-e<Math.abs(e-R))(M=E).push.apply(M,l_(h[I+1])),P(),I++;else P()}else P()}else for(var D=(u=u||[])[0]||e,U=0;U<T;U++)E.push(l[U]),R+=l[U].duration,(U+1>=T||R>=D)&&(P(),D=u[A.length]||e);return A}}function $_(e){var t="",r="",n=0,i=0,o=0,a=0,u=0;e.mvhd&&(u=e.mvhd.duration/e.mvhd.timescale);var s=e.trak;if(s){var c,f,l,h,d,p,v,y,m,g=s.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),b=s.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(g)if(c=null===(f=g.mdia)||void 0===f||null===(l=f.minf)||void 0===l||null===(h=l.stbl)||void 0===h?void 0:h.stsd.entries[0])n=c.width,i=c.height,t=null===(d=c.avcC||c.hvcC)||void 0===d?void 0:d.codec;if(b)if(c=null===(p=b.mdia)||void 0===p||null===(v=p.minf)||void 0===v||null===(y=v.stbl)||void 0===y?void 0:y.stsd.entries[0])o=c.channelCount,a=c.sampleRate,r=null===(m=c.esds)||void 0===m?void 0:m.codec}return{videoCodec:t,audioCodec:r,width:n,height:i,audioChannelCount:o,audioSampleRate:a,duration:u,moov:e}}function W_(e){return"number"==typeof e&&!isNaN(e)}var Q_=["vid","moovEnd","segmentDuration","cache","maxDownloadInfoSize"],K_=function(){function e(t){Co(this,e),Vo(this,"vid",""),Vo(this,"url",""),Vo(this,"meta",{}),Vo(this,"downloadInfo",[]),Vo(this,"videoSegments",[]),Vo(this,"audioSegments",[]),Vo(this,"cache",null),Vo(this,"_currentSegmentIndex",-1),Vo(this,"_currentLoadingSegmentIndex",-1),Vo(this,"_transformError",(function(e){return e.type="network",e})),this._config=z_(z_({vid:"",moovEnd:8e3,segmentDuration:5,maxDownloadInfoSize:30,cache:null},t),{},{responseType:"arraybuffer"});var r=this._config,n=r.vid;r.moovEnd,r.segmentDuration;var i=r.cache;r.maxDownloadInfoSize;var o=Bx(r,Q_);this.cache=i||new H_,this.vid=n||o.url,this.url=o.url,o.transformError=this._transformError,this._loader=new Vk(o)}var t,r,n,i,o,a,u,s,c,f;return Do(e,[{key:"isMetaLoaded",get:function(){return this.videoSegments.length||this.audioSegments.length}},{key:"setCurrentSegment",value:function(e){W_(e)&&(this._currentSegmentIndex=e)}},{key:"isLastSegment",value:function(e){var t,r;return!!W_(e)&&e===((null===(t=this.videoSegments[this.videoSegments.length-1])||void 0===t?void 0:t.index)||(null===(r=this.audioSegments[this.audioSegments.length-1])||void 0===r?void 0:r.index)||0)}},{key:"isSegmentLoading",value:function(e){return e===this._currentLoadingSegmentIndex}},{key:"changeUrl",value:(f=ua(ha.mark((function e(t){var r,n,i=arguments;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:t,n=i.length>2?i[2]:void 0,e.next=4,this.reset();case 4:t&&(this.url=t),r&&(this.vid=r),n&&(this._config.moovEnd=n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"getOrLoadMeta",value:(c=ua(ha.mark((function e(t){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(t);case 3:return e.abrupt("return",this.meta);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"loadMeta",value:(s=ua(ha.mark((function e(t,r){var n,i,o,a,u,s,c,f,l;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],e.next=3,this._loadData([0,r||this._config.moovEnd],t);case 3:if(i=e.sent){e.next=6;break}return e.abrupt("return");case 6:if(n.push(i),o=O_.findBox(i.data,["moov"])[0]){e.next=22;break}if(a=O_.findBox(i.data,["mdat"])[0]){e.next=12;break}throw new V_("cannot find moov or mdat box",i.data);case 12:return u=a.start+a.size,e.next=15,this._loadData([u],t);case 15:if(i=e.sent){e.next=18;break}return e.abrupt("return");case 18:if(n.push(i),o=O_.findBox(i.data,["moov"],u)[0]){e.next=22;break}throw new V_("cannot find moov box",i.data);case 22:if(!(o.size>o.data.length)){e.next=30;break}return e.next=25,this._loadData([i.data.length,o.start+o.size-1],t);case 25:if(i=e.sent){e.next=28;break}return e.abrupt("return");case 28:n.push(i),o.data=qk(o.data,i.data);case 30:if(s=O_.moov(o)){e.next=33;break}throw new V_("cannot parse moov box",o.data);case 33:if(c=Y_(s,this._config.segmentDuration)){e.next=36;break}throw new V_("cannot parse segments",o.data);case 36:return this.meta=$_(s),f=c.videoSegments,l=c.audioSegments,this.videoSegments=f,this.audioSegments=l,e.abrupt("return",{meta:this.meta,videoSegments:f,audioSegments:l,responses:n});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getSegmentByTime",value:function(e){var t,r;return this.videoSegments.length?(t=this.videoSegments.find((function(t){return t.startTime<=e&&t.endTime>e})))&&(r=this.audioSegments[t.index]):r=this.audioSegments.find((function(t){return t.startTime<=e&&t.endTime>e})),{video:t,audio:r}}},{key:"loadSegmentByTime",value:(u=ua(ha.mark((function e(t,r){var n,i,o,a,u=arguments;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(u.length>2&&void 0!==u[2])||u[2],this.isMetaLoaded){e.next=4;break}return e.next=4,this.loadMeta(r);case 4:return i=this.getSegmentByTime(t),o=i.video,a=i.audio,e.abrupt("return",this._loadSegment(o,a,r,n));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"loadNextSegment",value:(a=ua(ha.mark((function e(t){var r,n,i,o=arguments;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!(o.length>1&&void 0!==o[1])||o[1],this.isMetaLoaded){e.next=4;break}return e.next=4,this.loadMeta();case 4:return n=this.videoSegments[this._currentSegmentIndex+1],i=this.audioSegments[this._currentSegmentIndex+1],e.abrupt("return",this._loadSegment(n,i,t,r));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"preload",value:(o=ua(ha.mark((function e(t){var r,n,i,o,a,u,s,c=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(!0);case 3:if(t&&!(t<0)){e.next=5;break}return e.abrupt("return");case 5:if(r=this.getSegmentByTime(t),n=r.video,i=r.audio,o=Math.max((null==n?void 0:n.index)||0,(null==i?void 0:i.index)||0)){e.next=9;break}return e.abrupt("return");case 9:return a=this.videoSegments.slice(0,o),u=this.audioSegments.slice(0,o),s=function(){var e=ua(ha.mark((function e(t){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>o)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,c._loadSegment(a[t],u[t],!0,!1);case 4:return e.next=6,s(t+1);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=14,s(0);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"cancel",value:function(){return this._loader.cancel()}},{key:"reset",value:(i=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loader.cancel();case 2:this.vid=this.url="",this.meta={},this.downloadInfo=[],this.videoSegments=[],this.audioSegments=[],this._currentSegmentIndex=-1,this._currentLoadingSegmentIndex=-1;case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"destroy",value:(n=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cancel();case 2:this.cache.clear();case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_loadSegment",value:(r=ua(ha.mark((function e(t,r,n,i){var o,a;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||r){e.next=2;break}return e.abrupt("return");case 2:return o=(null==t?void 0:t.index)||(null==r?void 0:r.index)||0,this._currentLoadingSegmentIndex=o,e.prev=4,e.next=7,this._loadData([Math.min((null==t?void 0:t.range[0])||1/0,(null==r?void 0:r.range[0])||1/0),Math.max((null==t?void 0:t.range[1])||0,(null==r?void 0:r.range[1])||0)],n);case 7:a=e.sent;case 8:return e.prev=8,this._currentLoadingSegmentIndex=-1,e.finish(8);case 11:if(a){e.next=13;break}return e.abrupt("return");case 13:return i&&(this._currentSegmentIndex=o),a.video=t,a.audio=r,e.abrupt("return",a);case 17:case"end":return e.stop()}}),e,this,[[4,,8,11]])}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"_loadData",value:(t=ua(ha.mark((function e(t,r){var n,i,o;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getCacheKey(t),e.next=3,this.cache.get(n);case 3:if(i=e.sent){e.next=10;break}return e.next=7,this._loader.load(this.url,{range:t});case 7:o=e.sent,e.next=11;break;case 10:o={data:i,fromCache:!0};case 11:if(o){e.next=13;break}return e.abrupt("return");case 13:return i||(this.downloadInfo.push({startTime:o.startTime,endTime:o.endTime,size:o.data.byteLength,range:t}),this._addDownloadInfo>this._config.maxDownloadInfoSize&&(this._downloadInfos=this.downloadInfo.slice(-this._config.maxDownloadInfoSize))),!i&&r&&this.cache.set(n,o.data),o.range=t,e.abrupt("return",o);case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"_getCacheKey",value:function(e){return(this.vid||this.url)+":"+e}}]),e}(),X_=function(){function e(t,r){Co(this,e),Vo(this,"_demuxer",new F_),Vo(this,"_remuxer",null),Vo(this,"_mse",null),Vo(this,"_softVideo",null),Vo(this,"_needInitSegment",!0),Vo(this,"_sourceCreated",!1),this.mp4=t,r?this._softVideo=t.media:(this._remuxer=new N_(this._demuxer.videoTrack,this._demuxer.audioTrack),this._mse=new Kp,this._mse.bindMedia(t.media))}var t,r,n,i,o;return Do(e,[{key:"appendBuffer",value:(o=ua(ha.mark((function e(t,r,n,i,o){var a,u,s,c,f,l,h,d,p,v;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.length){e.next=2;break}return e.abrupt("return");case 2:if(n&&(a=[n[0].index,n[n.length-1].index]),i&&(u=[i[0].index,i[i.length-1].index]),a||u){e.next=6;break}return e.abrupt("return");case 6:if(s=this._demuxer.demux(t,r,a,u,o),c=s.videoTrack,f=s.audioTrack,l=c.type,h=f.type,!(d=this._mse)){e.next=28;break}this._sourceCreated||(c.exist()&&(d.createSource(l,"video/mp4;codecs=".concat(c.codec)),this._sourceCreated=!0),f.exist()&&(d.createSource(h,"audio/mp4;codecs=".concat(f.codec)),this._sourceCreated=!0)),e.prev=12,p=this._remuxer.remux(this._needInitSegment),e.next=19;break;case 16:throw e.prev=16,e.t0=e.catch(12),new $p(zp,Yp.FMP4,e.t0);case 19:return this._needInitSegment=!1,v=[],p.videoInitSegment&&v.push(d.append(l,p.videoInitSegment)),p.audioInitSegment&&v.push(d.append(h,p.audioInitSegment)),p.videoSegment&&v.push(d.append(l,p.videoSegment)),p.audioSegment&&v.push(d.append(h,p.audioSegment)),e.abrupt("return",Promise.all(v).catch((function(e){if(e.type!==Qp.CANCELLED)throw new $p(Vp,Yp.MSE_APPEND_BUFFER,e)})));case 28:this._softVideo&&this._softVideo.appendBuffer(c,f);case 29:case"end":return e.stop()}}),e,this,[[12,16]])}))),function(e,t,r,n,i){return o.apply(this,arguments)})},{key:"evictBuffer",value:(i=ua(ha.mark((function e(t){var r,n,i,o,a,u=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.mp4.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(!(Up.start(Up.get(r))+1>=i)){e.next=10;break}return e.abrupt("return");case 10:return o=this._demuxer,a=[],[o.videoTrack,o.audioTrack].forEach((function(e){e.exist()&&a.push(u._mse.remove(e.type,0,i))})),e.abrupt("return",Promise.all(a).catch((function(e){if(e.type!==Qp.CANCELLED)throw new $p(Vp,Yp.MSE_OTHER,e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"reset",value:(n=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=6;break}return e.next=3,this._mse.unbindMedia();case 3:return e.next=5,this._mse.bindMedia(this.mp4.media);case 5:this._mseOpened=!1;case 6:this._sourceCreated=!1,this._needInitSegment=!0;case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"endOfStream",value:(r=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=12;break}if(!this._sourceCreated){e.next=12;break}return e.prev=2,e.next=5,this._mse.endOfStream();case 5:e.next=12;break;case 7:if(e.prev=7,e.t0=e.catch(2),e.t0.type!==Qp.CANCELLED){e.next=11;break}return e.abrupt("return");case 11:throw new $p(Vp,Yp.MSE_OTHER,e.t0);case 12:this._softVideo&&this._softVideo.endOfStream();case 13:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:(t=ua(ha.mark((function e(){var t;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._mse,this._mse=null,this._softVideo=null,this._demuxer=null,this._remuxer=null,!t){e.next=8;break}return e.next=8,t.unbindMedia();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();function J_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J_(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function eT(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}var tT=function(e){No(a,e);var t,r,n,i,o=eT(a);function a(e){var t,r,n;return Co(this,a),Vo(Uo(t=o.call(this)),"_prevSegmentEndTime",0),Vo(Uo(t),"_tickTimer",null),Vo(Uo(t),"_loading",!1),Vo(Uo(t),"_onSeeking",ua(ha.mark((function e(){var r,n,i,o,a,u,s;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.media){e.next=2;break}return e.abrupt("return");case 2:if(r=t.media.currentTime,n=t._loader,i=n.getSegmentByTime(r),o=i.video,a=i.audio,u=o||a){e.next=8;break}return e.abrupt("return");case 8:if(!n.isSegmentLoading(u.index)){e.next=10;break}return e.abrupt("return");case 10:if(!(s=Up.info(Up.get(t.media),r,.1)).end||!(s.end>=u.endTime||s.end>=t.media.duration)){e.next=13;break}return e.abrupt("return");case 13:return e.next=15,n.cancel();case 15:t._loading=!1,t._prevSegmentEndTime=0,t._loadSegment(r),t._startTick();case 19:case"end":return e.stop()}}),e)})))),Vo(Uo(t),"_tick",(function(){t._stopTick();var e=t.media;e&&(t._startTick(t._config.tickInterval),Up.end(Up.get(e))<.1||!e.readyState||function(e){return e&&!e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState}(e)&&t._loadSegment())})),e=t._config=(n=(null==(r=e)?void 0:r.media)||document.createElement("video"),Z_(Z_({softDecode:!1,tickInterval:500,preloadTime:10,bufferBehind:10,segmentDuration:void 0,url:"",retry:3,retryDelay:100},r),{},{media:n})),t.media=t._config.media,e.softDecode&&t.media.setPlayMode&&t.media.setPlayMode("VOD"),t._bufferService=new X_(Uo(t),e.softDecode),t._loader=new K_({url:e.url,retry:e.retry,retryDelay:e.retryDelay}),t.media.addEventListener("seeking",t._onSeeking),t}return Do(a,[{key:"load",value:(i=ua(ha.mark((function e(t){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._reset();case 2:if(!t){e.next=5;break}return e.next=5,this._loader.changeUrl(t);case 5:return this._startTick(this._config.tickInterval),e.next=8,this._loadSegment(0);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"destroy",value:(n=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.media.removeEventListener("seeking",this._onSeeking),e.next=3,this._reset();case 3:return e.next=5,this._bufferService.destroy();case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_reset",value:(r=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._stopTick(),e.next=3,this._loader.reset();case 3:return e.next=5,this._bufferService.reset();case 5:this._prevSegmentEndTime=0,this._loading=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_loadSegment",value:(t=ua(ha.mark((function e(t){var r,n,i,o,a,u,s,c;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._loading){e.next=2;break}return e.abrupt("return");case 2:if(a=this.media.currentTime,!(this._prevSegmentEndTime>a+this._config.preloadTime)){e.next=5;break}return e.abrupt("return");case 5:if(this._loading=!0,e.prev=6,null==t){e.next=13;break}return e.next=10,this._loader.loadSegmentByTime(t);case 10:u=e.sent,e.next=16;break;case 13:return e.next=15,this._loader.loadNextSegment();case 15:u=e.sent;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(6),this._emitError($p.network(e.t0));case 21:if(u){e.next=24;break}return this._loading=!1,e.abrupt("return");case 24:return this._prevSegmentEndTime=Math.min((null===(r=u.video)||void 0===r?void 0:r.endTime)||1/0,(null===(n=u.audio)||void 0===n?void 0:n.endTime)||1/0),e.prev=25,e.next=28,this._bufferService.appendBuffer(u.data,u.range[0],null===(s=u.video)||void 0===s?void 0:s.frames,null===(c=u.audio)||void 0===c?void 0:c.frames,this._loader.meta.moov);case 28:return e.next=30,this._bufferService.evictBuffer(this._config.bufferBehind);case 30:e.next=35;break;case 32:return e.prev=32,e.t1=e.catch(25),e.abrupt("return",this._emitError($p.create(e.t1)));case 35:return e.prev=35,this._loading=!1,e.finish(35);case 38:this._loader.isLastSegment((null===(i=u.video)||void 0===i?void 0:i.index)||(null===(o=u.audio)||void 0===o?void 0:o.index)||0)?this._end():this._loadSegment();case 39:case"end":return e.stop()}}),e,this,[[6,18],[25,32,35,38]])}))),function(e){return t.apply(this,arguments)})},{key:"_end",value:function(){this._bufferService.endOfStream(),this._stopTick()}},{key:"_startTick",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._stopTick(),this._tickTimer=setTimeout(this._tick,e)}},{key:"_stopTick",value:function(){clearTimeout(this._tickTimer)}},{key:"_emitError",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];console.error(e),console.table(e),this.emit(Hk,e),t&&this._end()}}],[{key:"isSupported",value:function(){return Kp.isSupported()||!!WebAssembly}}]),a}($k);function rT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rT(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rT(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function iT(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}Vo(tT,"version","3.0.0-next.1");var oT=function(t){No(n,t);var r=iT(n);function n(){var e;Co(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return Vo(Uo(e=r.call.apply(r,[this].concat(i))),"mp4",null),Vo(Uo(e),"destroy",(function(){var t,r;e.mp4&&(e.mp4.destroy(),e.mp4=null,null===(t=e.player)||void 0===t||null===(r=t.video)||void 0===r||r.removeEventListener("lowdecode",e._onLowDecode))})),Vo(Uo(e),"_onLowDecode",(function(){var t=e.player.video;t&&(e.player.emit("lowdecode",t.degradeInfo),e.player.emit("core_event",nT(nT({},t.degradeInfo),{},{eventName:Yk})))})),Vo(Uo(e),"_onSwitchURL",(function(t){e.mp4&&(e.player.config.url=t,e.mp4.load(t))})),Vo(Uo(e),"_onLowDecode",(function(){var t=e.player.video;t&&(e.player.emit("lowdecode",t.degradeInfo),e.player.emit("core_event",nT(nT({},t.degradeInfo),{},{eventName:Yk})))})),Vo(Uo(e),"_onDefinitionChange",(function(t){var r=t.to;e.mp4&&e.mp4.load(r)})),e}return Do(n,[{key:"core",get:function(){return this.mp4}},{key:"version",get:function(){return tT.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}},{key:"beforePlayerInit",value:function(){var t=this,r=this.player.config;this.mp4&&this.mp4.destroy(),this.player.switchURL=this._onSwitchURL;var n=r.mp4||{};this.mp4=new tT(nT({softDecode:this.softDecode,media:this.player.video,url:r.url},n)),this.softDecode?(this.player.forceDegradeToVideo=function(){},this.player.video.addEventListener("lowdecode",this._onLowDecode)):e.BasePlugin.defineGetterOrSetter(this.player,{__url:{get:function(){var e,r;return null===(e=t.mp4)||void 0===e||null===(r=e.media)||void 0===r?void 0:r.src},configurable:!0}}),this.on(e.Events.URL_CHANGE,this._onSwitchURL),this.on(e.Events.DEFINITION_CHANGE,this._onDefinitionChange),this.on(e.Events.DESTROY,this.destroy),this._transError(),this.mp4.load()}},{key:"_transError",value:function(){var t=this;this.mp4.on(Hk,(function(r){t.player&&t.player.emit(e.Events.ERROR,new e.Errors(t.player,r))}))}}],[{key:"pluginName",get:function(){return"mp4"}},{key:"isSupported",value:function(e){return tT.isSupported(e)}}]),n}(e.BasePlugin);return Vo(oT,"MP4",tT),oT}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xgplayer")):"function"==typeof define&&define.amd?define(["xgplayer"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).MP4Player=t(e.Player)}(this,(function(e){"use strict";function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n(){n=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(D){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i,a,s,o,u=t&&t.prototype instanceof f?t:f,c=Object.create(u.prototype),h=new S(n||[]);return c._invoke=(i=e,a=r,s=h,o="suspendedStart",function(e,t){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===e)throw t;return{value:void 0,done:!0}}for(s.method=e,s.arg=t;;){var r=s.delegate;if(r){var n=_(r,s);if(n){if(n===d)continue;return n}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===o)throw o="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);o="executing";var u=l(i,a,s);if("normal"===u.type){if(o=s.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:s.done}}"throw"===u.type&&(o="completed",s.method="throw",s.arg=u.arg)}}),c}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(D){return{type:"throw",arg:D}}}e.wrap=c;var d={};function f(){}function h(){}function p(){}var v={};u(v,a,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==t&&r.call(y,a)&&(v=y);var g=p.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,a,s,o){var u=l(e[i],e,a);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,o)}),(function(e){n("throw",e,s,o)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,o)}))}o(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=l(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function x(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 w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function T(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:E}}function E(){return{value:void 0,done:!0}}return h.prototype=p,u(g,"constructor",p),u(p,"constructor",h),h.displayName=u(p,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,o,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(k.prototype),u(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var s=new k(c(t,r,n,i),a);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},b(g),u(g,o,"Generator"),u(g,a,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=T,S.prototype={constructor:S,reset:function(e){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,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=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 s.type="throw",s.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],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var o=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(o&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(o){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 s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(s)},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),d},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),w(r),d}},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;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,r,n,i,a,s){try{var o=e[a](s),u=o.value}catch(c){return void r(c)}o.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var s=e.apply(t,r);function o(e){a(s,n,i,o,u,"next",e)}function u(e){a(s,n,i,o,u,"throw",e)}o(void 0)}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,r){return t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function v(e,t,r){return(v=p()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i}).apply(null,arguments)}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;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,n)}function n(){return v(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},m(e)}function y(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function k(e){var t=p();return function(){var r,n=f(e);if(t){var i=f(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return b(this,r)}}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,a=[],s=!0,o=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(u){o=!0,i=u}finally{try{s||null==r.return||r.return()}finally{if(o)throw i}}return a}(e,t)||w(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 x(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(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 w(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(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 T(){var e,t,r=new Promise((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}var E,D=function(){function e(){o(this,e)}return c(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(t){}}},{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 s=r[a-1],o=s[1];if(e.start(n)-o<=t){var u=e.end(n);u>o&&(s[1]=u)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"length",value:function(e){return e&&e.length?e.reduce((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,s=0,o=0,u=0,c=0,l=0,d=e.buffers(t,n),f=0,h=d.length;f<h;f++){var p=d[f];if(r+n>=p[0]&&r<p[1])i=p[0],a=p[1],s=f;else{if(r+n<p[0]){o=p[0],u=p[1];break}r+n>p[1]&&(c=p[0],l=p[1])}}return{start:i,end:a,index:s,buffers:d,nextStart:o,nextEnd:u,prevStart:c,prevEnd:l,currentTime:r,behind:r-i,remaining:a?a-r:0,length:e.length&&e.length(d)}}}]),e}(),B="network",C="network_timeout",A="demux",P="remux",L="media",O="other",U={FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",OPTION:"OPTION"},I=(l(E={},"manifest",{HLS:1100}),l(E,B,2100),l(E,C,2101),l(E,A,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400}),l(E,P,{FMP4:4100,MP4:4200}),l(E,L,{MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202}),l(E,O,8e3),E),M=function(e){d(r,e);var t=k(r);function r(e,n,i,a,s){var u;return o(this,r),(u=t.call(this,s||(null==i?void 0:i.message))).errorType=e===C?B:e,u.originError=i,u.ext=a,u.errorCode=I[e][n]||I[e],u.errorMessage=u.message,u.errorCode||(u.errorType=O,u.errorCode=I[u.errorType]),u}return c(r,null,[{key:"create",value:function(e,t,n,i,a){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=O),new r(e,t,n,i,a))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?C:B,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}(m(Error)),R="undefined"!=typeof window?window.MediaSource||window.WebKitMediaSource:null,j={UPDATE_ERROR:"updateError"},N=function(){function e(t){var r=this;o(this,e),l(this,"media",null),l(this,"mediaSource",null),l(this,"_openPromise",T()),l(this,"_queue",Object.create(null)),l(this,"_sourceBuffer",Object.create(null)),l(this,"_onSBUpdateEnd",(function(e){var t=r._queue[e];if(t){var n=t.shift();n&&(n.promise.resolve(),r._startQueue(e))}})),l(this,"_onSBUpdateError",(function(e,t){var n=r._queue[e];if(n){var i=n[0];i&&i.promise.reject(new M(L,U.MSE_APPEND_BUFFER,t))}})),t&&this.bindMedia(t)}var t,r,i;return c(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"updateDuration",value:function(e){var t=this;return this._enqueueBlockingOp((function(){t.mediaSource&&(t.mediaSource.duration=e)}))}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){t.removeEventListener("sourceopen",r),e._openPromise.resolve()})),this._openPromise=T()}return this._openPromise}},{key:"bindMedia",value:(i=s(n().mark((function e(t){var r,i,a=this;return n().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(t&&R){e.next=5;break}throw new Error("Param media or MediaSource does not exist");case 5:return this.media=t,r=this.mediaSource=new R,t.src=URL.createObjectURL(r),i=function e(){r.removeEventListener("sourceopen",e),URL.revokeObjectURL(t.src),a._openPromise.resolve()},r.addEventListener("sourceopen",i),e.abrupt("return",this._openPromise);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"unbindMedia",value:(r=s(n().mark((function e(){var t,r=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){if(Object.keys(this._queue).forEach((function(e){var t=r._queue[e];t&&t.forEach((function(e){return e.promise.resolve}))})),"open"===t.readyState)try{t.endOfStream()}catch(n){}Object.keys(this._sourceBuffer).forEach((function(e){try{t.removeSourceBuffer(r._sourceBuffer[e])}catch(n){}}))}if(this.media){this.media.removeAttribute("src");try{this.media.load()}catch(n){}this.media=null}this.mediaSource=null,this._openPromise=T(),this._queue=Object.create(null),this._sourceBuffer=Object.create(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){if(!this._sourceBuffer[e]&&this.mediaSource){var r;try{r=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(n){throw new M(L,U.MSE_ADD_SB,n)}r.mimeType=t,r.addEventListener("updateend",this._onSBUpdateEnd.bind(this,e)),r.addEventListener("error",this._onSBUpdateError.bind(this,e))}}},{key:"changeType",value:function(e,t){var r=this._sourceBuffer[e];return this.mediaSource&&r&&r.mimeType!==t&&"function"==typeof r.changeType?this._enqueueOp((function(){r.changeType(t)})):Promise.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t){var r=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){r.mediaSource&&r._sourceBuffer[e].appendBuffer(t)})):Promise.resolve()}},{key:"remove",value:function(e,t,r){var n=this;return 1===Object.keys(this._sourceBuffer).length?Promise.resolve():this._enqueueOp(e,(function(){if(n.mediaSource){var i=n._sourceBuffer[e];t>=r||!i?n._onSBUpdateEnd(e):i.remove(t,r)}}))}},{key:"clearBuffer",value:function(e,t){var r,n=this;return Object.keys(this._sourceBuffer).forEach((function(i){r=n._enqueueOp(i,(function(){n.mediaSource&&n._sourceBuffer[i].remove(e,t)}))})),r}},{key:"clearAllBuffer",value:function(){var e,t=this;return Object.keys(this._sourceBuffer).forEach((function(r){e=t._enqueueOp(r,(function(){if(t.mediaSource){var e=t._sourceBuffer[r];e.remove(0,D.end(D.get(e)))}}))})),e}},{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&&(e?r.endOfStream(e):r.endOfStream())})):Promise.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:"buffered",value:function(e){return D.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return D.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return D.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t){if(!this.mediaSource)return Promise.resolve();var r=this._queue[e]=this._queue[e]||[],n={exec:t,promise:T()};return r.push(n),1===r.length&&this._startQueue(e),n.promise}},{key:"_enqueueBlockingOp",value:(t=s(n().mark((function e(t){var r,i,a=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if((r=Object.keys(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return i=[],r.forEach((function(e){var t=a._queue[e],r=T();i.push(r),t.push({exec:function(){return r.resolve()},promise:r}),1===t.length&&a._startQueue(e)})),e.abrupt("return",Promise.all(i).then((function(){try{return t()}finally{r.forEach((function(e){var t=a._queue[e],r=a._sourceBuffer[e];null==t||t.shift(),r&&r.updating||a._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r)try{r.exec()}catch(n){r.promise.reject(new M(L,U.MSE_OTHER,n)),t.shift(),this._startQueue(e)}}}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!R)return!1;try{return R.isTypeSupported(e)}catch(t){return!1}}}]),e}();l(N,"VIDEO","video"),l(N,"AUDIO","audio");var z="fetch",F="xhr",G="arraybuffer",V="text",q="json",H=function(e){d(r,e);var t=k(r);function r(e,n,i,a){var s;return o(this,r),l(g(s=t.call(this,a)),"retryCount",0),l(g(s),"isTimeout",!1),l(g(s),"loaderType",z),l(g(s),"startTime",0),l(g(s),"endTime",0),s.url=e,s.request=n,s.response=i,s}return c(r)}(m(Error)),K=Object.prototype.toString;function Q(e){if("[object Object]"!==K.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function W(e){if(e&&null!=e[0]&&(0!==e[0]||null!=e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z(e,t){if(e){if(!t)return e;var r,n=Object.keys(t).map((function(e){if(null!=(r=t[e]))return Array.isArray(r)?e+="[]":r=[r],r.map((function(t){var r;return r=t,"[object Date]"===K.call(r)?t=t.toISOString():function(e){return null!==e&&"object"===i(e)}(t)&&(t=JSON.stringify(t)),"".concat(Y(e),"=").concat(Y(t))})).join("&")})).filter(Boolean).join("&");if(n){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}}function X(e,t,r,n,i,a){return n=null!=n?parseFloat(n):null,r=parseInt(r||"0",10),isNaN(r)&&(r=0),{data:e,response:t,contentLength:r,age:n,startTime:i,firstByteTime:a,endTime:Date.now()}}var $=function(){function e(){o(this,e),l(this,"_abortController",null),l(this,"_timeoutTimer",null),l(this,"_reader",null),l(this,"_response",null),l(this,"_aborted",!1)}var t;return c(e,[{key:"load",value:function(e){var t,r=this,i=e.url,a=e.timeout,o=e.responseType,u=e.onProgress,c=e.onTimeout,l=e.range,d=e.transformResponse,f=e.request,h=e.params,p=e.method,v=e.headers,m=e.body,y=e.mode,g=e.credentials,b=e.cache,k=e.redirect,_=e.referrer,x=e.referrerPolicy;this._aborted=!1,this._abortController="undefined"!=typeof AbortController&&new AbortController;var w={method:p,headers:v,body:m,mode:y,credentials:g,cache:b,redirect:k,referrer:_,referrerPolicy:x,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},S=!1;clearTimeout(this._timeoutTimer),i=Z(i,h);var T=W(l);T&&((v=f?f.headers:w.headers=w.headers||new Headers)instanceof Headers?v.append("Range",T):v.Range=T),a&&(this._timeoutTimer=setTimeout((function(){if(S=!0,r.cancel(),c){var e=new H(i,w);e.isTimeout=!0,c(e)}}),a));var E=Date.now();return fetch(f||i,f?void 0:w).then(function(){var e=s(n().mark((function e(t){var a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=t,!r._aborted){e.next=4;break}return e.abrupt("return");case 4:if(d&&(t=d(t,i)||t),t.ok){e.next=7;break}throw new H(i,w,t,"bad network response");case 7:if(a=Date.now(),o!==V){e.next=14;break}return e.next=11,t.text();case 11:s=e.sent,e.next=28;break;case 14:if(o!==q){e.next=20;break}return e.next=17,t.json();case 17:s=e.sent,e.next=28;break;case 20:if(!u){e.next=24;break}r._loadChunk(t,u),e.next=28;break;case 24:return e.next=26,t.arrayBuffer();case 26:s=e.sent,s=new Uint8Array(s);case 28:return e.abrupt("return",X(s,t,t.headers.get("Content-Length"),t.headers.get("age"),E,a));case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){if(clearTimeout(r._timeoutTimer),!r._aborted||S)throw(e=e instanceof H?e:new H(i,w)).startTime=E,e.endTime=Date.now(),e.isTimeout=S,e}))}},{key:"cancel",value:(t=s(n().mark((function e(){return n().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._response){e.next=13;break}if(e.prev=4,!this._reader){e.next=8;break}return e.next=8,this._reader.cancel();case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:this._response=this._reader=null;case 13:if(this._abortController){try{this._abortController.abort()}catch(t){}this._abortController=null}case 14:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t){var r,i,a,o=this,u=this._reader=e.body.getReader(),c=function(){var l=s(n().mark((function s(){return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=Date.now(),n.prev=1,n.next=4,u.read();case 4:r=n.sent,a=Date.now(),n.next=13;break;case 8:return n.prev=8,n.t0=n.catch(1),a=Date.now(),t(void 0,!0,{startTime:i,endTime:a},e),n.abrupt("return");case 13:if(!o._aborted){n.next=16;break}return t(void 0,!0,{startTime:i,endTime:a},e),n.abrupt("return");case 16:t(r.value,r.done,{startTime:i,endTime:a},e),r.done||c();case 18:case"end":return n.stop()}}),s,null,[[1,8]])})));return function(){return l.apply(this,arguments)}}();c()}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),e}();var J=function(){function e(){o(this,e),l(this,"_xhr",null),l(this,"_aborted",!1),l(this,"_timeoutTimer",null)}return c(e,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer);var r=e.url,n=e.params,i=e.timeout,a=e.responseType,s=e.onTimeout,o=e.transformResponse,u=e.onProgress,c=e.method,l=e.credentials,d=e.body,f=e.headers,h=e.range,p=e.request,v=!1;r=Z(r,n);var m=Date.now();return new Promise((function(e,n){var y=t._xhr=new XMLHttpRequest;y.open(c||"GET",r,!0),y.responseType=a,y.withCredentials="include"===l||"same-origin"===l;var g=W(h);g&&((f=f||{}).Range=g),f&&Object.keys(f).forEach((function(e){y.setRequestHeader(e,f[e])})),i&&(t._timeoutTimer=setTimeout((function(){if(v=!0,t.cancel(),s){var e=new H(r,p);e.isTimeout=!0,s(e)}}),i)),y.onerror=function(e){return n(e)},y.onreadystatechange=function(){if(y.readyState>=2){clearTimeout(t._timeoutTimer);var i=Date.now();if(4===y.readyState){if(y.onreadystatechange=null,t._aborted)return;var a=y.status,s={ok:a>=200&&a<300,status:a,statusText:y.statusText,url:y.responseURL,headers:t._getHeaders(y),body:y.response};if(o&&(s=o(s,r)||s),!s.ok)return n(new H(r,p,s,"bad network response"));var c=y.responseType===G,l=c?new Uint8Array(y.response):y.response;u&&u(c?l:void 0,!0,{startTime:m,endTime:Date.now()},s),e(X(l,s,s.headers["content-length"],s.headers.age,m,i))}}},y.send(d)})).catch((function(e){if(clearTimeout(t._timeoutTimer),!t._aborted||v)throw(e=e instanceof H?e:new H(r,p)).startTime=m,e.endTime=Date.now(),e.isTimeout=v,e}))}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._xhr?this._xhr.cancel():void 0}},{key:"_getHeaders",value:function(e){var t,r={},n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=w(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,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}(e.getAllResponseHeaders().trim().split("\r\n"));try{for(n.s();!(t=n.n()).done;){var i=t.value.split(": ");r[i[0].toLowerCase()]=i.slice(1).join(": ")}}catch(a){n.e(a)}finally{n.f()}return r}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),e}(),ee=["retry","retryDelay","onRetryError","transformError"],te=function(){function e(t,r){o(this,e),this.promise=T(),this.alive=!!r.onProgress,this._loaderType=t,this._loader=t===z?new $:new J,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1}var t;return c(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,i=t.retryDelay,a=t.onRetryError,o=t.transformError,u=y(t,ee),c=function(){var t=s(n().mark((function t(){var s,l;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(u);case 3:s=t.sent,e.promise.resolve(s),t.next=22;break;case 7:if(t.prev=7,t.t0=t.catch(0),!e._canceled){t.next=11;break}return t.abrupt("return");case 11:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,l=t.t0,o&&(l=o(l)||l),a&&e._retryCount>0&&a(l,e._retryCount,r),e._retryCount++,!(e._retryCount<=r)){t.next=21;break}return clearTimeout(e._retryTimer),e._retryTimer=setTimeout(c,i),t.abrupt("return");case 21:e.promise.reject(l);case 22:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return c(),this.promise}},{key:"cancel",value:(t=s(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,e.abrupt("return",this._loader.cancel());case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();function re(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=t.filter(Boolean)).length<2)return t[0];var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var ie=function(){function e(t){o(this,e),l(this,"type",z),l(this,"_queue",[]),l(this,"_alive",[]),l(this,"_currentTask",null),this._config=function(e){return r({loaderType:z,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:V,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},e)}(t),this._config.loaderType!==F&&$.isSupported()||(this.type=F)}var t;return c(e,[{key:"isFetch",value:function(){return this.type===z}},{key:"load",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?t=e:t.url=e||t.url||this._config.url,(t=Object.assign({},this._config,t)).params&&(t.params=Object.assign({},t.params)),t.headers&&Q(t.headers)&&(t.headers=Object.assign({},t.headers)),t.body&&Q(t.body)&&(t.body=Object.assign({},t.body)),t.transformRequest&&(t=t.transformRequest(t)||t);var r=new te(this.type,t);return this._queue.push(r),1===this._queue.length&&this._processTask(),r.promise}},{key:"cancel",value:(t=s(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,ne();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;this._currentTask=this._queue.shift(),this._currentTask&&(this._currentTask.alive&&this._alive.push(this._currentTask),this._currentTask.exec().catch((function(){})).finally((function(){e._processTask()})))}}],[{key:"isFetchSupport",value:function(){return $.isSupported()}}]),e}(),ae="error",se="core.lowdecode",oe=function(){function e(t){o(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return c(e,[{key:"debug",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).debug.apply(t,[this._prefix].concat(n))}}},{key:"log",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).log.apply(t,[this._prefix].concat(n))}}},{key:"warn",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).warn.apply(t,[this._prefix].concat(n))}}},{key:"error",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).error.apply(t,[this._prefix].concat(n))}}},{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}();l(oe,"disabled",!0);var ue={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,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new i(n,a||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],o]:e._events[u].push(o):(e._events[u]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.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?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.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,s=new Array(a);i<a;i++)s[i]=n[i].fn;return s},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,i,a,s){var o=r?r+e:e;if(!this._events[o])return!1;var u,c,l=this._events[o],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,i),!0;case 5:return l.fn.call(l.context,t,n,i,a),!0;case 6:return l.fn.call(l.context,t,n,i,a,s),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,h=l.length;for(c=0;c<h;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){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(f=1,u=new Array(d-1);f<d;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},o.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||s(this,a);else{for(var u=0,c=[],l=o.length;u<l;u++)(o[u].fn!==t||i&&!o[u].once||n&&o[u].context!==n)&&c.push(o[u]);c.length?this._events[a]=1===c.length?c[0]:c:s(this,a)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o}(ue);var ce=ue.exports,le="video",de="audio",fe="metadata",he="avc",pe="hevc",ve="aac",me="g7110a",ye="g7110m",ge="LARGE_AV_SHIFT",be="LARGE_VIDEO_GAP",ke="LARGE_VIDEO_GAP_BETWEEN_CHUNK",_e="LARGE_AUDIO_GAP",xe="AUDIO_FILLED",we="AUDIO_DROPPED",Se=function(){function e(){o(this,e),l(this,"id",1),l(this,"type",le),l(this,"codecType",he),l(this,"pid",-1),l(this,"hvcC",void 0),l(this,"codec",""),l(this,"timescale",0),l(this,"formatTimescale",0),l(this,"sequenceNumber",0),l(this,"baseMediaDecodeTime",0),l(this,"baseDts",0),l(this,"duration",0),l(this,"warnings",[]),l(this,"samples",[]),l(this,"pps",[]),l(this,"sps",[]),l(this,"vps",[]),l(this,"fpsNum",0),l(this,"fpsDen",0),l(this,"sarRatio",[]),l(this,"width",0),l(this,"height",0),l(this,"nalUnitSize",4),l(this,"present",!1),l(this,"ext",void 0)}return c(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:"exist",value:function(){return!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}}]),e}(),Te=function(){function e(){o(this,e),l(this,"id",2),l(this,"type",de),l(this,"codecType",ve),l(this,"pid",-1),l(this,"codec",""),l(this,"sequenceNumber",0),l(this,"sampleDuration",0),l(this,"timescale",0),l(this,"formatTimescale",0),l(this,"baseMediaDecodeTime",0),l(this,"duration",0),l(this,"warnings",[]),l(this,"samples",[]),l(this,"baseDts",0),l(this,"sampleSize",16),l(this,"sampleRate",0),l(this,"channelCount",0),l(this,"objectType",0),l(this,"sampleRateIndex",0),l(this,"config",[]),l(this,"present",!1),l(this,"ext",void 0)}return c(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.codecType===ve)}},{key:"hasSample",value:function(){return!!this.samples.length}}]),e}(),Ee=function(){function e(t,r,n){o(this,e),l(this,"flag",{}),l(this,"keyframe",!1),l(this,"gopId",0),l(this,"duration",0),l(this,"size",0),l(this,"units",[]),l(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return c(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}(),De=c((function e(t,r,n){o(this,e),l(this,"duration",1024),l(this,"flag",{dependsOn:2,isNonSyncSample:0}),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,n&&(this.duration=n)})),Be=c((function e(t,r){o(this,e),l(this,"time",0),this.data=t,this.originPts=this.pts=r})),Ce=function(e){d(r,e);var t=k(r);function r(){return o(this,r),t.apply(this,arguments)}return c(r)}(Be),Ae=function(e){d(r,e);var t=k(r);function r(){return o(this,r),t.apply(this,arguments)}return c(r)}(Be),Pe=function(){function e(){o(this,e),l(this,"id",3),l(this,"type",fe),l(this,"timescale",0),l(this,"flvScriptSamples",[]),l(this,"seiSamples",[])}return c(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}(),Le=function(){function e(t){if(o(this,e),l(this,"_bytesAvailable",void 0),l(this,"_bitsAvailable",0),l(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return c(e,[{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}(),Oe=function(){function e(t){o(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return c(e,[{key:"warn",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).warn.apply(t,[this._prefix].concat(n))}}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();l(Oe,"disabled",!0);var Ue=function(){function e(){o(this,e)}return c(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 s=(31&n[i])<<6|63&n[i+1];if(s>=128){r.push(String.fromCharCode(65535&s)),i+=2;continue}}}else if(n[i]<240){if(e._checkContinuation(n,i,2)){var o=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(o>=2048&&55296!=(63488&o)){r.push(String.fromCharCode(65535&o)),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}(),Ie="undefined"!=typeof window,Me=Ie&&navigator.userAgent.toLocaleLowerCase(),Re=Ie&&/^((?!chrome|android).)*safari/.test(Me),je=Ie&&Me.includes("firefox"),Ne=Ie&&Me.includes("android");function ze(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=t.filter(Boolean);var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}var Fe=Math.pow(2,32);function Ge(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<8)+(e[t+1]||0)}function Ve(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 qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ve(e,t)*Fe+Ve(e,t+4)}function He(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}var Ke=function(){function e(){o(this,e)}return c(e,null,[{key:"parseAnnexB",value:function(e){for(var t=e.length,r=2,n=0;null!=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=Ve(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){for(var t=e.length,r=1,n=0,i=0,a="";255===e[r];)n+=255,r++;for(n+=e[r++];255===e[r];)i+=255,r++;if(i+=e[r++],5===n&&t>r+16)for(var s=0;s<16;s++)a+=e[r].toString(16),r++;return{payload:e.subarray(r),type:n,size:i,uuid:a}}},{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),s=0;for(n=0;n<i;s++,n++)s===r[0]&&(s++,r.shift()),a[n]=e[s];return a}}]),e}(),Qe=function(){function e(){o(this,e)}return c(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var r,n,i=1+(3&t[4]),a=[],s=[],o=6,u=31&t[5],c=0;c<u;c++)if(n=t[o]<<8|t[o+1],o+=2,n){var l=t.subarray(o,o+n);o+=n,a.push(l),r||(r=e.parseSPS(Ke.removeEPB(l)))}var d,f=t[o];o++;for(var h=0;h<f;h++)d=t[o]<<8|t[o+1],o+=2,d&&(s.push(t.subarray(o,o+d)),o+=d);return{sps:r,spsArr:a,ppsArr:s,nalUnitSize:i}}}},{key:"parseSPS",value:function(e){var t=new Le(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 s=t.readUEG();if(s<=3&&(a=[0,420,422,444][s]),3===s&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var o=3!==s?8:12,u=0;u<o;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(),d=0;d<l;d++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var f=t.readUEG(),h=t.readUEG(),p=t.readBits(1);0===p&&t.skipBits(1),t.skipBits(1);var v,m,y,g,b,k=0,_=0,x=0,w=0;if(t.readBool()&&(k=t.readUEG(),_=t.readUEG(),x=t.readUEG(),w=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 S=t.readBits(32),T=t.readBits(32);m=t.readBool(),b=(y=T)/(g=2*S)}}return{codec:He(e.subarray(1,4)),profileIdc:r,profileCompatibility:n,levelIdc:i,chromaFormat:a,width:Math.ceil(16*(f+1)-2*(k+_)),height:(2-p)*(h+1)*16-(p?2:4)*(x+w),sarRatio:v,fpsNum:y,fpsDen:g,fps:b,fixedFrame:m}}}]),e}(),We=function(){function e(){o(this,e)}return c(e,null,[{key:"getRateIndexByRate",value:function(t){return e.FREQ.indexOf(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,s=[],o=(60&t[i+2])>>>2,u=e.FREQ[o];if(!u)throw new Error("Invalid sampling index: ".concat(o));for(var c,l,d=1+((192&t[i+2])>>>6),f=(1&t[i+2])<<2|(192&t[i+3])>>>6,h=e._getConfig(o,f,d),p=h.config,v=h.codec,m=0,y=e.getFrameDuration(u);i+7<n;)if(255===t[i]&&240==(246&t[i+1])){if(n-i<(l=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5))break;c=2*(1&~t[i+1]),s.push({pts:r+m*y,data:t.subarray(i+7+c,i+l)}),m++,i+=l}else i++;return{skip:a,remaining:i>=n?void 0:t.subarray(i),frames:s,samplingFrequencyIndex:o,sampleRate:u,objectType:d,channelCount:f,codec:v,config:p,originCodec:"mp4a.40.".concat(d)}}}},{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)throw new Error("Invalid sampling index: ".concat(n));var s=e._getConfig(n,i,r);return{samplingFrequencyIndex:n,sampleRate:a,objectType:r,channelCount:i,config:s.config,codec:s.codec,originCodec:"mp4a.40.".concat(r)}}}},{key:"getFrameDuration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return 1024*t/e}},{key:"_getConfig",value:function(e,t,r){var n,i,a=[];return je?e>=6?(n=5,i=e-3):(n=2,i=e):Ne?(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}();l(We,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var Ye=function(){function e(){o(this,e)}return c(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,s,o,u=1+(3&t[21]),c=[],l=[],d=[],f=23,h=t[22],p=0;p<h;p++){a=63&t[f],s=t[f+1]<<8|t[f+2],f+=3;for(var v=0;v<s;v++)if(o=t[f]<<8|t[f+1],f+=2,o){switch(a){case 32:var m=t.subarray(f,f+o);n||(n=e.parseVPS(Ke.removeEPB(m),r)),d.push(m);break;case 33:var y=t.subarray(f,f+o);i||(i=e.parseSPS(Ke.removeEPB(y),r)),c.push(y);break;case 34:l.push(t.subarray(f,f+o))}f+=o}}return{hvcC:r,sps:i,spsArr:c,ppsArr:l,vpsArr:d,nalUnitSize:u}}}},{key:"parseVPS",value:function(t,r){r=r||{};var n=new Le(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 Le(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(),s=420;a<=3&&(s=[0,420,422,444][a]);var o=0;3===a&&(o=n.readBits(1));var u,c,l,d,f=n.readUEG(),h=n.readUEG(),p=n.readBits(1);if(1===p&&(u=n.readUEG(),c=n.readUEG(),l=n.readUEG(),d=n.readUEG()),r.bitDepthLumaMinus8=n.readUEG(),r.bitDepthChromaMinus8=n.readUEG(),1===p){var v=1!==a&&2!==a||0!==o?1:2,m=1===a&&0===o?2:1;f-=v*(c+u),h-=m*(d+l)}return{codec:"hev1.1.6.L93.B0",width:f,height:h,chromaFormat:s,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);for(var a=[],s=[],o=0;o<t;o++)a[o]=e.readBits(1),s[o]=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!==s[u]&&e.readBits(8)}}]),e}(),Ze=1e3,Xe=5e3,$e=function(){function e(t,r,n){o(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._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0}return c(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),this._baseDtsInited){if(!n&&t&&(this._audioNextPts=this._videoNextDts=t),this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(a),this._fixVideo(i),this.metadataTrack.exist()){var s=this.metadataTrack.timescale;this.metadataTrack.seiSamples.forEach((function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/s})),this.metadataTrack.flvScriptSamples.forEach((function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/s}))}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(r.forEach((function(e){e.dts-=t._baseDts,e.pts-=t._baseDts})),e.fpsNum&&e.fpsDen)n=e.timescale*(e.fpsDen/e.fpsNum);else{var i=e.samples[0],a=e.samples[r.length-1];n=Math.floor((a.dts-i.dts)/(r.length-1))}var s=r.pop();if(this._videoLastSample&&r.unshift(this._videoLastSample),this._videoLastSample=s,r.length){if(void 0===this._videoNextDts){var o=r[0];this._videoNextDts=o.dts}var u=r.length,c=0,l=r[0],d=this._videoNextDts-l.dts;if(Math.abs(d)>200){var f;if(Math.abs(l.dts-this._lastVideoExceptionChunkFirstDtsDot)>5e3)this._lastVideoExceptionChunkFirstDtsDot=l.dts,e.warnings.push({type:ke,nextDts:this._videoNextDts,firstSampleDts:l.dts,nextSampleDts:null===(f=r[1])||void 0===f?void 0:f.dts,sampleDuration:d});this._videoTimestampBreak>=5?(this._videoNextDts=l.dts,this._videoTimestampBreak=0):(l.dts+=d,l.pts+=d)}for(var h=0;h<u;h++){var p=r[h].dts,v=r[h+1];((c=h<u-1?v.dts-p:s?s.dts-p:n)>1e3||c<0)&&(this._videoTimestampBreak++,Math.abs(p-this._lastVideoExceptionLargeGapDot)>5e3&&(this._lastVideoExceptionLargeGapDot=p,e.warnings.push({type:be,time:p/e.timescale,dts:p,originDts:r[h].originDts,nextDts:this._videoNextDts,sampleDuration:c,refSampleDuration:n})),c=n),r[h].duration=c,this._videoNextDts+=c}}}}},{key:"_fixAudio",value:function(e){var t=this,r=e.samples;r.length&&(r.forEach((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 s=a-i;return Number.isFinite(s)&&Math.abs(s)>500&&t.warnings.push({type:ge,videoBaseDts:a,audioBasePts:i,baseDts:this._baseDts,delta:s}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){if(this._baseDtsInited&&this._videoTimestampBreak&&this._audioTimestampBreak){if(!this._calculateBaseDts(this.audioTrack,this.videoTrack))return;this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts),this._videoLastSample=null,this._videoTimestampBreak=0,this._audioTimestampBreak=0}}},{key:"_doFixAudioInternal",value:function(e,t,r){e.sampleDuration||(e.sampleDuration=e.codecType===ve?We.getFrameDuration(e.timescale,r):this._getG711Duration(e));var n=e.sampleDuration,i=e.codecType===ve?1024:n*e.timescale/1e3;if(void 0===this._audioNextPts){var a=t[0];this._audioNextPts=a.pts}for(var s=0;s<t.length;s++){var o=this._audioNextPts,u=t[s],c=u.pts-o;if(0===s&&this._audioTimestampBreak>=5&&(o=this._audioNextPts=u.dts,c=0,this._audioTimestampBreak=0),!this._audioTimestampBreak&&c>=3*n&&c<=Ze&&!Re){var l=this._getSilentFrame(e)||t[0].data.subarray(),d=Math.floor(c/n);Math.abs(u.pts-this._lastAudioExceptionGapDot)>Xe&&(this._lastAudioExceptionGapDot=u.pts,e.warnings.push({type:xe,pts:u.pts,originPts:u.originPts,count:d,nextPts:o,refSampleDuration:n}));for(var f=0;f<d;f++){var h=new De(Math.floor(this._audioNextPts+n)-Math.floor(this._audioNextPts),l,i);h.originPts=Math.floor(this._baseDts+o),t.splice(s,0,h),this._audioNextPts+=n,s++}s--}else c<=-3*n&&c>=-1e3?(Math.abs(u.pts-this._lastAudioExceptionOverlapDot)>Xe&&(this._lastAudioExceptionOverlapDot=u.pts,e.warnings.push({type:we,pts:u.pts,originPts:u.originPts,nextPts:o,refSampleDuration:n})),t.splice(s,1),s--):(Math.abs(c)>Ze&&(this._audioTimestampBreak++,Math.abs(u.pts-this._lastAudioExceptionLargeGapDot)>Xe&&(this._lastAudioExceptionLargeGapDot=u.pts,e.warnings.push({type:_e,time:u.pts/1e3,pts:u.pts,originPts:u.originPts,nextPts:o,sampleDuration:c,refSampleDuration:n}))),u.dts=u.pts=o,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===ve?We.getSilentFrame(e.codec,e.channelCount):new Uint8Array(8*e.sampleDuration*e.channelCount)}}]),e}(),Je=function(){function e(){o(this,e)}return c(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 s=e._parseString(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i));r=s.data,i+=s.size;break;case 3:r={};var o=0;for(9==(16777215&t.getUint32(n-4))&&(o=3);i<n-4;){var u=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-o)),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 d=0;for(9==(16777215&t.getUint32(n-4))&&(d=3);i<n-8;){var f=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-d)),h=f.size,p=f.data;if(f.isEnd)break;r[p.name]=p.value,i+=h}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 m=0;m<v;m++){var y=e._parseValue(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i)),g=y.data,b=y.size;r.push(g),i+=b}break;case 11:var k=t.getFloat64(i)+6e4*t.getInt16(i+8);r=new Date(k),i+=10;break;case 12:var _=t.getUint32(1);i+=4,r="",_>0&&(r=Ue.decode(new Uint8Array(t.buffer,t.byteOffset+i,_))),i+=_;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=Ue.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}(),et=new Oe("FlvDemuxer"),tt=function(){function e(t,r,n){o(this,e),l(this,"_headerParsed",!1),l(this,"_remainingData",null),l(this,"_gopId",0),l(this,"_needAddMetaBeforeKeyFrameNal",!0),this.videoTrack=t||new Se,this.audioTrack=r||new Te,this.metadataTrack=n||new Pe,this._fixer=new $e(this.videoTrack,this.audioTrack,this.metadataTrack)}return c(e,[{key:"demux",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this.audioTrack,a=this.videoTrack,s=this.metadataTrack;if(!r&&n||(this._remainingData=null,this._headerParsed=!1),r?(a.reset(),i.reset(),s.reset()):(a.samples=[],i.samples=[],s.seiSamples=[],s.flvScriptSamples=[],a.warnings=[],i.warnings=[],this._remainingData&&(t=ze(this._remainingData,t),this._remainingData=null)),!t.length)return{videoTrack:a,audioTrack:i,metadataTrack:s};var o=0;if(!this._headerParsed){if(!e.probe(t))throw new Error("Invalid flv file");i.present=(4&t[4])>>>2!=0,a.present=0!=(1&t[4]),this._headerParsed=!0,o=Ve(t,5)+4}for(var u,c,l,d,f,h=t.length;o+15<h&&(u=t[o],!(o+15+(c=t[o+1]<<16|t[o+2]<<8|t[o+3])>h));)l=(t[o+7]<<24>>>0)+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6],o+=11,d=t.subarray(o,o+c),8===u?this._parseAudio(d,l):9===u?this._parseVideo(d,l):18===u?this._parseScript(d,l):et.warn("Invalid tag type: ".concat(u)),(f=Ve(t,o+=c))!==11+c&&et.warn("Invalid PrevTagSize ".concat(f," (").concat(11+c,")")),o+=4;return o<h&&(this._remainingData=t.subarray(o)),i.formatTimescale=a.formatTimescale=a.timescale=s.timescale=1e3,i.timescale=i.sampleRate||0,!i.exist()&&i.hasSample()&&i.reset(),!a.exist()&&a.hasSample()&&a.reset(),{videoTrack:a,audioTrack:i,metadataTrack:s}}},{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){return this.demux(e,t,r),this.fix(n,t,r)}},{key:"_parseAudio",value:function(t,r){if(t.length){var n=(240&t[0])>>>4,i=this.audioTrack;if(10!==n&&7!==n&&8!==n)return et.warn("Unsupported sound format: ".concat(n)),void i.reset();if(10!==n){var a=(12&t[0])>>2,s=(2&t[0])>>1,o=1&t[0];i.sampleRate=e.AUDIO_RATE[a],i.sampleSize=s?16:8,i.channelCount=o+1}10===n?this._parseAac(t,r):this._parseG711(t,r,n)}}},{key:"_parseG711",value:function(e,t,r){var n=this.audioTrack;n.codecType=7===r?me:ye,n.sampleRate=8e3,n.codec=n.codecType,n.samples.push(new De(t,e.subarray(1)))}},{key:"_parseAac",value:function(e,t){var r=this.audioTrack;if(r.codecType=ve,0===e[1]){var n=We.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(),et.warn("Cannot parse AudioSpecificConfig",e))}else if(1===e[1]){if(null==t)return;r.samples.push(new De(t,e.subarray(2)))}else et.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 et.warn("Unsupported codecId: ".concat(i));var s=12===i;a.codecType=s?pe:he;var o=e[1],u=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===o){var c=e.subarray(5),l=s?Ye.parseHEVCDecoderConfigurationRecord(c):Qe.parseAVCDecoderConfigurationRecord(c);if(l){var d=l.hvcC,f=l.sps,h=l.ppsArr,p=l.spsArr,v=l.vpsArr,m=l.nalUnitSize;d&&(a.hvcC=a.hvcC||d),f&&(a.codec=f.codec,a.width=f.width,a.height=f.height,a.sarRatio=f.sarRatio,a.fpsNum=f.fpsNum,a.fpsDen=f.fpsDen),p.length&&(a.sps=p),h.length&&(a.pps=h),v&&v.length&&(a.vps=v),m&&(a.nalUnitSize=m)}else et.warn("Cannot parse ".concat(s?"HEVC":"AVC","DecoderConfigurationRecord"),e)}else if(1===o){var y=Ke.parseAvcC(e.subarray(5),a.nalUnitSize);if((y=this._checkAddMetaNalToUnits(s,y,a))&&y.length){var g=new Ee(t+u,t,y);1===n&&g.setToKeyframe(),a.samples.push(g),y.forEach((function(e){var n=s?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(!s&&5!==n||s&&5===n)break;g.setToKeyframe();break;case 6:case 39:case 40:if(!s&&6!==n||s&&6===n)break;r.metadataTrack.seiSamples.push(new Ae(Ke.parseSEI(Ke.removeEPB(e)),t+u))}})),g.keyframe&&this._gopId++,g.gopId=this._gopId}else et.warn("Cannot parse NALUs",e)}else 2===o||et.warn("Unknown AVCPacketType: ".concat(o))}}},{key:"_checkAddMetaNalToUnits",value:function(e,t,r){return e&&this._needAddMetaBeforeKeyFrameNal?t.map((function(e){return e[0]>>>1&63})).includes(32)?(this._needAddMetaBeforeKeyFrameNal=!1,t):(t.unshift(r.pps[0]),t.unshift(r.sps[0]),t.unshift(r.vps[0]),t.filter(Boolean)):(this._needAddMetaBeforeKeyFrameNal=!1,t)}},{key:"_parseScript",value:function(e,t){this.metadataTrack.flvScriptSamples.push(new Ce(Je.parse(e),t))}}],[{key:"probe",value:function(e){return 70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]&&Ve(e,5)>=9}}]),e}();l(tt,"AUDIO_RATE",[5500,11e3,22e3,44e3]),new Oe("TsDemuxer");var rt=function(){function e(){o(this,e)}return c(e,null,[{key:"findBox",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[];if(!t)return i;for(var a=0,s="",o=0;t.length>7;){if(a=Ve(t),s=String.fromCharCode.apply(null,t.subarray(4,8)),o=8,1===a?(a=qe(t,8),o+=8):a||(a=t.length),!r[0]||s===r[0]){var u=t.subarray(0,a);if(!(r.length<2))return e.findBox(u.subarray(o),r.slice(1),n+o);i.push({start:n,size:a,headerSize:o,type:s,data:u})}n+=a,t=t.subarray(a)}return i}},{key:"moov",value:function(t){return st(t,!1,(function(t,r,n){t.mvhd=e.mvhd(e.findBox(r,["mvhd"],n)[0]),t.trak=e.findBox(r,["trak"],n).map((function(t){return e.trak(t)}))}))}},{key:"mvhd",value:function(e){return st(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=Ve(t,16),e.duration=qe(t,20),r+=28):(e.timescale=Ve(t,8),e.duration=Ve(t,12),r+=16),e.nextTrackId=Ve(t,r+76)}))}},{key:"trak",value:function(t){return st(t,!1,(function(t,r,n){t.tkhd=e.tkhd(e.findBox(r,["tkhd"],n)[0]),t.mdia=e.mdia(e.findBox(r,["mdia"],n)[0])}))}},{key:"tkhd",value:function(e){return st(e,!0,(function(e,t){var r=0;1===e.version?(e.trackId=Ve(t,16),e.duration=qe(t,24),r+=32):(e.trackId=Ve(t,8),e.duration=Ve(t,16),r+=20),e.width=Ve(t,r+52),e.height=Ve(t,r+56)}))}},{key:"mdia",value:function(t){return st(t,!1,(function(t,r,n){t.mdhd=e.mdhd(e.findBox(r,["mdhd"],n)[0]),t.hdlr=e.hdlr(e.findBox(r,["hdlr"],n)[0]),t.minf=e.minf(e.findBox(r,["minf"],n)[0])}))}},{key:"mdhd",value:function(e){return st(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=Ve(t,16),e.duration=qe(t,20),r+=28):(e.timescale=Ve(t,8),e.duration=Ve(t,12),r+=16);var n=Ge(t,r);e.language=String.fromCharCode(96+(n>>10&31),96+(n>>5&31),96+(31&n))}))}},{key:"hdlr",value:function(e){return st(e,!0,(function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))}))}},{key:"minf",value:function(t){return st(t,!1,(function(t,r,n){t.vmhd=e.vmhd(e.findBox(r,["vmhd"],n)[0]),t.smhd=e.smhd(e.findBox(r,["smhd"],n)[0]),t.stbl=e.stbl(e.findBox(r,["stbl"],n)[0])}))}},{key:"vmhd",value:function(e){return st(e,!0,(function(e,t){e.graphicsmode=Ge(t),e.opcolor=[Ge(t,2),Ge(t,4),Ge(t,6)]}))}},{key:"smhd",value:function(e){return st(e,!0,(function(e,t){e.balance=Ge(t)}))}},{key:"stbl",value:function(t){return st(t,!1,(function(t,r,n){t.stsd=e.stsd(e.findBox(r,["stsd"],n)[0]),t.stts=e.stts(e.findBox(r,["stts"],n)[0]),t.ctts=e.ctts(e.findBox(r,["ctts"],n)[0]),t.stsc=e.stsc(e.findBox(r,["stsc"],n)[0]),t.stsz=e.stsz(e.findBox(r,["stsz"],n)[0]),t.stco=e.stco(e.findBox(r,["stco"],n)[0]),t.stss=e.stss(e.findBox(r,["stss"],n)[0])}))}},{key:"stsd",value:function(t){return st(t,!0,(function(t,r,n){t.entryCount=Ve(r),t.entries=e.findBox(r.subarray(4),[],n+4).map((function(t){switch(t.type){case"avc1":case"avc2":case"avc3":case"avc4":return e.avc1(t);case"hvc1":case"hev1":return e.hvc1(t);case"mp4a":return e.mp4a(t);case"alaw":case"ulaw":return e.alaw(t)}})).filter(Boolean)}))}},{key:"avc1",value:function(t){return st(t,!1,(function(t,r,n){var i=it(t,r),a=r.subarray(i);n+=i,t.avcC=e.avcC(e.findBox(a,["avcC"],n)[0]),t.pasp=e.pasp(e.findBox(a,["pasp"],n)[0])}))}},{key:"avcC",value:function(e){return st(e,!1,(function(e,t){e.configurationVersion=t[0],e.AVCProfileIndication=t[1],e.profileCompatibility=t[2],e.AVCLevelIndication=t[3],e.codec=He([t[1],t[2],t[3]]),e.lengthSizeMinusOne=3&t[4],e.spsLength=31&t[5],e.sps=[];for(var r=6,n=0;n<e.spsLength;n++){var i=Ge(t,r);r+=2,e.sps.push(t.subarray(r,r+i)),r+=i}e.ppsLength=t[r],r+=1,e.pps=[];for(var a=0;a<e.ppsLength;a++){var s=Ge(t,r);r+=2,e.pps.push(t.subarray(r,r+=s)),r+=s}}))}},{key:"hvc1",value:function(t){return st(t,!1,(function(t,r,n){var i=it(t,r),a=r.subarray(i);n+=i,t.hvcC=e.hvcC(e.findBox(a,["hvcC"],n)[0]),t.pasp=e.pasp(e.findBox(a,["pasp"],n)[0])}))}},{key:"hvcC",value:function(e){return st(e,!1,(function(t,r){t.data=e.data,t.codec="hev1.1.6.L93.B0",t.configurationVersion=r[0];var n=r[1];t.generalProfileSpace=n>>6,t.generalTierFlag=(32&n)>>5,t.generalProfileIdc=31&n,t.generalProfileCompatibility=Ve(r,2),t.generalConstraintIndicatorFlags=r.subarray(6,12),t.generalLevelIdc=r[12],t.avgFrameRate=Ge(r,19),t.numOfArrays=r[22],t.vps=[],t.sps=[],t.pps=[];for(var i=23,a=0,s=0,o=0,u=0;u<t.numOfArrays;u++){a=63&r[i],s=Ge(r,i+1),i+=3;for(var c,l=[],d=0;d<s;d++)o=Ge(r,i),i+=2,l.push(r.subarray(i,i+o)),i+=o;if(32===a)(c=t.vps).push.apply(c,l);else if(33===a){var f;(f=t.sps).push.apply(f,l)}else if(34===a){var h;(h=t.pps).push.apply(h,l)}}}))}},{key:"pasp",value:function(e){return st(e,!1,(function(e,t){e.hSpacing=Ve(t),e.vSpacing=Ve(t,4)}))}},{key:"mp4a",value:function(t){return st(t,!1,(function(t,r,n){var i=at(t,r);t.esds=e.esds(e.findBox(r.subarray(i),["esds"],n+i)[0])}))}},{key:"esds",value:function(e){return st(e,!0,(function(e,t){e.codec="mp4a.";for(var r=0,n=0,i=0,a=0;t.length;){for(a=t[r=0],n=t[r+1],r+=2;128&n;)i=(127&n)<<7,n=t[r],r+=1;if(i+=127&n,3===a)t=t.subarray(r+3);else{if(4!==a){if(5===a){var s=e.config=t.subarray(r,r+i),o=(248&s[0])>>3;return 31===o&&s.length>=2&&(o=32+((7&s[0])<<3)+((224&s[1])>>5)),e.objectType=o,void(e.codec+=o.toString(16))}return}e.codec+=(t[r].toString(16)+".").padStart(3,"0"),t=t.subarray(r+13)}}}))}},{key:"alaw",value:function(e){return st(e,!1,(function(e,t){at(e,t)}))}},{key:"stts",value:function(e){return st(e,!0,(function(e,t){for(var r=Ve(t),n=[],i=4,a=0;a<r;a++)n.push({count:Ve(t,i),delta:Ve(t,i+4)}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"ctts",value:function(e){return st(e,!0,(function(e,t){var r=Ve(t),n=[],i=4;if(1===e.version)for(var a=0;a<r;a++)n.push({count:Ve(t,i),offset:Ve(t,i+4)}),i+=8;else for(var s=0;s<r;s++)n.push({count:Ve(t,i),offset:-(1+~Ve(t,i+4))}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"stsc",value:function(e){return st(e,!0,(function(e,t){for(var r=Ve(t),n=[],i=4,a=0;a<r;a++)n.push({firstChunk:Ve(t,i),samplesPerChunk:Ve(t,i+4),sampleDescriptionIndex:Ve(t,i+8)}),i+=12;e.entryCount=r,e.entries=n}))}},{key:"stsz",value:function(e){return st(e,!0,(function(e,t){var r=Ve(t),n=Ve(t,4),i=[];if(!r)for(var a=8,s=0;s<n;s++)i.push(Ve(t,a)),a+=4;e.sampleSize=r,e.sampleCount=n,e.entrySizes=i}))}},{key:"stco",value:function(e){return st(e,!0,(function(e,t){for(var r=Ve(t),n=[],i=4,a=0;a<r;a++)n.push(Ve(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"stss",value:function(e){return st(e,!0,(function(e,t){for(var r=Ve(t),n=[],i=4,a=0;a<r;a++)n.push(Ve(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"moof",value:function(t){return st(t,!1,(function(t,r,n){t.mfhd=e.mfhd(e.findBox(r,["mfhd"],n)[0]),t.traf=e.findBox(r,["traf"],n).map((function(t){return e.traf(t)}))}))}},{key:"mfhd",value:function(e){return st(e,!0,(function(e,t){e.sequenceNumber=Ve(t)}))}},{key:"traf",value:function(t){return st(t,!1,(function(t,r,n){t.tfhd=e.tfhd(e.findBox(r,["tfhd"],n)[0]),t.tfdt=e.tfdt(e.findBox(r,["tfdt"],n)[0]),t.trun=e.trun(e.findBox(r,["trun"],n)[0])}))}},{key:"tfhd",value:function(e){return st(e,!0,(function(e,t){var r=e.flags,n=t.length;e.trackId=Ve(t);var i=4;n>i&&1&r&&(e.baseDataOffset=qe(t,i),i+=8),n>i&&2&r&&(e.sampleDescriptionIndex=Ve(t,i),i+=4),n>i&&8&r&&(e.defaultSampleDuration=Ve(t,i),i+=4),n>i&&10&r&&(e.defaultSampleSize=Ve(t,i),i+=4),n>i&&32&r&&(e.defaultSampleFlags=Ve(t,i),i+=4)}))}},{key:"trun",value:function(e){return st(e,!0,(function(e,t){var r=e.version,n=e.flags,i=t.length,a=e.sampleCount=Ve(t),s=4;if(i>s&&1&n&&(e.dataOffset=-(1+~Ve(t,s)),s+=4),i>s&&4&n&&(e.firstSampleFlags=Ve(t,s),s+=4),e.samples=[],i>s)for(var o,u=0;u<a;u++)o={},256&n&&(o.duration=Ve(t,s),s+=4),512&n&&(o.size=Ve(t,s),s+=4),1024&n&&(o.flags=Ve(t,s),s+=4),2048&n&&(o.cts=r?-(1+~Ve(t,s+4)):Ve(t,s),s+=4),e.samples.push(o)}))}},{key:"tfdt",value:function(e){return st(e,!0,(function(e,t){1===e.version?e.baseMediaDecodeTime=qe(t):e.baseMediaDecodeTime=Ve(t)}))}},{key:"probe",value:function(t){return!!e.findBox(t,["ftyp"])}},{key:"moovToTrack",value:function(e,t,r){var n,i,a=e.trak;if(a&&a.length){var s=a.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),o=a.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(s&&t){var u,c=t;null!=(null===(u=s.tkhd)||void 0===u?void 0:u.trackId)&&(c.id=s.tkhd.trackId),c.timescale=c.formatTimescale=s.mdia.mdhd.timescale,c.duration=s.mdia.mdhd.duration;var l=s.mdia.minf.stbl.stsd.entries[0];if(c.width=l.width,c.height=l.height,l.pasp&&(c.sarRatio=[l.pasp.hSpacing,l.pasp.vSpacing]),l.hvcC)c.codecType=pe,c.codec=l.hvcC.codec,c.vps=l.hvcC.vps,c.sps=l.hvcC.sps,c.pps=l.hvcC.pps,c.hvcC=l.hvcC.data;else{if(!l.avcC)throw new Error("unknown video stsd entry");c.codec=l.avcC.codec,c.sps=l.avcC.sps,c.pps=l.avcC.pps}c.present=!0}if(o&&r){var d,f=r;null!=(null===(d=o.tkhd)||void 0===d?void 0:d.trackId)&&(f.id=o.tkhd.trackId),f.timescale=f.formatTimescale=o.mdia.mdhd.timescale,f.duration=o.mdia.mdhd.duration;var h=o.mdia.minf.stbl.stsd.entries[0];switch(f.sampleSize=h.sampleSize,f.sampleRate=h.sampleRate,f.channelCount=h.channelCount,f.present=!0,h.type){case"alaw":f.codecType=f.codec=me,f.sampleRate=8e3;break;case"ulaw":f.codecType=f.codec=ye,f.sampleRate=8e3;break;default:f.sampleDuration=We.getFrameDuration(f.sampleRate,f.timescale),f.sampleRateIndex=We.getRateIndexByRate(f.sampleRate),f.objectType=(null===(n=h.esds)||void 0===n?void 0:n.objectType)||2,h.esds&&(f.config=Array.from(h.esds.config)),f.codec=(null===(i=h.esds)||void 0===i?void 0:i.codec)||"mp4a.40.2"}}return{videoTrack:t,audioTrack:r}}}},{key:"evaluateDefaultDuration",value:function(e,t,r){var n,i=null==t||null===(n=t.samples)||void 0===n?void 0:n.length;return i?1024*i/t.timescale*e.timescale/r:1024}},{key:"moofToSamples",value:function(t,r,n){var i={};return t.mfhd&&(r&&(r.sequenceNumber=t.mfhd.sequenceNumber),n&&(n.sequenceNumber=t.mfhd.sequenceNumber)),t.traf.forEach((function(t){var a=t.tfhd,s=t.tfdt,o=t.trun;if(a&&o){s&&(r&&r.id===a.trackId&&(r.baseMediaDecodeTime=s.baseMediaDecodeTime),n&&n.id===a.trackId&&(n.baseMediaDecodeTime=s.baseMediaDecodeTime));var u=a.defaultSampleSize||0,c=a.defaultSampleDuration||e.evaluateDefaultDuration(r,n,o.samples.length||o.sampleCount),l=o.dataOffset||0,d=0,f=-1;if(!o.samples.length&&o.sampleCount){i[a.trackId]=[];for(var h=0;h<o.sampleCount;h++)i[a.trackId].push({offset:l,dts:d,duration:c,size:u}),d+=c,l+=u}else i[a.trackId]=o.samples.map((function(e,t){return(e={offset:l,dts:d,pts:d+(e.cts||0),duration:e.duration||c,size:e.size||u,gopId:f,keyframe:0===t||null!=e.flags&&(65536&e.flags)>>>0!=65536}).keyframe&&(f++,e.gopId=f),d+=e.duration,l+=e.size,e}))}})),i}},{key:"moovToSamples",value:function(e){var t=e.trak;if(t&&t.length){var r=t.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),n=t.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(r||n){var i,a;if(r){var s,o,u=null===(s=r.mdia)||void 0===s||null===(o=s.minf)||void 0===o?void 0:o.stbl;if(!u)return;var c=u.stts,l=u.stsc,d=u.stsz,f=u.stco,h=u.stss,p=u.ctts;if(!(c&&l&&d&&f&&h))return;i=nt(c,l,d,f,p,h)}if(n){var v,m,y,g=null===(v=n.mdia)||void 0===v||null===(m=v.minf)||void 0===m?void 0:m.stbl;if(!g)return;var b=null===(y=n.mdia.mdhd)||void 0===y?void 0:y.timescale,k=g.stts,_=g.stsc,x=g.stsz,w=g.stco;if(!(b&&k&&_&&x&&w))return;a=nt(k,_,x,w)}return{videoSamples:i,audioSamples:a}}}}}]),e}();function nt(e,t,r,n,i,a){var s,o,u,c=[],l=null==i?void 0:i.entries,d=t.entries,f=n.entries,h=r.entrySizes,p=null==a?void 0:a.entries;p&&(s={},p.forEach((function(e){s[e-1]=!0}))),l&&(o=[],l.forEach((function(e){for(var t=e.count,r=e.offset,n=0;n<t;n++)o.push(r)})));var v=-1,m=0,y=0,g=0,b=0,k=0,_=d[0].samplesPerChunk,x=d[1]?d[1].firstChunk-1:1/0;return e.entries.forEach((function(e){for(var t=e.count,n=e.delta,i=0;i<t;i++)u={dts:m,duration:n,size:h[y]||r.sampleSize,offset:f[g]+k,index:y},p&&(u.keyframe=s[y],u.keyframe&&v++,u.gopId=v),o&&o[y]&&(u.pts=u.dts+o[y]),c.push(u),m+=n,++y<_?k+=u.size:(g++,k=0,g>=x&&(b++,x=d[b+1]?d[b+1].firstChunk-1:1/0),_+=d[b].samplesPerChunk)})),c}function it(e,t){return e.dataReferenceIndex=Ge(t,6),e.width=Ge(t,24),e.height=Ge(t,26),e.horizresolution=Ve(t,28),e.vertresolution=Ve(t,32),e.frameCount=Ge(t,40),e.depth=Ge(t,74),78}function at(e,t){return e.dataReferenceIndex=Ge(t,6),e.channelCount=Ge(t,16),e.sampleSize=Ge(t,18),e.sampleRate=Ve(t,24)/65536,28}function st(e,t,r){if(e){if(e.size!==e.data.length)throw new Error("box ".concat(e.type," size !== data.length"));var n={start:e.start,size:e.size,headerSize:e.headerSize,type:e.type};return t&&(n.version=e.data[e.headerSize],n.flags=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<16)+(e[t+1]<<8)+(e[t+2]||0)}(e.data,e.headerSize+1),n.headerSize+=4),r(n,e.data.subarray(n.headerSize),n.start+n.headerSize),n}}var ot=Math.pow(2,32)-1,ut=function(){function e(){o(this,e)}return c(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];var i=8+(r=r.filter(Boolean)).reduce((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 s=8;return r.forEach((function(e){a.set(e,s),s+=e.byteLength})),a}},{key:"ftyp",value:function(t){return t.find((function(e){return e.type===le&&e.codecType===pe}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return ze(e.ftyp(t),e.moov(t))}},{key:"moov",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(x(t.map((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.duration,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===le?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.STTS,e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){return e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),t.type===le?e.avc1hev1(t):e.mp4a(t))}},{key:"avc1hev1",value:function(t){var r=t.codecType===pe,n=r?e.types.hvc1:e.types.avc1,i=r?e.hvcC(t):e.avcC(t),a=[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]),i];return t.sarRatio&&t.sarRatio.length>1&&a.push(e.pasp(t.sarRatio)),e.box.apply(e,[n].concat(a))}},{key:"avcC",value:function(t){var r,n=[],i=[];return t.sps.forEach((function(e){r=e.byteLength,n.push(r>>>8&255),n.push(255&r),n.push.apply(n,x(e))})),t.pps.forEach((function(e){r=e.byteLength,i.push(r>>>8&255),i.push(255&r),i.push.apply(i,x(e))})),e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(i)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer)return r;var n,i=t.vps,a=t.sps,s=t.pps;if(r){var o=r.generalProfileCompatibilityFlags,u=r.generalConstraintIndicatorFlags,c=(i.length&&1)+(a.length&&1)+(s.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,o>>>24,o>>>16,o>>>8,o,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,x(e))};i.length&&(n.push(160,0,i.length),i.forEach(l)),a.length&&(n.push(161,0,a.length),a.forEach(l)),s.length&&(n.push(162,0,s.length),s.forEach(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=_(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=t.length;return e.box(e.types.esds,new Uint8Array([0,0,0,0,3,23+r,0,0,0,4,15+r,64,21,0,6,0,0,0,218,192,0,0,218,192,5].concat([r]).concat(t).concat([6,1,2])))}},{key:"mvex",value:function(t){return e.box.apply(e,[e.types.mvex].concat(x(t.map((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:"moof",value:function(t,r){return e.box.apply(e,[e.types.moof,e.mfhd(t)].concat(x(r.map((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){return e.box(e.types.traf,e.tfhd(t.id),e.tfdt(t.baseMediaDecodeTime),e.trun(t.samples,76))}},{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){var r=Math.floor(t/(ot+1)),n=Math.floor(t%(ot+1));return e.box(e.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n]))}},{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 s=0;s<n;s++){var o=t[s],u=o.duration,c=o.size,l=o.flag,d=void 0===l?{}:l,f=o.cts,h=void 0===f?0:f;a.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,c>>>24&255,c>>>16&255,c>>>8&255,255&c,d.isLeading<<2|(null==d.dependsOn?1:d.dependsOn),d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|(null==d.isNonSyncSample?1:d.isNonSyncSample),61440&d.degradationPriority,15&d.degradationPriority,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*s)}return e.box(e.types.trun,a)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"moovMP4",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(x(t.map((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===le?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r=t.ext,n=[e.stsd(t),e.stts(r.stts),e.stsc(r.stsc),e.stsz(r.stsz),e.stco(r.stco)];return r.stss.length&&n.push(e.stss(r.stss)),r.ctts.length&&n.push(e.ctts(r.ctts)),e.box.apply(e,[e.types.stbl].concat(n))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((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,ze(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 t.forEach((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,ze(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 t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stsz,ze(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 t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stco,ze(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 t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stss,ze(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 t.forEach((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,ze(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}}]),e}();l(ut,"types",["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","trun","trex","tkhd","vmhd","smhd","ctts","stss"].reduce((function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),Object.create(null))),l(ut,"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])}),l(ut,"FTYPAVC1",ut.box(ut.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),l(ut,"FTYPHEV1",ut.box(ut.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),l(ut,"DINF",ut.box(ut.types.dinf,ut.box(ut.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),l(ut,"VMHD",ut.box(ut.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),l(ut,"SMHD",ut.box(ut.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),l(ut,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),l(ut,"STTS",ut.box(ut.types.stts,ut.StblTable)),l(ut,"STSC",ut.box(ut.types.stsc,ut.StblTable)),l(ut,"STSZ",ut.box(ut.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),l(ut,"STCO",ut.box(ut.types.stco,ut.StblTable));var ct=/Chrome\/([^.]+)/.exec(navigator.userAgent),lt=ct&&Number(ct[1])<50,dt=function(){function e(t,r){o(this,e),this.videoTrack=t,this.audioTrack=r}return c(e,[{key:"remux",value:function(){var e,t,r,n,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=this.videoTrack,s=this.audioTrack,o=a.exist(),u=s.exist();return i&&(o&&(e=ut.initSegment([this.videoTrack])),u&&(t=ut.initSegment([this.audioTrack]))),o&&a.hasSample()&&(r=this._remuxVideo()),u&&s.hasSample()&&(n=this._remuxAudio()),a.samples=[],s.samples=[],{videoInitSegment:e,audioInitSegment:t,videoSegment:r,audioSegment:n}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack,t=e.samples;lt&&(t[0].flag={dependsOn:2,isNonSyncSample:0});var r=0;t.forEach((function(e){r+=e.units.reduce((function(e,t){return e+t.byteLength}),0),r+=4*e.units.length}));for(var n,i=new Uint8Array(r),a=new DataView(i.buffer),s=function(e,r,s,o){o=t[e];var u=0;o.units.forEach((function(e){a.setUint32(s,e.byteLength),s+=4,i.set(e,s),s+=e.byteLength,u+=4+e.byteLength})),o.size=u,c=s,n=o},o=0,u=t.length,c=0;o<u;o++)s(o,0,c,n);return ze(ut.moof(this.videoTrack.sequenceNumber++,[e]),ut.mdat(i))}},{key:"_remuxAudio",value:function(){var e=this.audioTrack,t=ut.moof(this.audioTrack.sequenceNumber++,[e]),r=new Uint8Array(e.samples.reduce((function(e,t){return e+t.size}),0));return e.samples.reduce((function(e,t){return r.set(t.data,e),e+t.size}),0),ze(t,ut.mdat(r))}}]),e}(),ft=function(){function e(t,r,n){o(this,e),l(this,"_videoSamples",[]),l(this,"_audioSamples",[]),this.videoTrack=t||new Se,this.audioTrack=r||new Te,this.metadataTrack=n||new Pe}return c(e,[{key:"demux",value:function(e,t,r,n,i){if(!this._audioSamples.length&&!this._videoSamples.length){if(!i)throw new Error("moov is required");rt.moovToTrack(i,this.videoTrack,this.audioTrack);var a=rt.moovToSamples(i);if(!a)throw new Error("cannot parse samples from moov box");this._videoSamples=a.videoSamples||[],this._audioSamples=a.audioSamples||[]}var s,o,u,c=this.videoTrack,l=this.audioTrack;if(c.samples=[],l.samples=[],r){for(var d,f=0,h=r[0],p=r[1];h<=p;h++){if(!(s=this._videoSamples[h]))throw new Error("cannot found video frame #".concat(h));u=s.offset-t,o=e.subarray(u,u+s.size),(d=new Ee(s.pts||s.dts,s.dts)).duration=s.duration,d.gopId=s.gopId,s.keyframe&&d.setToKeyframe();for(var v=0,m=o.length-1;v<m;)f=Ve(o,v),v+=4,d.units.push(o.subarray(v,v+f)),v+=f;c.samples.push(d)}c.baseMediaDecodeTime=c.samples[0].dts}if(n){for(var y=n[0],g=n[1];y<=g;y++){if(!(s=this._audioSamples[y]))throw new Error("cannot found video frame #".concat(y));u=s.offset-t,o=e.subarray(u,u+s.size),l.samples.push(new De(s.dts,o,s.duration))}l.baseMediaDecodeTime=l.samples[0].dts}return{videoTrack:c,audioTrack:l,metadataTrack:this.metadataTrack}}},{key:"reset",value:function(){this._videoSamples=[],this._audioSamples=[],this.videoTrack.reset(),this.audioTrack.reset(),this.metadataTrack.reset()}}],[{key:"probe",value:function(e){return rt.probe(e)}}]),e}();var ht=c((function e(t,r){o(this,e),this.type="file",this.message=t,this.data=r})),pt=function(){function e(){o(this,e),l(this,"_data",Object.create(null))}return c(e,[{key:"set",value:function(e,t){this._data[e]=t}},{key:"get",value:function(e){return this._data[e]}},{key:"clear",value:function(){this._data=Object.create(null)}}]),e}();function vt(e,t){var r=e.trak;if(r&&r.length){var n=r.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),i=r.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(n||i){var a,s=[],o=[];if(n){var u,c,l,d=null===(u=n.mdia)||void 0===u||null===(c=u.minf)||void 0===c?void 0:c.stbl;if(!d)return;var f=null===(l=n.mdia.mdhd)||void 0===l?void 0:l.timescale,h=d.stts,p=d.stsc,v=d.stsz,m=d.stco,y=d.stss,g=d.ctts;if(!(f&&h&&p&&v&&m&&y))return;a=(s=mt(t,f,h,p,v,m,y,g)).map((function(e){return e.duration}))}if(i){var b,k,_,x=null===(b=i.mdia)||void 0===b||null===(k=b.minf)||void 0===k?void 0:k.stbl;if(!x)return;var w=null===(_=i.mdia.mdhd)||void 0===_?void 0:_.timescale,S=x.stts,T=x.stsc,E=x.stsz,D=x.stco;if(!(w&&S&&T&&E&&D))return;o=mt(t,w,S,T,E,D,null,null,a)}return{videoSegments:s,audioSegments:o}}}}function mt(e,t,r,n,i,a,s,o,u){var c,l,d,f,h=[],p=[],v=[],m=n.entries,y=a.entries,g=i.entrySizes,b=null==s?void 0:s.entries,k=null==o?void 0:o.entries;k&&(c=[],k.forEach((function(e){for(var t=e.count,r=e.offset,n=0;n<t;n++)c.push(r)}))),b&&(l={},b.forEach((function(e){l[e-1]=!0})));var _=0,w=0,S=0,T=0,E=0,D=m[0].samplesPerChunk,B=m[1]?m[1].firstChunk-1:1/0,C=0,A=-1;r.entries.forEach((function(e){var t=e.count,r=e.delta;f=r;for(var n=0;n<t;n++)d={dts:C,startTime:_,duration:f,size:g[w]||i.sampleSize,offset:y[S]+E,index:w},b&&(d.keyframe=l[w],d.keyframe?(A++,p.push([d]),v.push(d.duration)):(p[p.length-1].push(d),v[p.length-1]+=d.duration),d.gopId=A),c&&w<c.length&&(d.pts=C+c[w]),h.push(d),_+=f,C+=r,++w<D?E+=d.size:(S++,E=0,S>=B&&(T++,B=m[T+1]?m[T+1].firstChunk-1:1/0),D+=m[T].samplesPerChunk)}));var P=h.length;if(P&&(!s||h[0].keyframe)){var L,O=[],U=[],I=0,M=function(e){var r;L=U[U.length-1],O.push({index:O.length,startTime:(null===(r=O[O.length-1])||void 0===r?void 0:r.endTime)||U[0].startTime/t,endTime:(L.startTime+L.duration)/t,duration:e,range:[U[0].offset,L.offset+L.size],frames:U}),I=0,U=[]};if(s)for(var R=e*t,j=0,N=p.length;j<N;j++){var z;I+=v[j],(z=U).push.apply(z,x(p[j])),j+1<N?I>R&&M(I/t):M(I/t)}else for(var F=(u=u||[])[0]||e,G=0;G<P;G++)U.push(h[G]),I+=h[G].duration,(G+1>=P||I/t>=F)&&(M(I/t),F=u[O.length]||e);return O}}function yt(e){var t="",r="",n=0,i=0,a=0,s=0,o=0;e.mvhd&&(o=e.mvhd.duration/e.mvhd.timescale);var u=e.trak;if(u){var c,l,d,f,h,p,v,m,y,g,b,k,_,x=u.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),w=u.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),S=null;if(x)if(S=null===(l=x.mdia)||void 0===l||null===(d=l.minf)||void 0===d||null===(f=d.stbl)||void 0===f?void 0:f.stsd.entries[0])if(n=S.width,i=S.height,t=null===(h=S.avcC||S.hvcC)||void 0===h?void 0:h.codec,"encv"===S.type)c=null===(p=S.sinf)||void 0===p||null===(v=p.schi)||void 0===v?void 0:v.tenc.default_KID;if(w)if(S=null===(m=w.mdia)||void 0===m||null===(y=m.minf)||void 0===y||null===(g=y.stbl)||void 0===g?void 0:g.stsd.entries[0])if(a=S.channelCount,s=S.sampleRate,r=null===(b=S.esds)||void 0===b?void 0:b.codec,"enca"===S.type)c=c||(null===(k=S.sinf)||void 0===k||null===(_=k.schi)||void 0===_?void 0:_.tenc.default_KID);return{kid:c?c.join(""):null,videoCodec:t,audioCodec:r,width:n,height:i,audioChannelCount:a,audioSampleRate:s,duration:o,moov:e}}}function gt(e){return"number"==typeof e&&!isNaN(e)}var bt=["vid","moovEnd","segmentDuration","cache","maxDownloadInfoSize"],kt=function(){function e(t){o(this,e),l(this,"vid",""),l(this,"url",""),l(this,"meta",{}),l(this,"downloadInfo",[]),l(this,"videoSegments",[]),l(this,"audioSegments",[]),l(this,"cache",null),l(this,"_currentSegmentIndex",-1),l(this,"_currentLoadingSegmentIndex",-1),l(this,"_transformError",(function(e){return e.type="network",e})),this._config=r(r({vid:"",moovEnd:8e3,segmentDuration:5,maxDownloadInfoSize:30,cache:null},t),{},{responseType:"arraybuffer"});var n=this._config,i=n.vid;n.moovEnd,n.segmentDuration;var a=n.cache;n.maxDownloadInfoSize;var s=y(n,bt);this.cache=a||new pt,this.vid=i||s.url,this.url=s.url,s.transformError=this._transformError,this._loader=new ie(s)}var t,i,a,u,d,f,h,p,v,m;return c(e,[{key:"isMetaLoaded",get:function(){return this.videoSegments.length||this.audioSegments.length}},{key:"setCurrentSegment",value:function(e){gt(e)&&(this._currentSegmentIndex=e)}},{key:"isLastSegment",value:function(e){var t,r;return!!gt(e)&&e===((null===(t=this.videoSegments[this.videoSegments.length-1])||void 0===t?void 0:t.index)||(null===(r=this.audioSegments[this.audioSegments.length-1])||void 0===r?void 0:r.index)||0)}},{key:"isSegmentLoading",value:function(e){return e===this._currentLoadingSegmentIndex}},{key:"changeUrl",value:(m=s(n().mark((function e(t){var r,i,a=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:t,i=a.length>2?a[2]:void 0,e.next=4,this.reset();case 4:t&&(this.url=t),r&&(this.vid=r),i&&(this._config.moovEnd=i);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"getOrLoadMeta",value:(v=s(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(t);case 3:return e.abrupt("return",this.meta);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"loadMeta",value:(p=s(n().mark((function e(t,r){var i,a,s,o,u,c,l,d,f;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=[],e.next=3,this._loadData([0,r||this._config.moovEnd],t);case 3:if(a=e.sent){e.next=6;break}return e.abrupt("return");case 6:if(i.push(a),s=rt.findBox(a.data,["moov"])[0]){e.next=22;break}if(o=rt.findBox(a.data,["mdat"])[0]){e.next=12;break}throw new ht("cannot find moov or mdat box",a.data);case 12:return u=o.start+o.size,e.next=15,this._loadData([u],t);case 15:if(a=e.sent){e.next=18;break}return e.abrupt("return");case 18:if(i.push(a),s=rt.findBox(a.data,["moov"],u)[0]){e.next=22;break}throw new ht("cannot find moov box",a.data);case 22:if(!(s.size>s.data.length)){e.next=30;break}return e.next=25,this._loadData([a.data.length,s.start+s.size-1],t);case 25:if(a=e.sent){e.next=28;break}return e.abrupt("return");case 28:i.push(a),s.data=re(s.data,a.data);case 30:if(c=rt.moov(s)){e.next=33;break}throw new ht("cannot parse moov box",s.data);case 33:if(l=vt(c,this._config.segmentDuration)){e.next=36;break}throw new ht("cannot parse segments",s.data);case 36:return this.meta=yt(c),d=l.videoSegments,f=l.audioSegments,this.videoSegments=d,this.audioSegments=f,e.abrupt("return",{meta:this.meta,videoSegments:d,audioSegments:f,responses:i});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getSegmentByTime",value:function(e){var t,r;return this.videoSegments.length?(t=this.videoSegments.find((function(t){return t.startTime<=e&&t.endTime>e})))&&(r=this.audioSegments[t.index]):r=this.audioSegments.find((function(t){return t.startTime<=e&&t.endTime>e})),{video:t,audio:r}}},{key:"loadSegmentByTime",value:(h=s(n().mark((function e(t,r){var i,a,s,o,u=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!(u.length>2&&void 0!==u[2])||u[2],this.isMetaLoaded){e.next=4;break}return e.next=4,this.loadMeta(r);case 4:return a=this.getSegmentByTime(t),s=a.video,o=a.audio,e.abrupt("return",this._loadSegment(s,o,r,i));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"loadNextSegment",value:(f=s(n().mark((function e(t){var r,i,a,s=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!(s.length>1&&void 0!==s[1])||s[1],this.isMetaLoaded){e.next=4;break}return e.next=4,this.loadMeta();case 4:return i=this.videoSegments[this._currentSegmentIndex+1],a=this.audioSegments[this._currentSegmentIndex+1],e.abrupt("return",this._loadSegment(i,a,t,r));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"preload",value:(d=s(n().mark((function e(t){var r,i,a,o,u,c,l,d=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(!0);case 3:if(t&&!(t<0)){e.next=5;break}return e.abrupt("return");case 5:if(r=this.getSegmentByTime(t),i=r.video,a=r.audio,o=Math.max((null==i?void 0:i.index)||0,(null==a?void 0:a.index)||0)){e.next=9;break}return e.abrupt("return");case 9:return u=this.videoSegments.slice(0,o),c=this.audioSegments.slice(0,o),l=function(){var e=s(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>o)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,d._loadSegment(u[t],c[t],!0,!1);case 4:return e.next=6,l(t+1);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=14,l(0);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"cancel",value:function(){return this._loader.cancel()}},{key:"reset",value:(u=s(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loader.cancel();case 2:this.vid=this.url="",this.meta={},this.downloadInfo=[],this.videoSegments=[],this.audioSegments=[],this._currentSegmentIndex=-1,this._currentLoadingSegmentIndex=-1;case 9:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"destroy",value:(a=s(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cancel();case 2:this.cache.clear();case 3:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"_loadSegment",value:(i=s(n().mark((function e(t,r,i,a){var s,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||r){e.next=2;break}return e.abrupt("return");case 2:return s=(null==t?void 0:t.index)||(null==r?void 0:r.index)||0,this._currentLoadingSegmentIndex=s,e.prev=4,e.next=7,this._loadData([Math.min((null==t?void 0:t.range[0])||1/0,(null==r?void 0:r.range[0])||1/0),Math.max((null==t?void 0:t.range[1])||0,(null==r?void 0:r.range[1])||0)],i);case 7:o=e.sent;case 8:return e.prev=8,this._currentLoadingSegmentIndex=-1,e.finish(8);case 11:if(o){e.next=13;break}return e.abrupt("return");case 13:return a&&(this._currentSegmentIndex=s),o.video=t,o.audio=r,e.abrupt("return",o);case 17:case"end":return e.stop()}}),e,this,[[4,,8,11]])}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"_loadData",value:(t=s(n().mark((function e(t,r){var i,a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getCacheKey(t),e.next=3,this.cache.get(i);case 3:if(a=e.sent){e.next=10;break}return e.next=7,this._loader.load(this.url,{range:t});case 7:s=e.sent,e.next=11;break;case 10:s={data:a,fromCache:!0};case 11:if(s){e.next=13;break}return e.abrupt("return");case 13:return a||(this.downloadInfo.push({startTime:s.startTime,endTime:s.endTime,size:s.data.byteLength,range:t}),this._addDownloadInfo>this._config.maxDownloadInfoSize&&(this._downloadInfos=this.downloadInfo.slice(-this._config.maxDownloadInfoSize))),!a&&r&&this.cache.set(i,s.data),s.range=t,e.abrupt("return",s);case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"_getCacheKey",value:function(e){return(this.vid||this.url)+":"+e}}]),e}(),_t=function(){function e(t,r){o(this,e),l(this,"_demuxer",new ft),l(this,"_remuxer",null),l(this,"_mse",null),l(this,"_softVideo",null),l(this,"_needInitSegment",!0),l(this,"_sourceCreated",!1),this.mp4=t,r?this._softVideo=t.media:(this._remuxer=new dt(this._demuxer.videoTrack,this._demuxer.audioTrack),this._mse=new N,this._mse.bindMedia(t.media))}var t,r,i,a,u;return c(e,[{key:"appendBuffer",value:(u=s(n().mark((function e(t,r,i,a,s){var o,u,c,l,d,f,h,p,v,m;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.length){e.next=2;break}return e.abrupt("return");case 2:if(i&&(o=[i[0].index,i[i.length-1].index]),a&&(u=[a[0].index,a[a.length-1].index]),o||u){e.next=6;break}return e.abrupt("return");case 6:if(c=this._demuxer.demux(t,r,o,u,s),l=c.videoTrack,d=c.audioTrack,f=l.type,h=d.type,!(p=this._mse)){e.next=28;break}this._sourceCreated||(l.exist()&&(p.createSource(f,"video/mp4;codecs=".concat(l.codec)),this._sourceCreated=!0),d.exist()&&(p.createSource(h,"audio/mp4;codecs=".concat(d.codec)),this._sourceCreated=!0)),e.prev=12,v=this._remuxer.remux(this._needInitSegment),e.next=19;break;case 16:throw e.prev=16,e.t0=e.catch(12),new M(P,U.FMP4,e.t0);case 19:return this._needInitSegment=!1,m=[],v.videoInitSegment&&m.push(p.append(f,v.videoInitSegment)),v.audioInitSegment&&m.push(p.append(h,v.audioInitSegment)),v.videoSegment&&m.push(p.append(f,v.videoSegment)),v.audioSegment&&m.push(p.append(h,v.audioSegment)),e.abrupt("return",Promise.all(m).catch((function(e){if(e.type!==j.CANCELLED)throw new M(L,U.MSE_APPEND_BUFFER,e)})));case 28:this._softVideo&&this._softVideo.appendBuffer(l,d);case 29:case"end":return e.stop()}}),e,this,[[12,16]])}))),function(e,t,r,n,i){return u.apply(this,arguments)})},{key:"evictBuffer",value:(a=s(n().mark((function e(t){var r,i,a,s,o,u=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.mp4.media,this._mse&&this._demuxer&&r&&t&&!(t<0)){e.next=3;break}return e.abrupt("return");case 3:if(i=r.currentTime,!((a=i-t)<=0)){e.next=7;break}return e.abrupt("return");case 7:if(!(D.start(D.get(r))+1>=a)){e.next=10;break}return e.abrupt("return");case 10:return s=this._demuxer,o=[],[s.videoTrack,s.audioTrack].forEach((function(e){e.exist()&&o.push(u._mse.remove(e.type,0,a))})),e.abrupt("return",Promise.all(o).catch((function(e){if(e.type!==j.CANCELLED)throw new M(L,U.MSE_OTHER,e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"reset",value:(i=s(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=6;break}return e.next=3,this._mse.unbindMedia();case 3:return e.next=5,this._mse.bindMedia(this.mp4.media);case 5:this._mseOpened=!1;case 6:this._sourceCreated=!1,this._needInitSegment=!0;case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"endOfStream",value:(r=s(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=12;break}if(!this._sourceCreated){e.next=12;break}return e.prev=2,e.next=5,this._mse.endOfStream();case 5:e.next=12;break;case 7:if(e.prev=7,e.t0=e.catch(2),e.t0.type!==j.CANCELLED){e.next=11;break}return e.abrupt("return");case 11:throw new M(L,U.MSE_OTHER,e.t0);case 12:this._softVideo&&this._softVideo.endOfStream();case 13:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:(t=s(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._mse,this._mse=null,this._softVideo=null,this._demuxer=null,this._remuxer=null,!t){e.next=8;break}return e.next=8,t.unbindMedia();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();var xt=function(e){d(h,e);var t,i,a,u,f=k(h);function h(e){var t,i,a;return o(this,h),l(g(t=f.call(this)),"_prevSegmentEndTime",0),l(g(t),"_tickTimer",null),l(g(t),"_loading",!1),l(g(t),"_onSeeking",s(n().mark((function e(){var r,i,a,s,o,u,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.media){e.next=2;break}return e.abrupt("return");case 2:if(r=t.media.currentTime,i=t._loader,a=i.getSegmentByTime(r),s=a.video,o=a.audio,u=s||o){e.next=8;break}return e.abrupt("return");case 8:if(!i.isSegmentLoading(u.index)){e.next=10;break}return e.abrupt("return");case 10:if(!(c=D.info(D.get(t.media),r,.1)).end||!(c.end>=u.endTime||c.end>=t.media.duration)){e.next=13;break}return e.abrupt("return");case 13:return e.next=15,i.cancel();case 15:t._loading=!1,t._prevSegmentEndTime=0,t._loadSegment(r),t._startTick();case 19:case"end":return e.stop()}}),e)})))),l(g(t),"_tick",(function(){t._stopTick();var e=t.media;e&&(t._startTick(t._config.tickInterval),D.end(D.get(e))<.1||!e.readyState||function(e){return e&&!e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState}(e)&&t._loadSegment())})),e=t._config=(a=(null==(i=e)?void 0:i.media)||document.createElement("video"),r(r({softDecode:!1,tickInterval:500,preloadTime:10,bufferBehind:10,segmentDuration:void 0,url:"",retry:3,retryDelay:100},i),{},{media:a})),t.media=t._config.media,e.softDecode&&t.media.setPlayMode&&t.media.setPlayMode("VOD"),t._bufferService=new _t(g(t),e.softDecode),t._loader=new kt({url:e.url,retry:e.retry,retryDelay:e.retryDelay}),t.media.addEventListener("seeking",t._onSeeking),t}return c(h,[{key:"load",value:(u=s(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._reset();case 2:if(!t){e.next=5;break}return e.next=5,this._loader.changeUrl(t);case 5:return this._startTick(this._config.tickInterval),e.next=8,this._loadSegment(0);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"destroy",value:(a=s(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.media.removeEventListener("seeking",this._onSeeking),e.next=3,this._reset();case 3:return e.next=5,this._bufferService.destroy();case 5:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"_reset",value:(i=s(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._stopTick(),e.next=3,this._loader.reset();case 3:return e.next=5,this._bufferService.reset();case 5:this._prevSegmentEndTime=0,this._loading=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"_loadSegment",value:(t=s(n().mark((function e(t){var r,i,a,s,o,u,c,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._loading){e.next=2;break}return e.abrupt("return");case 2:if(o=this.media.currentTime,!(this._prevSegmentEndTime>o+this._config.preloadTime)){e.next=5;break}return e.abrupt("return");case 5:if(this._loading=!0,e.prev=6,null==t){e.next=13;break}return e.next=10,this._loader.loadSegmentByTime(t);case 10:u=e.sent,e.next=16;break;case 13:return e.next=15,this._loader.loadNextSegment();case 15:u=e.sent;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(6),this._emitError(M.network(e.t0));case 21:if(u){e.next=24;break}return this._loading=!1,e.abrupt("return");case 24:return this._prevSegmentEndTime=Math.min((null===(r=u.video)||void 0===r?void 0:r.endTime)||1/0,(null===(i=u.audio)||void 0===i?void 0:i.endTime)||1/0),e.prev=25,e.next=28,this._bufferService.appendBuffer(u.data,u.range[0],null===(c=u.video)||void 0===c?void 0:c.frames,null===(l=u.audio)||void 0===l?void 0:l.frames,this._loader.meta.moov);case 28:return e.next=30,this._bufferService.evictBuffer(this._config.bufferBehind);case 30:e.next=35;break;case 32:return e.prev=32,e.t1=e.catch(25),e.abrupt("return",this._emitError(M.create(e.t1)));case 35:return e.prev=35,this._loading=!1,e.finish(35);case 38:this._loader.isLastSegment((null===(a=u.video)||void 0===a?void 0:a.index)||(null===(s=u.audio)||void 0===s?void 0:s.index)||0)?this._end():this._loadSegment();case 39:case"end":return e.stop()}}),e,this,[[6,18],[25,32,35,38]])}))),function(e){return t.apply(this,arguments)})},{key:"_end",value:function(){this._bufferService.endOfStream(),this._stopTick()}},{key:"_startTick",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._stopTick(),this._tickTimer=setTimeout(this._tick,e)}},{key:"_stopTick",value:function(){clearTimeout(this._tickTimer)}},{key:"_emitError",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];console.error(e),console.table(e),this.emit(ae,e),t&&this._end()}}],[{key:"isSupported",value:function(){return N.isSupported()||!!WebAssembly}}]),h}(ce);l(xt,"version","3.0.0-next.2");var wt=function(t){d(i,t);var n=k(i);function i(){var e;o(this,i);for(var t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];return l(g(e=n.call.apply(n,[this].concat(a))),"mp4",null),l(g(e),"destroy",(function(){var t,r;e.mp4&&(e.mp4.destroy(),e.mp4=null,null===(t=e.player)||void 0===t||null===(r=t.video)||void 0===r||r.removeEventListener("lowdecode",e._onLowDecode))})),l(g(e),"_onLowDecode",(function(){var t=e.player.video;t&&(e.player.emit("lowdecode",t.degradeInfo),e.player.emit("core_event",r(r({},t.degradeInfo),{},{eventName:se})))})),l(g(e),"_onSwitchURL",(function(t){e.mp4&&(e.player.config.url=t,e.mp4.load(t))})),l(g(e),"_onLowDecode",(function(){var t=e.player.video;t&&(e.player.emit("lowdecode",t.degradeInfo),e.player.emit("core_event",r(r({},t.degradeInfo),{},{eventName:se})))})),l(g(e),"_onDefinitionChange",(function(t){var r=t.to;e.mp4&&e.mp4.load(r)})),e}return c(i,[{key:"core",get:function(){return this.mp4}},{key:"version",get:function(){return xt.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}},{key:"beforePlayerInit",value:function(){var t=this,n=this.player.config;this.mp4&&this.mp4.destroy(),this.player.switchURL=this._onSwitchURL;var i=n.mp4||{};this.mp4=new xt(r({softDecode:this.softDecode,media:this.player.video,url:n.url},i)),this.softDecode?(this.player.forceDegradeToVideo=function(){},this.player.video.addEventListener("lowdecode",this._onLowDecode)):e.BasePlugin.defineGetterOrSetter(this.player,{__url:{get:function(){var e,r;return null===(e=t.mp4)||void 0===e||null===(r=e.media)||void 0===r?void 0:r.src},configurable:!0}}),this.on(e.Events.URL_CHANGE,this._onSwitchURL),this.on(e.Events.DEFINITION_CHANGE,this._onDefinitionChange),this.on(e.Events.DESTROY,this.destroy),this._transError(),this.mp4.load()}},{key:"_transError",value:function(){var t=this;this.mp4.on(ae,(function(r){t.player&&t.player.emit(e.Events.ERROR,new e.Errors(t.player,r))}))}}],[{key:"pluginName",get:function(){return"mp4"}},{key:"isSupported",value:function(e){return xt.isSupported(e)}}]),i}(e.BasePlugin);return l(wt,"MP4",xt),wt}));
2
2
  //# sourceMappingURL=index.min.js.map