UNPKG

xgplayer-shaka

Version:

xgplayer plugin for shaka-player

3 lines 416 kB
!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).ShakaPlugin=t(e.Player)}(this,(function(e){"use strict";function t(e){return(t="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 n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(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 o(e)}function s(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 n,i=r(e);if(t){var o=r(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return a(this,n)}}function u(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=function(e){return e&&e.Math==Math&&e},f=l("object"==typeof globalThis&&globalThis)||l("object"==typeof window&&window)||l("object"==typeof self&&self)||l("object"==typeof c&&c)||function(){return this}()||Function("return this")(),h={exports:{}},d=function(e){try{return!!e()}catch(t){return!0}},p=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),g={},m=function(e){return"object"==typeof e?null!==e:"function"==typeof e},v=m,y=f.document,b=v(y)&&v(y.createElement),w=function(e){return b?y.createElement(e):{}},T=w,S=!p&&!d((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),E=m,x=function(e){if(!E(e))throw TypeError(String(e)+" is not an object");return e},A=m,k=function(e,t){if(!A(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!A(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},I=p,M=S,P=x,R=k,C=Object.defineProperty;g.f=I?C:function(e,t,n){if(P(e),t=R(t,!0),P(n),M)try{return C(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var N=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},j=g,D=N,O=p?function(e,t,n){return j.f(e,t,D(1,n))}:function(e,t,n){return e[t]=n,e},L=f,U=O,_=function(e,t){try{U(L,e,t)}catch(n){L[e]=t}return t},K=_,B="__core-js_shared__",F=f[B]||K(B,{}),V=F;(h.exports=function(e,t){return V[e]||(V[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.12.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var H,q,z=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},G=z,W=function(e){return Object(G(e))},X=W,Y={}.hasOwnProperty,$=function(e,t){return Y.call(X(e),t)},J=0,Q=Math.random(),Z=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++J+Q).toString(36)},ee=f,te=ee,ne=f,re=function(e){return"function"==typeof e?e:void 0},ie=function(e,t){return arguments.length<2?re(te[e])||re(ne[e]):te[e]&&te[e][t]||ne[e]&&ne[e][t]},oe=ie("navigator","userAgent")||"",ae=oe,se=f.process,ue=se&&se.versions,ce=ue&&ue.v8;ce?q=(H=ce.split("."))[0]<4?1:H[0]+H[1]:ae&&(!(H=ae.match(/Edge\/(\d+)/))||H[1]>=74)&&(H=ae.match(/Chrome\/(\d+)/))&&(q=H[1]);var le=q&&+q,fe=le,he=d,de=!!Object.getOwnPropertySymbols&&!he((function(){return!String(Symbol())||!Symbol.sham&&fe&&fe<41})),pe=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ge=f,me=h.exports,ve=$,ye=Z,be=de,we=pe,Te=me("wks"),Se=ge.Symbol,Ee=we?Se:Se&&Se.withoutSetter||ye,xe=function(e){return ve(Te,e)&&(be||"string"==typeof Te[e])||(be&&ve(Se,e)?Te[e]=Se[e]:Te[e]=Ee("Symbol."+e)),Te[e]},Ae={};Ae[xe("toStringTag")]="z";var ke="[object z]"===String(Ae),Ie={exports:{}},Me=F,Pe=Function.toString;"function"!=typeof Me.inspectSource&&(Me.inspectSource=function(e){return Pe.call(e)});var Re,Ce,Ne,je=Me.inspectSource,De=je,Oe=f.WeakMap,Le="function"==typeof Oe&&/native code/.test(De(Oe)),Ue=h.exports,_e=Z,Ke=Ue("keys"),Be=function(e){return Ke[e]||(Ke[e]=_e(e))},Fe={},Ve=Le,He=m,qe=O,ze=$,Ge=F,We=Be,Xe=Fe,Ye="Object already initialized",$e=f.WeakMap;if(Ve||Ge.state){var Je=Ge.state||(Ge.state=new $e),Qe=Je.get,Ze=Je.has,et=Je.set;Re=function(e,t){if(Ze.call(Je,e))throw new TypeError(Ye);return t.facade=e,et.call(Je,e,t),t},Ce=function(e){return Qe.call(Je,e)||{}},Ne=function(e){return Ze.call(Je,e)}}else{var tt=We("state");Xe[tt]=!0,Re=function(e,t){if(ze(e,tt))throw new TypeError(Ye);return t.facade=e,qe(e,tt,t),t},Ce=function(e){return ze(e,tt)?e[tt]:{}},Ne=function(e){return ze(e,tt)}}var nt={set:Re,get:Ce,has:Ne,enforce:function(e){return Ne(e)?Ce(e):Re(e,{})},getterFor:function(e){return function(t){var n;if(!He(t)||(n=Ce(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},rt=f,it=O,ot=$,at=_,st=je,ut=nt.get,ct=nt.enforce,lt=String(String).split("String");(Ie.exports=function(e,t,n,r){var i,o=!!r&&!!r.unsafe,a=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||ot(n,"name")||it(n,"name",t),(i=ct(n)).source||(i.source=lt.join("string"==typeof t?t:""))),e!==rt?(o?!s&&e[t]&&(a=!0):delete e[t],a?e[t]=n:it(e,t,n)):a?e[t]=n:at(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&ut(this).source||st(this)}));var ft={}.toString,ht=function(e){return ft.call(e).slice(8,-1)},dt=ke,pt=ht,gt=xe("toStringTag"),mt="Arguments"==pt(function(){return arguments}()),vt=dt?pt:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Object(e),gt))?n:mt?pt(t):"Object"==(r=pt(t))&&"function"==typeof t.callee?"Arguments":r},yt=vt,bt=ke?{}.toString:function(){return"[object "+yt(this)+"]"},wt=ke,Tt=Ie.exports,St=bt;wt||Tt(Object.prototype,"toString",St,{unsafe:!0});var Et={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},xt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},At=xt,kt=function(e,t,n){if(At(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},It=ht,Mt="".split,Pt=d((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==It(e)?Mt.call(e,""):Object(e)}:Object,Rt=Math.ceil,Ct=Math.floor,Nt=function(e){return isNaN(e=+e)?0:(e>0?Ct:Rt)(e)},jt=Nt,Dt=Math.min,Ot=function(e){return e>0?Dt(jt(e),9007199254740991):0},Lt=ht,Ut=Array.isArray||function(e){return"Array"==Lt(e)},_t=m,Kt=Ut,Bt=xe("species"),Ft=function(e,t){var n;return Kt(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!Kt(n.prototype)?_t(n)&&null===(n=n[Bt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Vt=kt,Ht=Pt,qt=W,zt=Ot,Gt=Ft,Wt=[].push,Xt=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(u,c,l,f){for(var h,d,p=qt(u),g=Ht(p),m=Vt(c,l,3),v=zt(g.length),y=0,b=f||Gt,w=t?b(u,v):n||a?b(u,0):void 0;v>y;y++)if((s||y in g)&&(d=m(h=g[y],y,p),e))if(t)w[y]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:Wt.call(w,h)}else switch(e){case 4:return!1;case 7:Wt.call(w,h)}return o?-1:r||i?i:w}},Yt={forEach:Xt(0),map:Xt(1),filter:Xt(2),some:Xt(3),every:Xt(4),find:Xt(5),findIndex:Xt(6),filterOut:Xt(7)},$t=d,Jt=function(e,t){var n=[][e];return!!n&&$t((function(){n.call(null,t||function(){throw 1},1)}))},Qt=Yt.forEach,Zt=Jt("forEach")?[].forEach:function(e){return Qt(this,e,arguments.length>1?arguments[1]:void 0)},en=f,tn=Et,nn=Zt,rn=O;for(var on in tn){var an=en[on],sn=an&&an.prototype;if(sn&&sn.forEach!==nn)try{rn(sn,"forEach",nn)}catch(Wx){sn.forEach=nn}}var un={},cn={},ln={}.propertyIsEnumerable,fn=Object.getOwnPropertyDescriptor,hn=fn&&!ln.call({1:2},1);cn.f=hn?function(e){var t=fn(this,e);return!!t&&t.enumerable}:ln;var dn=Pt,pn=z,gn=function(e){return dn(pn(e))},mn=p,vn=cn,yn=N,bn=gn,wn=k,Tn=$,Sn=S,En=Object.getOwnPropertyDescriptor;un.f=mn?En:function(e,t){if(e=bn(e),t=wn(t,!0),Sn)try{return En(e,t)}catch(Wx){}if(Tn(e,t))return yn(!vn.f.call(e,t),e[t])};var xn={},An=Nt,kn=Math.max,In=Math.min,Mn=function(e,t){var n=An(e);return n<0?kn(n+t,0):In(n,t)},Pn=gn,Rn=Ot,Cn=Mn,Nn=function(e){return function(t,n,r){var i,o=Pn(t),a=Rn(o.length),s=Cn(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},jn={includes:Nn(!0),indexOf:Nn(!1)},Dn=$,On=gn,Ln=jn.indexOf,Un=Fe,_n=function(e,t){var n,r=On(e),i=0,o=[];for(n in r)!Dn(Un,n)&&Dn(r,n)&&o.push(n);for(;t.length>i;)Dn(r,n=t[i++])&&(~Ln(o,n)||o.push(n));return o},Kn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bn=_n,Fn=Kn.concat("length","prototype");xn.f=Object.getOwnPropertyNames||function(e){return Bn(e,Fn)};var Vn={};Vn.f=Object.getOwnPropertySymbols;var Hn=xn,qn=Vn,zn=x,Gn=ie("Reflect","ownKeys")||function(e){var t=Hn.f(zn(e)),n=qn.f;return n?t.concat(n(e)):t},Wn=$,Xn=Gn,Yn=un,$n=g,Jn=function(e,t){for(var n=Xn(t),r=$n.f,i=Yn.f,o=0;o<n.length;o++){var a=n[o];Wn(e,a)||r(e,a,i(t,a))}},Qn=d,Zn=/#|\.prototype\./,er=function(e,t){var n=nr[tr(e)];return n==ir||n!=rr&&("function"==typeof t?Qn(t):!!t)},tr=er.normalize=function(e){return String(e).replace(Zn,".").toLowerCase()},nr=er.data={},rr=er.NATIVE="N",ir=er.POLYFILL="P",or=er,ar=f,sr=un.f,ur=O,cr=Ie.exports,lr=_,fr=Jn,hr=or,dr=function(e,t){var n,r,i,o,a,s=e.target,u=e.global,c=e.stat;if(n=u?ar:c?ar[s]||lr(s,{}):(ar[s]||{}).prototype)for(r in t){if(o=t[r],i=e.noTargetGet?(a=sr(n,r))&&a.value:n[r],!hr(u?r:s+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;fr(o,i)}(e.sham||i&&i.sham)&&ur(o,"sham",!0),cr(n,r,o,e)}},pr=x,gr=function(){var e=pr(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},mr={},vr=d;function yr(e,t){return RegExp(e,t)}mr.UNSUPPORTED_Y=vr((function(){var e=yr("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),mr.BROKEN_CARET=vr((function(){var e=yr("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var br,wr,Tr=gr,Sr=mr,Er=h.exports,xr=RegExp.prototype.exec,Ar=Er("native-string-replace",String.prototype.replace),kr=xr,Ir=(br=/a/,wr=/b*/g,xr.call(br,"a"),xr.call(wr,"a"),0!==br.lastIndex||0!==wr.lastIndex),Mr=Sr.UNSUPPORTED_Y||Sr.BROKEN_CARET,Pr=void 0!==/()??/.exec("")[1];(Ir||Pr||Mr)&&(kr=function(e){var t,n,r,i,o=this,a=Mr&&o.sticky,s=Tr.call(o),u=o.source,c=0,l=e;return a&&(-1===(s=s.replace("y","")).indexOf("g")&&(s+="g"),l=String(e).slice(o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==e[o.lastIndex-1])&&(u="(?: "+u+")",l=" "+l,c++),n=new RegExp("^(?:"+u+")",s)),Pr&&(n=new RegExp("^"+u+"$(?!\\s)",s)),Ir&&(t=o.lastIndex),r=xr.call(a?n:o,l),a?r?(r.input=r.input.slice(c),r[0]=r[0].slice(c),r.index=o.lastIndex,o.lastIndex+=r[0].length):o.lastIndex=0:Ir&&r&&(o.lastIndex=o.global?r.index+r[0].length:t),Pr&&r&&r.length>1&&Ar.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var Rr=kr;dr({target:"RegExp",proto:!0,forced:/./.exec!==Rr},{exec:Rr});var Cr,Nr,jr=dr,Dr=m,Or=(Cr=!1,(Nr=/[ac]/).exec=function(){return Cr=!0,/./.exec.apply(this,arguments)},!0===Nr.test("abc")&&Cr),Lr=/./.test;jr({target:"RegExp",proto:!0,forced:!Or},{test:function(e){if("function"!=typeof this.exec)return Lr.call(this,e);var t=this.exec(e);if(null!==t&&!Dr(t))throw new Error("RegExp exec method returned something other than an Object or null");return!!t}});var Ur=dr,_r=xt,Kr=W,Br=d,Fr=Jt,Vr=[],Hr=Vr.sort,qr=Br((function(){Vr.sort(void 0)})),zr=Br((function(){Vr.sort(null)})),Gr=Fr("sort");Ur({target:"Array",proto:!0,forced:qr||!zr||!Gr},{sort:function(e){return void 0===e?Hr.call(Kr(this)):Hr.call(Kr(this),_r(e))}});var Wr,Xr=_n,Yr=Kn,$r=Object.keys||function(e){return Xr(e,Yr)},Jr=g,Qr=x,Zr=$r,ei=p?Object.defineProperties:function(e,t){Qr(e);for(var n,r=Zr(t),i=r.length,o=0;i>o;)Jr.f(e,n=r[o++],t[n]);return e},ti=ie("document","documentElement"),ni=x,ri=ei,ii=Kn,oi=Fe,ai=ti,si=w,ui=Be("IE_PROTO"),ci=function(){},li=function(e){return"<script>"+e+"</"+"script>"},fi=function(){try{Wr=document.domain&&new ActiveXObject("htmlfile")}catch(Wx){}var e,t;fi=Wr?function(e){e.write(li("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Wr):((t=si("iframe")).style.display="none",ai.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(li("document.F=Object")),e.close(),e.F);for(var n=ii.length;n--;)delete fi.prototype[ii[n]];return fi()};oi[ui]=!0;var hi=Object.create||function(e,t){var n;return null!==e?(ci.prototype=ni(e),n=new ci,ci.prototype=null,n[ui]=e):n=fi(),void 0===t?n:ri(n,t)},di={},pi=gn,gi=xn.f,mi={}.toString,vi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];di.f=function(e){return vi&&"[object Window]"==mi.call(e)?function(e){try{return gi(e)}catch(Wx){return vi.slice()}}(e):gi(pi(e))};var yi={},bi=xe;yi.f=bi;var wi=ee,Ti=$,Si=yi,Ei=g.f,xi=function(e){var t=wi.Symbol||(wi.Symbol={});Ti(t,e)||Ei(t,e,{value:Si.f(e)})},Ai=g.f,ki=$,Ii=xe("toStringTag"),Mi=function(e,t,n){e&&!ki(e=n?e:e.prototype,Ii)&&Ai(e,Ii,{configurable:!0,value:t})},Pi=dr,Ri=f,Ci=ie,Ni=p,ji=de,Di=pe,Oi=d,Li=$,Ui=Ut,_i=m,Ki=x,Bi=W,Fi=gn,Vi=k,Hi=N,qi=hi,zi=$r,Gi=xn,Wi=di,Xi=Vn,Yi=un,$i=g,Ji=cn,Qi=O,Zi=Ie.exports,eo=h.exports,to=Fe,no=Z,ro=xe,io=yi,oo=xi,ao=Mi,so=nt,uo=Yt.forEach,co=Be("hidden"),lo="Symbol",fo=ro("toPrimitive"),ho=so.set,po=so.getterFor(lo),go=Object.prototype,mo=Ri.Symbol,vo=Ci("JSON","stringify"),yo=Yi.f,bo=$i.f,wo=Wi.f,To=Ji.f,So=eo("symbols"),Eo=eo("op-symbols"),xo=eo("string-to-symbol-registry"),Ao=eo("symbol-to-string-registry"),ko=eo("wks"),Io=Ri.QObject,Mo=!Io||!Io.prototype||!Io.prototype.findChild,Po=Ni&&Oi((function(){return 7!=qi(bo({},"a",{get:function(){return bo(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=yo(go,t);r&&delete go[t],bo(e,t,n),r&&e!==go&&bo(go,t,r)}:bo,Ro=function(e,t){var n=So[e]=qi(mo.prototype);return ho(n,{type:lo,tag:e,description:t}),Ni||(n.description=t),n},Co=Di?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof mo},No=function(e,t,n){e===go&&No(Eo,t,n),Ki(e);var r=Vi(t,!0);return Ki(n),Li(So,r)?(n.enumerable?(Li(e,co)&&e[co][r]&&(e[co][r]=!1),n=qi(n,{enumerable:Hi(0,!1)})):(Li(e,co)||bo(e,co,Hi(1,{})),e[co][r]=!0),Po(e,r,n)):bo(e,r,n)},jo=function(e,t){Ki(e);var n=Fi(t),r=zi(n).concat(Uo(n));return uo(r,(function(t){Ni&&!Do.call(n,t)||No(e,t,n[t])})),e},Do=function(e){var t=Vi(e,!0),n=To.call(this,t);return!(this===go&&Li(So,t)&&!Li(Eo,t))&&(!(n||!Li(this,t)||!Li(So,t)||Li(this,co)&&this[co][t])||n)},Oo=function(e,t){var n=Fi(e),r=Vi(t,!0);if(n!==go||!Li(So,r)||Li(Eo,r)){var i=yo(n,r);return!i||!Li(So,r)||Li(n,co)&&n[co][r]||(i.enumerable=!0),i}},Lo=function(e){var t=wo(Fi(e)),n=[];return uo(t,(function(e){Li(So,e)||Li(to,e)||n.push(e)})),n},Uo=function(e){var t=e===go,n=wo(t?Eo:Fi(e)),r=[];return uo(n,(function(e){!Li(So,e)||t&&!Li(go,e)||r.push(So[e])})),r};(ji||(mo=function(){if(this instanceof mo)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=no(e),n=function(e){this===go&&n.call(Eo,e),Li(this,co)&&Li(this[co],t)&&(this[co][t]=!1),Po(this,t,Hi(1,e))};return Ni&&Mo&&Po(go,t,{configurable:!0,set:n}),Ro(t,e)},Zi(mo.prototype,"toString",(function(){return po(this).tag})),Zi(mo,"withoutSetter",(function(e){return Ro(no(e),e)})),Ji.f=Do,$i.f=No,Yi.f=Oo,Gi.f=Wi.f=Lo,Xi.f=Uo,io.f=function(e){return Ro(ro(e),e)},Ni&&(bo(mo.prototype,"description",{configurable:!0,get:function(){return po(this).description}}),Zi(go,"propertyIsEnumerable",Do,{unsafe:!0}))),Pi({global:!0,wrap:!0,forced:!ji,sham:!ji},{Symbol:mo}),uo(zi(ko),(function(e){oo(e)})),Pi({target:lo,stat:!0,forced:!ji},{for:function(e){var t=String(e);if(Li(xo,t))return xo[t];var n=mo(t);return xo[t]=n,Ao[n]=t,n},keyFor:function(e){if(!Co(e))throw TypeError(e+" is not a symbol");if(Li(Ao,e))return Ao[e]},useSetter:function(){Mo=!0},useSimple:function(){Mo=!1}}),Pi({target:"Object",stat:!0,forced:!ji,sham:!Ni},{create:function(e,t){return void 0===t?qi(e):jo(qi(e),t)},defineProperty:No,defineProperties:jo,getOwnPropertyDescriptor:Oo}),Pi({target:"Object",stat:!0,forced:!ji},{getOwnPropertyNames:Lo,getOwnPropertySymbols:Uo}),Pi({target:"Object",stat:!0,forced:Oi((function(){Xi.f(1)}))},{getOwnPropertySymbols:function(e){return Xi.f(Bi(e))}}),vo)&&Pi({target:"JSON",stat:!0,forced:!ji||Oi((function(){var e=mo();return"[null]"!=vo([e])||"{}"!=vo({a:e})||"{}"!=vo(Object(e))}))},{stringify:function(e,t,n){for(var r,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(r=t,(_i(t)||void 0!==e)&&!Co(e))return Ui(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Co(t))return t}),i[1]=t,vo.apply(null,i)}});mo.prototype[fo]||Qi(mo.prototype,fo,mo.prototype.valueOf),ao(mo,lo),to[co]=!0;var _o=dr,Ko=p,Bo=f,Fo=$,Vo=m,Ho=g.f,qo=Jn,zo=Bo.Symbol;if(Ko&&"function"==typeof zo&&(!("description"in zo.prototype)||void 0!==zo().description)){var Go={},Wo=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Wo?new zo(e):void 0===e?zo():zo(e);return""===e&&(Go[t]=!0),t};qo(Wo,zo);var Xo=Wo.prototype=zo.prototype;Xo.constructor=Wo;var Yo=Xo.toString,$o="Symbol(test)"==String(zo("test")),Jo=/^Symbol\((.*)\)[^)]+$/;Ho(Xo,"description",{configurable:!0,get:function(){var e=Vo(this)?this.valueOf():this,t=Yo.call(e);if(Fo(Go,e))return"";var n=$o?t.slice(7,-1):t.replace(Jo,"$1");return""===n?void 0:n}}),_o({global:!0,forced:!0},{Symbol:Wo})}xi("iterator");var Qo=hi,Zo=g,ea=xe("unscopables"),ta=Array.prototype;null==ta[ea]&&Zo.f(ta,ea,{configurable:!0,value:Qo(null)});var na,ra,ia,oa=function(e){ta[ea][e]=!0},aa={},sa=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ua=$,ca=W,la=sa,fa=Be("IE_PROTO"),ha=Object.prototype,da=la?Object.getPrototypeOf:function(e){return e=ca(e),ua(e,fa)?e[fa]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ha:null},pa=d,ga=da,ma=O,va=$,ya=xe("iterator"),ba=!1;[].keys&&("next"in(ia=[].keys())?(ra=ga(ga(ia)))!==Object.prototype&&(na=ra):ba=!0),(null==na||pa((function(){var e={};return na[ya].call(e)!==e})))&&(na={}),va(na,ya)||ma(na,ya,(function(){return this}));var wa={IteratorPrototype:na,BUGGY_SAFARI_ITERATORS:ba},Ta=wa.IteratorPrototype,Sa=hi,Ea=N,xa=Mi,Aa=aa,ka=function(){return this},Ia=function(e,t,n){var r=t+" Iterator";return e.prototype=Sa(Ta,{next:Ea(1,n)}),xa(e,r,!1),Aa[r]=ka,e},Ma=m,Pa=x,Ra=function(e){if(!Ma(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Ca=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(Wx){}return function(n,r){return Pa(n),Ra(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Na=dr,ja=Ia,Da=da,Oa=Ca,La=Mi,Ua=O,_a=Ie.exports,Ka=aa,Ba=wa.IteratorPrototype,Fa=wa.BUGGY_SAFARI_ITERATORS,Va=xe("iterator"),Ha="keys",qa="values",za="entries",Ga=function(){return this},Wa=function(e,t,n,r,i,o,a){ja(n,t,r);var s,u,c,l=function(e){if(e===i&&g)return g;if(!Fa&&e in d)return d[e];switch(e){case Ha:case qa:case za:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[Va]||d["@@iterator"]||i&&d[i],g=!Fa&&p||l(i),m="Array"==t&&d.entries||p;if(m&&(s=Da(m.call(new e)),Ba!==Object.prototype&&s.next&&(Da(s)!==Ba&&(Oa?Oa(s,Ba):"function"!=typeof s[Va]&&Ua(s,Va,Ga)),La(s,f,!0))),i==qa&&p&&p.name!==qa&&(h=!0,g=function(){return p.call(this)}),d[Va]!==g&&Ua(d,Va,g),Ka[t]=g,i)if(u={values:l(qa),keys:o?g:l(Ha),entries:l(za)},a)for(c in u)(Fa||h||!(c in d))&&_a(d,c,u[c]);else Na({target:t,proto:!0,forced:Fa||h},u);return u},Xa=gn,Ya=oa,$a=aa,Ja=nt,Qa=Wa,Za="Array Iterator",es=Ja.set,ts=Ja.getterFor(Za),ns=Qa(Array,"Array",(function(e,t){es(this,{type:Za,target:Xa(e),index:0,kind:t})}),(function(){var e=ts(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");$a.Arguments=$a.Array,Ya("keys"),Ya("values"),Ya("entries");var rs=Nt,is=z,os=function(e){return function(t,n){var r,i,o=String(is(t)),a=rs(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=o.charCodeAt(a))<55296||r>56319||a+1===s||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):i-56320+(r-55296<<10)+65536}},as={codeAt:os(!1),charAt:os(!0)},ss=as.charAt,us=nt,cs=Wa,ls="String Iterator",fs=us.set,hs=us.getterFor(ls);cs(String,"String",(function(e){fs(this,{type:ls,string:String(e),index:0})}),(function(){var e,t=hs(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=ss(n,r),t.index+=e.length,{value:e,done:!1})}));var ds=f,ps=Et,gs=ns,ms=O,vs=xe,ys=vs("iterator"),bs=vs("toStringTag"),ws=gs.values;for(var Ts in ps){var Ss=ds[Ts],Es=Ss&&Ss.prototype;if(Es){if(Es[ys]!==ws)try{ms(Es,ys,ws)}catch(Wx){Es[ys]=ws}if(Es[bs]||ms(Es,bs,Ts),ps[Ts])for(var xs in gs)if(Es[xs]!==gs[xs])try{ms(Es,xs,gs[xs])}catch(Wx){Es[xs]=gs[xs]}}}var As=f.Promise,ks=Ie.exports,Is=function(e,t,n){for(var r in t)ks(e,r,t[r],n);return e},Ms=ie,Ps=g,Rs=p,Cs=xe("species"),Ns=function(e){var t=Ms(e),n=Ps.f;Rs&&t&&!t[Cs]&&n(t,Cs,{configurable:!0,get:function(){return this}})},js=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Ds=aa,Os=xe("iterator"),Ls=Array.prototype,Us=function(e){return void 0!==e&&(Ds.Array===e||Ls[Os]===e)},_s=vt,Ks=aa,Bs=xe("iterator"),Fs=function(e){if(null!=e)return e[Bs]||e["@@iterator"]||Ks[_s(e)]},Vs=x,Hs=function(e){var t=e.return;if(void 0!==t)return Vs(t.call(e)).value},qs=x,zs=Us,Gs=Ot,Ws=kt,Xs=Fs,Ys=Hs,$s=function(e,t){this.stopped=e,this.result=t},Js=function(e,t,n){var r,i,o,a,s,u,c,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),p=Ws(t,l,1+f+d),g=function(e){return r&&Ys(r),new $s(!0,e)},m=function(e){return f?(qs(e),d?p(e[0],e[1],g):p(e[0],e[1])):d?p(e,g):p(e)};if(h)r=e;else{if("function"!=typeof(i=Xs(e)))throw TypeError("Target is not iterable");if(zs(i)){for(o=0,a=Gs(e.length);a>o;o++)if((s=m(e[o]))&&s instanceof $s)return s;return new $s(!1)}r=i.call(e)}for(u=r.next;!(c=u.call(r)).done;){try{s=m(c.value)}catch(Wx){throw Ys(r),Wx}if("object"==typeof s&&s&&s instanceof $s)return s}return new $s(!1)},Qs=xe("iterator"),Zs=!1;try{var eu=0,tu={next:function(){return{done:!!eu++}},return:function(){Zs=!0}};tu[Qs]=function(){return this},Array.from(tu,(function(){throw 2}))}catch(Wx){}var nu,ru,iu,ou=function(e,t){if(!t&&!Zs)return!1;var n=!1;try{var r={};r[Qs]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(Wx){}return n},au=x,su=xt,uu=xe("species"),cu=function(e,t){var n,r=au(e).constructor;return void 0===r||null==(n=au(r)[uu])?t:su(n)},lu=/(?:iphone|ipod|ipad).*applewebkit/i.test(oe),fu="process"==ht(f.process),hu=f,du=d,pu=kt,gu=ti,mu=w,vu=lu,yu=fu,bu=hu.location,wu=hu.setImmediate,Tu=hu.clearImmediate,Su=hu.process,Eu=hu.MessageChannel,xu=hu.Dispatch,Au=0,ku={},Iu="onreadystatechange",Mu=function(e){if(ku.hasOwnProperty(e)){var t=ku[e];delete ku[e],t()}},Pu=function(e){return function(){Mu(e)}},Ru=function(e){Mu(e.data)},Cu=function(e){hu.postMessage(e+"",bu.protocol+"//"+bu.host)};wu&&Tu||(wu=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return ku[++Au]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},nu(Au),Au},Tu=function(e){delete ku[e]},yu?nu=function(e){Su.nextTick(Pu(e))}:xu&&xu.now?nu=function(e){xu.now(Pu(e))}:Eu&&!vu?(iu=(ru=new Eu).port2,ru.port1.onmessage=Ru,nu=pu(iu.postMessage,iu,1)):hu.addEventListener&&"function"==typeof postMessage&&!hu.importScripts&&bu&&"file:"!==bu.protocol&&!du(Cu)?(nu=Cu,hu.addEventListener("message",Ru,!1)):nu=Iu in mu("script")?function(e){gu.appendChild(mu("script")).onreadystatechange=function(){gu.removeChild(this),Mu(e)}}:function(e){setTimeout(Pu(e),0)});var Nu,ju,Du,Ou,Lu,Uu,_u,Ku,Bu={set:wu,clear:Tu},Fu=/web0s(?!.*chrome)/i.test(oe),Vu=f,Hu=un.f,qu=Bu.set,zu=lu,Gu=Fu,Wu=fu,Xu=Vu.MutationObserver||Vu.WebKitMutationObserver,Yu=Vu.document,$u=Vu.process,Ju=Vu.Promise,Qu=Hu(Vu,"queueMicrotask"),Zu=Qu&&Qu.value;Zu||(Nu=function(){var e,t;for(Wu&&(e=$u.domain)&&e.exit();ju;){t=ju.fn,ju=ju.next;try{t()}catch(Wx){throw ju?Ou():Du=void 0,Wx}}Du=void 0,e&&e.enter()},zu||Wu||Gu||!Xu||!Yu?Ju&&Ju.resolve?((_u=Ju.resolve(void 0)).constructor=Ju,Ku=_u.then,Ou=function(){Ku.call(_u,Nu)}):Ou=Wu?function(){$u.nextTick(Nu)}:function(){qu.call(Vu,Nu)}:(Lu=!0,Uu=Yu.createTextNode(""),new Xu(Nu).observe(Uu,{characterData:!0}),Ou=function(){Uu.data=Lu=!Lu}));var ec=Zu||function(e){var t={fn:e,next:void 0};Du&&(Du.next=t),ju||(ju=t,Ou()),Du=t},tc={},nc=xt,rc=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=nc(t),this.reject=nc(n)};tc.f=function(e){return new rc(e)};var ic,oc,ac,sc,uc=x,cc=m,lc=tc,fc=function(e,t){if(uc(e),cc(t)&&t.constructor===e)return t;var n=lc.f(e);return(0,n.resolve)(t),n.promise},hc=f,dc="object"==typeof window,pc=dr,gc=f,mc=ie,vc=As,yc=Ie.exports,bc=Is,wc=Ca,Tc=Mi,Sc=Ns,Ec=m,xc=xt,Ac=js,kc=je,Ic=Js,Mc=ou,Pc=cu,Rc=Bu.set,Cc=ec,Nc=fc,jc=function(e,t){var n=hc.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},Dc=tc,Oc=function(e){try{return{error:!1,value:e()}}catch(Wx){return{error:!0,value:Wx}}},Lc=nt,Uc=or,_c=dc,Kc=fu,Bc=le,Fc=xe("species"),Vc="Promise",Hc=Lc.get,qc=Lc.set,zc=Lc.getterFor(Vc),Gc=vc&&vc.prototype,Wc=vc,Xc=Gc,Yc=gc.TypeError,$c=gc.document,Jc=gc.process,Qc=Dc.f,Zc=Qc,el=!!($c&&$c.createEvent&&gc.dispatchEvent),tl="function"==typeof PromiseRejectionEvent,nl="unhandledrejection",rl=!1,il=Uc(Vc,(function(){var e=kc(Wc)!==String(Wc);if(!e&&66===Bc)return!0;if(Bc>=51&&/native code/.test(Wc))return!1;var t=new Wc((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(t.constructor={})[Fc]=n,!(rl=t.then((function(){}))instanceof n)||!e&&_c&&!tl})),ol=il||!Mc((function(e){Wc.all(e).catch((function(){}))})),al=function(e){var t;return!(!Ec(e)||"function"!=typeof(t=e.then))&&t},sl=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;Cc((function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,s,u,c=n[o++],l=i?c.ok:c.fail,f=c.resolve,h=c.reject,d=c.domain;try{l?(i||(2===e.rejection&&fl(e),e.rejection=1),!0===l?a=r:(d&&d.enter(),a=l(r),d&&(d.exit(),u=!0)),a===c.promise?h(Yc("Promise-chain cycle")):(s=al(a))?s.call(a,f,h):f(a)):h(r)}catch(Wx){d&&!u&&d.exit(),h(Wx)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&cl(e)}))}},ul=function(e,t,n){var r,i;el?((r=$c.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),gc.dispatchEvent(r)):r={promise:t,reason:n},!tl&&(i=gc["on"+e])?i(r):e===nl&&jc("Unhandled promise rejection",n)},cl=function(e){Rc.call(gc,(function(){var t,n=e.facade,r=e.value;if(ll(e)&&(t=Oc((function(){Kc?Jc.emit("unhandledRejection",r,n):ul(nl,n,r)})),e.rejection=Kc||ll(e)?2:1,t.error))throw t.value}))},ll=function(e){return 1!==e.rejection&&!e.parent},fl=function(e){Rc.call(gc,(function(){var t=e.facade;Kc?Jc.emit("rejectionHandled",t):ul("rejectionhandled",t,e.value)}))},hl=function(e,t,n){return function(r){e(t,r,n)}},dl=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,sl(e,!0))},pl=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Yc("Promise can't be resolved itself");var r=al(t);r?Cc((function(){var n={done:!1};try{r.call(t,hl(pl,n,e),hl(dl,n,e))}catch(Wx){dl(n,Wx,e)}})):(e.value=t,e.state=1,sl(e,!1))}catch(Wx){dl({done:!1},Wx,e)}}};if(il&&(Xc=(Wc=function(e){Ac(this,Wc,Vc),xc(e),ic.call(this);var t=Hc(this);try{e(hl(pl,t),hl(dl,t))}catch(Wx){dl(t,Wx)}}).prototype,(ic=function(e){qc(this,{type:Vc,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=bc(Xc,{then:function(e,t){var n=zc(this),r=Qc(Pc(this,Wc));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Kc?Jc.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&sl(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),oc=function(){var e=new ic,t=Hc(e);this.promise=e,this.resolve=hl(pl,t),this.reject=hl(dl,t)},Dc.f=Qc=function(e){return e===Wc||e===ac?new oc(e):Zc(e)},"function"==typeof vc&&Gc!==Object.prototype)){sc=Gc.then,rl||(yc(Gc,"then",(function(e,t){var n=this;return new Wc((function(e,t){sc.call(n,e,t)})).then(e,t)}),{unsafe:!0}),yc(Gc,"catch",Xc.catch,{unsafe:!0}));try{delete Gc.constructor}catch(Wx){}wc&&wc(Gc,Xc)}pc({global:!0,wrap:!0,forced:il},{Promise:Wc}),Tc(Wc,Vc,!1),Sc(Vc),ac=mc(Vc),pc({target:Vc,stat:!0,forced:il},{reject:function(e){var t=Qc(this);return t.reject.call(void 0,e),t.promise}}),pc({target:Vc,stat:!0,forced:il},{resolve:function(e){return Nc(this,e)}}),pc({target:Vc,stat:!0,forced:ol},{all:function(e){var t=this,n=Qc(t),r=n.resolve,i=n.reject,o=Oc((function(){var n=xc(t.resolve),o=[],a=0,s=1;Ic(e,(function(e){var u=a++,c=!1;o.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=Qc(t),r=n.reject,i=Oc((function(){var i=xc(t.resolve);Ic(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var gl=dr,ml=d,vl=gn,yl=un.f,bl=p,wl=ml((function(){yl(1)}));gl({target:"Object",stat:!0,forced:!bl||wl,sham:!bl},{getOwnPropertyDescriptor:function(e,t){return yl(vl(e),t)}});var Tl=k,Sl=g,El=N,xl=function(e,t,n){var r=Tl(t);r in e?Sl.f(e,r,El(0,n)):e[r]=n},Al=d,kl=le,Il=xe("species"),Ml=function(e){return kl>=51||!Al((function(){var t=[];return(t.constructor={})[Il]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Pl=dr,Rl=Mn,Cl=Nt,Nl=Ot,jl=W,Dl=Ft,Ol=xl,Ll=Ml("splice"),Ul=Math.max,_l=Math.min,Kl=9007199254740991,Bl="Maximum allowed length exceeded";Pl({target:"Array",proto:!0,forced:!Ll},{splice:function(e,t){var n,r,i,o,a,s,u=jl(this),c=Nl(u.length),l=Rl(e,c),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=c-l):(n=f-2,r=_l(Ul(Cl(t),0),c-l)),c+n-r>Kl)throw TypeError(Bl);for(i=Dl(u,r),o=0;o<r;o++)(a=l+o)in u&&Ol(i,o,u[a]);if(i.length=r,n<r){for(o=l;o<c-r;o++)s=o+n,(a=o+r)in u?u[s]=u[a]:delete u[s];for(o=c;o>c-r+n;o--)delete u[o-1]}else if(n>r)for(o=c-r;o>l;o--)s=o+n-1,(a=o+r-1)in u?u[s]=u[a]:delete u[s];for(o=0;o<n;o++)u[o+l]=arguments[o+2];return u.length=c-r+n,i}});var Fl=Ie.exports,Vl=x,Hl=d,ql=gr,zl="toString",Gl=RegExp.prototype,Wl=Gl.toString,Xl=Hl((function(){return"/a/b"!=Wl.call({source:"a",flags:"b"})})),Yl=Wl.name!=zl;(Xl||Yl)&&Fl(RegExp.prototype,zl,(function(){var e=Vl(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Gl)?ql.call(e):n)}),{unsafe:!0});var $l={exports:{}},Jl=!d((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ql=Fe,Zl=m,ef=$,tf=g.f,nf=Jl,rf=Z("meta"),of=0,af=Object.isExtensible||function(){return!0},sf=function(e){tf(e,rf,{value:{objectID:"O"+ ++of,weakData:{}}})},uf=$l.exports={REQUIRED:!1,fastKey:function(e,t){if(!Zl(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!ef(e,rf)){if(!af(e))return"F";if(!t)return"E";sf(e)}return e[rf].objectID},getWeakData:function(e,t){if(!ef(e,rf)){if(!af(e))return!0;if(!t)return!1;sf(e)}return e[rf].weakData},onFreeze:function(e){return nf&&uf.REQUIRED&&af(e)&&!ef(e,rf)&&sf(e),e}};Ql[rf]=!0;var cf=dr,lf=m,ff=$l.exports.onFreeze,hf=Jl,df=d,pf=Object.seal;cf({target:"Object",stat:!0,forced:df((function(){pf(1)})),sham:!hf},{seal:function(e){return pf&&lf(e)?pf(ff(e)):e}});var gf=m,mf=Ca,vf=function(e,t,n){var r,i;return mf&&"function"==typeof(r=t.constructor)&&r!==n&&gf(i=r.prototype)&&i!==n.prototype&&mf(e,i),e},yf=dr,bf=f,wf=or,Tf=Ie.exports,Sf=$l.exports,Ef=Js,xf=js,Af=m,kf=d,If=ou,Mf=Mi,Pf=vf,Rf=function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=r?"set":"add",a=bf[e],s=a&&a.prototype,u=a,c={},l=function(e){var t=s[e];Tf(s,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!Af(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return i&&!Af(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!Af(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(wf(e,"function"!=typeof a||!(i||s.forEach&&!kf((function(){(new a).entries().next()})))))u=n.getConstructor(t,e,r,o),Sf.REQUIRED=!0;else if(wf(e,!0)){var f=new u,h=f[o](i?{}:-0,1)!=f,d=kf((function(){f.has(1)})),p=If((function(e){new a(e)})),g=!i&&kf((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));p||((u=t((function(t,n){xf(t,u,e);var i=Pf(new a,t,u);return null!=n&&Ef(n,i[o],{that:i,AS_ENTRIES:r}),i}))).prototype=s,s.constructor=u),(d||g)&&(l("delete"),l("has"),r&&l("get")),(g||h)&&l(o),i&&s.clear&&delete s.clear}return c[e]=u,yf({global:!0,forced:u!=a},c),Mf(u,e),i||n.setStrong(u,e,r),u},Cf=Is,Nf=$l.exports.getWeakData,jf=x,Df=m,Of=js,Lf=Js,Uf=$,_f=nt.set,Kf=nt.getterFor,Bf=Yt.find,Ff=Yt.findIndex,Vf=0,Hf=function(e){return e.frozen||(e.frozen=new qf)},qf=function(){this.entries=[]},zf=function(e,t){return Bf(e.entries,(function(e){return e[0]===t}))};qf.prototype={get:function(e){var t=zf(this,e);if(t)return t[1]},has:function(e){return!!zf(this,e)},set:function(e,t){var n=zf(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=Ff(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}};var Gf,Wf={getConstructor:function(e,t,n,r){var i=e((function(e,o){Of(e,i,t),_f(e,{type:t,id:Vf++,frozen:void 0}),null!=o&&Lf(o,e[r],{that:e,AS_ENTRIES:n})})),o=Kf(t),a=function(e,t,n){var r=o(e),i=Nf(jf(t),!0);return!0===i?Hf(r).set(t,n):i[r.id]=n,e};return Cf(i.prototype,{delete:function(e){var t=o(this);if(!Df(e))return!1;var n=Nf(e);return!0===n?Hf(t).delete(e):n&&Uf(n,t.id)&&delete n[t.id]},has:function(e){var t=o(this);if(!Df(e))return!1;var n=Nf(e);return!0===n?Hf(t).has(e):n&&Uf(n,t.id)}}),Cf(i.prototype,n?{get:function(e){var t=o(this);if(Df(e)){var n=Nf(e);return!0===n?Hf(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return a(this,e,t)}}:{add:function(e){return a(this,e,!0)}}),i}},Xf=f,Yf=Is,$f=$l.exports,Jf=Rf,Qf=Wf,Zf=m,eh=nt.enforce,th=Le,nh=!Xf.ActiveXObject&&"ActiveXObject"in Xf,rh=Object.isExtensible,ih=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},oh=Jf("WeakMap",ih,Qf);if(th&&nh){Gf=Qf.getConstructor(ih,"WeakMap",!0),$f.REQUIRED=!0;var ah=oh.prototype,sh=ah.delete,uh=ah.has,ch=ah.get,lh=ah.set;Yf(ah,{delete:function(e){if(Zf(e)&&!rh(e)){var t=eh(this);return t.frozen||(t.frozen=new Gf),sh.call(this,e)||t.frozen.delete(e)}return sh.call(this,e)},has:function(e){if(Zf(e)&&!rh(e)){var t=eh(this);return t.frozen||(t.frozen=new Gf),uh.call(this,e)||t.frozen.has(e)}return uh.call(this,e)},get:function(e){if(Zf(e)&&!rh(e)){var t=eh(this);return t.frozen||(t.frozen=new Gf),uh.call(this,e)?ch.call(this,e):t.frozen.get(e)}return ch.call(this,e)},set:function(e,t){if(Zf(e)&&!rh(e)){var n=eh(this);n.frozen||(n.frozen=new Gf),uh.call(this,e)?lh.call(this,e,t):n.frozen.set(e,t)}else lh.call(this,e,t);return this}})}var fh=g.f,hh=hi,dh=Is,ph=kt,gh=js,mh=Js,vh=Wa,yh=Ns,bh=p,wh=$l.exports.fastKey,Th=nt.set,Sh=nt.getterFor,Eh={getConstructor:function(e,t,n,r){var i=e((function(e,o){gh(e,i,t),Th(e,{type:t,index:hh(null),first:void 0,last:void 0,size:0}),bh||(e.size=0),null!=o&&mh(o,e[r],{that:e,AS_ENTRIES:n})})),o=Sh(t),a=function(e,t,n){var r,i,a=o(e),u=s(e,t);return u?u.value=n:(a.last=u={index:i=wh(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=u),r&&(r.next=u),bh?a.size++:e.size++,"F"!==i&&(a.index[i]=u)),e},s=function(e,t){var n,r=o(e),i=wh(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return dh(i.prototype,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,bh?e.size=0:this.size=0},delete:function(e){var t=this,n=o(t),r=s(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first==r&&(n.first=i),n.last==r&&(n.last=a),bh?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=o(this),r=ph(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),dh(i.prototype,n?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),bh&&fh(i.prototype,"size",{get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=Sh(t),o=Sh(r);vh(e,t,(function(e,t){Th(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),yh(t)}};Rf("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Eh);var xh=m,Ah=ht,kh=xe("match"),Ih=function(e){var t;return xh(e)&&(void 0!==(t=e[kh])?!!t:"RegExp"==Ah(e))},Mh=p,Ph=f,Rh=or,Ch=vf,Nh=g.f,jh=xn.f,Dh=Ih,Oh=gr,Lh=mr,Uh=Ie.exports,_h=d,Kh=nt.enforce,Bh=Ns,Fh=xe("match"),Vh=Ph.RegExp,Hh=Vh.prototype,qh=/a/g,zh=/a/g,Gh=new Vh(qh)!==qh,Wh=Lh.UNSUPPORTED_Y;if(Mh&&Rh("RegExp",!Gh||Wh||_h((function(){return zh[Fh]=!1,Vh(qh)!=qh||Vh(zh)==zh||"/a/i"!=Vh(qh,"i")})))){for(var Xh=function(e,t){var n,r=this instanceof Xh,i=Dh(e),o=void 0===t;if(!r&&i&&e.constructor===Xh&&o)return e;Gh?i&&!o&&(e=e.source):e instanceof Xh&&(o&&(t=Oh.call(e)),e=e.source),Wh&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var a=Ch(Gh?new Vh(e,t):Vh(e,t),r?this:Hh,Xh);Wh&&n&&(Kh(a).sticky=!0);return a},Yh=function(e){e in Xh||Nh(Xh,e,{configurable:!0,get:function(){return Vh[e]},set:function(t){Vh[e]=t}})},$h=jh(Vh),Jh=0;$h.length>Jh;)Yh($h[Jh++]);Hh.constructor=Xh,Xh.prototype=Hh,Uh(Ph,"RegExp",Xh)}Bh("RegExp");var Qh=p,Zh=mr.UNSUPPORTED_Y,ed=g.f,td=nt.get,nd=RegExp.prototype;Qh&&Zh&&ed(RegExp.prototype,"sticky",{configurable:!0,get:function(){if(this!==nd){if(this instanceof RegExp)return!!td(this).sticky;throw TypeError("Incompatible receiver, RegExp required")}}}),dr({target:"Object",stat:!0},{is:Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}});var rd=p,id=d,od=$r,ad=Vn,sd=cn,ud=W,cd=Pt,ld=Object.assign,fd=Object.defineProperty,hd=!ld||id((function(){if(rd&&1!==ld({b:1},ld(fd({},"a",{enumerable:!0,get:function(){fd(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=ld({},e)[n]||od(ld({},t)).join("")!=r}))?function(e,t){for(var n=ud(e),r=arguments.length,i=1,o=ad.f,a=sd.f;r>i;)for(var s,u=cd(arguments[i++]),c=o?od(u).concat(o(u)):od(u),l=c.length,f=0;l>f;)s=c[f++],rd&&!a.call(u,s)||(n[s]=u[s]);return n}:ld,dd=hd;dr({target:"Object",stat:!0,forced:Object.assign!==dd},{assign:dd});var pd=dr,gd=m,md=Ut,vd=Mn,yd=Ot,bd=gn,wd=xl,Td=xe,Sd=Ml("slice"),Ed=Td("species"),xd=[].slice,Ad=Math.max;pd({target:"Array",proto:!0,forced:!Sd},{slice:function(e,t){var n,r,i,o=bd(this),a=yd(o.length),s=vd(e,a),u=vd(void 0===t?a:t,a);if(md(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!md(n.prototype)?gd(n)&&null===(n=n[Ed])&&(n=void 0):n=void 0,n===Array||void 0===n))return xd.call(o,s,u);for(r=new(void 0===n?Array:n)(Ad(u-s,0)),i=0;s<u;s++,i++)s in o&&wd(r,i,o[s]);return r.length=i,r}});var kd=dr,Id=d,Md=ie("JSON","stringify"),Pd=/[\uD800-\uDFFF]/g,Rd=/^[\uD800-\uDBFF]$/,Cd=/^[\uDC00-\uDFFF]$/,Nd=function(e,t,n){var r=n.charAt(t-1),i=n.charAt(t+1);return Rd.test(e)&&!Cd.test(i)||Cd.test(e)&&!Rd.test(r)?"\\u"+e.charCodeAt(0).toString(16):e},jd=Id((function(){return'"\\udf06\\ud834"'!==Md("\udf06\ud834")||'"\\udead"'!==Md("\udead")}));Md&&kd({target:"JSON",stat:!0,forced:jd},{stringify:function(e,t,n){var r=Md.apply(null,arguments);return"string"==typeof r?r.replace(Pd,Nd):r}});var Dd=Ie.exports,Od=Rr,Ld=d,Ud=xe,_d=O,Kd=Ud("species"),Bd=RegExp.prototype,Fd=!Ld((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Vd="$0"==="a".replace(/./,"$0"),Hd=Ud("replace"),qd=!!/./[Hd]&&""===/./[Hd]("a","$0"),zd=!Ld((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Gd=function(e,t,n,r){var i=Ud(e),o=!Ld((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!Ld((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Kd]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||"replace"===e&&(!Fd||!Vd||qd)||"split"===e&&!zd){var s=/./[i],u=n(i,""[e],(function(e,t,n,r,i){var a=t.exec;return a===Od||a===Bd.exec?o&&!i?{done:!0,value:s.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Vd,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:qd}),c=u[0],l=u[1];Dd(String.prototype,e,c),Dd(Bd,i,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}r&&_d(Bd[i],"sham",!0)},Wd=as.charAt,Xd=function(e,t,n){return t+(n?Wd(e,t).length:1)},Yd=ht,$d=Rr,Jd=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Yd(e))throw TypeError("RegExp#exec called on incompatible receiver");return $d.call(e,t)},Qd=x,Zd=Ot,ep=z,tp=Xd,np=Jd;Gd("match",1,(function(e,t,n){return[function(t){var n=ep(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var i=Qd(e),o=String(this);if(!i.global)return np(i,o);var a=i.unicode;i.lastIndex=0;for(var s,u=[],c=0;null!==(s=np(i,o));){var l=String(s[0]);u[c]=l,""===l&&(i.lastIndex=tp(o,Zd(i.lastIndex),a)),c++}return 0===c?null:u}]}));var rp=W,ip=Math.floor,op="".replace,ap=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,sp=/\$([$&'`]|\d{1,2})/g,up=Gd,cp=x,lp=Ot,fp=Nt,hp=z,dp=Xd,pp=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,u=sp;return void 0!==i&&(i=rp(i),u=ap),op.call(o,u,(function(o,u){var c;switch(u.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(a);case"<":c=i[u.slice(1,-1)];break;default:var l=+u;if(0===l)return o;if(l>s){var f=ip(l/10);return 0===f?o:f<=s?void 0===r[f-1]?u.charAt(1):r[f-1]+u.charAt(1):o}c=r[l-1]}return void 0===c?"":c}))},gp=Jd,mp=Math.max,vp=Math.min;up("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,o=r.REPLACE_KEEPS_$0,a=i?"$":"$0";return[function(n,r){var i=hp(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&o||"string"==typeof r&&-1===r.indexOf(a)){var s=n(t,e,this,r);if(s.done)return s.value}var u=cp(e),c=String(this),l="function"==typeof r;l||(r=String(r));var f=u.global;if(f){var h=u.unicode;u.lastIndex=0}for(var d=[];;){var p=gp(u,c);if(null===p)break;if(d.push(p),!f)break;""===String(p[0])&&(u.lastIndex=dp(c,lp(u.lastIndex),h))}for(var g,m="",v=0,y=0;y<d.length;y++){p=d[y];for(var b=String(p[0]),w=mp(vp(fp(p.index),c.length),0),T=[],S=1;S<p.length;S++)T.push(void 0===(g=p[S])?g:String(g));var E=p.groups;if(l){var x=[b].concat(T,w,c);void 0!==E&&x.push(E);var A=String(r.apply(void 0,x))}else A=pp(b,c,w,T,E,r);w>=v&&(m+=c.slice(v,w)+A,v=w+b.length)}return m+c.slice(v)}]}));var yp=dr,bp=gn,wp=[].join,Tp=Pt!=Object,Sp=Jt("join",",");yp({target:"Array",proto:!0,forced:Tp||!Sp},{join:function(e){return wp.call(bp(this),void 0===e?",":e)}});var Ep="\t\n\v\f\r                 \u2028\u2029\ufeff",xp=z,Ap="[\t\n\v\f\r                 \u2028\u2029\ufeff]",kp=RegExp("^"+Ap+Ap+"*"),Ip=RegExp(Ap+Ap+"*$"),Mp=function(e){return function(t){var n=String(xp(t));return 1&e&&(n=n.replace(kp,"")),2&e&&(n=n.replace(Ip,"")),n}},Pp={start:Mp(1),end:Mp(2),trim:Mp(3)},Rp=p,Cp=f,Np=or,jp=Ie.exports,Dp=$,Op=ht,Lp=vf,Up=k,_p=d,Kp=hi,Bp=xn.f,Fp=un.f,Vp=g.f,Hp=Pp.trim,qp="Number",zp=Cp.Number,Gp=zp.prototype,Wp=Op(Kp(Gp))==qp,Xp=function(e){var t,n,r,i,o,a,s,u,c=Up(e,!1);if("string"==typeof c&&c.length>2)if(43===(t=(c=Hp(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(a=(o=c.slice(2)).length,s=0;s<a;s++)if((u=o.charCodeAt(s))<48||u>i)return NaN;return parseInt(o,r)}return+c};if(Np(qp,!zp(" 0o1")||!zp("0b1")||zp("+0x1"))){for(var Yp,$p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof $p&&(Wp?_p((function(){Gp.valueOf.call(n)})):Op(n)!=qp)?Lp(new zp(Xp(t)),n,$p):Xp(t)},Jp=Rp?Bp(zp):"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(","),Qp=0;Jp.length>Qp;Qp++)Dp(zp,Yp=Jp[Qp])&&!Dp($p,Yp)&&Vp($p,Yp,Fp(zp,Yp));$p.prototype=Gp,Gp.constructor=$p,jp(Cp,qp,$p)}var Zp=dr,eg=d,tg=Ut,ng=m,rg=W,ig=Ot,og=xl,ag=Ft,sg=Ml,ug=le,cg=xe("isConcatSpreadable"),lg=9007199254740991,fg="Maximum allowed index exceeded",hg=ug>=51||!eg((function(){var e=[];return e[cg]=!1,e.concat()[0]!==e})),dg=sg("concat"),pg=function(e){if(!ng(e))return!1;var t=e[cg];return void 0!==t?!!t:tg(e)};Zp({target:"Array",proto:!0,forced:!hg||!dg},{concat:function(e){var t,n,r,i,o,a=rg(this),s=ag(a,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(pg(o=-1===t?a:arguments[t])){if(u+(i=ig(o.length))>lg)throw TypeError(fg);for(n=0;n<i;n++,u++)n in o&&og(s,u,o[n])}else{if(u>=lg)throw TypeError(fg);og(s,u++,o)}return s.length=u,s}});var gg=Yt.map;dr({target:"Array",proto:!0,forced:!Ml("map")},{map:function(e){return gg(this,e,arguments.length>1?arguments[1]:void 0)}});var mg,vg={exports:{}},yg="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,bg=yg,wg=p,Tg=f,Sg=m,Eg=$,xg=vt,Ag=O,kg=Ie.exports,Ig=g.f,Mg=da,Pg=Ca,Rg=xe,Cg=Z,Ng=Tg.Int8Array,jg=Ng&&Ng.prototype,Dg=Tg.Uint8ClampedArray,Og=Dg&&Dg.prototype,Lg=Ng&&Mg(Ng),Ug=jg&&Mg(jg),_g=Object.prototype,Kg=_g.isPrototypeOf,Bg=Rg("toStringTag"),Fg=Cg("TYPED_ARRAY_TAG"),Vg=bg&&!!Pg&&"Opera"!==xg(Tg.opera),Hg=!1,qg={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},zg={BigInt64Array:8,BigUint64Array:8},Gg=function(e){if(!Sg(e))return!1;var t=xg(e);return Eg(qg,t)||Eg(zg,t)};for(mg in qg)Tg[mg]||(Vg=!1);if((!Vg||"function"!=typeof Lg||Lg===Function.prototype)&&(Lg=function(){throw TypeError("Incorrect invocation")},Vg))for(mg in qg)Tg[mg]&&Pg(Tg[mg],Lg);if((!Vg||!Ug||Ug===_g)&&(Ug=Lg.prototype,Vg))for(mg in qg)Tg[mg]&&Pg(Tg[mg].prototype,Ug);if(Vg&&Mg(Og)!==Ug&&Pg(Og,Ug),wg&&!Eg(Ug,Bg))for(mg in Hg=!0,Ig(Ug,Bg,{get:function(){return Sg(this)?this[Fg]:void 0}}),qg)Tg[mg]&&Ag(Tg[mg],Fg,mg);var Wg={NATIVE_ARRAY_BUFFER_VIEWS:Vg,TYPED_ARRAY_TAG:Hg&&Fg,aTypedArray:function(e){if(Gg(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Pg){if(Kg.call(Lg,e))return e}else for(var t in qg)if(Eg(qg,mg)){var n=Tg[t];if(n&&(e===n||Kg.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n){if(wg){if(n)for(var r in qg){var i=Tg[r];if(i&&Eg(i.prototype,e))try{delete i.prototype[e]}catch(Wx){}}Ug[e]&&!n||kg(Ug,e,n?t:Vg&&jg[e]||t)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(wg){if(Pg){if(n)for(r in qg)if((i=Tg[r])&&Eg(i,e))try{delete i[e]}catch(Wx){}if(Lg[e]&&!n)return;try{return kg(Lg,e,n?t:Vg&&Lg[e]||t)}catch(Wx){}}for(r in qg)!(i=Tg[r])||i[e]&&!n||kg(i,e,t)}},isView:function(e){if(!Sg(e))return!1;var t=xg(e);return"DataView"===t||Eg(qg,t)||Eg(zg,t)},isTypedArray:Gg,TypedArray:Lg,TypedArrayPrototype:Ug},Xg=f,Yg=d,$g=ou,Jg=Wg.NATIVE_ARRAY_BUFFER_VIEWS,Qg=Xg.ArrayBuffer,Zg=Xg.Int8Array,em=!Jg||!Yg((function(){Zg(1)}))||!Yg((function(){new Zg(-1)}))||!$g((function(e){new Zg,new Zg(null),new Zg(1.5),new Zg(e)}),!0)||Yg((function(){return 1!==new Zg(new Qg(2),1,void 0).length})),tm=Nt,nm=Ot,rm=function(e){if(void 0===e)return 0;var t=tm(e),n=nm(t);if(t!==n)throw RangeError("Wrong length or index");return n},im=Math.abs,om=Math.pow,am=Math.floor,sm=Math.log,um=Math.LN2,cm=W,lm=Mn,fm=Ot,hm=function(e){for(var t=cm(this),n=fm(t.length),r=arguments.length,i=lm(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:lm(o,n);a>i;)t[i++]=e;return t},dm=f,pm=p,gm=yg,mm=O,vm=Is,ym=d,bm=js,wm=Nt,Tm=Ot,Sm=rm,Em={pack:function(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,u=(1<<s)-1,c=u>>1,l=23===t?om(2,-24)-om(2,-77):0,f=e<0||0===e&&1/e<0?1:0,h=0;for((e=im(e))!=e||e===1/0?(i=e!=e?1:0,r=u):(r=am(sm(e)/um),e*(o=om(2,-r))<1&&(r--,o*=2),(e+=r+c>=1?l/o:l*om(2,1-c))*o>=2&&(r++,o/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(e*o-1)*om(2,t),r+=c):(i=e*om(2,c-1)*om(2,t),r=0));t>=8;a[h++]=255&i,i/=256,t-=8);for(r=r<<t|i,s+=t;s>0;a[h++]=255&r,r/=256,s-=8);return a[--h]|=128*f,a},unpack:function(e,t){var n,r=e.length,i=8*r-t-1,o=(1<<i)-1,a=o>>1,s=i-7,u=r-1,c=e[u--],l=127&c;for(c>>=7;s>0;l=256*l+e[u],u--,s-=8);for(n=l&(1<<-s)-1,l>>=-s,s+=t;s>0;n=256*n+e[u],u--,s-=8);if(0===l)l=1-a;else{if(l===o)return n?NaN:c?-1/0:1/0;n+=om(2,t),l-=a}return(c?-1:1)*n*om(2,l-t)}},xm=da,Am=Ca,km=xn.f,Im=g.f,Mm=hm,Pm=Mi,Rm=nt.get,Cm=nt.set,Nm="ArrayBuffer",jm="DataView",Dm="Wrong index",Om=dm.ArrayBuffer,Lm=Om,Um=dm.DataView,_m=Um&&Um.prototype,Km=Object.prototype,Bm=dm.RangeError,Fm=Em.pack,Vm=Em.unpack,Hm=function(e){return[255&e]},qm=function(e){return[255&e,e>>8&255]},zm=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Gm=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Wm=function(e){return Fm(e,23,4)},Xm=function(e){return Fm(e,52,8)},Ym=function(e,t){Im(e.prototype,t,{get:function(){return Rm(this)[t]}})},$m=function(e,t,n,r){var i=Sm(n),o=Rm(e);if(i+t>o.byteLength)throw Bm(Dm);var a=Rm(o.buffer).bytes,s=i+o.byteOffset,u=a.slice(s,s+t);return r?u:u.reverse()},Jm=function(e,t,n,r,i,o){var a=Sm(n),s=Rm(e);if(a+t>s.byteLength)throw Bm(Dm);for(var u=Rm(s.buffer).bytes,c=a+s.byteOffset,l=r(+i),f=0;f<t;f++)u[c+f]=l[o?f:t-f-1]};if(gm){if(!ym((function(){Om(1)}))||!ym((function(){new Om(-1)}))||ym((function(){return new Om,new Om(1.5),new Om(NaN),Om.name!=Nm}))){for(var Qm,Zm=(Lm=function(e){return bm(this,Lm),new Om(Sm(e))}).prototype=Om.prototype,ev=km(Om),tv=0;ev.length>tv;)(Qm=ev[tv++])in Lm||mm(Lm,Qm,Om[Qm]);Zm.constructor=Lm}Am&&xm(_m)!==Km&&Am(_m,Km);var nv=new Um(new Lm(2)),rv=_m.setInt8;nv.setInt8(0,2147483648),nv.setInt8(1,2147483649),!nv.getInt8(0)&&nv.getInt8(1)||vm(_m,{setInt8:function(e,t){rv.call(this,e,t<<24>>24)},setUint8:function(e,t){rv.call(this,e,t<<24>>24)}},{unsafe:!0})}else Lm=function(e){bm(this,Lm,Nm);var t=Sm(e);Cm(this,{bytes:Mm.call(new Array(t),0),byteLength:t}),pm||(this.byteLength=t)},Um=function(e,t,n){bm(this,Um,jm),bm(e,Lm,jm);var r=Rm(e).byteLength,i=wm(t);if(i<0||i>r)throw Bm("Wrong offset");if(i+(n=void 0===n?r-i:Tm(n))>r)throw Bm("Wrong length");Cm(this,{buffer:e,byteLength:n,byteOffset:i}),pm||(this.buffer=e,this.byteLength=n,this.byteOffset=i)},pm&&(Ym(Lm,"byteLength"),Ym(Um,"buffer"),Ym(Um,"byteLength"),Ym(Um,"byteOffset")),vm(Um.prototype,{getInt8:function(e){return $m(this,1,e)[0]<<24>>24},getUint8:function(e){return $m(this,1,e)[0]},getInt16:function(e){var t=$m(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=$m(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Gm($m(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Gm($m(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Vm($m(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Vm($m(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Jm(this,1,e,Hm,t)},setUint8:function(e,t){Jm(this,1,e,Hm,t)},setInt16:function(e,t){Jm(this,2,e,qm,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Jm(this,2,e,qm,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Jm(this,4,e,zm,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Jm(this,4,e,zm,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Jm(this,4,e,Wm,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Jm(this,8,e,Xm,t,arguments.length>2?arguments[2]:void 0)}});Pm(Lm,Nm),Pm(Um,jm);var iv={ArrayBuffer:Lm,DataView:Um},ov=Nt,av=function(e){var t=ov(e);if(t<0)throw RangeError("The argument can't be less than 0");return t},sv=function(e,t){var n=av(e);if(n%t)throw RangeError("Wrong offset");return n},uv=W,cv=Ot,lv=Fs,fv=Us,hv=kt,dv=Wg.aTypedArrayConstructor,pv=dr,gv=f,mv=p,vv=em,yv=Wg,bv=iv,wv=js,Tv=N,Sv=O,Ev=Ot,xv=rm,Av=sv,kv=k,Iv=$,Mv=vt,Pv=m,Rv=hi,Cv=Ca,Nv=xn.f,jv=function(e){var t,n,r,i,o,a,s=uv(e),u=arguments.length,c=u>1?arguments[1]:void 0,l=void 0!==c,f=lv(s);if(null!=f&&!fv(f))for(a=(o=f.call(s)).next,s=[];!(i=a.call(o)).done;)s.push(i.value);for(l&&u>2&&(c=hv(c,arguments[2],2)),n=cv(s.length),r=new(dv(this))(n),t=0;n>t;t++)r[t]=l?c(s[t],t):s[t];return r},Dv=Yt.forEach,Ov=Ns,Lv=g,Uv=un,_v=vf,Kv=nt.get,Bv=nt.set,Fv=Lv.f,Vv=Uv.f,Hv=Math.round,qv=gv.RangeError,zv=bv.ArrayBuffer,Gv=bv.DataView,Wv=yv.NATIVE_ARRAY_BUFFER_VIEWS,Xv=yv.TYPED_ARRAY_TAG,Yv=yv.TypedArray,$v=yv.TypedArrayPrototype,Jv=yv.aTypedArrayConstructor,Qv=yv.isTypedArray,Zv="BYTES_PER_ELEMENT",ey="Wrong length",ty=function(e,t){for(var n=0,r=t.length,i=new(Jv(e))(r);r>n;)i[n]=t[n++];return i},ny=function(e,t){Fv(e,t,{get:function(){return Kv(this)[t]}})},ry=function(e){var t;return e instanceof zv||"ArrayBuffer"==(t=Mv(e))||"SharedArrayBuffer"==t},iy=function(e,t){return Qv(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},oy=function(e,t){return iy(e,t=kv(t,!0))?Tv(2,e[t]):Vv(e,t)},ay=function(e,t,n){return!(iy(e,t=kv(t,!0))&&Pv(n)&&Iv(n,"value"))||Iv(n,"get")||Iv(n,"set")||n.configurable||Iv(n,"writable")&&!n.writable||Iv(n,"enumerable")&&!n.enumerable?Fv(e,t,n):(e[t]=n.value,e)};mv?(Wv||(Uv.f=oy,Lv.f=ay,ny($v,"buffer"),ny($v,"byteOffset"),ny($v,"byteLength"),ny($v,"length")),pv({target:"Object",stat:!0,forced:!Wv},{getOwnPropertyDescriptor:oy,defineProperty:ay}),vg.exports=function(e,t,n){var r=e.match(/\d+$/)[0]/8,i=e+(n?"Clamped":"")+"Array",o="get"+e,a="set"+e,s=gv[i],u=s,c=u&&u.prototype,l={},f=function(e,t){Fv(e,t,{get:function(){return function(e,t){var n=Kv(e);return n.view[o](t*r+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=Kv(e);n&&(i=(i=Hv(i))<0?0:i>255?255:255&i),o.view[a](t*r+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};Wv?vv&&(u=t((function(e,t,n,o){return wv(e,u,i),_v(Pv(t)?ry(t)?void 0!==o?new s(t,Av(n,r),o):void 0!==n?new s(t,Av(n,r)):new s(t):Qv(t)?ty(u,t):jv.call(u,t):new s(xv(t)),e,u)})),Cv&&Cv(u,Yv),Dv(Nv(s),(function(e){e in u||Sv(u,e,s[e])})),u.prototype=c):(u=t((function(e,t,n,o){wv(e,u,i);var a,s,c,l=0,h=0;if(Pv(t)){if(!ry(t))return Qv(t)?ty(u,t):jv.call(u,t);a=t,h=Av(n,r);var d=t.byteLength;if(void 0===o){if(d%r)throw qv(ey);if((s=d-h)<0)throw qv(ey)}else if((s=Ev(o)*r)+h>d)throw qv(ey);c=s/r}else c=xv(t),a=new zv(s=c*r);for(Bv(e,{buffer:a,byteOffset:h,byteLength:s,length:c,view:new Gv(a)});l<c;)f(e,l++)})),Cv&&Cv(u,Yv),c=u.prototype=Rv($v)),c.constructor!==u&&Sv(c,"constructor",u),Xv&&Sv(c,Xv,i),l[i]=u,pv({global:!0,forced:u!=s,sham:!Wv},l),Zv in u||Sv(u,Zv,r),Zv in c||Sv(c,Zv,r),Ov(i)}):vg.exports=function(){},(0,vg.exports)("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var sy=Ot,uy=Nt,cy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("at",(function(e){var t=cy(this),n=sy(t.length),r=uy(e),i=r>=0?r:n+r;return i<0||i>=n?void 0:t[i]}));var ly=W,fy=Mn,hy=Ot,dy=Math.min,py=[].copyWithin||function(e,t){var n=ly(this),r=hy(n.length),i=fy(e,r),o=fy(t,r),a=arguments.length>2?arguments[2]:void 0,s=dy((void 0===a?r:fy(a,r))-o,r-i),u=1;for(o<i&&i<o+s&&(u=-1,o+=s-1,i+=s-1);s-- >0;)o in n?n[i]=n[o]:delete n[i],i+=u,o+=u;return n},gy=py,my=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("copyWithin",(function(e,t){return gy.call(my(this),e,t,arguments.length>2?arguments[2]:void 0)}));var vy=Yt.every,yy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("every",(function(e){return vy(yy(this),e,arguments.length>1?arguments[1]:void 0)}));var by=hm,wy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("fill",(function(e){return by.apply(wy(this),arguments)}));var Ty=Wg.aTypedArrayConstructor,Sy=cu,Ey=Yt.filter,xy=function(e,t){for(var n=Sy(e,e.constructor),r=0,i=t.length,o=new(Ty(n))(i);i>r;)o[r]=t[r++];return o},Ay=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("filter",(function(e){var t=Ey(Ay(this),e,arguments.length>1?arguments[1]:void 0);return xy(this,t)}));var ky=Yt.find,Iy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("find",(function(e){return ky(Iy(this),e,arguments.length>1?arguments[1]:void 0)}));var My=Yt.findIndex,Py=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("findIndex",(function(e){return My(Py(this),e,arguments.length>1?arguments[1]:void 0)}));var Ry=kt,Cy=Pt,Ny=W,jy=Ot,Dy=function(e){var t=6==e;return function(n,r,i){for(var o,a=Ny(n),s=Cy(a),u=Ry(r,i,3),c=jy(s.length);c-- >0;)if(u(o=s[c],c,a))switch(e){case 5:return o;case 6:return c}return t?-1:void 0}},Oy={findLast:Dy(5),findLastIndex:Dy(6)},Ly=Oy.findLast,Uy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("findLast",(function(e){return Ly(Uy(this),e,arguments.length>1?arguments[1]:void 0)}));var _y=Oy.findLastIndex,Ky=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("findLastIndex",(function(e){return _y(Ky(this),e,arguments.length>1?arguments[1]:void 0)}));var By=Yt.forEach,Fy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("forEach",(function(e){By(Fy(this),e,arguments.length>1?arguments[1]:void 0)}));var Vy=jn.includes,Hy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("includes",(function(e){return Vy(Hy(this),e,arguments.length>1?arguments[1]:void 0)}));var qy=jn.indexOf,zy=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("indexOf",(function(e){return qy(zy(this),e,arguments.length>1?arguments[1]:void 0)}));var Gy=f,Wy=Wg,Xy=ns,Yy=xe("iterator"),$y=Gy.Uint8Array,Jy=Xy.values,Qy=Xy.keys,Zy=Xy.entries,eb=Wy.aTypedArray,tb=Wy.exportTypedArrayMethod,nb=$y&&$y.prototype[Yy],rb=!!nb&&("values"==nb.name||null==nb.name),ib=function(){return Jy.call(eb(this))};tb("entries",(function(){return Zy.call(eb(this))})),tb("keys",(function(){return Qy.call(eb(this))})),tb("values",ib,!rb),tb(Yy,ib,!rb);var ob=Wg.aTypedArray,ab=[].join;(0,Wg.exportTypedArrayMethod)("join",(function(e){return ab.apply(ob(this),arguments)}));var sb=gn,ub=Nt,cb=Ot,lb=Jt,fb=Math.min,hb=[].lastIndexOf,db=!!hb&&1/[1].lastIndexOf(1,-0)<0,pb=lb("lastIndexOf"),gb=db||!pb?function(e){if(db)return hb.apply(this,arguments)||0;var t=sb(this),n=cb(t.length),r=n-1;for(arguments.length>1&&(r=fb(r,ub(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:hb,mb=gb,vb=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("lastIndexOf",(function(e){return mb.apply(vb(this),arguments)}));var yb=Yt.map,bb=cu,wb=Wg.aTypedArray,Tb=Wg.aTypedArrayConstructor;(0,Wg.exportTypedArrayMethod)("map",(function(e){return yb(wb(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Tb(bb(e,e.constructor)))(t)}))}));var Sb=xt,Eb=W,xb=Pt,Ab=Ot,kb=function(e){return function(t,n,r,i){Sb(n);var o=Eb(t),a=xb(o),s=Ab(o.length),u=e?s-1:0,c=e?-1:1;if(r<2)for(;;){if(u in a){i=a[u],u+=c;break}if(u+=c,e?u<0:s<=u)throw TypeError("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=c)u in a&&(i=n(i,a[u],u,o));return i}},Ib={left:kb(!1),right:kb(!0)},Mb=Ib.left,Pb=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("reduce",(function(e){return Mb(Pb(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var Rb=Ib.right,Cb=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("reduceRight",(function(e){return Rb(Cb(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var Nb=Wg.aTypedArray,jb=Wg.exportTypedArrayMethod,Db=Math.floor;jb("reverse",(function(){for(var e,t=this,n=Nb(t).length,r=Db(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t}));var Ob=Ot,Lb=sv,Ub=W,_b=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("set",(function(e){_b(this);var t=Lb(arguments.length>1?arguments[1]:void 0,1),n=this.length,r=Ub(e),i=Ob(r.length),o=0;if(i+t>n)throw RangeError("Wrong length");for(;o<i;)this[t+o]=r[o++]}),d((function(){new Int8Array(1).set({})})));var Kb=cu,Bb=Wg.aTypedArray,Fb=Wg.aTypedArrayConstructor,Vb=[].slice;(0,Wg.exportTypedArrayMethod)("slice",(function(e,t){for(var n=Vb.call(Bb(this),e,t),r=Kb(this,this.constructor),i=0,o=n.length,a=new(Fb(r))(o);o>i;)a[i]=n[i++];return a}),d((function(){new Int8Array(1).slice()})));var Hb=Yt.some,qb=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("some",(function(e){return Hb(qb(this),e,arguments.length>1?arguments[1]:void 0)}));var zb=Wg.aTypedArray,Gb=[].sort;(0,Wg.exportTypedArrayMethod)("sort",(function(e){return Gb.call(zb(this),e)}));var Wb=Ot,Xb=Mn,Yb=cu,$b=Wg.aTypedArray;(0,Wg.exportTypedArrayMethod)("subarray",(function(e,t){var n=$b(this),r=n.length,i=Xb(e,r);return new(Yb(n,n.constructor))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,Wb((void 0===t?r:Xb(t,r))-i))}));var Jb=Wg,Qb=d,Zb=f.Int8Array,ew=Jb.aTypedArray,tw=Jb.exportTypedArrayMethod,nw=[].toLocaleString,rw=[].slice,iw=!!Zb&&Qb((function(){nw.call(new Zb(1))}));tw("toLocaleString",(function(){return nw.apply(iw?rw.call(ew(this)):ew(this),arguments)}),Qb((function(){return[1,2].toLocaleString()!=new Zb([1,2]).toLocaleString()}))||!Qb((function(){Zb.prototype.toLocaleString.call([1,2])})));var ow=Wg.exportTypedArrayMethod,aw=d,sw=f.Uint8Array,uw=sw&&sw.prototype||{},cw=[].toString,lw=[].join;aw((function(){cw.call({})}))&&(cw=function(){return lw.call(this)});var fw=uw.toString!=cw;ow("toString",cw,fw);var hw=Ns,dw="ArrayBuffer",pw=iv.ArrayBuffer;dr({global:!0,forced:f.ArrayBuffer!==pw},{ArrayBuffer:pw}),hw(dw),(0,vg.exports)("Uint16",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var gw=dr,mw=As,vw=d,yw=ie,bw=cu,ww=fc,Tw=Ie.exports;if(gw({target:"Promise",proto:!0,real:!0,forced:!!mw&&vw((function(){mw.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=bw(this,yw("Promise")),n="function"==typeof e;return this.then(n?function(n){return ww(t,e()).then((function(){return n}))}:e,n?function(n){return ww(t,e()).then((function(){throw n}))}:e)}}),"function"==typeof mw){var Sw=yw("Promise").prototype.finally;mw.prototype.finally!==Sw&&Tw(mw.prototype,"finally",Sw,{unsafe:!0})}var Ew=W,xw=$r;dr({target:"Object",stat:!0,forced:d((function(){xw(1)}))},{keys:function(e){return xw(Ew(e))}}),Rf("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Eh);var Aw=dr,kw=Yt.findIndex,Iw=oa,Mw="findIndex",Pw=!0;Mw in[]&&Array(1).findIndex((function(){Pw=!1})),Aw({target:"Array",proto:!0,forced:Pw},{findIndex:function(e){return kw(this,e,arguments.length>1?arguments[1]:void 0)}}),Iw(Mw);var Rw=Yt.filter;dr({target:"Array",proto:!0,forced:!Ml("filter")},{filter:function(e){return Rw(this,e,arguments.length>1?arguments[1]:void 0)}});var Cw=Gd,Nw=Ih,jw=x,Dw=z,Ow=cu,Lw=Xd,Uw=Ot,_w=Jd,Kw=Rr,Bw=mr.UNSUPPORTED_Y,Fw=[].push,Vw=Math.min,Hw=4294967295;Cw("split",2,(function(e,t,n){var r;return r="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,n){var r=String(Dw(this)),i=void 0===n?Hw:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!Nw(e))return t.call(r,e,i);for(var o,a,s,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,c+"g");(o=Kw.call(f,r))&&!((a=f.lastIndex)>l&&(u.push(r.slice(l,o.index)),o.length>1&&o.index<r.length&&Fw.apply(u,o.slice(1)),s=o[0].length,l=a,u.length>=i));)f.lastIndex===o.index&&f.lastIndex++;return l===r.length?!s&&f.test("")||u.push(""):u.push(r.slice(l)),u.length>i?u.slice(0,i):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=Dw(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var o=n(r,e,this,i,r!==t);if(o.done)return o.value;var a=jw(e),s=String(this),u=Ow(a,RegExp),c=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Bw?"g":"y"),f=new u(Bw?"^(?:"+a.source+")":a,l),h=void 0===i?Hw:i>>>0;if(0===h)return[];if(0===s.length)return null===_w(f,s)?[s]:[];for(var d=0,p=0,g=[];p<s.length;){f.lastIndex=Bw?0:p;var m,v=_w(f,Bw?s.slice(p):s);if(null===v||(m=Vw(Uw(f.lastIndex+(Bw?p:0)),s.length))===d)p=Lw(s,p,c);else{if(g.push(s.slice(d,p)),g.length===h)return g;for(var y=1;y<=v.length-1;y++)if(g.push(v[y]),g.length===h)return g;p=d=m}}return g.push(s.slice(d)),g}]}),Bw);var qw=dr,zw=Yt.find,Gw=oa,Ww="find",Xw=!0;Ww in[]&&Array(1).find((function(){Xw=!1})),qw({target:"Array",proto:!0,forced:Xw},{find:function(e){return zw(this,e,arguments.length>1?arguments[1]:void 0)}}),Gw(Ww);var Yw,$w=Ih,Jw=function(e){if($w(e))throw TypeError("The method doesn't accept regular expressions");return e},Qw=xe("match"),Zw=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Qw]=!1,"/./"[e](t)}catch(r){}}return!1},eT=dr,tT=un.f,nT=Ot,rT=Jw,iT=z,oT=Zw,aT="".startsWith,sT=Math.min,uT=oT("startsWith");eT({target:"String",proto:!0,forced:!!(uT||(Yw=tT(String.prototype,"startsWith"),!Yw||Yw.writable))&&!uT},{startsWith:function(e){var t=String(iT(this));rT(e);var n=nT(sT(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return aT?aT.call(t,r,n):t.slice(n,n+r.length)===r}});var cT=jn.includes,lT=oa;dr({target:"Array",proto:!0},{includes:function(e){return cT(this,e,arguments.length>1?arguments[1]:void 0)}}),lT("includes");var fT=Jw,hT=z;dr({target:"String",proto:!0,forced:!Zw("includes")},{includes:function(e){return!!~String(hT(this)).indexOf(fT(e),arguments.length>1?arguments[1]:void 0)}});var dT=x,pT=Hs,gT=kt,mT=W,vT=function(e,t,n,r){try{return r?t(dT(n)[0],n[1]):t(n)}catch(Wx){throw pT(e),Wx}},yT=Us,bT=Ot,wT=xl,TT=Fs,ST=function(e){var t,n,r,i,o,a,s=mT(e),u="function"==typeof this?this:Array,c=arguments.length,l=c>1?arguments[1]:void 0,f=void 0!==l,h=TT(s),d=0;if(f&&(l=gT(l,c>2?arguments[2]:void 0,2)),null==h||u==Array&&yT(h))for(n=new u(t=bT(s.length));t>d;d++)a=f?l(s[d],d):s[d],wT(n,d,a);else for(o=(i=h.call(s)).next,n=new u;!(r=o.call(i)).done;d++)a=f?vT(i,l,[r.value,d],!0):r.value,wT(n,d,a);return n.length=d,n},ET=ST;dr({target:"Array",stat:!0,forced:!ou((function(e){Array.from(e)}))},{from:ET});var xT=d,AT=Ep,kT=Pp.trim;dr({target:"String",proto:!0,forced:function(e){return xT((function(){return!!AT[e]()||"​…᠎"!="​…᠎"[e]()||AT[e].name!==e}))}("trim")},{trim:function(){return kT(this)}});var IT=d,MT=xe("iterator"),PT=!IT((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+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[MT]||"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"!==n||"x"!==new URL("http://x",void 0).host})),RT=2147483647,CT=/[^\0-\u007E]/,NT=/[.\u3002\uFF0E\uFF61]/g,jT="Overflow: input needs wider integers to process",DT=Math.floor,OT=String.fromCharCode,LT=function(e){return e+22+75*(e<26)},UT=function(e,t,n){var r=0;for(e=n?DT(e/700):e>>1,e+=DT(e/t);e>455;r+=36)e=DT(e/35);return DT(r+36*e/(e+38))},_T=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),n--)}else t.push(i)}return t}(e);var n,r,i=e.length,o=128,a=0,s=72;for(n=0;n<e.length;n++)(r=e[n])<128&&t.push(OT(r));var u=t.length,c=u;for(u&&t.push("-");c<i;){var l=RT;for(n=0;n<e.length;n++)(r=e[n])>=o&&r<l&&(l=r);var f=c+1;if(l-o>DT((RT-a)/f))throw RangeError(jT);for(a+=(l-o)*f,o=l,n=0;n<e.length;n++){if((r=e[n])<o&&++a>RT)throw RangeError(jT);if(r==o){for(var h=a,d=36;;d+=36){var p=d<=s?1:d>=s+26?26:d-s;if(h<p)break;var g=h-p,m=36-p;t.push(OT(LT(p+g%m))),h=DT(g/m)}t.push(OT(LT(h))),s=UT(a,f,c==u),a=0,++c}}++a,++o}return t.join("")},KT=x,BT=Fs,FT=dr,VT=ie,HT=PT,qT=Ie.exports,zT=Is,GT=Mi,WT=Ia,XT=nt,YT=js,$T=$,JT=kt,QT=vt,ZT=x,eS=m,tS=hi,nS=N,rS=function(e){var t=BT(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return KT(t.call(e))},iS=Fs,oS=xe,aS=VT("fetch"),sS=VT("Headers"),uS=oS("iterator"),cS="URLSearchParams",lS="URLSearchParamsIterator",fS=XT.set,hS=XT.getterFor(cS),dS=XT.getterFor(lS),pS=/\+/g,gS=Array(4),mS=function(e){return gS[e-1]||(gS[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},vS=function(e){try{return decodeURIComponent(e)}catch(Wx){return e}},yS=function(e){var t=e.replace(pS," "),n=4;try{return decodeURIComponent(t)}catch(Wx){for(;n;)t=t.replace(mS(n--),vS);return t}},bS=/[!'()~]|%20/g,wS={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},TS=function(e){return wS[e]},SS=function(e){return encodeURIComponent(e).replace(bS,TS)},ES=function(e,t){if(t)for(var n,r,i=t.split("&"),o=0;o<i.length;)(n=i[o++]).length&&(r=n.split("="),e.push({key:yS(r.shift()),value:yS(r.join("="))}))},xS=function(e){this.entries.length=0,ES(this.entries,e)},AS=function(e,t){if(e<t)throw TypeError("Not enough arguments")},kS=WT((function(e,t){fS(this,{type:lS,iterator:rS(hS(e).entries),kind:t})}),"Iterator",(function(){var e=dS(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),IS=function(){YT(this,IS,cS);var e,t,n,r,i,o,a,s,u,c=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(fS(l,{type:cS,entries:f,updateURL:function(){},updateSearchParams:xS}),void 0!==c)if(eS(c))if("function"==typeof(e=iS(c)))for(n=(t=e.call(c)).next;!(r=n.call(t)).done;){if((a=(o=(i=rS(ZT(r.value))).next).call(i)).done||(s=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");f.push({key:a.value+"",value:s.value+""})}else for(u in c)$T(c,u)&&f.push({key:u,value:c[u]+""});else ES(f,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},MS=IS.prototype;zT(MS,{append:function(e,t){AS(arguments.length,2);var n=hS(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){AS(arguments.length,1);for(var t=hS(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){AS(arguments.length,1);for(var t=hS(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){AS(arguments.length,1);for(var t=hS(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){AS(arguments.length,1);for(var t=hS(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){AS(arguments.length,1);for(var n,r=hS(this),i=r.entries,o=!1,a=e+"",s=t+"",u=0;u<i.length;u++)(n=i[u]).key===a&&(o?i.splice(u--,1):(o=!0,n.value=s));o||i.push({key:a,value:s}),r.updateURL()},sort:function(){var e,t,n,r=hS(this),i=r.entries,o=i.slice();for(i.length=0,n=0;n<o.length;n++){for(e=o[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=hS(this).entries,r=JT(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new kS(this,"keys")},values:function(){return new kS(this,"values")},entries:function(){return new kS(this,"entries")}},{enumerable:!0}),qT(MS,uS,MS.entries),qT(MS,"toString",(function(){for(var e,t=hS(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(SS(e.key)+"="+SS(e.value));return n.join("&")}),{enumerable:!0}),GT(IS,cS),FT({global:!0,forced:!HT},{URLSearchParams:IS}),HT||"function"!=typeof aS||"function"!=typeof sS||FT({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(eS(t=arguments[1])&&(n=t.body,QT(n)===cS&&((r=t.headers?new sS(t.headers):new sS).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=tS(t,{body:nS(0,String(n)),headers:nS(0,r)}))),i.push(t)),aS.apply(this,i)}});var PS,RS={URLSearchParams:IS,getState:hS},CS=dr,NS=p,jS=PT,DS=f,OS=ei,LS=Ie.exports,US=js,_S=$,KS=hd,BS=ST,FS=as.codeAt,VS=function(e){var t,n,r=[],i=e.toLowerCase().replace(NT,".").split(".");for(t=0;t<i.length;t++)n=i[t],r.push(CT.test(n)?"xn--"+_T(n):n);return r.join(".")},HS=Mi,qS=RS,zS=nt,GS=DS.URL,WS=qS.URLSearchParams,XS=qS.getState,YS=zS.set,$S=zS.getterFor("URL"),JS=Math.floor,QS=Math.pow,ZS="Invalid scheme",eE="Invalid host",tE="Invalid port",nE=/[A-Za-z]/,rE=/[\d+-.A-Za-z]/,iE=/\d/,oE=/^(0x|0X)/,aE=/^[0-7]+$/,sE=/^\d+$/,uE=/^[\dA-Fa-f]+$/,cE=/[\0\t\n\r #%/:?@[\\]]/,lE=/[\0\t\n\r #/:?@[\\]]/,fE=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,hE=/[\t\n\r]/g,dE=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return eE;if(!(n=gE(t.slice(1,-1))))return eE;e.host=n}else if(EE(e)){if(t=VS(t),cE.test(t))return eE;if(null===(n=pE(t)))return eE;e.host=n}else{if(lE.test(t))return eE;for(n="",r=BS(t),i=0;i<r.length;i++)n+=TE(r[i],vE);e.host=n}},pE=function(e){var t,n,r,i,o,a,s,u=e.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=u[r]))return e;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=oE.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else{if(!(10==o?sE:8==o?aE:uE).test(i))return e;a=parseInt(i,o)}n.push(a)}for(r=0;r<t;r++)if(a=n[r],r==t-1){if(a>=QS(256,5-t))return null}else if(a>255)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*QS(256,3-r);return s},gE=function(e){var t,n,r,i,o,a,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,f=0,h=function(){return e.charAt(f)};if(":"==h()){if(":"!=e.charAt(1))return;f+=2,l=++c}for(;h();){if(8==c)return;if(":"!=h()){for(t=n=0;n<4&&uE.test(h());)t=16*t+parseInt(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,c>6)return;for(r=0;h();){if(i=null,r>0){if(!("."==h()&&r<4))return;f++}if(!iE.test(h()))return;for(;iE.test(h());){if(o=parseInt(h(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;f++}u[c]=256*u[c]+i,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;u[c++]=t}else{if(null!==l)return;f++,l=++c}}if(null!==l)for(a=c-l,c=7;0!=c&&a>0;)s=u[c],u[c--]=u[l+a-1],u[l+--a]=s;else if(8!=c)return;return u},mE=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=JS(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},vE={},yE=KS({},vE,{" ":1,'"':1,"<":1,">":1,"`":1}),bE=KS({},yE,{"#":1,"?":1,"{":1,"}":1}),wE=KS({},bE,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),TE=function(e,t){var n=FS(e,0);return n>32&&n<127&&!_S(t,e)?e:encodeURIComponent(e)},SE={ftp:21,file:null,http:80,https:443,ws:80,wss:443},EE=function(e){return _S(SE,e.scheme)},xE=function(e){return""!=e.username||""!=e.password},AE=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},kE=function(e,t){var n;return 2==e.length&&nE.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},IE=function(e){var t;return e.length>1&&kE(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},ME=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&kE(t[0],!0)||t.pop()},PE=function(e){return"."===e||"%2e"===e.toLowerCase()},RE={},CE={},NE={},jE={},DE={},OE={},LE={},UE={},_E={},KE={},BE={},FE={},VE={},HE={},qE={},zE={},GE={},WE={},XE={},YE={},$E={},JE=function(e,t,n,r){var i,o,a,s,u,c=n||RE,l=0,f="",h=!1,d=!1,p=!1;for(n||(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(fE,"")),t=t.replace(hE,""),i=BS(t);l<=i.length;){switch(o=i[l],c){case RE:if(!o||!nE.test(o)){if(n)return ZS;c=NE;continue}f+=o.toLowerCase(),c=CE;break;case CE:if(o&&(rE.test(o)||"+"==o||"-"==o||"."==o))f+=o.toLowerCase();else{if(":"!=o){if(n)return ZS;f="",c=NE,l=0;continue}if(n&&(EE(e)!=_S(SE,f)||"file"==f&&(xE(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=f,n)return void(EE(e)&&SE[e.scheme]==e.port&&(e.port=null));f="","file"==e.scheme?c=HE:EE(e)&&r&&r.scheme==e.scheme?c=jE:EE(e)?c=UE:"/"==i[l+1]?(c=DE,l++):(e.cannotBeABaseURL=!0,e.path.push(""),c=XE)}break;case NE:if(!r||r.cannotBeABaseURL&&"#"!=o)return ZS;if(r.cannotBeABaseURL&&"#"==o){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,c=$E;break}c="file"==r.scheme?HE:OE;continue;case jE:if("/"!=o||"/"!=i[l+1]){c=OE;continue}c=_E,l++;break;case DE:if("/"==o){c=KE;break}c=WE;continue;case OE:if(e.scheme=r.scheme,o==PS)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==o||"\\"==o&&EE(e))c=LE;else if("?"==o)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",c=YE;else{if("#"!=o){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),c=WE;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",c=$E}break;case LE:if(!EE(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,c=WE;continue}c=KE}else c=_E;break;case UE:if(c=_E,"/"!=o||"/"!=f.charAt(l+1))continue;l++;break;case _E:if("/"!=o&&"\\"!=o){c=KE;continue}break;case KE:if("@"==o){h&&(f="%40"+f),h=!0,a=BS(f);for(var g=0;g<a.length;g++){var m=a[g];if(":"!=m||p){var v=TE(m,wE);p?e.password+=v:e.username+=v}else p=!0}f=""}else if(o==PS||"/"==o||"?"==o||"#"==o||"\\"==o&&EE(e)){if(h&&""==f)return"Invalid authority";l-=BS(f).length+1,f="",c=BE}else f+=o;break;case BE:case FE:if(n&&"file"==e.scheme){c=zE;continue}if(":"!=o||d){if(o==PS||"/"==o||"?"==o||"#"==o||"\\"==o&&EE(e)){if(EE(e)&&""==f)return eE;if(n&&""==f&&(xE(e)||null!==e.port))return;if(s=dE(e,f))return s;if(f="",c=GE,n)return;continue}"["==o?d=!0:"]"==o&&(d=!1),f+=o}else{if(""==f)return eE;if(s=dE(e,f))return s;if(f="",c=VE,n==FE)return}break;case VE:if(!iE.test(o)){if(o==PS||"/"==o||"?"==o||"#"==o||"\\"==o&&EE(e)||n){if(""!=f){var y=parseInt(f,10);if(y>65535)return tE;e.port=EE(e)&&y===SE[e.scheme]?null:y,f=""}if(n)return;c=GE;continue}return tE}f+=o;break;case HE:if(e.scheme="file","/"==o||"\\"==o)c=qE;else{if(!r||"file"!=r.scheme){c=WE;continue}if(o==PS)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==o)e.host=r.host,e.path=r.path.slice(),e.query="",c=YE;else{if("#"!=o){IE(i.slice(l).join(""))||(e.host=r.host,e.path=r.path.slice(),ME(e)),c=WE;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",c=$E}}break;case qE:if("/"==o||"\\"==o){c=zE;break}r&&"file"==r.scheme&&!IE(i.slice(l).join(""))&&(kE(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),c=WE;continue;case zE:if(o==PS||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&kE(f))c=WE;else if(""==f){if(e.host="",n)return;c=GE}else{if(s=dE(e,f))return s;if("localhost"==e.host&&(e.host=""),n)return;f="",c=GE}continue}f+=o;break;case GE:if(EE(e)){if(c=WE,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o)if(n||"#"!=o){if(o!=PS&&(c=WE,"/"!=o))continue}else e.fragment="",c=$E;else e.query="",c=YE;break;case WE:if(o==PS||"/"==o||"\\"==o&&EE(e)||!n&&("?"==o||"#"==o)){if(".."===(u=(u=f).toLowerCase())||"%2e."===u||".%2e"===u||"%2e%2e"===u?(ME(e),"/"==o||"\\"==o&&EE(e)||e.path.push("")):PE(f)?"/"==o||"\\"==o&&EE(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&kE(f)&&(e.host&&(e.host=""),f=f.charAt(0)+":"),e.path.push(f)),f="","file"==e.scheme&&(o==PS||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",c=YE):"#"==o&&(e.fragment="",c=$E)}else f+=TE(o,bE);break;case XE:"?"==o?(e.query="",c=YE):"#"==o?(e.fragment="",c=$E):o!=PS&&(e.path[0]+=TE(o,vE));break;case YE:n||"#"!=o?o!=PS&&("'"==o&&EE(e)?e.query+="%27":e.query+="#"==o?"%23":TE(o,vE)):(e.fragment="",c=$E);break;case $E:o!=PS&&(e.fragment+=TE(o,yE))}l++}},QE=function(e){var t,n,r=US(this,QE,"URL"),i=arguments.length>1?arguments[1]:void 0,o=String(e),a=YS(r,{type:"URL"});if(void 0!==i)if(i instanceof QE)t=$S(i);else if(n=JE(t={},String(i)))throw TypeError(n);if(n=JE(a,o,null,t))throw TypeError(n);var s=a.searchParams=new WS,u=XS(s);u.updateSearchParams(a.query),u.updateURL=function(){a.query=String(s)||null},NS||(r.href=ex.call(r),r.origin=tx.call(r),r.protocol=nx.call(r),r.username=rx.call(r),r.password=ix.call(r),r.host=ox.call(r),r.hostname=ax.call(r),r.port=sx.call(r),r.pathname=ux.call(r),r.search=cx.call(r),r.searchParams=lx.call(r),r.hash=fx.call(r))},ZE=QE.prototype,ex=function(){var e=$S(this),t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,a=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",xE(e)&&(c+=n+(r?":"+r:"")+"@"),c+=mE(i),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},tx=function(){var e=$S(this),t=e.scheme,n=e.port;if("blob"==t)try{return new QE(t.path[0]).origin}catch(Wx){return"null"}return"file"!=t&&EE(e)?t+"://"+mE(e.host)+(null!==n?":"+n:""):"null"},nx=function(){return $S(this).scheme+":"},rx=function(){return $S(this).username},ix=function(){return $S(this).password},ox=function(){var e=$S(this),t=e.host,n=e.port;return null===t?"":null===n?mE(t):mE(t)+":"+n},ax=function(){var e=$S(this).host;return null===e?"":mE(e)},sx=function(){var e=$S(this).port;return null===e?"":String(e)},ux=function(){var e=$S(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},cx=function(){var e=$S(this).query;return e?"?"+e:""},lx=function(){return $S(this).searchParams},fx=function(){var e=$S(this).fragment;return e?"#"+e:""},hx=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(NS&&OS(ZE,{href:hx(ex,(function(e){var t=$S(this),n=String(e),r=JE(t,n);if(r)throw TypeError(r);XS(t.searchParams).updateSearchParams(t.query)})),origin:hx(tx),protocol:hx(nx,(function(e){var t=$S(this);JE(t,String(e)+":",RE)})),username:hx(rx,(function(e){var t=$S(this),n=BS(String(e));if(!AE(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=TE(n[r],wE)}})),password:hx(ix,(function(e){var t=$S(this),n=BS(String(e));if(!AE(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=TE(n[r],wE)}})),host:hx(ox,(function(e){var t=$S(this);t.cannotBeABaseURL||JE(t,String(e),BE)})),hostname:hx(ax,(function(e){var t=$S(this);t.cannotBeABaseURL||JE(t,String(e),FE)})),port:hx(sx,(function(e){var t=$S(this);AE(t)||(""==(e=String(e))?t.port=null:JE(t,e,VE))})),pathname:hx(ux,(function(e){var t=$S(this);t.cannotBeABaseURL||(t.path=[],JE(t,e+"",GE))})),search:hx(cx,(function(e){var t=$S(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",JE(t,e,YE)),XS(t.searchParams).updateSearchParams(t.query)})),searchParams:hx(lx),hash:hx(fx,(function(e){var t=$S(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",JE(t,e,$E)):t.fragment=null}))}),LS(ZE,"toJSON",(function(){return ex.call(this)}),{enumerable:!0}),LS(ZE,"toString",(function(){return ex.call(this)}),{enumerable:!0}),GS){var dx=GS.createObjectURL,px=GS.revokeObjectURL;dx&&LS(QE,"createObjectURL",(function(e){return dx.apply(GS,arguments)})),px&&LS(QE,"revokeObjectURL",(function(e){return px.apply(GS,arguments)}))}HS(QE,"URL"),CS({global:!0,forced:!jS,sham:!NS},{URL:QE});var gx=p,mx=g.f,vx=Function.prototype,yx=vx.toString,bx=/^\s*function ([^ (]*)/,wx="name";gx&&!(wx in vx)&&mx(vx,wx,{configurable:!0,get:function(){try{return yx.call(this).match(bx)[1]}catch(Wx){return""}}});var Tx=ht,Sx=Nt,Ex=z,xx=dr,Ax=Nt,kx=function(e){if("number"!=typeof e&&"Number"!=Tx(e))throw TypeError("Incorrect invocation");return+e},Ix=function(e){var t=String(Ex(this)),n="",r=Sx(e);if(r<0||r==1/0)throw RangeError("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},Mx=d,Px=1..toFixed,Rx=Math.floor,Cx=function(e,t,n){return 0===t?n:t%2==1?Cx(e,t-1,n*e):Cx(e*e,t/2,n)},Nx=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=Rx(i/1e7)},jx=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=Rx(r/t),r=r%t*1e7},Dx=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=String(e[t]);n=""===n?r:n+Ix.call("0",7-r.length)+r}return n};xx({target:"Number",proto:!0,forced:Px&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!Mx((function(){Px.call({})}))},{toFixed:function(e){var t,n,r,i,o=kx(this),a=Ax(e),s=[0,0,0,0,0,0],u="",c="0";if(a<0||a>20)throw RangeError("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return String(o);if(o<0&&(u="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*Cx(2,69,1))-69)<0?o*Cx(2,-t,1):o/Cx(2,t,1),n*=4503599627370496,(t=52-t)>0){for(Nx(s,0,n),r=a;r>=7;)Nx(s,1e7,0),r-=7;for(Nx(s,Cx(10,r,1),0),r=t-1;r>=23;)jx(s,1<<23),r-=23;jx(s,1<<r),Nx(s,1,1),jx(s,2),c=Dx(s)}else Nx(s,0,n),Nx(s,1<<-t,0),c=Dx(s)+Ix.call("0",a);return c=a>0?u+((i=c.length)<=a?"0."+Ix.call("0",a-i)+c:c.slice(0,i-a)+"."+c.slice(i-a)):u+c}});var Ox=dr,Lx=d,Ux=di.f;Ox({target:"Object",stat:!0,forced:Lx((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:Ux});var _x=W,Kx=da,Bx=sa;dr({target:"Object",stat:!0,forced:d((function(){Kx(1)})),sham:!Bx},{getPrototypeOf:function(e){return Kx(_x(e))}});var Fx=p,Vx=g,Hx=gr,qx=mr.UNSUPPORTED_Y;Fx&&("g"!=/./g.flags||qx)&&Vx.f(RegExp.prototype,"flags",{configurable:!0,get:Hx});var zx,Gx={};return zx=Gx,function(){var e="undefined"!=typeof window?window:c,n={};for(var r in function(e,n,r){var i,o="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},a=void 0!==e&&e===this?this:void 0!==n&&null!=n?n:this;function s(){s=function(){},a.Symbol||(a.Symbol=c)}var u,c=(u=0,function(e){return"jscomp_symbol_"+(e||"")+u++});function l(){s();var e=a.Symbol.iterator;e||(e=a.Symbol.iterator=a.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&o(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return f(this)}}),l=function(){}}function f(e){var t=0;return h((function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}))}function h(e){return l(),(e={next:e})[a.Symbol.iterator]=function(){return this},e}function d(e){l();var t=e[Symbol.iterator];return t?t.call(e):f(e)}function p(e,t){if(t){for(var n=a,r=e.split("."),i=0;i<r.length-1;i++){var s=r[i];s in n||(n[s]={}),n=n[s]}(s=t(i=n[r=r[r.length-1]]))!=i&&null!=s&&o(n,r,{configurable:!0,writable:!0,value:s})}}function g(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,i){!function e(o){o.done?r(o.value):Promise.resolve(o.value).then(t,n).then(e,i)}(e.next())}))}(e())}p("Promise",(function(e){function n(e){this.h=0,this.l=void 0,this.g=[];var t=this.i();try{e(t.resolve,t.reject)}catch(n){t.reject(n)}}function r(){this.g=null}function i(e){return e instanceof n?e:new n((function(t){t(e)}))}if(e)return e;r.prototype.h=function(e){null==this.g&&(this.g=[],this.j()),this.g.push(e)},r.prototype.j=function(){var e=this;this.i((function(){e.m()}))};var o=a.setTimeout;r.prototype.i=function(e){o(e,0)},r.prototype.m=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(r){this.l(r)}}}this.g=null},r.prototype.l=function(e){this.i((function(){throw e}))},n.prototype.i=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.j)}},n.prototype.C=function(e){if(e===this)this.j(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof n)this.F(e);else{e:switch(t(e)){case"object":var r=null!=e;break e;case"function":r=!0;break e;default:r=!1}r?this.A(e):this.m(e)}},n.prototype.A=function(e){var t=void 0;try{t=e.then}catch(n){return void this.j(n)}"function"==typeof t?this.J(t,e):this.m(e)},n.prototype.j=function(e){this.o(2,e)},n.prototype.m=function(e){this.o(1,e)},n.prototype.o=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.l=t,this.u()},n.prototype.u=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new r;return n.prototype.F=function(e){var t=this.i();e.nc(t.resolve,t.reject)},n.prototype.J=function(e,t){var n=this.i();try{e.call(t,n.resolve,n.reject)}catch(r){n.reject(r)}},n.prototype.then=function(e,t){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(n){o(n)}}:t}var i,o,a=new n((function(e,t){i=e,o=t}));return this.nc(r(e,i),r(t,o)),a},n.prototype.catch=function(e){return this.then(void 0,e)},n.prototype.nc=function(e,t){function n(){switch(r.h){case 1:e(r.l);break;case 2:t(r.l);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n)},n.resolve=i,n.reject=function(e){return new n((function(t,n){n(e)}))},n.race=function(e){return new n((function(t,n){for(var r=d(e),o=r.next();!o.done;o=r.next())i(o.value).nc(t,n)}))},n.all=function(e){var t=d(e),r=t.next();return r.done?i([]):new n((function(e,n){function o(t){return function(n){a[t]=n,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,i(r.value).nc(o(a.length-1),n),r=t.next()}while(!r.done)}))},n})),p("Promise.prototype.finally",(function(e){return e||function(e){return this.then((function(t){return Promise.resolve(e()).then((function(){return t}))}),(function(t){return Promise.resolve(e()).then((function(){throw t}))}))}}));var m,v="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)m=Object.setPrototypeOf;else{var y;e:{var b={};try{b.__proto__={a:!0},y=b.a;break e}catch(u){}y=!1}m=y?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var w=m;function T(e,t){if(e.prototype=v(t.prototype),e.prototype.constructor=e,w)w(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.Lg=t.prototype}function S(){this.l=!1,this.i=null,this.B=void 0,this.s=1,this.h=this.j=0,this.o=this.g=null}function E(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function x(e,t){e.g={ce:t,ne:!0},e.s=e.j||e.h}function A(e,t,n){return e.s=n,{value:t}}function k(e){e.s=0}function I(e,t,n){e.j=t,null!=n&&(e.h=n)}function M(e,t){e.j=0,e.h=t||0}function P(e,t){e.s=t,e.j=0}function R(e){e.j=0;var t=e.g.ce;return e.g=null,t}function C(e){e.o=[e.g],e.j=0,e.h=0}function N(e,t){var n=e.o.splice(0)[0];(n=e.g=e.g||n)?n.ne?e.s=e.j||e.h:null!=n.I&&e.h<n.I?(e.s=n.I,e.g=null):e.s=e.h:e.s=t}function j(e){this.g=new S,this.h=e}function D(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(a){return e.g.i=null,x(e.g,a),O(e)}return e.g.i=null,r.call(e.g,o),O(e)}function O(e){for(;e.g.s;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(n){e.g.B=void 0,x(e.g,n)}if(e.g.l=!1,e.g.g){if(t=e.g.g,e.g.g=null,t.ne)throw t.ce;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function L(e){this.next=function(t){return E(e.g),e.g.i?t=D(e,e.g.i.next,t,e.g.m):(e.g.m(t),t=O(e)),t},this.throw=function(t){return E(e.g),e.g.i?t=D(e,e.g.i.throw,t,e.g.m):(x(e.g,t),t=O(e)),t},this.return=function(t){return function(e,t){E(e.g);var n=e.g.i;return n?D(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),O(e))}(e,t)},l(),this[Symbol.iterator]=function(){return this}}function U(e,t){return L.prototype=e.prototype,new L(new j(t))}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function K(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,i=0;i<r;i++){var o=e[i];if(t.call(n,o,i,e))return{le:i,Qe:o}}return{le:-1,Qe:void 0}}function B(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""}S.prototype.m=function(e){this.B=e},S.prototype.return=function(e){this.g={return:e},this.s=this.h},S.prototype.I=function(e){this.s=e},p("Array.prototype.keys",(function(e){return e||function(){return function(e,t){l(),e instanceof String&&(e+="");var n=0,r={next:function(){if(n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r.next=function(){return{done:!0,value:void 0}},r.next()}};return r[Symbol.iterator]=function(){return r},r}(this,(function(e){return e}))}})),p("WeakMap",(function(e){function t(e){if(this.g=(a+=Math.random()+1).toString(),e){s(),l(),e=d(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function n(e){_(e,i)||o(e,i,{value:{}})}function r(e){var t=Object[e];t&&(Object[e]=function(e){return n(e),t(e)})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),r=new e([[t,2],[n,3]]);return 2==r.get(t)&&3==r.get(n)&&(r.delete(t),r.set(n,4),!r.has(t)&&4==r.get(n))}catch(i){return!1}}())return e;var i="$jscomp_hidden_"+Math.random();r("freeze"),r("preventExtensions"),r("seal");var a=0;return t.prototype.set=function(e,t){if(n(e),!_(e,i))throw Error("WeakMap key fail: "+e);return e[i][this.g]=t,this},t.prototype.get=function(e){return _(e,i)?e[i][this.g]:void 0},t.prototype.has=function(e){return _(e,i)&&_(e[i],this.g)},t.prototype.delete=function(e){return!(!_(e,i)||!_(e[i],this.g))&&delete e[i][this.g]},t})),p("Map",(function(e){function n(){var e={};return e.Na=e.next=e.head=e}function r(e,t){var n=e.g;return h((function(){if(n){for(;n.head!=e.g;)n=n.Na;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}}))}function i(e,n){var r=n&&t(n);"object"==r||"function"==r?a.has(n)?r=a.get(n):(r=""+ ++u,a.set(n,r)):r="p_"+n;var i=e.h[r];if(i&&_(e.h,r))for(var o=0;o<i.length;o++){var s=i[o];if(n!=n&&s.key!=s.key||n===s.key)return{id:r,list:i,index:o,ga:s}}return{id:r,list:i,index:-1,ga:void 0}}function o(e){if(this.h={},this.g=n(),this.size=0,e){e=d(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}if(function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(d([[t,"s"]]));if("s"!=n.get(t)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var r=n.entries(),i=r.next();return!i.done&&i.value[0]==t&&"s"==i.value[1]&&!((i=r.next()).done||4!=i.value[0].x||"t"!=i.value[1]||!r.next().done)}catch(o){return!1}}())return e;s(),l();var a=new WeakMap;o.prototype.set=function(e,t){var n=i(this,e);return n.list||(n.list=this.h[n.id]=[]),n.ga?n.ga.value=t:(n.ga={next:this.g,Na:this.g.Na,head:this.g,key:e,value:t},n.list.push(n.ga),this.g.Na.next=n.ga,this.g.Na=n.ga,this.size++),this},o.prototype.delete=function(e){return!(!(e=i(this,e)).ga||!e.list||(e.list.splice(e.index,1),e.list.length||delete this.h[e.id],e.ga.Na.next=e.ga.next,e.ga.next.Na=e.ga.Na,e.ga.head=null,this.size--,0))},o.prototype.clear=function(){this.h={},this.g=this.g.Na=n(),this.size=0},o.prototype.has=function(e){return!!i(this,e).ga},o.prototype.get=function(e){return(e=i(this,e).ga)&&e.value},o.prototype.entries=function(){return r(this,(function(e){return[e.key,e.value]}))},o.prototype.keys=function(){return r(this,(function(e){return e.key}))},o.prototype.values=function(){return r(this,(function(e){return e.value}))},o.prototype.forEach=function(e,t){for(var n,r=this.entries();!(n=r.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},o.prototype[Symbol.iterator]=o.prototype.entries;var u=0;return o})),p("Set",(function(e){function t(e){if(this.g=new Map,e){e=d(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.g.size}return function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(d([t]));if(!n.has(t)||1!=n.size||n.add(t)!=n||1!=n.size||n.add({x:4})!=n||2!=n.size)return!1;var r=n.entries(),i=r.next();return!i.done&&i.value[0]==t&&i.value[1]==t&&!(i=r.next()).done&&i.value[0]!=t&&4==i.value[0].x&&i.value[1]==i.value[0]&&r.next().done}catch(o){return!1}}()?e:(s(),l(),t.prototype.add=function(e){return this.g.set(e,e),this.size=this.g.size,this},t.prototype.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.prototype.clear=function(){this.g.clear(),this.size=0},t.prototype.has=function(e){return this.g.has(e)},t.prototype.entries=function(){return this.g.entries()},t.prototype.values=function(){return this.g.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var n=this;this.g.forEach((function(r){return e.call(t,r,r,n)}))},t)})),p("Array.prototype.findIndex",(function(e){return e||function(e,t){return K(this,e,t).le}})),p("Array.prototype.find",(function(e){return e||function(e,t){return K(this,e,t).Qe}})),p("String.prototype.startsWith",(function(e){return e||function(e,t){for(var n=B(this,e,"startsWith"),r=n.length,i=e.length,o=Math.max(0,Math.min(0|t,n.length)),a=0;a<i&&o<r;)if(n[o++]!=e[a++])return!1;return a>=i}})),p("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),p("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length,i=t||0;for(0>i&&(i=Math.max(i+r,0));i<r;i++){var o=n[i];if(o===e||Object.is(o,e))return!0}return!1}})),p("String.prototype.includes",(function(e){return e||function(e,t){return-1!==B(this,e,"includes").indexOf(e,t||0)}})),p("Array.from",(function(e){return e||function(e,t,n){l(),t=null!=t?t:function(e){return e};var r=[],i=e[Symbol.iterator];if("function"==typeof i)for(e=i.call(e);!(i=e.next()).done;)r.push(t.call(n,i.value));else{i=e.length;for(var o=0;o<i;o++)r.push(t.call(n,e[o]))}return r}}));var F="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)_(r,i)&&(e[i]=r[i])}return e};p("Object.assign",(function(e){return e||F}));var V=this;function H(e,t){var n,r=e.split("."),i=V;r[0]in i||!i.execScript||i.execScript("var "+r[0]);for(;r.length&&(n=r.shift());)r.length||void 0===t?i=i[n]?i[n]:i[n]={}:i[n]=t}function q(e,t){function n(){}n.prototype=t.prototype,e.Lg=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Wg=function(e,n,r){return t.prototype[n].apply(e,Array.prototype.slice.call(arguments,2))}}function z(e){this.i=Math.exp(Math.log(.5)/e),this.h=this.g=0}function G(e,t,n){var r=Math.pow(e.i,t);n=n*(1-r)+r*e.g,isNaN(n)||(e.g=n,e.h+=t)}function W(e){return e.g/(1-Math.pow(e.i,e.h))}function X(){this.h=new z(2),this.i=new z(5),this.g=0}V.g=!0,X.prototype.getBandwidthEstimate=function(e){return 128e3>this.g?e:Math.min(W(this.h),W(this.i))};var Y={sb:0,kc:function(){},ba:function(){},error:function(){},v:function(){},info:function(){},debug:function(){},K:function(){},O:function(){}};function $(e,t,n,r){for(var i=[],o=3;o<arguments.length;++o)i[o-3]=arguments[o];this.severity=e,this.category=t,this.code=n,this.data=i,this.handled=!1}e.console&&e.console.log.bind&&(Y.ba=console.warn.bind(console),Y.kc=console.error.bind(console),1<=Y.sb&&(Y.error=console.error.bind(console)),2<=Y.sb&&(Y.v=console.warn.bind(console)),3<=Y.sb&&(Y.info=console.info.bind(console)),4<=Y.sb&&(Y.debug=console.log.bind(console)),5<=Y.sb&&(Y.K=console.debug.bind(console)),6<=Y.sb&&(Y.O=console.debug.bind(console))),H("shaka.util.Error",$),$.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")},$.Severity={RECOVERABLE:1,CRITICAL:2},$.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},$.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,HLS_AES_128_ENCRYPTION_NOT_SUPPORTED:4034,HLS_INTERNAL_SKIP_STREAM:4035,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013};var J=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function Q(e){var t;e instanceof Q?(Z(this,e.Ba),this.pb=e.pb,this.Aa=e.Aa,ee(this,e.Ob),this.pa=e.pa,te(this,e.g.clone()),this.bb=e.bb):e&&(t=String(e).match(J))?(Z(this,t[1]||"",!0),this.pb=ne(t[2]||""),this.Aa=ne(t[3]||"",!0),ee(this,t[4]),this.pa=ne(t[5]||"",!0),te(this,t[6]||"",!0),this.bb=ne(t[7]||"")):this.g=new le(null)}function Z(e,t,n){e.Ba=n?ne(t,!0):t,e.Ba&&(e.Ba=e.Ba.replace(/:$/,""))}function ee(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Ob=t}else e.Ob=null}function te(e,t,n){t instanceof le?e.g=t:(n||(t=re(t,ue)),e.g=new le(t))}function ne(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function re(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,ie),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function ie(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=Q.prototype).Ba="",i.pb="",i.Aa="",i.Ob=null,i.pa="",i.bb="",i.toString=function(){var e=[],t=this.Ba;if(t&&e.push(re(t,oe,!0),":"),t=this.Aa){e.push("//");var n=this.pb;n&&e.push(re(n,oe,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Ob)&&e.push(":",String(t))}return(t=this.pa)&&(this.Aa&&"/"!=t.charAt(0)&&e.push("/"),e.push(re(t,"/"==t.charAt(0)?se:ae,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.bb)&&e.push("#",re(t,ce)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.Ba&&(t=new Q);var n=!!e.Ba;n?Z(t,e.Ba):n=!!e.pb,n?t.pb=e.pb:n=!!e.Aa,n?t.Aa=e.Aa:n=null!=e.Ob;var r=e.pa;if(n)ee(t,e.Ob);else if(n=!!e.pa){if("/"!=r.charAt(0))if(this.Aa&&!this.pa)r="/"+r;else{var i=t.pa.lastIndexOf("/");-1!=i&&(r=t.pa.substr(0,i+1)+r)}if(".."==r||"."==r)r="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){i=0==r.lastIndexOf("/",0),r=r.split("/");for(var o=[],a=0;a<r.length;){var s=r[a++];"."==s?i&&a==r.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),i&&a==r.length&&o.push("")):(o.push(s),i=!0)}r=o.join("/")}}return n?t.pa=r:n=""!==e.g.toString(),n?te(t,e.g.clone()):n=!!e.bb,n&&(t.bb=e.bb),t},i.clone=function(){return new Q(this)};var oe=/[#\/\?@]/g,ae=/[#\?:]/g,se=/[#\?]/g,ue=/[#\?@]/g,ce=/#/g;function le(e){this.g=e||null}(i=le.prototype).na=null,i.qc=null,i.add=function(e,t){if(!this.na&&(this.na={},this.qc=0,this.g))for(var n=this.g.split("&"),r=0;r<n.length;r++){var i=n[r].indexOf("="),o=null;if(0<=i){var a=n[r].substring(0,i);o=n[r].substring(i+1)}else a=n[r];a=decodeURIComponent(a.replace(/\+/g," ")),o=o||"",this.add(a,decodeURIComponent(o.replace(/\+/g," ")))}return this.g=null,(n=this.na.hasOwnProperty(e)&&this.na[e])||(this.na[e]=n=[]),n.push(t),this.qc++,this},i.toString=function(){if(this.g)return this.g;if(!this.na)return"";var e,t=[];for(e in this.na)for(var n=encodeURIComponent(e),r=this.na[e],i=0;i<r.length;i++){var o=n;""!==r[i]&&(o+="="+encodeURIComponent(r[i])),t.push(o)}return this.g=t.join("&")},i.clone=function(){var e=new le;if(e.g=this.g,this.na){var t,n={};for(t in this.na)n[t]=this.na[t].concat();e.na=n,e.qc=this.qc}return e};var fe={df:function(e,t){return e.reduce(function(e,t,n){return t.catch(e.bind(null,n))}.bind(null,t),Promise.reject())},Rc:function(e,t){return e.concat(t)},Bc:function(){},Ra:function(e){return null!=e}};function he(e,t){if(0==t.length)return e;var n=t.map((function(e){return new Q(e)}));return e.map((function(e){return new Q(e)})).map((function(e){return n.map(e.resolve.bind(e))})).reduce(fe.Rc,[]).map((function(e){return e.toString()}))}function de(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:t||[],keyIds:[]}}var pe={Za:"video",Sb:"audio",za:"text",Ug:"image",Sg:"application"},ge=1/15;function me(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function ve(e){if(!e)return"";239==(e=new Uint8Array(e))[0]&&187==e[1]&&191==e[2]&&(e=e.subarray(3)),e=Se(e),e=escape(e);try{return decodeURIComponent(e)}catch(t){throw new $(2,2,2004)}}function ye(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw Y.error("Data has an incorrect length, must be even."),new $(2,2,2004);if(e instanceof ArrayBuffer)var r=e;else(n=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),r=n.buffer;e=Math.floor(e.byteLength/2),n=new Uint16Array(e),r=new DataView(r);for(var i=0;i<e;i++)n[i]=r.getUint16(2*i,t);return Se(n)}function be(e){var t=new Uint8Array(e);if(239==t[0]&&187==t[1]&&191==t[2])return ve(t);if(254==t[0]&&255==t[1])return ye(t.subarray(2),!1);if(255==t[0]&&254==t[1])return ye(t.subarray(2),!0);var n=function(e,t){return e.byteLength<=t||32<=e[t]&&126>=e[t]}.bind(null,t);if(Y.debug("Unable to find byte-order-mark, making an educated guess."),0==t[0]&&0==t[2])return ye(e,!1);if(0==t[1]&&0==t[3])return ye(e,!0);if(n(0)&&n(1)&&n(2)&&n(3))return ve(e);throw new $(2,2,2003)}function we(e){e=encodeURIComponent(e),e=unescape(e);for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t.buffer}function Te(e,t){for(var n=new Uint8Array(2*e.length),r=new DataView(n.buffer),i=0;i<e.length;++i)r.setUint16(2*i,e.charCodeAt(i),t);return n.buffer}function Se(e){if(!Ee)for(var t=function(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(n){return!1}},n={size:65536};0<n.size;(n={size:n.size}).size/=2)if(t(n.size)){Ee=function(e){return function(t){for(var n="",r=0;r<t.length;r+=e.size)n+=String.fromCharCode.apply(null,t.subarray(r,r+e.size));return n}}(n);break}return Ee(e)}me.prototype.resolve=function(){},me.prototype.reject=function(){},H("shaka.util.StringUtils.fromUTF8",ve),H("shaka.util.StringUtils.fromUTF16",ye),H("shaka.util.StringUtils.fromBytesAutoDetect",be),H("shaka.util.StringUtils.toUTF8",we),H("shaka.util.StringUtils.toUTF16",Te);var Ee=null;H("shaka.util.StringUtils.resetFromCharCode",(function(){Ee=null}));var xe={Mc:function(t,n){var r=Se(t);return n=null==n||n,r=e.btoa(r).replace(/\+/g,"-").replace(/\//g,"_"),n?r:r.replace(/=*$/,"")}};function Ae(){this.g=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.h=null,this.l=[],this.i=[],this.j=!1,this.g.on("data",this.o.bind(this)),this.g.on("done",this.m.bind(this))}function ke(t,n){return!(!e.muxjs||"mp2t"!=t.toLowerCase().split(";")[0].split("/")[1])&&(n?MediaSource.isTypeSupported(Ie(n,t)):MediaSource.isTypeSupported(Ie("audio",t))||MediaSource.isTypeSupported(Ie("video",t)))}function Ie(e,t){var n=t.replace(/mp2t/i,"mp4");"audio"==e&&(n=n.replace("video","audio"));var r=/avc1\.(66|77|100)\.(\d+)/.exec(n);if(r){var i="avc1.",o=r[1],a=Number(r[2]);i=("66"==o?i+"4200":"77"==o?i+"4d00":i+"6400")+(a>>4).toString(16),i+=(15&a).toString(16),n=n.replace(r[0],i)}return n}function Me(e){this.h=e,this.g=null}function Pe(e){this.h=e,this.g=null}function Re(e,t){var n={maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0};this.o=null==e.maxAttempts?n.maxAttempts:e.maxAttempts,this.j=null==e.baseDelay?n.baseDelay:e.baseDelay,this.m=null==e.fuzzFactor?n.fuzzFactor:e.fuzzFactor,this.l=null==e.backoffFactor?n.backoffFactor:e.backoffFactor,this.g=0,this.h=this.j,(this.i=void 0!==t&&t)&&(this.g=1)}function Ce(e){return g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:if(e.g>=e.o){if(!e.i)return t.return(Promise.reject());e.g=1,e.h=e.j}return n=e.g,e.g++,0==n?t.return():(r=e.h*(1+(2*Math.random()-1)*e.m),A(t,new Promise((function(e){new Pe(e).V(r/1e3)})),2));case 2:e.h*=e.l,k(t)}}))}))}function Ne(e,t){this.promise=e,this.se=t,this.g=!1}function je(e){return new Ne(Promise.reject(e),(function(){return Promise.resolve()}))}function De(){var e=Promise.reject(new $(2,7,7001));return e.catch((function(){})),new Ne(e,(function(){return Promise.resolve()}))}function Oe(e){return new Ne(Promise.resolve(e),(function(){return Promise.resolve()}))}function Le(e){return new Ne(e,(function(){return e.catch((function(){}))}))}function Ue(e){return new Ne(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function _e(t,n){for(var r in n=void 0===n?{}:n)this[r]=n[r];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.g=!1}function Ke(){this.g={}}function Be(){this.hd=new Ke,this.jc=this}function Fe(e){var n=new Set;return function e(r){switch(t(r)){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return r;default:if(!r||r.buffer&&r.buffer.constructor==ArrayBuffer)return r;if(n.has(r))return null;var i=r.constructor==Array;if(r.constructor!=Object&&!i)return null;n.add(r);var o,a=i?[]:{};for(o in r)a[o]=e(r[o]);return i&&(a.length=r.length),a}}(e)}function Ve(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function He(e,t){var n=e.indexOf(t);-1<n&&e.splice(n,1)}function qe(e,t,n){if(n||(n=Ve),e.length!=t.length)return!1;t=t.slice();for(var r={},i=(e=d(e)).next();!i.done;r={item:r.item},i=e.next()){if(r.item=i.value,-1==(i=t.findIndex(function(e){return function(t){return n(e.item,t)}}(r))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function ze(){this.g=[]}function Ge(e,t){e.g.push(t.finally((function(){He(e.g,t)})))}function We(e){Be.call(this),this.j=!1,this.l=new ze,this.g=new Set,this.h=new Set,this.i=e||null}H("shaka.util.Uint8ArrayUtils.toBase64",xe.Mc),xe.Ja=function(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n},H("shaka.util.Uint8ArrayUtils.fromBase64",xe.Ja),xe.$c=function(t){for(var n=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)n[r/2]=e.parseInt(t.substr(r,2),16);return n},H("shaka.util.Uint8ArrayUtils.fromHex",xe.$c),xe.Nc=function(e){for(var t="",n=0;n<e.length;++n){var r=e[n].toString(16);1==r.length&&(r="0"+r),t+=r}return t},H("shaka.util.Uint8ArrayUtils.toHex",xe.Nc),xe.Ha=function(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var n=0;n<e.length;++n)if(e[n]!=t[n])return!1;return!0},H("shaka.util.Uint8ArrayUtils.equal",xe.Ha),xe.concat=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];for(var r=n=0;r<t.length;++r)n+=t[r].length;n=new Uint8Array(n);for(var i=r=0;i<t.length;++i)n.set(t[i],r),r+=t[i].length;return n},H("shaka.util.Uint8ArrayUtils.concat",xe.concat),Ae.prototype.destroy=function(){return this.g.dispose(),this.g=null,Promise.resolve()},Ae.prototype.o=function(e){this.i=e.captions;var t=new Uint8Array(e.data.byteLength+e.initSegment.byteLength);t.set(e.initSegment,0),t.set(e.data,e.initSegment.byteLength),this.l.push(t)},Ae.prototype.m=function(){var e={data:xe.concat.apply(null,this.l),captions:this.i};this.h.resolve(e),this.j=!1},Me.prototype.V=function(t){var n=this;this.stop();var r=!0,i=null;return this.g=function(){e.clearTimeout(i),r=!1},i=e.setTimeout((function(){r&&n.h()}),1e3*t),this},Me.prototype.stop=function(){this.g&&(this.g(),this.g=null)},H("shaka.util.Timer",Pe),Pe.prototype.Lc=function(){return this.stop(),this.h(),this},Pe.prototype.tickNow=Pe.prototype.Lc,Pe.prototype.V=function(e){var t=this;return this.stop(),this.g=new Me((function(){t.h()})).V(e),this},Pe.prototype.tickAfter=Pe.prototype.V,Pe.prototype.Oa=function(e){var t=this;return this.stop(),this.g=new Me((function(){t.g.V(e),t.h()})).V(e),this},Pe.prototype.tickEvery=Pe.prototype.Oa,Pe.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},Pe.prototype.stop=Pe.prototype.stop,H("shaka.util.AbortableOperation",Ne),Ne.failed=je,Ne.aborted=De,Ne.completed=Oe,Ne.notAbortable=Le,Ne.prototype.abort=function(){return this.g=!0,this.se()},Ne.prototype.abort=Ne.prototype.abort,Ne.all=Ue,Ne.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},Ne.prototype.finally=Ne.prototype.finally,Ne.prototype.ca=function(e,t){function n(n){return function(s){if(i.g&&n)o.reject(a);else{var u=n?e:t;u?r=function(e,t,n){try{var r=e(t);return r&&r.promise&&r.abort?(n.resolve(r.promise),function(){return r.abort()}):(n.resolve(r),function(){return Promise.resolve(r).then((function(){}),(function(){}))})}catch(i){return n.reject(i),function(){return Promise.resolve()}}}(u,s,o):(n?o.resolve:o.reject)(s)}}}function r(){return o.reject(a),i.abort()}var i=this,o=new me,a=new $(2,7,7001);return this.promise.then(n(!0),n(!1)),new Ne(o,(function(){return r()}))},Ne.prototype.chain=Ne.prototype.ca,H("shaka.util.FakeEvent",_e),_e.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},_e.prototype.stopImmediatePropagation=function(){this.g=!0},_e.prototype.stopPropagation=function(){},(i=Ke.prototype).push=function(e,t){this.g.hasOwnProperty(e)?this.g[e].push(t):this.g[e]=[t]},i.get=function(e){return(e=this.g[e])?e.slice():null},i.getAll=function(){var e,t=[];for(e in this.g)t.push.apply(t,this.g[e]);return t},i.remove=function(e,t){var n=this.g[e];if(n)for(var r=0;r<n.length;++r)n[r]==t&&(n.splice(r,1),--r)},i.forEach=function(e){for(var t in this.g)e(t,this.g[t])},i.size=function(){return Object.keys(this.g).length},Be.prototype.addEventListener=function(e,t){this.hd.push(e,t)},Be.prototype.removeEventListener=function(e,t){this.hd.remove(e,t)},Be.prototype.dispatchEvent=function(e){for(var t=this.hd.get(e.type)||[],n=0;n<t.length;++n){e.target=this.jc,e.currentTarget=this.jc;var r=t[n];try{r.handleEvent?r.handleEvent(e):r.call(this,e)}catch(i){Y.error("Uncaught exception in event handler",i,i?i.message:null,i?i.stack:null)}if(e.g)break}return e.defaultPrevented},ze.prototype.destroy=function(){var e=[];return this.g.forEach((function(t){t.promise.catch((function(){})),e.push(t.abort())})),this.g=[],Promise.all(e)},q(We,Be),H("shaka.net.NetworkingEngine",We),We.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3,TIMING:4},We.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var Xe={};function Ye(e,t,n){n=n||3;var r=Xe[e];(!r||n>=r.priority)&&(Xe[e]={priority:n,mg:t})}function $e(e,t){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null}}function Je(e,t,n,r,i,o,a){var s=new Q(n.uris[i]),u=s.Ba,c=!1;u||(Z(s,u=(u=location.protocol).slice(0,-1)),n.uris[i]=s.toString()),u=u.toLowerCase();var l,f=(u=Xe[u])?u.mg:null;return f?Le(Ce(r)).ca((function(){return e.j?De():(l=Date.now(),f(n.uris[i],n,t,(function(n,r,i){e.i&&1==t&&(e.i(n,r),c=!0,a.g=i)})))})).ca((function(e){return null==e.timeMs&&(e.timeMs=Date.now()-l),{response:e,Nf:c}}),(function(s){if(s&&7001==s.code)throw s;if(e.j)return De();if(s&&1==s.severity)return e.dispatchEvent(new _e("retry",{error:s instanceof $?s:null})),i=(i+1)%n.uris.length,Je(e,t,n,r,i,s,a);throw s||o})):je(new $(2,1,1e3,s))}function Qe(){this.g=0}function Ze(e,t,n){Ne.call(this,e,t),this.h=n}function et(){}function tt(){this.g=new Ke}function nt(e,t,n,r){this.target=e,this.type=t,this.listener=n,this.g=function(e,t){if(null==t)return!1;if("boolean"==typeof t)return t;var n=new Set(["passive","capture"]);return Object.keys(t).filter((function(e){return!n.has(e)})),function(e){var t=rt;if(null==t){t=!1;try{var n={},r={get:function(){return t=!0,!1}};Object.defineProperty(n,"passive",r),Object.defineProperty(n,"capture",r),r=function(){},e.addEventListener("test",r,n),e.removeEventListener("test",r,n)}catch(i){t=!1}rt=t}return t||!1}(e)?t:t.capture||!1}(e,r),this.target.addEventListener(t,n,this.g)}We.registerScheme=Ye,We.unregisterScheme=function(e){delete Xe[e]},We.prototype.og=function(e){this.g.add(e)},We.prototype.registerRequestFilter=We.prototype.og,We.prototype.Ng=function(e){this.g.delete(e)},We.prototype.unregisterRequestFilter=We.prototype.Ng,We.prototype.bf=function(){this.g.clear()},We.prototype.clearAllRequestFilters=We.prototype.bf,We.prototype.pg=function(e){this.h.add(e)},We.prototype.registerResponseFilter=We.prototype.pg,We.prototype.Og=function(e){this.h.delete(e)},We.prototype.unregisterResponseFilter=We.prototype.Og,We.prototype.cf=function(){this.h.clear()},We.prototype.clearAllResponseFilters=We.prototype.cf,We.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}},We.makeRequest=$e,We.prototype.destroy=function(){return this.j=!0,this.g.clear(),this.h.clear(),this.l.destroy()},We.prototype.destroy=We.prototype.destroy,We.prototype.request=function(e,t){var n=this,r=new Qe;if(this.j){var i=Promise.reject(new $(2,7,7001));return i.catch((function(){})),new Ze(i,(function(){return Promise.resolve()}),r)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?Fe(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},t.uris=Fe(t.uris),i=function(e,t,n){for(var r=Oe(void 0),i={},o=(e=d(e.g)).next();!o.done;i={Gd:i.Gd},o=e.next())i.Gd=o.value,r=r.ca(function(e){return function(){return e.Gd(t,n)}}(i));return r.ca(void 0,(function(e){if(e&&7001==e.code)throw e;throw new $(2,1,1006,e)}))}(this,e,t);var o=i.ca((function(){return Je(n,e,t,new Re(t.retryParameters,!1),0,null,r)})),a=o.ca((function(t){return function(e,t,n){for(var r=Oe(void 0),i=(e=d(e.h)).next();!i.done;i=e.next())r=r.ca(i.value.bind(null,t,n.response));return r.ca((function(){return n}),(function(e){if(e&&7001==e.code)throw e;var t=2;throw e instanceof $&&(t=e.severity),new $(t,1,1007,e)}))}(n,e,t)})),s=Date.now(),u=0;i.promise.then((function(){u=Date.now()-s}),(function(){}));var c=0;return o.promise.then((function(){c=Date.now()}),(function(){})),i=new Ze((i=a.ca((function(t){var r=Date.now()-c,i=t.response;return i.timeMs+=u,i.timeMs+=r,t.Nf||!n.i||i.fromCache||1!=e||n.i(i.timeMs,i.data.byteLength),i}),(function(e){throw e&&(e.severity=2),e}))).promise,i.se,r),Ge(this.l,i),i},We.prototype.request=We.prototype.request,We.NumBytesRemainingClass=Qe,T(Ze,Ne),We.PendingRequest=Ze,Ze.all=Ue,Ze.notAbortable=Le,Ze.completed=Oe,Ze.aborted=De,Ze.failed=je,H("shaka.util.IReleasable",et),et.prototype.release=function(){},H("shaka.util.EventManager",tt),tt.prototype.release=function(){this.nb(),this.g=null},tt.prototype.release=tt.prototype.release,tt.prototype.H=function(e,t,n,r){this.g&&(e=new nt(e,t,n,r),this.g.push(t,e))},tt.prototype.listen=tt.prototype.H,tt.prototype.ya=function(e,t,n,r){var i=this;this.H(e,t,(function r(o){i.ta(e,t,r),n(o)}),r)},tt.prototype.listenOnce=tt.prototype.ya,tt.prototype.ta=function(e,t,n){if(this.g)for(var r=this.g.get(t)||[],i=(r=d(r)).next();!i.done;i=r.next())(i=i.value).target!=e||n!=i.listener&&n||(i.ta(),this.g.remove(t,i))},tt.prototype.unlisten=tt.prototype.ta,tt.prototype.nb=function(){if(this.g){for(var e=this.g.getAll(),t=(e=d(e)).next();!t.done;t=e.next())t.value.ta();this.g.g={}}},tt.prototype.removeAll=tt.prototype.nb,nt.prototype.ta=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1},nt.prototype.unlisten=nt.prototype.ta;var rt=void 0;function it(e){return new Q(e=be(e)).Aa}function ot(e,t,n){function r(e){new DataView(i.buffer).setUint32(o,e.byteLength,!0),o+=4,i.set(e,o),o+=e.byteLength}if(!n||!n.byteLength)throw new $(2,6,6015);t="string"==typeof t?new Uint8Array(Te(t,!0)):new Uint8Array(t),e=Te(e=be(e),!0);var i=new Uint8Array(12+e.byteLength+t.byteLength+n.byteLength),o=0;return r(new Uint8Array(e)),r(t),r(new Uint8Array(n)),i}function at(e,t){for(var n=[],r=d(e),i=r.next();!i.done;i=r.next())n.push(t(i.value));return n}function st(e,t){for(var n=d(e),r=n.next();!r.done;r=n.next())if(!t(r.value))return!1;return!0}function ut(e){var t=new Map;return Object.keys(e).forEach((function(n){t.set(n,e[n])})),t}function ct(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}function lt(e,t){var n=e;return t&&(n+='; codecs="'+t+'"'),n}function ft(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function ht(e){var t=(e=e.split("."))[0];return e.pop(),[t,e.join(".")]}H("shaka.util.FairPlayUtils.defaultGetContentId",it),H("shaka.util.FairPlayUtils.initDataTransform",ot);var dt=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function pt(){return!(!e.MediaSource||!MediaSource.isTypeSupported)}function gt(e){return""!=wt().canPlayType(e)}function mt(){return bt("Tizen")}function vt(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!mt()}function yt(){if(!vt())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function bt(e){return(navigator.userAgent||"").includes(e)}function wt(){return St||(Tt||(Tt=new Pe((function(){St=null}))),(St=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(St=document.createElement("video")),Tt.V(1),St)}var Tt=null,St=null;function Et(e,t){var n=this;t=void 0===t?1:t,this.J=e,this.C=new Set,this.m=this.o=null,this.Z=!1,this.P=0,this.g=null,this.u=new tt,this.h=new Map,this.F=[],this.A=new me,this.j=null,this.l=function(t){n.A.reject(t),e.onError(t)},this.wa=new Map,this.da=new Map,this.X=new Pe((function(){return function(e){var t=e.wa,n=e.da;n.clear(),t.forEach((function(e,t){return n.set(t,e)})),(t=Array.from(n.values())).length&&t.every((function(e){return"expired"==e}))&&e.l(new $(2,6,6014)),e.J.Dc(ct(n))}(n)})),this.i=!1,this.ua=new me,this.L=!1,this.M=[],this.va=!1,this.ea=new Pe((function(){!function(e){e.h.forEach((function(t,n){var r=t.xd,i=n.expiration;isNaN(i)&&(i=1/0),i!=r&&(e.J.onExpirationUpdated(n.sessionId,i),t.xd=i)}))}(n)})).Oa(t),this.A.catch((function(){}))}function xt(e,t,n){return e.F=n,e.L=0<n.length,At(e,t)}function At(t,n){var r=function(t){if(0==(t=ut(t.j.clearKeys)).size)return null;var n=[],r=[];t.forEach((function(e,t){var i=xe.$c(t),o=xe.$c(e);i={kty:"oct",kid:xe.Mc(i,!1),k:xe.Mc(o,!1)},n.push(i),r.push(i.kid)})),t=JSON.stringify({keys:n});var i=JSON.stringify({kids:r});return i=[{initData:new Uint8Array(we(i)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:i,keyIds:[]}}(t);if(r)for(var i=d(n),o=i.next();!o.done;o=i.next())o.value.drmInfos=[r];for((r=n.some((function(e){return 0<e.drmInfos.length})))||function(e,t){var n=[];t.forEach((function(e,t){n.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})}));for(var r=d(e),i=r.next();!i.done;i=r.next())i.value.drmInfos=n}(n,o=ut(t.j.servers)),o=(i=d(n)).next();!o.done;o=i.next())for(var a=(o=d(o.value.drmInfos)).next();!a.done;a=o.next())Vt(a.value,ut(t.j.servers),ut(t.j.advanced||{}));return o=function(e,t){for(var n=new Set,r=d(t),i=r.next();!i.done;i=r.next()){var o=d(i.value.drmInfos);for(i=o.next();!i.done;i=o.next())n.add(i.value)}for(r=d(n),i=r.next();!i.done;i=r.next())Vt(i.value,ut(e.j.servers),ut(e.j.advanced||{}));o=e.L?"required":"optional";var a=e.L?["persistent-license"]:["temporary"];for(r=new Map,n=d(n),i=n.next();!i.done;i=n.next())i=i.value,r.set(i.keySystem,{audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:o,sessionTypes:a,label:i.keySystem,drmInfos:[]});for(n=d(t),i=n.next();!i.done;i=n.next()){o=(i=i.value).audio,a=i.video;var s=o?Nt(o):"",u=a?Nt(a):"",c=d(i.drmInfos);for(i=c.next();!i.done;i=c.next()){i=i.value;var l=r.get(i.keySystem);l.drmInfos.push(i),i.distinctiveIdentifierRequired&&(l.distinctiveIdentifier="required"),i.persistentStateRequired&&(l.persistentState="required"),o&&(l.audioCapabilities.push({robustness:i.audioRobustness||"",contentType:s}),"ac-3"==o.codecs.toLowerCase()&&mt()&&l.audioCapabilities.push({robustness:i.audioRobustness||"",contentType:lt(o.mimeType,"ec-3")})),a&&l.videoCapabilities.push({robustness:i.videoRobustness||"",contentType:u})}}return r}(t,n),o.size?(o=jt(t,o),r?o:o.catch((function(){}))):(t.Z=!0,Promise.resolve())}function kt(e){return g((function t(){var n;return U(t,(function(t){switch(t.s){case 1:if(!(e.o&&e.g&&e.g.serverCertificate&&e.g.serverCertificate.length)){t.I(0);break}return I(t,3),A(t,e.o.setServerCertificate(e.g.serverCertificate),5);case 5:t.B||Y.v("Server certificates are not supported by the key system.  The server certificate has been ignored."),P(t,0);break;case 3:return n=R(t),t.return(Promise.reject(new $(2,6,6004,n.message)))}}))}))}function It(e){var t=e.g?e.g.initData:[];return t.forEach((function(t){return Mt(e,t.initDataType,t.initData)})),e.F.forEach((function(t){return Dt(e,t)})),t.length||e.F.length||e.A.resolve(),e.A}function Mt(e,t,n){for(var r=e.h.values(),i=(r=d(r)).next();!i.done;i=r.next())if(xe.Ha(n,i.value.initData)&&!bt("Tizen 2"))return void Y.debug("Ignoring duplicate init data.");!function(e,t,n){try{if(e.L){Y.K("Creating new persistent session");var r=e.o.createSession("persistent-license")}else Y.K("Creating new temporary session"),r=e.o.createSession()}catch(i){return void e.l(new $(2,6,6005,i.message))}e.u.H(r,"message",e.ye.bind(e)),e.u.H(r,"keystatuseschange",e.we.bind(e)),e.h.set(r,{initData:n,loaded:!1,xd:1/0,Ga:null});try{n=e.j.initDataTransform(n,e.g)}catch(i){return t=i,i instanceof $||(t=new $(2,6,6016,i)),void e.l(t)}r.generateRequest(t,n).catch((function(t){if(!e.i){if(e.h.delete(r),t.errorCode&&t.errorCode.systemCode){var n=t.errorCode.systemCode;0>n&&(n+=Math.pow(2,32)),n="0x"+n.toString(16)}e.l(new $(2,6,6006,t.message,t,n))}}))}(e,t,n)}function Pt(e){return e?e.keySystem:""}function Rt(e,t){if(navigator.userAgent.match(/Edge\//))return!0;if(t=t.toLowerCase(),mt()&&t.includes('codecs="ac-3"')){var n=t.replace("ac-3","ec-3");return e.C.has(t)||e.C.has(n)}return e.C.has(t)}function Ct(e){return e=at(e=e.h.keys(),(function(e){return e.sessionId})),Array.from(e)}function Nt(e){var t=lt(e.mimeType,e.codecs);return ke(t)?Ie(e.type,t):t}function jt(e,t){if(1==t.size&&t.has(""))return Promise.reject(new $(2,6,6e3));for(var n=d(t.values()),r=n.next();!r.done;r=n.next())0==(r=r.value).audioCapabilities.length&&delete r.audioCapabilities,0==r.videoCapabilities.length&&delete r.videoCapabilities;var i=n=new me;return[!0,!1].forEach(function(e){var n=this;t.forEach((function(t,r){t.drmInfos.some((function(e){return!!e.licenseServerUri}))==e&&(i=i.catch(function(){if(!this.i)return navigator.requestMediaKeySystemAccess(r,[t])}.bind(n)))}))}.bind(e)),i=(i=i.catch((function(){return Promise.reject(new $(2,6,6001))}))).then(function(e){if(this.i)return Promise.reject();this.C.clear();var n=e.getConfiguration(),r=n.videoCapabilities||[],i=d(n.audioCapabilities||[]);for(n=i.next();!n.done;n=i.next())this.C.add(n.value.contentType.toLowerCase());for(n=(r=d(r)).next();!n.done;n=r.next())this.C.add(n.value.contentType.toLowerCase());r=e.keySystem,i=[];var o=[],a=[],s=[];return function(e,t,n,r,i){e.forEach((function(e){if(t.includes(e.licenseServerUri)||t.push(e.licenseServerUri),e.serverCertificate&&(n.some((function(t){return xe.Ha(t,e.serverCertificate)}))||n.push(e.serverCertificate)),e.initData&&e.initData.forEach((function(e){r.some((function(t){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&xe.Ha(t.initData,e.initData)}))||r.push(e)})),e.keyIds)for(var o=0;o<e.keyIds.length;++o)i.includes(e.keyIds[o])||i.push(e.keyIds[o])}))}((n=t.get(e.keySystem)).drmInfos,i,o,a,s),1<o.length&&Y.v("Multiple unique server certificates found! Only the first will be used."),1<i.length&&Y.v("Multiple unique license server URIs found! Only the first will be used."),this.g={keySystem:r,licenseServerUri:i[0],distinctiveIdentifierRequired:"required"==n.distinctiveIdentifier,persistentStateRequired:"required"==n.persistentState,audioRobustness:(n.audioCapabilities?n.audioCapabilities[0].robustness:"")||"",videoRobustness:(n.videoCapabilities?n.videoCapabilities[0].robustness:"")||"",serverCertificate:o[0],initData:a,keyIds:s},this.g.licenseServerUri?e.createMediaKeys():Promise.reject(new $(2,6,6012,this.g.keySystem))}.bind(e)).then(function(e){if(this.i)return Promise.reject();Y.info("Created MediaKeys object for key system",this.g.keySystem),this.o=e,this.Z=!0}.bind(e)).catch(function(e){if(!this.i)return this.g=null,this.C.clear(),e instanceof $?Promise.reject(e):Promise.reject(new $(2,6,6002,e.message))}.bind(e)),n.reject(),i}function Dt(e,t){try{Y.K("Attempting to load an offline session",t);var n=e.o.createSession("persistent-license")}catch(o){var r=new $(2,6,6005,o.message);return e.l(r),Promise.reject(r)}e.u.H(n,"message",e.ye.bind(e)),e.u.H(n,"keystatuseschange",e.we.bind(e));var i={initData:null,loaded:!1,xd:1/0,Ga:null};return e.h.set(n,i),n.load(t).then(function(e){return this.i?Promise.reject():(Y.O("Loaded offline session",t,e),e?(i.loaded=!0,Ft(this)&&this.A.resolve(),n):(this.h.delete(n),void this.l(new $(2,6,6013))))}.bind(e),function(e){this.i||(this.h.delete(n),this.l(new $(2,6,6005,e.message)))}.bind(e))}function Ot(e,t){if(Pt(t).startsWith("com.apple.fps")){var n=t.serverCertificate;e=ot(e,it(e),n)}return e}function Lt(e,t){var n=t.target;Y.K("Sending license request for session",n.sessionId,"of type",t.messageType);var r=e.h.get(n),i=e.g.licenseServerUri,o=e.j.advanced[e.g.keySystem];"individualization-request"==t.messageType&&o&&o.individualizationServer&&(i=o.individualizationServer),(i=$e([i],e.j.retryParameters)).body=t.message,i.method="POST",i.licenseRequestType=t.messageType,i.sessionId=n.sessionId,"com.microsoft.playready"!=e.g.keySystem&&"com.chromecast.playready"!=e.g.keySystem||function(e){var t=ye(e.body,!0,!0);if(t.includes("PlayReadyKeyMessage")){Y.debug("Unwrapping PlayReady request.");for(var n=(t=(new DOMParser).parseFromString(t,"application/xml")).getElementsByTagName("HttpHeader"),r=0;r<n.length;++r)e.headers[n[r].getElementsByTagName("name")[0].textContent]=n[r].getElementsByTagName("value")[0].textContent;e.body=xe.Ja(t.getElementsByTagName("Challenge")[0].textContent).buffer}else Y.debug("PlayReady request is already unwrapped."),e.headers["Content-Type"]="text/xml; charset=utf-8"}(i),e.g.keySystem.startsWith("com.apple.fps")&&e.j.fairPlayTransform&&function(e){var t=new Uint8Array(e.body);t="spc="+xe.Mc(t),e.headers["Content-Type"]="application/x-www-form-urlencoded",e.body=we(t)}(i);var a=Date.now();e.J.Ib.request(2,i).promise.then(function(e){return this.i?Promise.reject():(this.g.keySystem.startsWith("com.apple.fps")&&this.j.fairPlayTransform&&function(e){try{var t=ve(e.data)}catch(n){return}"<ckc>"===(t=t.trim()).substr(0,5)&&"</ckc>"===t.substr(-6)&&(t=t.slice(5,-6));try{t=JSON.parse(t).ckc}catch(n){}e.data=xe.Ja(t).buffer}(e),this.P+=(Date.now()-a)/1e3,Y.K("Updating session",n.sessionId),n.update(e.data).then(function(){var e=this;this.J.onEvent(new _e("drmsessionupdate")),r&&(r.Ga&&r.Ga.resolve(),new Pe((function(){r.loaded=!0,Ft(e)&&e.A.resolve()})).V(qt))}.bind(this)))}.bind(e),function(e){this.i||(e=new $(2,6,6007,e),this.l(e),r&&r.Ga&&r.Ga.reject(e))}.bind(e)).catch(function(e){this.i||(e=new $(2,6,6008,e.message),this.l(e),r&&r.Ga&&r.Ga.reject(e))}.bind(e))}function Ut(){var e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],t=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],n=new Map;return e="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.3_0 com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").map((function(e){return r=e,g((function e(){var i,o,a;return U(e,(function(e){switch(e.s){case 1:return I(e,2),A(e,navigator.requestMediaKeySystemAccess(r,t),4);case 4:return i=e.B,a=!!(o=i.getConfiguration().sessionTypes)&&o.includes("persistent-license"),bt("Tizen 3")&&(a=!1),n.set(r,{persistentState:a}),A(e,i.createMediaKeys(),5);case 5:P(e,0);break;case 2:R(e),n.set(r,null),k(e)}}))}));var r})),Promise.all(e).then((function(){return ct(n)}))}function _t(e,t){var n=t.audio,r=t.video;if(n&&n.encrypted&&!Rt(e,n=Nt(n))||r&&r.encrypted&&!Rt(e,r=Nt(r)))return!1;var i=Pt(e.g);return 0==t.drmInfos.length||t.drmInfos.some((function(e){return e.keySystem==i}))}function Kt(e,t){if(!e.length)return t;if(!t.length)return e;for(var n=[],r=0;r<e.length;r++)for(var i=0;i<t.length;i++)if(e[r].keySystem==t[i].keySystem){var o=e[r];i=t[i];var a=[];a=(a=a.concat(o.initData||[])).concat(i.initData||[]);var s=[];s=(s=s.concat(o.keyIds)).concat(i.keyIds),n.push({keySystem:o.keySystem,licenseServerUri:o.licenseServerUri||i.licenseServerUri,distinctiveIdentifierRequired:o.distinctiveIdentifierRequired||i.distinctiveIdentifierRequired,persistentStateRequired:o.persistentStateRequired||i.persistentStateRequired,videoRobustness:o.videoRobustness||i.videoRobustness,audioRobustness:o.audioRobustness||i.audioRobustness,serverCertificate:o.serverCertificate||i.serverCertificate,initData:a,keyIds:s});break}return n}function Bt(e){return g((function t(){var n;return U(t,(function(t){if(1===t.s)return n=Array.from(e.h.keys()),e.h.clear(),A(t,Promise.all(n.map((function(e){return g((function t(){return U(t,(function(t){switch(t.s){case 1:return Y.K("Closing session",e.sessionId),I(t,2),A(t,function(e){return g((function t(){var n;return U(t,(function(t){switch(t.s){case 1:return n=new Promise((function(e,t){new Pe(t).V(Ht)})),I(t,2),A(t,Promise.race([Promise.all([e.close(),e.closed]),n]),4);case 4:P(t,0);break;case 2:R(t),Y.v("Timeout waiting for session close"),k(t)}}))}))}(e),4);case 4:P(t,0);break;case 2:R(t),k(t)}}))}))}))),0)}))}))}function Ft(e){return st(e=e.h.values(),(function(e){return e.loaded}))}function Vt(t,n,r){!t.keySystem||"org.w3.clearkey"==t.keySystem&&t.licenseServerUri||(n.size&&(n=n.get(t.keySystem)||"",t.licenseServerUri=n),t.keyIds||(t.keyIds=[]),(r=r.get(t.keySystem))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=r.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=r.persistentStateRequired),t.videoRobustness||(t.videoRobustness=r.videoRobustness),t.audioRobustness||(t.audioRobustness=r.audioRobustness),t.serverCertificate||(t.serverCertificate=r.serverCertificate)),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==t.keySystem&&(t.keySystem="com.chromecast.playready"))}(i=Et.prototype).destroy=function(){var e=this;return g((function t(){return U(t,(function(t){switch(t.s){case 1:return e.i?A(t,e.ua,0):(e.i=!0,A(t,function(e){return g((function t(){return U(t,(function(t){switch(t.s){case 1:return e.u.release(),e.u=null,e.A.reject(),e.ea.stop(),e.ea=null,e.X.stop(),e.X=null,A(t,Bt(e),2);case 2:if(!e.m){t.I(3);break}return I(t,4),A(t,e.m.setMediaKeys(null),6);case 6:P(t,5);break;case 4:R(t);case 5:e.m=null;case 3:e.g=null,e.C.clear(),e.o=null,e.F=[],e.j=null,e.l=null,e.J=null,k(t)}}))}))}(e),4));case 4:e.ua.resolve(),t.I(0)}}))}))},i.configure=function(e){this.j=e},i.Ub=function(e){var t=this;if(!this.o)return this.u.ya(e,"encrypted",(function(){t.l(new $(2,6,6010))})),Promise.resolve();this.m=e,this.u.ya(this.m,"play",(function(){for(var e=0;e<t.M.length;e++)Lt(t,t.M[e]);t.va=!0,t.M=[]})),"webkitCurrentPlaybackTargetIsWireless"in this.m&&this.u.H(this.m,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return Bt(t)})),e=(e=this.m.setMediaKeys(this.o)).catch((function(e){return Promise.reject(new $(2,6,6003,e.message))}));var n=kt(this);return Promise.all([e,n]).then((function(){if(t.i)return Promise.reject();It(t),t.g.initData.length||t.F.length||t.u.H(t.m,"encrypted",(function(e){return Mt(t,e.initDataType,new Uint8Array(e.initData))}))})).catch((function(e){if(!t.i)return Promise.reject(e)}))},i.Xb=function(){for(var e=1/0,t=this.h.keys(),n=(t=d(t)).next();!n.done;n=t.next())n=n.value,isNaN(n.expiration)||(e=Math.min(e,n.expiration));return e},i.ye=function(e){this.m&&this.j.delayLicenseRequestUntilPlayed&&this.m.paused&&!this.va?this.M.push(e):Lt(this,e)},i.we=function(e){e=e.target,Y.O("Key status changed for session",e.sessionId);var t=this.h.get(e),n=!1;e.keyStatuses.forEach(function(e,r){if("string"==typeof r){var i=r;r=e,e=i}if("com.microsoft.playready"==this.g.keySystem&&16==r.byteLength&&(bt("Trident/")||navigator.userAgent.match(/Edge?\//))){var o=(i=new DataView(r)).getUint32(0,!0),a=i.getUint16(4,!0),s=i.getUint16(6,!0);i.setUint32(0,o,!1),i.setUint16(4,a,!1),i.setUint16(6,s,!1)}"com.microsoft.playready"==this.g.keySystem&&"status-pending"==e&&(e="usable"),"status-pending"!=e&&(t.loaded=!0),"expired"==e&&(n=!0),i=xe.Nc(new Uint8Array(r)),this.wa.set(i,e)}.bind(this));var r=e.expiration-Date.now();(0>r||n&&1e3>r)&&t&&!t.Ga&&(Y.debug("Session has expired",e.sessionId),this.h.delete(e),e.close().catch((function(){}))),Ft(this)&&(this.A.resolve(),this.X.V(zt))};var Ht=1,qt=5,zt=.5;function Gt(){this.g=new muxjs.mp4.CaptionParser,this.l=[],this.j={}}function Wt(){}function Xt(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function Yt(e,t,n){return n=void 0===n?0:n,!(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0)||t>e.end(e.length-1))&&t+n>=e.start(0)}function $t(e,t){if(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))return 0;for(var n=0,r=e.length-1;0<=r&&e.end(r)>t;--r)n+=e.end(r)-Math.max(e.start(r),t);return n}function Jt(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function Qt(e,t,n){this.startTime=e,this.direction=on,this.endTime=t,this.payload=n,this.region=new dn,this.position=null,this.positionAlign=Zt,this.size=0,this.textAlign=en,this.writingMode=an,this.lineInterpretation=sn,this.line=null,this.lineHeight="",this.lineAlign=un,this.displayAlign=nn,this.fontSize=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=ln,this.fontStyle=fn,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id="",this.nestedCues=[],this.spacer=!1}Gt.prototype.init=function(e){var t=muxjs.mp4.probe;e=new Uint8Array(e),this.l=t.videoTrackIds(e),this.j=t.timescale(e),this.g.init()},Gt.prototype.h=function(e,t){var n=new Uint8Array(e);(n=this.g.parse(n,this.l,this.j))&&n.captions&&t(n.captions),this.g.clearParsedCaptions()},Gt.prototype.i=function(){this.g.resetCaptionStream()},Wt.prototype.init=function(){},Wt.prototype.h=function(){},Wt.prototype.i=function(){},H("shaka.text.Cue",Qt),Qt.prototype.clone=function(){var e,t=new Qt(0,0,"");for(e in this)t[e]=this[e],t[e]&&t[e].constructor==Array&&(t[e]=t[e].slice());return t};var Zt="auto";Qt.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Zt};var en="center",tn={LEFT:"left",RIGHT:"right",CENTER:en,START:"start",END:"end"};Qt.textAlign=tn;var nn="after",rn={BEFORE:"before",CENTER:"center",AFTER:nn};Qt.displayAlign=rn;var on="ltr";Qt.direction={HORIZONTAL_LEFT_TO_RIGHT:on,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var an="horizontal-tb";Qt.writingMode={HORIZONTAL_TOP_TO_BOTTOM:an,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var sn=0;Qt.lineInterpretation={LINE_NUMBER:sn,PERCENTAGE:1};var un="start",cn={CENTER:"center",START:un,END:"end"};Qt.lineAlign=cn;var ln=400;Qt.fontWeight={NORMAL:ln,BOLD:700};var fn="normal",hn={NORMAL:fn,ITALIC:"italic",OBLIQUE:"oblique"};function dn(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=pn,this.scroll=gn}Qt.fontStyle=hn,Qt.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},H("shaka.text.CueRegion",dn);var pn=1;dn.units={PX:0,PERCENTAGE:pn,LINES:2};var gn="";function mn(e){this.l=null,this.i=e,this.j=this.A=0,this.m=1/0,this.h=this.g=null,this.u="",this.o=new Map}dn.scrollMode={NONE:gn,UP:"up"};var vn={};function yn(t){return!!(vn[t]||e.muxjs&&"application/cea-608"==t)}function bn(e,t){"application/cea-608"!=t&&(e.l=new vn[t])}function wn(e,t,n,r,i){for(var o=n+" "+r,a=new Map,s=(t=d(t)).next();!s.done;s=t.next()){var u=s.value;s=u.stream,a.has(s)||a.set(s,new Map),a.get(s).has(o)||a.get(s).set(o,[]),u.startTime+=i,u.endTime+=i,u.startTime>=e.j&&u.startTime<e.m&&(u=new Qt(u.startTime,u.endTime,u.text),a.get(s).get(o).push(u),s==e.u&&e.i.append([u]))}for(o=(i=d(a.keys())).next();!o.done;o=i.next())for(o=o.value,e.o.has(o)||e.o.set(o,new Map),s=(t=d(a.get(o).keys())).next();!s.done;s=t.next())s=s.value,u=a.get(o).get(s),e.o.get(o).set(s,u);e.g=null==e.g?Math.max(n,e.j):Math.min(e.g,Math.max(n,e.j)),e.h=Math.max(e.h,Math.min(r,e.m))}function Tn(e,t,n){this.j=e,this.l=n,this.h={},this.g=null,this.i={},this.o=new tt,this.F=!1,this.u={},this.A=t,this.C=new me,this.m=function(e,t){var n=new MediaSource;return e.o.ya(n,"sourceopen",(function(){URL.revokeObjectURL(e.J),t.resolve()})),e.J=Sn(n),e.j.src=e.J,n}(this,this.C),this.J=""}H("shaka.text.TextEngine.registerParser",(function(e,t){vn[e]=t})),H("shaka.text.TextEngine.unregisterParser",(function(e){delete vn[e]})),mn.prototype.destroy=function(){return this.i=this.l=null,this.o.clear(),Promise.resolve()},mn.prototype.xc=function(e){try{return this.l.parseMedia(new Uint8Array(e),{periodStart:0,segmentStart:null,segmentEnd:0})[0].startTime}catch(t){throw new $(2,2,2009,t)}},mn.prototype.remove=function(e,t){return Promise.resolve().then(function(){!this.i||!this.i.remove(e,t)||null==this.g||t<=this.g||e>=this.h||(e<=this.g&&t>=this.h?this.g=this.h=null:e<=this.g&&t<this.h?this.g=t:e>this.g&&t>=this.h&&(this.h=e))}.bind(this))};var Sn=e.URL.createObjectURL;function En(e){var t=lt(e.mimeType,e.codecs),n=function(e){var t=[e.mimeType];return dt.forEach((function(n,r){var i=e[r];i&&t.push(n+'="'+i+'"')})),t.join(";")}(e);return yn(t)||MediaSource.isTypeSupported(n)||ke(t,e.type)}function xn(e,t){e.g||(e.g=new mn(e.l)),bn(e.g,t)}function An(e){return!e.m||"ended"==e.m.readyState}function kn(e,t){if("text"==t)var n=e.g.g;else n=!(n=Mn(e,t))||1==n.length&&1e-6>n.end(0)-n.start(0)?null:1==n.length&&0>n.start(0)?0:n.length?n.start(0):null;return n}function In(e,t){return"text"==t?e.g.h:Xt(Mn(e,t))}function Mn(e,t){try{return e.h[t].buffered}catch(n){return t in e.h&&Y.error("failed to get buffered range for "+t,n),null}}function Pn(t,n,r,i,o,a){return"text"==n?function(e,t,n,r){return Promise.resolve().then(function(){if(this.l&&this.i)if(null==n||null==r)this.l.parseInit(new Uint8Array(t));else{var e={periodStart:this.A,segmentStart:n,segmentEnd:r};e=this.l.parseMedia(new Uint8Array(t),e).filter(function(e){return e.startTime>=this.j&&e.startTime<this.m}.bind(this)),this.i.append(e),null==this.g&&(this.g=Math.max(n,this.j)),this.h=Math.min(r,this.m)}}.bind(e))}(t.g,r,i,o):t.u[n]?function(e,t){e.j=!0,e.h=new me,e.l=[],e.i=[];var n=new Uint8Array(t);return e.g.push(n),e.g.flush(),e.j&&e.h.reject(new $(2,3,3018)),e.h}(t.u[n],r).then(function(e){return this.g||xn(this,"text/vtt"),e.captions&&e.captions.length&&wn(this.g,e.captions,i,o,this.h.video.timestampOffset),Nn(this,n,this.Me.bind(this,n,e.data.buffer))}.bind(t)):(a&&e.muxjs&&(t.g||xn(t,"text/vtt"),null==i&&null==o?t.A.init(r):t.A.h(r,(function(e){e.length&&wn(t.g,e,i,o,t.h.video.timestampOffset)}))),Nn(t,n,t.Me.bind(t,n,r)))}function Rn(e,t){var n=In(e,"video")||0;!function(e,t,n){if(e.u=t,t=e.o.get(t))for(var r=d(t.keys()),i=r.next();!i.done;i=r.next())(i=t.get(i.value).filter((function(e){return e.endTime<=n})))&&e.i.append(i)}(e.g,t,n)}function Cn(e,t){return"text"==t?e.g?(e.A.i(),e.g.remove(0,1/0)):Promise.resolve():Nn(e,t,e.Ne.bind(e,t,0,e.m.duration))}function Nn(e,t,n){if(e.F)return Promise.reject();if(n={start:n,p:new me},e.i[t].push(n),1==e.i[t].length)try{n.start()}catch(r){"QuotaExceededError"==r.name?n.p.reject(new $(2,3,3017,t)):n.p.reject(new $(2,3,3015,r)),Dn(e,t)}return n.p}function jn(e,t){if(e.F)return Promise.reject();var n,r=[];for(n in e.h){var i=new me,o={start:function(e){e.resolve()}.bind(null,i),p:i};e.i[n].push(o),r.push(i),1==e.i[n].length&&o.start()}return Promise.all(r).then(function(){try{t()}catch(r){var e=Promise.reject(new $(2,3,3015,r))}for(var n in this.h)Dn(this,n);return e}.bind(e),function(e){throw e}.bind(e))}function Dn(e,t){e.i[t].shift();var n=e.i[t][0];if(n)try{n.start()}catch(r){n.p.reject(new $(2,3,3015,r)),Dn(e,t)}}function On(e,t){return e=Un(e),t=Un(t),e.split("-")[0]==t.split("-")[0]}function Ln(e,t){e=Un(e),t=Un(t);var n=e.split("-"),r=t.split("-");return n[0]==r[0]&&1==n.length&&2==r.length}function Un(e){var t=e.split("-");return e=t[0]||"",t=t[1]||"",e=e.toLowerCase(),e=Bn.get(e)||e,(t=t.toUpperCase())?e+"-"+t:e}function _n(e){return e.language?Un(e.language):e.audio&&e.audio.language?Un(e.audio.language):e.video&&e.video.language?Un(e.video.language):"und"}function Kn(e,t){for(var n=Un(e),r=new Set,i=d(t),o=i.next();!o.done;o=i.next())r.add(Un(o.value));for(o=(i=d(r)).next();!o.done;o=i.next())if((o=o.value)==n)return o;for(o=(i=d(r)).next();!o.done;o=i.next())if(Ln(o=o.value,n))return o;for(o=(i=d(r)).next();!o.done;o=i.next()){var a=o=o.value,s=n;if(a=Un(a),s=Un(s),a=a.split("-"),s=s.split("-"),2==a.length&&2==s.length&&a[0]==s[0])return o}for(o=(r=d(r)).next();!o.done;o=r.next())if(Ln(n,i=o.value))return i;return null}(i=Tn.prototype).destroy=function(){var e=this;this.F=!0;var t,n=[];for(t in this.i){var r=this.i[t],i=r[0];for(this.i[t]=r.slice(0,1),i&&n.push(i.p.catch(fe.Bc)),i=1;i<r.length;++i)r[i].p.reject()}for(var o in this.g&&n.push(this.g.destroy()),this.l&&n.push(this.l.destroy()),this.u)n.push(this.u[o].destroy());return Promise.all(n).then((function(){e.o&&(e.o.release(),e.o=null),e.j&&(e.j.removeAttribute("src"),e.j.load(),e.j=null),e.m=null,e.g=null,e.l=null,e.h={},e.u={},e.A=null,e.i={}}))},i.init=function(e,t){var n=this;return g((function r(){var i;return U(r,(function(r){switch(r.s){case 1:return i=pe,A(r,n.C,2);case 2:e.forEach((function(e,r){var o=lt(e.mimeType,e.codecs);r==i.za?xn(n,o):(!t&&MediaSource.isTypeSupported(o)||!ke(o,r)||(n.u[r]=new Ae,o=Ie(r,o)),o=n.m.addSourceBuffer(o),n.o.H(o,"error",n.Dg.bind(n,r)),n.o.H(o,"updateend",n.Lb.bind(n,r)),n.h[r]=o,n.i[r]=[])})),k(r)}}))}))},i.bd=function(e){if(e.total=Jt(this.j.buffered),e.audio=Jt(Mn(this,"audio")),e.video=Jt(Mn(this,"video")),e.text=[],this.g){var t=this.g.g,n=this.g.h;null!=t&&null!=n&&e.text.push({start:t,end:n})}},i.remove=function(e,t,n){return"text"==e?this.g.remove(t,n):Nn(this,e,this.Ne.bind(this,e,t,n))},i.flush=function(e){return"text"==e?Promise.resolve():Nn(this,e,this.lf.bind(this,e))},i.endOfStream=function(e){return jn(this,function(){An(this)||(e?this.m.endOfStream(e):this.m.endOfStream())}.bind(this))},i.Fa=function(e){return jn(this,function(){this.m.duration=e}.bind(this))},i.ha=function(){return this.m.duration},i.Me=function(e,t){this.h[e].appendBuffer(t)},i.Ne=function(e,t,n){n<=t?this.Lb(e):this.h[e].remove(t,n)},i.Ve=function(e){var t=this.h[e].appendWindowStart,n=this.h[e].appendWindowEnd;this.h[e].abort(),this.h[e].appendWindowStart=t,this.h[e].appendWindowEnd=n,this.Lb(e)},i.lf=function(e){this.j.currentTime-=.001,this.Lb(e)},i.Cg=function(e,t){0>t&&(t+=.001),this.h[e].timestampOffset=t,this.Lb(e)},i.zg=function(e,t,n){this.h[e].appendWindowStart=0,this.h[e].appendWindowEnd=n,this.h[e].appendWindowStart=t,this.Lb(e)},i.Dg=function(e){this.i[e][0].p.reject(new $(2,3,3014,this.j.error?this.j.error.code:0))},i.Lb=function(e){var t=this.i[e][0];t&&(t.p.resolve(),Dn(this,e))};var Bn=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze","cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice","is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao","mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san","sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie","vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]),Fn={$d:function(e,t){var n=e.periods.reduce((function(e,t){return e.concat(t.variants)}),[]);n=Fn.ee(n,t),n=Fn.Lf(n),n=Fn.jf(n);for(var r=Fn.kf(n),i=(n=d(e.periods)).next();!i.done;i=n.next())(i=i.value).variants=i.variants.filter((function(e){return Fn.he(e)==r||(Y.debug("Dropping Variant (better codec available)",e),!1)}))},Lf:function(e){for(var t=new Ke,n=(e=d(e)).next();!n.done;n=e.next()){n=n.value;var r=Fn.he(n);t.push(r,n)}return t},jf:function(e){var t=0,n=new Map,r=e.size();return e.forEach((function(e,i){for(var o=d(i),a=o.next();!a.done;a=o.next()){var s=(a=a.value).video;if(s&&s.width&&s.height){s=s.width*s.height*(s.frameRate||1),n.has(s)||n.set(s,new Ke);var u=n.get(s);u.push(e,a),u.size()===r&&(t=Math.max(t,s))}}})),t?n.get(t):e},kf:function(e){var t="",n=1/0;return e.forEach((function(e,r){for(var i=0,o=0,a=d(r),s=a.next();!s.done;s=a.next())i+=s.value.bandwidth||0,++o;i/=o,Y.debug("codecs",e,"avg bandwidth",i),i<n&&(t=e,n=i)})),t},he:function(e){var t="";e.video&&(t=ht(e.video.codecs)[0]);var n="";return e.audio&&(n=ht(e.audio.codecs)[0]),t+"-"+n},rd:function(e,t,n){function r(e,t,n){return e>=t&&e<=n}var i=e.video;return!(i&&i.width&&i.height&&(!r(i.width,t.minWidth,Math.min(t.maxWidth,n.width))||!r(i.height,t.minHeight,Math.min(t.maxHeight,n.height))||!r(i.width*i.height,t.minPixels,t.maxPixels))||e&&e.video&&e.video.frameRate&&!r(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||!r(e.bandwidth,t.minBandwidth,t.maxBandwidth))},Xd:function(e,t,n){var r=!1;return e.forEach((function(e){var i=e.allowedByApplication;e.allowedByApplication=Fn.rd(e,t,n),i!=e.allowedByApplication&&(r=!0)})),r},filterNewPeriod:function(e,t,n,r){r.variants=r.variants.filter((function(r){if(e&&e.Z&&!_t(e,r))return Y.debug("Dropping variant - not compatible with key system",r),!1;var i=r.audio;return r=r.video,i&&!En(i)?(Y.debug("Dropping variant - audio not compatible with platform",Fn.fb(i)),!1):r&&!En(r)||bt("Xbox One")&&r&&(r.width&&1920<r.width||r.height&&1080<r.height)&&r.codecs.includes("avc1.")?(Y.debug("Dropping variant - video not compatible with platform",Fn.fb(r)),!1):i&&t&&!Fn.Yd(i,t)?(Y.debug("Droping variant - not compatible with active audio","active audio",Fn.fb(t),"variant.audio",Fn.fb(i)),!1):!(r&&n&&!Fn.Yd(r,n)&&(Y.debug("Droping variant - not compatible with active video","active video",Fn.fb(n),"variant.video",Fn.fb(r)),1))})),r.textStreams=r.textStreams.filter((function(e){var t=yn(lt(e.mimeType,e.codecs));return t||Y.debug("Dropping text stream. Is not supported by the platform.",e),t}))},Yd:function(e,t){return e.mimeType==t.mimeType&&e.codecs.split(".")[0]==t.codecs.split(".")[0]},Oc:function(e){var t=e.audio,n=e.video,r=t?t.codecs:null,i=n?n.codecs:null,o=[];i&&o.push(i),r&&o.push(r);var a=[];n&&a.push(n.mimeType),t&&a.push(t.mimeType),a=a[0]||null;var s=[];t&&s.push(t.kind),n&&s.push(n.kind),s=s[0]||null;var u=new Set;return t&&t.roles.forEach((function(e){return u.add(e)})),n&&n.roles.forEach((function(e){return u.add(e)})),e={id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null,kind:s,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:a,codecs:o.join(", "),audioCodec:r,videoCodec:i,primary:e.primary,roles:Array.from(u),audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null},n&&(e.videoId=n.id,e.originalVideoId=n.originalId,e.width=n.width||null,e.height=n.height||null,e.frameRate=n.frameRate||null,e.pixelAspectRatio=n.pixelAspectRatio||null,e.videoBandwidth=n.bandwidth||null),t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.label=t.label,e.audioRoles=t.roles),e},Kc:function(e){return{id:e.id,active:!1,type:"text",bandwidth:0,language:e.language,label:e.label,kind:e.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:e.mimeType,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:e.originalId}},gd:function(e){return e.__shaka_id||(e.__shaka_id=Fn.Uf++),e.__shaka_id},Uf:0,Of:function(e){var t=Fn.ke(e);return t.active="disabled"!=e.mode,t.type="text",t.originalTextId=e.id,"captions"==e.kind&&(t.mimeType="application/cea-608"),e.kind&&(t.roles=[e.kind]),t},je:function(e){var t=Fn.ke(e);return t.active=e.enabled,t.type="variant",t.originalAudioId=e.id,"main"==e.kind&&(t.primary=!0),e.kind&&(t.roles=[e.kind],t.audioRoles=[e.kind]),t},ke:function(e){return{id:Fn.gd(e),active:!1,type:"",bandwidth:0,language:Un(e.language),label:e.label,kind:e.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null}},Gb:function(e){return e.allowedByApplication&&e.allowedByKeySystem},Bf:function(e){return e.filter((function(e){return Fn.Gb(e)}))},ee:function(e,t){for(var n=e.filter((function(e){return e.audio&&e.audio.channelsCount})),r=new Map,i=(n=d(n)).next();!i.done;i=n.next()){var o=(i=i.value).audio.channelsCount;r.has(o)||r.set(o,[]),r.get(o).push(i)}return 0==(n=Array.from(r.keys())).length?e:(i=n.filter((function(e){return e<=t}))).length?r.get(Math.max.apply(null,i)):r.get(Math.min.apply(null,n))},Wb:function(e,t,n){var r=e,i=e.filter((function(e){return e.primary}));i.length&&(r=i);var o=r.length?r[0].language:"";if(r=r.filter((function(e){return e.language==o})),t){var a=Kn(Un(t),e.map((function(e){return e.language})));a&&(r=e.filter((function(e){return Un(e.language)==a})))}if(n){if((e=Fn.de(r,n)).length)return e;Y.v("No exact match for the text role could be found.")}else if((e=r.filter((function(e){return 0==e.roles.length}))).length)return e;return(e=r.map((function(e){return e.roles})).reduce(fe.Rc,[])).length?Fn.de(r,e[0]):r},de:function(e,t){return e.filter((function(e){return e.roles.includes(t)}))},ie:function(e,t,n){for(var r=0;r<n.length;r++)if(n[r].audio==e&&n[r].video==t)return n[r];return null},Pf:function(e){return"audio"==e.type},Sf:function(e){return"video"==e.type},Kf:function(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),t},fb:function(e){return Fn.Pf(e)?"type=audio codecs="+e.codecs+" bandwidth="+e.bandwidth+" channelsCount="+e.channelsCount+" audioSamplingRate="+e.audioSamplingRate:Fn.Sf(e)?"type=video codecs="+e.codecs+" bandwidth="+e.bandwidth+" frameRate="+e.frameRate+" width="+e.width+" height="+e.height:"unexpected stream type"}};function Vn(){this.m=null,this.i=!1,this.h=new X,this.l=[],this.o=!1,this.g=this.j=null}function Hn(e,t){return e&&(t=t.filter((function(t){return Fn.rd(t,e,{width:1/0,height:1/0})}))),t.sort((function(e,t){return e.bandwidth-t.bandwidth}))}function qn(e,t){this.g=e,this.h=t}function zn(e,t){var n=new qn(2,6),r=Xn,i=r.g,o=n.h-i.h;(0<(n.g-i.g||o)?r.i:r.h)(r.g,n,e,t)}function Gn(e,t,n,r){Y.ba([n,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",r].join(" "))}function Wn(e,t,n,r){Y.kc([n,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",r].join(""))}H("shaka.abr.SimpleAbrManager",Vn),Vn.prototype.stop=function(){this.m=null,this.i=!1,this.l=[],this.j=null},Vn.prototype.stop=Vn.prototype.stop,Vn.prototype.init=function(e){this.m=e},Vn.prototype.init=Vn.prototype.init,Vn.prototype.chooseVariant=function(){var e=Hn(this.g.restrictions,this.l),t=this.h.getBandwidthEstimate(this.g.defaultBandwidthEstimate);this.l.length&&!e.length&&(Y.v("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),e=[(e=Hn(null,this.l))[0]]);for(var n=e[0]||null,r=0;r<e.length;++r){var i=e[r],o=i.bandwidth/this.g.bandwidthDowngradeTarget,a=(e[r+1]||{bandwidth:1/0}).bandwidth/this.g.bandwidthUpgradeTarget;Y.O("Bandwidth ranges:",(i.bandwidth/1e6).toFixed(3),(o/1e6).toFixed(3),(a/1e6).toFixed(3)),t>=o&&t<=a&&(n=i)}return this.j=Date.now(),n},Vn.prototype.chooseVariant=Vn.prototype.chooseVariant,Vn.prototype.enable=function(){this.i=!0},Vn.prototype.enable=Vn.prototype.enable,Vn.prototype.disable=function(){this.i=!1},Vn.prototype.disable=Vn.prototype.disable,Vn.prototype.segmentDownloaded=function(e,t){Y.O("Segment downloaded:","deltaTimeMs="+e,"numBytes="+t,"lastTimeChosenMs="+this.j,"enabled="+this.i);var n=this.h;if(!(16e3>t)){var r=8e3*t/e,i=e/1e3;n.g+=t,G(n.h,i,r),G(n.i,i,r)}if(null!=this.j&&this.i)e:{if(Y.O("Suggesting Streams..."),this.o){if(Date.now()-this.j<1e3*this.g.switchInterval){Y.O("Still within switch interval...");break e}}else{if(!(128e3<=this.h.g)){Y.O("Still waiting for a good estimate...");break e}this.o=!0}n=this.chooseVariant(),r=this.h.getBandwidthEstimate(this.g.defaultBandwidthEstimate),Y.debug("Calling switch_(), bandwidth="+Math.round(r/1e3)+" kbps"),this.m(n)}},Vn.prototype.segmentDownloaded=Vn.prototype.segmentDownloaded,Vn.prototype.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate(this.g.defaultBandwidthEstimate)},Vn.prototype.getBandwidthEstimate=Vn.prototype.getBandwidthEstimate,Vn.prototype.setVariants=function(e){this.l=e},Vn.prototype.setVariants=Vn.prototype.setVariants,Vn.prototype.configure=function(e){this.g=e},Vn.prototype.configure=Vn.prototype.configure,qn.prototype.toString=function(){return"v"+this.g+"."+this.h};var Xn=null,Yn="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),$n="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Jn=["loop","playbackRate"],Qn=["pause","play"],Zn="abrstatuschanged adaptation buffering drmsessionupdate emsg error expirationupdated largegap loading manifestparsed onstatechange onstateidle streaming textchanged texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading variantchanged".split(" "),er={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,usingEmbeddedTextTrack:2,getLoadMode:10},tr={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},nr=[["getConfiguration","configure"]],rr=[["isTextTrackVisible","setTextTrackVisibility"]],ir="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay".split(" "),or=["attach","detach","load","unload"];function ar(e){return JSON.stringify(e,(function(e,n){if("function"!=typeof n){if(n instanceof Event||n instanceof _e){var r={};for(o in n){var i=n[o];i&&"object"==t(i)?"detail"==o&&(r[o]=i):o in Event||(r[o]=i)}return r}if(n instanceof Error){var o=new Set(["name","message","stack"]);for(r in n)o.add(r);for(r=(i=d(Object.getOwnPropertyNames(n))).next();!r.done;r=i.next())o.add(r.value);for(i={},r=(o=d(o)).next();!r.done;r=o.next())i[r=r.value]=n[r];o={__type__:"Error",contents:i}}else if(n instanceof TimeRanges)for(o={__type__:"TimeRanges",length:n.length,start:[],end:[]},r=0;r<n.length;++r)o.start.push(n.start(r)),o.end.push(n.end(r));else o=n instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(n)}:"number"==typeof n?isNaN(n)?"NaN":isFinite(n)?n:0>n?"-Infinity":"Infinity":n;return o}}))}function sr(e){return JSON.parse(e,(function(e,n){if("NaN"==n)var r=NaN;else if("-Infinity"==n)r=-1/0;else if("Infinity"==n)r=1/0;else if(n&&"object"==t(n)&&"TimeRanges"==n.__type__)r=function(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}(n);else if(n&&"object"==t(n)&&"Uint8Array"==n.__type__)r=new Uint8Array(n.entries);else if(n&&"object"==t(n)&&"Error"==n.__type__){r=n.contents;var i,o=Error(r.message);for(i in r)o[i]=r[i];r=o}else r=n;return r}))}function ur(e,t,n,r,i,o){this.X=e,this.j=new Pe(t),this.Z=n,this.u=!1,this.F=r,this.P=i,this.L=o,this.h=this.m=!1,this.M="",this.o=null,this.A=this.yd.bind(this),this.C=this.ag.bind(this),this.g={video:{},player:{}},this.J=0,this.i={},this.l=null,vr.add(this)}var cr=!1,lr=null;function fr(e){for(var t=d(vr),n=t.next();!n.done;n=t.next())hr(n.value,e)}function hr(e,t){Y.debug("CastSender: onExistingSessionJoined");var n=e.L();e.l=new me,e.u=!0,e.Ad(n,t)}function dr(e){for(var t=d(vr),n=t.next();!n.done;n=t.next()){n=n.value;var r=e;Y.debug("CastSender: receiver status",r),cr="available"==r,n.j.Lc()}}function pr(e){var t=lr;t.removeUpdateListener(e.A),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.C)}function gr(e){for(var t in e.i){var n=e.i[t];delete e.i[t],n.reject(new $(1,7,7e3))}}function mr(e,t){var n=ar(t),r=lr;try{r.sendMessage("urn:x-cast:com.google.shaka.v2",n,(function(){}),Y.error)}catch(i){throw Y.error("Cast session sendMessage threw",i),n=new $(2,8,8005,i),e.F("player",new _e("error",{detail:n})),e.Bb(),n}}(i=ur.prototype).destroy=function(){return vr.delete(this),gr(this),lr&&pr(this),this.j&&(this.j.stop(),this.j=null),this.P=this.F=null,this.h=this.m=!1,this.C=this.A=this.l=this.i=this.g=this.o=null,Promise.resolve()},i.la=function(){return this.h},i.Dd=function(){return this.M},i.init=function(){if(this.X.length)if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.j.Lc();var t=new chrome.cast.SessionRequest(this.X);t=new chrome.cast.ApiConfig(t,fr.bind(this),dr.bind(this),"origin_scoped"),chrome.cast.initialize(t,(function(){Y.debug("CastSender: init")}),(function(e){Y.error("CastSender: init error",e)})),cr&&this.j.V(.02),(t=lr)&&t.status!=chrome.cast.SessionStatus.STOPPED?(Y.debug("CastSender: re-using existing connection"),hr(this,t)):lr=null}else e.__onGCastApiAvailable||(e.__onGCastApiAvailable=yr),e.__onGCastApiAvailable!=yr&&Y.ba("A global Cast SDK hook is already installed! Shaka Player will be unable to receive a notification when the Cast SDK is ready.")},i.Md=function(e){this.o=e,this.h&&mr(this,{type:"appData",appData:this.o})},i.cast=function(e){return this.m?cr?this.h?Promise.reject(new $(1,8,8002)):(this.l=new me,chrome.cast.requestSession(this.Ad.bind(this,e),this.ve.bind(this)),this.l):Promise.reject(new $(1,8,8001)):Promise.reject(new $(1,8,8e3))},i.Bb=function(){if(this.h){if(gr(this),lr){pr(this);try{lr.stop((function(){}),(function(){}))}catch(u){}lr=null}this.yd()}},i.get=function(e,t){if("video"==e){if(Qn.includes(t))return this.Ee.bind(this,e,t)}else if("player"==e){if(tr[t]&&!this.get("player","isLive")())return function(){};if(ir.includes(t))return this.Ee.bind(this,e,t);if(or.includes(t))return this.rg.bind(this,e,t);if(er[t])return this.Be.bind(this,e,t)}return this.Be(e,t)},i.set=function(e,t,n){this.g[e][t]=n,mr(this,{type:"set",targetName:e,property:t,value:n})},i.Ad=function(e,t){Y.debug("CastSender: onSessionInitiated"),lr=t,t.addUpdateListener(this.A),t.addMessageListener("urn:x-cast:com.google.shaka.v2",this.C),this.yd(),mr(this,{type:"init",initState:e,appData:this.o}),this.l.resolve()},i.ve=function(e){var t=8003;switch(e.code){case"cancel":t=8004;break;case"timeout":t=8005;break;case"receiver_unavailable":t=8006}this.l.reject(new $(2,8,t,e))},i.Be=function(e,t){return this.g[e][t]},i.Ee=function(e,t,n){for(var r=[],i=2;i<arguments.length;++i)r[i-2]=arguments[i];mr(this,{type:"call",targetName:e,methodName:t,args:r})},i.rg=function(e,t,n){for(var r=[],i=2;i<arguments.length;++i)r[i-2]=arguments[i];i=new me;var o=this.J.toString();this.J++,this.i[o]=i;try{mr(this,{type:"asyncCall",targetName:e,methodName:t,args:r,id:o})}catch(a){i.reject(a)}return i},i.yd=function(){var e=!!lr&&"connected"==lr.status;if(Y.debug("CastSender: connection status",e),this.h&&!e){for(var t in this.P(),this.g)this.g[t]={};gr(this)}this.M=(this.h=e)?lr.receiver.friendlyName:"",this.j.Lc()},i.ag=function(e,t){var n=sr(t);switch(Y.O("CastSender: message",n),n.type){case"event":var r=n.event;this.F(n.targetName,new _e(r.type,r));break;case"update":for(var i in r=n.update)for(var o in n=this.g[i]||{},r[i])n[o]=r[i][o];this.u&&(this.Z(),this.u=!1);break;case"asyncComplete":if(i=n.id,n=n.error,o=this.i[i],delete this.i[i],o)if(n){for(r in i=new $(n.severity,n.category,n.code),n)i[r]=n[r];o.reject(i)}else o.resolve()}};var vr=new Set;function yr(e){if(e)for(var t=(e=d(vr)).next();!t.done;t=e.next())t.value.init()}function br(e,t,n){var r=this;Be.call(this),this.i=e,this.h=t,this.o=this.l=this.j=this.u=this.m=null,this.C=n,this.A=new Map,this.g=new ur(n,(function(){return Sr(r)}),(function(){return Er(r)}),(function(e,t){return kr(r,e,t)}),(function(){return xr(r)}),(function(){return Tr(r)})),function(e){for(var t in e.g.init(),e.o=new tt,Yn.forEach(function(e){this.o.H(this.i,e,this.L.bind(this))}.bind(e)),Zn.forEach(function(e){this.o.H(this.h,e,this.F.bind(this))}.bind(e)),e.m={},e.i)Object.defineProperty(e.m,t,{configurable:!1,enumerable:!0,get:e.J.bind(e,t),set:e.M.bind(e,t)});e.u={},wr(e,(function(t){Object.defineProperty(e.u,t,{configurable:!1,enumerable:!0,get:function(){return Ar(e,t)}})})),function(e){var t=new Map;wr(e,(function(n,r){if(t.has(r)){var i=t.get(r);n.length<i.length?e.A.set(n,i):e.A.set(i,n)}else t.set(r,n)}))}(e),e.j=new Be,e.j.jc=e.m,e.l=new Be,e.l.jc=e.u}(this)}function wr(e,t){function n(e){return"constructor"!=e&&"function"==typeof r[e]&&!i.has(e)}var r=e.h,i=new Set;for(o in r)n(o)&&(i.add(o),t(o,r[o]));for(var o=Object.getPrototypeOf(r),a=Object.getPrototypeOf({});o&&o!=a;){for(var s=d(Object.getOwnPropertyNames(o)),u=s.next();!u.done;u=s.next())n(u=u.value)&&(i.add(u),t(u,r[u]));o=Object.getPrototypeOf(o)}}function Tr(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.h.tc(),startTime:null};return e.i.pause(),Jn.forEach(function(e){t.video[e]=this.i[e]}.bind(e)),e.i.ended||(t.startTime=e.i.currentTime),nr.forEach(function(e){var n=e[1];e=this.h[e[0]](),t.player[n]=e}.bind(e)),rr.forEach(function(e){var n=e[1];e=this.h[e[0]](),t.playerAfterLoad[n]=e}.bind(e)),t}function Sr(e){e.dispatchEvent(new _e("caststatuschanged"))}function Er(e){e.j.dispatchEvent(new _e(e.m.paused?"pause":"play"))}function xr(e){nr.forEach(function(e){var t=e[1];e=this.g.get("player",e[0])(),this.h[t](e)}.bind(e));var t=e.g.get("player","getAssetUri")(),n=e.g.get("video","ended"),r=Promise.resolve(),i=e.i.autoplay,o=null;n||(o=e.g.get("video","currentTime")),t&&(e.i.autoplay=!1,r=e.h.load(t,o));var a={};Jn.forEach(function(e){a[e]=this.g.get("video",e)}.bind(e)),r.then((function(){e.i&&(Jn.forEach(function(e){this.i[e]=a[e]}.bind(e)),rr.forEach(function(e){var t=e[1];e=this.g.get("player",e[0])(),this.h[t](e)}.bind(e)),e.i.autoplay=i,t&&e.i.play())}),(function(t){e.h.dispatchEvent(new _e("error",{detail:t}))}))}function Ar(e,t){if(e.A.has(t)&&(t=e.A.get(t)),"addEventListener"==t)return e.l.addEventListener.bind(e.l);if("removeEventListener"==t)return e.l.removeEventListener.bind(e.l);if("getMediaElement"==t)return function(){return this.m}.bind(e);if("getSharedConfiguration"==t)return Y.v("Can't share configuration across a network. Returning copy."),e.g.get("player","getConfiguration");if("getNetworkingEngine"==t)return e.g.la()&&Y.v("NOTE: getNetworkingEngine() is always local!"),e.h.Yb.bind(e.h);if(e.g.la()){if("getManifest"==t||"drmInfo"==t)return function(){return Y.ba(t+"() does not work while casting!"),null};if("getManifestUri"==t)return zn("getManifestUri",'Please use "getAssetUri" instead.'),Ar(e,"getAssetUri");if("attach"==t||"detach"==t)return function(){return Y.ba(t+"() does not work while casting!"),Promise.resolve()}}return e.g.la()&&0==Object.keys(e.g.g.video).length&&er[t]||!e.g.la()?e.h[t].bind(e.h):e.g.get("player",t)}function kr(e,t,n){e.g.la()&&("video"==t?e.j.dispatchEvent(n):"player"==t&&e.l.dispatchEvent(n))}function Ir(e,t,n,r){var i=this;Be.call(this),this.g=e,this.h=t,this.i=new tt,this.L={video:e,player:t},this.C=n||function(){},this.M=r||function(e){return e},this.F=!1,this.m=!0,this.l=0,this.A=!1,this.u=!0,this.o=this.j=null,this.J=new Pe((function(){Pr(i)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=e.xe.bind(e),t.onSenderDisconnected=e.xe.bind(e),t.onSystemVolumeChanged=e.hf.bind(e),e.o=t.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.o.onMessage=e.Wf.bind(e),e.j=t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.j.onMessage=e.fg.bind(e),t.start(),Yn.forEach(function(e){this.i.H(this.g,e,this.Ce.bind(this,"video"))}.bind(e)),Zn.forEach(function(e){this.i.H(this.h,e,this.Ce.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.h.Nd(3840,2160):e.h.Nd(1920,1080),e.i.H(e.g,"loadeddata",function(){this.A=!0}.bind(e)),e.i.H(e.h,"loading",function(){this.m=!1,Mr(this)}.bind(e)),e.i.H(e.g,"playing",function(){this.m=!1,Mr(this)}.bind(e)),e.i.H(e.g,"pause",function(){Mr(this)}.bind(e)),e.i.H(e.h,"unloading",function(){this.m=!0,Mr(this)}.bind(e)),e.i.H(e.g,"ended",function(){var e=this;new Pe((function(){e.g&&e.g.ended&&(e.m=!0,Mr(e))})).V(5)}.bind(e))}(this)}function Mr(e){Promise.resolve().then(function(){this.h&&(this.dispatchEvent(new _e("caststatuschanged")),Rr(this)||jr(this))}.bind(e))}function Pr(e){e.J.V(.5);var t={video:{},player:{}};if($n.forEach(function(e){t.video[e]=this.g[e]}.bind(e)),e.h.aa())for(var n in tr)0==e.l%tr[n]&&(t.player[n]=e.h[n]());for(var r in er)0==e.l%er[r]&&(t.player[r]=e.h[r]());(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),e.A&&(e.l+=1),Nr(e,{type:"update",update:t},e.j),Rr(e)}function Rr(e){return!(!e.u||!e.g.duration&&!e.h.aa()||(Cr(e),e.u=!1,0))}function Cr(e,t){t=void 0===t?0:t;var n={contentId:e.h.tc(),streamType:e.h.aa()?"LIVE":"BUFFERED",contentType:""};e.h.aa()||(n.duration=e.g.duration),jr(e,t,n)}function Nr(e,t,n,r){e.F&&(e=ar(t),r?n.getCastChannel(r).send(e):n.broadcast(e))}function jr(e,t,n){t=void 0===t?0:t,n=void 0===n?null:n;var r=e.g.playbackRate,i=Dr;r={mediaSessionId:0,playbackRate:r,playerState:i=e.m?i.IDLE:e.h.jd()?i.Re:e.g.paused?i.Te:i.Ue,currentTime:e.g.currentTime,supportedMediaCommands:63,volume:{level:e.g.volume,muted:e.g.muted}},n&&(r.media=n),Nr(e,{requestId:t,type:"MEDIA_STATUS",status:[r]},e.o)}q(br,Be),H("shaka.cast.CastProxy",br),br.prototype.destroy=function(e){return e&&this.g.Bb(),this.o&&(this.o.release(),this.o=null),e=[],this.h&&(e.push(this.h.destroy()),this.h=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.u=this.m=this.i=null,Promise.all(e)},br.prototype.destroy=br.prototype.destroy,br.prototype.Mf=function(){return this.m},br.prototype.getVideo=br.prototype.Mf,br.prototype.Df=function(){return this.u},br.prototype.getPlayer=br.prototype.Df,br.prototype.Ye=function(){return this.g.m&&cr},br.prototype.canCast=br.prototype.Ye,br.prototype.la=function(){return this.g.la()},br.prototype.isCasting=br.prototype.la,br.prototype.Dd=function(){return this.g.Dd()},br.prototype.receiverName=br.prototype.Dd,br.prototype.cast=function(){var e=Tr(this);return this.g.cast(e).then(function(){if(this.h)return this.h.Ud()}.bind(this))},br.prototype.cast=br.prototype.cast,br.prototype.Md=function(e){this.g.Md(e)},br.prototype.setAppData=br.prototype.Md,br.prototype.Kg=function(){var e=this.g;if(e.h){var t=e.L();chrome.cast.requestSession(e.Ad.bind(e,t),e.ve.bind(e))}},br.prototype.suggestDisconnect=br.prototype.Kg,br.prototype.af=function(e){var t=this;return g((function n(){return U(n,(function(n){switch(n.s){case 1:return e==t.C?n.return():(t.C=e,t.g.Bb(),A(n,t.g.destroy(),2));case 2:t.g=null,t.g=new ur(e,(function(){return Sr(t)}),(function(){return Er(t)}),(function(e,n){return kr(t,e,n)}),(function(){return xr(t)}),(function(){return Tr(t)})),t.g.init(),k(n)}}))}))},br.prototype.changeReceiverId=br.prototype.af,br.prototype.Bb=function(){this.g.Bb()},br.prototype.forceDisconnect=br.prototype.Bb,br.prototype.J=function(e){if("addEventListener"==e)return this.j.addEventListener.bind(this.j);if("removeEventListener"==e)return this.j.removeEventListener.bind(this.j);if(this.g.la()&&0==Object.keys(this.g.g.video).length){var t=this.i[e];if("function"!=typeof t)return t}return this.g.la()?this.g.get("video",e):("function"==typeof(e=this.i[e])&&(e=e.bind(this.i)),e)},br.prototype.M=function(e,t){this.g.la()?this.g.set("video",e,t):this.i[e]=t},br.prototype.L=function(e){this.g.la()||this.j.dispatchEvent(new _e(e.type,e))},br.prototype.F=function(e){this.g.la()||this.l.dispatchEvent(e)},q(Ir,Be),H("shaka.cast.CastReceiver",Ir),Ir.prototype.isConnected=function(){return this.F},Ir.prototype.isConnected=Ir.prototype.isConnected,Ir.prototype.Rf=function(){return this.m},Ir.prototype.isIdle=Ir.prototype.Rf,Ir.prototype.destroy=function(){var e=this;return g((function t(){var n;return U(t,(function(t){switch(t.s){case 1:return e.i&&(e.i.release(),e.i=null),n=[],e.h&&(n.push(e.h.destroy()),e.h=null),e.J&&(e.J.stop(),e.J=null),e.g=null,e.L=null,e.C=null,e.F=!1,e.m=!0,e.j=null,e.o=null,A(t,Promise.all(n),2);case 2:cast.receiver.CastReceiverManager.getInstance().stop(),k(t)}}))}))},Ir.prototype.destroy=Ir.prototype.destroy,(i=Ir.prototype).xe=function(){this.l=0,this.u=!0,this.F=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Mr(this)},i.Ce=function(e,t){this.h&&(Pr(this),Nr(this,{type:"event",targetName:e,event:t},this.j))},i.hf=function(){var e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();e&&Nr(this,{type:"update",update:{video:{volume:e.level,muted:e.muted}}},this.j),Nr(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.j)},i.fg=function(e){var t=sr(e.data);switch(Y.debug("CastReceiver: message",t),t.type){case"init":this.l=0,this.A=!1,this.u=!0,function(e,t,n){for(var r in t.player)e.h[r](t.player[r]);e.C(n),n=Promise.resolve();var i=e.g.autoplay;t.manifest&&(e.g.autoplay=!1,n=e.h.load(t.manifest,t.startTime)),n.then((function(){if(e.h){for(var n in t.video)e.g[n]=t.video[n];for(var r in t.playerAfterLoad)e.h[r](t.playerAfterLoad[r]);e.g.autoplay=i,t.manifest&&(e.g.play(),jr(e))}}),(function(t){e.h.dispatchEvent(new _e("error",{detail:t}))}))}(this,t.initState,t.appData),Pr(this);break;case"appData":this.C(t.appData);break;case"set":var n=t.targetName,r=t.property;if(t=t.value,"video"==n){var i=cast.receiver.CastReceiverManager.getInstance();if("volume"==r){i.setSystemVolumeLevel(t);break}if("muted"==r){i.setSystemVolumeMuted(t);break}}this.L[n][r]=t;break;case"call":(n=this.L[t.targetName])[t.methodName].apply(n,t.args);break;case"asyncCall":n=t.targetName,r=t.methodName,"player"==n&&"load"==r&&(this.l=0,this.A=!1),i=t.id,e=e.senderId;var o=this.L[n];t=o[r].apply(o,t.args),"player"==n&&"load"==r&&(t=t.then(function(){this.u=!0}.bind(this))),t.then(this.Je.bind(this,e,i,null),this.Je.bind(this,e,i))}},i.Wf=function(e){var t=sr(e.data);switch(Y.debug("CastReceiver: message",t),t.type){case"PLAY":this.g.play(),jr(this);break;case"PAUSE":this.g.pause(),jr(this);break;case"SEEK":e=t.currentTime;var n=t.resumeState;null!=e&&(this.g.currentTime=Number(e)),n&&"PLAYBACK_START"==n?(this.g.play(),jr(this)):n&&"PLAYBACK_PAUSE"==n&&(this.g.pause(),jr(this));break;case"STOP":this.h.Ud().then(function(){this.h&&jr(this)}.bind(this));break;case"GET_STATUS":Cr(this,Number(t.requestId));break;case"VOLUME":e=(n=t.volume).level,n=n.muted;var r=this.g.volume,i=this.g.muted;null!=e&&(this.g.volume=Number(e)),null!=n&&(this.g.muted=n),r==this.g.volume&&i==this.g.muted||jr(this);break;case"LOAD":this.l=0,this.u=this.A=!1,e=t.media,n=t.currentTime,r=this.M(e.contentId),i=t.autoplay||!0,this.C(e.customData),i&&(this.g.autoplay=!0),this.h.load(r,n).then(function(){this.h&&Cr(this)}.bind(this)).catch(function(e){var n="LOAD_FAILED";7==e.category&&7e3==e.code&&(n="LOAD_CANCELLED"),Nr(this,{requestId:Number(t.requestId),type:n},this.o)}.bind(this));break;default:Y.v("Unrecognized message type from the generic Chromecast controller!",t.type),Nr(this,{requestId:Number(t.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.o)}},i.Je=function(e,t,n){this.h&&Nr(this,{type:"asyncComplete",id:t,error:n},this.j,e)};var Dr={IDLE:"IDLE",Ue:"PLAYING",Re:"BUFFERING",Te:"PAUSED"};function Or(e,t){this.S=e,this.h=t==Lr,this.g=0}H("shaka.util.DataViewReader",Or);var Lr=1;function Ur(){throw new $(2,3,3e3)}function _r(){this.i=[],this.h=[],this.g=!1}function Kr(e){for(var t=qr(e);e.reader.Ca()&&!e.parser.g;)e.parser.Fc(e.start+t,e.reader,e.partialOkay)}function Br(e){for(var t=qr(e),n=e.reader.N();0<n&&!e.parser.g;--n)e.parser.Fc(e.start+t,e.reader,e.partialOkay)}function Fr(e){return function(t){e(t.reader.mb(t.reader.S.byteLength-t.reader.ka()))}}function Vr(e){for(var t=0,n=0;n<e.length;n++)t=t<<8|e.charCodeAt(n);return t}function Hr(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function qr(e){return 8+(e.has64BitSize?8:0)+(null!=e.flags?4:0)}function zr(e){var t=this;this.g=[],this.h=[],this.data=[],(new _r).box("moov",Kr).ma("pssh",(function(e){if(1<e.version)Y.v("Unrecognized PSSH version found!");else{var n=e.reader.S;if(n=new Uint8Array(n.buffer,n.byteOffset-12,e.size),t.data.push(n),t.g.push(xe.Nc(e.reader.mb(16))),0<e.version){n=e.reader.N();for(var r=0;r<n;++r){var i=xe.Nc(e.reader.mb(16));t.h.push(i)}}}})).parse(e),0==this.data.length&&Y.v("No pssh box found!")}Or.Endianness={Tg:0,Vg:Lr},Or.prototype.Ca=function(){return this.g<this.S.byteLength},Or.prototype.hasMoreData=Or.prototype.Ca,Or.prototype.ka=function(){return this.g},Or.prototype.getPosition=Or.prototype.ka,Or.prototype.sf=function(){return this.S.byteLength},Or.prototype.getLength=Or.prototype.sf,Or.prototype.ra=function(){try{var e=this.S.getUint8(this.g);return this.g+=1,e}catch(t){Ur()}},Or.prototype.readUint8=Or.prototype.ra,Or.prototype.dc=function(){try{var e=this.S.getUint16(this.g,this.h);return this.g+=2,e}catch(t){Ur()}},Or.prototype.readUint16=Or.prototype.dc,Or.prototype.N=function(){try{var e=this.S.getUint32(this.g,this.h);return this.g+=4,e}catch(t){Ur()}},Or.prototype.readUint32=Or.prototype.N,Or.prototype.De=function(){try{var e=this.S.getInt32(this.g,this.h);return this.g+=4,e}catch(t){Ur()}},Or.prototype.readInt32=Or.prototype.De,Or.prototype.Pb=function(){try{if(this.h)var e=this.S.getUint32(this.g,!0),t=this.S.getUint32(this.g+4,!0);else t=this.S.getUint32(this.g,!1),e=this.S.getUint32(this.g+4,!1)}catch(n){Ur()}if(2097151<t)throw new $(2,3,3001);return this.g+=8,t*Math.pow(2,32)+e},Or.prototype.readUint64=Or.prototype.Pb,Or.prototype.mb=function(e){this.g+e>this.S.byteLength&&Ur();var t=new Uint8Array(this.S.buffer,this.S.byteOffset+this.g,e);return this.g+=e,t},Or.prototype.readBytes=Or.prototype.mb,Or.prototype.U=function(e){this.g+e>this.S.byteLength&&Ur(),this.g+=e},Or.prototype.skip=Or.prototype.U,Or.prototype.Fe=function(e){this.g<e&&Ur(),this.g-=e},Or.prototype.rewind=Or.prototype.Fe,Or.prototype.seek=function(e){(0>e||e>this.S.byteLength)&&Ur(),this.g=e},Or.prototype.seek=Or.prototype.seek,Or.prototype.Cd=function(){for(var e=this.g;this.Ca()&&0!=this.S.getUint8(this.g);)this.g+=1;return e=new Uint8Array(this.S.buffer,this.S.byteOffset+e,this.g-e),this.g+=1,ve(e)},Or.prototype.readTerminatedString=Or.prototype.Cd,H("shaka.util.Mp4Parser",_r),_r.prototype.box=function(e,t){var n=Vr(e);return this.i[n]=0,this.h[n]=t,this},_r.prototype.box=_r.prototype.box,_r.prototype.ma=function(e,t){var n=Vr(e);return this.i[n]=1,this.h[n]=t,this},_r.prototype.fullBox=_r.prototype.ma,_r.prototype.stop=function(){this.g=!0},_r.prototype.stop=_r.prototype.stop,_r.prototype.parse=function(e,t){var n=new Uint8Array(e);for(n=new Or(new DataView(n.buffer,n.byteOffset,n.byteLength),0),this.g=!1;n.Ca()&&!this.g;)this.Fc(0,n,t)},_r.prototype.parse=_r.prototype.parse,_r.prototype.Fc=function(e,t,n){var r=t.ka(),i=t.N(),o=t.N(),a=!1;switch(Y.O("Parsing MP4 box",Hr(o)),i){case 0:i=t.S.byteLength-r;break;case 1:i=t.Pb(),a=!0}var s=this.h[o];if(s){var u=null,c=null;1==this.i[o]&&(u=(c=t.N())>>>24,c&=16777215),o=r+i,n&&o>t.S.byteLength&&(o=t.S.byteLength),o-=t.ka(),t=0<o?t.mb(o):new Uint8Array(0),s({parser:this,partialOkay:n||!1,version:u,flags:c,reader:t=new Or(new DataView(t.buffer,t.byteOffset,t.byteLength),0),size:i,start:r+e,has64BitSize:a})}else t.U(Math.min(r+i-t.ka(),t.S.byteLength-t.ka()))},_r.prototype.parseNext=_r.prototype.Fc,_r.children=Kr,_r.sampleDescription=Br,_r.allData=Fr,_r.typeToString=Hr,_r.headerSize=qr;var Gr={sc:function(e,t){var n=Gr.Y(e,t);return 1!=n.length?null:n[0]},Yc:function(e,t,n){return 1!=(e=Gr.fe(e,t,n)).length?null:e[0]},Y:function(e,t){return Array.prototype.filter.call(e.childNodes,(function(e){return e instanceof Element&&e.tagName==t}))},fe:function(e,t,n){return Array.prototype.filter.call(e.childNodes,(function(e){return e instanceof Element&&e.localName==n&&e.namespaceURI==t}))},getAttributeNS:function(e,t,n){return e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null},uc:function(e){return Array.prototype.every.call(e.childNodes,(function(e){return e.nodeType==Node.TEXT_NODE||e.nodeType==Node.CDATA_SECTION_NODE}))?e.textContent.trim():null},R:function(e,t,n,r){r=void 0===r?null:r;var i=null;return null!=(e=e.getAttribute(t))&&(i=n(e)),null==i?r:i},jg:function(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:Math.floor(e/1e3)):null},Ma:function(e){if(!e)return null;var t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(e);return t?(e=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(e)?e:null):(Y.v("Invalid duration string:",e),null)},Hc:function(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null},parseInt:function(e){return 0==(e=Number(e))%1?e:null},Gc:function(e){return 0==(e=Number(e))%1&&0<e?e:null},Mb:function(e){return 0==(e=Number(e))%1&&0<=e?e:null},parseFloat:function(e){return e=Number(e),isNaN(e)?null:e},ff:function(e){var t;return e=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e),isNaN(e)?null:e},Ae:function(e,t){var n=new DOMParser;try{var r=n.parseFromString(e,"text/xml")}catch(o){}if(r&&r.documentElement.tagName==t)var i=r.documentElement;return i&&0<i.getElementsByTagName("parsererror").length?null:i},ze:function(e,t){try{var n=ve(e);return Gr.Ae(n,t)}catch(r){}}},Wr=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b","org.w3.clearkey").set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine.alpha").set("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95","com.microsoft.playready").set("urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95","com.microsoft.playready").set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb","com.adobe.primetime");function Xr(e,t,n){var r=function(e){for(var t=[],n=(e=d(e)).next();!n.done;n=e.next())(n=Jr(n.value))&&t.push(n);return t}(e),i=null;e=[];var o=[],a=new Set(r.map((function(e){return e.keyId})));if(a.delete(null),1<a.size)throw new $(2,4,4010);if(n||(o=r.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"!=e.Ge||(i=e.init||i,!1)}))).length&&(e=function(e,t,n){for(var r=[],i=(n=d(n)).next();!i.done;i=n.next()){i=i.value;var o=Wr.get(i.Ge);if(o){var a;if(a=Gr.Yc(i.node,"urn:microsoft:playready","pro")){a=xe.Ja(a.textContent);var s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),u=a.length,c=s.length+16+u,l=new ArrayBuffer(c),f=new Uint8Array(l),h=0;(l=new DataView(l)).setUint32(h,c),h+=4,l.setUint32(h,1886614376),h+=4,l.setUint32(h,0),h+=4,f.set(s,h),h+=s.length,l.setUint32(h,u),h+=4,f.set(a,h),a=[{initData:f,initDataType:"cenc",keyId:i.keyId}]}else a=null;a=de(o,i.init||e||a),(o=$r.get(o))&&(a.licenseServerUri=o(i)),r.push(a)}else for(o=(i=d(i=t(i.node)||[])).next();!o.done;o=i.next())r.push(o.value)}return r}(i,t,o),0==e.length&&(e=[de("",i)])),r.length&&(n||!o.length))for(e=[],n=(t=d(Wr.values())).next();!n.done;n=t.next())"org.w3.clearkey"!=(n=n.value)&&e.push(de(n,i));if(a=Array.from(a)[0]||null)for(n=(t=d(e)).next();!n.done;n=t.next())for(r=(n=d(n.value.initData)).next();!r.done;r=n.next())r.value.keyId=a;return{be:a,Xg:i,drmInfos:e,ge:!0}}var Yr,$r=(new Map).set("com.widevine.alpha",(function(e){return(e=Gr.Yc(e.node,"urn:microsoft","laurl"))&&e.getAttribute("licenseUrl")||""})).set("com.microsoft.playready",(function(e){return(e=Gr.Yc(e.node,"urn:microsoft:playready","pro"))&&(e=function(e){var t=0,n=new DataView(e).getUint32(t,!0);if(t+=4,n!==e.byteLength)return Y.v("PlayReady Object with invalid length encountered."),[];t+=2,n=[];for(var r=new DataView(e);t<e.byteLength-1;){var i=r.getUint16(t,!0);t+=2;var o=r.getUint16(t,!0);t+=2;var a=new Uint8Array(e,t,o);n.push({type:i,value:a}),t+=o}return n}((e=xe.Ja(e.textContent)).buffer).filter((function(e){return 1===e.type}))[0])?(e=ye(e.value,!0),(e=Gr.Ae(e,"WRMHEADER"))?function(e){for(var t=(e=d(e.getElementsByTagName("DATA"))).next();!t.done;t=e.next())for(var n=(t=d(t.value.childNodes)).next();!n.done;n=t.next())if((n=n.value)instanceof Element&&"LA_URL"==n.tagName)return n.textContent;return""}(e):""):""}));function Jr(e){var t=e.getAttribute("schemeIdUri"),n=Gr.getAttributeNS(e,"urn:mpeg:cenc:2013","default_KID"),r=Gr.fe(e,"urn:mpeg:cenc:2013","pssh").map(Gr.uc);if(!t)return Y.error("Missing required schemeIdUri attribute on","ContentProtection element",e),null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase()).includes(" "))throw new $(2,4,4009);var i=[];try{i=r.map((function(e){return{initDataType:"cenc",initData:xe.Ja(e),keyId:null}}))}catch(o){throw new $(2,4,4007)}return{node:e,Ge:t,keyId:n,init:0<i.length?i:null}}function Qr(t,n,r,i,o){var a={RepresentationID:n,Number:r,Bandwidth:i,Time:o};return t.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(n,r,i,o){if("$$"==n)return"$";var s=a[r];if(null==s)return Y.v("URL template does not have an available substitution for identifier",'"'+r+'":',t),n;switch("RepresentationID"==r&&i&&(Y.v("URL template should not contain a width specifier for identifier",'"RepresentationID":',t),i=void 0),"Time"==r&&(s=Math.round(s)),o){case void 0:case"d":case"i":case"u":n=s.toString();break;case"o":n=s.toString(8);break;case"x":n=s.toString(16);break;case"X":n=s.toString(16).toUpperCase();break;default:n=s.toString()}return i=e.parseInt(i,10)||1,Array(Math.max(0,i-n.length)+1).join("0")+n}))}function Zr(e,t){var n=ei(e,t,"timescale"),r=1;n&&(r=Gr.Gc(n)||1),n=ei(e,t,"duration"),(n=Gr.Gc(n||""))&&(n/=r);var i=ei(e,t,"startNumber"),o=Number(ei(e,t,"presentationTimeOffset"))||0,a=Gr.Mb(i||"");null!=i&&null!=a||(a=1);var s=ti(e,t,"SegmentTimeline");if(i=null,s){i=r;var u=e.$.duration||1/0;s=Gr.Y(s,"S");for(var c=[],l=-o,f=0;f<s.length;++f){var h=s[f],d=Gr.R(h,"t",Gr.Mb),p=Gr.R(h,"d",Gr.Mb),g=Gr.R(h,"r",Gr.parseInt);if(null!=d&&(d-=o),!p){Y.v('"S" element must have a duration:','ignoring the remaining "S" elements.',h);break}if(d=null!=d?d:l,0>(g=g||0))if(f+1<s.length){if(null==(g=Gr.R(s[f+1],"t",Gr.Mb))){Y.v('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:','ignoring the remaining "S" elements.',h);break}if(d>=g){Y.v('An "S" element cannot have a negative repeat','if its start time exceeds the next "S" element\'s start time:','ignoring the remaining "S" elements.',h);break}g=Math.ceil((g-d)/p)-1}else{if(1/0==u){Y.v('The last "S" element cannot have a negative repeat',"if the Period has an infinite duration:",'ignoring the last "S" element.',h);break}if(d/i>=u){Y.v('The last "S" element cannot have a negative repeat',"if its start time exceeds the Period's duration:",'igoring the last "S" element.',h);break}g=Math.ceil((u*i-d)/p)-1}for(0<c.length&&d!=l&&(Math.abs((d-l)/i)>=ge&&Y.v("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",h),c[c.length-1].end=d/i),h=0;h<=g;++h)l=d+p,c.push({start:d/i,end:l/i,Pg:d}),d=l}i=c}return{timescale:r,ia:n,ob:a,sa:o/r||0,Vd:o,W:i}}function ei(e,t,n){return[t(e.G),t(e.fa),t(e.qa)].filter(fe.Ra).map((function(e){return e.getAttribute(n)})).reduce((function(e,t){return e||t}))}function ti(e,t,n){return[t(e.G),t(e.fa),t(e.qa)].filter(fe.Ra).map((function(e){return Gr.sc(e,n)})).reduce((function(e,t){return e||t}))}function ni(e,t,n,r,i,o){if(o=void 0===o?0:o,Gr.getAttributeNS(e,"http://www.w3.org/1999/xlink","href")){var a=function(e,t,n,r,i,o){for(var a=Gr.getAttributeNS(e,"http://www.w3.org/1999/xlink","href"),s=Gr.getAttributeNS(e,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=0;u<e.attributes.length;u++){var c=e.attributes[u];"http://www.w3.org/1999/xlink"==c.namespaceURI&&(e.removeAttributeNS(c.namespaceURI,c.localName),--u)}if(5<=o)return je(new $(2,4,4028));if("onLoad"!=s)return je(new $(2,4,4027));var l=he([r],[a]);return i.request(0,$e(l,t)).ca((function(r){if(!(r=Gr.ze(r.data,e.tagName)))return je(new $(2,4,4001,a));for(;e.childNodes.length;)e.removeChild(e.childNodes[0]);for(;r.childNodes.length;){var s=r.childNodes[0];r.removeChild(s),e.appendChild(s)}for(s=0;s<r.attributes.length;s++){var u=r.attributes[s].nodeName,c=r.getAttribute(u);e.setAttribute(u,c)}return ni(e,t,n,l[0],i,o+1)}))}(e,t,n,r,i,o);return n&&(a=a.ca(void 0,(function(){return ni(e,t,n,r,i,o)}))),a}a=[];for(var s=0;s<e.childNodes.length;s++){var u=e.childNodes[s];u instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==Gr.getAttributeNS(u,"http://www.w3.org/1999/xlink","href")?(e.removeChild(u),--s):"SegmentTimeline"!=u.tagName&&a.push(ni(u,t,n,r,i,o)))}return Ue(a).ca((function(){return e}))}function ri(e,t,n){this.i=e,this.h=t,this.g=n}function ii(e,t,n,r,i,o){this.position=e,this.startTime=t,this.endTime=n,this.i=r,this.h=i,this.g=o}function oi(e,t,n,r){var i,o=(new _r).ma("sidx",(function(e){i=function(e,t,n,r){var i=[];r.reader.U(4);var o=r.reader.N();if(0==o)throw Y.error("Invalid timescale."),new $(2,3,3005);if(0==r.version)var a=r.reader.N(),s=r.reader.N();else a=r.reader.Pb(),s=r.reader.Pb();r.reader.U(2);var u=r.reader.dc();for(e=e+r.size+s,s=0;s<u;s++){var c=r.reader.N(),l=(2147483648&c)>>>31;c&=2147483647;var f=r.reader.N();if(r.reader.U(4),1==l)throw Y.error("Heirarchical SIDXs are not supported."),new $(2,3,3006);i.push(new ii(i.length,a/o-t,(a+f)/o-t,(function(){return n}),e,e+c-1)),a+=f,e+=c}return r.parser.stop(),i}(t,r,n,e)}));if(e&&o.parse(e),i)return i;throw Y.error('Invalid box type, expected "sidx".'),new $(2,3,3004)}function ai(e){this.g=e}function si(e,t){for(;e.g.length&&e.g[e.g.length-1].startTime>=t;)e.g.pop();for(;e.g.length&&0>=e.g[0].endTime;)e.g.shift();if(0!=e.g.length){var n=e.g[e.g.length-1];e.g[e.g.length-1]=new ii(n.position,n.startTime,t,n.i,n.h,n.g)}}function ui(e){this.h=e,this.g=new Or(e,0),Yr||(Yr=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function ci(e){var t=li(e);if(7<t.length)throw new $(2,3,3002);for(var n=0,r=0;r<t.length;r++)n=256*n+t[r];t=n,n=li(e);e:{r=xe.Ha;for(var i=0;i<Yr.length;i++)if(r(n,Yr[i])){r=!0;break e}r=!1}if(r)n=e.h.byteLength-e.g.ka();else{if(8==n.length&&224&n[1])throw new $(2,3,3001);for(r=n[0]&(1<<8-n.length)-1,i=1;i<n.length;i++)r=256*r+n[i];n=r}return n=e.g.ka()+n<=e.h.byteLength?n:e.h.byteLength-e.g.ka(),r=new DataView(e.h.buffer,e.h.byteOffset+e.g.ka(),n),e.g.U(n),new fi(t,r)}function li(e){var t,n=e.g.ra();for(t=1;8>=t&&!(n&1<<8-t);t++);if(8<t)throw new $(2,3,3002);var r=new Uint8Array(t);for(r[0]=n,n=1;n<t;n++)r[n]=e.g.ra();return r}function fi(e,t){this.id=e,this.g=t}function hi(e){if(8<e.g.byteLength)throw new $(2,3,3002);if(8==e.g.byteLength&&224&e.g.getUint8(0))throw new $(2,3,3001);for(var t=0,n=0;n<e.g.byteLength;n++)t=256*t+e.g.getUint8(n);return t}function di(){}function pi(e){var t=new ui(e.g);if(179!=(e=ci(t)).id)throw Y.v("Not a CueTime element."),new $(2,3,3013);if(e=hi(e),183!=(t=ci(t)).id)throw Y.v("Not a CueTrackPositions element."),new $(2,3,3012);t=new ui(t.g);for(var n=0;t.Ca();){var r=ci(t);if(241==r.id){n=hi(r);break}}return{Qg:e,qg:n}}function gi(e,t){var n=ti(e,t,"Initialization");if(!n)return null;var r=e.G.xa,i=n.getAttribute("sourceURL");i&&(r=he(e.G.xa,[i])),i=0;var o=null;return(n=Gr.R(n,"range",Gr.Hc))&&(i=n.start,o=n.end),new ri((function(){return r}),i,o)}function mi(e,t,n,r,i,o,a,s){var u=e.presentationTimeline,c=!e.zb||!e.$.ld,l=e.$.start,f=e.$.duration,h=t,d=null;return{createSegmentIndex:function(){var e=[h(r,i,o),"webm"==a?h(n.i(),n.h,n.g):null];return h=null,Promise.all(e).then((function(e){var t=e[0];e=e[1]||null,t="mp4"==a?oi(t,i,r,s):(new di).parse(t,e,r,s),u.Jb(t,l),d=new ai(t),c&&si(d,f)}))},findSegmentPosition:function(e){return d.find(e)},getSegmentReference:function(e){return d.get(e)}}}function vi(e){return e.ec}function yi(e,t){var n=gi(e,bi),r=function(e){return[e.G.Ua,e.fa.Ua,e.qa.Ua].filter(fe.Ra).map((function(e){return Gr.Y(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.getAttribute("indexRange")&&!e.me&&(e.me=!0,Y.v("We do not support the SegmentURL@indexRange attribute on SegmentList.  We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate.")),{Tf:t.getAttribute("media"),start:(t=Gr.R(t,"mediaRange",Gr.Hc,{start:0,end:null})).start,end:t.end}}))}(e),i=Zr(e,bi),o=i.ob;0==o&&(Y.v("SegmentList@startNumber must be > 0"),o=1);var a=0;if(i.ia?a=i.ia*(o-1):i.W&&0<i.W.length&&(a=i.W[0].start),!(r={ia:i.ia,startTime:a,ob:o,sa:i.sa,W:i.W,jb:r}).ia&&!r.W&&1<r.jb.length)throw Y.v("SegmentList does not contain sufficient segment information:","the SegmentList specifies multiple segments,","but does not specify a segment duration or timeline.",e.G),new $(2,4,4002);if(!r.ia&&!e.$.duration&&!r.W&&1==r.jb.length)throw Y.v("SegmentList does not contain sufficient segment information:","the SegmentList specifies one segment,","but does not specify a segment duration, period duration,","or timeline.",e.G),new $(2,4,4002);if(r.W&&0==r.W.length)throw Y.v("SegmentList does not contain sufficient segment information:","the SegmentList has an empty timeline.",e.G),new $(2,4,4002);return o=i=null,e.qa.id&&e.G.id&&(i=t[o=e.qa.id+","+e.G.id]),a=function(e,t,n,r){var i=r.jb.length;r.W&&r.W.length!=r.jb.length&&(i=Math.min(r.W.length,r.jb.length),Y.v("The number of items in the segment timeline and the number of segment","URLs do not match, truncating",r.jb.length,"to",i));for(var o=[],a=r.startTime,s=0;s<i;s++){var u=r.jb[s],c=he(n,[u.Tf]),l=void 0;l=null!=r.ia?a+r.ia:r.W?r.W[s].end:a+e,o.push(new ii(s+t,a,l,function(e){return e}.bind(null,c),u.start,u.end)),a=l}return o}(e.$.duration,r.ob,e.G.xa,r),i?(i.sd(a),o=e.presentationTimeline.$b(),i.Vc(o-e.$.start)):(e.presentationTimeline.Jb(a,e.$.start),i=new ai(a),o&&e.zb&&(t[o]=i)),e.zb&&e.$.ld||si(i,e.$.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:i.find.bind(i),getSegmentReference:i.get.bind(i),initSegmentReference:n,sa:r.sa}}function bi(e){return e.Ua}function wi(e,t,n,r){var i=function(e){var t=ei(e,Ti,"initialization");if(!t)return null;var n=e.G.id,r=e.bandwidth||null,i=e.G.xa;return new ri((function(){var e=Qr(t,n,null,r,null);return he(i,[e])}),0,null)}(e),o=Zr(e,Ti),a=ei(e,Ti,"media"),s=ei(e,Ti,"index");if(a=(o={ia:o.ia,timescale:o.timescale,ob:o.ob,sa:o.sa,Vd:o.Vd,W:o.W,qd:a,bc:s}).bc?1:0,a+=o.W?1:0,0==(a+=o.ia?1:0))throw Y.error("SegmentTemplate does not contain any segment information:","the SegmentTemplate must contain either an index URL template","a SegmentTimeline, or a segment duration.",e.G),new $(2,4,4002);if(1!=a&&(Y.v("SegmentTemplate containes multiple segment information sources:","the SegmentTemplate should only contain an index URL template,","a SegmentTimeline or a segment duration.",e.G),o.bc?(Y.info("Using the index URL template by default."),o.W=null):Y.info("Using the SegmentTimeline by default."),o.ia=null),!o.bc&&!o.qd)throw Y.error("SegmentTemplate does not contain sufficient segment information:","the SegmentTemplate's media URL template is missing.",e.G),new $(2,4,4002);if(o.bc){if("mp4"!=(n=e.G.mimeType.split("/")[1])&&"webm"!=n)throw Y.error("SegmentTemplate specifies an unsupported container type.",e.G),new $(2,4,4006);if("webm"==n&&!i)throw Y.error("SegmentTemplate does not contain sufficient segment information:","the SegmentTemplate uses a WebM container,","but does not contain an initialization URL template.",e.G),new $(2,4,4005);r=Qr(o.bc,e.G.id,null,e.bandwidth||null,null),e=mi(e,t,i,r=he(e.G.xa,[r]),0,null,n,o.sa)}else o.ia?(r||(e.presentationTimeline.ud(o.ia),e.presentationTimeline.vd(e.$.start)),e=function(e,t){var n=e.$.duration,r=t.ia,i=t.ob,o=t.timescale,a=t.qd,s=e.bandwidth||null,u=e.G.id,c=e.G.xa;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0>e||n&&e>=n?null:Math.floor(e/r)},getSegmentReference:function(e){var t=e*r,l=t+r;return n&&(l=Math.min(l,n)),0>l||n&&t>=n?null:new ii(e,t,l,(function(){var n=Qr(a,u,e+i,s,t*o);return he(c,[n])}),0,null)}}}(e,o)):(a=t=null,e.qa.id&&e.G.id&&(t=n[a=e.qa.id+","+e.G.id]),s=function(e,t){for(var n=[],r=0;r<t.W.length;r++){var i=r+t.ob;n.push(new ii(i,t.W[r].start,t.W[r].end,function(e,t,n,r,i,o){return he(r,[e=Qr(e,t,i,n,o)]).map((function(e){return e.toString()}))}.bind(null,t.qd,e.G.id,e.bandwidth||null,e.G.xa,i,t.W[r].Pg+t.Vd),0,null))}return n}(e,o),r=!e.zb||!e.$.ld,t?(r&&si(new ai(s),e.$.duration),t.sd(s),n=e.presentationTimeline.$b(),t.Vc(n-e.$.start)):(e.presentationTimeline.Jb(s,e.$.start),t=new ai(s),a&&e.zb&&(n[a]=t)),r&&si(t,e.$.duration),e={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t)});return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:i,sa:o.sa}}function Ti(e){return e.gc}H("shaka.media.InitSegmentReference",ri),ri.prototype.Tc=function(){return this.i()},ri.prototype.createUris=ri.prototype.Tc,ri.prototype.dd=function(){return this.h},ri.prototype.getStartByte=ri.prototype.dd,ri.prototype.cd=function(){return this.g},ri.prototype.getEndByte=ri.prototype.cd,H("shaka.media.SegmentReference",ii),ii.prototype.ka=function(){return this.position},ii.prototype.getPosition=ii.prototype.ka,ii.prototype.xc=function(){return this.startTime},ii.prototype.getStartTime=ii.prototype.xc,ii.prototype.qf=function(){return this.endTime},ii.prototype.getEndTime=ii.prototype.qf,ii.prototype.Tc=function(){return this.i()},ii.prototype.createUris=ii.prototype.Tc,ii.prototype.dd=function(){return this.h},ii.prototype.getStartByte=ii.prototype.dd,ii.prototype.cd=function(){return this.g},ii.prototype.getEndByte=ii.prototype.cd,H("shaka.media.SegmentIndex",ai),ai.prototype.destroy=function(){return this.g=null,Promise.resolve()},ai.prototype.destroy=ai.prototype.destroy,ai.prototype.find=function(e){for(var t=this.g.length-1,n=t;0<=n;--n){var r=this.g[n],i=n<t?this.g[n+1].startTime:r.endTime;if(e>=r.startTime&&e<i)return r.position}return this.g.length&&e<this.g[0].startTime?this.g[0].position:null},ai.prototype.find=ai.prototype.find,ai.prototype.get=function(e){return 0==this.g.length||0>(e-=this.g[0].position)||e>=this.g.length?null:this.g[e]},ai.prototype.get=ai.prototype.get,ai.prototype.offset=function(e){for(var t=0;t<this.g.length;++t)this.g[t].startTime+=e,this.g[t].endTime+=e},ai.prototype.offset=ai.prototype.offset,ai.prototype.sd=function(e){for(var t=[],n=0,r=0;n<this.g.length&&r<e.length;){var i=this.g[n],o=e[r];i.startTime<o.startTime?(t.push(i),n++):(i.startTime>o.startTime?0==n?t.push(o):Y.v("Refusing to rewrite original references on update!"):(.1<Math.abs(i.endTime-o.endTime)?t.push(new ii(i.position,o.startTime,o.endTime,o.i,o.h,o.g)):t.push(i),n++),r++)}for(;n<this.g.length;)t.push(this.g[n++]);if(t.length)for(n=t[t.length-1].position+1;r<e.length;)i=new ii(n++,(i=e[r++]).startTime,i.endTime,i.i,i.h,i.g),t.push(i);else t=e;this.g=t},ai.prototype.merge=ai.prototype.sd,ai.prototype.Vc=function(e){for(var t=0;t<this.g.length;++t)if(this.g[t].endTime>e)return void this.g.splice(0,t);this.g=[]},ai.prototype.evict=ai.prototype.Vc,ui.prototype.Ca=function(){return this.g.Ca()},di.prototype.parse=function(e,t,n,r){var i;if(440786851!=ci(t=new ui(new DataView(t))).id)throw Y.error("Not an EBML element."),new $(2,3,3008);var o=ci(t);if(408125543!=o.id)throw Y.error("Not a Segment element."),new $(2,3,3009);for(t=o.g.byteOffset,o=new ui(o.g),i=null;o.Ca();){var a=ci(o);if(357149030==a.id){i=a;break}}if(!i)throw Y.error("Not an Info element."),new $(2,3,3010);for(o=new ui(i.g),i=1e6,a=null;o.Ca();){var s=ci(o);if(2807729==s.id)i=hi(s);else if(17545==s.id)if(4==(a=s).g.byteLength)a=a.g.getFloat32(0);else{if(8!=a.g.byteLength)throw new $(2,3,3003);a=a.g.getFloat64(0)}}if(null==a)throw new $(2,3,3011);if(i=a*(o=i/1e9),475249515!=(e=ci(new ui(new DataView(e)))).id)throw Y.error("Not a Cues element."),new $(2,3,3007);return function(e,t,n,r,i,o){function a(){return i}var s=[];e=new ui(e.g);for(var u=null,c=null;e.Ca();){var l=ci(e);if(187==l.id){var f=pi(l);f&&(l=n*f.Qg,f=t+f.qg,null!=u&&s.push(new ii(s.length,u-o,l-o,a,c,f-1)),u=l,c=f)}}return null!=u&&s.push(new ii(s.length,u-o,r-o,a,c,null)),s}(e,t,o,i,n,r)};var Si={Nb:{},cc:{},Fd:function(e,t){Si.cc[e]=t}};function Ei(e,t,n){this.j=e,this.Ic=t,this.m=this.l=1/0,this.g=1,this.h=this.i=null,this.u=0,this.A=!0,this.o=0,this.C=void 0===n||n}function xi(e,t,n,r){return e=$e(e,r),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function Ai(){var e=this;this.h=this.g=null,this.j=[],this.i=null,this.u=[],this.m=1,this.A={},this.C=0,this.F=new z(5),this.o=new Pe((function(){!function(e){g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:return Y.info("Updating manifest..."),n=0,I(t,2),A(t,ki(e),4);case 4:n=t.B,P(t,3);break;case 2:r=R(t),e.h&&(r.severity=1,e.h.onError(r));case 3:if(!e.h)return t.return();Ri(e,n),k(t)}}))}))}(e)})),this.l=new ze}function ki(e){var t=Date.now(),n=e.h.networkingEngine.request(0,$e(e.j,e.g.retryParameters));return Ge(e.l,n),n.promise.then((function(t){if(e.h)return t.uri&&!e.j.includes(t.uri)&&e.j.unshift(t.uri),function(e,t,n){if(!(t=Gr.ze(t,"MPD")))throw new $(2,4,4001,n);return t=ni(t,e.g.retryParameters,e.g.dash.xlinkFailGracefully,n,e.h.networkingEngine),Ge(e.l,t),t.promise.then((function(t){return function(e,t,n){return g((function r(){var i,o,a,s,u,c,l,f,h,d,p,g,m,v,y,b,w,T,S,E,x,I,M,P;return U(r,(function(r){switch(r.s){case 1:s=fe,c=[n],0<(l=(u=Gr).Y(t,"Location").map(u.uc).filter(s.Ra)).length&&(f=he(c,l),c=e.j=f),h=u.Y(t,"BaseURL").map(u.uc),d=he(c,h),p=e.g.dash.ignoreMinBufferTime,g=0,p||(g=u.R(t,"minBufferTime",u.Ma)),e.C=u.R(t,"minimumUpdatePeriod",u.Ma,-1),m=u.R(t,"availabilityStartTime",u.jg),v=u.R(t,"timeShiftBufferDepth",u.Ma),y=u.R(t,"maxSegmentDuration",u.Ma),b=t.getAttribute("type")||"static",w=e.g.dash.ignoreSuggestedPresentationDelay,T=null,w||(T=u.R(t,"suggestedPresentationDelay",u.Ma)),e.i?S=e.i.presentationTimeline:(E=Math.max(e.g.dash.defaultPresentationDelay,1.5*g),S=new Ei(m,null!=T?T:E,e.g.dash.autoCorrectDrift));for(var R={zb:"static"!=b,presentationTimeline:S,qa:null,$:null,fa:null,G:null,bandwidth:0,me:!1},C=d,N=Gr.R(t,"mediaPresentationDuration",Gr.Ma),j=[],D=0,O=Gr.Y(t,"Period"),L=0;L<O.length;L++){var U=O[L];D=Gr.R(U,"start",Gr.Ma,D);var _=Gr.R(U,"duration",Gr.Ma),K=null;if(L!=O.length-1){var B=Gr.R(O[L+1],"start",Gr.Ma);null!=B&&(K=B-D)}else null!=N&&(K=N-D);if(B=ge,K&&_&&Math.abs(K-_)>B&&Y.v("There is a gap/overlap between Periods",U),null==K&&(K=_),U=Ii(e,R,C,{start:D,duration:K,node:U,ld:null==K||L==O.length-1}),j.push(U),_=R.qa.id,e.u.includes(_)||(e.u.push(_),e.i&&(e.h.filterNewPeriod(U),e.i.periods.push(U))),null==K){L!=O.length-1&&Y.v("Skipping Period",L+1,"and any subsequent Periods:","Period",L+1,"does not have a valid start time.",j[L+1]),D=null;break}D+=K}if(null==e.i&&e.h.filterAllPeriods(j),null!=N?(D!=N&&Y.v("@mediaPresentationDuration does not match the total duration of all","Periods."),i=j,o=N,a=!1):(i=j,o=D,a=!0),x=o,I=i,S.hc("static"==b),"static"!=b&&a||S.Fa(x||1/0),S.aa()&&!isNaN(e.g.availabilityWindowOverride)&&(v=e.g.availabilityWindowOverride),null==v&&(v=1/0),S.Pd(v),S.ud(y||1),e.i){r.I(0);break}if(e.i={presentationTimeline:S,periods:I,offlineSessionIds:[],minBufferTime:g||0},!S.Pe()){r.I(0);break}return M=u.Y(t,"UTCTiming"),A(r,function(e,t,n){n=n.map((function(e){return{scheme:e.getAttribute("schemeIdUri"),value:e.getAttribute("value")}}));var r=e.g.dash.clockSyncUri;return!n.length&&r&&n.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),fe.df(n,function(e){var n=e.scheme;switch(e=e.value,n){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Ni(this,t,e,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return Ni(this,t,e,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return n=Date.parse(e),isNaN(n)?0:n-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":return Y.ba("NTP UTCTiming scheme is not supported"),Promise.reject();default:return Y.ba("Unrecognized scheme in UTCTiming element",n),Promise.reject()}}.bind(e)).catch((function(){return Y.ba("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),0}))}(e,d,M),4);case 4:if(P=r.B,!e.h)return r.return();S.Ke(P),k(r)}}))}))}(e,t,n)}))}(e,t.data,t.uri)})).then((function(){var n=(Date.now()-t)/1e3;return G(e.F,1,n),n}))}function Ii(e,t,n,r){if(t.qa=Ci(r.node,null,n),t.$=r,t.qa.id||(Y.info("No Period ID given for Period with start time "+r.start+",  Assigning a default"),t.qa.id="__shaka_period_"+r.start),Gr.Y(r.node,"EventStream").forEach(e.kg.bind(e,r.start,r.duration)),n=Gr.Y(r.node,"AdaptationSet").map(e.ig.bind(e,t)).filter(fe.Ra),t.zb){t=[];for(var i=d(n),o=i.next();!o.done;o=i.next())for(var a=(o=d(o.value.tg)).next();!a.done;a=o.next())t.push(a.value);if(t.length!=new Set(t).size)throw new $(2,4,4018)}var s=n.filter((function(e){return!e.Td}));if(n.filter((function(e){return e.Td})).forEach((function(e){var t=e.Td.split(" ");s.forEach((function(n){t.includes(n.id)&&n.streams.forEach((function(t){t.trickModeVideo=e.streams.find((function(e){return ht(t.codecs)[0]==ht(e.codecs)[0]}))}))}))})),t=Mi(s,"video"),i=Mi(s,"audio"),!t.length&&!i.length)throw new $(2,4,4004);for(n=e.g.disableAudio,i.length&&!n||(i=[null]),n=e.g.disableVideo,t.length&&!n||(t=[null]),n=[],o=0;o<i.length;o++)for(a=0;a<t.length;a++)Pi(e,i[o],t[a],n);if(t=[],!e.g.disableText)for(e=Mi(s,"text"),i=0;i<e.length;i++)t.push.apply(t,e[i].streams);return{startTime:r.start,textStreams:t,variants:n}}function Mi(e,t){return e.filter((function(e){return e.contentType==t}))}function Pi(e,t,n,r){if(t||n)if(t&&n){var i=t.drmInfos,o=n.drmInfos;if(!i.length||!o.length||0<Kt(i,o).length){o=Kt(t.drmInfos,n.drmInfos);for(var a=0;a<t.streams.length;a++)for(var s=0;s<n.streams.length;s++)i=(n.streams[s].bandwidth||0)+(t.streams[a].bandwidth||0),i={id:e.m++,language:t.language,primary:t.pd||n.pd,audio:t.streams[a],video:n.streams[s],bandwidth:i,drmInfos:o,allowedByApplication:!0,allowedByKeySystem:!0},r.push(i)}}else for(o=t||n,a=0;a<o.streams.length;a++)i=o.streams[a].bandwidth||0,i={id:e.m++,language:o.language||"und",primary:o.pd,audio:t?o.streams[a]:null,video:n?o.streams[a]:null,bandwidth:i,drmInfos:o.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},r.push(i)}function Ri(e,t){0>e.C||e.o.V(Math.max(3,e.C-t,W(e.F)))}function Ci(e,t,n){t=t||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,wd:null,audioSamplingRate:null},n=n||t.xa;var r=Gr.Mb,i=Gr.ff,o=Gr.Y(e,"BaseURL").map(Gr.uc),a=e.getAttribute("contentType")||t.contentType,s=e.getAttribute("mimeType")||t.mimeType,u=e.getAttribute("codecs")||t.codecs;i=Gr.R(e,"frameRate",i)||t.frameRate;for(var c=e.getAttribute("sar")||t.pixelAspectRatio,l=Gr.Y(e,"InbandEventStream"),f=t.emsgSchemeIdUris.slice(),h=(l=d(l)).next();!h.done;h=l.next())h=h.value.getAttribute("schemeIdUri"),f.includes(h)||f.push(h);return l=function(e){for(var t=0;t<e.length;++t){var n=e[t],r=n.getAttribute("schemeIdUri");if(r&&(n=n.getAttribute("value")))switch(r){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":var i=parseInt(n,10);if(!i){Y.v("Channel parsing failure! Ignoring scheme and value",r,n);continue}return i;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(!(i=parseInt(n,16))){Y.v("Channel parsing failure! Ignoring scheme and value",r,n);continue}for(e=0;i;)1&i&&++e,i>>=1;return e;default:Y.v("Unrecognized audio channel scheme:",r,n)}}return null}(l=Gr.Y(e,"AudioChannelConfiguration"))||t.wd,h=Gr.R(e,"audioSamplingRate",r)||t.audioSamplingRate,a||(a=ji(s,u)),{xa:he(n,o),ec:Gr.sc(e,"SegmentBase")||t.ec,Ua:Gr.sc(e,"SegmentList")||t.Ua,gc:Gr.sc(e,"SegmentTemplate")||t.gc,width:Gr.R(e,"width",r)||t.width,height:Gr.R(e,"height",r)||t.height,contentType:a,mimeType:s,codecs:u,frameRate:i,pixelAspectRatio:c,emsgSchemeIdUris:f,id:e.getAttribute("id"),wd:l,audioSamplingRate:h}}function Ni(e,t,n,r){return(t=$e(t=he(t,[n]),e.g.retryParameters)).method=r,t=e.h.networkingEngine.request(4,t),Ge(e.l,t),t.promise.then((function(e){if("HEAD"==r){if(!e.headers||!e.headers.date)return Y.v("UTC timing response is missing","expected date header"),0;e=e.headers.date}else e=ve(e.data);return e=Date.parse(e),isNaN(e)?(Y.v("Unable to parse date from UTC timing response"),0):e-Date.now()}))}function ji(e,t){return yn(lt(e,t))?"text":e.split("/")[0]}function Di(e,t,n,r){this.h=e,this.type=t,this.g=n,this.segments=r||null}function Oi(e,t,n,r){this.id=e,this.name=t,this.g=n,this.value=void 0===r?null:r}function Li(e,t){this.name=e,this.value=t}function Ui(e,t,n){return(e=e.getAttribute(t))?e.value:n||null}function _i(e,t){this.h=t,this.g=e}H("shaka.media.ManifestParser.registerParserByExtension",Si.Fd),Si.Qb=function(e,t){Si.Nb[e]=t},H("shaka.media.ManifestParser.registerParserByMime",Si.Qb),Si.ng=function(){var e={};if(pt()){for(var t in Si.Nb)e[t]=!0;for(var n in Si.cc)e[n]=!0}t={mpd:"application/dash+xml",m3u8:"application/x-mpegurl",ism:"application/vnd.ms-sstr+xml"};for(var r=(n=d(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!r.done;r=n.next())e[r=r.value]=pt()?!!Si.Nb[r]:gt(r);for(var i in t)e[i]=pt()?!!Si.cc[i]:gt(t[i]);return e},Si.create=function(e,t,n,r){return g((function i(){var o,a;return U(i,(function(i){switch(i.s){case 1:return I(i,2),A(i,Si.rf(e,t,n,r),4);case 4:return o=i.B,i.return(new o);case 2:throw(a=R(i)).severity=2,a}}))}))},Si.rf=function(e,t,n,r){return g((function i(){var o,a,s,u,c;return U(i,(function(i){switch(i.s){case 1:if(o=Si,r){if(a=o.Nb[r.toLowerCase()])return i.return(a);Y.v("Could not determine manifest type using MIME type ",r)}if(s=o.getExtension(e)){if(u=o.cc[s])return i.return(u);Y.v("Could not determine manifest type for extension ",s)}else Y.v("Could not find extension for ",e);if(r){i.I(2);break}return A(i,o.zf(e,t,n),3);case 3:if(r=i.B){if(c=Si.Nb[r])return i.return(c);Y.v("Could not determine manifest type using MIME type",r)}case 2:throw new $(2,4,4e3,e)}}))}))},Si.zf=function(e,t,n){return g((function r(){var i,o,a;return U(r,(function(r){switch(r.s){case 1:return(i=$e([e],n)).method="HEAD",A(r,t.request(0,i).promise,2);case 2:return o=r.B,a=o.headers["content-type"],r.return(a?a.toLowerCase().split(";").shift():"")}}))}))},Si.getExtension=function(e){return 1==(e=new Q(e).pa.split("/").pop().split(".")).length?"":e.pop().toLowerCase()},Si.isSupported=function(e,t){return!!pt()&&(t in Si.Nb||Si.getExtension(e)in Si.cc)},H("shaka.media.PresentationTimeline",Ei),Ei.prototype.ha=function(){return this.l},Ei.prototype.getDuration=Ei.prototype.ha,Ei.prototype.xf=function(){return this.g},Ei.prototype.getMaxSegmentDuration=Ei.prototype.xf,Ei.prototype.Fa=function(e){this.l=e},Ei.prototype.setDuration=Ei.prototype.Fa,Ei.prototype.Ff=function(){return this.j},Ei.prototype.getPresentationStartTime=Ei.prototype.Ff,Ei.prototype.Ke=function(e){this.u=e},Ei.prototype.setClockOffset=Ei.prototype.Ke,Ei.prototype.hc=function(e){this.A=e},Ei.prototype.setStatic=Ei.prototype.hc,Ei.prototype.Pd=function(e){this.m=e},Ei.prototype.setSegmentAvailabilityDuration=Ei.prototype.Pd,Ei.prototype.Ag=function(e){this.Ic=e},Ei.prototype.setDelay=Ei.prototype.Ag,Ei.prototype.pf=function(){return this.Ic},Ei.prototype.getDelay=Ei.prototype.pf,Ei.prototype.Jb=function(e,t){if(0!=e.length){var n=e[e.length-1].endTime+t;this.vd(e[0].startTime+t),this.g=e.reduce((function(e,t){return Math.max(e,t.endTime-t.startTime)}),this.g),this.h=Math.max(this.h,n),null!=this.j&&this.C&&(this.j=(Date.now()+this.u)/1e3-this.h-this.g),Y.K("notifySegments:","maxSegmentDuration="+this.g)}},Ei.prototype.notifySegments=Ei.prototype.Jb,Ei.prototype.vd=function(e){this.i=null==this.i?e:Math.min(this.i,e)},Ei.prototype.notifyMinSegmentStartTime=Ei.prototype.vd,Ei.prototype.ud=function(e){this.g=Math.max(this.g,e),Y.K("notifyNewSegmentDuration:","maxSegmentDuration="+this.g)},Ei.prototype.notifyMaxSegmentDuration=Ei.prototype.ud,Ei.prototype.offset=function(e){null!=this.i&&(this.i+=e),null!=this.h&&(this.h+=e)},Ei.prototype.offset=Ei.prototype.offset,Ei.prototype.aa=function(){return 1/0==this.l&&!this.A},Ei.prototype.isLive=Ei.prototype.aa,Ei.prototype.ib=function(){return 1/0!=this.l&&!this.A},Ei.prototype.isInProgress=Ei.prototype.ib,Ei.prototype.$b=function(){if(1/0==this.m)return this.o;var e=this.Db()-this.m;return Math.max(this.o,e)},Ei.prototype.getSegmentAvailabilityStart=Ei.prototype.$b,Ei.prototype.Le=function(e){this.o=e},Ei.prototype.setUserSeekStart=Ei.prototype.Le,Ei.prototype.Db=function(){return this.aa()||this.ib()?Math.min(Math.max(0,(Date.now()+this.u)/1e3-this.g-this.j),this.l):this.l},Ei.prototype.getSegmentAvailabilityEnd=Ei.prototype.Db,Ei.prototype.Zb=function(e){var t=Math.max(this.i,this.o);if(1/0==this.m)return Math.ceil(1e3*t)/1e3;var n=this.Db()-this.m;return e=Math.min(n+e,this.Ka()),Math.max(t,e)},Ei.prototype.getSafeSeekRangeStart=Ei.prototype.Zb,Ei.prototype.Cb=function(){return this.Zb(0)},Ei.prototype.getSeekRangeStart=Ei.prototype.Cb,Ei.prototype.Ka=function(){var e=this.aa()||this.ib()?this.Ic:0;return Math.max(0,this.Db()-e)},Ei.prototype.getSeekRangeEnd=Ei.prototype.Ka,Ei.prototype.Pe=function(){return!(null==this.j||null!=this.h&&this.C)},Ei.prototype.usingPresentationStartTime=Ei.prototype.Pe,H("shaka.dash.DashParser",Ai),(i=Ai.prototype).configure=function(e){this.g=e},i.start=function(e,t){var n=this;return g((function r(){var i;return U(r,(function(r){switch(r.s){case 1:return n.j=[e],n.h=t,A(r,ki(n),2);case 2:if(i=r.B,n.h&&Ri(n,i),!n.h)throw new $(2,7,7001);return r.return(n.i)}}))}))},i.stop=function(){return this.g=this.h=null,this.j=[],this.i=null,this.u=[],this.A={},null!=this.o&&(this.o.stop(),this.o=null),this.l.destroy()},i.update=function(){ki(this).catch(function(e){this.h&&this.h.onError(e)}.bind(this))},i.onExpirationUpdated=function(){},i.ig=function(e,t){if(e.fa=Ci(t,e.qa,null),"image"==e.fa.contentType)return Y.v("Skipping Image AdaptationSet",e.fa),null;var n=!1,r=Gr.Y(t,"Role"),i=r.map((function(e){return e.getAttribute("value")})).filter(fe.Ra),o=void 0,a="text"==e.fa.contentType;a&&(o="subtitle");for(var s=0;s<r.length;s++){var u=r[s].getAttribute("schemeIdUri");if(null==u||"urn:mpeg:dash:role:2011"==u)switch(u=r[s].getAttribute("value"),u){case"main":n=!0;break;case"caption":case"subtitle":o=u}}var c=null,l=!1;Gr.Y(t,"EssentialProperty").forEach((function(e){"http://dashif.org/guidelines/trickmode"==e.getAttribute("schemeIdUri")?c=e.getAttribute("value"):l=!0})),s=Gr.Y(t,"Accessibility");var f=new Map;for(r={},u=(s=d(s)).next();!u.done;r={Vb:r.Vb},u=s.next()){var h=u.value;u=h.getAttribute("schemeIdUri"),h=h.getAttribute("value"),"urn:scte:dash:cc:cea-608:2015"==u||"urn:scte:dash:cc:cea-708:2015"==u?(r.Vb=1,null!=h?h.split(";").forEach(function(e){return function(t){if(t.includes("=")){var n=(t=t.split("="))[0].startsWith("CC")?t[0]:"CC"+t[0];t=t[1].split(",")[0].split(":").pop()}else n="CC"+e.Vb,e.Vb+=2;f.set(n,Un(t))}}(r)):f.set("CC1","und")):"urn:mpeg:dash:role:2011"==u&&null!=h&&(i.push(h),"captions"==h&&(o="caption"))}if(l)return null;var p=Xr(r=Gr.Y(t,"ContentProtection"),this.g.dash.customScheme,this.g.dash.ignoreDrmInfo);if(r=Un(t.getAttribute("lang")||"und"),s=t.getAttribute("label"),(u=Gr.Y(t,"Label"))&&u.length&&(u=u[0]).textContent&&(s=u.textContent),0==(i=(u=Gr.Y(t,"Representation")).map(this.lg.bind(this,e,p,o,r,s,n,i,f)).filter((function(e){return!!e}))).length){if(this.g.dash.ignoreEmptyAdaptationSet||a)return null;throw new $(2,4,4003)}return e.fa.contentType&&"application"!=e.fa.contentType||(e.fa.contentType=ji(i[0].mimeType,i[0].codecs),i.forEach((function(t){t.type=e.fa.contentType}))),i.forEach((function(e){p.drmInfos.forEach((function(t){e.keyId&&t.keyIds.push(e.keyId)}))})),a=u.map((function(e){return e.getAttribute("id")})).filter(fe.Ra),{id:e.fa.id||"__fake__"+this.m++,contentType:e.fa.contentType,language:r,pd:n,streams:i,drmInfos:p.drmInfos,Td:c,tg:a}},i.lg=function(e,t,n,r,i,o,a,s,u){if(e.G=Ci(u,e.fa,null),!function(e){var t=e.ec?1:0;return t+=e.Ua?1:0,0==(t+=e.gc?1:0)?"text"==e.contentType||"application"==e.contentType||(Y.v("Representation does not contain a segment information source:","the Representation must contain one of SegmentBase, SegmentList,",'SegmentTemplate, or explicitly indicate that it is "text".',e),!1):(1!=t&&(Y.v("Representation contains multiple segment information sources:","the Representation should only contain one of SegmentBase,","SegmentList, or SegmentTemplate.",e),e.ec?(Y.info("Using SegmentBase by default."),e.Ua=null):Y.info("Using SegmentList by default."),e.gc=null),!0)}(e.G))return Y.v("Skipping Representation",e.G),null;e.bandwidth=Gr.R(u,"bandwidth",Gr.Gc)||0;var c=e.G.contentType;c="text"==c||"application"==c;try{var l=this.ug.bind(this);if(e.G.ec)var f=function(e,t){var n=Number(ei(e,vi,"presentationTimeOffset"))||0,r=ei(e,vi,"timescale"),i=1;r&&(i=Gr.Gc(r)||1),n=n/i||0,r=gi(e,vi);var o=e.G.contentType;if(i=e.G.mimeType.split("/")[1],"text"!=o&&"mp4"!=i&&"webm"!=i)throw Y.error("SegmentBase specifies an unsupported container type.",e.G),new $(2,4,4006);if("webm"==i&&!r)throw Y.error("SegmentBase does not contain sufficient segment information:","the SegmentBase uses a WebM container,","but does not contain an Initialization element.",e.G),new $(2,4,4005);o=ti(e,vi,"RepresentationIndex");var a=ei(e,vi,"indexRange"),s=e.G.xa;if(a=Gr.Hc(a||""),o){var u=o.getAttribute("sourceURL");u&&(s=he(e.G.xa,[u])),a=Gr.R(o,"range",Gr.Hc,a)}if(!a)throw Y.error("SegmentBase does not contain sufficient segment information:","the SegmentBase does not contain @indexRange","or a RepresentationIndex element.",e.G),new $(2,4,4002);return{createSegmentIndex:(i=mi(e,t,r,s,a.start,a.end,i,n)).createSegmentIndex,findSegmentPosition:i.findSegmentPosition,getSegmentReference:i.getSegmentReference,initSegmentReference:r,sa:n}}(e,l);else if(e.G.Ua)f=yi(e,this.A);else if(e.G.gc)f=wi(e,l,this.A,!!this.i);else{var h=e.G.xa,d=e.$.duration||0;f={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0<=e&&e<d?1:null},getSegmentReference:function(e){return 1!=e?null:new ii(1,0,d,(function(){return h}),0,null)},initSegmentReference:null,sa:0}}}catch(p){if(c&&4002==p.code)return null;throw p}return u=function(e,t,n,r){var i=Xr(e,t,r);if(n.ge)e=1==n.drmInfos.length&&!n.drmInfos[0].keySystem,t=0==i.drmInfos.length,(0==n.drmInfos.length||e&&!t)&&(n.drmInfos=i.drmInfos),n.ge=!1;else if(0<i.drmInfos.length&&(n.drmInfos=n.drmInfos.filter((function(e){return i.drmInfos.some((function(t){return t.keySystem==e.keySystem}))})),0==n.drmInfos.length))throw new $(2,4,4008);return i.be||n.be}(u=Gr.Y(u,"ContentProtection"),this.g.dash.customScheme,t,this.g.dash.ignoreDrmInfo),{id:this.m++,originalId:e.G.id,createSegmentIndex:f.createSegmentIndex,findSegmentPosition:f.findSegmentPosition,getSegmentReference:f.getSegmentReference,initSegmentReference:f.initSegmentReference,presentationTimeOffset:f.sa,mimeType:e.G.mimeType,codecs:e.G.codecs,frameRate:e.G.frameRate,pixelAspectRatio:e.G.pixelAspectRatio,bandwidth:e.bandwidth,width:e.G.width,height:e.G.height,kind:n,encrypted:0<t.drmInfos.length,keyId:u,language:r,label:i,type:e.fa.contentType,primary:o,trickModeVideo:null,emsgSchemeIdUris:e.G.emsgSchemeIdUris,roles:a,channelsCount:e.G.wd,audioSamplingRate:e.G.audioSamplingRate,closedCaptions:s}},i.kg=function(e,t,n){var r=Gr.Mb,i=n.getAttribute("schemeIdUri")||"",o=n.getAttribute("value")||"",a=Gr.R(n,"timescale",r)||1;Gr.Y(n,"Event").forEach(function(n){var s=Gr.R(n,"presentationTime",r)||0,u=Gr.R(n,"duration",r)||0;u=(s=s/a+e)+u/a,null!=t&&(s=Math.min(s,e+t),u=Math.min(u,e+t)),n={schemeIdUri:i,value:o,startTime:s,endTime:u,id:n.getAttribute("id")||"",eventElement:n},this.h.onTimelineRegionAdded(n)}.bind(this))},i.ug=function(e,t,n){return e=xi(e,t,n,this.g.retryParameters),e=this.h.networkingEngine.request(1,e),Ge(this.l,e),e.promise.then((function(e){return e.data}))},Si.Fd("mpd",Ai),Si.Qb("application/dash+xml",Ai),Si.Qb("video/vnd.mpeg.dash.mpd",Ai),Oi.prototype.toString=function(){var e="#"+this.name,t=this.g?this.g.map((function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)})):[];return this.value&&t.unshift(this.value),0<t.length&&(e+=":"+t.join(",")),e},Oi.prototype.getAttribute=function(e){var t=this.g.filter((function(t){return t.name==e}));return t.length?t[0]:null};var Ki={Ab:function(e,t){return e.filter((function(e){return e.name==t}))},cb:function(e,t){var n=Ki.Ab(e,t);return n.length?n[0]:null},Zc:function(e,t,n){return e.filter((function(e){var r=e.getAttribute("TYPE");return e=e.getAttribute("GROUP-ID"),r.value==t&&e.value==n}))},Sc:function(e,t){return he([e],[t])[0]},kd:function(e){return/^#(?!EXT)/m.test(e)}};function Bi(e){this.h=e,this.g=0}function Fi(e){Vi(e,/[ \t]+/gm)}function Vi(e,t){t.lastIndex=e.g;var n=t.exec(e.h);return n=null==n?null:{position:n.index,length:n[0].length,wg:n},e.g==e.h.length||null==n||n.position!=e.g?null:(e.g+=n.length,n.wg)}function Hi(e){return e.g==e.h.length?null:(e=Vi(e,/[^ \t\n]*/gm))?e[0]:null}function qi(){this.g=0}function zi(e,t,n){var r=(t=(t=ve(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(r[0]))throw new $(2,4,4015);t=0;for(var i=1;i<r.length;i++)if(!Ki.kd(r[i])){var o=Wi(e,r[i]);if(--e.g,Xi.includes(o.name)){t=1;break}"EXT-X-STREAM-INF"==o.name&&(i+=1)}for(i=[],o=1;o<r.length;)if(Ki.kd(r[o]))o+=1;else{var a=Wi(e,r[o]);if(Yi.includes(a.name)){if(1!=t)throw new $(2,4,4017);return new Di(n,t,i,e=Gi(e,n,r=r.splice(o,r.length-o),i))}i.push(a),o+=1,"EXT-X-STREAM-INF"==a.name&&(a.g.push(new Li("URI",r[o])),o+=1)}return new Di(n,t,i)}function Gi(e,t,n,r){var i=[],o=[];return n.forEach((function(n){if(/^(#EXT)/.test(n))n=Wi(e,n),Xi.includes(n.name)?r.push(n):o.push(n);else{if(Ki.kd(n))return[];n=Ki.Sc(t,n.trim()),i.push(new _i(n,o)),o=[]}})),i}function Wi(e,t){var n=e.g++,r=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!r)throw new $(2,4,4016,t);var i,o=r[1],a=r[2];if(r=[],a){var s;(s=Vi(a=new Bi(a),/^([^,=]+)(?:,|$)/g))&&(i=s[1]);for(var u=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;s=Vi(a,u);)r.push(new Li(s[1],s[2]||s[3]))}return new Oi(n,o,r,i)}var Xi="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Yi="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");function $i(e){try{var t=$i.parse(e);return Oe({uri:e,Bd:e,data:t.data,headers:{"content-type":t.contentType}})}catch(n){return je(n)}}function Ji(){var e=this;this.g=this.j=null,this.ea=1,this.L=new Map,this.Z=new Set,this.h=new Map,this.i=null,this.F="",this.C=new qi,this.X=0,this.m=new Pe((function(){!function(e){g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:return Y.info("Updating manifest..."),e.j?(I(t,2),A(t,e.update(),4)):t.return();case 4:n=e.X,e.m.V(n),P(t,0);break;case 2:if(r=R(t),!e.j)return t.return();r.severity=1,e.j.onError(r),e.m.V(.1),k(t)}}))}))}(e)})),this.l=yo,this.A=null,this.J=0,this.M=1/0,this.o=new ze,this.P=[],this.u=new Map,this.da=!1}function Qi(e,t){return g((function n(){var r,i,o,a,s,u,c,l,f,h;return U(n,(function(n){switch(n.s){case 1:return r=Ki,i=bo,o=t.We,A(n,mo(e,$e([o],e.g.retryParameters),0),2);case 2:if(a=n.B,1!=(s=zi(e.C,a.data,a.uri)).type)throw new $(2,4,4017);return c=(u=r.cb(s.g,"EXT-X-MEDIA-SEQUENCE"))?Number(u.value):0,l=t.stream,A(n,ao(e,t.Pc,s,c,l.mimeType,l.codecs),3);case 3:f=n.B,t.fc.g=f,h=f[f.length-1],r.cb(s.g,"EXT-X-ENDLIST")&&(go(e,i.$a),e.i.Fa(h.endTime)),k(n)}}))}))}function Zi(e){e.forEach((function(e){if(e){var t=e.stream.codecs.split(",");t=t.filter((function(e){return"mp4a.40.34"!=e})),e.stream.codecs=t.join(",")}}))}function eo(e,t,n,r,i){return{id:e.ea++,language:t?t.language:"und",primary:!!t&&t.primary||!!n&&n.primary,audio:t,video:n,bandwidth:r,drmInfos:i,allowedByApplication:!0,allowedByKeySystem:!0}}function to(e,t,n){return g((function r(){var i,o,a,s,u,c,l,f,h,d,p;return U(r,(function(r){switch(r.s){case 1:if(i=co(t,"URI"),e.h.has(i))return r.return(e.h.get(i));if(o=co(t,"TYPE").toLowerCase(),a=pe,"subtitles"==o&&(o=a.za),s=Un(Ui(t,"LANGUAGE","und")),u=Ui(t,"NAME"),c=t.getAttribute("DEFAULT"),l="YES"==c,f=Ui(t,"CHANNELS"),"audio"==o)if(f){var g=f.split("/")[0];g=parseInt(g,10)}else g=null;else g=null;return h=g,d=Ui(t,"CHARACTERISTICS"),A(r,no(e,i,n,o,s,l,u,h,null,d),2);case 2:return p=r.B,e.h.has(i)?r.return(e.h.get(i)):null==p?r.return(null):(e.L.set(t.id,p),e.h.set(i,p),r.return(p))}}))}))}function no(e,t,n,r,i,o,a,s,u,c){return g((function l(){var f,h,p,m,v,y,b,w,T,S,E,x,k,M,C,N,j,D,O,L,_,K,B,F,V,H,q,z;return U(l,(function(l){switch(l.s){case 1:return h=(f=Ki).Sc(e.F,t),A(l,mo(e,$e([h],e.g.retryParameters),0),2);case 2:if(p=l.B,h=p.uri,1!=(m=zi(e.C,p.data,h)).type)throw new $(2,4,4017);v=[],m.segments.forEach((function(e){e=f.Ab(e.h,"EXT-X-KEY"),v.push.apply(v,e)})),y=!1,b=[],w=null;for(var G=d(v),W=G.next();!W.done;W=G.next())if(T=W.value,"NONE"!=(S=co(T,"METHOD"))){if(y=!0,"AES-128"==S)return Y.v("Unsupported HLS Encryption",S),e.da=!0,l.return(null);E=co(T,"KEYFORMAT"),(k=(x=vo[E])?x(T):null)?(k.keyIds.length&&(w=k.keyIds[0]),b.push(k)):Y.v("Unsupported HLS KEYFORMAT",E)}if(y&&!b.length)throw new $(2,4,4026);return function(e,t){var n=bo,r=Ki.cb(t.g,"EXT-X-PLAYLIST-TYPE"),i=Ki.cb(t.g,"EXT-X-ENDLIST");i=r&&"VOD"==r.value||i,r=r&&"EVENT"==r.value&&!i,r=!i&&!r,i?go(e,n.$a):(go(e,r?n.Wd:n.Se),n=lo(t.g,"EXT-X-TARGETDURATION"),n=Number(n.value),e.J=Math.max(n,e.J),e.M=Math.min(n,e.M))}(e,m),M=function(e,t){if(1==t.length)return t[0];var n=uo(e,t);if(null!=n)return n;throw new $(2,4,4025,t)}(r,n),A(l,function(e,t,n,r){return g((function i(){var o,a,s,u,c,l,f,h,d,p;return U(i,(function(i){switch(i.s){case 1:return o=pe,a=r.segments[0].g,s=new Q(a),u=s.pa.split(".").pop(),c=po[t],(l=c[u])?i.return(l):t==o.za?n&&"vtt"!=n&&"wvtt"!=n?i.return("application/mp4"):i.return("text/vtt"):((f=$e([a],e.g.retryParameters)).method="HEAD",A(i,mo(e,f,1),2));case 2:return h=i.B,(d=h.headers["content-type"])?i.return(d.split(";")[0]):(p=c.mp4,i.return(p))}}))}))}(e,r,M,m),3);case 3:return C=l.B,ho.includes(C)&&(M=""),j=(N=f.cb(m.g,"EXT-X-MEDIA-SEQUENCE"))?Number(N.value):0,I(l,4),A(l,ao(e,t,m,j,C,M),6);case 6:D=l.B,P(l,5);break;case 4:if(4035==(O=R(l)).code)return Y.ba("Skipping unsupported HLS stream",C,t),l.return(null);throw O;case 5:if(L=D[0].startTime,_=D[D.length-1].endTime,K=_-L,B=new ai(D),F=ro(m),V=void 0,"text"==r&&(V="subtitle"),H=[],c)for(W=(G=d(c.split(","))).next();!W.done;W=G.next())q=W.value,H.push(q);return z={id:e.ea++,originalId:a,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:B.find.bind(B),getSegmentReference:B.get.bind(B),initSegmentReference:F,presentationTimeOffset:0,mimeType:C,codecs:M,kind:V,encrypted:y,keyId:w,language:i,label:a,type:r,primary:o,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:H,channelsCount:s,audioSamplingRate:null,closedCaptions:u},l.return({stream:z,fc:B,drmInfos:b,Pc:t,We:h,td:L,Yg:_,duration:K})}}))}))}function ro(e){var t=Ki.Ab(e.g,"EXT-X-MAP");if(!t.length)return null;if(1<t.length)throw new $(2,4,4020);var n=co(t=t[0],"URI"),r=Ki.Sc(e.h,n);return e=0,n=null,(t=Ui(t,"BYTERANGE"))&&(e=t.split("@"),t=Number(e[0]),n=(e=Number(e[1]))+t-1),new ri((function(){return[r]}),e,n)}function io(e,t,n,r){var i=t.h,o=t.g;t=lo(i,"EXTINF").value.split(","),t=r+Number(t[0]);var a=0,s=null;return(i=Ki.cb(i,"EXT-X-BYTERANGE"))&&(a=i.value.split("@"),i=Number(a[0]),s=(a=a[1]?Number(a[1]):e.g+1)+i-1),new ii(n,r,t,(function(){return[o]}),a,s)}function oo(e){e.i&&(e.P.forEach((function(t){e.i.Jb(t,0)})),e.P=[])}function ao(e,t,n,r,i,o){return g((function a(){var s,u,c,l,f,h,d,p,m,v;return U(a,(function(a){switch(a.s){case 1:return s=n.segments,u=[],c=s[0].g,l=io(null,s[0],r,0),f=ro(n),A(a,function(e,t,n,r,i,o){return g((function a(){var s,u,c,l,f,h,d,p,g;return U(a,(function(a){switch(a.s){case 1:if(e.A){if(s=e.h.get(t),u=s.fc,c=u.get(r.position))return Y.K("Found segment start time in previous manifest"),a.return(c.startTime);Y.debug("Unable to find segment start time in previous manifest!")}if(Y.K("Fetching segment to find start time"),i=i.toLowerCase(),ho.includes(i))throw Y.ba("Raw formats are not yet supported.  Skipping "+i),new $(1,4,4035);if("video/webm"==i)throw Y.ba("WebM in HLS is not yet supported.  Skipping."),new $(1,4,4035);if("video/mp4"!=i&&"audio/mp4"!=i){a.I(2);break}return l=[so(e,r)],n&&l.push(so(e,n)),A(a,Promise.all(l),3);case 3:return f=a.B,h=f[0],d=f[1]||f[0],a.return(function(e,t,n,r){var i=0;if((new _r).box("moov",Kr).box("trak",Kr).box("mdia",Kr).ma("mdhd",(function(e){e.reader.U(0==e.version?8:16),i=e.reader.N(),e.parser.stop()})).parse(r,!0),!i)throw Y.error("Unable to find timescale in init segment!"),new $(2,4,4030,e,t);var o=0,a=!1;if((new _r).box("moof",Kr).box("traf",Kr).ma("tfdt",(function(e){o=(0==e.version?e.reader.N():e.reader.Pb())/i,a=!0,e.parser.stop()})).parse(n,!0),!a)throw new $(2,4,4030,e,t);return o}(t,h.uri,h.data,d.data));case 2:if("video/mp2t"!=i){a.I(4);break}return A(a,so(e,r),5);case 5:return p=a.B,a.return(function(e,t,n){function r(){o.seek(a+188),71!=(s=o.ra())&&(o.seek(a+192),s=o.ra()),71!=s&&(o.seek(a+204),s=o.ra()),71!=s&&i(),o.Fe(1)}function i(){throw new $(2,4,4030,e,t)}for(var o=new Or(new DataView(n),0),a=0,s=0;;)if(a=o.ka(),71!=(s=o.ra())&&i(),8191==(8191&(n=o.dc())))r();else if(16384&n){if(0!=(n=(48&o.ra())>>4)&&2!=n||i(),3==n&&(n=o.ra(),o.U(n)),1==o.N()>>8)return o.U(3),0!=(n=o.ra()>>6)&&1!=n||i(),0==o.ra()&&i(),(1073741824*((14&(n=o.ra()))>>1)+((65534&o.dc())<<14|(65534&o.dc())>>1))/9e4;r()}else r()}(t,p.uri,p.data));case 4:if("application/mp4"!=i&&!i.startsWith("text/")){a.I(6);break}return A(a,so(e,r),7);case 7:return g=a.B,a.return(function(e,t,n){return yn(e=lt(e,t))?(bn(t=new mn(null),e),t.xc(n)):0}(i,o,g.data));case 6:throw new $(2,4,4030,t)}}))}))}(e,t,f,l,i,o),2);case 2:h=a.B,Y.debug("First segment",c.split("/").pop(),"starts at",h);for(var y=0;y<s.length;++y)d=s[y],p=u[u.length-1],m=0==y?h:p.endTime,v=io(p,d,r+y,m),u.push(v);return e.P.push(u),oo(e),a.return(u)}}))}))}function so(e,t){return g((function n(){var r,i,o,a,s,u;return U(n,(function(n){switch(n.s){case 1:return r=1,i=xi(t.i(),t.h,t.h+2048-1,e.g.retryParameters),o=xi(t.i(),t.h,t.g,e.g.retryParameters),e.g.hls.useFullSegmentsForStartTime?n.return(mo(e,o,r)):(I(n,2),A(n,mo(e,i,r),4));case 4:return a=n.B,n.return(a);case 2:if(7001==(s=R(n)).code)throw s;return Y.ba("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive!  Your server should support Range requests and CORS preflights.",i.uris[0]),A(n,mo(e,o,r),5);case 5:return u=n.B,n.return(u)}}))}))}function uo(e,t){for(var n=fo[e],r=0;r<n.length;r++)for(var i=0;i<t.length;i++)if(n[r].test(t[i].trim()))return t[i].trim();return"text"==e?"":null}function co(e,t){var n=e.getAttribute(t);if(!n)throw new $(2,4,4023,t);return n.value}function lo(e,t){var n=Ki.cb(e,t);if(!n)throw new $(2,4,4024,t);return n}H("shaka.net.DataUriPlugin",$i),$i.parse=function(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw Y.error("Bad data URI, failed to parse scheme"),new $(2,1,1004,t);if(2>(n=n.slice(1).join(":").split(",")).length)throw Y.error("Bad data URI, failed to extract encoding and MIME type"),new $(2,1,1004,t);var r=n[0];t=e.decodeURIComponent(n.slice(1).join(",")),n=r.split(";"),r=n[0];var i=!1;return 1<n.length&&"base64"==n[n.length-1]&&(i=!0,n.pop()),{data:i?xe.Ja(t).buffer:we(t),contentType:r}},Ye("data",$i),H("shaka.hls.HlsParser",Ji),(i=Ji.prototype).configure=function(e){this.g=e},i.start=function(e,t){var n=this;return g((function r(){var i,o;return U(r,(function(r){switch(r.s){case 1:return n.j=t,A(r,mo(n,$e([e],n.g.retryParameters),0),2);case 2:return i=r.B,n.F=i.uri,A(r,function(e,t){return g((function n(){var r,i,o,a,s,u,c,l,f,h,p;return U(n,(function(n){switch(n.s){case 1:if(0!=(r=zi(e.C,t,e.F)).type)throw new $(2,4,4022);return A(n,function(e,t){return g((function n(){var r,i,o,a,s,u,c,l,f,h,p,m;return U(n,(function(n){switch(n.s){case 1:return r=Ki,i=fe,o=t.g,a=r.Ab(t.g,"EXT-X-MEDIA"),s=a.filter(function(e){return"SUBTITLES"==co(e,"TYPE")}.bind(e)),u=s.map(function(e){var t=this;return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return t.g.disableText?n.return(null):(I(n,2),A(n,function(e,t){return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return co(t,"TYPE"),A(n,to(e,t,[]),2);case 2:return r=n.B,n.return(r.stream)}}))}))}(t,e),4));case 4:return n.return(n.B);case 2:if(r=R(n),t.g.hls.ignoreTextStreamFailures)return n.return(null);throw r}}))}))}.bind(e)),c=a.filter((function(e){return"CLOSED-CAPTIONS"==co(e,"TYPE")})),function(e,t){for(var n=d(t),r=n.next();!r.done;r=n.next()){co(r=r.value,"TYPE");var i=Ui(r,"LANGUAGE")||"und";i=Un(i);var o=co(r,"GROUP-ID");r=co(r,"INSTREAM-ID"),e.u.get(o)||e.u.set(o,new Map),e.u.get(o).set(r,i)}}(e,c),A(n,Promise.all(u),2);case 2:return l=n.B,f=r.Ab(o,"EXT-X-STREAM-INF"),h=f.map(function(e){return function(e,t,n){return g((function r(){var i,o,a,s,u,c,l,f,h,p,m,v,y,b,w,T,S,E,x,k,I,M,P,R,C,N,j,D,O;return U(r,(function(r){switch(r.s){case 1:return i=pe,o=Ki,a=[],e.g.disableVideo||a.push("avc1.42E01E"),e.g.disableAudio||a.push("mp4a.40.2"),s=a.join(","),u=Ui(t,"CODECS",s),c=function(e){for(var t=new Set,n=[],r=(e=d(e)).next();!r.done;r=e.next()){var i=ht(r=r.value)[0];t.has(i)?Y.debug("Ignoring duplicate codec"):(n.push(r),t.add(i))}return n}(u.split(/\s*,\s*/)),l=t.getAttribute("RESOLUTION"),h=f=null,p=Ui(t,"FRAME-RATE"),m=Number(Ui(t,"AVERAGE-BANDWIDTH"))||Number(co(t,"BANDWIDTH")),l&&(v=l.value.split("x"),f=v[0],h=v[1]),y=(y=o.Ab(n.g,"EXT-X-MEDIA")).filter((function(e){return"CLOSED-CAPTIONS"!=co(e,"TYPE")})),y=y.filter((function(e){var t=Ui(e,"URI")||"";return"SUBTITLES"==(Ui(e,"TYPE")||"")||""!=t})),b=Ui(t,"AUDIO"),w=Ui(t,"VIDEO"),b?y=o.Zc(y,"AUDIO",b):w&&(y=o.Zc(y,"VIDEO",w)),(T=uo(i.za,c))&&((S=Ui(t,"SUBTITLES"))&&(E=o.Zc(y,"SUBTITLES",S)).length&&(x=e.L.get(E[0].id))&&(x.stream.codecs=T),He(c,T)),k=y.map(function(e){return to(this,e,c)}.bind(e)),I=[],M=[],A(r,Promise.all(k),2);case 2:if(R=(R=r.B).filter((function(e){return null!=e})),b?I=R:w&&(M=R),Y.debug("Guessing stream type for",t.toString()),N=!1,I.length||M.length?I.length?(D=co(t,"URI"),O=I[0].Pc,D==O?(Y.debug("Guessing audio-only."),C=i.Sb,N=!0):(Y.debug("Guessing video."),C=i.Za)):(Y.debug("Guessing audio."),C=i.Sb):1==c.length?(j=uo(i.Za,c),l||p||j?(Y.debug("Guessing video-only."),C=i.Za):(Y.debug("Guessing audio-only."),C=i.Sb)):(Y.debug("Guessing multiplexed audio+video."),C=i.Za,c=[c.join(",")]),N){r.I(3);break}return A(r,function(e,t,n,r){return g((function i(){var o,a,s,u,c;return U(i,(function(i){switch(i.s){case 1:return o=pe,a=co(t,"URI"),e.h.has(a)?i.return(e.h.get(a)):(s=Ui(t,"CLOSED-CAPTIONS"),u=null,r==o.Za&&s&&"NONE"!=s&&(u=e.u.get(s)),A(i,no(e,a,n,r,"und",!1,null,null,u,null),2));case 2:return null==(c=i.B)?i.return(null):e.h.has(a)?i.return(e.h.get(a)):(e.h.set(a,c),i.return(c))}}))}))}(e,t,c,C),4);case 4:P=r.B;case 3:if(P)P.stream.type==i.Sb?I=[P]:M=[P];else if(null===P)return Y.debug("streamInfo is null"),r.return([]);return M&&Zi(M),I&&Zi(I),r.return(function(e,t,n,r,i,o,a){n.forEach(function(e){(e=e.stream)&&(e.width=Number(i)||void 0,e.height=Number(o)||void 0,e.frameRate=Number(a)||void 0)}.bind(e));var s=!!e.g&&e.g.disableAudio;t.length&&!s||(t=[null]),s=!!e.g&&e.g.disableVideo,(!n.length||s)&&(n=[null]),s=[];for(var u=(t=d(t)).next();!u.done;u=t.next()){u=u.value;for(var c=d(n),l=c.next();!l.done;l=c.next()){var f=l.value;l=u?u.stream:null;var h=f?f.stream:null,p=u?u.drmInfos:null,g=f?f.drmInfos:null;f=(f?f.Pc:"")+" - "+(u?u.Pc:"");var m=void 0;if(l&&h){if(p.length&&g.length&&!(0<Kt(p,g).length)){Y.v("Incompatible DRM info in HLS variant.  Skipping.");continue}m=Kt(p,g)}else l?m=p:h&&(m=g);e.Z.has(f)?Y.debug("Skipping variant which only differs in text streams."):(l=eo(e,l,h,r,m),s.push(l),e.Z.add(f))}}return s}(e,I,M,m,f,h,p))}}))}))}(this,e,t)}.bind(e)),A(n,Promise.all(h),3);case 3:return p=n.B,m=(m=p.reduce(i.Rc,[])).filter((function(e){return null!=e})),n.return({startTime:0,variants:m,textStreams:l.filter((function(e){return null!=e}))})}}))}))}(e,r),2);case 2:if(i=n.B,!e.j)throw new $(2,7,7001);if(e.da&&0==i.variants.length)throw Y.info("No stream is created, because we don't support AES-128","encryption yet"),new $(2,4,4034);e.j.filterAllPeriods([i]),o=1/0,a=0,s=1/0;for(var m=d(e.h.values()),v=m.next();!v.done;v=m.next())u=v.value,o=Math.min(o,u.td),a=Math.max(a,u.td),"text"!=u.stream.type&&(s=Math.min(s,u.duration));if(e.l!=bo.$a?(e.i=new Ei(0,3*e.J),e.i.hc(!1)):(e.i=new Ei(null,0),e.i.hc(!0)),oo(e),e.l!=bo.$a){for(e.X=e.M,c=bo,e.l==c.Wd&&(l=e.i.Ic,isNaN(e.g.availabilityWindowOverride)||(l=e.g.availabilityWindowOverride),e.i.Pd(l)),f=0;95443.7176888889<=a;)f+=95443.7176888889,a-=95443.7176888889;if(f)for(Y.debug("Offsetting live streams by",f,"to compensate for rollover"),v=(m=d(e.h.values())).next();!v.done;v=m.next())95443.7176888889>(h=v.value).td?(Y.K("Offset applied to",h.stream.type),h.stream.presentationTimeOffset=-f,h.fc.offset(f)):Y.K("Offset NOT applied to",h.stream.type)}else for(e.i.Fa(s),e.i.offset(-o),v=(m=d(e.h.values())).next();!v.done;v=m.next())(p=v.value).stream.presentationTimeOffset=o,p.fc.offset(-o),si(p.fc,s);e.A={presentationTimeline:e.i,periods:[i],offlineSessionIds:[],minBufferTime:0},k(n)}}))}))}(n,i.data),3);case 3:return 0<(o=n.X)&&n.m.V(o),r.return(n.A)}}))}))},i.stop=function(){this.m&&(this.m.stop(),this.m=null);var e=[];return this.o&&(e.push(this.o.destroy()),this.o=null),this.g=this.j=null,this.L.clear(),this.Z.clear(),this.h.clear(),this.A=null,Promise.all(e)},i.update=function(){if(this.l!=bo.$a){for(var e=[],t=d(this.h.values()),n=t.next();!n.done;n=t.next())e.push(Qi(this,n.value));return Promise.all(e)}},i.onExpirationUpdated=function(){};var fo={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},ho=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"],po={audio:{mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t",aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},video:{mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};function go(e,t){e.l=t,e.i&&e.i.hc(e.l==bo.$a),e.l!=bo.$a||e.m.stop()}function mo(e,t,n){if(!e.o)throw new $(2,7,7001);return t=e.j.networkingEngine.request(n,t),Ge(e.o,t),t.promise}var vo={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){var t=co(e,"METHOD");zn("HLS SAMPLE-AES-CENC","SAMPLE-AES-CENC will no longer be supported, see Issue #1227");var n=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];return n.includes(t)?(t=co(e,"URI"),t=$i.parse(t),t=de("com.widevine.alpha",[{initDataType:"cenc",initData:t=new Uint8Array(t.data)}]),(e=Ui(e,"KEYID"))&&(t.keyIds=[e.toLowerCase().substr(2)]),t):(Y.error("Widevine in HLS is only supported with [",n.join(", "),"], not",t),null)}},yo="VOD",bo={$a:yo,Se:"EVENT",Wd:"LIVE"};function wo(){this.g=new Map}function To(e,t,n){So(e,t).text=n}function So(e,t){return e.g.has(t)||e.g.set(t,new Eo),e.g.get(t)}function Eo(){this.text=this.variant=null}function xo(e,t){this.g=e,this.h=new Set([e]);for(var n=d(t=t||[]),r=n.next();!r.done;r=n.next())this.add(r.value)}function Ao(e,t){var n;if(!(n=!!e.audio!=!!t.audio||!!e.video!=!!t.video||e.language!=t.language)&&(n=e.audio&&t.audio)){n=e.audio;var r=t.audio;n=!(n.channelsCount==r.channelsCount&&ko(n,r)&&Io(n.roles,r.roles))}return!n&&(n=e.video&&t.video)&&(n=!(ko(n=e.video,r=t.video)&&Io(n.roles,r.roles))),!n}function ko(e,t){if(e.mimeType!=t.mimeType)return!1;var n=e.codecs.split(",").map((function(e){return ht(e)[0]})),r=t.codecs.split(",").map((function(e){return ht(e)[0]}));if(n.length!=r.length)return!1;n.sort(),r.sort();for(var i=0;i<n.length;i++)if(n[i]!=r[i])return!1;return!0}function Io(e,t){var n=new Set(e),r=new Set(t);if(n.delete("main"),r.delete("main"),n.size!=r.size)return!1;for(var i=(n=d(n)).next();!i.done;i=n.next())if(!r.has(i.value))return!1;return!0}function Mo(e){this.g=e,this.h=new Po(e.language,"",e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,"")}function Po(e,t,n,r){this.i=e,this.j=t,this.g=n,this.h=void 0===r?"":r}function Ro(){this.g=jo,this.h=(new Map).set(jo,2).set(No,1)}function Co(e,t,n){e.h.set(jo,n).set(No,t)}Si.Fd("m3u8",Ji),Si.Qb("application/x-mpegurl",Ji),Si.Qb("application/vnd.apple.mpegurl",Ji),xo.prototype.add=function(e){return Ao(this.g,e)?(this.h.add(e),!0):(Y.v("Rejecting variant - not compatible with root."),!1)},xo.prototype.values=function(){return this.h.values()},Mo.prototype.create=function(e){var t=this,n=e.filter((function(e){return Ao(t.g,e)}));return n.length?new xo(n[0],n):this.h.create(e)},Po.prototype.create=function(e){var t=[];t=function(e,t){var n=Kn(Un(t),e.map((function(e){return _n(e)})));return n?e.filter((function(e){return n==_n(e)})):[]}(e,this.i);var n=e.filter((function(e){return e.primary}));for((e=function(e,t){return e.filter((function(e){return!!e.audio&&(t?e.audio.roles.includes(t):0==e.audio.roles.length)}))}(t=t.length?t:n.length?n:e,this.j)).length?t=e:Y.v("No exact match for variant role could be found."),this.g&&((e=Fn.ee(t,this.g)).length?t=e:Y.v("No exact match for the channel count could be found.")),this.h&&(e=function(e,t){return e.filter((function(e){return!!e.audio&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(t,this.h),e.length?t=e:Y.v("No exact match for variant label could be found.")),e=new xo(t[0]),n=(t=d(t)).next();!n.done;n=t.next())n=n.value,Ao(e.g,n)&&e.add(n);return e};var No=0,jo=1;function Do(e,t){this.l=e,this.m=Lo(e),this.g=e.g.currentTime,this.j=Date.now()/1e3,this.h=!1,this.o=t,this.i=function(){}}function Oo(e){this.g=e}function Lo(e){if(e.g.paused||0==e.g.playbackRate||0==e.g.buffered.length)var t=!1;else e:{t=e.g.buffered,e=e.g.currentTime;for(var n=0;n<t.length;n++){var r=t.start(n),i=t.end(n);if(!(e<r-.1||e>i-.5)){t=!0;break e}}t=!1}return t}function Uo(e,t,n,r,i){var o=this;this.g=e,this.F=t,this.C=n,this.u=i,this.j=new tt,this.o=!1,this.A=e.readyState,this.i=!1,this.h=r,this.m=!1,this.j.H(e,"waiting",(function(){return _o(o)})),this.l=new Pe((function(){_o(o)})).Oa(.25)}function _o(e){if(0!=e.g.readyState){if(e.g.seeking){if(!e.o)return}else e.o=!1;if(!e.g.paused||0==e.g.currentTime){var t;if(e.g.readyState!=e.A&&(e.i=!1,e.A=e.g.readyState),!(t=!e.h)){var n=(t=e.h).l,r=Lo(n),i=n.g.currentTime,o=Date.now()/1e3;t.g==i&&t.m==r||(t.j=o,t.g=i,t.m=r,t.h=!1),(r=(i=o-t.j)>=t.o&&r&&!t.h)&&(t.i(t.g,i),t.h=!0,t.g=n.g.currentTime),t=!r}if(t){o=e.C.smallGapLimit,t=e.g.currentTime;e:{if((n=e.g.buffered)&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0)))for(r=navigator.userAgent.match(/Edge\//)||bt("Trident/")||mt()||bt("CrKey")?.5:.1,i=0;i<n.length;i++)if(n.start(i)>t&&(0==i||n.end(i-1)-t<=r)){r=i;break e}r=null}if(null!=r&&(0!=r||e.m)){i=n.start(r);var a=e.F.Ka();if(!(i>=a)){o=(a=i-t)<=o;var s=!1;if(!(.001>a)){if(!o&&!e.i){e.i=!0;var u=new _e("largegap",{currentTime:t,gapSize:a});u.cancelable=!0,e.u(u),e.C.jumpLargeGaps&&!u.defaultPrevented?s=!0:Y.info("Ignoring large gap at",t,"size",a)}(o||s)&&(0==r?Y.info("Jumping forward",a,"seconds because of gap before start time of",i):Y.info("Jumping forward",a,"seconds because of gap starting at",n.end(r-1),"and ending at",i),e.g.currentTime=i)}}}}}}}function Ko(e){var t=this;this.i=e,this.g=new Set,this.h=new Pe((function(){Bo(t,!1)})).Oa(.25)}function Bo(e,t){for(var n=d(e.g),r=n.next();!r.done;r=n.next())r.value.l(e.i.currentTime,t)}function Fo(e){for(var t=[],n=(e=d(e)).next();!n.done;n=e.next())for(var r=(n=d(n.value.variants)).next();!r.done;r=n.next())t.push(r.value);return t}function Vo(e,t){for(var n=null,r=d(e),i=r.next();!i.done;i=r.next())t>=(i=i.value).startTime&&(n=i);return n}function Ho(e){this.i=e,this.g=null,this.h=function(){}}function qo(e){var t=this;this.g=e,this.j=!1,this.i=this.g.wc(),this.h=new Pe((function(){t.g.pe(.25*t.i)}))}function zo(e){e.h.stop();var t=e.j?0:e.i;if(0<=t)try{return void(e.g.wc()!=t&&e.g.Od(t))}catch(n){}e.h.Oa(.25),0!=e.g.wc()&&e.g.Od(0)}function Go(e,t,n,r){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?r():(t=Wo.get(t),n.ya(e,t,r))}Do.prototype.release=function(){this.l=null,this.i=function(){}},Uo.prototype.release=function(){this.j&&(this.j.release(),this.j=null),null!=this.l&&(this.l.stop(),this.l=null),this.h&&(this.h.release(),this.h=null),this.g=this.F=this.u=null},Uo.prototype.zd=function(){this.m=!0,_o(this)},Ko.prototype.release=function(){this.h.stop();for(var e=d(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()},Ho.prototype.release=function(){this.g=this.i=null,this.h=function(){}},Ho.prototype.l=function(e){var t=this.g,n=this.i.periods;t!=(e=Vo(n,e)||n[0])&&this.h(e),this.g=e},qo.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null},qo.prototype.set=function(e){this.i=e,zo(this)},qo.prototype.vc=function(){return this.g.vc()};var Wo=new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]]);function Xo(e,t,n){var r=this;this.g=e,this.l=t,this.j=n,this.m=!1,this.h=new tt,this.i=new Zo(e),Go(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){Jo(r,r.j)}))}function Yo(e){return e.m?e.g.currentTime:e.j}function $o(e,t){0<e.g.readyState?ea(e.i,t):Go(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){Jo(e,e.j)}))}function Jo(e,t){.001>Math.abs(e.g.currentTime-t)?Qo(e):(e.h.ya(e.g,"seeking",(function(){Qo(e)})),ea(e.i,0==e.g.currentTime?t:e.g.currentTime))}function Qo(e){e.m=!0,e.h.H(e.g,"seeking",(function(){return e.l()}))}function Zo(e){var t=this;this.h=e,this.m=10,this.l=this.i=this.j=0,this.g=new Pe((function(){0>=t.j?(Y.v(["Failed to move playhead from",t.i,"to",t.l].join(" ")),t.g.stop()):t.h.currentTime!=t.i?t.g.stop():(t.h.currentTime=t.l,t.j--)}))}function ea(e,t){e.i=e.h.currentTime,e.l=t,e.j=e.m,e.h.currentTime=t,e.g.Oa(.1)}function ta(e){var t=this;this.g=e,this.j=!1,this.i=null,this.h=new tt,Go(this.g,HTMLMediaElement.HAVE_CURRENT_DATA,this.h,(function(){null==t.i?t.j=!0:(t.h.ya(t.g,"seeking",(function(){t.j=!0})),t.g.currentTime=Math.max(0,t.g.currentTime+t.i))}))}function na(e,t,n,r,i,o){var a=this;this.i=e,this.g=t.presentationTimeline,this.J=t.minBufferTime||0,this.m=n,this.F=i,this.u=null,this.j=new Uo(e,t.presentationTimeline,n,function(e,t){if(!t.stallEnabled)return null;var n=t.stallSkip,r=new Do(new Oo(e),t.stallThreshold);return function(e,t){e.i=t}(r,(function(t,r){Y.debug("Stall detected at "+t+" for "+r+" seconds."),n?(Y.debug("Seeking forward "+n+" seconds to break stall."),e.currentTime+=n):(Y.debug("Pausing and unpausing to break stall."),e.pause(),e.play())})),r}(e,n),o),this.h=new Xo(e,(function(){e:{var e=a.j;e.o=!0,e.m=!1,e.i=!1,e=Yo(a.h);var t=ia(a,e);if(.001<Math.abs(t-e)){var n=Date.now()/1e3;if(!a.u||a.u<n-1){a.u=n,$o(a.h,t),e=void 0;break e}}Y.K("Seek to "+e),a.F(),e=void 0}return e}),function(e,t){return null==t?t=1/0>e.g.ha()?e.g.Cb():e.g.Ka():0>t&&(t=e.g.Ka()+t),ra(e,oa(e,t))}(this,r)),this.o=new Pe((function(){if(0!=a.i.readyState&&!a.i.paused){var e=Yo(a.h),t=a.g.Cb(),n=a.g.Ka();3>n-t&&(t=n-3),e<t&&(t=ia(a,e),Y.info("Jumping forward "+(t-e)+" seconds to catch up with the seek range."),a.i.currentTime=t)}})).Oa(.25)}function ra(e,t){var n=e.g.ha();return t>=n?n-e.m.durationBackoff:t}function ia(e,t){var n=Yt.bind(null,e.i.buffered),r=Math.max(e.J,e.m.rebufferingGoal),i=e.m.safeSeekOffset,o=e.g.Cb(),a=e.g.Ka(),s=e.g.ha();3>a-o&&(o=a-3);var u=e.g.Zb(r),c=e.g.Zb(i);return r=e.g.Zb(r+i),t>=s?(Y.K("Playhead past duration."),ra(e,t)):t>a?(Y.K("Playhead past end."),a):t<o?n(c)?(Y.K("Playhead before start & start is buffered"),c):(Y.K("Playhead before start & start is unbuffered"),r):t>=u||n(t)?(Y.K("Playhead in safe region or in buffered region."),t):(Y.K("Playhead outside safe region & in unbuffered region."),r)}function oa(e,t){var n=e.g.Cb();return t<n||t>(n=e.g.Ka())?n:t}function aa(e){var t=this;this.h=function(){},this.g=new Set,this.j=e,this.i=new Pe((function(){for(var e=t.j(),n=d(t.g),r=n.next();!r.done;r=n.next())(r=r.value).endTime<e.start&&t.g.delete(r)})).Oa(2)}function sa(e){var t=this;this.m=e,this.j=new Map,this.g=function(){},this.h=function(){},this.i=function(){},this.o=[{rb:null,qb:ca,hb:function(e,n){return t.g(e,n)}},{rb:ua,qb:ca,hb:function(e,n){return t.g(e,n)}},{rb:la,qb:ca,hb:function(e,n){return t.g(e,n)}},{rb:ca,qb:ua,hb:function(e,n){return t.h(e,n)}},{rb:ca,qb:la,hb:function(e,n){return t.h(e,n)}},{rb:ua,qb:la,hb:function(e,n){return t.i(e,n)}},{rb:la,qb:ua,hb:function(e,n){return t.i(e,n)}}]}Xo.prototype.release=function(){this.h&&(this.h.release(),this.h=null),null!=this.i&&(this.i.release(),this.i=null),this.l=function(){},this.g=null},Zo.prototype.release=function(){this.g&&(this.g.stop(),this.g=null),this.h=null},ta.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.g=null},ta.prototype.A=function(e){this.i=this.j?this.i:e},ta.prototype.l=function(){return(this.j?this.g.currentTime:this.i)||0},ta.prototype.C=function(){},na.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.j&&(this.j.release(),this.j=null),this.o&&(this.o.stop(),this.o=null),this.i=this.h=this.g=this.m=null,this.F=function(){}},na.prototype.A=function(e){$o(this.h,e)},na.prototype.l=function(){var e=Yo(this.h);return 0<this.i.readyState&&!this.i.paused?oa(this,e):e},na.prototype.C=function(){this.j.zd()},aa.prototype.release=function(){this.h=function(){},this.g.clear(),this.i.stop()},sa.prototype.release=function(){this.m=null,this.j.clear(),this.g=function(){},this.h=function(){},this.i=function(){}},sa.prototype.l=function(e,t){for(var n=d(this.m.g),r=n.next();!r.done;r=n.next()){r=r.value;var i=this.j.get(r),o=e<r.startTime?ua:e>r.endTime?la:ca;this.j.set(r,o);for(var a=d(this.o),s=a.next();!s.done;s=a.next())(s=s.value).rb==i&&s.qb==o&&s.hb(r,t)}};var ua=1,ca=2,la=3;function fa(e,t){this.g=t,this.i=e,this.l=null,this.u=1,this.F=Promise.resolve(),this.m=[],this.o=new Map,this.h=new Map,this.C=!1,this.M=null,this.L=this.j=this.A=!1,this.J=0}function ha(e){return pa(e,"audio")}function da(e){return pa(e,"video")}function pa(e,t){var n=e.h.get(t);return n?n.Ta||n.stream:null}function ga(e,t){return g((function n(){var r,i,o,a,s,u,c,l,f;return U(n,(function(n){switch(n.s){case 1:return r=pe,A(n,Cn(e.g.T,r.za),2);case 2:return e.J++,e.L=!1,i=e.J,o=e.g.T,a=new Map,s=new Set,a.set(r.za,t),s.add(t),A(n,o.init(a,!1),3);case 3:return e.j?n.return():A(n,Ea(e,s),4);case 4:if(e.j)return n.return();u=e.g.T.l.isTextVisible()||e.l.alwaysStreamText,e.J!=i||e.h.has(r.za)||e.L||!u||(c=e.g.eb(),l=Ca(e,c),f=Ta(t,l,0),e.h.set(r.za,f),Oa(e,f,0)),k(n)}}))}))}function ma(e,t){var n=e.h.get("video");if(n){var r=n.stream;if(r)if(Y.debug("setTrickPlay",t),t){var i=r.trickModeVideo;i&&!n.Ta&&(Y.debug("Engaging trick mode stream",i),ya(e,i,!1,0,!1),n.Ta=r)}else(r=n.Ta)&&(Y.debug("Restoring non-trick-mode stream",r),n.Ta=null,ya(e,r,!0,0,!1))}}function va(e,t,n,r){var i=!1;if(t.video){var o=ya(e,t.video,n,r,!1);i=i||o}return t.audio&&(e=ya(e,t.audio,n,r,!1),i=i||e),i}function ya(e,t,n,r,i){var o=e.h.get(t.type);if(!o&&"text"==t.type&&e.l.ignoreTextStreamFailures)return ga(e,t),!0;if(!o)return!1;var a=Na(e,t),s=Array.from(e.h.values()).every((function(e){return e.oa==o.oa}));return n&&a!=o.oa&&s?(Y.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),e.h.forEach((function(t){ba(e,t)})),!0):(o.Ta&&(Y.debug("switch during trick play mode",t),t.trickModeVideo?(o.Ta=t,t=t.trickModeVideo,Y.debug("switch found trick play stream",t)):(o.Ta=null,Y.debug("switch found no special trick play stream"))),!(!(s=e.m[a])||!s.Rb||!(s=e.o.get(t.id))||!s.Rb||(o.stream!=t||i?("text"==t.type&&xn(e.g.T,lt(t.mimeType,t.codecs)),o.stream=t,o.Ac=!0,Y.debug("switch: switching to Stream "+Ka(o)),function(e,t,n){if(!t.lb)return!1;var r=e.g.eb(),i=In(e.g.T,t.type),o=ka(e,t,r,i,n);return n=o&&o.g?o.g-o.h:null,o&&!n&&(n=(o.endTime-o.xc())*t.stream.bandwidth/8),!isNaN(n)&&((o=t.stream.initSegmentReference)&&(n+=(o.g?o.g-o.h:null)||0),o=e.g.getBandwidthEstimate(),8*n/o<i-r-Math.max(e.i.minBufferTime||0,e.l.rebufferingGoal)||t.lb.h.g>n)}(e,o,a)&&(Y.info("Aborting current segment request to switch."),o.lb.abort()),n&&(o.ab?o.Qc=!0:o.Sa?(o.Wa=!0,o.oc=r,o.Qc=!0):(La(o),Da(e,o,!0,r).catch((function(t){e.g&&e.g.onError(t)})))),0):(Y.debug("switch: Stream "+Ka(o)+" already active"),1))))}function ba(e,t){var n=Ka(t);t.ab?Y.debug(n,"clear: already clearing the buffer"):t.Wa?Y.debug(n,"clear: already waiting"):t.Sa?(Y.debug(n,"clear: currently updating"),t.Wa=!0,t.oc=0):null==kn(e.g.T,t.type)?(Y.debug(n,"clear: nothing buffered"),null==t.Pa&&Oa(e,t,0)):(Y.debug(n,"clear: handling right now"),La(t),Da(e,t,!1,0).catch((function(t){e.g&&e.g.onError(t)})))}function wa(e,t,n,r,i){return g((function o(){var a,s,u,c,l,f,h;return U(o,(function(o){switch(o.s){case 1:return a=e.g.eb(),s=Ca(e,a),u=pe,c=new Map,l=new Set,t&&(c.set(u.Sb,t),l.add(t)),n&&(c.set(u.Za,n),l.add(n)),r&&(c.set(u.za,r),l.add(r)),f=e.g.T,h=e.l.forceTransmuxTS,A(o,f.init(c,h),2);case 2:return e.j?o.return():(function(e){var t=e.i.presentationTimeline.ha();1/0>t?e.g.T.Fa(t):e.g.T.Fa(Math.pow(2,32))}(e),A(o,Ea(e,l),3));case 3:if(e.j)return o.return();c.forEach((function(t,n){if(!e.h.has(n)){var r=Ta(t,s,i);e.h.set(n,r),Oa(e,r,0)}})),k(o)}}))}))}function Ta(e,t,n){return{stream:e,type:e.type,Hb:null,La:null,Ta:null,Ac:!0,oa:t,endOfStream:!1,Sa:!1,Pa:null,Wa:!1,oc:0,Qc:!1,ab:!1,Ed:!1,ac:!1,Hd:n||0,lb:null}}function Sa(e,t){var n=e.m[t];if(n)return Y.debug("(all) Period "+t+" is being or has been set up"),n.promise;Y.debug("(all) setting up Period "+t),n={promise:new me,Rb:!1},e.m[t]=n;for(var r=new Set,i=d(e.i.periods[t].variants),o=i.next();!o.done;o=i.next())(o=o.value).video&&r.add(o.video),o.video&&o.video.trickModeVideo&&r.add(o.video.trickModeVideo),o.audio&&r.add(o.audio);for(o=(i=d(e.i.periods[t].textStreams)).next();!o.done;o=i.next())r.add(o.value);return e.F=e.F.then(function(){if(!this.j)return Ea(this,r)}.bind(e)).then(function(){this.j||(this.m[t].promise.resolve(),this.m[t].Rb=!0,Y.K("(all) setup Period "+t))}.bind(e)).catch(function(e){this.j||(this.m[t].promise.catch((function(){})),this.m[t].promise.reject(),delete this.m[t],Y.v("(all) failed to setup Period "+t),this.g.onError(e))}.bind(e)),n.promise}function Ea(e,t){return g((function n(){var r,i,o,a,s,u,c;return U(n,(function(n){switch(n.s){case 1:r=[];for(var l=d(t),f=l.next();!f.done;f=l.next())i=f.value,(o=e.o.get(i.id))?(Y.debug("(all) Stream "+i.id+" is being or has been set up"),r.push(o.promise)):(Y.K("(all) setting up Stream "+i.id),e.o.set(i.id,{promise:new me,Rb:!1}),r.push(i.createSegmentIndex()));return I(n,2),A(n,Promise.all(r),4);case 4:if(e.j)return n.return();P(n,3);break;case 2:if(a=R(n),e.j)return n.return();for(f=(n=d(t)).next();!f.done;f=n.next())s=f.value,e.o.get(s.id).promise.catch((function(){})),e.o.get(s.id).promise.reject(),e.o.delete(s.id);throw a;case 3:for(f=(l=d(t)).next();!f.done;f=l.next())u=f.value,(c=e.o.get(u.id)).Rb||(c.promise.resolve(),c.Rb=!0,Y.K("(all) setup Stream "+u.id));k(n)}}))}))}function xa(e,t){if(!e.j){var n=Ka(t);if(!t.Sa&&null!=t.Pa&&!t.ab)if(t.Pa=null,t.Wa)Y.debug(n,"skipping update and clearing the buffer"),Da(e,t,t.Qc,t.oc);else{try{var r=function(e,t){if(Pa(t))return Rn(e.g.T,t.stream.originalId||""),null;var n=Ka(t),r=e.g.eb(),i=Aa(e,t,r);Y.O(n,"timeNeeded="+i);var o=Na(e,t.stream),a=Ca(e,i),s=function(e,t,n){return"text"==t?null==(e=e.g).h||e.h<n?0:e.h-Math.max(n,e.g):$t(e=Mn(e,t),n)}(e.g.T,t.type,r);Y.O(n,"update_:","presentationTime="+r,"bufferedAhead="+s);var u=Math.max(e.i.minBufferTime||0,e.l.rebufferingGoal,e.l.bufferingGoal)*e.u;if(i>=e.i.presentationTimeline.ha())return Y.debug(n,"buffered to end of presentation"),t.endOfStream=!0,"video"==t.type&&(i=e.h.get("text"))&&"application/cea-608"==i.stream.mimeType&&(i.endOfStream=!0),null;if(t.endOfStream=!1,t.oa=a,a!=o)return Y.debug(n,"need Period "+a,"presentationTime="+r,"timeNeeded="+i,"currentPeriodIndex="+o),null;if(s>=u)return Y.O(n,"buffering goal met"),.5;if(n=In(e.g.T,t.type),!(n=ka(e,t,r,n,o)))return 1;var c=1/0;return Array.from(e.h.values()).forEach((function(t){Pa(t)||(t=Aa(e,t,r),c=Math.min(c,t))})),i>=c+e.i.presentationTimeline.g?1:(t.Hd=0,function(e,t,n,r,i){var o=Ka(t),a=e.i.periods[r];Y.K(o,"fetchAndAppend_:","presentationTime="+n,"currentPeriod.startTime="+a.startTime,"reference.position="+i.position,"reference.startTime="+i.startTime,"reference.endTime="+i.endTime);var s=t.stream,u=e.i.presentationTimeline.ha(),c=e.i.periods[r+1];r=function(e,t,n,r,i){if(!t.Ac)return Promise.resolve();var o=Ka(t);return n=e.i.periods[n].startTime-t.stream.presentationTimeOffset,Y.K(o,"setting timestamp offset to "+n),Y.K(o,"setting append window start to "+r),Y.K(o,"setting append window end to "+i),r=function(e,t,n,r,i){return"text"==t?(e.g.A=n,(e=e.g).j=r,e.m=i,Promise.resolve()):Promise.all([Nn(e,t,e.Ve.bind(e,t)),Nn(e,t,e.Cg.bind(e,t,n)),Nn(e,t,e.zg.bind(e,t,r,i))])}(e.g.T,t.type,n,r,i),t.stream.initSegmentReference?(Y.K(o,"fetching init segment"),e=ja(e,t,t.stream.initSegmentReference).then(function(e){if(!this.j)return Y.K(o,"appending init segment"),Pn(this.g.T,t.type,e,null,null,t.stream.closedCaptions&&0<t.stream.closedCaptions.size)}.bind(e)).catch((function(e){return t.Ac=!0,Promise.reject(e)})),Promise.all([r,e])):r}(e,t,r,Math.max(0,a.startTime-.1),c?c.startTime+.01:u),t.Sa=!0,t.Ac=!1,Y.O(o,"fetching segment"),u=ja(e,t,i),Promise.all([r,u]).then(function(e){if(!this.j&&!this.A)return function(e,t,n,r,i,o,a){var s=Ka(t),u=i.closedCaptions&&0<i.closedCaptions.size;return null!=i.emsgSchemeIdUris&&0<i.emsgSchemeIdUris.length&&(new _r).ma("emsg",e.P.bind(e,r,o,i.emsgSchemeIdUris)).parse(a),function(e,t,n){var r=Ka(t);Y.O(r,"checking buffer length");var i=Math.max(e.l.bufferBehind,e.i.presentationTimeline.g),o=kn(e.g.T,t.type);if(null==o)return Y.O(r,"buffer behind okay because nothing buffered:","presentationTime="+n,"bufferBehind="+i),Promise.resolve();var a=n-o,s=a-i;return.01>=s?(Y.O(r,"buffer behind okay:","presentationTime="+n,"bufferedBehind="+a,"bufferBehind="+i,"underflow="+Math.abs(s)),Promise.resolve()):(Y.K(r,"buffer behind too large:","presentationTime="+n,"bufferedBehind="+a,"bufferBehind="+i,"overflow="+s),e.g.T.remove(t.type,o,o+s).then(function(){this.j||Y.K(r,"evicted "+s+" seconds")}.bind(e)))}(e,t,n).then(function(){if(!this.j)return Y.K(s,"appending media segment"),Pn(this.g.T,t.type,a,o.startTime+r.startTime,o.endTime+r.startTime,u)}.bind(e)).then(function(){if(!this.j)return Y.O(s,"appended media segment"),t.Hb=i,t.La=o,Promise.resolve()}.bind(e))}(this,t,n,a,s,i,e[1])}.bind(e)).then(function(){this.j||this.A||(t.Sa=!1,t.Ed=!1,t.Wa||this.g.zd(),Oa(this,t,0),function(e,t,n){if(!e.C){var r=Ka(t);if(1==(t=Array.from(e.h.values())).length&&"text"==t[0].type||(e.C=t.every((function(e){return"text"==e.type||!e.Wa&&!e.ab&&e.La}))),e.C){for(Y.debug(r,"startup complete"),n=Na(e,n),e.m[n]||Sa(e,n).then(function(){this.j||(Y.K(r,"calling onCanSwitch()..."),this.g.te())}.bind(e)).catch(fe.Bc),n=0;n<e.i.periods.length;++n)Sa(e,n).catch(fe.Bc);e.g.gg&&(Y.K(r,"calling onStartupComplete()..."),e.g.gg())}}}(this,t,s),Y.K(o,"finished fetch and append"))}.bind(e)).catch(function(e){this.j||this.A||(t.Sa=!1,"text"==t.type&&this.l.ignoreTextStreamFailures?(1001==e.code?Y.v(o,"Text stream failed to download. Proceeding without it."):Y.v(o,"Text stream failed to parse. Proceeding without it."),this.h.delete("text")):7001==e.code?(t.Sa=!1,t.Pa=null,Oa(this,t,0)):3017==e.code?function(e,t,n){var r=Ka(t);if(Array.from(e.h.values()).some((function(e){return e!=t&&e.Ed})))Y.debug(r,"MediaSource threw QuotaExceededError:","waiting for another stream to recover...");else{var i=Math.round(100*e.u);if(20<i)e.u-=.2;else{if(!(4<i))return Y.error(r,"MediaSource threw QuotaExceededError too many times"),t.ac=!0,e.A=!0,void e.g.onError(n);e.u-=.04}Y.v(r,"MediaSource threw QuotaExceededError:","reducing buffering goals by "+(100-Math.round(100*e.u))+"%"),t.Ed=!0}Oa(e,t,4)}(this,t,e):(Y.error(o,"failed fetch and append: code="+e.code),t.ac=!0,e.severity=2,_a(this,e)))}.bind(e))}(e,t,r,o,n),null)}(e,t);null!=r&&(Oa(e,t,r),t.ac=!1)}catch(i){return void _a(e,i)}r=Array.from(e.h.values()),function(e,t){var n=Ka(t),r=Na(e,t.stream);if(t.oa!=r){var i=t.oa,o=Array.from(e.h.values());o.every((function(e){return e.oa==i||Pa(e)}))?o.every(Ra)?(Y.debug(n,"all need Period "+i),Sa(e,i).then(function(){if(!this.j)if(o.every(function(e){var t=Ra(e),n=Na(this,e.stream);return!!Pa(e)||t&&e.oa==i&&n!=i}.bind(this))){var e=this.i.periods[i];Y.K(n,"calling onChooseStreams()...");var t=this.g.ue(e),r=new Map;t.variant&&t.variant.video&&r.set("video",t.variant.video),t.variant&&t.variant.audio&&r.set("audio",t.variant.audio),t.text&&r.set("text",t.text);for(var a=(t=d(this.h.keys())).next();!a.done;a=t.next())if(a=a.value,!r.has(a)&&"text"!=a)return Y.error(n,"invalid Streams chosen: missing "+a+" Stream"),void this.g.onError(new $(2,5,5005));for(a=(t=d(Array.from(r.keys()))).next();!a.done;a=t.next())if(a=a.value,!this.h.has(a)){if("text"!=a)return Y.error(n,"invalid Streams chosen: unusable "+a+" Stream"),void this.g.onError(new $(2,5,5005));wa(this,null,null,r.get("text"),e.startTime),r.delete(a)}for(a=(t=d(Array.from(this.h.keys()))).next();!a.done;a=t.next()){a=a.value;var s=this.h.get(a),u=r.get(a);if(u){var c=Pa(s);c&&(s.oa=i,s.Hd=e.startTime),ya(this,u,!1,0,!1),c&&Pa(s)||Oa(this,this.h.get(a),0)}else this.h.delete(a)}Y.K(n,"calling onCanSwitch()..."),this.g.te()}else Y.debug(n,"ignoring transition to Period",i,"since another is happening")}.bind(e)).catch(fe.Bc)):Y.debug(n,"all MediaStates need Period "+i+", but not all MediaStates are idle"):Y.debug(n,"not all MediaStates need Period "+i)}}(e,t),e.C&&r.every((function(e){return e.endOfStream}))&&(Y.K(n,"calling endOfStream()..."),e.g.T.endOfStream().then(function(){if(!this.j){var e=this.g.T.ha();0!=e&&e<this.i.presentationTimeline.ha()&&this.i.presentationTimeline.Fa(e)}}.bind(e)))}}}function Aa(e,t,n){return t.Hb&&t.La?(n=Na(e,t.Hb),e.i.periods[n].startTime+t.La.endTime):Math.max(n,t.Hd)}function ka(e,t,n,r,i){var o=Ka(t);return t.La&&t.stream==t.Hb?(r=t.La.position+1,Y.O(o,"next position known:","position="+r),Ma(e,t,i,r)):(t.La?(Y.K(o,"next position unknown: another Stream buffered"),o=Na(e,t.Hb),o=Ia(e,t,e.i.periods[o].startTime+t.La.endTime,i)):(Y.K(o,"next position unknown: nothing buffered"),o=Ia(e,t,r||n,i)),null==o?null:(n=null,null==r&&(n=Ma(e,t,i,Math.max(0,o-1))),n||Ma(e,t,i,o)))}function Ia(e,t,n,r){var i=Ka(t);return e=e.i.periods[r],Y.debug(i,"looking up segment:","presentationTime="+n,"currentPeriod.startTime="+e.startTime),n=Math.max(0,n-e.startTime),null==(t=t.stream.findSegmentPosition(n))&&Y.v(i,"cannot find segment:","currentPeriod.startTime="+e.startTime,"lookupTime="+n),t}function Ma(e,t,n,r){var i=Ka(t);return n=e.i.periods[n],(t=t.stream.getSegmentReference(r))?(e=(r=e.i.presentationTimeline).$b(),r=r.Db(),n.startTime+t.endTime<e||n.startTime+t.startTime>r?(Y.O(i,"segment is not available:","currentPeriod.startTime="+n.startTime,"reference.startTime="+t.startTime,"reference.endTime="+t.endTime,"availabilityStart="+e,"availabilityEnd="+r),null):t):(Y.K(i,"segment does not exist:","currentPeriod.startTime="+n.startTime,"position="+r),null)}function Pa(e){return e&&"text"==e.type&&"application/cea-608"==e.stream.mimeType}function Ra(e){return!e.Sa&&null==e.Pa&&!e.Wa&&!e.ab}function Ca(e,t){var n=Vo(e.i.periods,t+ge);return n?e.i.periods.indexOf(n):0}function Na(e,t){for(var n=e.i.periods,r=0;r<n.length;r++){for(var i=n[r],o=new Set,a=d(i.variants),s=a.next();!s.done;s=a.next())(s=s.value).audio&&o.add(s.audio),s.video&&o.add(s.video),s.video&&s.video.trickModeVideo&&o.add(s.video.trickModeVideo);for(a=(i=d(i.textStreams)).next();!a.done;a=i.next())o.add(a.value);if(o.has(t))return r}return-1}function ja(e,t,n){var r=xi(n.i(),n.h,n.g,e.l.retryParameters);return Y.O("fetching: reference=",n),e=e.g.Ib.request(1,r),t.lb=e,e.promise.then((function(e){return t.lb=null,e.data}))}function Da(e,t,n,r){return g((function i(){var o,a,s,u;return U(i,(function(i){switch(i.s){case 1:return o=Ka(t),t.Wa=!1,t.Qc=!1,t.oc=0,t.ab=!0,t.Hb=null,t.La=null,Y.debug(o,"clearing buffer"),r?(s=e.g.eb(),u=e.g.T.ha(),a=e.g.T.remove(t.type,s+r,u)):a=Cn(e.g.T,t.type).then(function(){if(!this.j&&n)return this.g.T.flush(t.type)}.bind(e)),A(i,a,2);case 2:if(e.j)return i.return();Y.debug(o,"cleared buffer"),t.ab=!1,t.endOfStream=!1,Oa(e,t,0),k(i)}}))}))}function Oa(e,t,n){var r=Ka(t),i=t.type;"text"!=i||e.h.has(i)?(Y.O(r,"updating in "+n+" seconds"),t.Pa=new Me((function(){return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return I(n,2),A(n,xa(e,t),4);case 4:P(n,0);break;case 2:r=R(n),e.g&&e.g.onError(r),k(n)}}))}))})).V(n)):Y.K(r,"Text stream is unloaded. No update is needed.")}function La(e){null!=e.Pa&&(e.Pa.stop(),e.Pa=null)}function Ua(e){return g((function t(){return U(t,(function(t){if(1===t.s){if(e.lb)return A(t,e.lb.abort(),0);t.I(0)}}))}))}function _a(e,t){Ce(e.M).then(function(){this.j||(this.g.onError(t),t.handled||this.l.failureCallback(t))}.bind(e))}function Ka(e){return"("+e.type+":"+e.stream.id+")"}function Ba(e,t,n,r,i,o){if(200<=n&&299>=n&&202!=n)return{uri:i||r,Bd:r,data:t,headers:e,fromCache:!!e["x-shaka-from-cache"]};i=null;try{i=be(t)}catch(a){}throw Y.debug("HTTP error text:",i),new $(401==n||403==n?2:1,1,1001,r,n,i,e,o)}function Fa(e,t,n,r){var i=new Fa.h;ut(t.headers).forEach((function(e,t){i.append(t,e)}));var o=new Fa.g,a={Zd:!1,Oe:!1};if(e=new Ne(e=Fa.u(e,n,{body:t.body||void 0,headers:i,method:t.method,signal:o.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},a,r),(function(){return a.Zd=!0,o.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var s=new Pe((function(){a.Oe=!0,o.abort()}));s.V(t/1e3),e.finally((function(){s.stop()}))}return e}function Va(e,t,n,r){var i=new Va.j,o=Date.now(),a=0;return new Ne(new Promise((function(s,u){for(var c in i.open(t.method,e,!0),i.responseType="arraybuffer",i.timeout=t.retryParameters.timeout,i.withCredentials=t.allowCrossSiteCredentials,i.onabort=function(){u(new $(1,1,7001,e,n))},i.onload=function(t){for(var r=(t=t.target).getAllResponseHeaders().trim().split("\r\n"),i={},o=(r=d(r)).next();!o.done;o=r.next())i[(o=o.value.split(": "))[0].toLowerCase()]=o.slice(1).join(": ");try{var a=Ba(i,t.response,t.status,e,t.responseURL,n);s(a)}catch(c){u(c)}},i.onerror=function(t){u(new $(1,1,1002,e,t,n))},i.ontimeout=function(){u(new $(1,1,1003,e,n))},i.onprogress=function(e){var t=Date.now();(100<t-o||e.lengthComputable&&e.loaded==e.total)&&(r(t-o,e.loaded-a,e.total-e.loaded),a=e.loaded,o=t)},t.headers)i.setRequestHeader(c.toLowerCase(),t.headers[c]);i.send(t.body)})),(function(){return i.abort(),Promise.resolve()}))}function Ha(){this.g=this.j=this.h=0,this.i=new Map,this.l=0}function qa(e,t,n){this.m=e,this.h=new Map,this.i=!1,this.l=t,this.j=n,this.g=new Ha}function za(e,t,n,r,i,o){var a=function(e,t){e.h+=t;var n=e.l;return e.l++,e.i.set(n,t),n}(e.g,r);r=e.h.get(t)||Promise.resolve(),e.h.set(t,r.then((function(){return g((function t(){var r,s,u,c,l,f;return U(t,(function(t){switch(t.s){case 1:return A(t,function(e,t){return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return A(n,e.m.request(1,t).promise,2);case 2:return r=n.B,n.return(r.data)}}))}))}(e,n),2);case 2:if(r=t.B,e.i)throw new $(2,9,7001);if(i)for(var h in s=new Uint8Array(r),(u=new zr(s)).data)c=Number(h),l=u.data[c],f=u.g[c],e.j(l,f);return e.g.close(a,r.byteLength),h=e.g,e.l(0==h.h?0:h.j/h.h,e.g.g),t.return(o(r))}}))}))})))}function Ga(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new me,e.onabort=function(e){e.preventDefault(),n.g.reject()},e.onerror=function(e){e.preventDefault(),n.g.reject()},e.oncomplete=function(){n.g.resolve()}}function Wa(e,t){return new Promise((function(n,r){var i=e.h.openCursor();i.onerror=r,i.onsuccess=function(e){if(!(e=e.target.result))return n();t(e.key,e.value,e),e.continue()}}))}function Xa(e){this.h=e,this.g=[]}function Ya(e,t){return $a(e,t,"readwrite")}function $a(e,t,n){var r=new Ga(n=e.h.transaction([t],n),t);return e.g.push(r),r.promise().then((function(){He(e.g,r)}),(function(){He(e.g,r)})),r}function Ja(e,t,n){this.h=new Xa(e),this.i=t,this.g=n}function Qa(e){return Promise.reject(new $(2,9,9011,"Cannot add new value to "+e))}function Za(e,t,n,r){t=(e=Ya(e.h,t)).store();for(var i={},o=(n=d(n)).next();!o.done;i={key:i.key},o=n.next())i.key=o.value,t.delete(i.key).onsuccess=function(e){return function(){return r(e.key)}}(i);return e.promise()}function es(e,t,n){return g((function r(){var i,o,a,s,u,c,l;return U(r,(function(r){switch(r.s){case 1:for(i=$a(e.h,t,"readonly"),o=i.store(),a={},s=[],u={},c=d(n),l=c.next();!l.done;u={request:u.request,key:u.key},l=c.next())u.key=l.value,u.request=o.get(u.key),u.request.onsuccess=function(e){return function(){null==e.request.result&&s.push(e.key),a[e.key]=e.request.result}}(u);return A(r,i.promise(),2);case 2:if(s.length)throw new $(2,9,9012,"Could not find values for "+s);return r.return(n.map((function(e){return a[e]})))}}))}))}function ts(e){this.g=new Xa(e)}function ns(){this.g=new Map}function rs(e,t,n){if(!(e=e.g.get(t)))throw new $(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(n)))throw new $(2,9,9013,"Could not find cell with name "+n);return t}function is(e,t){os.set(e,t)}fa.prototype.destroy=function(){var e=this;return g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:n=[];for(var i=d(e.h.values()),o=i.next();!o.done;o=i.next())La(r=o.value),n.push(Ua(r));return A(t,Promise.all(n),2);case 2:e.h.clear(),e.o.clear(),e.g=null,e.i=null,e.F=null,e.m=null,e.l=null,e.j=!0,k(t)}}))}))},fa.prototype.configure=function(e){this.l=e,this.M=new Re({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0},!0)},fa.prototype.start=function(){var e=this;return g((function t(){var n,r,i;return U(t,(function(t){switch(t.s){case 1:return n=e.g.eb(),r=Ca(e,n),(i=e.g.ue(e.i.periods[r])).variant||i.text?A(t,wa(e,i.variant?i.variant.audio:null,i.variant?i.variant.video:null,i.text,n),2):(Y.error("init: no Streams chosen"),t.return(new $(2,5,5005)));case 2:if(e.j)return t.return();Y.debug("init: completed initial Stream setup"),e.g&&e.g.Yf&&(Y.K("init: calling onInitialStreamsSetup()..."),e.g.Yf()),k(t)}}))}))},fa.prototype.P=function(e,t,n,r){var i=r.reader.Cd(),o=r.reader.Cd(),a=r.reader.N(),s=r.reader.N(),u=r.reader.N(),c=r.reader.N();r=r.reader.mb(r.reader.S.byteLength-r.reader.ka()),e=e.startTime+t.startTime+s/a,n.includes(i)&&("urn:mpeg:dash:event:2012"==i?this.g.Zf():this.g.onEvent(new _e("emsg",{detail:{startTime:e,endTime:e+u/a,schemeIdUri:i,value:o,timescale:a,presentationTimeDelta:s,eventDuration:u,id:c,messageData:r}})))},H("shaka.net.HttpFetchPlugin",Fa),Fa.u=function(e,t,n,r,i){return g((function o(){var a,s,u,c,l,f,h,d,p,m,v,y;return U(o,(function(o){switch(o.s){case 1:return a=Fa.l,s=Fa.i,f=l=0,h=Date.now(),I(o,2),A(o,a(e,n),4);case 4:return u=o.B,d=u.clone().body.getReader(),m=(p=u.headers.get("Content-Length"))?parseInt(p,10):0,new s({start:function(e){!function t(){return g((function n(){var r,o,a;return U(n,(function(n){switch(n.s){case 1:return I(n,2),A(n,d.read(),4);case 4:r=n.B,P(n,3);break;case 2:return o=R(n),Y.K("error reading from stream",o.message),n.return();case 3:r.done||(l+=r.value.byteLength),(100<(a=Date.now())-h||r.done)&&(i(a-h,l-f,m-l),f=l,h=a),r.done?e.close():(e.enqueue(r.value),t()),k(n)}}))}))}()}}),A(o,u.arrayBuffer(),5);case 5:c=o.B,P(o,3);break;case 2:if(v=R(o),r.Zd)throw new $(1,1,7001,e,t);if(r.Oe)throw new $(1,1,1003,e,t);throw new $(1,1,1002,e,v,t);case 3:return y={},u.headers.forEach((function(e,t){y[t.trim()]=e})),o.return(Ba(y,c,u.status,e,u.url,t))}}))}))},Fa.isSupported=function(){if(!e.ReadableStream)return!1;try{new ReadableStream({})}catch(u){return!1}return!(!e.fetch||!e.AbortController)},Fa.isSupported=Fa.isSupported,Fa.l=e.fetch,Fa.g=e.AbortController,Fa.i=e.ReadableStream,Fa.h=e.Headers,Fa.isSupported()&&(Ye("http",Fa,2),Ye("https",Fa,2)),H("shaka.net.HttpXHRPlugin",Va),Va.j=e.XMLHttpRequest,Ye("http",Va,1),Ye("https",Va,1),Ha.prototype.close=function(e,t){if(this.i.has(e)){var n=this.i.get(e);this.i.delete(e),this.j+=n,this.g+=t}},qa.prototype.destroy=function(){return this.i=!0,Promise.all(this.h.values()).then((function(){}),(function(){}))},Ga.prototype.abort=function(){try{this.i.abort()}catch(u){}return this.g.catch((function(){}))},Ga.prototype.store=function(){return this.h},Ga.prototype.promise=function(){return this.g},Xa.prototype.destroy=function(){return Promise.all(this.g.map((function(e){return e.abort()})))},(i=Ja.prototype).destroy=function(){return this.h.destroy()},i.hasFixedKeySpace=function(){return!0},i.addSegments=function(){return Qa(this.i)},i.removeSegments=function(e,t){return Za(this,this.i,e,t)},i.getSegments=function(e){var t=this;return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return A(n,es(t,t.i,e),2);case 2:return r=n.B,n.return(r.map((function(e){return t.ae(e)})))}}))}))},i.addManifests=function(){return Qa(this.g)},i.updateManifestExpiration=function(e,t){var n=Ya(this.h,this.g),r=n.store();return r.get(e).onsuccess=function(n){(n=n.target.result)&&(n.expiration=t,r.put(n,e))},n.promise()},i.removeManifests=function(e,t){return Za(this,this.g,e,t)},i.getManifests=function(e){var t=this;return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return A(n,es(t,t.g,e),2);case 2:return r=n.B,n.return(r.map((function(e){return t.pc(e)})))}}))}))},i.getAllManifests=function(){var e=this;return g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:return n=$a(e.h,e.g,"readonly"),r=new Map,A(t,Wa(n,(function(t,n){r.set(t,e.pc(n))})),2);case 2:return A(t,n.promise(),3);case 3:return t.return(r)}}))}))},i.ae=function(e){return e},i.pc=function(e){return e},i.add=function(e,t){var n=this;return g((function r(){var i,o,a,s;return U(r,(function(r){switch(r.s){case 1:i=Ya(n.h,e),o=i.store(),a=[];for(var u=d(t),c=u.next();!c.done;c=u.next())s=c.value,o.add(s).onsuccess=function(e){a.push(e.target.result)};return A(r,i.promise(),2);case 2:return r.return(a)}}))}))},ts.prototype.destroy=function(){return this.g.destroy()},ts.prototype.getAll=function(){var e=this;return g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:return n=$a(e.g,"session-ids","readonly"),r=[],A(t,Wa(n,(function(e,t){r.push(t)})),2);case 2:return A(t,n.promise(),3);case 3:return t.return(r)}}))}))},ts.prototype.add=function(e){for(var t=Ya(this.g,"session-ids"),n=t.store(),r=(e=d(e)).next();!r.done;r=e.next())n.add(r.value);return t.promise()},ts.prototype.remove=function(e){var t=this;return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return A(n,Wa(r=Ya(t.g,"session-ids"),(function(t,n,r){0<=e.indexOf(n.sessionId)&&r.delete()})),2);case 2:return A(n,r.promise(),0)}}))}))},ns.prototype.destroy=function(){for(var e=[],t=d(this.g.values()),n=t.next();!n.done;n=t.next())e.push(n.value.destroy());return this.g.clear(),Promise.all(e)},ns.prototype.init=function(){var e=this;os.forEach((function(t,n){var r=t();r?e.g.set(n,r):Y.info("Skipping "+n+" as it is not supported on this platform")}));for(var t=[],n=d(this.g.values()),r=n.next();!r.done;r=n.next())t.push(r.value.init());return Promise.all(t)},ns.prototype.erase=function(){var e=this;return g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:return n=Array.from(e.g.values()),(r=0<n.length)||os.forEach((function(e){(e=e())&&n.push(e)})),A(t,Promise.all(n.map((function(e){return e.erase()}))),2);case 2:if(!r)return A(t,Promise.all(n.map((function(e){return e.destroy()}))),0);t.I(0)}}))}))},H("shaka.offline.StorageMuxer.register",is),H("shaka.offline.StorageMuxer.unregister",(function(e){os.delete(e)}));var os=new Map;function as(e){Ja.apply(this,arguments)}function ss(e){return function(e){var t=e.streams.filter((function(e){return"audio"==e.contentType})),n=e.streams.filter((function(e){return"video"==e.contentType}));if(!t.every((function(e){return e.variantIds}))||!n.every((function(e){return e.variantIds}))){t.forEach((function(e){e.variantIds=[]})),n.forEach((function(e){e.variantIds=[]}));var r=0;if(n.length&&!t.length){Y.debug("Found video-only content. Creating variants for video.");var i=r++;n.forEach((function(e){e.variantIds.push(i)}))}if(!n.length&&t.length){Y.debug("Found audio-only content. Creating variants for audio.");var o=r++;t.forEach((function(e){e.variantIds.push(o)}))}n.length&&t.length&&(Y.debug("Found audio-video content. Creating variants."),t.forEach((function(e){n.forEach((function(t){var n=r++;e.variantIds.push(n),t.variantIds.push(n)}))})))}}(e),e.streams.forEach((function(){})),{startTime:e.startTime,streams:e.streams.map(us)}}function us(e){var t=e.initSegmentUri?ls(e.initSegmentUri):null;return{id:e.id,originalId:null,primary:e.primary,presentationTimeOffset:e.presentationTimeOffset,contentType:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,kind:e.kind,language:e.language,label:e.label,width:e.width,height:e.height,initSegmentKey:t,encrypted:e.encrypted,keyId:e.keyId,segments:e.segments.map(cs),variantIds:e.variantIds}}function cs(e){var t=ls(e.uri);return{startTime:e.startTime,endTime:e.endTime,dataKey:t}}function ls(e){var t;if((t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e))||(t=/^offline:segment\/([0-9]+)$/.exec(e)))return Number(t[1]);throw new $(2,9,9004,"Could not parse uri "+e)}function fs(e,t,n,r){Ja.call(this,e,t,n),this.j=r}function hs(){this.l=this.i=this.h=this.g=this.j=null}function ds(e,t,n,r){this.g=e,this.l=t,this.j=n,this.i=r,this.h=["offline:",e,"/",t,"/",n,"/",r].join("")}function ps(e){if(null==(e=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e)))return null;var t=e[1];if("manifest"!=t&&"segment"!=t)return null;var n=e[2];if(!n)return null;var r=e[3];return r&&null!=t?new ds(t,n,r,Number(e[4])):null}function gs(e,t){this.h=e,this.g=t}function ms(e,t,n){var r=t.streams.filter((function(e){return"audio"==e.contentType})),i=t.streams.filter((function(e){return"video"==e.contentType}));return r=function(e,t,n){for(var r=new Set,i=d(t),o=i.next();!o.done;o=i.next()){var a=d(o.value.variantIds);for(o=a.next();!o.done;o=a.next())r.add(o.value)}for(i=d(n),o=i.next();!o.done;o=i.next())for(a=d(o.value.variantIds),o=a.next();!o.done;o=a.next())r.add(o.value);for(i=new Map,r=d(r),o=r.next();!o.done;o=r.next())o=o.value,i.set(o,{id:o,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0});for(t=d(t),r=t.next();!r.done;r=t.next())for(r=r.value,o=vs(e,r),a=d(r.variantIds),r=a.next();!r.done;r=a.next())(r=i.get(r.value)).language=o.language,r.primary=r.primary||o.primary,r.audio=o;for(n=d(n),t=n.next();!t.done;t=n.next())for(r=t.value,t=vs(e,r),o=d(r.variantIds),r=o.next();!r.done;r=o.next())(r=i.get(r.value)).primary=r.primary||t.primary,r.video=t;return i}(e,r,i),i=t.streams.filter((function(e){return"text"==e.contentType})).map((function(t){return vs(e,t)})),t.streams.forEach((function(r){r=r.segments.map((function(t,n){return ys(e,n,t)})),n.Jb(r,t.startTime)})),{startTime:t.startTime,variants:Array.from(r.values()),textStreams:i}}function vs(e,t){var n=t.segments.map((function(t,n){return ys(e,n,t)})),r=new ai(n);return n={id:t.id,originalId:t.originalId,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(e){return r.find(e)},getSegmentReference:function(e){return r.get(e)},initSegmentReference:null,presentationTimeOffset:t.presentationTimeOffset,mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate||void 0,pixelAspectRatio:t.pixelAspectRatio||void 0,kind:t.kind,encrypted:t.encrypted,keyId:t.keyId,language:t.language,label:t.label||null,type:t.contentType,primary:t.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},null!=t.initSegmentKey&&(n.initSegmentReference=function(e,t){var n=new ds("segment",e.h,e.g,t);return new ri((function(){return[n.toString()]}),0,null)}(e,t.initSegmentKey)),n}function ys(e,t,n){var r=new ds("segment",e.h,e.g,n.dataKey);return new ii(t,n.startTime,n.endTime,(function(){return[r.toString()]}),0,null)}function bs(){this.g=null}function ws(e){var t=ps(e);return t&&"manifest"==t.g?ws.m(e):t&&"segment"==t.g?ws.o(t.key(),t):je(new $(2,1,9004,e))}function Ts(e,t,n){return g((function r(){var i,o,a,s,u,c;return U(r,(function(r){switch(r.s){case 1:i=[];for(var l=[],f=d(n),h=f.next();!h.done;h=f.next()){h=h.value;for(var p=!1,m=d(l),v=m.next();!v.done;v=m.next())if(Ss((v=v.value).info,h)){v.sessionIds.push(h.sessionId),p=!0;break}p||l.push({info:h,sessionIds:[h.sessionId]})}o=d(l),a=o.next();case 2:if(a.done){r.I(4);break}return s=a.value,u=function(e,t,n){return g((function r(){var i,o,a,s;return U(r,(function(r){switch(r.s){case 1:return i=new Et({Ib:t,onError:function(){},Dc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),I(r,2),i.configure(e),A(r,function(e,t,n,r,i,o){var a=new Map;return a.set(t,{audioCapabilities:i,videoCapabilities:o,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:t,drmInfos:[{keySystem:t,licenseServerUri:n,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:r,initData:null,keyIds:null}]}),jt(e,a)}(i,n.info.keySystem,n.info.licenseUri,n.info.serverCertificate,n.info.audioCapabilities,n.info.videoCapabilities),4);case 4:P(r,3);break;case 2:return o=R(r),Y.v("Error initializing EME",o),A(r,i.destroy(),5);case 5:case 9:return r.return([]);case 3:return I(r,6),A(r,kt(i),8);case 8:P(r,7);break;case 6:return a=R(r),Y.v("Error setting server certificate",a),A(r,i.destroy(),9);case 7:return s=[],A(r,Promise.all(n.sessionIds.map((function(e){return g((function t(){var n;return U(t,(function(t){switch(t.s){case 1:return I(t,2),A(t,function(e,t){return g((function n(){var r,i,o;return U(n,(function(n){switch(n.s){case 1:return A(n,Dt(e,t),2);case 2:return(r=n.B)?(i=[],(o=e.h.get(r))&&(o.Ga=new me,i.push(o.Ga)),Y.O("Attempting to remove session",t),i.push(r.remove()),A(n,Promise.all(i),0)):(Y.O("Ignoring attempt to remove missing session",t),n.return())}}))}))}(i,e),4);case 4:s.push(e),P(t,0);break;case 2:n=R(t),Y.v("Error deleting offline session",n),k(t)}}))}))}))),10);case 10:return A(r,i.destroy(),11);case 11:return r.return(s)}}))}))}(e,t,s),A(r,u,5);case 5:c=r.B,i=i.concat(c),a=o.next(),r.I(2);break;case 4:return r.return(i)}}))}))}function Ss(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&qe(e.audioCapabilities,t.audioCapabilities,n)&&qe(e.videoCapabilities,t.videoCapabilities,n)}function Es(e,t){var n={Ia:null,D:null,mimeType:null,startTime:null,Rd:null,uri:null},r=this;this.m=t,this.i=e,this.j=n,this.o=null,this.l=[],this.h=this.g=null,this.u=!0,this.A=Promise.resolve().then((function(){return function(e){return g((function t(){return U(t,(function(t){if(1===t.s){if(e.u){if(0==e.l.length||e.g&&!e.g.gb)var n=!1;else{e.g&&(e.g.Da.kb(),e.g=null);var r=(n=e.l.shift()).create(e.j);r?(n.Da.Kb(),e.g={node:r.node,payload:r.payload,gb:r.gb,Da:n.Da}):n.Da.Ec(),n=!0}return n?n=Promise.resolve():e.g?n=function(e){return g((function t(){var n,r;return U(t,(function(t){switch(t.s){case 1:return e.i=e.m.Af(e.i,e.j,e.g.node,e.g.payload),I(t,2),e.h=e.m.ef(e.i,e.j,e.g.payload),A(t,e.h.promise,4);case 4:e.h=null,e.i==e.g.node&&(e.g.Da.Cc(),e.g=null),P(t,0);break;case 2:return 7001==(n=R(t)).code?e.g.Da.kb():e.g.Da.onError(n),e.g=null,e.h=null,r=e,A(t,e.m.handleError(e.j,n),5);case 5:r.i=t.B,k(t)}}))}))}(e):(e.m.Xf(e.i),e.o=new me,n=e.o),A(t,n,1)}t.I(0)}}))}))}(r)}))}function xs(e,t){var n={Kb:function(){},Cc:function(){},kb:function(){},onError:function(){},Ec:function(){},$g:function(){}};return e.l.push({create:t,Da:n}),e.h&&e.h.abort(),As(e),n}function As(e){e.o&&(e.o.resolve(),e.o=null)}function ks(e){this.g=null;for(var t=0;t<e.textTracks.length;++t){var n=e.textTracks[t];n.mode="disabled","Shaka Player TextTrack"==n.label&&(this.g=n)}this.g||(this.g=e.addTextTrack("subtitles","Shaka Player TextTrack")),this.g.mode="hidden"}function Is(e){if(e.startTime>=e.endTime)return Y.v("Invalid cue times: "+e.startTime+" - "+e.endTime),null;var t=new VTTCue(e.startTime,e.endTime,e.payload);t.lineAlign=e.lineAlign,t.positionAlign=e.positionAlign,e.size&&(t.size=e.size);try{t.align=e.textAlign}catch(n){}return"center"==e.textAlign&&"center"!=t.align&&(t.align="middle"),"vertical-lr"==e.writingMode?t.vertical="lr":"vertical-rl"==e.writingMode&&(t.vertical="rl"),1==e.lineInterpretation&&(t.snapToLines=!1),null!=e.line&&(t.line=e.line),null!=e.position&&(t.position=e.position),t}function Ms(e,t){var n=e.mode;e.mode="showing"==n?"showing":"hidden";for(var r=e.cues,i=r.length-1;0<=i;i--){var o=r[i];o&&t(o)&&e.removeCue(o)}e.mode=n}function Ps(e,n,r,i,o){var a,s=o in i,u=!0;for(a in n){var c=o+"."+a,l=s?i[o]:r[a];s||a in r?void 0===n[a]?void 0===l||s?delete e[a]:e[a]=Fe(l):l.constructor==Object&&n[a]&&n[a].constructor==Object?(e[a]||(e[a]=Fe(l)),c=Ps(e[a],n[a],l,i,c),u=u&&c):t(n[a])!=t(l)||null==n[a]||"function"!=typeof n[a]&&n[a].constructor!=l.constructor?(Y.kc("Invalid config, wrong type for "+c),u=!1):("function"==typeof r[a]&&r[a].length!=n[a].length&&Y.ba("Unexpected number of arguments for "+c),e[a]=n[a]):(Y.kc("Invalid config, unrecognized key "+c),u=!1)}return u}function Rs(e,t){for(var n={},r=n,i=0,o=0;!(0>(i=e.indexOf(".",i)));)0!=i&&"\\"==e[i-1]||(r[o=e.substring(o,i).replace(/\\\./g,".")]={},r=r[o],o=i+1),i+=1;return r[e.substring(o).replace(/\\\./g,".")]=t,n}function Cs(){}function Ns(){var e=5e5,t=1/0;navigator.connection&&(navigator.connection.downlink&&(e=1e6*navigator.connection.downlink),navigator.connection.saveData&&(t=360));var n={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:Ot,fairPlayTransform:!0,updateExpirationTime:1},r={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,dash:{customScheme:function(e){if(e)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,defaultPresentationDelay:10,ignoreMinBufferTime:!1,autoCorrectDrift:!0,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1},hls:{ignoreTextStreamFailures:!1,useFullSegmentsForStartTime:!1}},i={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},failureCallback:function(e){return Y.error("Unhandled streaming error",e),[e]},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0};(bt("Web0S")||mt()||bt("CrKey"))&&(i.stallSkip=0);var o={trackSelectionCallback:function(e){return g((function t(){return U(t,(function(t){if(1===t.s)return t.return(e)}))}))},progressCallback:function(e,t){return[e,t]},usePersistentLicense:!0},a={drm:n,manifest:r,streaming:i,offline:o,abrFactory:Vn,abr:{enabled:!0,defaultBandwidthEstimate:e,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:t,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayFactory:function(){return null}};return o.trackSelectionCallback=function(e){return g((function t(){return U(t,(function(t){if(1===t.s)return t.return(function(e,t){var n=e.filter((function(e){return"variant"==e.type})),r=[],i=Kn(t,n.map((function(e){return e.language})));i&&(r=n.filter((function(e){return Un(e.language)==i}))),0==r.length&&(r=n.filter((function(e){return e.primary}))),0==r.length&&(1<new Set(n.map((function(e){return e.language}))).size&&Y.v("Could not choose a good audio track based on language preferences or primary tracks.  An arbitrary language will be stored!"),r=n);var o=r.filter((function(e){return e.height&&480>=e.height}));if(o.length&&(o.sort((function(e,t){return t.height-e.height})),r=o.filter((function(e){return e.height==o[0].height}))),n=[],r.length){var a=Math.floor(r.length/2);r.sort((function(e,t){return e.bandwidth-t.bandwidth})),n.push(r[a])}for(r=d(e),a=r.next();!a.done;a=r.next())"text"==(a=a.value).type&&n.push(a);return n}(e,a.preferredAudioLanguage))}))}))},a}function js(e,t,n){var r={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0),individualizationServer:""}};return Ps(e,t,n||Ns(),r,"")}function Ds(){this.g=null,this.h=[]}function Os(e,t){if(null==e.g)e.g={timestamp:Date.now()/1e3,state:t,duration:0};else{var n=Date.now()/1e3;e.g.duration=n-e.g.timestamp,e.g.state!=t&&(e.h.push(e.g),e.g={timestamp:n,state:t,duration:0})}}function Ls(e,t){var n=0;e.g&&e.g.state==t&&(n+=e.g.duration);for(var r=d(e.h),i=r.next();!i.done;i=r.next())n+=(i=i.value).state==t?i.duration:0;return n}function Us(){this.h=this.i=null,this.g=[]}function _s(){this.j=this.C=this.m=this.h=this.o=this.u=this.A=this.l=this.F=NaN,this.g=new Ds,this.i=new Us}function Ks(t,n){var r=this;Be.call(this),this.o=Mu,this.g=null,this.ub=!1,this.l=new tt,this.Uc=this.u=this.Tb=this.i=this.C=this.j=this.rc=this.L=this.ic=this.J=this.wb=this.A=this.M=this.m=this.X=null,this.re=1e9,this.lc=new Set,this.yb=!0,this.wa=null,this.qe=!1,this.oe=0,this.va=null,this.Z=new wo,this.h=Js(this),this.mc={width:1/0,height:1/0},this.F=null,this.tb=new Po(this.h.preferredAudioLanguage,this.h.preferredVariantRole,this.h.preferredAudioChannelCount),this.ua=this.h.preferredTextLanguage,this.Xa=this.h.preferredTextRole,this.Wc=[],n&&n(this),this.X=function(e){return new We((function(t,n){e.u&&e.u.segmentDownloaded(t,n)}))}(this),this.l.H(e,"online",(function(){r.Id()})),this.P={name:"detach"},this.da={name:"attach"},this.Qa={name:"unload"},this.nd={name:"manifest-parser"},this.md={name:"manifest"},this.vb={name:"media-source"},this.ad={name:"drm-engine"},this.ea={name:"load"},this.od={name:"src-equals-drm-engine"},this.xb={name:"src-equals"};var i=new Map;i.set(this.da,(function(e,t){return Le(function(e,t,n){return null==t.D&&(t.D=n.D,e.l.H(t.D,"error",(function(){var t=pu(e);t&&e.Va(t)}))),e.g=t.D,Promise.resolve()}(r,e,t))})),i.set(this.P,(function(e){return e.D&&(r.l.ta(e.D,"error"),e.D=null),r.g=null,Le(e=Promise.resolve())})),i.set(this.Qa,(function(e){return Le(Hs(r,e))})),i.set(this.vb,(function(t){return t=function(t,n){return g((function r(){var i,o,a,s;return U(r,(function(r){switch(r.s){case 1:return i=e.muxjs?new Gt:new Wt,o=t.h.textDisplayFactory,a=new o,t.fd=o,A(r,(s=new Tn(n.D,i,a)).C,2);case 2:t.M=s,k(r)}}))}))}(r,t),Le(t)})),i.set(this.nd,(function(e,t){var n=function(e,t,n){return g((function r(){var i,o,a,s;return U(r,(function(r){switch(r.s){case 1:if(t.Ia=n.Ia,t.mimeType=n.mimeType,t.uri=n.uri,i=t.uri,o=e.X,e.Tb=i,t.Ia){e.C=t.Ia(),r.I(2);break}return a=e,A(r,Si.create(i,o,e.h.manifest.retryParameters,t.mimeType),3);case 3:a.C=r.B;case 2:s=Fe(e.h.manifest),n.D&&"AUDIO"===n.D.nodeName&&(s.disableVideo=!0),e.C.configure(s),k(r)}}))}))}(r,e,t);return Le(n)})),i.set(this.md,(function(e){return function(e,t){var n=t.uri,r=e.X;e.rc=new aa((function(){return e.He()})),function(e,t){e.h=t}(e.rc,(function(t){du(e,"timelineregionadded",t)}));var i={networkingEngine:r,filterNewPeriod:function(t){return e.Xc(t)},filterAllPeriods:function(t){return Qs(e,t)},onTimelineRegionAdded:function(t){var n=e.rc;e:{for(var r=d(n.g),i=r.next();!i.done;i=r.next())if((i=i.value).schemeIdUri==t.schemeIdUri&&i.id==t.id&&i.startTime==t.startTime&&i.endTime==t.endTime){r=i;break e}r=null}null==r&&(n.g.add(t),n.h(t))},onEvent:function(t){return e.dispatchEvent(t)},onError:function(t){return e.Va(t)}};return new Ne(Promise.resolve().then((function(){return g((function t(){var r;return U(t,(function(t){switch(t.s){case 1:return r=e,A(t,e.C.start(n,i),2);case 2:if(r.i=t.B,e.dispatchEvent(new _e("manifestparsed")),0==e.i.periods.length)throw new $(2,4,4014);!function(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(",")}e.some((function(e){return e.variants.some(t)}))&&(Y.debug("Found variant with audio and video content, so filtering out audio-only content in all periods."),e.forEach((function(e){e.variants=e.variants.filter(t)})))}(e.i.periods),k(t)}}))}))})),(function(){return Y.info("Aborting parser step..."),e.C.stop()}))}(r,e)})),i.set(this.ad,(function(e){return e=function(e,t){return g((function n(){return U(n,(function(n){switch(n.s){case 1:return e.m=qs(e,{Ib:e.X,onError:function(t){e.Va(t)},Dc:function(t){gu(e,t)},onExpirationUpdated:function(t,n){mu(e,t,n)},onEvent:function(t){e.dispatchEvent(t)}}),e.m.configure(e.h.drm),A(n,xt(e.m,Fo(e.i.periods),e.i.offlineSessionIds),2);case 2:return A(n,e.m.Ub(t.D),3);case 3:Qs(e,e.i.periods),k(n)}}))}))}(r,e),Le(e)})),i.set(this.ea,(function(e,t){return Le(function(e,t,n){return g((function r(){var i,o,a,s,u,c,l,f,h,p;return U(r,(function(r){switch(r.s){case 1:return t.startTime=n.startTime,i=t.D,o=t.uri,e.Tb=o,e.J=new qo({wc:function(){return t.D.playbackRate},vc:function(){return t.D.defaultPlaybackRate},Od:function(e){t.D.playbackRate=e},pe:function(e){t.D.currentTime+=e}}),e.F=new _s,a=function(){return ru(e)},s=function(){return nu(e)},e.l.H(i,"playing",a),e.l.H(i,"pause",a),e.l.H(i,"ended",a),e.l.H(i,"ratechange",s),u=e.h.abrFactory,e.u&&e.Uc==u||(e.Uc=u,e.u=new u,e.u.configure(e.h.abr)),function(e,t){for(var n=0;n<t.length;n++){for(var r=t[n],i=new Map,o=d(r.variants),a=o.next();!a.done;a=o.next())if((a=a.value).video&&a.video.closedCaptions)for(var s=d((a=a.video).closedCaptions.keys()),u=s.next();!u.done;u=s.next())if(u=u.value,!i.has(u)){var c={id:e.re++,originalId:u,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,presentationTimeOffset:0,mimeType:"application/cea-608",codecs:"",kind:"caption",encrypted:!1,keyId:null,language:a.closedCaptions.get(u),label:null,type:"text",primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:a.roles,channelsCount:null,audioSamplingRate:null,closedCaptions:null};i.set(u,c)}for(o=(i=d(i.values())).next();!o.done;o=i.next())r.textStreams.push(o.value)}}(e,e.i.periods),e.tb=new Po(e.h.preferredAudioLanguage,e.h.preferredVariantRole,e.h.preferredAudioChannelCount),e.ua=e.h.preferredTextLanguage,e.Xa=e.h.preferredTextRole,function(e,t,n){0<t&&(e.aa()?Y.v("|playRangeStart| has been configured for live content. Ignoring the setting."):e.Le(t)),n<e.ha()&&(e.aa()?Y.v("|playRangeEnd| has been configured for live content. Ignoring the setting."):e.Fa(n))}(e.i.presentationTimeline,e.h.playRangeStart,e.h.playRangeEnd),e.u.init((function(t,n,r){n=void 0!==n&&n,r=void 0===r?0:r,Y.debug("switch_");e:{for(var i=d(e.i.periods),o=i.next();!o.done;o=i.next())if((o=o.value).variants.includes(t)){i=o;break e}i=null}Ys(e,i,t,!0),e.j&&va(e.j,t,n,r)&&su(e)})),e.A=function(e,t){return new na(e.g,e.i,e.h.streaming,t,(function(){e.wb&&Bo(e.wb,!0),e.j&&function(e){function t(t){var i=e.g.T;return t="text"==t?null!=(t=i.g).g&&null!=t.h&&n>=t.g&&n<t.h:Yt(t=Mn(i,t),n,r)}var n=e.g.eb(),r=e.l.smallGapLimit,i=!1,o=Ca(e,n);if(st(e.h.values(),(function(e){return e.oa==o})))for(var a=d(e.h.keys()),s=a.next();!s.done;s=a.next())t(s=s.value)||(ba(e,e.h.get(s)),i=!0);else st(e.h.keys(),t)||(Y.debug("(all): seeked: unbuffered seek: clearing all buffers"),e.h.forEach((function(t){ba(e,t)})),i=!0);i||Y.debug("(all): seeked: buffered seek: presentationTime="+n)}(e.j),e.L&&Gs(e)}),(function(t){return e.dispatchEvent(t)}))}(e,t.startTime),e.wb=function(e){var t=new Ho(e.i);!function(e,t){e.h=t}(t,(function(){uu(e)}));var n=new sa(e.rc);!function(e,t,n,r){e.g=t,e.h=n,e.i=r}(n,(function(t){du(e,"timelineregionenter",t)}),(function(t){du(e,"timelineregionexit",t)}),(function(t,n){n||(du(e,"timelineregionenter",t),du(e,"timelineregionexit",t))}));var r=new Ko(e.g);return r.g.add(t),r.g.add(n),r}(e),c=Math.max(e.i.minBufferTime,e.h.streaming.rebufferingGoal),zs(e,c),e.j=function(e){return new fa(e.i,{eb:function(){return e.A.l()},getBandwidthEstimate:function(){return e.u.getBandwidthEstimate()},T:e.M,Ib:e.X,ue:e.Vf.bind(e),te:e.Ze.bind(e),onError:e.Va.bind(e),onEvent:function(t){return e.dispatchEvent(t)},Zf:e.$f.bind(e),zd:e.eg.bind(e)})}(e),e.j.configure(e.h.streaming),Fn.$d(e.i,e.h.preferredAudioChannelCount),e.o=Pu,e.dispatchEvent(new _e("streaming")),A(r,e.j.start(),2);case 2:e.h.streaming.startAtSegmentBoundary&&(l=e.A.l(),f=function(e,t){function n(e,t){if(!e)return null;var n=e.findSegmentPosition(t-o.startTime);return null==n?null:(n=e.getSegmentReference(n))?n.startTime+o.startTime:null}var r=ha(e.j),i=da(e.j),o=Su(e);return r=n(r,t),null!=(i=n(i,t))&&null!=r?Math.max(i,r):null!=i?i:null!=r?r:t}(e,l),e.A.A(f)),e.i.periods.forEach(e.Xc.bind(e)),uu(e),su(e),h=Su(e)||e.i.periods[0],p=h.variants.some((function(e){return e.primary})),e.h.preferredAudioLanguage||p||Y.v("No preferred audio language set.  We will choose an arbitrary language initially"),iu(e,h.variants),e.l.ya(i,"loadedmetadata",(function(){e.F.h=Date.now()/1e3-n.Rd})),k(r)}}))}))}(r,e,t))})),i.set(this.od,(function(e,t){var n=function(e,t,n){return g((function r(){var i,o;return U(r,(function(r){switch(r.s){case 1:return i=pe,e.m=qs(e,{Ib:e.X,onError:function(t){e.Va(t)},Dc:function(t){gu(e,t)},onExpirationUpdated:function(t,n){mu(e,t,n)},onEvent:function(t){e.dispatchEvent(t)}}),e.m.configure(e.h.drm),o={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,presentationTimeOffset:0,mimeType:n.mimeType?n.mimeType.split(";")[0]:"video/mp4",codecs:n.mimeType?ft(n.mimeType):"",encrypted:!0,keyId:null,language:"und",label:null,type:i.Za,primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0},A(r,xt(e.m,[o],[]),2);case 2:return A(r,e.m.Ub(t.D),0)}}))}))}(r,e,t);return Le(n)})),i.set(this.xb,(function(e,t){return function(e,t,n){function r(){return ru(e)}if(t.uri=n.uri,t.startTime=n.startTime,e.Tb=t.uri,e.F=new _s,e.A=new ta(t.D),null!=t.startTime&&e.A.A(t.startTime),e.J=new qo({wc:function(){return t.D.playbackRate},vc:function(){return t.D.defaultPlaybackRate},Od:function(e){t.D.playbackRate=e},pe:function(e){t.D.currentTime+=e}}),zs(e,e.h.streaming.rebufferingGoal),e.l.H(t.D,"playing",r),e.l.H(t.D,"pause",r),e.l.H(t.D,"ended",r),e.l.H(t.D,"ratechange",(function(){return nu(e)})),"none"!=e.g.preload&&e.l.ya(t.D,"loadedmetadata",(function(){e.F.h=Date.now()/1e3-n.Rd})),e.g.audioTracks&&(e.l.H(e.g.audioTracks,"addtrack",(function(){return uu(e)})),e.l.H(e.g.audioTracks,"removetrack",(function(){return uu(e)})),e.l.H(e.g.audioTracks,"change",(function(){return uu(e)}))),e.g.textTracks){var i=e.g.textTracks;e.l.H(i,"addtrack",(function(){return uu(e)})),e.l.H(i,"removetrack",(function(){return uu(e)})),e.l.H(i,"change",(function(){return uu(e)}))}t.D.src=t.uri,(mt()||bt("Web0S"))&&t.D.load(),e.o=Ru,e.dispatchEvent(new _e("streaming"));var o=new me;Go(e.g,HTMLMediaElement.HAVE_METADATA,e.l,(function(){o.resolve()}));var a=!1;return e.Wc.push((function(){a=!0})),Go(e.g,HTMLMediaElement.HAVE_CURRENT_DATA,e.l,(function(){return g((function t(){return U(t,(function(t){switch(t.s){case 1:if(a)return t.return();if(function(e){var t=e.h.preferredAudioLanguage;if(""!=t){e.Jd(t);var n=e.h.preferredVariantRole;""!=n&&e.Jd(t,n)}}(e),Xs(e).find((function(e){return"disabled"!=e.mode}))){t.I(2);break}return A(t,new Promise((function(t){e.l.ya(e.g.textTracks,"change",t),new Pe(t).V(1)})),2);case 2:if(a)return t.return();!function(e){var t=e.h.preferredTextLanguage;if(""!=t){e.Kd(t);var n=e.h.preferredTextRole;""!=n&&e.Kd(t,n)}}(e),k(t)}}))}))})),e.g.error?o.reject(pu(e)):"none"==e.g.preload&&(Y.ba('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),o.resolve()),e.l.ya(e.g,"error",(function(){o.reject(pu(e))})),new Ne(o,(function(){return o.reject(new $(2,7,7001)),Promise.resolve()}))}(r,e,t)})),this.Ya=new Es(this.P,{Af:function(e,t,n,i){var o=null;return e==r.P&&(o=n==r.P?r.P:r.da),e==r.da&&(o=n==r.P||t.D!=i.D?r.P:n==r.da?r.da:n==r.vb||n==r.ea?r.vb:n==r.xb?r.od:null),e==r.vb&&(o=n==r.ea&&t.D==i.D?r.nd:r.Qa),e==r.nd&&(o=Au(r.ea,r.md,r.Qa,n,t,i)),e==r.md&&(o=Au(r.ea,r.ad,r.Qa,n,t,i)),e==r.ad&&(o=Au(r.ea,r.ea,r.Qa,n,t,i)),e==r.od&&(o=n==r.xb&&t.D==i.D?r.xb:r.Qa),e!=r.ea&&e!=r.xb||(o=r.Qa),e==r.Qa&&(o=i.D&&t.D==i.D?r.da:r.P),o},ef:function(e,t,n){return r.dispatchEvent(new _e("onstatechange",{state:e.name})),i.get(e)(t,n)},handleError:function(e,t){return g((function n(){return U(n,(function(n){switch(n.s){case 1:return Y.v("The walker saw an error:"),t instanceof $?Y.v("Error Code:",t.code):(Y.v("Error Message:",t.message),Y.v("Error Stack:",t.stack)),A(n,Hs(r,e),2);case 2:return n.return(e.D?r.da:r.P)}}))}))},Xf:function(e){r.dispatchEvent(new _e("onstateidle",{state:e.name}))}}),t&&this.Ub(t,!0)}T(as,Ja),as.prototype.updateManifestExpiration=function(e,t){var n=Ya(this.h,this.g),r=n.store(),i=new me;return r.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,r.put(n),i.resolve()):i.reject(new $(2,9,9012,"Could not find values for "+e))},n.promise().then((function(){return i}))},as.prototype.pc=function(e){return{originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:null==e.expiration?1/0:e.expiration,periods:e.periods.map(ss),sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata}},as.prototype.ae=function(e){return{data:e.data}},T(fs,Ja),fs.prototype.hasFixedKeySpace=function(){return this.j},fs.prototype.addSegments=function(e){return this.j?Qa(this.i):this.add(this.i,e)},fs.prototype.addManifests=function(e){return this.j?Qa(this.g):this.add(this.g,e)},fs.prototype.pc=function(e){return null==e.expiration&&(e.expiration=1/0),e},(i=hs.prototype).init=function(){var t=this,n=new me,r=e.indexedDB.open("shaka_offline_db",4);return r.onsuccess=function(e){e=e.target.result,t.j=e;var r=e.objectStoreNames;r.contains("manifest")&&r.contains("segment")?(Y.debug("Mounting v1 idb storage cell"),r=new as(e,"segment","manifest")):r=null,t.g=r,(r=e.objectStoreNames).contains("manifest-v2")&&r.contains("segment-v2")?(Y.debug("Mounting v2 idb storage cell"),r=new fs(e,"segment-v2","manifest-v2",!0)):r=null,t.h=r,(r=e.objectStoreNames).contains("manifest-v3")&&r.contains("segment-v3")?(Y.debug("Mounting v3 idb storage cell"),r=new fs(e,"segment-v3","manifest-v3",!1)):r=null,t.i=r,e.objectStoreNames.contains("session-ids")?(Y.debug("Mounting session ID idb storage cell"),e=new ts(e)):e=null,t.l=e,n.resolve()},r.onupgradeneeded=function(e){e=e.target.result;for(var t=d(["segment-v3","manifest-v3","session-ids"]),n=t.next();!n.done;n=t.next())n=n.value,e.objectStoreNames.contains(n)||e.createObjectStore(n,{autoIncrement:!0})},r.onerror=function(e){n.reject(new $(2,9,9001,r.error)),e.preventDefault()},n},i.destroy=function(){var e=this;return g((function t(){return U(t,(function(t){switch(t.s){case 1:if(!e.g){t.I(2);break}return A(t,e.g.destroy(),2);case 2:if(!e.h){t.I(4);break}return A(t,e.h.destroy(),4);case 4:if(!e.i){t.I(6);break}return A(t,e.i.destroy(),6);case 6:if(!e.l){t.I(8);break}return A(t,e.l.destroy(),8);case 8:e.j&&e.j.close(),k(t)}}))}))},i.getCells=function(){var e=new Map;return this.g&&e.set("v1",this.g),this.h&&e.set("v2",this.h),this.i&&e.set("v3",this.i),e},i.getEmeSessionCell=function(){return this.l},i.erase=function(){var t=this;return g((function n(){return U(n,(function(n){switch(n.s){case 1:if(!t.g){n.I(2);break}return A(n,t.g.destroy(),2);case 2:if(!t.h){n.I(4);break}return A(n,t.h.destroy(),4);case 4:if(!t.i){n.I(6);break}return A(n,t.i.destroy(),6);case 6:return t.j&&t.j.close(),A(n,function(){var t=new me,n=e.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){Y.v("Deleting","shaka_offline_db","is being blocked")},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new $(2,9,9001,n.error)),e.preventDefault()},t}(),8);case 8:return t.j=null,t.g=null,t.h=null,t.i=null,A(n,t.init(),0)}}))}))},is("idb",(function(){return bt("CrKey")||!e.indexedDB?null:new hs})),ds.prototype.Ea=function(){return this.l},ds.prototype.ja=function(){return this.j},ds.prototype.key=function(){return this.i},ds.prototype.toString=function(){return this.h},(i=bs.prototype).configure=function(){},i.start=function(e){var t=this;return g((function n(){var r,i,o,a,s;return U(n,(function(n){switch(n.s){case 1:return r=ps(e),t.g=r,null==r||"manifest"!=r.g?n.return(Promise.reject(new $(2,1,9004,r))):(i=new ns,M(n,2),A(n,i.init(),4));case 4:return A(n,rs(i,r.Ea(),r.ja()),5);case 5:return A(n,n.B.getManifests([r.key()]),6);case 6:return o=n.B,a=o[0],s=new gs(r.Ea(),r.ja()),n.return(function(e,t){var n=new Ei(null,0);n.Fa(t.duration);var r=t.periods.map((function(t){return ms(e,t,n)})),i=t.drmInfo?[t.drmInfo]:[];return t.drmInfo&&r.forEach((function(e){e.variants.forEach((function(e){e.drmInfos=i}))})),{presentationTimeline:n,minBufferTime:2,offlineSessionIds:t.sessionIds,periods:r}}(s,a));case 2:return C(n),A(n,i.destroy(),7);case 7:N(n,0)}}))}))},i.stop=function(){return Promise.resolve()},i.update=function(){},i.onExpirationUpdated=function(e,t){var n=this;return g((function r(){var i,o,a,s,u,c,l,f;return U(r,(function(r){switch(r.s){case 1:return i=n.g,o=new ns,I(r,2,3),A(r,o.init(),5);case 5:return A(r,rs(o,i.Ea(),i.ja()),6);case 6:return A(r,(a=r.B).getManifests([i.key()]),7);case 7:if(s=r.B,u=s[0],c=u.sessionIds.includes(e),l=null==u.expiration||u.expiration>t,!c||!l){r.I(3);break}return Y.debug("Updating expiration for stored content"),A(r,a.updateManifestExpiration(i.key(),t),3);case 3:return C(r),A(r,o.destroy(),10);case 10:N(r,0);break;case 2:f=R(r),Y.error("There was an error updating",i,f),r.I(3)}}))}))},Si.Qb("application/x-offline-manifest",bs),H("shaka.offline.OfflineScheme",ws),ws.m=function(e){return Oe(e={uri:e,Bd:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}})},ws.o=function(e,t){var n=new ns;return Oe(void 0).ca((function(){return n.init()})).ca((function(){return rs(n,t.Ea(),t.ja())})).ca((function(e){return e.getSegments([t.key()])})).ca((function(e){return{uri:t,Bd:t,data:e[0].data,headers:{}}})).finally((function(){return n.destroy()}))},Ye("offline",ws),Es.prototype.destroy=function(){var e=this;return g((function t(){return U(t,(function(t){switch(t.s){case 1:return e.u=!1,e.h&&e.h.abort(),As(e),A(t,e.A,2);case 2:e.g&&e.g.Da.kb();for(var n=d(e.l),r=n.next();!r.done;r=n.next())r.value.Da.kb();e.g=null,e.l=[],e.m=null,k(t)}}))}))},H("shaka.text.SimpleTextDisplayer",ks),ks.prototype.remove=function(e,t){return!!this.g&&(Ms(this.g,(function(n){return n.startTime<t&&n.endTime>e})),!0)},ks.prototype.remove=ks.prototype.remove,ks.prototype.append=function(e){var t=Is,n=e.map((function(e){if(e.nestedCues.length){var t=e.nestedCues.map((function(e){return e.spacer?"\n":e.payload+" "})).join("").replace(/ $/m,"");(e=e.clone()).nestedCues=[],e.payload=t}return e})),r=[];e=this.g.cues?Array.from(this.g.cues):[];for(var i={},o=(n=d(n)).next();!o.done;i={Fb:i.Fb},o=n.next())i.Fb=o.value,e.some(function(e){return function(t){return t.startTime==e.Fb.startTime&&t.endTime==e.Fb.endTime&&t.text==e.Fb.payload}}(i))||(o=t(i.Fb))&&r.push(o);r.slice().sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime!=t.endTime?e.endTime-t.startTime:"line"in VTTCue.prototype?r.indexOf(t)-r.indexOf(e):r.indexOf(e)-r.indexOf(t)})).forEach(function(e){this.g.addCue(e)}.bind(this))},ks.prototype.append=ks.prototype.append,ks.prototype.destroy=function(){return this.g&&Ms(this.g,(function(){return!0})),this.g=null,Promise.resolve()},ks.prototype.destroy=ks.prototype.destroy,ks.prototype.isTextVisible=function(){return"showing"==this.g.mode},ks.prototype.isTextVisible=ks.prototype.isTextVisible,ks.prototype.setTextVisibility=function(e){this.g.mode=e?"showing":"hidden"},ks.prototype.setTextVisibility=ks.prototype.setTextVisibility,H("shaka.util.ConfigUtils.mergeConfigObjects",Ps),H("shaka.util.ConfigUtils.convertToConfigObject",Rs),H("shaka.util.PlayerConfiguration",Cs),Cs.mergeConfigObjects=js,q(Ks,Be),H("shaka.Player",Ks),Ks.prototype.destroy=function(){var e=this;return g((function t(){var n;return U(t,(function(t){switch(t.s){case 1:return e.o==Iu?t.return():(e.o=Iu,n=xs(e.Ya,(function(){return{node:e.P,payload:{Ia:null,D:null,mimeType:null,startTime:null,Rd:null,uri:null},gb:!1}})),A(t,new Promise((function(t){n.Kb=function(){Y.info("Preparing to destroy walker...")},n.Cc=function(){t(),e.dispatchEvent(new _e("loaded"))},n.kb=function(){t()},n.onError=function(){t()},n.Ec=function(){t()}})),2));case 2:return A(t,e.Ya.destroy(),3);case 3:if(e.l&&(e.l.release(),e.l=null),e.Uc=null,e.u=null,e.h=null,!e.X){t.I(0);break}return A(t,e.X.destroy(),5);case 5:e.X=null,k(t)}}))}))},Ks.prototype.destroy=Ks.prototype.destroy,Ks.version="v2.5.23";var Bs=["2","5"];Xn=new function(e){this.g=e,this.i=Gn,this.h=Wn}(new qn(Number(Bs[0]),Number(Bs[1])));var Fs=["output-restricted","internal-error"],Vs={};function Hs(e,t){return g((function n(){var r;return U(n,(function(n){switch(n.s){case 1:return e.o!=Iu&&(e.o=Mu),r=e.Wc.map((function(e){return e()})),e.Wc=[],A(n,Promise.all(r),2);case 2:if(e.dispatchEvent(new _e("unloading")),t.Ia=null,t.mimeType=null,t.startTime=null,t.uri=null,t.D&&(e.l.ta(t.D,"loadedmetadata"),e.l.ta(t.D,"playing"),e.l.ta(t.D,"pause"),e.l.ta(t.D,"ended"),e.l.ta(t.D,"ratechange")),e.wb&&(e.wb.release(),e.wb=null),e.ic&&(e.ic.stop(),e.ic=null),!e.C){n.I(3);break}return A(n,e.C.stop(),4);case 4:e.C=null;case 3:if(!e.u){n.I(5);break}return A(n,e.u.stop(),5);case 5:if(!e.j){n.I(7);break}return A(n,e.j.destroy(),8);case 8:e.j=null;case 7:if(e.J&&(e.J.release(),e.J=null),e.A&&(e.A.release(),e.A=null),!e.M){n.I(9);break}return A(n,e.M.destroy(),10);case 10:e.M=null;case 9:if(!t.D||!t.D.src){n.I(11);break}return A(n,new Promise((function(e){return new Pe(e).V(.1)})),12);case 12:t.D.removeAttribute("src"),t.D.load();case 11:if(!e.m){n.I(13);break}return A(n,e.m.destroy(),14);case 14:e.m=null;case 13:e.Z.g.clear(),e.Tb=null,e.L=null,e.lc.clear(),e.i=null,e.F=null,e.fd=null,e.yb=!0,tu(e),k(n)}}))}))}function qs(e,t){return new Et(t,e.h.drm.updateExpirationTime)}function zs(e,t){e.L=new Ro,e.L.g=No,Co(e.L,t,Math.min(.5,t/2)),tu(e),e.ic=new Pe((function(){Gs(e)})).Oa(.25)}function Gs(e){switch(e.o){case Ru:var t=!!e.g.ended||Xt(e.g.buffered)>=e.g.duration-1;break;case Pu:e:if(e.g.ended||An(e.M))t=!0;else{if(e.i.presentationTimeline.aa()){var n=e.i.presentationTimeline.Db();if(Xt(e.g.buffered)>=n){t=!0;break e}}t=!1}break;default:t=!1}var r=$t(e.g.buffered,e.g.currentTime),i=t,o=(n=e.L).h.get(n.g);t=n.g,r=i||r>=o?jo:No,n.g=r,t!=r&&tu(e)}function Ws(e){if(e.C){var t=Fe(e.h.manifest);e.g&&"AUDIO"===e.g.nodeName&&(t.disableVideo=!0),e.C.configure(t)}if(e.m&&e.m.configure(e.h.drm),e.j){e.j.configure(e.h.streaming);try{e.i.periods.forEach(e.Xc.bind(e))}catch(o){e.Va(o)}var n=ha(e.j),r=da(e.j);t=Su(e),n=Fn.ie(n,r,t.variants),e.u&&n&&n.allowedByApplication&&n.allowedByKeySystem?iu(e,t.variants):(Y.debug("Choosing new streams after changing configuration"),ou(e,t))}if(e.M&&(t=e.h.textDisplayFactory,e.fd!=t)){n=new t;var i=(r=e.M).l;r.l=n,i&&(n.setTextVisibility(i.isTextVisible()),i.destroy()),r.g&&(r.g.i=n),e.fd=t,e.j&&(n=(t=e.j).h.get("text"))&&ya(t,n.stream,!0,0,!0)}e.u&&(e.u.configure(e.h.abr),e.h.abr.enabled&&!e.yb?e.u.enable():e.u.disable(),hu(e)),e.L&&(t=e.h.streaming.rebufferingGoal,e.i&&(t=Math.max(t,e.i.minBufferTime)),Co(e.L,t,Math.min(.5,t/2)))}function Xs(e){return Array.from(e.g.textTracks).filter((function(e){return"metadata"!=e.kind&&"chapters"!=e.kind&&"Shaka Player TextTrack"!=e.label}))}function Ys(e,t,n,r){So(e.Z,t).variant=n,(e=e.F.i).i!=n&&(e.i=n,e.g.push({timestamp:Date.now()/1e3,id:n.id,type:"variant",fromAdaptation:r,bandwidth:n.bandwidth}))}function $s(e,t,n,r){To(e.Z,t,n),(e=e.F.i).h!=n&&(e.h=n,e.g.push({timestamp:Date.now()/1e3,id:n.id,type:"text",fromAdaptation:r,bandwidth:null}))}function Js(e){var t=Ns();return t.streaming.failureCallback=function(t){e.aa()&&[1001,1002,1003].includes(t.code)&&(t.severity=1,Y.v("Live streaming error.  Retrying automatically..."),e.Id())},t.textDisplayFactory=function(){return new ks(e.g)},t}function Qs(e,t){var n=e.j?ha(e.j):null,r=e.j?da(e.j):null;if(t.forEach(Fn.filterNewPeriod.bind(null,e.m,n,r)),n=function(e,t){var n=0;return e.forEach((function(e){n+=t(e)?1:0})),n}(t,(function(e){return e.variants.some(Fn.Gb)})),0==n)throw new $(2,4,4032);if(n<t.length)throw new $(2,4,4011);t.forEach(function(e){Fn.Xd(e.variants,this.h.restrictions,this.mc)&&this.j&&Su(this)==e&&uu(this),vu(this,e.variants)}.bind(e))}function Zs(e,t,n,r){return n=void 0!==n&&n,r=void 0===r?0:r,e.yb?(e.wa=t,e.qe=n,e.oe=r,!0):((t=va(e.j,t,n,r))&&cu(e),t)}function eu(e,t){if(e.yb)return e.va=t,!0;var n=ya(e.j,t,!0,0,!1);return n&&lu(e),n}function tu(e){var t=e.jd();if(e.F&&e.L&&e.A){var n=e.J;n.j=t,zo(n),ru(e)}e.dispatchEvent(new _e("buffering",{buffering:t}))}function nu(e){var t=e.g.playbackRate;0!=t&&e.J.set(t)}function ru(e){if(e.F&&e.L){var t=e.F.g;e.L.g==No?Os(t,"buffering"):e.g.paused?Os(t,"paused"):e.g.ended?Os(t,"ended"):Os(t,"playing")}}function iu(e,t){try{vu(e,t)}catch(r){return e.Va(r),null}var n=t.filter((function(e){return Fn.Gb(e)}));return n=e.tb.create(n),e.u.setVariants(Array.from(n.values())),e.u.chooseVariant()}function ou(e,t){var n=au(e,t,!1),r=Fn.Wb(t.textStreams,e.ua,e.Xa)[0]||null,i=!1;r&&(e.h.streaming.alwaysStreamText||e.zc())&&($s(e,t,r,!0),i=eu(e,r)),(n||i)&&su(e)}function au(e,t,n){n=void 0===n||n;var r=iu(e,t.variants),i=!1;return r&&(Ys(e,t,r,!0),i=Zs(e,r,!0)),n&&i&&su(e),i}function su(e){yu(e,new _e("adaptation"))}function uu(e){yu(e,new _e("trackschanged"))}function cu(e){yu(e,new _e("variantchanged"))}function lu(e){yu(e,new _e("textchanged"))}function fu(e){yu(e,new _e("texttrackvisibility"))}function hu(e){yu(e,new _e("abrstatuschanged",{Zg:e.h.abr.enabled}))}function du(e,t,n){e.dispatchEvent(new _e(t,{detail:{schemeIdUri:n.schemeIdUri,value:n.value,startTime:n.startTime,endTime:n.endTime,id:n.id,eventElement:n.eventElement}}))}function pu(e){if(!e.g.error)return null;var t=e.g.error.code;if(1==t)return null;var n=e.g.error.msExtendedCode;return n&&(0>n&&(n+=Math.pow(2,32)),n=n.toString(16)),new $(2,3,3016,t,n,e.g.error.message)}function gu(e,t){if(e.j){var n=Su(e),r=!1,i=Object.keys(t);0==i.length&&Y.v("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var o=1==i.length&&"00"==i[0];o&&Y.v("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks."),i.length&&e.i.periods.forEach((function(e){e.variants.forEach((function(e){Fn.Kf(e).forEach((function(n){var i=e.allowedByKeySystem;n.keyId&&(n=t[o?"00":n.keyId],e.allowedByKeySystem=!!n&&!Fs.includes(n)),i!=e.allowedByKeySystem&&(r=!0)}))}))})),i=ha(e.j);var a=da(e.j);(i=Fn.ie(i,a,n.variants))&&!i.allowedByKeySystem&&(Y.debug("Choosing new variants after key status changed"),au(e,n)),r&&(uu(e),iu(e,n.variants))}}function mu(e,t,n){e.C&&e.C.onExpirationUpdated&&e.C.onExpirationUpdated(t,n),e.dispatchEvent(new _e("expirationupdated"))}function vu(e,t){var n=e.m?ct(e.m.da):{},r=Object.keys(n);r=r.length&&"00"==r[0];for(var i=!1,o=!1,a=[],s=[],u=d(t),c=u.next();!c.done;c=u.next()){var l=[];(c=c.value).audio&&l.push(c.audio),c.video&&l.push(c.video);for(var f=(l=d(l)).next();!f.done;f=l.next())if((f=f.value).keyId){var h=n[r?"00":f.keyId];h?Fs.includes(h)&&(s.includes(h)||s.push(h)):a.includes(f.keyId)||a.push(f.keyId)}c.allowedByApplication?c.allowedByKeySystem&&(i=!0):o=!0}if(!i)throw new $(2,4,4012,{hasAppRestrictions:o,missingKeys:a,restrictedKeyStatuses:s})}function yu(e,t){g((function n(){return U(n,(function(n){switch(n.s){case 1:return A(n,Promise.resolve(),2);case 2:e.o!=Iu&&e.dispatchEvent(t),k(n)}}))}))}function bu(e){for(var t=new Set,n=(e=d(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(Un(n.language)):t.add("und");return t}function wu(e){for(var t=new Map,n=(e=d(e)).next();!n.done;n=e.next()){var r=n.value;n="und";var i=[];for(r.language&&(n=Un(r.language)),(i="variant"==r.type?r.audioRoles:r.roles)&&i.length||(i=[""]),t.has(n)||t.set(n,new Set),i=(r=d(i)).next();!i.done;i=r.next())i=i.value,t.get(n).add(i)}var o=[];return t.forEach((function(e,t){for(var n=d(e),r=n.next();!r.done;r=n.next())o.push({language:t,role:r.value})})),o}function Tu(e){return null==(e=Su(e))?[]:e.variants.filter((function(e){return Fn.Gb(e)}))}function Su(e){for(var t=e.A.l(),n=null,r=(e=d(e.i.periods)).next();!r.done;r=e.next())(r=r.value).startTime<=t&&(n=r);return n}function Eu(e){var t=Su(e);return So(e.Z,t).variant}function xu(){return new $(2,7,7e3)}function Au(e,t,n,r,i,o){return r==e&&i.D==o.D&&i.uri==o.uri&&i.mimeType==o.mimeType&&i.Ia==o.Ia?t:n}function ku(e){return new Promise((function(t,n){e.kb=function(){return n(xu())},e.Cc=function(){return t()},e.onError=function(e){return n(e)},e.Ec=function(){return n(xu())}}))}Ks.registerSupportPlugin=function(e,t){Vs[e]=t},Ks.isBrowserSupported=function(){if(!(e.Promise&&e.Uint8Array&&Array.prototype.forEach))return!1;var t=yt();return!(t&&12>t||!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration))&&(!!pt()||gt("application/x-mpegurl"))},Ks.probeSupport=function(){return Ut().then((function(e){for(var t=Si.ng(),n={},r=d('video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",")),i=r.next();!i.done;i=r.next()){n[i=i.value]=pt()?!!yn(i)||MediaSource.isTypeSupported(i)||ke(i):gt(i);var o=i.split(";")[0];n[o]=n[o]||n[i]}for(var a in e={manifest:t,media:n,drm:e},Vs)e[a]=Vs[a]();return e}))},Ks.prototype.Ub=function(e,t){if(t=void 0===t||t,this.o==Iu)return Promise.reject(xu());var n={Ia:null,D:null,mimeType:null,startTime:null,Rd:null,uri:null};n.D=e,pt()||(t=!1);var r=t?this.vb:this.da,i=xs(this.Ya,(function(){return{node:r,payload:n,gb:!1}}));return i.Kb=function(){return Y.info("Starting attach...")},ku(i)},Ks.prototype.attach=Ks.prototype.Ub,Ks.prototype.detach=function(){var e=this;if(this.o==Iu)return Promise.reject(xu());var t=xs(this.Ya,(function(){return{node:e.P,payload:{Ia:null,D:null,mimeType:null,startTime:null,Rd:null,uri:null},gb:!1}}));return t.Kb=function(){return Y.info("Starting detach...")},ku(t)},Ks.prototype.detach=Ks.prototype.detach,Ks.prototype.Ud=function(e){var t=this;if(e=void 0===e||e,this.o==Iu)return Promise.reject(xu());pt()||(e=!1);var n={Ia:null,D:null,mimeType:null,startTime:null,Rd:null,uri:null},r=xs(this.Ya,(function(r){var i=r.D&&e?t.vb:r.D?t.da:t.P;return n.D=r.D,{node:i,payload:n,gb:!1}}));return r.Kb=function(){return Y.info("Starting unload...")},ku(r)},Ks.prototype.unload=Ks.prototype.Ud,Ks.prototype.load=function(e,t,n){if(this.o==Iu)return Promise.reject(xu());this.dispatchEvent(new _e("loading"));var r={Ia:null,D:null,mimeType:null,startTime:null,Rd:null,uri:null};r.uri=e,r.Rd=Date.now()/1e3,n&&"string"!=typeof n&&(zn("Loading with a manifest parser factory","Please register a manifest parser and for the mime-type."),r.Ia=function(){return new n}),n&&"string"==typeof n&&(r.mimeType=n),void 0!==t&&(r.startTime=t);var i=function(e,t){if(t.Ia)return!1;if(!pt())return!0;var n=t.mimeType,r=t.uri||"";return n||(n={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"}[Si.getExtension(r)]),!!n&&""!=(t.D||wt()).canPlayType(n)&&(!Si.isSupported(r,n)||vt()&&e.h.streaming.useNativeHlsOnSafari)}(this,r)?this.xb:this.ea,o=xs(this.Ya,(function(e){return null==e.D?null:(r.D=e.D,{node:i,payload:r,gb:!0})}));return o.Kb=function(){return Y.info("Starting load of "+e+"...")},new Promise((function(e,t){o.Ec=function(){return t(new $(2,7,7002))},o.Cc=function(){return e()},o.kb=function(){return t(xu())},o.onError=function(e){return t(e)}}))},Ks.prototype.load=Ks.prototype.load,Ks.prototype.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=Rs(e,t));var n=js(this.h,e,Js(this));return Ws(this),n},Ks.prototype.configure=Ks.prototype.configure,Ks.prototype.getConfiguration=function(){var e=Js(this);return js(e,this.h,Js(this)),e},Ks.prototype.getConfiguration=Ks.prototype.getConfiguration,Ks.prototype.vg=function(){for(var e in this.h)delete this.h[e];js(this.h,Js(this),Js(this)),Ws(this)},Ks.prototype.resetConfiguration=Ks.prototype.vg,Ks.prototype.tf=function(){return this.o},Ks.prototype.getLoadMode=Ks.prototype.tf,Ks.prototype.yf=function(){return this.g},Ks.prototype.getMediaElement=Ks.prototype.yf,Ks.prototype.Yb=function(){return this.X},Ks.prototype.getNetworkingEngine=Ks.prototype.Yb,Ks.prototype.tc=function(){return this.Tb},Ks.prototype.getAssetUri=Ks.prototype.tc,Ks.prototype.wf=function(){return zn("getManifestUri",'Please use "getAssetUri" instead.'),this.tc()},Ks.prototype.getManifestUri=Ks.prototype.wf,Ks.prototype.aa=function(){return this.i?this.i.presentationTimeline.aa():!(!this.g||!this.g.src)&&1/0==this.g.duration},Ks.prototype.isLive=Ks.prototype.aa,Ks.prototype.ib=function(){return!!this.i&&this.i.presentationTimeline.ib()},Ks.prototype.isInProgress=Ks.prototype.ib,Ks.prototype.Qf=function(){if(this.i){if(!this.i.periods.length)return!1;var e=this.i.periods[0].variants;return!!e.length&&!e[0].video}return!(!this.g||!this.g.src)&&(this.g.videoTracks?0==this.g.videoTracks.length:0==this.g.videoHeight)},Ks.prototype.isAudioOnly=Ks.prototype.Qf,Ks.prototype.He=function(){if(this.i){var e=this.i.presentationTimeline;return{start:e.Cb(),end:e.Ka()}}return this.g&&this.g.src&&(e=this.g.seekable).length?{start:e.start(0),end:e.end(e.length-1)}:{start:0,end:0}},Ks.prototype.seekRange=Ks.prototype.He,Ks.prototype.keySystem=function(){return Pt(this.drmInfo())},Ks.prototype.keySystem=Ks.prototype.keySystem,Ks.prototype.drmInfo=function(){return this.m?this.m.g:null},Ks.prototype.drmInfo=Ks.prototype.drmInfo,Ks.prototype.Xb=function(){return this.m?this.m.Xb():1/0},Ks.prototype.getExpiration=Ks.prototype.Xb,Ks.prototype.jd=function(){return!!this.L&&this.L.g==No},Ks.prototype.isBuffering=Ks.prototype.jd,Ks.prototype.Cf=function(){if(this.J){var e=this.J;e=e.j?0:e.i}else e=0;return e},Ks.prototype.getPlaybackRate=Ks.prototype.Cf,Ks.prototype.Mg=function(e){0==e?Y.ba("A trick play rate of 0 is unsupported!"):(this.g.paused&&this.g.play(),this.J&&this.J.set(e),this.o==Pu&&ma(this.j,1<Math.abs(e)))},Ks.prototype.trickPlay=Ks.prototype.Mg,Ks.prototype.$e=function(){var e=this.J.vc();this.o==Ru&&this.J.set(e),this.o==Pu&&(this.J.set(e),ma(this.j,!1))},Ks.prototype.cancelTrickPlay=Ks.prototype.$e,Ks.prototype.ed=function(){if(this.i&&this.A){for(var e=Eu(this),t=[],n=d(Tu(this)),r=n.next();!r.done;r=n.next()){r=r.value;var i=Fn.Oc(r);i.active=r==e,t.push(i)}return t}return this.g&&this.g.audioTracks?Array.from(this.g.audioTracks).map((function(e){return Fn.je(e)})):[]},Ks.prototype.getVariantTracks=Ks.prototype.ed,Ks.prototype.Eb=function(){if(this.i&&this.A){for(var e=function(e){var t=Su(e);if(null==t)return null;if(!So(e.Z,t).text){var n=Fn.Wb(t.textStreams,e.ua,e.Xa);n.length&&To(e.Z,t,n[0])}return So(e.Z,t).text}(this),t=[],n=d(function(e){var t=Su(e);return null==t?[]:t.textStreams.filter((function(t){return!e.lc.has(t)}))}(this)),r=n.next();!r.done;r=n.next()){r=r.value;var i=Fn.Kc(r);i.active=r==e,t.push(i)}return t}return this.g&&this.g.src&&this.g.textTracks?Xs(this).map((function(e){return Fn.Of(e)})):[]},Ks.prototype.getTextTracks=Ks.prototype.Eb,Ks.prototype.Ld=function(e){if(this.i&&this.j){var t=Su(this),n=t.textStreams.find((function(t){return t.id==e.id}));n?($s(this,t,n,!1),eu(this,n),this.ua=n.language):Y.error("No stream with id",e.id)}else if(this.g&&this.g.src&&this.g.textTracks){for(n=(t=d(t=Xs(this))).next();!n.done;n=t.next())n=n.value,Fn.gd(n)==e.id?n.mode=this.ub?"showing":"hidden":n.mode="disabled";lu(this)}},Ks.prototype.selectTextTrack=Ks.prototype.Ld,Ks.prototype.xg=function(){zn("selectEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. Please use SelectTextTrack.");var e=this.Eb().filter((function(e){return"application/cea-608"==e.mimeType}));0<e.length?this.Ld(e[0]):Y.v("Unable to find the text track embedded in the video.")},Ks.prototype.selectEmbeddedTextTrack=Ks.prototype.xg,Ks.prototype.Rg=function(){zn("usingEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. There should be no reason to know if the player is playing embedded text.");var e=this.Eb().filter((function(e){return e.active}))[0];return!!e&&"application/cea-608"==e.mimeType},Ks.prototype.usingEmbeddedTextTrack=Ks.prototype.Rg,Ks.prototype.Ie=function(e,t,n){if(n=void 0===n?0:n,this.i&&this.j){var r=Su(this);this.h.abr.enabled&&Y.ba("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=r.variants.find((function(t){return t.id==e.id}));i?Fn.Gb(i)?(Ys(this,r,i,!1),Zs(this,i,t,n),this.tb=new Mo(i),iu(this,r.variants)):Y.error("Unable to switch to restricted track",e.id):Y.error("No variant with id",e.id)}else if(this.g&&this.g.audioTracks){for(n=(t=d(t=Array.from(this.g.audioTracks))).next();!n.done;n=t.next())n=n.value,Fn.gd(n)==e.id&&(n.enabled=!0);cu(this)}},Ks.prototype.selectVariantTrack=Ks.prototype.Ie,Ks.prototype.nf=function(){return wu(this.ed())},Ks.prototype.getAudioLanguagesAndRoles=Ks.prototype.nf,Ks.prototype.Jf=function(){return wu(this.Eb())},Ks.prototype.getTextLanguagesAndRoles=Ks.prototype.Jf,Ks.prototype.mf=function(){return Array.from(bu(this.ed()))},Ks.prototype.getAudioLanguages=Ks.prototype.mf,Ks.prototype.If=function(){return Array.from(bu(this.Eb()))},Ks.prototype.getTextLanguages=Ks.prototype.If,Ks.prototype.Jd=function(e,t){if(this.i&&this.A){var n=Su(this);if(this.tb=new Po(e,t||"",0,""),!this.h.abr.enabled){var r=function(e,t){return e.video||t.video?e.video&&t.video?Math.abs((e.video.height||0)-(t.video.height||0))+Math.abs((e.video.width||0)-(t.video.width||0)):1/0:0},i=Su(this)||this.i.periods[0],o=So(this.Z,i).variant,a=this.tb.create(i.variants);i=null;for(var s=(a=d(a.values())).next();!s.done;s=a.next())s=s.value,(!i||r(i,o)>r(s,o))&&(i=s);if(i)return n=Fn.Oc(i),void this.Ie(n,!0)}au(this,n)}else if(this.g&&this.g.audioTracks){for(i=Array.from(this.g.audioTracks),n=Un(e),o=r=null,a=(i=d(i)).next();!a.done;a=i.next())a=a.value,Un((s=Fn.je(a)).language)==n&&(r=a,t?s.roles.includes(t)&&(o=a):0==s.roles.length&&(o=a));o?(o.enabled=!0,cu(this)):r&&(r.enabled=!0,cu(this))}},Ks.prototype.selectAudioLanguage=Ks.prototype.Jd,Ks.prototype.Kd=function(e,t){if(this.i&&this.A){var n=Su(this);this.ua=e,this.Xa=t||"";var r=Fn.Wb(n.textStreams,this.ua,this.Xa)[0]||null;r&&($s(this,n,r,!1),(this.h.streaming.alwaysStreamText||this.zc())&&eu(this,r))}else{var i=Un(e);(n=this.Eb().filter((function(e){return Un(e.language)==i&&(!t||e.roles.includes(t))}))[0])&&this.Ld(n)}},Ks.prototype.selectTextLanguage=Ks.prototype.Kd,Ks.prototype.yg=function(e){if(this.i&&this.A){for(var t=Su(this),n=null,r=d(Tu(this)),i=r.next();!i.done;i=r.next())if((i=i.value).audio.label==e){n=i;break}null==n?Y.v("No variants were found with label: "+e+". Ignoring the request to switch."):(this.tb=new Po(n.language,"",0,e),au(this,t))}},Ks.prototype.selectVariantsByLabel=Ks.prototype.yg,Ks.prototype.zc=function(){var e=this.ub;return this.M?this.M.l.isTextVisible():this.g&&this.g.src&&this.g.textTracks?Xs(this).some((function(e){return"showing"==e.mode})):e},Ks.prototype.isTextTrackVisible=Ks.prototype.zc,Ks.prototype.Bg=function(e){var t=this;return g((function n(){var r,i,o,a;return U(n,(function(n){switch(n.s){case 1:if(t.ub==(r=!!e))return n.return();if(t.ub=r,t.o!=Pu){if(t.g&&t.g.src&&t.g.textTracks)for(var s=d(Xs(t)),u=s.next();!u.done;u=s.next())"disabled"!=(i=u.value).mode&&(i.mode=r?"showing":"hidden");n.I(2);break}if(t.M.l.setTextVisibility(r),t.h.streaming.alwaysStreamText){n.I(2);break}if(!r){!function(e){e.L=!0;var t=e.h.get("text");t&&(La(t),Ua(t).catch((function(){})),e.h.delete("text"))}(t.j),n.I(2);break}if(pa(t.j,"text")){n.I(2);break}if(o=Su(t),!(0<(a=Fn.Wb(o.textStreams,t.ua,t.Xa)).length)){n.I(2);break}return A(n,ga(t.j,a[0]),2);case 2:fu(t),k(n)}}))}))},Ks.prototype.setTextTrackVisibility=Ks.prototype.Bg,Ks.prototype.Ef=function(){if(!this.aa())return Y.v("getPlayheadTimeAsDate is for live streams!"),null;var e=this.Ya.j,t=0;if(this.A)t=this.A.l();else if(e){if(null==e.startTime)return new Date;t=e.startTime}return this.i?new Date(1e3*(this.i.presentationTimeline.j+this.g.currentTime)):this.g&&this.g.getStartDate?(e=this.g.getStartDate(),isNaN(e.getTime())?(Y.v("EXT-X-PROGRAM-DATETIME required to get playhead time as Date!"),null):new Date(e.getTime()+1e3*t)):(Y.v("No way to get playhead time as Date!"),null)},Ks.prototype.getPlayheadTimeAsDate=Ks.prototype.Ef,Ks.prototype.Gf=function(){if(!this.aa())return Y.v("getPresentationStartTimeAsDate is for live streams!"),null;if(this.i)return new Date(1e3*this.i.presentationTimeline.j);if(this.g&&this.g.getStartDate){var e=this.g.getStartDate();return isNaN(e.getTime())?(Y.v("EXT-X-PROGRAM-DATETIME required to get presentation start time as Date!"),null):e}return Y.v("No way to get presentation start time as Date!"),null},Ks.prototype.getPresentationStartTimeAsDate=Ks.prototype.Gf,Ks.prototype.bd=function(){var e={total:[],audio:[],video:[],text:[]};return this.o==Ru&&(e.total=Jt(this.g.buffered)),this.o==Pu&&this.M.bd(e),e},Ks.prototype.getBufferedInfo=Ks.prototype.bd,Ks.prototype.getStats=function(){if(this.o!=Pu&&this.o!=Ru)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,switchHistory:[],stateHistory:[]};ru(this);var e=this.g;if(e.getVideoPlaybackQuality){e=e.getVideoPlaybackQuality();var t=this.F,n=Number(e.totalVideoFrames);t.A=Number(e.droppedVideoFrames),t.u=n,this.F.o=Number(e.corruptedVideoFrames)}e=this.m&&(e=this.m).P?e.P:NaN,this.F.m=e,this.o==Pu&&((e=Eu(this))&&(this.F.C=e.bandwidth),e&&e.video&&(t=this.F,n=e.video.height||NaN,t.F=e.video.width||NaN,t.l=n),e=this.u.getBandwidthEstimate(),this.F.j=e);var r=this.F;e=r.F,t=r.l,n=r.C;for(var i=r.u,o=r.A,a=r.o,s=r.j,u=r.h,c=Ls(r.g,"playing"),l=Ls(r.g,"paused"),f=Ls(r.g,"buffering"),h=r.m,p=function(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var n=[],r=d(e.h),i=r.next();!i.done;i=r.next())n.push(t(i.value));return e.g&&n.push(t(e.g)),n}(r.g),g=[],m=(r=d(r.i.g)).next();!m.done;m=r.next())m=m.value,g.push({timestamp:m.timestamp,id:m.id,type:m.type,fromAdaptation:m.fromAdaptation,bandwidth:m.bandwidth});return{width:e,height:t,streamBandwidth:n,decodedFrames:i,droppedFrames:o,corruptedFrames:a,estimatedBandwidth:s,loadLatency:u,playTime:c,pauseTime:l,bufferingTime:f,licenseTime:h,stateHistory:p,switchHistory:g}},Ks.prototype.getStats=Ks.prototype.getStats,Ks.prototype.addTextTrack=function(e,t,n,r,i,o){var a=this;return g((function s(){var u,c,l,f,h,d,p,g,m;return U(s,(function(s){switch(s.s){case 1:if(a.o==Ru)throw Y.error("Cannot add text when loaded with src="),Error("State error!");if(a.o!=Pu)throw Y.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");if(u=Su(a),c=pe,l=a.i.periods.indexOf(u),h=(f=l+1)>=a.i.periods.length?a.i.presentationTimeline.ha():a.i.periods[f].startTime,1/0==(d=h-u.startTime))throw new $(1,4,4033);return p=new ii(1,0,d,(function(){return[e]}),0,null),g={id:a.re++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1==e?p:null},initSegmentReference:null,presentationTimeOffset:0,mimeType:r,codecs:i||"",kind:n,encrypted:!1,keyId:null,language:t,label:o||null,type:c.za,primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},a.lc.add(g),u.textStreams.push(g),A(s,ga(a.j,g),2);case 2:return(m=pa(a.j,"text"))&&To(a.Z,u,m),a.lc.delete(g),Y.debug("Choosing new streams after adding a text stream"),ou(a,u),uu(a),s.return(Fn.Kc(g))}}))}))},Ks.prototype.addTextTrack=Ks.prototype.addTextTrack,Ks.prototype.Nd=function(e,t){this.mc.width=e,this.mc.height=t},Ks.prototype.setMaxHardwareResolution=Ks.prototype.Nd,Ks.prototype.Id=function(){if(this.o==Pu){var e=this.j;if(e.j)Y.error("Unable to retry after StreamingEngine is destroyed!"),e=!1;else if(e.A)Y.error("Unable to retry after StreamingEngine encountered a fatal error!"),e=!1;else{for(var t=d(e.h.values()),n=t.next();!n.done;n=t.next()){var r=Ka(n=n.value);n.ac&&(Y.info(r,"Retrying after failure..."),n.ac=!1,Oa(e,n,.1))}e=!0}}else e=!1;return e},Ks.prototype.retryStreaming=Ks.prototype.Id,Ks.prototype.uf=function(){return this.i},Ks.prototype.getManifest=Ks.prototype.uf,Ks.prototype.vf=function(){return this.C?this.C.constructor:null},Ks.prototype.getManifestParserFactory=Ks.prototype.vf,(i=Ks.prototype).Xc=function(e){var t=this.j?ha(this.j):null,n=this.j?da(this.j):null;if(Fn.filterNewPeriod(this.m,t,n,e),!(t=e.variants).some(Fn.Gb))throw new $(2,4,4011);if(vu(this,e.variants),Fn.Xd(t,this.h.restrictions,this.mc)&&this.j&&Su(this)==e&&uu(this),(e=this.m?this.m.g:null)&&this.m.o)for(n=(t=d(t)).next();!n.done;n=t.next())for(var r=(n=d(n.value.drmInfos)).next();!r.done;r=n.next())if((r=r.value).keySystem==e.keySystem)for(var i=(r=d(r.initData||[])).next();!i.done;i=r.next())i=i.value,Mt(this.m,i.initDataType,i.initData)},i.Vf=function(e){Y.debug("onChooseStreams_",e);try{Y.O("onChooseStreams_, choosing variant from ",e.variants),Y.O("onChooseStreams_, choosing text from ",e.textStreams),this.yb=!0,this.u.disable(),hu(this),Y.debug("Choosing new streams after period changed");var t=iu(this,e.variants),n=Fn.Wb(e.textStreams,this.ua,this.Xa)[0]||null;this.wa&&(e.variants.includes(this.wa)&&(t=this.wa),this.wa=null),this.va&&(e.textStreams.includes(this.va)&&(n=this.va),this.va=null),t&&Ys(this,e,t,!0),n&&$s(this,e,n,!0);var r=this.j,i=r.h.get("video");if(i)var o=r.i.periods[i.oa];else{var a=r.h.get("audio");o=a?r.i.periods[a.oa]:null}var s=t?t.audio:null;if(!o&&n){var u;if(u=s){e=n;var c=Un(this.h.preferredTextLanguage),l=Un(s.language),f=Un(e.language);u=On(f,c)&&!On(l,f)}u&&(this.ub=!0),this.ub&&this.M.l.setTextVisibility(!0),fu(this)}var h=this.h.streaming.alwaysStreamText||this.zc()?{variant:t,text:n}:{variant:t,text:null};return Y.O("onChooseStreams_, chose variant ",h.variant),Y.O("onChooseStreams_, chose text ",h.text),h}catch(d){return this.Va(d),{variant:null,text:null}}},i.Ze=function(){Y.debug("canSwitch_"),this.yb=!1,this.h.abr.enabled&&(this.u.enable(),hu(this)),this.wa&&(va(this.j,this.wa,this.qe,this.oe),cu(this),this.wa=null),this.va&&(ya(this.j,this.va,!0,0,!1),lu(this),this.va=null)},i.$f=function(){this.C&&this.C.update&&this.C.update()},i.eg=function(){this.A&&this.A.C()},i.Va=function(e){if(this.o!=Iu){var t=new _e("error",{detail:e});this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)}};var Iu=0,Mu=1,Pu=2,Ru=3;function Cu(e,t){var n=ms(new gs(e.Ea(),e.ja()),t.periods[0],new Ei(null,0)),r=t.appMetadata||{};return n=Nu(n),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:n,appMetadata:r}}function Nu(e){for(var t=[],n=Fn.Bf(e.variants),r=(n=d(n)).next();!r.done;r=n.next())t.push(Fn.Oc(r.value));for(n=(e=d(e.textStreams)).next();!n.done;n=e.next())t.push(Fn.Kc(n.value));return t}function ju(){this.g={}}function Du(e,t){var n=t.audio,r=t.video;if(n&&!r&&(e.g[n.id]=n.bandwidth||t.bandwidth),!n&&r&&(e.g[r.id]=r.bandwidth||t.bandwidth),n&&r){var i=n.bandwidth||393216,o=r.bandwidth||t.bandwidth-i;0>=o&&(Y.v("Audio bit rate consumes variants bandwidth. Setting video bandwidth to match variant's bandwidth."),o=t.bandwidth),e.g[n.id]=i,e.g[r.id]=o}}function Ou(e,t){var n=e.g[t];return null==n&&(n=0,Y.error("Asking for bitrate of stream not given to the estimator")),0==n&&Y.v("Using bitrate of 0, this stream won't affect progress"),n}function Lu(e){this.g=!1,this.h=new me,this.i=e}function Uu(e){var t=new Ku;e.periods.forEach((function(e,n){var r=Fu(e.variants);if(0==n)for(var i=(r=d(r.g)).next();!i.done;i=r.next())t.add(i.value);else!function(e,t){e.g=e.g.filter((function(e){return Bu(t,e)}))}(t,r)}));for(var n=(e=d(e.periods)).next();!n.done;n=e.next())(n=n.value).variants=n.variants.filter((function(e){return Bu(t,new _u(e))}))}function _u(e){var t=e.audio;e=e.video,this.h=t?t.mimeType:null,this.g=t?t.codecs.split(".")[0]:null,this.j=e?e.mimeType:null,this.i=e?e.codecs.split(".")[0]:null}function Ku(){this.g=[]}function Bu(e,t){return e.g.some((function(e){return t.h==e.h&&t.g==e.g&&t.j==e.j&&t.i==e.i}))}function Fu(e){for(var t=new Ku,n=(e=d(e)).next();!n.done;n=e.next())t.add(new _u(n.value));return t}function Vu(e){var t=this;if(e&&e.constructor!=Ks)throw new $(2,9,9008);this.h=this.g=null,e?(this.g=e.h,this.h=e.Yb()):(this.g=Ns(),this.h=new We),this.j=!1,this.i=[],this.l=[];var n=!e;this.m=new Lu((function(){return g((function e(){var r;return U(e,(function(e){switch(e.s){case 1:return r=function(){},A(e,Promise.all(t.l.map((function(e){return e.then(r,r)}))),2);case 2:if(!n){e.I(3);break}return A(e,t.h.destroy(),3);case 3:t.g=null,t.h=null,k(e)}}))}))}))}function Hu(){if(pt())e:{for(var e=d(os.values()),t=e.next();!t.done;t=e.next())if(t=(t=t.value)()){t.destroy(),e=!0;break e}e=!1}else e=!1;return e}function qu(e,t){for(var n=[],r=d(e.periods),i=r.next();!i.done;i=r.next())for(var o=(i=d(i.value.streams)).next();!o.done;o=i.next())o=o.value,t&&"video"==o.contentType?n.push({contentType:lt(o.mimeType,o.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=o.contentType||n.push({contentType:lt(o.mimeType,o.codecs),robustness:e.drmInfo.audioRobustness});return n}function zu(e,t,n){return g((function r(){return U(r,(function(r){if(1===r.s)return A(r,function(e,t,n,r){return g((function i(){var o,a,s;return U(i,(function(i){switch(i.s){case 1:return r.drmInfo?(o=function(e){var t=Array.from(e.g.keys());if(!t.length)throw new $(2,9,9e3,"No supported storage mechanisms found");return e.g.get(t[0]).getEmeSessionCell()}(n),a=r.sessionIds.map((function(e){return{sessionId:e,keySystem:r.drmInfo.keySystem,licenseUri:r.drmInfo.licenseServerUri,serverCertificate:r.drmInfo.serverCertificate,audioCapabilities:qu(r,!1),videoCapabilities:qu(r,!0)}})),A(i,Ts(t,e,a),2)):i.return();case 2:return s=i.B,A(i,o.remove(s),3);case 3:return A(i,o.add(a.filter((function(e){return-1==s.indexOf(e.sessionId)}))),0)}}))}))}(e.h,e.g.drm,n,t),0)}))}))}function Gu(e,t,n,r){function i(){s+=1,e.g.offline.progressCallback(u,s/a)}var o=function(e){var t=[];return e.periods.forEach((function(e){e.streams.forEach((function(e){null!=e.initSegmentKey&&t.push(e.initSegmentKey),e.segments.forEach((function(e){t.push(e.dataKey)}))}))})),t}(r),a=o.length+1,s=0,u=Cu(n,r);return Promise.all([t.removeSegments(o,i),t.removeManifests([n.key()],i)])}function Wu(e,t,n,r,i,o){var a={id:o.id,originalId:o.originalId,primary:o.primary,presentationTimeOffset:o.presentationTimeOffset||0,contentType:o.type,mimeType:o.mimeType,codecs:o.codecs,frameRate:o.frameRate,pixelAspectRatio:o.pixelAspectRatio,kind:o.kind,language:o.language,label:o.label,width:o.width||null,height:o.height||null,initSegmentKey:null,encrypted:o.encrypted,keyId:o.keyId,segments:[],variantIds:[]};i=i.presentationTimeline.$b();var s=o.id,u=o.initSegmentReference;return u&&(u=xi(u.i(),u.h,u.g,e.g.streaming.retryParameters),za(t,s,u,.5*Ou(r,o.id),!0,(function(t){return g((function r(){var i;return U(r,(function(r){switch(r.s){case 1:return A(r,n.addSegments([{data:t}]),2);case 2:i=r.B,e.i.push(i[0]),a.initSegmentKey=i[0],k(r)}}))}))}))),function(e,t,n){for(var r=null==(t=e.findSegmentPosition(t))?null:e.getSegmentReference(t);r;)n(r),r=e.getSegmentReference(++t)}(o,i,(function(i){var u=xi(i.i(),i.h,i.g,e.g.streaming.retryParameters);za(t,s,u,function(e,t,n){return n=n.endTime-n.startTime,Ou(e,t)*n}(r,o.id,i),!1,(function(t){return g((function r(){var o;return U(r,(function(r){switch(r.s){case 1:return A(r,n.addSegments([{data:t}]),2);case 2:o=r.B,e.i.push(o[0]),a.segments.push({startTime:i.startTime,endTime:i.endTime,dataKey:o[0]}),k(r)}}))}))}))})),a}function Xu(e){if(e.m.g)throw new $(2,9,7001)}function Yu(){if(!Hu())throw new $(2,9,9e3)}function $u(e,t){return g((function n(){return U(n,(function(n){switch(n.s){case 1:return e.l.push(t),M(n,2),A(n,t,4);case 4:return n.return(n.B);case 2:C(n),He(e.l,t),N(n,0)}}))}))}function Ju(e){var t=new Set(e.variants.map((function(e){return e.video}))),n=new Set(e.variants.map((function(e){return e.audio})));e=e.textStreams,1<t.size&&Y.v("Multiple video tracks selected to be stored");for(var r=(t=d(n)).next();!r.done;r=t.next()){r=r.value;for(var i=d(n),o=i.next();!o.done;o=i.next())r!=(o=o.value)&&r.language==o.language&&Y.v("Similar audio tracks were selected to be stored",r.id,o.id)}for(t=(n=d(e)).next();!t.done;t=n.next())for(t=t.value,i=(r=d(e)).next();!i.done;i=r.next())t!=(i=i.value)&&t.language==i.language&&Y.v("Similar text tracks were selected to be stored",t.id,i.id)}Ks.LoadMode={DESTROYED:Iu,NOT_LOADED:Mu,MEDIA_SOURCE:Pu,SRC_EQUALS:Ru},Lu.prototype.destroy=function(){var e=this;return this.g?this.h:(this.g=!0,this.i().then((function(){e.h.resolve()}),(function(){e.h.resolve()})))},Ku.prototype.add=function(e){Bu(this,e)||this.g.push(e)},H("shaka.offline.Storage",Vu),Vu.support=Hu,Vu.prototype.destroy=function(){return this.m.destroy()},Vu.prototype.destroy=Vu.prototype.destroy,Vu.prototype.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=Rs(e,t));var n=e,r=!1;return null!=n.trackSelectionCallback&&(r=!0,n.offline=n.offline||{},n.offline.trackSelectionCallback=n.trackSelectionCallback,delete n.trackSelectionCallback),null!=n.progressCallback&&(r=!0,n.offline=n.offline||{},n.offline.progressCallback=n.progressCallback,delete n.progressCallback),null!=n.usePersistentLicense&&(r=!0,n.offline=n.offline||{},n.offline.usePersistentLicense=n.usePersistentLicense,delete n.usePersistentLicense),r&&zn("Storage.configure with OfflineConfig","Please configure storage with a player configuration."),js(this.g,e)},Vu.prototype.configure=Vu.prototype.configure,Vu.prototype.getConfiguration=function(){var e=Ns();return js(e,this.g,Ns()),e},Vu.prototype.getConfiguration=Vu.prototype.getConfiguration,Vu.prototype.Yb=function(){return this.h},Vu.prototype.getNetworkingEngine=Vu.prototype.Yb,Vu.prototype.store=function(e,t,n){var r=this;return $u(this,function(e,t,n,r){return g((function i(){var o,a,s,u,c,l,f,h,p;return U(i,(function(i){switch(i.s){case 1:return Yu(),e.j?i.return(Promise.reject(new $(2,9,9006))):(e.j=!0,A(i,function(e,t,n){return g((function r(){var i,o,a,s,u,c;return U(r,(function(r){switch(r.s){case 1:return i=null,o=e.h,a={networkingEngine:o,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){i=e}},A(r,n(),2);case 2:return(s=r.B).configure(e.g.manifest),Xu(e),M(r,3),A(r,s.start(t,a),5);case 5:return u=r.B,Xu(e),c=function(e){for(var t=new Set,n=(e=d(e.periods)).next();!n.done;n=e.next()){for(var r=d((n=n.value).textStreams),i=r.next();!i.done;i=r.next())t.add(i.value);for(r=(n=d(n.variants)).next();!r.done;r=n.next())(r=r.value).audio&&t.add(r.audio),r.video&&t.add(r.video)}return t}(u),A(r,Promise.all(at(c,(function(e){return e.createSegmentIndex()}))),6);case 6:if(Xu(e),i)throw i;return r.return(u);case 3:return C(r),A(r,s.stop(),7);case 7:N(r,0)}}))}))}(e,t,r),2));case 2:if(o=i.B,Xu(e),o.presentationTimeline.aa()||o.presentationTimeline.ib())throw new $(2,9,9005,t);return a=null,s=new ns,c=u=null,I(i,3,4),A(i,function(e,t,n){return g((function r(){var i,o,a;return U(r,(function(r){switch(r.s){case 1:return i=new Et({Ib:e.h,onError:n,Dc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),o=Fo(t.periods),a=e.g,i.configure(a.drm),A(r,function(e,t,n){return e.F=[],e.L=n,At(e,t)}(i,o,a.offline.usePersistentLicense),2);case 2:return A(r,kt(i),3);case 3:return A(r,It(i),4);case 4:return r.return(i)}}))}))}(e,o,(function(e){c=c||e})),6);case 6:if(a=i.B,Xu(e),c)throw c;return A(i,function(e,t,n){return g((function r(){var i,o;return U(r,(function(r){switch(r.s){case 1:return i={width:1/0,height:1/0},function(e,t,n){for(var r=(e=d(e.periods)).next();!r.done;r=e.next())(r=r.value).variants=r.variants.filter((function(e){return Fn.rd(e,t,n)}))}(t,e.g.restrictions,i),function(e){for(var t=(e=d(e.periods)).next();!t.done;t=e.next())(t=t.value).variants=t.variants.filter((function(e){var t=!0;return e.audio&&(t=t&&En(e.audio)),e.video&&(t=t&&En(e.video)),t}))}(t),function(e,t){for(var n=d(e.periods),r=n.next();!r.done;r=n.next())(r=r.value).variants=r.variants.filter((function(e){return _t(t,e)}))}(t,n),Uu(t),o=e.g.preferredAudioChannelCount,Fn.$d(t,o),A(r,function(e,t){return g((function n(){var r,i,o,a;return U(n,(function(n){switch(n.s){case 1:r=null,i=d(e.periods),o=i.next();case 2:if(o.done){n.I(0);break}return a=o.value,r&&(a.variants=a.variants.filter((function(e){return Bu(r,new _u(e))}))),A(n,t(a),5);case 5:r=Fu(a.variants),o=i.next(),n.I(2)}}))}))}(t,(function(t){return g((function n(){var r,i,o,a,s,u,c,l;return U(n,(function(n){switch(n.s){case 1:r=Fn,i=[];for(var f=d(t.variants),h=f.next();!h.done;h=f.next())o=h.value,i.push(r.Oc(o));for(h=(f=d(t.textStreams)).next();!h.done;h=f.next())a=h.value,i.push(r.Kc(a));return A(n,e.g.offline.trackSelectionCallback(i),2);case 2:for(s=n.B,u=new Set,c=new Set,h=(f=d(s)).next();!h.done;h=f.next())"variant"==(l=h.value).type&&u.add(l.id),"text"==l.type&&c.add(l.id);t.variants=t.variants.filter((function(e){return u.has(e.id)})),t.textStreams=t.textStreams.filter((function(e){return c.has(e.id)})),k(n)}}))}))})),2);case 2:(function(e){if(0==e.periods.length)throw new $(2,4,4014);for(var t=(e=d(e.periods)).next();!t.done;t=e.next())Ju(t.value)})(t),k(r)}}))}))}(e,o,a),7);case 7:return A(i,s.init(),8);case 8:return Xu(e),A(i,function(e){var t=null;if(e.g.forEach((function(e,n){e.getCells().forEach((function(e,r){e.hasFixedKeySpace()||t||(t={path:{Ea:n,ja:r},ja:e})}))})),t)return t;throw new $(2,9,9013,"Could not find a cell that supports add-operations")}(s),9);case 9:return u=i.B,Xu(e),A(i,function(e,t,n,r,i,o){return g((function a(){var s,u,c,l,f,h,p,m,v,y;return U(a,(function(a){switch(a.s){case 1:return s=function(e,t,n){var r=null==t.expiration?1/0:t.expiration;return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.ha(),size:0,expiration:r,tracks:t=Nu(t.periods[0]),appMetadata:n}}(i,r,o),u=r.periods.some((function(e){return e.variants.some((function(e){return e.drmInfos&&e.drmInfos.length}))})),c=r.periods.some((function(e){return e.variants.some((function(e){return e.drmInfos.some((function(e){return e.initData&&e.initData.length}))}))})),f=null,(l=u&&!c)&&(h=n.g,f=Qu.get(h.keySystem)),p=new qa(e.h,(function(t,n){s.size=n,e.g.offline.progressCallback(s,t)}),(function(t,r){l&&e.g.offline.usePersistentLicense&&f==r&&Mt(n,"cenc",t)})),M(a,2),v=m=function(e,t,n,r,i,o,a){var s=new ju,u=i.periods.map((function(r){return function(e,t,n,r,i,o){for(var a=d(o.variants),s=a.next();!s.done;s=a.next())Du(r,s.value);for(a=d(o.textStreams),s=a.next();!s.done;s=a.next())r.g[s.value.id]=52;a=function(e){for(var t=new Set,n=d(e.textStreams),r=n.next();!r.done;r=n.next())t.add(r.value);for(e=d(e.variants),n=e.next();!n.done;n=e.next())(n=n.value).audio&&t.add(n.audio),n.video&&t.add(n.video);return t}(o);var u=new Map;for(a=d(a),s=a.next();!s.done;s=a.next()){var c=Wu(e,t,n,r,i,s=s.value);u.set(s.id,c)}return o.variants.forEach((function(e){e.audio&&u.get(e.audio.id).variantIds.push(e.id),e.video&&u.get(e.video.id).variantIds.push(e.id)})),{startTime:o.startTime,streams:Array.from(u.values())}}(e,t,n,s,i,r)})),c=r.g,l=e.g.offline.usePersistentLicense;return c&&l&&(c.initData=[]),{originalManifestUri:o,duration:i.presentationTimeline.ha(),size:0,expiration:r.Xb(),periods:u,sessionIds:l?Ct(r):[],drmInfo:c,appMetadata:a}}(e,p,t,n,r,i,o),A(a,function(e){return g((function t(){return U(t,(function(t){switch(t.s){case 1:return A(t,Promise.all(e.h.values()),2);case 2:return t.return(e.g.g)}}))}))}(p),4);case 4:if(v.size=a.B,m.expiration=n.Xb(),y=Ct(n),m.sessionIds=e.g.offline.usePersistentLicense?y:[],u&&e.g.offline.usePersistentLicense&&!y.length)throw new $(2,9,9007);return a.return(m);case 2:return C(a),A(a,p.destroy(),5);case 5:N(a,0)}}))}))}(e,u.ja,a,o,t,n),10);case 10:if(l=i.B,Xu(e),c)throw c;return A(i,u.ja.addManifests([l]),11);case 11:return f=i.B,Xu(e),h=new ds("manifest",u.path.Ea,u.path.ja,f[0]),i.return(Cu(h,l));case 4:return C(i),e.j=!1,e.i=[],A(i,s.destroy(),12);case 12:if(!a){i.I(13);break}return A(i,a.destroy(),13);case 13:N(i,0);break;case 3:if(p=R(i),!u){i.I(15);break}return A(i,u.ja.removeSegments(e.i,(function(){})),15);case 15:throw c||p}}))}))}(this,e,t||{},(function(){return g((function t(){var i,o;return U(t,(function(t){switch(t.s){case 1:return n&&"string"!=typeof n?(zn("Storing with a manifest parser factory","Please register a manifest parser and for the mime-type."),i=n,t.return(new i)):A(t,Si.create(e,r.h,r.g.manifest.retryParameters,n),2);case 2:return o=t.B,t.return(o)}}))}))})))},Vu.prototype.store=Vu.prototype.store,Vu.prototype.Hf=function(){return this.j},Vu.prototype.getStoreInProgress=Vu.prototype.Hf,Vu.prototype.remove=function(e){return $u(this,function(e,t){return g((function n(){var r,i,o,a,s,u;return U(n,(function(n){switch(n.s){case 1:return Yu(),null==(r=ps(t))||"manifest"!=r.g?n.return(Promise.reject(new $(2,9,9004,t))):(i=r,o=new ns,M(n,2),A(n,o.init(),4));case 4:return A(n,rs(o,i.Ea(),i.ja()),5);case 5:return A(n,(a=n.B).getManifests([i.key()]),6);case 6:return s=n.B,u=s[0],A(n,Promise.all([zu(e,u,o),Gu(e,a,i,u)]),2);case 2:return C(n),A(n,o.destroy(),8);case 8:N(n,0)}}))}))}(this,e))},Vu.prototype.remove=Vu.prototype.remove,Vu.prototype.sg=function(){return $u(this,function(e){return g((function t(){var n,r,i,o,a,s,u,c,l;return U(t,(function(t){switch(t.s){case 1:return Yu(),n=e.h,r=e.g.drm,i=new ns,o=!1,M(t,2),A(t,i.init(),4);case 4:for(a=[],function(e,t){e.g.forEach((function(e){t(e.getEmeSessionCell())}))}(i,(function(e){return a.push(e)})),s=Promise.resolve(),u={},c=d(a),l=c.next();!l.done;u={Jc:u.Jc},l=c.next())u.Jc=l.value,s=s.then(function(e){return function(){return g((function t(){var i,a;return U(t,(function(t){switch(t.s){case 1:return A(t,e.Jc.getAll(),2);case 2:return i=t.B,A(t,Ts(r,n,i),3);case 3:return a=t.B,A(t,e.Jc.remove(a),4);case 4:a.length!=i.length&&(o=!0),k(t)}}))}))}}(u));return A(t,s,2);case 2:return C(t),A(t,i.destroy(),6);case 6:N(t,3);break;case 3:return t.return(!o)}}))}))}(this))},Vu.prototype.removeEmeSessions=Vu.prototype.sg,Vu.prototype.list=function(){return $u(this,g((function e(){var t,n,r;return U(e,(function(e){switch(e.s){case 1:return Yu(),t=[],n=new ns,M(e,2),A(e,n.init(),4);case 4:return r=Promise.resolve(),function(e,t){e.g.forEach((function(e,n){e.getCells().forEach((function(e,r){t({Ea:n,ja:r},e)}))}))}(n,(function(e,n){r=r.then((function(){return g((function r(){return U(r,(function(r){switch(r.s){case 1:return A(r,n.getAllManifests(),2);case 2:r.B.forEach((function(n,r){var i=Cu(new ds("manifest",e.Ea,e.ja,r),n);t.push(i)})),k(r)}}))}))}))})),A(e,r,2);case 2:return C(e),A(e,n.destroy(),6);case 6:N(e,3);break;case 3:return e.return(t)}}))})))},Vu.prototype.list=Vu.prototype.list,Vu.deleteAll=function(){return g((function e(){var t;return U(e,(function(e){switch(e.s){case 1:return t=new ns,M(e,2),A(e,t.erase(),2);case 2:return C(e),A(e,t.destroy(),5);case 5:N(e,0)}}))}))};var Qu=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.adobe.primetime","f239e769efa348509c16a903c6932efb");Vs.offline=Hu,H("shaka.polyfill.installAll",(function(){for(var e=0;e<tc.length;++e)try{tc[e].Xe()}catch(t){Y.ba("Error installing polyfill!",t)}}));var Zu,ec,tc=[];function nc(e,t){for(var n={priority:t=t||0,Xe:e},r=0;r<tc.length;r++)if(tc[r].priority<t)return void tc.splice(r,0,n);tc.push(n)}function rc(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var n=new Event(t,e);else(n=document.createEvent("Event")).initEvent(t,e.bubbles,e.cancelable);e.target.dispatchEvent(n)}function ic(e,t,n){"input"==e&&"range"===this.type&&(e="change"),HTMLInputElement.prototype.originalAddEventListener.call(this,e,t,n)}function oc(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(t){for(var n=[],r=0;r<arguments.length;++r)n[r]=arguments[r];return(n=e.apply(this,n)).abort=function(){},n}}function ac(e,t){Y.debug("PatchedMediaKeysApple.requestMediaKeySystemAccess");try{var n=new sc(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function sc(e,t){if(Y.debug("PatchedMediaKeysApple.MediaKeySystemAccess"),this.keySystem=e,e.startsWith("com.apple.fps"))for(var n=d(t),r=n.next();!r.done;r=n.next()){var i=r.value;if("required"==i.persistentState)r=null;else{r={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label};var o=!1,a=!1;if(i.audioCapabilities)for(var s=d(i.audioCapabilities),u=s.next();!u.done;u=s.next())if((u=u.value).contentType){o=!0;var c=u.contentType.split(";")[0];WebKitMediaKeys.isTypeSupported(this.keySystem,c)&&(r.audioCapabilities.push(u),a=!0)}if(i.videoCapabilities)for(u=(i=d(i.videoCapabilities)).next();!u.done;u=i.next())(s=u.value).contentType&&(o=!0,u=s.contentType.split(";")[0],WebKitMediaKeys.isTypeSupported(this.keySystem,u)&&(r.videoCapabilities.push(s),a=!0));o||(a=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),r=a?r:null}if(r)return void(this.g=r)}throw(n=Error("Unsupported keySystem")).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function uc(e){Y.debug("PatchedMediaKeysApple.setMediaKeys");var t=this.mediaKeys;return t&&t!=e&&lc(t,null),delete this.mediaKeys,(this.mediaKeys=e)?lc(e,this):Promise.resolve()}function cc(e){Y.debug("PatchedMediaKeysApple.MediaKeys"),this.h=new WebKitMediaKeys(e),this.g=new tt}function lc(e,t){if(e.g.nb(),!t)return Promise.resolve();e.g.H(t,"webkitneedkey",hc);try{return Go(t,HTMLMediaElement.HAVE_METADATA,e.g,(function(){t.webkitSetMediaKeys(e.h)})),Promise.resolve()}catch(n){return Promise.reject(n)}}function fc(e){Y.debug("PatchedMediaKeysApple.MediaKeySession"),Be.call(this),this.h=null,this.l=e,this.i=this.g=null,this.j=new tt,this.sessionId="",this.expiration=NaN,this.closed=new me,this.keyStatuses=new pc}function hc(e){if(Y.debug("PatchedMediaKeysApple.onWebkitNeedKey_",e),e=new Uint8Array(e.initData),new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=we(e=ye(e.subarray(4),!0));var t=new Event("encrypted");t.initDataType="skd",t.initData=e,this.dispatchEvent(t)}function dc(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,e.dispatchEvent(new _e("keystatuseschange"))}function pc(){this.size=0,this.g=void 0}function gc(e,t){Y.debug("PatchedMediaKeysMs.requestMediaKeySystemAccess");try{var n=new mc(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function mc(e,t){Y.debug("PatchedMediaKeysMs.MediaKeySystemAccess"),this.keySystem=e;for(var n=!1,r=0;r<t.length;++r){var i=t[r],o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label},a=!1;if(i.audioCapabilities)for(var s=0;s<i.audioCapabilities.length;++s){var u=i.audioCapabilities[s];if(u.contentType){a=!0;var c=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,c)&&(o.audioCapabilities.push(u),n=!0)}}if(i.videoCapabilities)for(s=0;s<i.videoCapabilities.length;++s)(u=i.videoCapabilities[s]).contentType&&(a=!0,c=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,c)&&(o.videoCapabilities.push(u),n=!0));if(a||(n=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==i.persistentState&&(n=!1),n)return void(this.g=o)}throw(n=Error("Unsupported keySystem")).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function vc(e){Y.debug("PatchedMediaKeysMs.setMediaKeys");var t=this.mediaKeys;return t&&t!=e&&bc(t,null),delete this.mediaKeys,(this.mediaKeys=e)?bc(e,this):Promise.resolve()}function yc(e){Y.debug("PatchedMediaKeysMs.MediaKeys"),this.h=new MSMediaKeys(e),this.g=new tt}function bc(e,t){if(e.g.nb(),!t)return Promise.resolve();e.g.H(t,"msneedkey",Tc);try{return Go(t,HTMLMediaElement.HAVE_METADATA,e.g,(function(){t.msSetMediaKeys(e.h)})),Promise.resolve()}catch(n){return Promise.reject(n)}}function wc(e){Y.debug("PatchedMediaKeysMs.MediaKeySession"),Be.call(this),this.i=null,this.l=e,this.h=this.g=null,this.j=new tt,this.sessionId="",this.expiration=NaN,this.closed=new me,this.keyStatuses=new Ec}function Tc(e){if(Y.debug("PatchedMediaKeysMs.onMsNeedKey_",e),e.initData){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="cenc",t.initData=function(e){if(!e)return e;var t=new zr(e);if(1>=t.data.length)return e;e=[];for(var n={},r=(t=d(t.data)).next();!r.done;n={yc:n.yc},r=t.next())n.yc=r.value,e.some(function(e){return function(t){return xe.Ha(t,e.yc)}}(n))||e.push(n.yc);return xe.concat.apply(xe,e instanceof Array?e:function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(d(e)))}(e.initData).buffer,this.dispatchEvent(t)}}function Sc(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,e.dispatchEvent(new _e("keystatuseschange"))}function Ec(){this.size=0,this.g=void 0}function xc(){return Y.debug("PatchedMediaKeysNop.requestMediaKeySystemAccess"),Promise.reject(Error("The key system specified is not supported."))}function Ac(e){return Y.debug("PatchedMediaKeysNop.setMediaKeys"),null==e?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function kc(){throw new TypeError("Illegal constructor.")}function Ic(){throw new TypeError("Illegal constructor.")}H("shaka.polyfill.register",nc),nc((function(){Fl()}),-1),nc((function(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,(t=Document.prototype).exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.webkitCancelFullScreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",rc),document.addEventListener("webkitfullscreenerror",rc),document.addEventListener("mozfullscreenchange",rc),document.addEventListener("mozfullscreenerror",rc),document.addEventListener("MSFullscreenChange",rc),document.addEventListener("MSFullscreenError",rc)}})),nc((function(){Y.debug("InputEvent.install"),bt("Trident/")&&!HTMLInputElement.prototype.originalAddEventListener&&(Y.info("Patching input event support on IE."),HTMLInputElement.prototype.originalAddEventListener=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=ic)})),nc((function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:function(){return navigator.language?[navigator.language]:["en"]}})})),nc((function(){Y.debug("mathRound.install")})),nc((function(){Y.debug("MediaSource.install");var t=yt();e.MediaSource?e.cast&&cast.__platform__&&cast.__platform__.canDisplayType?(Y.info("Patching Chromecast MSE bugs."),function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */);return n.shift(),n.some((function(e){return e.startsWith("codecs=")}))?cast.__platform__.canDisplayType(t):e(t)}}()):t?(function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"mp2t"!=t.split(/ *; */)[0].split("/")[1].toLowerCase()&&e(t)}}(),12>=t?(Y.info("Patching Safari 11 & 12 MSE bugs."),oc(),function(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}()):(Y.info("Patching Safari 13 MSE bugs."),oc())):bt("Tizen 2")||bt("Tizen 3")||bt("Tizen 4")?function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"opus"!=ht(t)[0]&&e(t)}}():Y.info("Using native MSE as-is."):Y.info("No MSE implementation available.")})),sc.prototype.createMediaKeys=function(){Y.debug("PatchedMediaKeysApple.MediaKeySystemAccess.createMediaKeys");var e=new cc(this.keySystem);return Promise.resolve(e)},sc.prototype.getConfiguration=function(){return Y.debug("PatchedMediaKeysApple.MediaKeySystemAccess.getConfiguration"),this.g},cc.prototype.createSession=function(e){if(Y.debug("PatchedMediaKeysApple.MediaKeys.createSession"),"temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new fc(this.h)},cc.prototype.setServerCertificate=function(e){return Y.debug("PatchedMediaKeysApple.MediaKeys.setServerCertificate"),Promise.resolve(!0)},q(fc,Be),(i=fc.prototype).generateRequest=function(e,t){Y.debug("PatchedMediaKeysApple.MediaKeySession.generateRequest"),this.g=new me;try{this.h=this.l.createSession("video/mp4",new Uint8Array(t)),this.sessionId=this.h.sessionId||"",this.j.H(this.h,"webkitkeymessage",this.Gg.bind(this)),this.j.H(this.h,"webkitkeyadded",this.Eg.bind(this)),this.j.H(this.h,"webkitkeyerror",this.Fg.bind(this)),dc(this,"status-pending")}catch(n){this.g.reject(n)}return this.g},i.load=function(){return Y.debug("PatchedMediaKeysApple.MediaKeySession.load"),Promise.reject(Error("MediaKeySession.load not yet supported"))},i.update=function(e){Y.debug("PatchedMediaKeysApple.MediaKeySession.update"),this.i=new me;try{this.h.update(new Uint8Array(e))}catch(t){this.i.reject(t)}return this.i},i.close=function(){Y.debug("PatchedMediaKeysApple.MediaKeySession.close");try{this.h.close(),this.closed.resolve(),this.j.nb()}catch(u){this.closed.reject(u)}return this.closed},i.remove=function(){return Y.debug("PatchedMediaKeysApple.MediaKeySession.remove"),Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},i.Gg=function(e){Y.debug("PatchedMediaKeysApple.onWebkitKeyMessage_",e),this.g&&(this.g.resolve(),this.g=null),this.dispatchEvent(new _e("message",{messageType:null==this.keyStatuses.g?"license-request":"license-renewal",message:e.message.buffer}))},i.Eg=function(e){Y.debug("PatchedMediaKeysApple.onWebkitKeyAdded_",e),this.i&&(dc(this,"usable"),this.i.resolve(),this.i=null)},i.Fg=function(e){if(Y.debug("PatchedMediaKeysApple.onWebkitKeyError_",e),(e=Error("EME PatchedMediaKeysApple key error")).errorCode=this.h.error,null!=this.g)this.g.reject(e),this.g=null;else if(null!=this.i)this.i.reject(e),this.i=null;else switch(this.h.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:dc(this,"output-not-allowed");break;default:dc(this,"internal-error")}},(i=pc.prototype).forEach=function(e){this.g&&e(this.g,Zu)},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=Zu;return!(!this.g||!xe.Ha(new Uint8Array(e),new Uint8Array(t)))},i.entries=function(){},i.keys=function(){},i.values=function(){},nc((function(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(Y.info("Using Apple-prefixed EME"),Zu=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=uc,e.MediaKeys=cc,e.MediaKeySystemAccess=sc,navigator.requestMediaKeySystemAccess=ac)})),mc.prototype.createMediaKeys=function(){Y.debug("PatchedMediaKeysMs.MediaKeySystemAccess.createMediaKeys");var e=new yc(this.keySystem);return Promise.resolve(e)},mc.prototype.getConfiguration=function(){return Y.debug("PatchedMediaKeysMs.MediaKeySystemAccess.getConfiguration"),this.g},yc.prototype.createSession=function(e){if(Y.debug("PatchedMediaKeysMs.MediaKeys.createSession"),"temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new wc(this.h)},yc.prototype.setServerCertificate=function(){return Y.debug("PatchedMediaKeysMs.MediaKeys.setServerCertificate"),Promise.resolve(!1)},q(wc,Be),(i=wc.prototype).generateRequest=function(e,t){Y.debug("PatchedMediaKeysMs.MediaKeySession.generateRequest"),this.g=new me;try{this.i=this.l.createSession("video/mp4",new Uint8Array(t),null),this.j.H(this.i,"mskeymessage",this.dg.bind(this)),this.j.H(this.i,"mskeyadded",this.bg.bind(this)),this.j.H(this.i,"mskeyerror",this.cg.bind(this)),Sc(this,"status-pending")}catch(n){this.g.reject(n)}return this.g},i.load=function(){return Y.debug("PatchedMediaKeysMs.MediaKeySession.load"),Promise.reject(Error("MediaKeySession.load not yet supported"))},i.update=function(e){Y.debug("PatchedMediaKeysMs.MediaKeySession.update"),this.h=new me;try{this.i.update(new Uint8Array(e))}catch(t){this.h.reject(t)}return this.h},i.close=function(){Y.debug("PatchedMediaKeysMs.MediaKeySession.close");try{this.i.close(),this.closed.resolve(),this.j.nb()}catch(u){this.closed.reject(u)}return this.closed},i.remove=function(){return Y.debug("PatchedMediaKeysMs.MediaKeySession.remove"),Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},i.dg=function(e){Y.debug("PatchedMediaKeysMs.onMsKeyMessage_",e),this.g&&(this.g.resolve(),this.g=null),this.dispatchEvent(new _e("message",{messageType:null==this.keyStatuses.g?"license-request":"license-renewal",message:e.message.buffer}))},i.bg=function(e){Y.debug("PatchedMediaKeysMs.onMsKeyAdded_",e),this.g?(Y.debug("Simulating completion for a PR persistent license."),Sc(this,"usable"),this.g.resolve(),this.g=null):this.h&&(Sc(this,"usable"),this.h.resolve(),this.h=null)},i.cg=function(e){if(Y.debug("PatchedMediaKeysMs.onMsKeyError_",e),(e=Error("EME PatchedMediaKeysMs key error")).errorCode=this.i.error,null!=this.g)this.g.reject(e),this.g=null;else if(null!=this.h)this.h.reject(e),this.h=null;else switch(this.i.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:Sc(this,"output-not-allowed");break;default:Sc(this,"internal-error")}},(i=Ec.prototype).forEach=function(e){this.g&&e(this.g,ec)},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=ec;return!(!this.g||!xe.Ha(new Uint8Array(e),new Uint8Array(t)))},i.entries=function(){},i.keys=function(){},i.values=function(){},nc((function(){!e.HTMLVideoElement||!e.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(Y.info("Using ms-prefixed EME v20140218"),ec=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=vc,e.MediaKeys=yc,e.MediaKeySystemAccess=mc,navigator.requestMediaKeySystemAccess=gc)})),kc.prototype.createSession=function(){},kc.prototype.setServerCertificate=function(){},Ic.prototype.getConfiguration=function(){},Ic.prototype.createMediaKeys=function(){},nc((function(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(Y.info("EME not available."),navigator.requestMediaKeySystemAccess=xc,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ac,e.MediaKeys=kc,e.MediaKeySystemAccess=Ic)}),-10);var Mc,Pc="";function Rc(e){return Pc?Pc+e.charAt(0).toUpperCase()+e.slice(1):e}function Cc(e,t){Y.debug("PatchedMediaKeysWebkit.requestMediaKeySystemAccess");try{var n=new jc(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function Nc(e){Y.debug("PatchedMediaKeysWebkit.setMediaKeys");var t=this.mediaKeys;return t&&t!=e&&Oc(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&Oc(e,this),Promise.resolve()}function jc(e,t){Y.debug("PatchedMediaKeysWebkit.MediaKeySystemAccess"),this.g=this.keySystem=e;var n=!1;"org.w3.clearkey"==e&&(this.g="webkit-org.w3.clearkey",n=!1);var r=!1,i=document.getElementsByTagName("video");i=i.length?i[0]:document.createElement("video");for(var o=0;o<t.length;++o){var a=t[o],s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:a.initDataTypes,sessionTypes:["temporary"],label:a.label},u=!1;if(a.audioCapabilities)for(var c=0;c<a.audioCapabilities.length;++c){var l=a.audioCapabilities[c];if(l.contentType){u=!0;var f=l.contentType.split(";")[0];i.canPlayType(f,this.g)&&(s.audioCapabilities.push(l),r=!0)}}if(a.videoCapabilities)for(c=0;c<a.videoCapabilities.length;++c)(l=a.videoCapabilities[c]).contentType&&(u=!0,i.canPlayType(l.contentType,this.g)&&(s.videoCapabilities.push(l),r=!0));if(u||(r=i.canPlayType("video/mp4",this.g)||i.canPlayType("video/webm",this.g)),"required"==a.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):r=!1),r)return void(this.h=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(n="None of the requested configurations were supported."),(n=Error(n)).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function Dc(e){Y.debug("PatchedMediaKeysWebkit.MediaKeys"),this.l=e,this.h=null,this.g=new tt,this.i=[],this.j={}}function Oc(e,t){e.h=t,e.g.nb();var n=Pc;t&&(e.g.H(t,n+"needkey",e.hg.bind(e)),e.g.H(t,n+"keymessage",e.Jg.bind(e)),e.g.H(t,n+"keyadded",e.Hg.bind(e)),e.g.H(t,n+"keyerror",e.Ig.bind(e)))}function Lc(e,t){var n=e.j[t];return n?(Y.debug("PatchedMediaKeysWebkit.MediaKeys.findSession_",n),n):(n=e.i.shift())?(n.sessionId=t,e.j[t]=n,Y.debug("PatchedMediaKeysWebkit.MediaKeys.findSession_",n),n):null}function Uc(e,t,n){Y.debug("PatchedMediaKeysWebkit.MediaKeySession"),Be.call(this),this.j=e,this.m=!1,this.g=this.h=null,this.i=t,this.l=n,this.sessionId="",this.expiration=NaN,this.closed=new me,this.keyStatuses=new Bc}function _c(e,t,n){if(e.m)return Promise.reject(Error("The session is already initialized."));e.m=!0;try{if("persistent-license"==e.l)if(n)var r=new Uint8Array(we("LOAD_SESSION|"+n));else{var i=we("PERSISTENT|"),o=new Uint8Array(i.byteLength+t.byteLength);o.set(new Uint8Array(i),0),o.set(new Uint8Array(t),i.byteLength),r=o}else r=new Uint8Array(t)}catch(s){return Promise.reject(s)}e.h=new me;var a=Rc("generateKeyRequest");try{e.j[a](e.i,r)}catch(s){if("InvalidStateError"!=s.name)return e.h=null,Promise.reject(s);new Pe((function(){try{e.j[a](e.i,r)}catch(t){e.h.reject(t),e.h=null}})).V(.01)}return e.h}function Kc(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,e.dispatchEvent(new _e("keystatuseschange"))}function Bc(){this.size=0,this.g=void 0}function Fc(e){if("picture-in-picture"==(e=e.target).webkitPresentationMode){document.pictureInPictureElement=e;var t=new Event("enterpictureinpicture");e.dispatchEvent(t)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),t=new Event("leavepictureinpicture"),e.dispatchEvent(t)}function Vc(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function Hc(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function qc(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function zc(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function Gc(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function Wc(t,n,r){return new e.TextTrackCue(t,n,r)}function Xc(t,n,r){return new e.TextTrackCue(t+"-"+n+"-"+r,t,n,r)}function Yc(){}jc.prototype.createMediaKeys=function(){Y.debug("PatchedMediaKeysWebkit.MediaKeySystemAccess.createMediaKeys");var e=new Dc(this.g);return Promise.resolve(e)},jc.prototype.getConfiguration=function(){return Y.debug("PatchedMediaKeysWebkit.MediaKeySystemAccess.getConfiguration"),this.h},(i=Dc.prototype).createSession=function(e){if(Y.debug("PatchedMediaKeysWebkit.MediaKeys.createSession"),"temporary"!=(e=e||"temporary")&&"persistent-license"!=e)throw new TypeError("Session type "+e+" is unsupported on this platform.");var t=this.h||document.createElement("video");return t.src||(t.src="about:blank"),e=new Uc(t,this.l,e),this.i.push(e),e},i.setServerCertificate=function(){return Y.debug("PatchedMediaKeysWebkit.MediaKeys.setServerCertificate"),Promise.resolve(!1)},i.hg=function(e){Y.debug("PatchedMediaKeysWebkit.onWebkitNeedKey_",e);var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="cenc",e.initData instanceof ArrayBuffer?t.initData=e.initData:t.initData=e.initData.buffer,this.h.dispatchEvent(t)},i.Jg=function(e){Y.debug("PatchedMediaKeysWebkit.onWebkitKeyMessage_",e);var t=Lc(this,e.sessionId);t?(e=new _e("message",{messageType:null==t.keyStatuses.g?"licenserequest":"licenserenewal",message:e.message}),Y.debug("PatchedMediaKeysWebkit.MediaKeySession.generated"),t.h&&(t.h.resolve(),t.h=null),t.dispatchEvent(e)):Y.error("Session not found",e.sessionId)},i.Hg=function(e){Y.debug("PatchedMediaKeysWebkit.onWebkitKeyAdded_",e),(e=Lc(this,e.sessionId))&&(Y.debug("PatchedMediaKeysWebkit.MediaKeySession.ready"),Kc(e,"usable"),e.g&&e.g.resolve(),e.g=null)},i.Ig=function(e){Y.debug("PatchedMediaKeysWebkit.onWebkitKeyError_",e);var t=Lc(this,e.sessionId);t&&t.handleError(e)},q(Uc,Be),(i=Uc.prototype).handleError=function(e){Y.debug("PatchedMediaKeysWebkit.MediaKeySession.handleError",e);var t=Error("EME v0.1b key error"),n=e.errorCode;n.systemCode=e.systemCode,t.errorCode=n,!e.sessionId&&this.h?(45==e.systemCode&&(t.message="Unsupported session type."),this.h.reject(t),this.h=null):e.sessionId&&this.g?(this.g.reject(t),this.g=null):(t=e.systemCode,e.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Kc(this,"output-restricted"):Kc(this,1==t?"expired":"internal-error"))},i.Qd=function(e,t){if(this.g)this.g.then(this.Qd.bind(this,e,t)).catch(this.Qd.bind(this,e,t));else{if(this.g=e,"webkit-org.w3.clearkey"==this.i){var n=ve(t),r=JSON.parse(n);"oct"!=r.keys[0].kty&&(this.g.reject(Error("Response is not a valid JSON Web Key Set.")),this.g=null),n=xe.Ja(r.keys[0].k),r=xe.Ja(r.keys[0].kid)}else n=new Uint8Array(t),r=null;var i=Rc("addKey");try{this.j[i](this.i,n,r,this.sessionId)}catch(o){this.g.reject(o),this.g=null}}},i.generateRequest=function(e,t){return Y.debug("PatchedMediaKeysWebkit.MediaKeySession.generateRequest"),_c(this,t,null)},i.load=function(e){return Y.debug("PatchedMediaKeysWebkit.MediaKeySession.load"),"persistent-license"==this.l?_c(this,null,e):Promise.reject(Error("Not a persistent session."))},i.update=function(e){Y.debug("PatchedMediaKeysWebkit.MediaKeySession.update",e);var t=new me;return this.Qd(t,e),t},i.close=function(){if(Y.debug("PatchedMediaKeysWebkit.MediaKeySession.close"),"persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=Rc("cancelKeyRequest");try{this.j[e](this.i,this.sessionId)}catch(t){}}return this.closed.resolve(),this.closed},i.remove=function(){return Y.debug("PatchedMediaKeysWebkit.MediaKeySession.remove"),"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()},(i=Bc.prototype).forEach=function(e){this.g&&e(this.g,Mc)},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=Mc;return!(!this.g||!xe.Ha(new Uint8Array(e),new Uint8Array(t)))},i.entries=function(){},i.keys=function(){},i.values=function(){},nc((function(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)Y.info("Using webkit-prefixed EME v0.1b"),Pc="webkit";else{if(!HTMLMediaElement.prototype.generateKeyRequest)return;Y.info("Using nonprefixed EME v0.1b")}Mc=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=Cc,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Nc,e.MediaKeys=Dc,e.MediaKeySystemAccess=jc}})),nc((function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(Y.debug("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=Vc,Object.defineProperty(t,"disablePictureInPicture",{get:qc,set:zc,enumerable:!0,configurable:!0}),document.exitPictureInPicture=Hc,document.addEventListener("webkitpresentationmodechanged",Fc,!0))}})),nc((function(){if(Y.debug("VideoPlayPromise.install"),e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}})),nc((function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in t&&(t.getVideoPlaybackQuality=Gc)}})),nc((function(){if(e.VTTCue)Y.info("Using native VTTCue.");else if(e.TextTrackCue){var t=TextTrackCue.length;if(3==t)Y.info("Using VTTCue polyfill from 3 argument TextTrackCue."),e.VTTCue=Wc;else if(6==t)Y.info("Using VTTCue polyfill from 6 argument TextTrackCue."),e.VTTCue=Xc;else{try{var n=!!Wc(1,2,"")}catch(r){n=!1}n&&(Y.info("Using VTTCue polyfill from 3 argument TextTrackCue."),e.VTTCue=Wc)}}else Y.error("VTTCue not available.")})),H("shaka.text.TtmlTextParser",Yc),Yc.prototype.parseInit=function(){},Yc.prototype.parseInit=Yc.prototype.parseInit,Yc.prototype.parseMedia=function(e,t){var n=ve(e),r=[],i=new DOMParser,o=null;if(""==n)return r;try{o=i.parseFromString(n,"text/xml")}catch(w){throw new $(2,2,2005,"Failed to parse TTML.")}if(o){if(n=o.getElementsByTagName("parsererror")[0])throw new $(2,2,2005,n.textContent);if(!(i=o.getElementsByTagName("tt")[0]))throw new $(2,2,2005,"TTML does not contain <tt> tag.");var a=Gr.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","frameRate"),s=Gr.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),u=Gr.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),c=Gr.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","tickRate");if(o=i.getAttribute("xml:space")||"default",n=Gr.getAttributeNS(i,"http://www.w3.org/ns/ttml#styling","extent"),"default"!=o&&"preserve"!=o)throw new $(2,2,2005,"Invalid xml:space value: "+o);o="default"==o,a=new Tl(a,s,u,c),s=cl(i.getElementsByTagName("metadata")[0]),u=cl(i.getElementsByTagName("styling")[0]),c=cl(i.getElementsByTagName("layout")[0]);for(var l=[],f=0;f<c.length;f++){var h,p,g=c[f],m=u,v=n,y=new dn,b=g.getAttribute("xml:id");b?(y.id=b,b=null,v&&(b=Qc.exec(v)||el.exec(v)),v=b?Number(b[1]):null,b=b?Number(b[2]):null,(h=gl(g,m,"extent"))&&null!=(h=(p=Qc.exec(h))||el.exec(h))&&(y.width=null!=v?100*Number(h[1])/v:Number(h[1]),y.height=null!=b?100*Number(h[2])/b:Number(h[2]),y.widthUnits=p||null!=v?pn:0,y.heightUnits=p||null!=b?pn:0),(g=gl(g,m,"origin"))&&null!=(h=(p=Qc.exec(g))||el.exec(g))&&(y.viewportAnchorX=null!=v?100*Number(h[1])/v:Number(h[1]),y.viewportAnchorY=null!=b?100*Number(h[2])/b:Number(h[2]),y.viewportAnchorUnits=p||null!=v?pn:0)):(Y.v("TtmlTextParser parser encountered a region with no id. Region will be ignored."),y=null),y&&l.push(y)}for(n=ll(i.getElementsByTagName("body")[0]),i=(n=d(n)).next();!i.done;i=n.next())(i=hl(i.value,t.periodStart,a,s,u,c,l,o,!1))&&r.push(i)}return r},Yc.prototype.parseMedia=Yc.prototype.parseMedia;var $c,Jc,Qc=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Zc=/^(\d+px|\d+em)$/,el=/^(\d+)px (\d+)px$/,tl=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,nl=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,rl=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,il=/^(\d*(?:\.\d*)?)f$/,ol=/^(\d*(?:\.\d*)?)t$/,al=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,sl={left:un,center:"center",right:"end",start:un,end:"end"},ul={left:"line-left",center:"center",right:"line-right"};function cl(e){var t=[];if(!e)return t;for(var n=d(e.childNodes),r=n.next();!r.done;r=n.next())(r=r.value).nodeType==Node.ELEMENT_NODE&&"br"!==r.nodeName&&(r=cl(r),t=t.concat(r));return t.length||t.push(e),t}function ll(e){if(!e)return[];for(var t=[],n=(e=d(e.childNodes)).next();!n.done;n=e.next())(n=n.value)instanceof Element&&(n.hasAttribute("begin")?t.push(n):t=t.concat(ll(n)));return t}function fl(e,t){for(var n="",r=d(e.childNodes),i=r.next();!i.done;i=r.next())"br"==(i=i.value).nodeName&&e.childNodes[0]!==i?n+="\n":i.childNodes&&0<i.childNodes.length?n+=fl(i,t):n+=t?i=(i=i.textContent.trim()).replace(/\s+/g," "):i.textContent;return n}function hl(e,t,n,r,i,o,a,s,u){if(u&&"br"==e.nodeName)return(e=new Qt(0,0,"")).spacer=!0,e;var c=/^[\s\n]*$/.test(e.textContent),l=e.nodeType==Node.ELEMENT_NODE&&!e.hasAttribute("begin")&&!e.hasAttribute("end");if(e.nodeType!=Node.ELEMENT_NODE||l&&c||l&&!u)return null;s="default"==(e.getAttribute("xml:space")||(s?"default":"preserve")),c=bl(e.getAttribute("begin"),n),l=bl(e.getAttribute("end"),n);var f=bl(e.getAttribute("dur"),n);if(null==l&&null!=f&&(l=c+f),!u&&(null==c||null==l))throw new $(2,2,2001);if(c=u&&null==c?0:c+t,l=u&&null==l?0:l+t,f="",u=[],Array.from(e.childNodes).find((function(e){return e.nodeType===Node.TEXT_NODE&&/\S+/.test(e.textContent)})))f=fl(e,s);else for(var h=d(e.childNodes),p=h.next();!p.done;p=h.next())(p=hl(p.value,t,n,r,i,o,a,s,!0))&&(p.startTime=p.startTime||c,p.endTime=p.endTime||l,u.push(p));if((t=new Qt(c,l,f)).nestedCues=u,(o=yl(e,"region",o,"")[0])&&o.getAttribute("xml:id")){var g=o.getAttribute("xml:id");t.region=a.filter((function(e){return e.id==g}))[0]}return function(e,t,n,r,i){"rtl"==pl(t,n,i,"direction")&&(e.direction="rtl");var o=pl(t,n,i,"writingMode");if("tb"==o||"tblr"==o?e.writingMode="vertical-lr":"tbrl"==o?e.writingMode="vertical-rl":"rltb"==o||"rl"==o?e.direction="rtl":o&&(e.direction=on),(o=pl(t,n,i,"textAlign"))?(e.positionAlign=ul[o],e.lineAlign=sl[o],e.textAlign=tn[o.toUpperCase()]):e.textAlign="start",(o=pl(t,n,i,"displayAlign"))&&(e.displayAlign=rn[o.toUpperCase()]),(o=pl(t,n,i,"color"))&&(e.color=o),(o=pl(t,n,i,"backgroundColor"))&&(e.backgroundColor=o),(o=pl(t,n,i,"fontFamily"))&&(e.fontFamily=o),(o=pl(t,n,i,"fontWeight"))&&"bold"==o&&(e.fontWeight=700),(o=pl(t,n,i,"wrapOption"))&&"noWrap"==o&&(e.wrapLine=!1),(o=pl(t,n,i,"lineHeight"))&&o.match(Zc)&&(e.lineHeight=o),(o=pl(t,n,i,"fontSize"))&&o.match(Zc)&&(e.fontSize=o),(o=pl(t,n,i,"fontStyle"))&&(e.fontStyle=hn[o.toUpperCase()]),r){o=r.getAttribute("imageType")||r.getAttribute("imagetype");var a=r.getAttribute("encoding");r=r.textContent.trim(),"PNG"==o&&"Base64"==a&&r&&(e.backgroundImage="data:image/png;base64,"+r)}(n=gl(n,i,"textDecoration"))&&dl(e,n),(t=ml(t,i,"textDecoration"))&&dl(e,t)}(t,e,o,r=yl(e,"backgroundImage",r,"#","http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt")[0],i),t}function dl(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)switch(n[r]){case"underline":e.textDecoration.includes("underline")||e.textDecoration.push("underline");break;case"noUnderline":e.textDecoration.includes("underline")&&He(e.textDecoration,"underline");break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&He(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&He(e.textDecoration,"overline")}}function pl(e,t,n,r){return(e=ml(e,n,r))?e:gl(t,n,r)}function gl(e,t,n){if(!e)return null;for(var r=cl(e),i=0;i<r.length;i++){var o=Gr.getAttributeNS(r[i],"http://www.w3.org/ns/ttml#styling",n);if(o)return o}return vl(e,t,n)}function ml(e,t,n){var r=Gr.getAttributeNS(e,"http://www.w3.org/ns/ttml#styling",n);return r||vl(e,t,n)}function vl(e,t,n){e=yl(e,"style",t,"");for(var r=null,i=0;i<e.length;i++){var o=Gr.getAttributeNS(e[i],"http://www.w3.org/ns/ttml#styling",n);o||(o=ml(e[i],t,n)),o&&(r=o)}return r}function yl(e,t,n,r,i){var o=[];if(!e||1>n.length)return o;var a=e;for(e=null;a&&!(e=i?Gr.getAttributeNS(a,i,t):a.getAttribute(t))&&(a=a.parentNode)instanceof Element;);if(t=e)for(i=(t=d(t=t.split(" "))).next();!i.done;i=t.next())for(i=i.value,a=(e=d(n)).next();!a.done;a=e.next())if(r+(a=a.value).getAttribute("xml:id")==i){o.push(a);break}return o}function bl(e,t){var n=null;if(tl.test(e)){n=tl.exec(e);var r=Number(n[1]),i=Number(n[2]),o=Number(n[3]),a=Number(n[4]);n=(o+=(a+=(Number(n[5])||0)/t.h)/t.frameRate)+60*i+3600*r}else nl.test(e)?n=wl(nl,e):rl.test(e)?n=wl(rl,e):il.test(e)?(n=il.exec(e),n=Number(n[1])/t.frameRate):ol.test(e)?(n=ol.exec(e),n=Number(n[1])/t.g):al.test(e)&&(n=wl(al,e));return n}function wl(e,t){var n=e.exec(t);return null==n||""==n[0]?null:(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0)}function Tl(e,t,n,r){this.frameRate=Number(e)||30,this.h=Number(t)||1,this.g=Number(r),0==this.g&&(this.g=e?this.frameRate*this.h:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=Number(e[1])/Number(e[2]))}function Sl(){this.g=new Yc}function El(){}function xl(e,t,n){var r;if(r=/^align:(start|middle|center|end|left|right)$/.exec(t))t=r[1],e.textAlign="middle"==t?en:tn[t.toUpperCase()];else if(r=/^vertical:(lr|rl)$/.exec(t))e.writingMode="lr"==r[1]?"vertical-lr":"vertical-rl";else if(r=/^size:([\d.]+)%$/.exec(t))e.size=Number(r[1]);else if(r=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))e.position=Number(r[1]),r[2]&&(t=r[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center");else{if(!(r=/^region:(.*)$/.exec(t))){e:{if(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))e.lineInterpretation=1,e.line=Number(n[1]),n[2]&&(e.lineAlign=cn[n[2].toUpperCase()]);else{if(!(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))){e=!1;break e}e.lineInterpretation=sn,e.line=Number(n[1]),n[2]&&(e.lineAlign=cn[n[2].toUpperCase()])}e=!0}return e}(t=function(e,t){var n=e.filter((function(e){return e.id==t}));return n.length?n[0]:(Y.v("VTT parser could not find a region with id: ",t," The region will be ignored."),null)}(n,r[1]))&&(e.region=t)}return!0}function Al(e){if(null==(e=Vi(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:Number(e[4])/1e3+n+60*t+3600*(Number(e[1])||0)}function kl(){this.g=null}function Il(e,t,n){var r,i,o;return(new _r).box("payl",Fr((function(e){r=ve(e)}))).box("iden",Fr((function(e){i=ve(e)}))).box("sttg",Fr((function(e){o=ve(e)}))).parse(e),r?function(e,t,n,r,i){if(e=new Qt(r,i,e),t&&(e.id=t),n)for(t=new Bi(n),n=Hi(t);n;)xl(e,n,[])||Y.v("VTT parser encountered an invalid VTT setting: ",n," The setting will be ignored."),Fi(t),n=Hi(t);return e}(r,i,o,t,n):null}function Ml(){}function Pl(){$c?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?($c=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=Rl):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function Rl(e,t){var n=this;return g((function r(){var i;return U(r,(function(r){switch(r.s){case 1:return console.assert(n==navigator,'bad "this" for requestMediaKeySystemAccess'),A(r,$c.call(n,e,t),2);case 2:return Kl(i=r.B)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=$c,r.return(i)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=Cl,r.return(Cl.call(n,e,t)))}}))}))}function Cl(e,t){var n=this;return g((function r(){var i,o,a,s,u,c,l,f;return U(r,(function(r){switch(r.s){case 1:console.assert(n==navigator,'bad "this" for requestMediaKeySystemAccess'),i=_l(e),o=[];for(var h=d(t),p=h.next();!p.done;p=h.next())a=p.value,s=Nl(a.videoCapabilities,i),u=Nl(a.audioCapabilities,i),a.videoCapabilities&&a.videoCapabilities.length&&!s.length||a.audioCapabilities&&a.audioCapabilities.length&&!u.length||((c=Object.assign({},a)).videoCapabilities=s,c.audioCapabilities=u,o.push(c));if(!o.length)throw(l=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",l.code=DOMException.NOT_SUPPORTED_ERR,l;return A(r,$c.call(n,e,o),2);case 2:return f=r.B,r.return(new Ul(f,i))}}))}))}function Nl(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function jl(){}function Dl(){Jc?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(Jc=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=Ol):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function Ol(e){var t=this;return g((function n(){var r,i;return U(n,(function(n){switch(n.s){case 1:return console.assert(t==navigator.mediaCapabilities,'bad "this" for decodingInfo'),A(n,Jc.call(t,e),2);case 2:return r=n.B,e.keySystemConfiguration?(i=r.keySystemAccess)&&Kl(i)?(console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=Jc,n.return(r)):(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=Ll,n.return(Ll.call(t,e))):n.return(r)}}))}))}function Ll(e){var t=this;return g((function n(){var r,i,o,a,s,u,c,l,f;return U(n,(function(n){switch(n.s){case 1:return console.assert(t==navigator.mediaCapabilities,'bad "this" for decodingInfo'),r=null,e.keySystemConfiguration&&(i=e.keySystemConfiguration,o=i.keySystem,a=i.audio&&i.audio.encryptionScheme,s=i.video&&i.video.encryptionScheme,r=_l(o),u={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},a&&a!=r||s&&s!=r)?n.return(u):A(n,Jc.call(t,e),2);case 2:if((c=n.B).keySystemAccess){c.keySystemAccess=new Ul(c.keySystemAccess,r),n.I(3);break}if(!e.keySystemConfiguration){n.I(3);break}var h=e.keySystemConfiguration,d=[],p=[];return h.audio&&d.push({robustness:h.audio.robustness||"",contentType:e.audio.contentType}),h.video&&p.push({robustness:h.video.robustness||"",contentType:e.video.contentType}),h={initDataTypes:h.initDataType?[h.initDataType]:[],distinctiveIdentifier:h.distinctiveIdentifier,persistentState:h.persistentState,sessionTypes:h.sessionTypes},d.length&&(h.audioCapabilities=d),p.length&&(h.videoCapabilities=p),l=h,f=c,A(n,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[l]),5);case 5:f.keySystemAccess=n.B;case 3:return n.return(c)}}))}))}function Ul(e,t){this.h=e,this.g=t,this.keySystem=e.keySystem}function _l(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function Kl(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function Bl(){}function Fl(){Pl(),Dl()}vn["application/ttml+xml"]=Yc,H("shaka.text.Mp4TtmlParser",Sl),Sl.prototype.parseInit=function(e){var t=!1;if((new _r).box("moov",Kr).box("trak",Kr).box("mdia",Kr).box("minf",Kr).box("stbl",Kr).ma("stsd",Br).box("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new $(2,2,2007)},Sl.prototype.parseInit=Sl.prototype.parseInit,Sl.prototype.parseMedia=function(e,t){var n=!1,r=[];if((new _r).box("mdat",Fr(function(e){n=!0,r=r.concat(this.g.parseMedia(e,t))}.bind(this))).parse(e),!n)throw new $(2,2,2007);return r},Sl.prototype.parseMedia=Sl.prototype.parseMedia,vn['application/mp4; codecs="stpp"']=Sl,vn['application/mp4; codecs="stpp.ttml.im1t"']=Sl,vn['application/mp4; codecs="stpp.TTML.im1t"']=Sl,H("shaka.text.VttTextParser",El),El.prototype.parseInit=function(){},El.prototype.parseInit=El.prototype.parseInit,El.prototype.parseMedia=function(e,t){var n=ve(e);if(n=(n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m),!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new $(2,2,2e3);var r=t.segmentStart;if(null==r&&(r=0,n[0].includes("X-TIMESTAMP-MAP"))){var i=n[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),o=n[0].match(/MPEGTS:(\d+)/m);if(i&&o){if(null==(r=Al(new Bi(i[1]))))throw new $(2,2,2e3);r=t.periodStart+(Number(o[1])/9e4-r)}}o=[];var a=n[0].split("\n");for(i=1;i<a.length;i++)if(/^Region:/.test(a[i])){var s=new Bi(a[i]),u=new dn;Hi(s),Fi(s);for(var c=Hi(s);c;){var l;e:{var f=u,h=c;if(l=/^id=(.*)$/.exec(h))f.id=l[1];else if(l=/^width=(\d{1,2}|100)%$/.exec(h))f.width=Number(l[1]);else if(l=/^lines=(\d+)$/.exec(h))f.height=Number(l[1]),f.heightUnits=2;else if(l=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))f.regionAnchorX=Number(l[1]),f.regionAnchorY=Number(l[2]);else if(l=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))f.viewportAnchorX=Number(l[1]),f.viewportAnchorY=Number(l[2]);else{if(!/^scroll=up$/.exec(h)){l=!1;break e}f.scroll="up"}l=!0}l||Y.v("VTT parser encountered an invalid VTTRegion setting: ",c," The setting will be ignored."),Fi(s),c=Hi(s)}o.push(u)}for(i=[],s=1;s<n.length;s++){if(l=a=n[s].split("\n"),f=r,a=o,1==l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||"STYLE"==l[0])a=null;else{u=null,l[0].includes("--\x3e")||(u=l[0],l.splice(0,1)),h=Al(c=new Bi(l[0]));var d=Vi(c,/[ \t]+--\x3e[ \t]+/g),p=Al(c);if(null==h||null==d||null==p)throw new $(2,2,2001);for(l=new Qt(h+f,p+f,l.slice(1).join("\n").trim()),Fi(c),f=Hi(c);f;)xl(l,f,a)||Y.v("VTT parser encountered an invalid VTT setting: ",f," The setting will be ignored."),Fi(c),f=Hi(c);null!=u&&(l.id=u),a=l}a&&i.push(a)}return i},El.prototype.parseMedia=El.prototype.parseMedia,vn["text/vtt"]=El,vn['text/vtt; codecs="vtt"']=El,vn['text/vtt; codecs="wvtt"']=El,H("shaka.text.Mp4VttParser",kl),kl.prototype.parseInit=function(e){var t=!1;if((new _r).box("moov",Kr).box("trak",Kr).box("mdia",Kr).ma("mdhd",function(e){0==e.version?(e.reader.U(4),e.reader.U(4),this.g=e.reader.N(),e.reader.U(4)):(e.reader.U(8),e.reader.U(8),this.g=e.reader.N(),e.reader.U(8)),e.reader.U(4)}.bind(this)).box("minf",Kr).box("stbl",Kr).ma("stsd",Br).box("wvtt",(function(){t=!0})).parse(e),!this.g)throw new $(2,2,2008);if(!t)throw new $(2,2,2008)},kl.prototype.parseInit=kl.prototype.parseInit,kl.prototype.parseMedia=function(e,t){var n=this;if(!this.g)throw Y.error("No init segment for MP4+VTT!"),new $(2,2,2008);var r,i=0,o=[],a=[],s=!1,u=!1,c=!1,l=null;if((new _r).box("moof",Kr).box("traf",Kr).ma("tfdt",(function(e){s=!0,i=0==e.version?e.reader.N():e.reader.Pb()})).ma("tfhd",(function(e){var t=e.flags;(e=e.reader).U(4),1&t&&e.U(8),2&t&&e.U(4),l=8&t?e.N():null})).ma("trun",(function(e){u=!0;var t=e.version,n=e.flags,r=(e=e.reader).N();1&n&&e.U(4),4&n&&e.U(4);for(var i=[],a=0;a<r;a++){var s={duration:null,sampleSize:null,Sd:null};256&n&&(s.duration=e.N()),512&n&&(s.sampleSize=e.N()),1024&n&&e.U(4),2048&n&&(s.Sd=0==t?e.N():e.De()),i.push(s)}o=i})).box("mdat",Fr((function(e){c=!0,r=e}))).parse(e),!c&&!s&&!u)throw new $(2,2,2008);var f=i,h=new Or(new DataView(r.buffer,r.byteOffset,r.byteLength),0);return o.forEach((function(e){var r=e.duration||l,o=e.Sd?i+e.Sd:f;f=o+(r||0);var s=0;do{var u=h.N();s+=u;var c=h.N(),d=null;"vttc"==(c=Hr(c))?8<u&&(d=h.mb(u-8)):("vtte"!=c&&Y.error("Unknown box "+c+"! Skipping!"),h.U(u-8)),r?d&&a.push(Il(d,t.periodStart+o/n.g,t.periodStart+f/n.g)):Y.error("WVTT sample duration unknown, and no default found!")}while(e.sampleSize&&s<e.sampleSize)})),a.filter(fe.Ra)},kl.prototype.parseMedia=kl.prototype.parseMedia,vn['application/mp4; codecs="wvtt"']=kl,H("shaka.util.Dom.createHTMLElement",(function(e){return document.createElement(e)})),H("shaka.util.Dom.createVideoElement",(function(){var e=document.createElement("video");return e.muted=!0,e.width=600,e.height=400,e})),H("shaka.util.Dom.asHTMLElement",(function(e){return e})),H("shaka.util.Dom.asHTMLMediaElement",(function(e){return e})),H("shaka.util.Dom.removeAllChildren",(function(e){for(;e.firstChild;)e.removeChild(e.firstChild)})),H("EmeEncryptionSchemePolyfill",Ml),Ml.install=Pl,H("McEncryptionSchemePolyfill",jl),jl.install=Dl,Ul.prototype.getConfiguration=function(){var e=this.h.getConfiguration();if(e.videoCapabilities)for(var t=d(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.g;if(e.audioCapabilities)for(n=(t=d(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.g;return e},Ul.prototype.createMediaKeys=function(){return this.h.createMediaKeys()},H("EncryptionSchemePolyfills",Bl),Bl.install=Fl,void 0!==r&&r.gf&&(r.gf=Bl)}.call(n,e,e,void 0),n.shaka)zx[r]=n.shaka[r]}(),function(t){!function(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&&i(e,t)}(f,t);var r,a,c,l=s(f);function f(e){var t,n,r,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),t=l.call(this,e),n=o(t),i=function(){t.shakaplayer.getVariantTracks().forEach((function(e){if(e.active)for(var t=0;t<this.content.length;++t){var n=this.content[t];n.value===e.id?n.selected=!0:n.selected=!1}}))},(r=u(r="onAdaptation_"))in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,Gx.polyfill.installAll(),t}return r=f,c=[{key:"pluginName",get:function(){return"ShakaPlugin"}},{key:"defaultConfig",get:function(){return{shakaOpts:{}}}},{key:"isSupported",value:function(){return Gx.Player.isBrowserSupported()}}],(a=[{key:"afterCreate",value:function(){var t=this;this.content=[],this.url=this.player.config.url,Gx.Player.isBrowserSupported()&&this.on(e.Events.URL_CHANGE,(function(e){/^blob/.test(e)||(t.url=e,t.loadUrl(e))}))}},{key:"beforePlayerInit",value:function(){if(!Gx.Player.isBrowserSupported())throw new Error("Browser not supported!");this._initShaka()}},{key:"destroy",value:function(){this.shakaplayer&&(this.shakaplayer.destroy(),this.shakaplayer=null)}},{key:"_initShaka",value:function(){var e=this.player;this.shakaplayer=new Gx.Player(e.video),this.shakaplayer.addEventListener("error",(function(e){console.error("Error code",e.detail.code,"object",e.detail)})),this.config.shakaOpts&&this.shakaplayer.configure(this.config.shakaOpts),this.shakaplayer.getNetworkingEngine().registerRequestFilter((function(e,t){e===Gx.net.NetworkingEngine.RequestType.LICENSE&&(t.headers["CWIP-Auth-Header"]="VGhpc0lzQVRlc3QK")})),this.shakaplayer.addEventListener("adaptation",this.onAdaptation_),this.shakaplayer.configure({abr:{enabled:!1}}),this.loadUrl(this.url)}},{key:"loadUrl",value:function(e){var t=this;this.shakaplayer.load(e).then((function(){console.log(" this.onTracksChanged_"),t.onTracksChanged_()})).catch((function(e){console.trace("event",e),console.error("Error code",e.detail.code,"object",e.detail)}))}},{key:"onTracksChanged_",value:function(){this.updateVariantTracks_()}},{key:"updateVariantTracks_",value:function(){var e=this.shakaplayer.getVariantTracks();e.sort((function(e,t){return e.bandwidth-t.bandwidth})),this.updateTrackOptions_(e)}},{key:"updateTrackOptions_",value:function(e){var t=this,n={variant:function(e){var t="";return e.width&&e.height&&(t+=e.height+"P"),t}};this.content=[],e.forEach((function(e){var r={};r.textContent=n[e.type](e),r.track=e,r.value=e.id,r.selected=e.active,t.content.push(r)})),this.updateDefinition()}},{key:"updateDefinition",value:function(){"mobile"!==e.Sniffer.device&&console.log("updateDefinition",this.content)}}])&&n(r.prototype,a),c&&n(r,c),Object.defineProperty(r,"prototype",{writable:!1}),f}(e.BasePlugin)}));
//# sourceMappingURL=index.min.js.map