-1):!1},this.trigger=function(c){var h,d,p,g;if(h=u[c],!!h)if(arguments.length===2)for(p=h.length,d=0;d"u")){for(u in V)V.hasOwnProperty(u)&&(V[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);te=new Uint8Array([105,115,111,109]),ie=new Uint8Array([97,118,99,49]),Xe=new Uint8Array([0,0,0,1]),Te=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Pt=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ii={video:Te,audio:Pt},ni=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ri=new Uint8Array([0,0,0,0,0,0,0,0]),gr=new Uint8Array([0,0,0,0,0,0,0,0]),Bu=gr,Fu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Uu=gr,si=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(u){var c=[],h=0,d,p,g;for(d=1;d>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},m=function(){return o(V.ftyp,te,Xe,te,ie)},U=function(u){return o(V.hdlr,ii[u])},y=function(u){return o(V.mdat,u)},L=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,u.duration&255,85,196,0,0]);return u.samplerate&&(c[12]=u.samplerate>>>24&255,c[13]=u.samplerate>>>16&255,c[14]=u.samplerate>>>8&255,c[15]=u.samplerate&255),o(V.mdhd,c)},R=function(u){return o(V.mdia,L(u),U(u.type),S(u))},T=function(u){return o(V.mfhd,new Uint8Array([0,0,0,0,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255]))},S=function(u){return o(V.minf,u.type==="video"?o(V.vmhd,si):o(V.smhd,ri),l(),J(u))},_=function(u,c){for(var h=[],d=c.length;d--;)h[d]=ue(c[d]);return o.apply(null,[V.moof,T(u)].concat(h))},D=function(u){for(var c=u.length,h=[];c--;)h[c]=I(u[c]);return o.apply(null,[V.moov,k(4294967295)].concat(h).concat(w(u)))},w=function(u){for(var c=u.length,h=[];c--;)h[c]=ee(u[c]);return o.apply(null,[V.mvex].concat(h))},k=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(V.mvhd,c)},q=function(u){var c=u.samples||[],h=new Uint8Array(4+c.length),d,p;for(p=0;p>>8),g.push(d[b].byteLength&255),g=g.concat(Array.prototype.slice.call(d[b]));for(b=0;b>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(x=[V.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(V.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],g,[p.length],v))),o(V.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var C=h.sarRatio[0],P=h.sarRatio[1];x.push(o(V.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255])))}return o.apply(null,x)},c=function(h){return o(V.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),f(h))}}(),M=function(u){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,0,(u.duration&4278190080)>>24,(u.duration&16711680)>>16,(u.duration&65280)>>8,u.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(u.width&65280)>>8,u.width&255,0,0,(u.height&65280)>>8,u.height&255,0,0]);return o(V.tkhd,c)},ue=function(u){var c,h,d,p,g,v,b;return c=o(V.tfhd,new Uint8Array([0,0,0,58,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(u.baseMediaDecodeTime/a),b=Math.floor(u.baseMediaDecodeTime%a),h=o(V.tfdt,new Uint8Array([1,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,u.type==="audio"?(d=de(u,g),o(V.traf,c,h,d)):(p=q(u),d=de(u,p.length+g),o(V.traf,c,h,d,p))},I=function(u){return u.duration=u.duration||4294967295,o(V.trak,M(u),R(u))},ee=function(u){var c=new Uint8Array([0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(c[c.length-1]=0),o(V.trex,c)},function(){var u,c,h;h=function(d,p){var g=0,v=0,b=0,x=0;return d.length&&(d[0].duration!==void 0&&(g=1),d[0].size!==void 0&&(v=2),d[0].flags!==void 0&&(b=4),d[0].compositionTimeOffset!==void 0&&(x=8)),[0,0,g|v|b|x,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(d,p){var g,v,b,x,C,P;for(x=d.samples||[],p+=20+16*x.length,b=h(x,p),v=new Uint8Array(b.length+x.length*16),v.set(b),g=b.length,P=0;P>>24,v[g++]=(C.duration&16711680)>>>16,v[g++]=(C.duration&65280)>>>8,v[g++]=C.duration&255,v[g++]=(C.size&4278190080)>>>24,v[g++]=(C.size&16711680)>>>16,v[g++]=(C.size&65280)>>>8,v[g++]=C.size&255,v[g++]=C.flags.isLeading<<2|C.flags.dependsOn,v[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,v[g++]=C.flags.degradationPriority&61440,v[g++]=C.flags.degradationPriority&15,v[g++]=(C.compositionTimeOffset&4278190080)>>>24,v[g++]=(C.compositionTimeOffset&16711680)>>>16,v[g++]=(C.compositionTimeOffset&65280)>>>8,v[g++]=C.compositionTimeOffset&255;return o(V.trun,v)},u=function(d,p){var g,v,b,x,C,P;for(x=d.samples||[],p+=20+8*x.length,b=h(x,p),g=new Uint8Array(b.length+x.length*8),g.set(b),v=b.length,P=0;P>>24,g[v++]=(C.duration&16711680)>>>16,g[v++]=(C.duration&65280)>>>8,g[v++]=C.duration&255,g[v++]=(C.size&4278190080)>>>24,g[v++]=(C.size&16711680)>>>16,g[v++]=(C.size&65280)>>>8,g[v++]=C.size&255;return o(V.trun,g)},de=function(d,p){return d.type==="audio"?u(d,p):c(d,p)}}();var t_={ftyp:m,mdat:y,moof:_,moov:D,initSegment:function(u){var c=m(),h=D(u),d;return d=new Uint8Array(c.byteLength+h.byteLength),d.set(c),d.set(h,c.byteLength),d}},i_=function(u){var c,h,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,c=0;c1&&(c=u.shift(),u.byteLength-=c.byteLength,u.nalCount-=c.nalCount,u[0][0].dts=c.dts,u[0][0].pts=c.pts,u[0][0].duration+=c.duration),u},n_=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},$u=function(u,c){var h=n_();return h.dataOffset=c,h.compositionTimeOffset=u.pts-u.dts,h.duration=u.duration,h.size=4*u.length,h.size+=u.byteLength,u.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},a_=function(u,c){var h,d,p,g,v,b=c||0,x=[];for(h=0;h_r.ONE_SECOND_IN_TS/2))){for(C=f_()[u.samplerate],C||(C=c[0].data),P=0;P=h?u:(c.minSegmentDts=1/0,u.filter(function(d){return d.dts>=h?(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},y_=function(u){var c,h,d=[];for(c=0;c=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Lt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Lt.prototype.addText=function(u){this.rows[this.rowIdx]+=u},Lt.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var br=function(u,c,h){this.serviceNum=u,this.text="",this.currentWindow=new Lt(-1),this.windows=[],this.stream=h,typeof c=="string"&&this.createTextDecoder(c)};br.prototype.init=function(u,c){this.startPts=u;for(var h=0;h<8;h++)this.windows[h]=new Lt(h),typeof c=="function"&&(this.windows[h].beforeRowOverflow=c)},br.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},br.prototype.createTextDecoder=function(u){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(u)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+c})}};var oe=function(u){u=u||{},oe.prototype.init.call(this);var c=this,h=u.captionServices||{},d={},p;Object.keys(h).forEach(g=>{p=h[g],/^SERVICE/.test(g)&&(d[g]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};oe.prototype=new ua,oe.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},oe.prototype.add708Bytes=function(u){var c=u.ccData,h=c>>>8,d=c&255;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},oe.prototype.push708Packet=function(){var u=this.current708Packet,c=u.data,h=null,d=null,p=0,g=c[p++];for(u.seq=g>>6,u.sizeCode=g&63;p>5,d=g&31,h===7&&d>0&&(g=c[p++],h=g),this.pushServiceBlock(h,p,d),d>0&&(p+=d-1)},oe.prototype.pushServiceBlock=function(u,c,h){var d,p=c,g=this.current708Packet.data,v=this.services[u];for(v||(v=this.initService(u,p));p("0"+(G&255).toString(16)).slice(-2)).join("")}if(p?(O=[b,x],u++):O=[b],c.textDecoder_&&!d)P=c.textDecoder_.decode(new Uint8Array(O));else if(p){const N=$(O);P=String.fromCharCode(parseInt(N,16))}else P=P_(v|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(u)),C.pendingNewLine=!1,C.addText(P),u},oe.prototype.multiByteCharacter=function(u,c){var h=this.current708Packet.data,d=h[u+1],p=h[u+2];return Tr(d)&&Tr(p)&&(u=this.handleText(++u,c,{isMultiByte:!0})),u},oe.prototype.setCurrentWindow=function(u,c){var h=this.current708Packet.data,d=h[u],p=d&7;return c.setCurrentWindow(p),u},oe.prototype.defineWindow=function(u,c){var h=this.current708Packet.data,d=h[u],p=d&7;c.setCurrentWindow(p);var g=c.currentWindow;return d=h[++u],g.visible=(d&32)>>5,g.rowLock=(d&16)>>4,g.columnLock=(d&8)>>3,g.priority=d&7,d=h[++u],g.relativePositioning=(d&128)>>7,g.anchorVertical=d&127,d=h[++u],g.anchorHorizontal=d,d=h[++u],g.anchorPoint=(d&240)>>4,g.rowCount=d&15,d=h[++u],g.columnCount=d&63,d=h[++u],g.windowStyle=(d&56)>>3,g.penStyle=d&7,g.virtualRowCount=g.rowCount+1,u},oe.prototype.setWindowAttributes=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.winAttr;return d=h[++u],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=h[++u],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=h[++u],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=h[++u],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,u},oe.prototype.flushDisplayed=function(u,c){for(var h=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isEmpty()&&h.push(c.windows[d].getText());c.endPts=u,c.text=h.join(`
+
+`),this.pushCaption(c),c.startPts=u},oe.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.text="",u.startPts=u.endPts)},oe.prototype.displayWindows=function(u,c){var h=this.current708Packet.data,d=h[++u],p=this.getPts(u);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<>4,p.offset=(d&12)>>2,p.penSize=d&3,d=h[++u],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,u},oe.prototype.setPenColor=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.penColor;return d=h[++u],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=h[++u],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=h[++u],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,u},oe.prototype.setPenLocation=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=h[++u],p.row=d&15,d=h[++u],p.column=d&63,u},oe.prototype.reset=function(u,c){var h=this.getPts(u);return this.flushDisplayed(h,c),this.initService(c.serviceNum,u)};var L_={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Sr=function(u){return u===null?"":(u=L_[u]||u,String.fromCharCode(u))},xr=14,O_=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ai=function(){for(var u=[],c=xr+1;c--;)u.push({text:"",indent:0,offset:0});return u},fe=function(u,c){fe.prototype.init.call(this),this.field_=u||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var d,p,g,v,b;if(d=h.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),g=d>>>8,v=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=h.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=ai();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ai();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=ai()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(g,v))g=(g&3)<<8,b=Sr(g|v),this[this.mode_](h.pts,b),this.column_++;else if(this.isExtCharacter(g,v))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=Sr(g|v),this[this.mode_](h.pts,b),this.column_++;else if(this.isMidRowCode(g,v))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(v&14)===14&&this.addFormatting(h.pts,["i"]),(v&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(g,v)){const C=v&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,v)){var x=O_.indexOf(d&7968);if(this.mode_==="rollUp"&&(x-this.rollUpRows_+1<0&&(x=this.rollUpRows_-1),this.setRollUp(h.pts,x)),x!==this.row_&&x>=0&&x<=14&&(this.clearFormatting(h.pts),this.row_=x),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const C=(d&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(g)&&(v===0&&(v=null),b=Sr(g),b+=Sr(v),this[this.mode_](h.pts,b),this.column_+=b.length)}};fe.prototype=new ua,fe.prototype.flushDisplayed=function(u){const c=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},h=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{c(p)}d.text.length&&h.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&c(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,content:h,stream:this.name_})},fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ai(),this.nonDisplayed_=ai(),this.lastControlCode_=null,this.column_=0,this.row_=xr,this.rollUpRows_=2,this.formatting_=[]},fe.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},fe.prototype.isSpecialCharacter=function(u,c){return u===this.EXT_&&c>=48&&c<=63},fe.prototype.isExtCharacter=function(u,c){return(u===this.EXT_+1||u===this.EXT_+2)&&c>=32&&c<=63},fe.prototype.isMidRowCode=function(u,c){return u===this.EXT_&&c>=32&&c<=47},fe.prototype.isOffsetControlCode=function(u,c){return u===this.OFFSET_&&c>=33&&c<=35},fe.prototype.isPAC=function(u,c){return u>=this.BASE_&&u=64&&c<=127},fe.prototype.isColorPAC=function(u){return u>=64&&u<=79||u>=96&&u<=127},fe.prototype.isNormalChar=function(u){return u>=32&&u<=127},fe.prototype.setRollUp=function(u,c){if(this.mode_!=="rollUp"&&(this.row_=xr,this.mode_="rollUp",this.flushDisplayed(u),this.nonDisplayed_=ai(),this.displayed_=ai()),c!==void 0&&c!==this.row_)for(var h=0;h"},"");this[this.mode_](u,h)},fe.prototype.clearFormatting=function(u){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(h,d){return h+""+d+">"},"");this.formatting_=[],this[this.mode_](u,c)}},fe.prototype.popOn=function(u,c){var h=this.nonDisplayed_[this.row_].text;h+=c,this.nonDisplayed_[this.row_].text=h},fe.prototype.rollUp=function(u,c){var h=this.displayed_[this.row_].text;h+=c,this.displayed_[this.row_].text=h},fe.prototype.shiftRowsUp_=function(){var u;for(u=0;uc&&(h=-1);Math.abs(c-u)>N_;)u+=h*M_;return u},ca=function(u){var c,h;ca.prototype.init.call(this),this.type_=u||Wu,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Wu&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=la(d.dts,h),d.pts=la(d.pts,h),c=d.dts,this.trigger("data",d))},this.flush=function(){h=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ca.prototype=new R_;var Ku={TimestampRolloverStream:ca,handleRollover:la},B_=(u,c,h)=>{if(!u)return-1;for(var d=h;d";u.data[0]===Ar.Utf8&&(h=Cr(u.data,0,c),!(h<0)&&(u.mimeType=ys(u.data,c,h),c=h+1,u.pictureType=u.data[c],c++,d=Cr(u.data,0,c),!(d<0)&&(u.description=gs(u.data,c,d),c=d+1,u.mimeType===p?u.url=ys(u.data,c,u.data.length):u.pictureData=u.data.subarray(c,u.data.length))))},"T*":function(u){u.data[0]===Ar.Utf8&&(u.value=gs(u.data,1,u.data.length).replace(/\0*$/,""),u.values=u.value.split("\0"))},TXXX:function(u){var c;u.data[0]===Ar.Utf8&&(c=Cr(u.data,0,1),c!==-1&&(u.description=gs(u.data,1,c),u.value=gs(u.data,c+1,u.data.length).replace(/\0*$/,""),u.data=u.value))},"W*":function(u){u.url=ys(u.data,0,u.data.length).replace(/\0.*$/,"")},WXXX:function(u){var c;u.data[0]===Ar.Utf8&&(c=Cr(u.data,0,1),c!==-1&&(u.description=gs(u.data,1,c),u.url=ys(u.data,c+1,u.data.length).replace(/\0.*$/,"")))},PRIV:function(u){var c;for(c=0;c>>2;G*=4,G+=N[7]&3,P.timeStamp=G,b.pts===void 0&&b.dts===void 0&&(b.pts=P.timeStamp,b.dts=P.timeStamp),this.trigger("timestamp",P)}b.frames.push(P),x+=10,x+=C}while(x>>4>1&&(v+=p[v]+1),g.pid===0)g.type="pat",u(p.subarray(v),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",u(p.subarray(v),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,g]):this.processPes_(p,v,g)},this.processPes_=function(p,g,v){v.pid===this.programMapTable.video?v.streamType=lt.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=lt.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(g),this.trigger("data",v)}},Ts.prototype=new da,Ts.STREAM_TYPES={h264:27,adts:15},kr=function(){var u=this,c=!1,h={data:[],size:0},d={data:[],size:0},p={data:[],size:0},g,v=function(x,C){var P;const O=x[0]<<16|x[1]<<8|x[2];C.data=new Uint8Array,O===1&&(C.packetLength=6+(x[4]<<8|x[5]),C.dataAlignmentIndicator=(x[6]&4)!==0,P=x[7],P&192&&(C.pts=(x[9]&14)<<27|(x[10]&255)<<20|(x[11]&254)<<12|(x[12]&255)<<5|(x[13]&254)>>>3,C.pts*=4,C.pts+=(x[13]&6)>>>1,C.dts=C.pts,P&64&&(C.dts=(x[14]&14)<<27|(x[15]&255)<<20|(x[16]&254)<<12|(x[17]&255)<<5|(x[18]&254)>>>3,C.dts*=4,C.dts+=(x[18]&6)>>>1)),C.data=x.subarray(9+x[8]))},b=function(x,C,P){var O=new Uint8Array(x.size),$={type:C},N=0,G=0,z=!1,Ce;if(!(!x.data.length||x.size<9)){for($.trackId=x.data[0].pid,N=0;N>5,x=((c[p+6]&3)+1)*1024,C=x*z_/Ju[(c[p+2]&60)>>>2],c.byteLength-p>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:Ju[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+v,p+g)}),h++,p+=g}typeof P=="number"&&(this.skipWarn_(P,p),P=null),c=c.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},Ir.prototype=new G_;var W_=Ir,Zu;Zu=function(u){var c=u.byteLength,h=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var p=u.byteLength-c,g=new Uint8Array(4),v=Math.min(4,c);if(v===0)throw new Error("no bytes available");g.set(u.subarray(p,p+v)),h=new DataView(g.buffer).getUint32(0),d=v*8,c-=v},this.skipBits=function(p){var g;d>p?(h<<=p,d-=p):(p-=d,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),h<<=p,d-=p)},this.readBits=function(p){var g=Math.min(d,p),v=h>>>32-g;return d-=g,d>0?h<<=g:c>0&&this.loadWord(),g=p-g,g>0?v<>>p)return h<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var K_=Zu,el=t,X_=K_,Pr,bs,tl;bs=function(){var u=0,c,h;bs.prototype.init.call(this),this.push=function(d){var p;h?(p=new Uint8Array(h.byteLength+d.data.byteLength),p.set(h),p.set(d.data,h.byteLength),h=p):h=d.data;for(var g=h.byteLength;u3&&this.trigger("data",h.subarray(u+3)),h=null,u=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},bs.prototype=new el,tl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Pr=function(){var u=new bs,c,h,d,p,g,v,b;Pr.prototype.init.call(this),c=this,this.push=function(x){x.type==="video"&&(h=x.trackId,d=x.pts,p=x.dts,u.push(x))},u.on("data",function(x){var C={trackId:h,pts:d,dts:p,data:x,nalUnitTypeCode:x[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(x.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(x.subarray(1)),C.config=v(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),u.on("done",function(){c.trigger("done")}),u.on("partialdone",function(){c.trigger("partialdone")}),u.on("reset",function(){c.trigger("reset")}),u.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){u.flush()},this.partialFlush=function(){u.partialFlush()},this.reset=function(){u.reset()},this.endTimeline=function(){u.endTimeline()},b=function(x,C){var P=8,O=8,$,N;for($=0;$>4;return h=h>=0?h:0,p?h+20:h+10},sl=function(u,c){return u.length-c<10||u[c]!==73||u[c+1]!==68||u[c+2]!==51?c:(c+=il(u,c),sl(u,c))},J_=function(u){var c=sl(u,0);return u.length>=c+2&&(u[c]&255)===255&&(u[c+1]&240)===240&&(u[c+1]&22)===16},rl=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},Z_=function(u,c,h){var d,p="";for(d=c;d>5,d=u[c+4]<<3,p=u[c+3]&6144;return p|d|h},iv=function(u,c){return u[c]===73&&u[c+1]===68&&u[c+2]===51?"timed-metadata":u[c]&!0&&(u[c+1]&240)===240?"audio":null},sv=function(u){for(var c=0;c+5>>2]}return null},rv=function(u){var c,h,d,p;c=10,u[5]&64&&(c+=4,c+=rl(u.subarray(10,14)));do{if(h=rl(u.subarray(c+4,c+8)),h<1)return null;if(p=String.fromCharCode(u[c],u[c+1],u[c+2],u[c+3]),p==="PRIV"){d=u.subarray(c+10,c+h+10);for(var g=0;g>>2;return x*=4,x+=b[7]&3,x}break}}c+=10,c+=h}while(c=3;){if(u[p]===73&&u[p+1]===68&&u[p+2]===51){if(u.length-p<10||(d=nl.parseId3TagSize(u,p),p+d>u.length))break;v={type:"timed-metadata",data:u.subarray(p,p+d)},this.trigger("data",v),p+=d;continue}else if((u[p]&255)===255&&(u[p+1]&240)===240){if(u.length-p<7||(d=nl.parseAdtsSize(u,p),p+d>u.length))break;b={type:"audio",data:u.subarray(p,p+d),pts:c,dts:c},this.trigger("data",b),p+=d;continue}p++}g=u.length-p,g>0?u=u.subarray(p):u=new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},Lr.prototype=new nv;var av=Lr,ov=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],uv=ov,lv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],cv=lv,Or=t,Ss=t_,xs=c_,Rr=v_,ct=E_,Ot=H_,Mr=he,al=W_,dv=Y_.H264Stream,hv=av,fv=ma.isLikelyAacData,pv=he.ONE_SECOND_IN_TS,ga=uv,ya=cv,Es,Ci,Nr,oi,mv=function(u,c){c.stream=u,this.trigger("log",c)},ol=function(u,c){for(var h=Object.keys(c),d=0;d=-C&&O<=x&&(!$||P>O)&&($=G,P=O)));return $?$.gop:null},this.alignGopsAtStart_=function(b){var x,C,P,O,$,N,G,z;for($=b.byteLength,N=b.nalCount,G=b.duration,x=C=0;xP.pts){x++;continue}C++,$-=O.byteLength,N-=O.nalCount,G-=O.duration}return C===0?b:C===b.length?null:(z=b.slice(C),z.byteLength=$,z.duration=G,z.nalCount=N,z.pts=z[0].pts,z.dts=z[0].dts,z)},this.alignGopsAtEnd_=function(b){var x,C,P,O,$,N;for(x=p.length-1,C=b.length-1,$=null,N=!1;x>=0&&C>=0;){if(P=p[x],O=b[C],P.pts===O.pts){N=!0;break}if(P.pts>O.pts){x--;continue}x===p.length-1&&($=C),C--}if(!N&&$===null)return null;var G;if(N?G=C:G=$,G===0)return b;var z=b.slice(G),Ce=z.reduce(function(it,li){return it.byteLength+=li.byteLength,it.duration+=li.duration,it.nalCount+=li.nalCount,it},{byteLength:0,duration:0,nalCount:0});return z.byteLength=Ce.byteLength,z.duration=Ce.duration,z.nalCount=Ce.nalCount,z.pts=z[0].pts,z.dts=z[0].dts,z},this.alignGopsWith=function(b){p=b}},Es.prototype=new Or,oi=function(u,c){this.numberOfTracks=0,this.metadataStream=c,u=u||{},typeof u.remux<"u"?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,oi.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},oi.prototype=new Or,oi.prototype.flush=function(u){var c=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,p,g,v=0,b;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,ya.forEach(function(x){h.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,ga.forEach(function(x){h.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,g=Ss.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(g.byteLength),h.initSegment.set(g),h.data=new Uint8Array(this.pendingBytes),b=0;b=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},oi.prototype.setRemux=function(u){this.remuxTracks=u},Nr=function(u){var c=this,h=!0,d,p;Nr.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new Ot.MetadataStream,g.aacStream=new hv,g.audioTimestampRolloverStream=new Ot.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new Ot.TimestampRolloverStream("timed-metadata"),g.adtsStream=new al,g.coalesceStream=new oi(u,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(v){g.aacStream.setTimestamp(v.timeStamp)}),g.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Ci(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ol(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new Ot.MetadataStream,g.packetStream=new Ot.TransportPacketStream,g.parseStream=new Ot.TransportParseStream,g.elementaryStream=new Ot.ElementaryStream,g.timestampRolloverStream=new Ot.TimestampRolloverStream,g.adtsStream=new al,g.h264Stream=new dv,g.captionStream=new Ot.CaptionStream(u),g.coalesceStream=new oi(u,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!d&&v.tracks[b].type==="video"?(d=v.tracks[b],d.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);d&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new Es(d,u),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(x){p&&!u.keepOriginalTimestamps&&(p.timelineStartInfo=x,g.audioSegmentStream.setEarliestDts(x.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(x){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Ci(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(v){v.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",v)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ol(this,g)},this.setBaseMediaDecodeTime=function(g){var v=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ct.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),d&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,ct.clearDtsInfo(d),v.captionStream.reset()),v.timestampRolloverStream&&v.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var v=this.transmuxPipeline_;u.remux=g,v&&v.coalesceStream&&v.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var v=this;return function(b){b.stream=g,v.trigger("log",b)}},this.push=function(g){if(h){var v=fv(g);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Nr.prototype=new Or;var gv={Transmuxer:Nr,VideoSegmentStream:Es,AudioSegmentStream:Ci,AUDIO_PROPERTIES:ga,VIDEO_PROPERTIES:ya,generateSegmentTimingInfo:_a},yv=function(u){return u>>>0},_v=function(u){return("00"+u.toString(16)).slice(-2)},Br={toUnsigned:yv,toHexString:_v},vv=function(u){var c="";return c+=String.fromCharCode(u[0]),c+=String.fromCharCode(u[1]),c+=String.fromCharCode(u[2]),c+=String.fromCharCode(u[3]),c},ll=vv,Tv=Br.toUnsigned,bv=ll,cl=function(u,c){var h=[],d,p,g,v,b;if(!c.length)return null;for(d=0;d1?d+p:u.byteLength,g===c[0]&&(c.length===1?h.push(u.subarray(d+8,v)):(b=cl(u.subarray(d+8,v),c.slice(1)),b.length&&(h=h.concat(b)))),d=v;return h},dl=cl,Sv=Br.toUnsigned,xv=n.getUint64,Ev=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=xv(u.subarray(4)):c.baseMediaDecodeTime=Sv(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),c},hl=Ev,Cv=function(u){return{isLeading:(u[0]&12)>>>2,dependsOn:u[0]&3,isDependedOn:(u[1]&192)>>>6,hasRedundancy:(u[1]&48)>>>4,paddingValue:(u[1]&14)>>>1,isNonSyncSample:u[1]&1,degradationPriority:u[2]<<8|u[3]}},Av=Cv,fl=Av,Dv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},h=new DataView(u.buffer,u.byteOffset,u.byteLength),d=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,v=c.flags[1]&2,b=c.flags[1]&4,x=c.flags[1]&8,C=h.getUint32(4),P=8,O;for(d&&(c.dataOffset=h.getInt32(P),P+=4),p&&C&&(O={flags:fl(u.subarray(P,P+4))},P+=4,g&&(O.duration=h.getUint32(P),P+=4),v&&(O.size=h.getUint32(P),P+=4),x&&(c.version===1?O.compositionTimeOffset=h.getInt32(P):O.compositionTimeOffset=h.getUint32(P),P+=4),c.samples.push(O),C--);C--;)O={},g&&(O.duration=h.getUint32(P),P+=4),v&&(O.size=h.getUint32(P),P+=4),b&&(O.flags=fl(u.subarray(P,P+4)),P+=4),x&&(c.version===1?O.compositionTimeOffset=h.getInt32(P):O.compositionTimeOffset=h.getUint32(P),P+=4),c.samples.push(O);return c},pl=Dv,wv=function(u){var c=new DataView(u.buffer,u.byteOffset,u.byteLength),h={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:c.getUint32(4)},d=h.flags[2]&1,p=h.flags[2]&2,g=h.flags[2]&8,v=h.flags[2]&16,b=h.flags[2]&32,x=h.flags[0]&65536,C=h.flags[0]&131072,P;return P=8,d&&(P+=4,h.baseDataOffset=c.getUint32(12),P+=4),p&&(h.sampleDescriptionIndex=c.getUint32(P),P+=4),g&&(h.defaultSampleDuration=c.getUint32(P),P+=4),v&&(h.defaultSampleSize=c.getUint32(P),P+=4),b&&(h.defaultSampleFlags=c.getUint32(P)),x&&(h.durationIsEmpty=!0),!d&&C&&(h.baseDataOffsetIsMoof=!0),h},ml=wv,Cs;typeof window<"u"?Cs=window:typeof i<"u"?Cs=i:typeof self<"u"?Cs=self:Cs={};var gl=Cs,kv=Gu.discardEmulationPreventionBytes,Iv=zu.CaptionStream,As=dl,Pv=hl,Lv=pl,Ov=ml,yl=gl,Rv=function(u,c){for(var h=u,d=0;d0?Pv($[0]).baseMediaDecodeTime:0,G=As(x,["trun"]),z,Ce;c===O&&G.length>0&&(z=Nv(G,N,P),Ce=Mv(b,z,O),p[O]||(p[O]={seiNals:[],logs:[]}),p[O].seiNals=p[O].seiNals.concat(Ce.seiNals),p[O].logs=p[O].logs.concat(Ce.logs))}),p},Fv=function(u,c,h){var d;if(c===null)return null;d=Bv(u,c);var p=d[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},Uv=function(){var u=!1,c,h,d,p,g,v;this.isInitialized=function(){return u},this.init=function(b){c=new Iv,u=!0,v=b?b.isPartial:!1,c.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,g.captions.push(x),g.captionStreams[x.stream]=!0}),c.on("log",function(x){g.logs.push(x)})},this.isNewInit=function(b,x){return b&&b.length===0||x&&typeof x=="object"&&Object.keys(x).length===0?!1:d!==b[0]||p!==x[d]},this.parse=function(b,x,C){var P;if(this.isInitialized()){if(!x||!C)return null;if(this.isNewInit(x,C))d=x[0],p=C[d];else if(d===null||!p)return h.push(b),null}else return null;for(;h.length>0;){var O=h.shift();this.parse(O,x,C)}return P=Fv(b,d,p),P&&P.logs&&(g.logs=g.logs.concat(P.logs)),P===null||!P.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(P.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(x){c.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;v?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},$v=Uv,jv=function(u){for(var c=0,h=String.fromCharCode(u[c]),d="";h!=="\0";)d+=h,c++,h=String.fromCharCode(u[c]);return d+=h,d},qv={uint8ToCString:jv},Fr=qv.uint8ToCString,Vv=n.getUint64,Hv=function(u){var c=4,h=u[0],d,p,g,v,b,x,C,P;if(h===0){d=Fr(u.subarray(c)),c+=d.length,p=Fr(u.subarray(c)),c+=p.length;var O=new DataView(u.buffer);g=O.getUint32(c),c+=4,b=O.getUint32(c),c+=4,x=O.getUint32(c),c+=4,C=O.getUint32(c),c+=4}else if(h===1){var O=new DataView(u.buffer);g=O.getUint32(c),c+=4,v=Vv(u.subarray(c)),c+=8,x=O.getUint32(c),c+=4,C=O.getUint32(c),c+=4,d=Fr(u.subarray(c)),c+=d.length,p=Fr(u.subarray(c)),c+=p.length}P=new Uint8Array(u.subarray(c,u.byteLength));var $={scheme_id_uri:d,value:p,timescale:g||1,presentation_time:v,presentation_time_delta:b,event_duration:x,id:C,message_data:P};return zv(h,$)?$:void 0},Gv=function(u,c,h,d){return u||u===0?u/c:d+h/c},zv=function(u,c){var h=c.scheme_id_uri!=="\0",d=u===0&&_l(c.presentation_time_delta)&&h,p=u===1&&_l(c.presentation_time)&&h;return!(u>1)&&d||p},_l=function(u){return u!==void 0||u!==null},Wv={parseEmsgBox:Hv,scaleTime:Gv},Ur=Br.toUnsigned,Ds=Br.toHexString,be=dl,Ai=ll,va=Wv,Kv=ml,Xv=pl,Yv=hl,Qv=n.getUint64,vl,Tl,bl,Sl,xl,Ta,El,ba=gl,Jv=Yu.parseId3Frames;vl=function(u){var c={},h=be(u,["moov","trak"]);return h.reduce(function(d,p){var g,v,b,x,C;return g=be(p,["tkhd"])[0],!g||(v=g[0],b=v===0?12:20,x=Ur(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=be(p,["mdia","mdhd"])[0],!C)?null:(v=C[0],b=v===0?12:20,d[x]=Ur(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),d)},c)},Tl=function(u,c){var h;h=be(c,["moof","traf"]);var d=h.reduce(function(p,g){var v=be(g,["tfhd"])[0],b=Ur(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),x=u[b]||9e4,C=be(g,["tfdt"])[0],P=new DataView(C.buffer,C.byteOffset,C.byteLength),O;C[0]===1?O=Qv(C.subarray(4,12)):O=P.getUint32(4);let $;return typeof O=="bigint"?$=O/ba.BigInt(x):typeof O=="number"&&!isNaN(O)&&($=O/x),$11?(p.codec+=".",p.codec+=Ds(N[9]),p.codec+=Ds(N[10]),p.codec+=Ds(N[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(N=$.subarray(28),G=Ai(N.subarray(4,8)),G==="esds"&&N.length>20&&N[19]!==0?(p.codec+="."+Ds(N[19]),p.codec+="."+Ds(N[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var z=be(d,["mdia","mdhd"])[0];z&&(p.timescale=Ta(z)),h.push(p)}),h},El=function(u,c=0){var h=be(u,["emsg"]);return h.map(d=>{var p=va.parseEmsgBox(new Uint8Array(d)),g=Jv(p.message_data);return{cueTime:va.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:va.scaleTime(p.event_duration,p.timescale),frames:g}})};var Sa={findBox:be,parseType:Ai,timescale:vl,startTime:Tl,compositionStartTime:bl,videoTrackIds:Sl,tracks:xl,getTimescaleFromMediaHeader:Ta,getEmsgID3:El},xa=Er,Cl=function(u){var c=u[1]&31;return c<<=8,c|=u[2],c},$r=function(u){return!!(u[1]&64)},jr=function(u){var c=0;return(u[3]&48)>>>4>1&&(c+=u[4]+1),c},Zv=function(u,c){var h=Cl(u);return h===0?"pat":h===c?"pmt":c?"pes":null},eT=function(u){var c=$r(u),h=4+jr(u);return c&&(h+=u[h]+1),(u[h+10]&31)<<8|u[h+11]},tT=function(u){var c={},h=$r(u),d=4+jr(u);if(h&&(d+=u[d]+1),!!(u[d+5]&1)){var p,g,v;p=(u[d+1]&15)<<8|u[d+2],g=3+p-4,v=(u[d+10]&15)<<8|u[d+11];for(var b=12+v;b=u.byteLength)return null;var d=null,p;return p=u[h+7],p&192&&(d={},d.pts=(u[h+9]&14)<<27|(u[h+10]&255)<<20|(u[h+11]&254)<<12|(u[h+12]&255)<<5|(u[h+13]&254)>>>3,d.pts*=4,d.pts+=(u[h+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(u[h+14]&14)<<27|(u[h+15]&255)<<20|(u[h+16]&254)<<12|(u[h+17]&255)<<5|(u[h+18]&254)>>>3,d.dts*=4,d.dts+=(u[h+18]&6)>>>1)),d},Ea=function(u){switch(u){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},rT=function(u){for(var c=4+jr(u),h=u.subarray(c),d=0,p=0,g=!1,v;p3&&(v=Ea(h[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},nT={parseType:Zv,parsePat:eT,parsePmt:tT,parsePayloadUnitStartIndicator:$r,parsePesType:iT,parsePesTime:sT,videoPacketContainsKeyFrame:rT},Al=Er,Di=Ku.handleRollover,ne={};ne.ts=nT,ne.aac=ma;var ui=he.ONE_SECOND_IN_TS,Me=188,mt=71,aT=function(u,c){for(var h=0,d=Me,p,g;d=0;){if(u[d]===mt&&(u[p]===mt||p===u.byteLength)){switch(g=u.subarray(d,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),x=ne.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&x&&(C=ne.ts.parsePesTime(g),C&&(C.type="audio",h.audio.push(C),P=!0));break}if(P)break;d-=Me,p-=Me;continue}d--,p--}},oT=function(u,c,h){for(var d=0,p=Me,g,v,b,x,C,P,O,$,N=!1,G={data:[],size:0};p=0;){if(u[d]===mt&&u[p]===mt){switch(g=u.subarray(d,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),x=ne.ts.parsePayloadUnitStartIndicator(g),b==="video"&&x&&(C=ne.ts.parsePesTime(g),C&&(C.type="video",h.video.push(C),N=!0));break}if(N)break;d-=Me,p-=Me;continue}d--,p--}},uT=function(u,c){if(u.audio&&u.audio.length){var h=c;(typeof h>"u"||isNaN(h))&&(h=u.audio[0].dts),u.audio.forEach(function(g){g.dts=Di(g.dts,h),g.pts=Di(g.pts,h),g.dtsTime=g.dts/ui,g.ptsTime=g.pts/ui})}if(u.video&&u.video.length){var d=c;if((typeof d>"u"||isNaN(d))&&(d=u.video[0].dts),u.video.forEach(function(g){g.dts=Di(g.dts,d),g.pts=Di(g.pts,d),g.dtsTime=g.dts/ui,g.ptsTime=g.pts/ui}),u.firstKeyFrame){var p=u.firstKeyFrame;p.dts=Di(p.dts,d),p.pts=Di(p.pts,d),p.dtsTime=p.dts/ui,p.ptsTime=p.pts/ui}}},lT=function(u){for(var c=!1,h=0,d=null,p=null,g=0,v=0,b;u.length-v>=3;){var x=ne.aac.parseType(u,v);switch(x){case"timed-metadata":if(u.length-v<10){c=!0;break}if(g=ne.aac.parseId3TagSize(u,v),g>u.length){c=!0;break}p===null&&(b=u.subarray(v,v+g),p=ne.aac.parseAacTimestamp(b)),v+=g;break;case"audio":if(u.length-v<7){c=!0;break}if(g=ne.aac.parseAdtsSize(u,v),g>u.length){c=!0;break}d===null&&(b=u.subarray(v,v+g),d=ne.aac.parseSampleRate(b)),h++,v+=g;break;default:v++;break}if(c)return null}if(d===null||p===null)return null;var C=ui/d,P={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*C,pts:p+h*1024*C}]};return P},cT=function(u){var c={pid:null,table:null},h={};aT(u,c);for(var d in c.table)if(c.table.hasOwnProperty(d)){var p=c.table[d];switch(p){case Al.H264_STREAM_TYPE:h.video=[],oT(u,c,h),h.video.length===0&&delete h.video;break;case Al.ADTS_STREAM_TYPE:h.audio=[],Dl(u,c,h),h.audio.length===0&&delete h.audio;break}}return h},dT=function(u,c){var h=ne.aac.isLikelyAacData(u),d;return h?d=lT(u):d=cT(u),!d||!d.audio&&!d.video?null:(uT(d,c),d)},hT={inspect:dT,parseAudioPes_:Dl};const fT=function(u,c){c.on("data",function(h){const d=h.initSegment;h.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=h.data;h.data=p.buffer,u.postMessage({action:"data",segment:h,byteOffset:p.byteOffset,byteLength:p.byteLength},[h.data])}),c.on("done",function(h){u.postMessage({action:"done"})}),c.on("gopInfo",function(h){u.postMessage({action:"gopInfo",gopInfo:h})}),c.on("videoSegmentTimingInfo",function(h){const d={start:{decode:he.videoTsToSeconds(h.start.dts),presentation:he.videoTsToSeconds(h.start.pts)},end:{decode:he.videoTsToSeconds(h.end.dts),presentation:he.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=he.videoTsToSeconds(h.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(h){const d={start:{decode:he.videoTsToSeconds(h.start.dts),presentation:he.videoTsToSeconds(h.start.pts)},end:{decode:he.videoTsToSeconds(h.end.dts),presentation:he.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=he.videoTsToSeconds(h.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(h){u.postMessage({action:"id3Frame",id3Frame:h})}),c.on("caption",function(h){u.postMessage({action:"caption",caption:h})}),c.on("trackinfo",function(h){u.postMessage({action:"trackinfo",trackInfo:h})}),c.on("audioTimingInfo",function(h){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:he.videoTsToSeconds(h.start),end:he.videoTsToSeconds(h.end)}})}),c.on("videoTimingInfo",function(h){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:he.videoTsToSeconds(h.start),end:he.videoTsToSeconds(h.end)}})}),c.on("log",function(h){u.postMessage({action:"log",log:h})})};class wl{constructor(c,h){this.options=h||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new gv.Transmuxer(this.options),fT(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new $v,this.captionParser.init());const h=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.captionParser.parse(h,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:c,data:h}){const d=Sa.startTime(c,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:c}){const h=Sa.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:c},[c.buffer])}probeEmsgID3({data:c,offset:h}){const d=Sa.getEmsgID3(c,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*he.ONE_SECOND_IN_TS:void 0,p=hT.inspect(c,d);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const h=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const h=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(he.secondsToVideoTs(h)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(he.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(u){if(u.data.action==="init"&&u.data.options){this.messageHandlers=new wl(self,u.data.options);return}this.messageHandlers||(this.messageHandlers=new wl(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data)}}));var Fx=cp(Bx);const Ux=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:f}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const m=i.data.segment.boxes||{data:i.data.segment.data},y={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof l<"u"&&(y.videoFrameDtsTime=l),typeof f<"u"&&(y.videoFramePtsTime=f),t(y)},$x=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},jx=(i,e)=>{e.gopInfo=i.data.gopInfo},fp=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:f,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:y,onId3:T,onCaptions:S,onDone:_,onEndedTimeline:D,onTransmuxerLog:w,isEndOfTimeline:k}=i,I={buffer:[]};let M=k;const R=L=>{e.currentTransmux===i&&(L.data.action==="data"&&Ux(L,I,a),L.data.action==="trackinfo"&&o(L.data.trackInfo),L.data.action==="gopInfo"&&jx(L,I),L.data.action==="audioTimingInfo"&&l(L.data.audioTimingInfo),L.data.action==="videoTimingInfo"&&f(L.data.videoTimingInfo),L.data.action==="videoSegmentTimingInfo"&&m(L.data.videoSegmentTimingInfo),L.data.action==="audioSegmentTimingInfo"&&y(L.data.audioSegmentTimingInfo),L.data.action==="id3Frame"&&T([L.data.id3Frame],L.data.id3Frame.dispatchType),L.data.action==="caption"&&S(L.data.caption),L.data.action==="endedtimeline"&&(M=!1,D()),L.data.action==="log"&&w(L.data.log),L.data.type==="transmuxed"&&(M||(e.onmessage=null,$x({transmuxedData:I,callback:_}),pp(e))))};if(e.onmessage=R,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const L=t instanceof ArrayBuffer?t:t.buffer,U=t instanceof ArrayBuffer?0:t.byteOffset;e.postMessage({action:"push",data:L,byteOffset:U,byteLength:t.byteLength},[L])}k&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},pp=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():fp(i.currentTransmux))},Hc=(i,e)=>{i.postMessage({action:e}),pp(i)},mp=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Hc(e,i);return}e.transmuxQueue.push(Hc.bind(null,e,i))},qx=i=>{mp("reset",i)},Vx=i=>{mp("endTimeline",i)},gp=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,fp(i);return}i.transmuxer.transmuxQueue.push(i)},Hx=i=>{const e=new Fx;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var za={reset:qx,endTimeline:Vx,transmux:gp,createTransmuxer:Hx};const Ks=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=rt({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},St={FAILURE:2,TIMEOUT:-101,ABORTED:-102},wo=i=>{i.forEach(e=>{e.abort()})},Gx=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),zx=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},Pu=(i,e)=>e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:St.TIMEOUT,xhr:e}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:St.ABORTED,xhr:e}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:St.FAILURE,xhr:e}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:St.FAILURE,xhr:e}:null,Gc=(i,e,t)=>(s,r)=>{const n=r.response,a=Pu(s,r);if(a)return t(a,i);if(n.byteLength!==16)return t({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:St.FAILURE,xhr:r},i);const o=new DataView(n),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let f=0;f{const t=Yo(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:St.FAILURE,metadata:{errorType:A.Error.UnsupportedMediaInitialization,mediaType:r}})}Ks({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},Wx=({segment:i,finishProcessingFn:e})=>(t,s)=>{const r=Pu(t,s);if(r)return e(r,i);const n=new Uint8Array(s.response);if(i.map.key)return i.map.encryptedBytes=n,e(null,i);i.map.bytes=n,yp(i,function(a){if(a)return a.xhr=s,a.status=s.status,e(a,i);e(null,i)})},Kx=({segment:i,finishProcessingFn:e,responseType:t})=>(s,r)=>{const n=Pu(s,r);if(n)return e(n,i);const a=t==="arraybuffer"||!r.responseText?r.response:Mx(r.responseText.substring(i.lastReachedChar||0));return i.stats=Gx(r),i.key?i.encryptedBytes=new Uint8Array(a):i.bytes=new Uint8Array(a),e(null,i)},Xx=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{const S=i.map&&i.map.tracks||{},_=!!(S.audio&&S.video);let D=s.bind(null,i,"audio","start");const w=s.bind(null,i,"audio","end");let k=s.bind(null,i,"video","start");const I=s.bind(null,i,"video","end"),M=()=>gp({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:_,onData:R=>{R.type=R.type==="combined"?"video":R.type,m(i,R)},onTrackInfo:R=>{t&&(_&&(R.isMuxed=!0),t(i,R))},onAudioTimingInfo:R=>{D&&typeof R.start<"u"&&(D(R.start),D=null),w&&typeof R.end<"u"&&w(R.end)},onVideoTimingInfo:R=>{k&&typeof R.start<"u"&&(k(R.start),k=null),I&&typeof R.end<"u"&&I(R.end)},onVideoSegmentTimingInfo:R=>{r(R)},onAudioSegmentTimingInfo:R=>{n(R)},onId3:(R,L)=>{a(i,R,L)},onCaptions:R=>{o(i,[R])},isEndOfTimeline:l,onEndedTimeline:()=>{f()},onTransmuxerLog:T,onDone:R=>{y&&(R.type=R.type==="combined"?"video":R.type,y(null,i,R))}});Ks({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:R=>{i.bytes=e=R.data;const L=R.result;L&&(t(i,{hasAudio:L.hasAudio,hasVideo:L.hasVideo,isMuxed:_}),t=null),M()}})},_p=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{let S=new Uint8Array(e);if(S1(S)){i.isFmp4=!0;const{tracks:_}=i.map,D={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(D.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(D.videoCodec=_.video.codec),_.video&&_.audio&&(D.isMuxed=!0),t(i,D);const w=(k,I)=>{m(i,{data:S,type:D.hasAudio&&!D.isMuxed?"audio":"video"}),I&&I.length&&a(i,I),k&&k.length&&o(i,k),y(null,i,{})};Ks({action:"probeMp4StartTime",timescales:i.map.timescales,data:S,transmuxer:i.transmuxer,callback:({data:k,startTime:I})=>{e=k.buffer,i.bytes=S=k,D.hasAudio&&!D.isMuxed&&s(i,"audio","start",I),D.hasVideo&&s(i,"video","start",I),Ks({action:"probeEmsgID3",data:S,transmuxer:i.transmuxer,offset:I,callback:({emsgData:M,id3Frames:R})=>{if(e=M.buffer,i.bytes=S=M,!_.video||!M.byteLength||!i.transmuxer){w(void 0,R);return}Ks({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:S,timescales:i.map.timescales,trackIds:[_.video.id],callback:L=>{e=L.data.buffer,i.bytes=S=L.data,L.logs.forEach(function(U){T(se(U,{stream:"mp4CaptionParser"}))}),w(L.captions,R)}})}})}});return}if(!i.transmuxer){y(null,i,{});return}if(typeof i.container>"u"&&(i.container=Yo(S)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),y(null,i,{});return}Xx({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})},vp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s},r){const n=o=>{if(o.data.source===i){s.removeEventListener("message",n);const l=o.data.decrypted;r(new Uint8Array(l.bytes,l.byteOffset,l.byteLength))}};s.addEventListener("message",n);let a;e.bytes.slice?a=e.bytes.slice():a=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(rp({source:i,encrypted:t,key:a,iv:e.iv}),[t.buffer,a.buffer])},Yx=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{vp({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i},S=>{e.bytes=S,_p({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})})},Qx=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{let S=0,_=!1;return(D,w)=>{if(!_){if(D)return _=!0,wo(i),y(D,w);if(S+=1,S===i.length){const k=function(){if(w.encryptedBytes)return Yx({decryptionWorker:e,segment:w,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T});_p({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return vp({decryptionWorker:e,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key},I=>{w.map.bytes=I,yp(w,M=>{if(M)return wo(i),y(M,w);k()})});k()}}}},Jx=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},Zx=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m})=>y=>{if(!y.target.aborted)return i.stats=se(i.stats,zx(y)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(y,i)},eE=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_,doneFn:D,onTransmuxerLog:w})=>{const k=[],I=Qx({activeXhrs:k,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_,doneFn:D,onTransmuxerLog:w});if(s.key&&!s.key.bytes){const q=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&q.push(s.map.key);const J=se(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),X=Gc(s,q,I),ue=i(J,X);k.push(ue)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const ee=se(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),de=Gc(s,[s.map.key],I),V=i(ee,de);k.push(V)}const J=se(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Ao(s.map),requestType:"segment-media-initialization"}),X=Wx({segment:s,finishProcessingFn:I}),ue=i(J,X);k.push(ue)}const M=se(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Ao(s),requestType:"segment"}),R=Kx({segment:s,finishProcessingFn:I,responseType:M.responseType}),L=i(M,R);L.addEventListener("progress",Zx({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_})),k.push(L);const U={};return k.forEach(q=>{q.addEventListener("loadend",Jx({loadendState:U,abortFn:r}))}),()=>wo(k)},tE=ut("CodecUtils"),iE=function(i){const e=i.attributes||{};if(e.CODECS)return gt(e.CODECS)},Tp=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},sE=(i,e)=>{if(!Tp(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},Cn=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(Ld(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){tE(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},zc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},Xs=function(i,e){const t=e.attributes||{},s=Cn(iE(e)||[]);if(Tp(i,e)&&!s.audio&&!sE(i,e)){const r=Cn(Sb(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},Kr=ut("PlaylistSelector"),Wc=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},An=function(i,e){if(!i)return"";const t=E.getComputedStyle(i);return t?t[e]:""},Wi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Lu=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||E.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||E.Number.MAX_VALUE,t-s},rE=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||E.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||E.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let bp=function(i,e,t,s,r,n){if(!i)return;const a={bandwidth:e,width:t,height:s,limitRenditionByPlayerDimensions:r};let o=i.playlists;ze.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(L=>{let U;const q=L.attributes&&L.attributes.RESOLUTION&&L.attributes.RESOLUTION.width,J=L.attributes&&L.attributes.RESOLUTION&&L.attributes.RESOLUTION.height;return U=L.attributes&&L.attributes.BANDWIDTH,U=U||E.Number.MAX_VALUE,{bandwidth:U,width:q,height:J,playlist:L}});Wi(l,(L,U)=>L.bandwidth-U.bandwidth),l=l.filter(L=>!ze.isIncompatible(L.playlist));let f=l.filter(L=>ze.isEnabled(L.playlist));f.length||(f=l.filter(L=>!ze.isDisabled(L.playlist)));const m=f.filter(L=>L.bandwidth*De.BANDWIDTH_VARIANCEL.bandwidth===y.bandwidth)[0];if(r===!1){const L=T||f[0]||l[0];if(L&&L.playlist){let U="sortedPlaylistReps";return T&&(U="bandwidthBestRep"),f[0]&&(U="enabledPlaylistReps"),Kr(`choosing ${Wc(L)} using ${U} with options`,a),L.playlist}return Kr("could not choose a playlist with options",a),null}const S=m.filter(L=>L.width&&L.height);Wi(S,(L,U)=>L.width-U.width);const _=S.filter(L=>L.width===t&&L.height===s);y=_[_.length-1];const D=_.filter(L=>L.bandwidth===y.bandwidth)[0];let w,k,I;D||(w=S.filter(L=>L.width>t||L.height>s),k=w.filter(L=>L.width===w[0].width&&L.height===w[0].height),y=k[k.length-1],I=k.filter(L=>L.bandwidth===y.bandwidth)[0]);let M;if(n.leastPixelDiffSelector){const L=S.map(U=>(U.pixelDiff=Math.abs(U.width-t)+Math.abs(U.height-s),U));Wi(L,(U,q)=>U.pixelDiff===q.pixelDiff?q.bandwidth-U.bandwidth:U.pixelDiff-q.pixelDiff),M=L[0]}const R=M||I||D||T||f[0]||l[0];if(R&&R.playlist){let L="sortedPlaylistReps";return M?L="leastPixelDiffRep":I?L="resolutionPlusOneRep":D?L="resolutionBestRep":T?L="bandwidthBestRep":f[0]&&(L="enabledPlaylistReps"),Kr(`choosing ${Wc(R)} using ${L} with options`,a),R.playlist}return Kr("could not choose a playlist with options",a),null};const Kc=function(){let i=this.useDevicePixelRatio&&E.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),bp(this.playlists.main,this.systemBandwidth,parseInt(An(this.tech_.el(),"width"),10)*i,parseInt(An(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},nE=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&E.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),bp(this.playlists.main,e,parseInt(An(this.tech_.el(),"width"),10)*s,parseInt(An(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},aE=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=i,f=e.playlists.filter(_=>!ze.isIncompatible(_));let m=f.filter(ze.isEnabled);m.length||(m=f.filter(_=>!ze.isDisabled(_)));const T=m.filter(ze.hasAttribute.bind(null,"BANDWIDTH")).map(_=>{const w=l.getSyncPoint(_,r,o,t)?1:2,I=ze.estimateSegmentRequestTime(n,s,_)*w-a;return{playlist:_,rebufferingImpact:I}}),S=T.filter(_=>_.rebufferingImpact<=0);return Wi(S,(_,D)=>Lu(D.playlist,_.playlist)),S.length?S[0]:(Wi(T,(_,D)=>_.rebufferingImpact-D.rebufferingImpact),T[0]||null)},oE=function(){const i=this.playlists.main.playlists.filter(ze.isEnabled);return Wi(i,(t,s)=>Lu(t,s)),i.filter(t=>!!Xs(this.playlists.main,t).video)[0]||null},uE=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function Sp(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const lE=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const f=n[s];f&&(a=f.label,o=f.language,l=f.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:l,label:a,language:o},!1).track}}},cE=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=E.WebKitDataCue||E.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new s(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},dE=function(i){Object.defineProperties(i.frame,{id:{get(){return A.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return A.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return A.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},hE=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=E.WebKitDataCue||E.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const y=m.cueTime+t;typeof y!="number"||E.isNaN(y)||y<0||!(y<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const S=new r(y,y,T.value||T.url||T.data||"");S.frame=T,S.value=T,dE(S),n.addCue(S)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let m=0;m{const T=m[y.startTime]||[];return T.push(y),m[y.startTime]=T,m},{}),f=Object.keys(l).sort((m,y)=>Number(m)-Number(y));f.forEach((m,y)=>{const T=l[m],S=isFinite(s)?s:m,_=Number(f[y+1])||S;T.forEach(D=>{D.endTime=_})})},fE={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},pE=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),mE=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=E.WebKitDataCue||E.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(pE.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:fE[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},Xc=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,A.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},js=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},gE=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},yE=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*mi.ONE_SECOND_IN_TS);let r;for(r=0;rs);r++);return i.slice(r)},_E=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r=s);r++);return i.slice(0,r).concat(e)},vE=(i,e,t,s)=>{const r=Math.ceil((e-s)*mi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*mi.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(i[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},TE=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;rt))return n}return s.length===0?0:s[s.length-1]},Ms=1,SE=500,Yc=i=>typeof i=="number"&&isFinite(i),Xr=1/60,xE=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,EE=(i,e,t)=>{let s=e-De.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Oi=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:f,timeline:m}=i,y=o.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const S=typeof f=="number",_=i.segment.uri?"segment":"pre-segment",D=S?Vf({preloadSegment:s})-1:0;return`${_} [${n+l}/${n+y}]`+(S?` part [${f}/${D}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(S?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},Qc=i=>`${i}TimingInfo`,CE=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},AE=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=E.BigInt(n)-E.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&ei?Math.round(i)>e+Tt:!1,DE=(i,e)=>{if(e!=="hls")return null;const t=AE({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=Zc({segmentDuration:t,maxDuration:s*2}),n=Zc({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null};class ko extends A.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ut(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return za.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,E.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&za.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Le();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=En(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=np(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
+currentTime: ${this.currentTime_()}
+bufferedEnd: ${Ha(this.buffered_())}
+`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&za.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=vE(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)js(e,t,this.inbandTextTracks_[o]);js(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=E.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=E.setTimeout(this.monitorBufferTick_.bind(this),SE)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Ha(e)||0,s=Du(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=bE(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],S=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=T.end?T.end:t,T.parts&&T.parts[S+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=S+1):o.mediaIndex=this.mediaIndex+1}else{let T,S,_;const D=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
+For TargetTime: ${D}.
+CurrentTime: ${this.currentTime_()}
+BufferedEnd: ${t}
+Fetch At Buffer: ${this.fetchAtBuffer_}
+`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const w=this.getSyncInfoFromMediaSequenceSync_(D);if(!w)return this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${w.start} --> ${w.end})`),T=w.segmentIndex,S=w.partIndex,_=w.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const w=ze.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:D,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=w.segmentIndex,S=w.partIndex,_=w.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${D}`:`currentTime ${D}`,o.mediaIndex=T,o.startOfSegment=_,o.partIndex=S,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let f=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!f)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,f=l.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&f&&!m&&!f.independent)if(o.partIndex===0){const T=a[o.mediaIndex-1],S=T.parts&&T.parts.length&&T.parts[T.parts.length-1];S&&S.independent&&(o.mediaIndex-=1,o.partIndex=T.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:f}=e,m=s.segments[r],y=typeof o=="number"&&m.parts[o],T={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:y?o:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:y&&y.duration||m.duration,segment:m,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},S=typeof l<"u"?l:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:S});const _=Ha(this.sourceUpdater_.audioBuffered());return typeof _=="number"&&(T.audioAppendStart=_-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=yE(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return CE(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=ze.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=KS(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=aE({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const f=n-a-o.rebufferingImpact;let m=.5;a<=Tt&&(m=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||f{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:f}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),lE(m,this.vhs_.tech_,a),js(o,l,m[a]),cE({captionArray:f,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Jc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Jc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Qc(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=En(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+gi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+gi(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(l-o<=Ms&&m-f<=Ms){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${gi(n).join(", ")}, video buffer: ${gi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0,metadata:{errorType:A.Error.SegmentExceedsSourceBufferQuota}}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Ms;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Ms}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=E.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Ms*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===xp){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:A.Error.SegmentAppendError}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const a=[r];let o=r.byteLength;s&&(a.unshift(s),o+=s.byteLength),n=uE({bytes:o,segments:a})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const t=rt({},e,{forceTimestampOffset:!0});rt(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting
+${Sp(e.uri)}
+${Oi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=eE({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:f})=>{this.logger_(`${Oi(e)} logged from transmuxer stream ${f} as a ${l}: ${o}`)}})}trimBackBuffer_(e){const t=EE(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?r.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(r.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=a}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e"u"||f.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0,metadata:{errorType:A.Error.SegmentUnsupportedMediaFormat}}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=xE(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0,metadata:{errorType:A.Error.SegmentSwitchError}}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=DE(e,this.sourceType_);if(t&&(t.severity==="warn"?A.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Oi(e)}`);return}this.logger_(`Appended ${Oi(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Oi(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},wE=["video","audio"],Io=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},kE=(i,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Ki("audio",e),Ki("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Io(i,e))){if(s.type!==i){if(t=kE(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Ki(i,e);return}}},Cp=(i,e)=>{const t=e[`${i}Buffer`],s=Ep(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},yt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,Qe={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(yt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===xp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(yt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];yt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){A.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){A.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(yt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){A.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=Ep(i),r=Ys(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(Cp(i,e),!!yt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){A.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Ys(i);if(!yt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))!==n){t.logger_(`changing ${e}Buffer codec from ${t.codecs[e]} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(l){A.log.warn(`Failed to changeType on ${e}Buffer`,l)}}}},Je=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Ki(i,e)},ed=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=GS(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Ki(i,e)};class Ap extends A.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ki("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ut("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=ed("video",this),this.onAudioUpdateEnd_=ed("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Je({type:"mediaSource",sourceUpdater:this,action:Qe.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Je({type:e,sourceUpdater:this,action:Qe.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){A.log.error("removeSourceBuffer is not supported!");return}Je({type:"mediaSource",sourceUpdater:this,action:Qe.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!A.browser.IS_FIREFOX&&E.MediaSource&&E.MediaSource.prototype&&typeof E.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return E.SourceBuffer&&E.SourceBuffer.prototype&&typeof E.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){A.log.error("changeType is not supported!");return}Je({type:e,sourceUpdater:this,action:Qe.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Je({type:r,sourceUpdater:this,action:Qe.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return yt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Le()}videoBuffered(){return yt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Le()}buffered(){const e=yt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=yt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():WS(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Bt){Je({type:"mediaSource",sourceUpdater:this,action:Qe.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Bt){typeof e!="string"&&(e=void 0),Je({type:"mediaSource",sourceUpdater:this,action:Qe.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Bt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}Je({type:"audio",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Bt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}Je({type:"video",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(Io("audio",this)||Io("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Je({type:"audio",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Je({type:"video",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Je({type:"audio",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Je({type:"video",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),wE.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Cp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const td=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),IE=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},id=new Uint8Array(`
+
+`.split("").map(i=>i.charCodeAt(0)));class PE extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class LE extends ko{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Le();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return Le([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=En(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=id.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(id,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){js(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===St.TIMEOUT&&this.handleTimeout_(),e.code===St.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof E.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:A.Error.VttLoadError}}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){this.stopForError({message:a.message,metadata:{errorType:A.Error.VttCueParsingError}});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new E.VTTCue(a.startTime,a.endTime,a.text):a)}),gE(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,s=!1;if(typeof E.WebVTT!="function")throw new PE;typeof E.TextDecoder=="function"?t=new E.TextDecoder("utf8"):(t=E.WebVTT.StringDecoder(),s=!0);const r=new E.WebVTT.Parser(E,E.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{A.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=td(a)),r.parse(a)}let n=e.bytes;s&&(n=td(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/mi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const m=f.endTime-f.startTime,y=n===0?f.startTime+l:this.handleRollover_(f.startTime+l,t.time);f.startTime=Math.max(y,0),f.endTime=Math.max(y+m,0)}),!s.syncInfo){const f=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(f,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*mi.ONE_SECOND_IN_TS;const r=t*mi.ONE_SECOND_IN_TS;let n;for(r4294967296;)s+=n;return s/mi.ONE_SECOND_IN_TS}}const OE=function(i,e){const t=i.cues;for(let s=0;s=r.adStartTime&&e<=r.adEndTime)return r}return null},RE=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Wa{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}updateStorage_(e,t,s){const r=new Map;let n=`
+`,a=s,o=t;this.start_=a,e.forEach((l,f)=>{const m=this.storage_.get(o),y=a,T=y+l.duration,S=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),_=new sd({start:y,end:T,appended:S,segmentIndex:f});l.syncInfo=_;let D=a;const w=(l.parts||[]).map((k,I)=>{const M=D,R=D+k.duration,L=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[I]&&m.partsSyncInfo[I].isAppended),U=new sd({start:M,end:R,appended:L,segmentIndex:f,partIndex:I});return D=R,n+=`Media Sequence: ${o}.${I} | Range: ${M} --> ${R} | Appended: ${L}
+`,k.syncInfo=U,U});r.set(o,new ME(_,w)),n+=`${Sp(l.resolvedUri)} | Media Sequence: ${o} | Range: ${y} --> ${T} | Appended: ${S}
+`,o++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}const NE=86400,Ka=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=bo(e);r=r||0;for(let l=0;l{let n=null,a=null;r=r||0;const o=bo(e);for(let l=0;l=S)&&(a=S,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o=y)&&(a=y,n={time:m.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class BE extends A.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new Wa,audio:new Wa,vtt:new Wa},this.logger_=ut("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return Ka.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:f}=o,{segmentIndex:m,time:y}=l;if(m<0)continue;const T=e.segments[m],S=y,_=S+T.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${m}. Time: [${S} -> ${_}]}`),r>=S&&r<_)return this.logger_("Found sync point with exact match: ",l),l}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const s=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!s.length)return null;const r=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ws({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let o=0;oNE){A.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!r.start||ol){let f;o<0?f=s.start-Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=s.end+Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}}class FE extends A.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const UE=dp(hp(function(){var i=function(){function D(){this.listeners={}}var w=D.prototype;return w.on=function(I,M){this.listeners[I]||(this.listeners[I]=[]),this.listeners[I].push(M)},w.off=function(I,M){if(!this.listeners[I])return!1;var R=this.listeners[I].indexOf(M);return this.listeners[I]=this.listeners[I].slice(0),this.listeners[I].splice(R,1),R>-1},w.trigger=function(I){var M=this.listeners[I];if(M)if(arguments.length===2)for(var R=M.length,L=0;L>7)*283)^R]=R;for(L=U=0;!I[L];L^=X||1,U=J[U]||1)for(de=U^U<<1^U<<2^U<<3^U<<4,de=de>>8^de&255^99,I[L]=de,M[de]=L,ee=q[ue=q[X=q[L]]],te=ee*16843009^ue*65537^X*257^L*16843008,V=q[de]*257^de*16843008,R=0;R<4;R++)w[R][L]=V=V<<24^V>>>8,k[R][de]=te=te<<24^te>>>8;for(R=0;R<5;R++)w[R]=w[R].slice(0),k[R]=k[R].slice(0);return D};let s=null;class r{constructor(w){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let k,I,M;const R=this._tables[0][4],L=this._tables[1],U=w.length;let q=1;if(U!==4&&U!==6&&U!==8)throw new Error("Invalid aes key size");const J=w.slice(0),X=[];for(this._key=[J,X],k=U;k<4*U+28;k++)M=J[k-1],(k%U===0||U===8&&k%U===4)&&(M=R[M>>>24]<<24^R[M>>16&255]<<16^R[M>>8&255]<<8^R[M&255],k%U===0&&(M=M<<8^M>>>24^q<<24,q=q<<1^(q>>7)*283)),J[k]=J[k-U]^M;for(I=0;k;I++,k--)M=J[I&3?k:k-4],k<=4||I<4?X[I]=M:X[I]=L[0][R[M>>>24]]^L[1][R[M>>16&255]]^L[2][R[M>>8&255]]^L[3][R[M&255]]}decrypt(w,k,I,M,R,L){const U=this._key[1];let q=w^U[0],J=M^U[1],X=I^U[2],ue=k^U[3],ee,de,V;const te=U.length/4-2;let Xe,ie=4;const Te=this._tables[1],Pt=Te[0],ii=Te[1],si=Te[2],ri=Te[3],ni=Te[4];for(Xe=0;Xe>>24]^ii[J>>16&255]^si[X>>8&255]^ri[ue&255]^U[ie],de=Pt[J>>>24]^ii[X>>16&255]^si[ue>>8&255]^ri[q&255]^U[ie+1],V=Pt[X>>>24]^ii[ue>>16&255]^si[q>>8&255]^ri[J&255]^U[ie+2],ue=Pt[ue>>>24]^ii[q>>16&255]^si[J>>8&255]^ri[X&255]^U[ie+3],ie+=4,q=ee,J=de,X=V;for(Xe=0;Xe<4;Xe++)R[(3&-Xe)+L]=ni[q>>>24]<<24^ni[J>>16&255]<<16^ni[X>>8&255]<<8^ni[ue&255]^U[ie++],ee=q,q=J,J=X,X=ue,ue=ee}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(w){this.jobs.push(w),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},o=function(D,w,k){const I=new Int32Array(D.buffer,D.byteOffset,D.byteLength>>2),M=new r(Array.prototype.slice.call(w)),R=new Uint8Array(D.byteLength),L=new Int32Array(R.buffer);let U,q,J,X,ue,ee,de,V,te;for(U=k[0],q=k[1],J=k[2],X=k[3],te=0;te{const I=D[k];T(I)?w[k]={bytes:I.buffer,byteOffset:I.byteOffset,byteLength:I.byteLength}:w[k]=I}),w};self.onmessage=function(D){const w=D.data,k=new Uint8Array(w.encrypted.bytes,w.encrypted.byteOffset,w.encrypted.byteLength),I=new Uint32Array(w.key.bytes,w.key.byteOffset,w.key.byteLength/4),M=new Uint32Array(w.iv.bytes,w.iv.byteOffset,w.iv.byteLength/4);new l(k,I,M,function(R,L){self.postMessage(_({source:w.source,decrypted:L}),[L.buffer])})}}));var $E=cp(UE);const jE=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Dp=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Po=(i,e)=>{e.activePlaylistLoader=i,i.load()},qE=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if(!(a&&l&&a.id===l.id)&&(r.lastGroup_=a,r.lastTrack_=n,Dp(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&s.resetEverything();return}t.resyncLoader(),Po(a.playlistLoader,r)}},VE=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},HE=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,Dp(s,n),!!o)){if(o.isMainPlaylist){if(!a||!f||a.id===f.id)return;const m=e.vhs.playlistController_,y=m.selectPlaylist();if(m.media()===y)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(y);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){Po(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),Po(o.playlistLoader,n)}},Dn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}A.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;A.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},rd={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Dn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!s.paused()||o.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Dn[i](i,t))}},GE={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:l,logger_:f}},mainPlaylistLoader:m}=e,y=pr(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},y&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){o[T]||(o[T]=[]);for(const S in a[i][T]){let _=a[i][T][S],D;if(y?(f(`AUDIO group '${T}' label '${S}' is a main playlist`),_.isMainPlaylist=!0,D=null):s==="vhs-json"&&_.playlists?D=new $i(_.playlists[0],t,n):_.resolvedUri?D=new $i(_.resolvedUri,t,n):_.playlists&&s==="dash"?D=new Do(_.playlists[0],t,n,m):D=null,_=se({id:S,playlistLoader:D},_),rd[i](i,_.playlistLoader,e),o[T].push(_),typeof l[S]>"u"){const w=new A.AudioTrack({id:S,kind:jE(_),enabled:!1,language:_.language,default:_.default,label:S});l[S]=w}}}r.on("error",Dn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:f}},mainPlaylistLoader:m}=e;for(const y in o[i]){l[y]||(l[y]=[]);for(const T in o[i][y]){if(!s.options_.useForcedSubtitles&&o[i][y][T].forced)continue;let S=o[i][y][T],_;if(r==="hls")_=new $i(S.resolvedUri,s,a);else if(r==="dash"){if(!S.playlists.filter(w=>w.excludeUntil!==1/0).length)return;_=new Do(S.playlists[0],s,a,m)}else r==="vhs-json"&&(_=new $i(S.playlists?S.playlists[0]:S.resolvedUri,s,a));if(S=se({id:T,playlistLoader:_},S),rd[i](i,S.playlistLoader,e),l[y].push(S),typeof f[T]>"u"){const D=t.addRemoteTextTrack({id:T,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:T},!1).track;f[T]=D}}}n.on("error",Dn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const o in s[i][a]){const l=s[i][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(f[m.instreamId]&&(m=se(m,f[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(se({id:o},l)),typeof n[o]>"u"){const y=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[o]=y}}}}},wp=(i,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&pr(e.main))for(let l=0;l"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},WE={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},KE=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},XE=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{GE[f](f,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=zE(f,i),e[f].activeTrack=WE[f](f,i),e[f].onGroupChanged=qE(f,i),e[f].onGroupChanging=VE(f,i),e[f].onTrackChanged=HE(f,i),e[f].getActiveGroup=KE(f,i)});const o=e.AUDIO.activeGroup();if(o){const f=(o.filter(y=>y.default)[0]||o[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const f in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[f])},YE=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Bt,activeTrack:Bt,getActiveGroup:Bt,onGroupChanged:Bt,onTrackChanged:Bt,lastTrack_:null,logger_:ut(`MediaGroups[${e}]`)}}),i};class nd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Ge(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class QE extends A.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new nd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=ut("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ge(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(r,n)=>{if(r){if(n.status===410){this.logger_(`manifest request 410 ${r}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(n.status===429){const o=n.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${r}.`),this.logger_(`content steering will retry in ${o} seconds.`),this.startTTLTimeout_(parseInt(o,10));return}this.logger_(`manifest failed to load ${r}.`),this.startTTLTimeout_();return}const a=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(a),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new E.URL(e),s=new E.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(E.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new E.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=E.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){E.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new nd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Ge(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const JE=10;let Mt;const ZE=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],eC=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},tC=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!s)return A.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return l(`${f} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!Ui(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(l(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${f} as current playlist is live`),!0);const y=Du(e,t),T=o?De.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:De.MAX_BUFFER_LOW_WATER_LINE;if(a_)&&y>=r){let D=`${f} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return o&&(D+=` and next bandwidth > current bandwidth (${S} > ${_})`),l(D),!0}return l(`not ${f} as no switching criteria met`),!1};class iC extends A.EventTarget{constructor(e){super();const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:f,sourceType:m,cacheEncryptionKeys:y,bufferBasedABR:T,leastPixelDiffSelector:S,captionServices:_}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:D}=e;(D===null||typeof D>"u")&&(D=1/0),Mt=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!S,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=m,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=D,this.enableLowInitialPlaylist=f,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:D,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=YE(),this.mediaSource=new E.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Le(),this.hasPlayed_=!1,this.syncController_=new BE(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new $E,this.sourceUpdater_=new Ap(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new FE,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:_,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Do(t,this.vhs_,se(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new $i(t,this.vhs_,se(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new ko(se(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new ko(se(w,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new LE(se(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((M,R)=>{function L(){r.off("vttjserror",U),M()}function U(){r.off("vttjsloaded",L),R()}r.one("vttjsloaded",L),r.one("vttjserror",U),r.addWebVttScript_()})}),e);const k=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new QE(this.vhs_.xhr,k),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),ZE.forEach(M=>{this[M+"_"]=eC.bind(this,M)}),this.logger_=ut("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const I=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(I,()=>{const M=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-M,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);n&&n!==a&&(this.logger_(`switch media ${n} -> ${a} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=E.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(E.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=s.main||r.length&&s[r[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in s)if(s[o][n.label]){const l=s[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let f=0;f{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),XE({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const o in s.AUDIO[a])s.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Mt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return tC({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:JE}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Mt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=bt;const o=a.end(a.length-1);return o-n<=bt&&r-o<=bt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(ea),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return A.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const _=this.pathwayAttribute_(e),D=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(_),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(_)},D);return}let S=!1;r.forEach(_=>{if(_===e)return;const D=_.excludeUntil;typeof D<"u"&&D!==1/0&&(S=!0,delete _.excludeUntil)}),S&&(A.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+s*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:A.log.warn,m=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=l.targetDuration/2*1e3||5*1e3,T=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=y;return this.switchMedia_(l,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&s.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&s.push(o)}),s.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Ui(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Mt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let s=this.syncController_.getExpiredTime(t,this.duration());if(s===null)return;const r=this.mainPlaylistLoader_.main,n=Mt.Playlist.seekable(t,s,Mt.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(t,this.duration()),s===null||(e=Mt.Playlist.seekable(t,s,Mt.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,o;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Le([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=Xs(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||Eb),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Vl}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Vl,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(f,m)=>f?Zr(m):Ia(m),o={};let l;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const m=e[f].isFmp4?"browser":"muxer";o[m]=o[m]||[],o[m].push(r[f]),f==="audio"&&(l=m)}}),n&&l&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===f&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${l} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const f=Object.keys(o).reduce((m,y)=>(m&&(m+=", "),m+=`${y} does not support codec(s): "${o[y].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const f=[];if(["video","audio"].forEach(m=>{const y=(gt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(gt(r[m]||"")[0]||{}).type;y&&T&&y.toLowerCase()!==T.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=Xs(this.main,r),a=[];n.audio&&!Ia(n.audio)&&!Zr(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Ia(n.video)&&!Zr(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=Cn(gt(e)),n=zc(r),a=r.video&>(r.video)[0]||null,o=r.audio&>(r.audio)[0]||null;Object.keys(s).forEach(l=>{const f=s[l];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const m=[],y=Xs(this.mainPlaylistLoader_.main,f),T=zc(y);if(!(!y.audio&&!y.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const S=y.video&>(y.video)[0]||null,_=y.audio&>(y.audio)[0]||null;S&&a&&S.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${S.type}" !== "${a.type}"`),_&&o&&_.type.toLowerCase()!==o.type.toLowerCase()&&m.push(`audio codec "${_.type}" !== "${o.type}"`)}m.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),RE(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=De.GOAL_BUFFER_LENGTH,s=De.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,De.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=De.BUFFER_LOW_WATER_LINE,s=De.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,De.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,De.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return De.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Xc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),mE({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Xc(this.inbandTextTracks_,e,this.tech_),hE({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const r=this.contentSteeringController_.getAvailablePathways(),n=[];for(const a of e.playlists){const o=a.attributes.serviceLocation;if(o&&(n.push(o),!r.has(o)))return!0}return!!(!n.length&&r.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const o=s[a],l=this.pathwayAttribute_(o),f=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!f&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const y=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&f&&y&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,o]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const l=s.get(a);if(!l){t.filter(m=>m.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(o,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=s.lastExcludeReason_===t&&s.excludeUntil===1/0;o?o&&l&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,A.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:IE(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const sC=(i,e,t)=>s=>{const r=i.main.playlists[e],n=ku(r),a=ea(r);return typeof s>"u"?a:(s?delete r.disabled:r.disabled=!0,s!==a&&!n&&(t(r),s?i.trigger("renditionenabled"):i.trigger("renditiondisabled")),s)};class rC{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Xs(r.main(),t),this.playlist=t,this.id=s,this.enabled=sC(e.playlists,t.id,n)}}const nC=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=pr(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!ku(s)).map((s,r)=>new rC(i,s,s.id)):[]}},ad=["seeking","seeked","pause","playing","error"];class aC{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=ut("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(m=>{l[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",l[m].reset),this.tech_.on(["seeked","seeking"],l[m].reset)});const f=m=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(ad,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(ad,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",l[m].reset),this.tech_.off(["seeked","seeking"],l[m].reset)}),this.checkCurrentTimeTimeout_&&E.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&E.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=E.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=XS(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:gi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+bt>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const _=t.start(0);n=_+(_===t.end(0)?0:bt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${jf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,m=this.media(),y=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-Tt)*2,T=[l,f];for(let _=0;_ ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Wr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+bt;const a=!s.endList,o=typeof s.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const oC={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},kp=function(i,e){let t=0,s=0;const r=se(oC,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t{Object.defineProperty(ge,i,{get(){return A.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),De[i]},set(e){if(A.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){A.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}De[i]=e}})});const Pp="videojs-vhs",Lp=function(i,e){const t=e.media();let s=-1;for(let r=0;r{i.addQualityLevel(t)}),Lp(i,e.playlists)};ge.canPlaySource=function(){return A.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const pC=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=Cn(gt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Ys(s.video),n=Ys(s.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return se(i,a)},mC=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const o=s.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),gC=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=mC(r,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((f,m)=>{i.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,m)=>{i.eme.initializeMediaKeys({keySystems:l},y=>{if(y){m(y);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},yC=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=pC(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(A.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Op=()=>{if(!E.localStorage)return null;const i=E.localStorage.getItem(Pp);if(!i)return null;try{return JSON.parse(i)}catch{return null}},_C=i=>{if(!E.localStorage)return!1;let e=Op();e=e?se(e,i):i;try{E.localStorage.setItem(Pp,JSON.stringify(e))}catch{return!1}return e},vC=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,Rp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},Mp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},Np=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},Bp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!F||!F.createElement)return!1;const i=F.createElement("video");return A.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!F||!F.createElement||!A.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(F.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return A.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){Rp(ge.xhr,i)};ge.xhr.onResponse=function(i){Mp(ge.xhr,i)};ge.xhr.offRequest=function(i){Np(ge.xhr,i)};ge.xhr.offResponse=function(i){Bp(ge.xhr,i)};const TC=A.getComponent("Component");class Fp extends TC{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=ut("VhsHandler"),t.options_&&t.options_.playerId){const r=A.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(F,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=F.fullscreenElement||F.webkitFullscreenElement||F.mozFullScreenElement||F.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=se(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=Op();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=De.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===De.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=vC(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=Rd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.playlistController_=new iC(this.options_);const s=se({liveRangeSafeTimeDelta:bt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new aC(s),this.playlistController_.on("error",()=>{const n=A.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=E.navigator.connection||E.navigator.mozConnection||E.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){A.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>gi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>gi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&_C({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{nC(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=E.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),gC({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:A.Error.EMEKeySessionCreationError}})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=yC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=A.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{fC(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Lp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Ip,"mux.js":lC,"mpd-parser":cC,"m3u8-parser":dC,"aes-decrypter":hC}}version(){return this.constructor.version()}canChangeType(){return Ap.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&E.URL.revokeObjectURL&&(E.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Ax({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return up({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Rp(this.xhr,e)},this.xhr.onResponse=e=>{Mp(this.xhr,e)},this.xhr.offRequest=e=>{Np(this.xhr,e)},this.xhr.offResponse=e=>{Bp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const wn={name:"videojs-http-streaming",VERSION:Ip,canHandleSource(i,e={}){const t=se(A.options,e);return wn.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=se(A.options,t);return e.vhs=new Fp(i,e,s),e.vhs.xhr=sp(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=Rd(i);if(!t)return"";const s=wn.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(A.browser.IS_ANY_SAFARI||A.browser.IS_IOS),{overrideNative:s=t}=e;return s}},bC=()=>Zr("avc1.4d400d,mp4a.40.2");bC()&&A.getTech("Html5").registerSourceHandler(wn,0);A.VhsHandler=Fp;A.VhsSourceHandler=wn;A.Vhs=ge;A.use||A.registerComponent("Vhs",ge);A.options.vhs=A.options.vhs||{};(!A.getPlugin||!A.getPlugin("reloadSourceOnError"))&&A.registerPlugin("reloadSourceOnError",uC);/*! @name videojs-contrib-eme @version 3.11.2 @license Apache-2.0 */function kn(){return kn=Object.assign||function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;t&&(a=String.fromCharCode.apply(null,new Uint8Array(n))),e({cause:a});return}e(null,n)}});var AC=function(e){var t=String.fromCharCode.apply(null,new Uint16Array(e)),s=new E.DOMParser().parseFromString(t,"application/xml"),r=s.getElementsByTagName("HttpHeaders")[0],n={};if(r)for(var a=r.getElementsByTagName("name"),o=r.getElementsByTagName("value"),l=0;l"u"){s.mediaKeysObject=null,s.pendingSessionData=[];var y,T;m=new Promise(function(S,_){if(s.keySystem=a.keySystem,T=ud(a.keySystem,o.keySystems[a.keySystem]),!T.getCertificate){S(a);return}T.getCertificate(o,function(D,w){if(D){_(D);return}y=w,S()})}).then(function(){return a.createMediaKeys()}).then(function(S){return IC({player:t,video:s,certificate:y,createdMediaKeys:S})}).catch(function(S){return S?Promise.reject(S):Promise.reject("Failed to create and initialize a MediaKeys object")})}return m.then(function(){var S=ud(s.keySystem,o.keySystems[s.keySystem]),_=S.getLicense;return kC({player:t,video:s,initDataType:r,initData:n,options:o,getLicense:s.keySystem?OC(_,f):null,removeSession:l,eventBus:f})})},Ru="com.apple.fps.1_0",MC=function(e){var t=e.initData,s=e.id,r=e.cert;typeof s=="string"&&(s=SC(s));var n=0,a=new ArrayBuffer(t.byteLength+4+s.byteLength+4+r.byteLength),o=new DataView(a),l=new Uint8Array(a,n,t.byteLength);l.set(t),n+=t.byteLength,o.setUint32(n,s.byteLength,!0),n+=4;var f=new Uint16Array(a,n,s.length);f.set(s),n+=f.byteLength,o.setUint32(n,r.byteLength,!0),n+=4;var m=new Uint8Array(a,n,r.byteLength);return m.set(r),new Uint8Array(a,0,a.byteLength)},NC=function(e){var t=e.video,s=e.contentId,r=e.initData,n=e.cert,a=e.options,o=e.getLicense,l=e.eventBus;return new Promise(function(f,m){if(!t.webkitKeys)try{t.webkitSetMediaKeys(new E.WebKitMediaKeys(Ru))}catch{m("Could not create MediaKeys");return}var y;try{y=t.webkitKeys.createSession("video/mp4",MC({id:s,initData:r,cert:n}))}catch{m("Could not create key session");return}l.trigger("keysessioncreated"),y.contentId=s,y.addEventListener("webkitkeymessage",function(T){o(a,s,T.message,function(S,_){if(l&&l.trigger("licenserequestattempted"),S){m(S);return}y.update(new Uint8Array(_))})}),y.addEventListener("webkitkeyadded",function(){f()}),y.addEventListener("webkitkeyerror",function(){var T=y.error;m("KeySession error: code "+T.code+", systemCode "+T.systemCode)})})},BC=function(e){return function(t,s){var r=ta(t.emeHeaders,e.certificateHeaders);A.xhr({uri:e.certificateUri,responseType:"arraybuffer",headers:r},os(function(n,a){if(n){s(n);return}s(null,new Uint8Array(a))}))}},FC=function(e,t){return EC(xC(t))},UC=function(e){return function(t,s,r,n){var a=ta({"Content-type":"application/octet-stream"},t.emeHeaders,e.licenseHeaders);A.xhr({uri:e.licenseUri,method:"POST",responseType:"arraybuffer",body:r,headers:a},os(n,!0))}},$C=function(e){var t=e.video,s=e.initData,r=e.options,n=e.eventBus,a=r.keySystems[Ru],o=a.getCertificate||BC(a),l=a.getContentId||FC,f=a.getLicense||UC(a);return new Promise(function(m,y){o(r,function(T,S){if(T){y(T);return}m(S)})}).then(function(m){return NC({video:t,cert:m,initData:s,getLicense:f,options:r,contentId:l(r,s),eventBus:n})})},ji="com.microsoft.playready",jC=function(e,t,s,r){var n=e.keySystems[ji];if(typeof n.getKey=="function"){n.getKey(e,s.destinationURL,s.message.buffer,function(o,l){if(o){r.trigger({message:"Unable to get key: "+o,target:t,type:"mskeyerror"});return}t.update(l)});return}typeof n=="string"?n={url:n}:typeof n=="boolean"&&(n={}),n.url||(n.url=s.destinationURL);var a=function(l,f){if(r&&r.trigger("licenserequestattempted"),l){r.trigger({message:"Unable to request key from url: "+n.url,target:t,type:"mskeyerror"});return}t.update(new Uint8Array(f))};n.getLicense?n.getLicense(e,s.message.buffer,a):Up(n,s.message.buffer,e,a)},qC=function(e,t,s,r){var n=e.msKeys.createSession("video/mp4",t);if(!n)throw new Error("Could not create key session.");r.trigger("keysessioncreated"),n.addEventListener("mskeymessage",function(a){jC(s,n,a,r)}),n.addEventListener("mskeyerror",function(a){r.trigger({message:"Unexpected key error from key session with "+("code: "+n.error.code+" and systemCode: "+n.error.systemCode),target:n,type:"mskeyerror"})}),n.addEventListener("mskeyadded",function(){r.trigger({target:n,type:"mskeyadded"})})},VC=function(i){var e=i.video,t=i.initData,s=i.options,r=i.eventBus;e.msKeys&&delete e.msKeys;try{e.msSetMediaKeys(new E.MSMediaKeys(ji))}catch(n){throw new Error("Unable to create media keys for PlayReady key system. Error: "+n.message)}qC(e,t,s,r)},HC="3.11.2",GC=function(e,t){for(var s=0;s=0)&&(t[r]=i[r]);return t}function dd(i,e){if(i==null)return{};var t=ZC(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}var eA="1.12.1";const tA=A.getComponent("player");class iA extends tA{constructor(e,t,s){t=A.obj.merge(t,{plugins:{eme:!0}}),super(e,t,s)}audioTrack(e){const t=Array.from(this.player().audioTracks());if(!e)return t.find(a=>a.enabled);const{kind:s,language:r}=e,n=t.find(a=>a.language===r&&a.kind===s)||t.find(a=>a.language===r);return n&&(n.enabled=!0),n}bufferedRanges(){const e=[];for(let t=0;t!["chapters","metadata"].includes(a.kind));if(!e)return t.find(a=>a.mode==="showing");t.forEach(a=>a.mode="disabled");const{kind:s,language:r}=e;return t.find(a=>(a.language===r&&a.kind===s&&(a.mode="showing"),a.mode==="showing"))||t.find(a=>(a.language===r&&(a.mode="showing"),a.mode==="showing"))}}A.registerComponent("player",iA);const ye=A;ye.VERSION={pillarbox:eA,videojs:A.VERSION,[A.VhsSourceHandler.name]:A.VhsSourceHandler.VERSION,eme:A.getPlugin("eme").VERSION};ye.options.enableSmoothSeeking=!0;ye.options.fill=!0;ye.options.html5={vhs:{useForcedSubtitles:!0}};ye.options.liveTracker={trackingThreshold:120,liveTolerance:15};ye.options.liveui=!0;ye.options.playsinline=!0;ye.options.responsive=!0;ye.options.trackers={};class hd{constructor(e="il.srgssr.ch"){this.setIlHost(e)}setIlHost(e){this.baseUrl=`${e}/integrationlayer/2.1/`}handleRequest(e){var t=this;return function(){var s=Ni(function*(r){const n=typeof e=="function"?e(r):t.mediaCompositionUrlHandler(r),a=yield fetch(n);if(!a.ok)throw a;return yield a.json()});return function(r){return s.apply(this,arguments)}}()}mediaCompositionUrlHandler(e){return`https://${this.baseUrl}mediaComposition/byUrn/${e}?onlyChapters=true&vector=portalplay`}}const Ri={WIDTH_240:"240",WIDTH_320:"320",WIDTH_480:"480",WIDTH_960:"960",WIDTH_1920:"1920"},Qr={JPG:"jpg",WEBP:"webp",PNG:"png"},sA="https://il.srgssr.ch/images/";class rA{static scale({url:e,width:t=Ri.WIDTH_960,format:s=Qr.JPG}={},r=sA){if(!e)return;const n=new URL(r);return n.searchParams.set("imageUrl",e),n.searchParams.set("format",s),n.searchParams.set("width",t),decodeURIComponent(n.href)}static get JPG(){return Qr.JPG}static get PNG(){return Qr.PNG}static get WEBP(){return Qr.WEBP}static get WIDTH_240(){return Ri.WIDTH_240}static get WIDTH_320(){return Ri.WIDTH_320}static get WIDTH_480(){return Ri.WIDTH_480}static get WIDTH_960(){return Ri.WIDTH_960}static get WIDTH_1920(){return Ri.WIDTH_1920}}const nA={WIDEVINE:"com.widevine.alpha",FAIRPLAY:"com.apple.fps.1_0",PLAYREADY:"com.microsoft.playready"};class rr{static buildKeySystems(e=[]){const t={};return e.forEach(s=>{const r=rr.vendors[s.type];if(rr.vendors.FAIRPLAY===r){const{certificateUrl:n,licenseUrl:a}=s;t[r]={certificateUri:n,licenseUri:a}}else t[r]=s.licenseUrl}),{keySystems:t}}static hasDrm(e){return e.some(({drmList:t})=>t&&t.length>0)}static get vendors(){return nA}}const Jr={AKAMAI:"AKAMAI",NONE:"NONE"};class Ti{static aclPath(e){const t=e.pathname;return`${t.substring(0,t.lastIndexOf("/")+1)}*`}static get AKAMAI(){return Jr.AKAMAI}static hasToken(e){return e.some(t=>Ti.isAkamai(t.tokenType))}static isAkamai(e){return Jr.AKAMAI===e}static isNone(e){return Jr.NONE===e}static get NONE(){return Jr.NONE}static tokenize(e,t){const s=new URL(`${e.url}`),r=Ti.aclPath(s),n=`${t}${encodeURIComponent(r)}`;return fetch(n).then(a=>a.ok?a.json():Promise.reject({status:a.status,statusText:a.statusText})).then(({token:{authparams:a}})=>(new URLSearchParams(a).forEach((l,f)=>s.searchParams.set(f,l)),Object.assign({},e,{url:s.toString()}))).catch(a=>Promise.reject(a))}static tokenizeSources(e,t="https://tp.srgssr.ch/akahd/token?acl="){const s=[];return e.forEach(r=>{const n=Ti.tokenize(r,t);s.push(n)}),Promise.all(s).then(r=>r).catch(r=>Promise.reject(r))}}const fd="emptied",pd="ended",md="loadeddata",gd="loadstart",Xa="pause",aA="play",Ya="playing",yd="ratechange",_d="seeking",Qa="timeupdate",vd="waiting";class pi{constructor(e,{debug:t=!1,environment:s="prod",playerVersion:r="none",tagCommanderScriptURL:n="//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js"}={}){this.isDebugEnabled=t,this.elapsedPlaybackTime=0,this.environment=s,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isSeeking=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.pendingTagCommanderReload=!1,this.player=e,this.playerVersion=r,this.srcMediaData=void 0,this.startPlaybackSession=0,this.tagCommanderScriptURL=n,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0,this.initScript(),this.initListeners()}beforeunload(){this.notify("stop")}clearTimers(){clearInterval(this.heartBeatIntervalId),clearInterval(this.uptimeIntervalId),clearTimeout(this.uptimeTimeoutId)}currentTime(){return Math.round(this.trackedCurrentTime)}debug(e){if(e===void 0)return this.isDebugEnabled||this.player.debug();this.isDebugEnabled=!!e}destroy(){this.clearTimers(),window.tc_vars||(window.tc_vars={}),this.elapsedPlaybackTime=0,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.srcMediaData=void 0,this.startPlaybackSession=0,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0}dispose(){this.beforeunload(),this.clearTimers(),window.removeEventListener("beforeunload",this.beforeunloadListener),this.player.off(fd,this.emptiedListener),this.player.off(pd,this.endedListener),this.player.off(gd,this.loadstartListener),this.player.off(md,this.loadeddataListener),this.player.off(Ya,this.playListener),this.player.off(Xa,this.pauseListener),this.player.off(yd,this.rateChangeListener),this.player.off(_d,this.seekingListener),this.player.off(Qa,this.timeUpdateListener),this.player.off(vd,this.waitingListener)}emptied(){this.player.ended()||this.notify("stop")}ended(){this.notify("eof"),this.mediaSession=0,this.clearTimers()}flush(){this.isTrackerDisabled()||(this.pendingTagCommanderReload&&window.tC&&(window.tC.container.reload(),this.pendingTagCommanderReload=!1),window.tc_events_11&&this.pendingQueue.length>0&&(this.pendingQueue.forEach(e=>{window.tc_events_11(this.player.el(),e.action,e.labels)}),this.pendingQueue=[]))}getCurrentAudioTrack(){const e=Array.from(this.player.audioTracks()).find(s=>s.enabled);let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getCurrentTextTrack(){const e=this.player.textTrack();let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getDvrWindowPosition(){const{liveTracker:e}=this.player,t=this.currentTime()-e.seekableStart()|0,s=e.liveWindow()-t;return s<0||s===1/0?0:s*1e3}getDvrWindowSize(){const e=this.player.liveTracker.liveWindow()===1/0,t=this.player.liveTracker.liveWindow()*1e3;return e?0:t}getElapsedPlaybackTime(){return this.startPlaybackSession?this.getElapsedPlayingTime():this.elapsedPlaybackTime}getElapsedPlayingTime(){const e=pi.now()-this.startPlaybackSession|0;return this.elapsedPlaybackTime+e}getEventLabels(e){const t={event_id:e,event_timestamp:pi.now(),media_dvr_window_length:0,media_dvr_window_offset:0,media_is_dvr:!1,media_is_live:!1,media_mute:this.player.muted()?"1":"0",media_playback_rate:this.player.playbackRate(),media_position:this.currentTime(),media_quality:this.srcMediaData.mediaData.quality,media_subtitles_on:this.isTextTrackEnabled(),media_volume:(this.player.volume()*100).toFixed(0),navigation_environment:this.environment};return this.isAudioTrackEnabled()&&(t.media_audio_track=this.getCurrentAudioTrack()),this.isTextTrackEnabled()&&(t.media_subtitle_selection=this.getCurrentTextTrack()),this.isMediaOnDemand()||(t.media_is_live=!0,t.media_position=this.getElapsedPlaybackTime()),this.isMediaDvr()&&(t.media_dvr_window_offset=this.getDvrWindowPosition()|0,t.media_dvr_window_length=this.getDvrWindowSize()|0,t.media_is_dvr=!0,t.media_timeshift=[aA,Xa].includes(e)?this.timeShifted():0),t}getInternalLabels(){const e={media_bu_distributer:this.srcMediaData.mediaData.vendor,media_chromecast_selected:!!this.player.tech(!0).isCasting,media_embedding_url:document.referrer,media_player_display:"default",media_player_name:"pillarbox-web",media_player_version:this.playerVersion,media_url:this.srcMediaData.src},t=this.srcMediaData.mediaData.analyticsMetadata||{};window.tc_vars=Object.assign({},window.tc_vars,e,t)}heartBeat(){this.heartBeatIntervalId=setInterval(()=>{this.player.paused()||this.notify("pos")},3e4)}initCallbacks(){this.beforeunloadListener=this.beforeunload.bind(this),this.emptiedListener=this.emptied.bind(this),this.endedListener=this.ended.bind(this),this.loadstartListener=this.loadstart.bind(this),this.loadeddataListener=this.loadeddata.bind(this),this.playListener=this.play.bind(this),this.pauseListener=this.pause.bind(this),this.rateChangeListener=this.rateChange.bind(this),this.seekingListener=this.seeking.bind(this),this.timeUpdateListener=this.timeUpdate.bind(this),this.waitingListener=this.waiting.bind(this)}initListeners(){this.initCallbacks(),window.addEventListener("beforeunload",this.beforeunloadListener),this.player.on(fd,this.emptiedListener),this.player.on(pd,this.endedListener),this.player.on(gd,this.loadstartListener),this.player.on(md,this.loadeddataListener),this.player.on(Ya,this.playListener),this.player.on(Xa,this.pauseListener),this.player.on(yd,this.rateChangeListener),this.player.on(_d,this.seekingListener),this.player.on(Qa,this.timeUpdateListener),this.player.on(vd,this.waitingListener),this.player.one("dispose",this.dispose.bind(this))}initScript(){const e="tc_script__11";if(!document.querySelector(`#${e}`)){const t=document.createElement("script"),s=this.tagCommanderScriptURL;t.defer=!0,t.id=e,t.src=s,t.type="text/javascript",t.onload=r=>{this.flush()},document.body.appendChild(t)}}isAudioTrackEnabled(){return!!this.getCurrentAudioTrack()}isMediaDvr(){const{trackingThreshold:e}=this.player.liveTracker.options();return!this.isMediaOnDemand()&ðis.player.liveTracker.liveWindow()}isMediaOnDemand(){return Number.isFinite(this.player.duration())}isTextTrackEnabled(){return!!this.getCurrentTextTrack()}isTrackerDisabled(){return!this.srcMediaData||!this.srcMediaData.mediaData?!0:Array.isArray(this.srcMediaData.disableTrackers)?!!this.srcMediaData.disableTrackers.find(e=>e.toLowerCase()===pi.name.toLowerCase()):!!this.srcMediaData.disableTrackers}loadstart(){this.destroy(),this.updateSrcMediaData(this.player.currentSource()),!this.isTrackerDisabled()&&(this.getInternalLabels(),this.reloadTagCommanderContainer(),this.notify("buffer_start"),this.hasStarted=!1)}loadeddata(){this.notify("init"),this.initialized=!0,this.notify("buffer_stop")}log(e,t,s="log"){this.debug()&&console[s](`SRGAnalytics:${e}`,t,window.tc_vars)}notify(e,t){if(this.isTrackerDisabled())return;try{this.flush()}catch(r){this.log(e,r,"error")}const s=Object.assign({},this.getEventLabels(e),t);this.log(e,s);try{window.tc_events_11?window.tc_events_11(this.player.el(),e,s):this.pendingQueue.push({action:e,labels:s})}catch(r){this.log(e,r,"error")}}static now(){return(Date.now()/1e3).toFixed(0)}play(){this.hasStarted||(this.hasStarted=!0),!this.startPlaybackSession&&!this.isMediaOnDemand()&&(this.startPlaybackSession=pi.now()),this.mediaSession===0&&(this.mediaSession=pi.now(),this.heartBeat(),this.uptime()),this.timeUpdate(),this.notify("play"),this.isSeeking&&(this.isSeeking=!1)}pause(){if(this.isMediaOnDemand()||(this.elapsedPlaybackTime=this.getElapsedPlayingTime(),this.startPlaybackSession=0),!this.player.seeking()&&!this.isMediaLive()&&this.player.currentTime(){!this.player.paused()&&!this.isMediaOnDemand()&&this.notify("uptime")};this.uptimeTimeoutId=setTimeout(()=>{e(),this.uptimeIntervalId=setInterval(()=>{e()},6e4)},3e4)}waiting(){if(!this.initialized||this.isWaiting)return;const e=()=>{this.isWaiting=!1,this.notify("buffer_stop")};this.isWaiting=!0,this.notify("buffer_start"),ye.browser.IS_ANY_SAFARI?this.player.one(Qa,e):this.player.one(Ya,e)}}class oA{findChapterByUrn(e){if(this.chapterList){const[t]=this.chapterList.filter(s=>s.urn===e);return t}}findMainSegment(){if(!this.segmentUrn)return;const e=this.getMainSegments(),[t]=e.filter(s=>s.urn===this.segmentUrn);return t}findResourceListByUrn(e){const t=this.findChapterByUrn(e);if(t)return t.resourceList||[]}getChapters(){const e="AUDIO";return this.getMainChapter().mediaType===e?[]:this.chapterList.filter(({mediaType:t})=>t!==e)}getFilteredExternalSubtitles(){const{subtitleList:e}=this.getMainChapter(),[{subtitleInformationList:t}={}]=this.getResourceList().filter(({subtitleInformationList:n})=>n),s=e&&!t;if(!e)return[];const r=e.filter(n=>n.format!=="TTML");return s?r:r.filter(n=>!t.find(o=>o.locale===n.locale&&n.type===o.type))}getMainBlockReason(){const e=this.getMainChapter();if(!e)return;let{blockReason:t}=e;return!t&&new Datee.blockReason)}getMainChapter(){return this.mainChapter||(this.mainChapter=this.findChapterByUrn(this.chapterUrn)),!this.mainChapter&&this.chapterList&&this.chapterList.length>0&&([this.mainChapter]=this.chapterList),this.mainChapter}getMainChapterImageUrl(){const e=this.getMainChapter();if(!(!e||!e.imageUrl))return e.imageUrl}getMainResources(){const e=this.getResourceList();if(!(!e||!e.length))return e.map(t=>({analyticsData:this.getMergedAnalyticsData(t.analyticsData),analyticsMetadata:this.getMergedAnalyticsMetadata(t.analyticsMetadata),blockReason:this.getMainChapter().blockReason,blockedSegments:this.getMainBlockedSegments(),imageUrl:this.getMainChapterImageUrl(),chapters:this.getChapters(),drmList:t.drmList,dvr:t.dvr,eventData:this.getMainChapter().eventData,id:this.getMainChapter().id,imageCopyright:this.getMainChapter().imageCopyright,intervals:this.getMainTimeIntervals(),live:t.live,mediaType:this.getMainChapter().mediaType,mimeType:t.mimeType,presentation:t.presentation,quality:t.quality,streaming:t.streaming,streamOffset:t.streamOffset,subtitles:this.getFilteredExternalSubtitles(),title:this.getMainChapter().title,tokenType:t.tokenType,url:t.url,urn:this.chapterUrn,vendor:this.getMainChapter().vendor}))}getMainSegments(){const e=this.getMainChapter();return!this.mainSegments&&e&&e.segmentList&&(this.mainSegments=e.segmentList),this.mainSegments||[]}getMainTimeIntervals(){const{timeIntervalList:e=[]}=this.getMainChapter()||{};return e}getMainValidFromDate(){const e=this.getMainChapter();if(!e)return new Date(0);const{validFrom:t}=e;if(t)return new Date(t)}getMergedAnalyticsData(e){return Pe(Pe(Pe({},this.analyticsData),this.getMainChapter().analyticsData),e)}getMergedAnalyticsMetadata(e){return Pe(Pe(Pe({},this.analyticsMetadata),this.getMainChapter().analyticsMetadata),e)}getResourceList(){const{resourceList:e}=this.getMainChapter();return e||[]}}var Hp="Wiedergabe",Gp="Pause",zp="Erneut abspielen",Wp="Dauer",Kp="LIVE",Xp="Geladen",Yp="Status",Qp="Vollbild",Jp="Stumm schalten",Zp="Ton einschalten",em="Untertitel",tm="Untertitel",im="Kapitel",sm="Schließen",rm="Beschreibungen",nm="Schrift",am="Weiß",om="Schwarz",um="Rot",lm="Grün",cm="Blau",dm="Gelb",hm="Magenta",fm="Türkis",pm="Hintergrund",mm="Fenster",gm="Durchsichtig",ym="Undurchsichtig",_m="Kein",vm="Erhoben",Tm="Gedrückt",bm="Uniform",Sm="Zwanglos",xm="Schreibschrift",Em="Zurücksetzen",Cm="Fertig",Am="Farbe",Dm="Deckkraft",uA={Play:Hp,Pause:Gp,Replay:zp,"Current Time":"Aktueller Zeitpunkt",Duration:Wp,"Remaining Time":"Verbleibende Zeit","Stream Type":"Streamtyp",LIVE:Kp,Loaded:Xp,Progress:Yp,Fullscreen:Qp,"Exit Fullscreen":"Vollbildmodus beenden",Mute:Jp,Unmute:Zp,"Playback Rate":"Wiedergabegeschwindigkeit",Subtitles:em,"subtitles off":"Untertitel aus",Captions:tm,"captions off":"Untertitel aus",Chapters:im,"You aborted the media playback":"Sie haben die Videowiedergabe abgebrochen.","A network error caused the media download to fail part-way.":"Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.","No compatible source was found for this media.":"Für dieses Video wurde keine kompatible Quelle gefunden.","Play Video":"Video abspielen",Close:sm,"Modal Window":"Modales Fenster","This is a modal window":"Dies ist ein modales Fenster","This modal can be closed by pressing the Escape key or activating the close button.":'Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche "Schließen" wird dieses modale Fenster geschlossen.',", opens captions settings dialog":", öffnet Einstellungen für Untertitel",", opens subtitles settings dialog":", öffnet Einstellungen für Untertitel",", selected":", ausgewählt","captions settings":"Untertiteleinstellungen","subtitles settings":"Untertiteleinstellungen","descriptions settings":"Einstellungen für Beschreibungen","Close Modal Dialog":"Modales Fenster schließen",Descriptions:rm,"descriptions off":"Beschreibungen aus","The media is encrypted and we do not have the keys to decrypt it.":"Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",", opens descriptions settings dialog":", öffnet Einstellungen für Beschreibungen","Audio Track":"Tonspur",Text:nm,White:am,Black:om,Red:um,Green:lm,Blue:cm,Yellow:dm,Magenta:hm,Cyan:fm,Background:pm,Window:mm,Transparent:gm,"Semi-Transparent":"Halbdurchsichtig",Opaque:ym,"Font Size":"Schriftgröße","Text Edge Style":"Textkantenstil",None:_m,Raised:vm,Depressed:Tm,Uniform:bm,"Drop shadow":"Schlagschatten","Font Family":"Schriftfamilie","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:Sm,Script:xm,"Small Caps":"Small-Caps",Reset:Em,"restore all settings to the default values":"Alle Einstellungen auf die Standardwerte zurücksetzen",Done:Cm,"Caption Settings Dialog":"Einstellungsdialog für Untertitel","Beginning of dialog window. Escape will cancel and close the window.":"Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.","End of dialog window.":"Ende des Dialogfensters.","Audio Player":"Audio-Player","Video Player":"Video-Player","Progress Bar":"Fortschrittsbalken","progress bar timing: currentTime={1} duration={2}":"{1} von {2}","Volume Level":"Lautstärke","{1} is loading.":"{1} wird geladen.","Seek to live, currently behind live":"Zur Live-Übertragung wechseln. Aktuell wird es nicht live abgespielt.","Seek to live, currently playing live":"Zur Live-Übertragung wechseln. Es wird aktuell live abgespielt.","Exit Picture-in-Picture":"Bild-im-Bild-Modus beenden","Picture-in-Picture":"Bild-im-Bild-Modus","No content":"Kein Inhalt",Color:Am,Opacity:Dm,"Text Background":"Texthintergrund","Caption Area Background":"Hintergrund des Untertitelbereichs","Playing in Picture-in-Picture":"Wird im Bild-im-Bild-Modus wiedergegeben","Skip forward {1} seconds":"{1} Sekunden vorwärts","Skip backward {1} seconds":"{1} Sekunden zurück"},lA=Object.freeze({__proto__:null,Background:pm,Black:om,Blue:cm,Captions:tm,Casual:Sm,Chapters:im,Close:sm,Color:Am,Cyan:fm,Depressed:Tm,Descriptions:rm,Done:Cm,Duration:Wp,Fullscreen:Qp,Green:lm,LIVE:Kp,Loaded:Xp,Magenta:hm,Mute:Jp,None:_m,Opacity:Dm,Opaque:ym,Pause:Gp,Play:Hp,Progress:Yp,Raised:vm,Red:um,Replay:zp,Reset:Em,Script:xm,Subtitles:em,Text:nm,Transparent:gm,Uniform:bm,Unmute:Zp,White:am,Window:mm,Yellow:dm,default:uA}),wm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 20:00 und 06:00 Uhr zur Verfügung.",km="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 23:00 und 05:00 Uhr zur Verfügung.",Im="Die Werbung wurde übersprungen.",Pm="Dieser Inhalt ist nicht mehr verfügbar.",Lm="Dieser Inhalt ist ausserhalb der Schweiz nicht verfügbar.",Om="Dieser Inhalt ist aus rechtlichen Gründen nicht verfügbar.",Rm="Dieser Inhalt ist noch nicht verfügbar. Bitte probieren Sie es später noch einmal.",Mm="Dieser Inhalt ist nicht verfügbar.",cA={AGERATING12:wm,AGERATING18:km,COMMERCIAL:Im,ENDDATE:Pm,GEOBLOCK:Lm,LEGAL:Om,STARTDATE:Rm,UNKNOWN:Mm},dA=Object.freeze({__proto__:null,AGERATING12:wm,AGERATING18:km,COMMERCIAL:Im,ENDDATE:Pm,GEOBLOCK:Lm,LEGAL:Om,STARTDATE:Rm,UNKNOWN:Mm,default:cA});ye.addLanguage("de",Pe(Pe({},lA),dA));var Nm="Play",Bm="Pause",Fm="Replay",Um="Duration",$m="LIVE",jm="Loaded",qm="Progress",Vm="Fullscreen",Hm="Mute",Gm="Unmute",zm="Subtitles",Wm="Captions",Km="Chapters",Xm="Descriptions",Ym="Close",Qm="Text",Jm="White",Zm="Black",eg="Red",tg="Green",ig="Blue",sg="Yellow",rg="Magenta",ng="Cyan",ag="Background",og="Window",ug="Transparent",lg="Opaque",cg="None",dg="Raised",hg="Depressed",fg="Uniform",pg="Casual",mg="Script",gg="Reset",yg="Done",_g="Color",vg="Opacity",hA={"Audio Player":"Audio Player","Video Player":"Video Player",Play:Nm,Pause:Bm,Replay:Fm,"Current Time":"Current Time",Duration:Um,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:$m,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:jm,Progress:qm,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:Vm,"Exit Fullscreen":"Exit Fullscreen",Mute:Hm,Unmute:Gm,"Playback Rate":"Playback Rate",Subtitles:zm,"subtitles off":"subtitles off",Captions:Wm,"captions off":"captions off",Chapters:Km,Descriptions:Xm,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:Ym,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:Qm,White:Jm,Black:Zm,Red:eg,Green:tg,Blue:ig,Yellow:sg,Magenta:rg,Cyan:ng,Background:ag,Window:og,Transparent:ug,"Semi-Transparent":"Semi-Transparent",Opaque:lg,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:cg,Raised:dg,Depressed:hg,Uniform:fg,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:pg,Script:mg,"Small Caps":"Small Caps",Reset:gg,"restore all settings to the default values":"restore all settings to the default values",Done:yg,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:_g,Opacity:vg,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},fA=Object.freeze({__proto__:null,Background:ag,Black:Zm,Blue:ig,Captions:Wm,Casual:pg,Chapters:Km,Close:Ym,Color:_g,Cyan:ng,Depressed:hg,Descriptions:Xm,Done:yg,Duration:Um,Fullscreen:Vm,Green:tg,LIVE:$m,Loaded:jm,Magenta:rg,Mute:Hm,None:cg,Opacity:vg,Opaque:lg,Pause:Bm,Play:Nm,Progress:qm,Raised:dg,Red:eg,Replay:Fm,Reset:gg,Script:mg,Subtitles:zm,Text:Qm,Transparent:ug,Uniform:fg,Unmute:Gm,White:Jm,Window:og,Yellow:sg,default:hA}),Tg="To protect children this content is only available between 8PM and 6AM.",bg="To protect children this content is only available between 10PM and 5AM.",Sg="This commercial content is not available.",xg="This content is not available anymore.",Eg="This content is not available outside Switzerland.",Cg="This content is not available due to legal restrictions.",Ag="This content is not available yet.",Dg="This content is not available.",pA={AGERATING12:Tg,AGERATING18:bg,COMMERCIAL:Sg,ENDDATE:xg,GEOBLOCK:Eg,LEGAL:Cg,STARTDATE:Ag,UNKNOWN:Dg},mA=Object.freeze({__proto__:null,AGERATING12:Tg,AGERATING18:bg,COMMERCIAL:Sg,ENDDATE:xg,GEOBLOCK:Eg,LEGAL:Cg,STARTDATE:Ag,UNKNOWN:Dg,default:pA});ye.addLanguage("en",Pe(Pe({},fA),mA));var wg="Lecture",kg="Pause",Ig="Revoir",Pg="Durée",Lg="EN DIRECT",Og="Chargé",Rg="Progression",Mg="Plein écran",Ng="Mettre en sourdine",Bg="Activer le son",Fg="Sous-titres",Ug="Sous-titres transcrits",$g="Chapitres",jg="Descriptions",qg="Fermer",Vg="Texte",Hg="Blanc",Gg="Noir",zg="Rouge",Wg="Vert",Kg="Bleu",Xg="Jaune",Yg="Magenta",Qg="Cyan",Jg="Arrière-plan",Zg="Fenêtre",e0="Transparent",t0="Opaque",i0="Aucun",s0="Élevé",r0="Enfoncé",n0="Uniforme",a0="Manuscrite",o0="Scripte",u0="Réinitialiser",l0="Terminé",c0="Couleur",d0="Opacité",gA={"Audio Player":"Lecteur audio","Video Player":"Lecteur vidéo",Play:wg,Pause:kg,Replay:Ig,"Current Time":"Temps actuel",Duration:Pg,"Remaining Time":"Temps restant","Stream Type":"Type de flux",LIVE:Lg,"Seek to live, currently behind live":"Rechercher le direct, actuellement après le direct","Seek to live, currently playing live":"Rechercher le direct, le direct actuellement en cours de lecture",Loaded:Og,Progress:Rg,"Progress Bar":"Barre de progression","progress bar timing: currentTime={1} duration={2}":"{1} de {2}",Fullscreen:Mg,"Exit Fullscreen":"Fenêtré",Mute:Ng,Unmute:Bg,"Playback Rate":"Vitesse de lecture",Subtitles:Fg,"subtitles off":"Sous-titres désactivés",Captions:Ug,"captions off":"Sous-titres transcrits désactivés",Chapters:$g,Descriptions:jg,"descriptions off":"descriptions désactivées","Audio Track":"Piste audio","Volume Level":"Niveau de volume","You aborted the media playback":"Vous avez interrompu la lecture de la vidéo.","A network error caused the media download to fail part-way.":"Une erreur de réseau a interrompu le téléchargement de la vidéo.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.","No compatible source was found for this media.":"Aucune source compatible n'a été trouvée pour cette vidéo.","The media is encrypted and we do not have the keys to decrypt it.":"Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.","Play Video":"Lire la vidéo",Close:qg,"Close Modal Dialog":"Fermer la boîte de dialogue modale","Modal Window":"Fenêtre modale","This is a modal window":"Ceci est une fenêtre modale","This modal can be closed by pressing the Escape key or activating the close button.":"Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.",", opens captions settings dialog":", ouvrir les paramètres des sous-titres transcrits",", opens subtitles settings dialog":", ouvrir les paramètres des sous-titres",", opens descriptions settings dialog":", ouvrir les paramètres des descriptions",", selected":", sélectionné","captions settings":"Paramètres des sous-titres transcrits","subtitles settings":"Paramètres des sous-titres","descriptions settings":"Paramètres des descriptions",Text:Vg,White:Hg,Black:Gg,Red:zg,Green:Wg,Blue:Kg,Yellow:Xg,Magenta:Yg,Cyan:Qg,Background:Jg,Window:Zg,Transparent:e0,"Semi-Transparent":"Semi-transparent",Opaque:t0,"Font Size":"Taille des caractères","Text Edge Style":"Style des contours du texte",None:i0,Raised:s0,Depressed:r0,Uniform:n0,"Drop shadow":"Ombre portée","Font Family":"Famille de polices","Proportional Sans-Serif":"Polices à chasse variable sans empattement (Proportional Sans-Serif)","Monospace Sans-Serif":"Polices à chasse fixe sans empattement (Monospace Sans-Serif)","Proportional Serif":"Polices à chasse variable avec empattement (Proportional Serif)","Monospace Serif":"Polices à chasse fixe avec empattement (Monospace Serif)",Casual:a0,Script:o0,"Small Caps":"Petites capitales",Reset:u0,"restore all settings to the default values":"Restaurer tous les paramètres aux valeurs par défaut",Done:l0,"Caption Settings Dialog":"Boîte de dialogue des paramètres des sous-titres transcrits","Beginning of dialog window. Escape will cancel and close the window.":"Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.","End of dialog window.":"Fin de la fenêtre de dialogue.","Exit Picture-in-Picture":"Quitter le mode image dans l'image","Picture-in-Picture":"Image dans l'image","{1} is loading.":"{1} en cours de chargement.","No content":"Aucun contenu",Color:c0,Opacity:d0,"Text Background":"Arrière-plan du texte","Caption Area Background":"Arrière-plan de la zone de sous-titre","Skip backward {1} seconds":"Reculer de {1} secondes","Skip forward {1} seconds":"Avancer de {1} secondes"},yA=Object.freeze({__proto__:null,Background:Jg,Black:Gg,Blue:Kg,Captions:Ug,Casual:a0,Chapters:$g,Close:qg,Color:c0,Cyan:Qg,Depressed:r0,Descriptions:jg,Done:l0,Duration:Pg,Fullscreen:Mg,Green:Wg,LIVE:Lg,Loaded:Og,Magenta:Yg,Mute:Ng,None:i0,Opacity:d0,Opaque:t0,Pause:kg,Play:wg,Progress:Rg,Raised:s0,Red:zg,Replay:Ig,Reset:u0,Script:o0,Subtitles:Fg,Text:Vg,Transparent:e0,Uniform:n0,Unmute:Bg,White:Hg,Window:Zg,Yellow:Xg,default:gA}),h0="Pour protéger les enfants, ce contenu est accessible entre 20h et 6h.",f0="Pour protéger les enfants, ce contenu est accessible entre 23h et 5h.",p0="Ce contenu n'est actuellement pas disponible.",m0="Ce contenu n'est plus disponible.",g0="La RTS ne dispose pas des droits de diffusion en dehors de la Suisse.",y0="Pour des raisons juridiques, ce contenu n'est pas disponible.",_0="Ce contenu n'est pas encore disponible. Veuillez réessayer plus tard.",v0="Ce contenu n'est actuellement pas disponible.",_A={AGERATING12:h0,AGERATING18:f0,COMMERCIAL:p0,ENDDATE:m0,GEOBLOCK:g0,LEGAL:y0,STARTDATE:_0,UNKNOWN:v0},vA=Object.freeze({__proto__:null,AGERATING12:h0,AGERATING18:f0,COMMERCIAL:p0,ENDDATE:m0,GEOBLOCK:g0,LEGAL:y0,STARTDATE:_0,UNKNOWN:v0,default:_A});ye.addLanguage("fr",Pe(Pe({},yA),vA));var T0="Play",b0="Pausa",S0="Replay",x0="Durata",E0="LIVE",C0="Caricato",A0="Stato",D0="Schermo intero",w0="Disattiva l’audio",k0="Attiva l’audio",I0="Sottotitoli",P0="Sottotitoli non udenti",L0="Capitolo",O0="Descrizioni",R0="Chiudi",M0="Testo",N0="Bianco",B0="Nero",F0="Rosso",U0="Verde",$0="Blu",j0="Giallo",q0="Magenta",V0="Ciano",H0="Sfondo",G0="Finestra",z0="Trasparente",W0="Opaco",K0="Nessuno",X0="Uniforme",Y0="Reinizializza",Q0="Fatto",J0="Colore",Z0="Opacità",TA={"Audio Player":"Lettore audio","Video Player":"Lettore video",Play:T0,Pause:b0,Replay:S0,"Current Time":"Orario attuale",Duration:x0,"Remaining Time":"Tempo rimanente","Stream Type":"Tipo di streaming",LIVE:E0,Loaded:C0,Progress:A0,"Progress Bar":"Barra di avanzamento","progress bar timing: currentTime={1} duration={2}":"{1} di {2}",Fullscreen:D0,"Exit Fullscreen":"Chiudi Schermo intero",Mute:w0,Unmute:k0,"Playback Rate":"Velocità di riproduzione",Subtitles:I0,"subtitles off":"Senza sottotitoli",Captions:P0,"captions off":"Senza sottotitoli non udenti",Chapters:L0,Descriptions:O0,"descriptions off":"Descrizioni disattivate","Audio Track":"Traccia audio","Volume Level":"Livello del volume","You aborted the media playback":"La riproduzione del contenuto multimediale è stata interrotta.","A network error caused the media download to fail part-way.":"Il download del contenuto multimediale è stato interrotto a causa di un problema rete.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il contenuto multimediale non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La riproduzione del contenuto multimediale è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.","No compatible source was found for this media.":"Non ci sono fonti compatibili per questo contenuto multimediale.","The media is encrypted and we do not have the keys to decrypt it.":"Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.","Play Video":"Riproduci il video",Close:R0,"Close Modal Dialog":"Chiudi la finestra di dialogo","Modal Window":"Finestra di dialogo","This is a modal window":"Questa è una finestra di dialogo","This modal can be closed by pressing the Escape key or activating the close button.":"Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.",", opens captions settings dialog":", aprire i parametri della trascrizione dei sottotitoli",", opens subtitles settings dialog":", aprire i parametri dei sottotitoli",", opens descriptions settings dialog":", aprire i parametri delle descrizioni",", selected":", selezionato","captions settings":"Parametri sottotitoli non udenti","subtitles settings":"Parametri sottotitoli","descriptions settings":"Parametri descrizioni",Text:M0,White:N0,Black:B0,Red:F0,Green:U0,Blue:$0,Yellow:j0,Magenta:q0,Cyan:V0,Background:H0,Window:G0,Transparent:z0,"Semi-Transparent":"Semi-Trasparente",Opaque:W0,"Font Size":"Dimensione dei caratteri","Text Edge Style":"Stile dei bordi del testo",None:K0,Uniform:X0,"Drop shadow":"Ombra","Font Family":"Carattere","Proportional Sans-Serif":"Sans-Serif proporzionale","Monospace Sans-Serif":"Sans-Serif monospaziato","Proportional Serif":"Serif proporzionale","Monospace Serif":"Serif monospaziato","Small Caps":"Maiuscoletto",Reset:Y0,"restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:Q0,"Caption Settings Dialog":"Finestra di dialogo dei parametri della trascrizione dei sottotitoli","Beginning of dialog window. Escape will cancel and close the window.":"Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.","End of dialog window.":"Fine della finestra di dialogo.","{1} is loading.":"{1} in fase di caricamento.","Exit Picture-in-Picture":"Esci dalla modalità Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture",Color:J0,Opacity:Z0,"Text Background":"Sfondo testo","Caption Area Background":"Sfondo area sottotitoli","Skip forward {1} seconds":"Avanti {1} secondi","Skip backward {1} seconds":"Indietro {1} secondi"},bA=Object.freeze({__proto__:null,Background:H0,Black:B0,Blue:$0,Captions:P0,Chapters:L0,Close:R0,Color:J0,Cyan:V0,Descriptions:O0,Done:Q0,Duration:x0,Fullscreen:D0,Green:U0,LIVE:E0,Loaded:C0,Magenta:q0,Mute:w0,None:K0,Opacity:Z0,Opaque:W0,Pause:b0,Play:T0,Progress:A0,Red:F0,Replay:S0,Reset:Y0,Subtitles:I0,Text:M0,Transparent:z0,Uniform:X0,Unmute:k0,White:N0,Window:G0,Yellow:j0,default:TA}),ey="Per proteggere i bambini, questo media è disponibile solo fra le 20 e le 6.",ty="Per proteggere i bambini, questo media è disponibile solo fra le 23 le 5.",iy="Questo contenuto commerciale non è disponibile.",sy="Questo media non è più disponibile.",ry="Questo media non è disponibile fuori dalla Svizzera.",ny="Il contenuto non è fruibile a causa di restrizioni legali.",ay="Il contenuto non è ancora disponibile. Per cortesia prova più tardi.",oy="Questo media non è disponibile.",SA={AGERATING12:ey,AGERATING18:ty,COMMERCIAL:iy,ENDDATE:sy,GEOBLOCK:ry,LEGAL:ny,STARTDATE:ay,UNKNOWN:oy},xA=Object.freeze({__proto__:null,AGERATING12:ey,AGERATING18:ty,COMMERCIAL:iy,ENDDATE:sy,GEOBLOCK:ry,LEGAL:ny,STARTDATE:ay,UNKNOWN:oy,default:SA});ye.addLanguage("it",Pe(Pe({},bA),xA));var uy="Laschar ir",ly="Pausa",cy="Mussar danovamain",dy="Durada",hy="LIVE",fy="Chargià",py="Progress",my="Entir visur",gy="Senza tun",yy="Cun tun",_y="Suttitels",vy="Suttitels",Ty="Chapitels",by="Descripziuns",Sy="Serrar",xy="Text",Ey="Alv",Cy="Nair",Ay="Cotschn",Dy="Verd",wy="Blau",ky="Mellen",Iy="Magenta",Py="Cyan",Ly="Fund",Oy="Fanestra",Ry="Transparent",My="Betg transparent",Ny="Nagin",By="Auzà",Fy="Sbassà",Uy="Uniform",$y="Sumbriva",jy="Casual",qy="Script",Vy="Da nov",Hy="Fatg",Gy="Per proteger uffants, è quest cuntegn disponibel mo tranter las 20.00 e las 06.00.",zy="Per proteger uffants, è quest cuntegn disponibel mo tranter las 23.00 e las 05.00.",Wy="Quest medium commerzial n'è betg disponibel.",Ky="Quest cuntegn n'è betg pli disponibel.",Xy="Quest cuntegn n'è betg disponibel ordaifer la Svizra.",Yy="Quest cuntegn n'è betg disponibel perquai ch'el è scadì.",Qy="Quest cuntegn n'è betg anc disponibel. Empruvai pli tard.",Jy="Quest cuntegn n'è betg disponibel.",EA={"Audio Player":"Audio-Player","Video Player":"Video-Player",Play:uy,Pause:ly,Replay:cy,"Current Time":"Temp actual",Duration:dy,"Remaining Time":"Temp restant","Stream Type":"Tip dal stream",LIVE:hy,Loaded:fy,Progress:py,"Progress Bar":"Bar da progessiun","progress bar timing: currentTime={1} duration={2}":"{1} da {2}",Fullscreen:my,"Non-Fullscreen":"Betg entir visur",Mute:gy,Unmute:yy,"Playback Rate":"Tempo ",Subtitles:_y,"subtitles off":"senza suttitels",Captions:vy,"captions off":"senza suttitels",Chapters:Ty,Descriptions:by,"descriptions off":"senza descripziuns","Audio Track":"Piese audio","Volume Level":"Nivel dal volumen","You aborted the media playback":"Vus avais interrut il vdieo","A network error caused the media download to fail part-way.":"In sbagl en la rait ha impedì il download","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il video n'è betg chargià - ubain per in sbagl da server / da la rait, ubain ch'il format n'è betg cumpatibel.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Il video è interrut: Ubain ch'il video è donnegià, ubain che funcziuns n'èn betg cumpatiblas.","No compatible source was found for this media.":"Chattà nagina funtauna cumpatibla per quest video.","The media is encrypted and we do not have the keys to decrypt it.":"Il video è codifitgà da moda nunenconuschenta.","Play Video":"Aviar video",Close:Sy,"Close Modal Dialog":"Serrar la fanestra modala","Modal Window":"Fanestra modala","This is a modal window":"Quai è ina fanestra modala","This modal can be closed by pressing the Escape key or activating the close button.":'Questa fanestra modala pudais serrar cun la tasta "Escape" ubain cun il buttun.',", opens captions settings dialog":", avra opziuns per ils suttitels",", opens subtitles settings dialog":", avra opziuns per ils suttitels",", opens descriptions settings dialog":", avra opziuns per la descripziun",", selected":", selecziunà","captions settings":"opziuns per ils suttitels","subtitles settings":"opziuns per ils suttitels","descriptions settings":"opziuns per la descripziun",Text:xy,White:Ey,Black:Cy,Red:Ay,Green:Dy,Blue:wy,Yellow:ky,Magenta:Iy,Cyan:Py,Background:Ly,Window:Oy,Transparent:Ry,"Semi-Transparent":"Mez transparent",Opaque:My,"Font Size":"Grandezza dal text","Text Edge Style":"Stil dal text",None:Ny,Raised:By,Depressed:Fy,Uniform:Uy,Dropshadow:$y,"Font Family":"Scrittira","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:jy,Script:qy,"Small Caps":"Bustabs pitschens",Reset:Vy,"restore all settings to the default values":"Enavos tar las opziuns da standard",Done:Hy,"Caption Settings Dialog":"Opziuns per suttitels","Beginning of dialog window. Escape will cancel and close the window.":"Entschatta da la fanestra da dialog. Escape stizza e serra la fanestra.","End of dialog window.":"Fin da la fanestra da dialog.",AGERATING12:Gy,AGERATING18:zy,COMMERCIAL:Wy,ENDDATE:Ky,GEOBLOCK:Xy,LEGAL:Yy,STARTDATE:Qy,UNKNOWN:Jy},CA=Object.freeze({__proto__:null,AGERATING12:Gy,AGERATING18:zy,Background:Ly,Black:Cy,Blue:wy,COMMERCIAL:Wy,Captions:vy,Casual:jy,Chapters:Ty,Close:Sy,Cyan:Py,Depressed:Fy,Descriptions:by,Done:Hy,Dropshadow:$y,Duration:dy,ENDDATE:Ky,Fullscreen:my,GEOBLOCK:Xy,Green:Dy,LEGAL:Yy,LIVE:hy,Loaded:fy,Magenta:Iy,Mute:gy,None:Ny,Opaque:My,Pause:ly,Play:uy,Progress:py,Raised:By,Red:Ay,Replay:cy,Reset:Vy,STARTDATE:Qy,Script:qy,Subtitles:_y,Text:xy,Transparent:Ry,UNKNOWN:Jy,Uniform:Uy,Unmute:yy,White:Ey,Window:Oy,Yellow:ky,default:EA});ye.addLanguage("rm",Pe({},CA));const AA=["url","mimeType","keySystems"],DA=["src"];class Q{static addBlockedSegments(e,t=[]){const s="srgssr-blocked-segments",r=e.textTracks().getTrackById(s);if(r&&e.textTracks().removeTrack(r),!Array.isArray(t)||!t.length)return;const n=t.filter(a=>a.blockReason);n.length&&Q.createTextTrack(e,s).then(a=>{n.forEach(o=>{Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addRemoteTextTracks(e,t=[]){Array.isArray(t)&&t.forEach(({type:s,language:r,locale:n,url:a})=>{e.addRemoteTextTrack({kind:s==="SDH"?"captions":"subtitles",label:r,language:n,src:a})})}static addTextTrackCue(e,t){const s=(Number.isFinite(t.markIn)?t.markIn:t.fullLengthMarkIn)/1e3,r=(Number.isFinite(t.markOut)?t.markOut:t.fullLengthMarkOut)/1e3;e.addCue(new VTTCue(s,r,JSON.stringify(t)))}static addTextTracks(e,{mediaData:t}){Q.addRemoteTextTracks(e,t.subtitles),Q.addChapters(e,t.urn,t.chapters),Q.addBlockedSegments(e,t.blockedSegments),Q.addIntervals(e,t.intervals)}static addChapters(e,t,s=[]){const r="srgssr-chapters",n=e.textTracks().getTrackById(r);n&&e.textTracks().removeTrack(n),!(!Array.isArray(s)||!s.length)&&Q.createTextTrack(e,r).then(a=>{s.forEach(o=>{t===o.fullLengthUrn&&Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addIntervals(e,t=[]){const s="srgssr-intervals",r=e.textTracks().getTrackById(s);r&&e.textTracks().removeTrack(r),!(!Array.isArray(t)||!t.length)&&Q.createTextTrack(e,s).then(n=>{t.forEach(a=>{Q.addTextTrackCue(n,a)}),e.textTracks().addTrack(n)})}static blockingReason(e,t){if(!t.mediaData.blockReason)return;const s=e.localize(t.mediaData.blockReason);return Q.error(e,{code:MediaError.MEDIA_ERR_ABORTED,message:s,metadata:{errorType:t.mediaData.blockReason,src:t}}),!0}static composeAkamaiResources(e=[]){return Ni(function*(){return Ti.hasToken(e)?Ti.tokenizeSources(e):Promise.resolve(e)})()}static composeKeySystemsResources(e=[]){return rr.hasDrm(e),e.map(t=>Pe(Pe({},t),rr.buildKeySystems(t.drmList)))}static composeMainResources(e){return Q.composeAkamaiResources(Q.composeKeySystemsResources(Q.filterIncompatibleResources(e.getMainResources())))}static composeSrcMediaData({mediaData:e,disableTrackers:t},s){const r=ye.obj.merge(s,e),{url:n,mimeType:a,keySystems:o}=r,l=dd(r,AA);return{src:n,type:a,keySystems:o,disableTrackers:t,mediaData:l}}static createTextTrack(e,t){return new Promise(s=>{setTimeout(()=>{s(new ye.TextTrack({id:t,kind:"metadata",label:t,tech:e.tech(!0)}))},100)})}static cuechangeEventProxy(e){e.textTracks().on("addtrack",({track:t})=>{["srgssr-chapters","srgssr-intervals"].includes(t.id)&&t.on("cuechange",()=>{const[s]=Array.from(t.activeCues),r=t.id.includes("srgssr-chapters")?"srgssr/chapter":"srgssr/interval";e.trigger({type:r,data:s})})})}static dataProvider(e){if(!e.options().srgOptions.dataProvider){const{dataProviderHost:t,dataProviderUrlHandler:s}=e.options().srgOptions,n=new hd(t).handleRequest(s);e.options({srgOptions:{dataProvider:n}})}return e.options().srgOptions.dataProvider}static dataProviderError(e,t){if(!t)return;const s=t.statusText?t.statusText:t.message;return Q.error(e,{code:0,message:e.localize("UNKNOWN"),metadata:{errorType:"UNKNOWN",urn:e.src(),status:t.status,statusText:s,url:t.url}}),!0}static error(e,{code:t,message:s,metadata:r}){e.error(null),e.error({code:t,message:s,metadata:r})}static filterIncompatibleResources(e=[]){return e.filter(t=>!["RTMP","HDS"].includes(t.streaming))}static getBlockedSegment(e){const s=e.textTracks().getTrackById("srgssr-blocked-segments");if(!s)return;const[r]=Array.from(s.activeCues);return r}static getBlockedSegmentByTime(e,t){const s=Q.getBlockedSegment(e);return s&&t>=s.startTime&&tr===t)||e[0]}static getSrcMediaObj(e,t){return Ni(function*(){const{src:s}=t,r=dd(t,DA),n=yield Q.getMediaComposition(s,Q.dataProvider(e)),a=yield Q.composeMainResources(n),o=Q.getMediaData(a);return Q.composeSrcMediaData(r,o)})()}static handleCurrentTime(e,t){const s=Q.getBlockedSegmentByTime(e,t);if(!s||!Number.isFinite(s.endTime))return t;const r=s.endTime+.1;return e.trigger({type:"srgssr/blocked-segment",data:s}),e.currentTime(r),r}static handleSetCurrentTime(e,t){const{endTime:s}=Q.getBlockedSegmentByTime(e,t)||{};return Number.isFinite(s)?s:t}static handleSetSource(e,t,s){return Ni(function*(){try{const r=yield Q.getSrcMediaObj(e,t);return Q.srgAnalytics(e),Q.updateTitleBar(e,r),Q.updatePoster(e,r),Q.blockingReason(e,r)?void 0:(Q.addTextTracks(e,r),s(null,r))}catch(r){return Q.dataProviderError(e,r)?void 0:s(r)}})()}static srgAnalytics(e){if(e.options().trackers.srgAnalytics!==!1&&!e.options().trackers.srgAnalytics){const t=new pi(e,{debug:e.debug(),playerVersion:ye.VERSION.pillarbox,tagCommanderScriptURL:e.options().srgOptions.tagCommanderScriptURL});e.options({trackers:{srgAnalytics:t}})}}static updatePoster(e,t,s=rA){e.poster(s.scale({url:t.mediaData.imageUrl}))}static updateTitleBar(e,t){e.titleBar&&e.titleBar.update({title:t.mediaData.vendor,description:t.mediaData.title})}static middleware(e){return Q.cuechangeEventProxy(e),{currentTime:t=>Q.handleCurrentTime(e,t),setCurrentTime:t=>Q.handleSetCurrentTime(e,t),setSource:function(){var t=Ni(function*(s,r){return Q.handleSetSource(e,s,r)});return function(r,n){return t.apply(this,arguments)}}()}}}ye.use("srgssr/urn",Q.middleware);ye.options.srgOptions={dataProvider:void 0,dataProviderHost:void 0,dataProviderUrlHandler:void 0,tagCommanderScriptURL:void 0};const wA="2.0.0",kA=A.getPlugin("plugin"),Td=A.log.createLogger("pillarbox-playlist"),_t={NO_REPEAT:0,REPEAT_ALL:1,REPEAT_ONE:2};class Mu extends kA{constructor(t,s){super(t);Rt(this,"items_",[]);Rt(this,"currentIndex_",-1);Rt(this,"previousNavigationThreshold",3);Rt(this,"repeat",_t.NO_REPEAT);Rt(this,"autoadvance",!1);Rt(this,"onEnded_",()=>this.handleEnded());s=this.options_=A.obj.merge(this.options_,s),s.playlist&&s.playlist.length&&t.ready(()=>{this.load(...s.playlist)}),this.autoadvance=!!s.autoadvance,this.repeat=s.repeat??this.repeat,this.previousNavigationThreshold=Number.isFinite(s.previousNavigationThreshold)?s.previousNavigationThreshold:this.previousNavigationThreshold,this.player.on("ended",this.onEnded_)}toggleRepeat(t=void 0){this.repeat=t??(this.repeat+1)%3}isRepeatOneMode(){return this.repeat===_t.REPEAT_ONE}isRepeatAllMode(){return this.repeat===_t.REPEAT_ALL}isNoRepeatMode(){return this.repeat===_t.NO_REPEAT}toggleAutoadvance(t=void 0){this.autoadvance=t??!this.autoadvance}dispose(){this.player.off("ended",this.onEnded_)}load(t){this.items_=[...t],this.select(0)}push(...t){this.items_.push(...t),this.updateState_()}splice(t,s,...r){const n=r.length,a=this.items_.splice(t,s,...r),o=a.length;return this.currentIndex_>=t&&this.currentIndex_=t&&(this.currentIndex_=this.currentIndex_-o+n),this.updateState_(),a}clear(){this.items_=[],this.currentIndex_=-1,this.updateState_()}reverse(){this.items_.length&&(this.items_.reverse(),this.currentIndex_=this.items_.length-1-this.currentIndex_,this.updateState_())}sort(t){if(!this.items_.length)return;const s=this.currentItem;this.items_.sort(t),this.currentIndex_=this.items_.indexOf(s),this.updateState_()}get currentIndex(){return this.currentIndex_}get currentItem(){return this.items_[this.currentIndex_]}get items(){return[...this.items_]}select(t){if(t<0||t>=this.items_.length){Td.warn(`Index: ${t} is out of bounds (The current playlist has ${this.items_.length} elements)`);return}if(t===this.currentIndex_){Td.warn(`Index: ${t} is already selected`);return}const s=this.items_[t];this.player.src(s.sources),this.player.poster(s.poster),this.currentIndex_=t,this.updateState_()}next(){if(this.hasNext()){this.select(this.currentIndex_+1);return}this.repeat===_t.REPEAT_ALL&&this.select(0)}hasNext(){return this.currentIndex_+1this.previousNavigationThreshold){this.player.currentTime(0);return}this.select(this.currentIndex_-1)}isLive(){const t=this.player.liveTracker;return t&&t.isLive()}hasPrevious(){return this.currentIndex_>0}handleEnded(){if(this.repeat===_t.REPEAT_ONE){this.player.play().then(()=>{});return}this.autoadvance&&this.next()}shuffle(){for(let t=this.items_.length-1;t>0;t-=1){const s=Math.floor(Math.random()*(t+1));[this.items_[t],this.items_[s]]=[this.items_[s],this.items_[t]],this.currentIndex_===t?this.currentIndex_=s:this.currentIndex_===s&&(this.currentIndex_=t)}this.updateState_()}updateState_(){this.setState({items:JSON.stringify(this.items_),currentIndex:this.currentIndex_})}}Mu.VERSION=wA;Mu.prototype.options_={autoadvance:!1,repeat:!1};A.registerPlugin("pillarboxPlaylist",Mu);const IA=A.getComponent("Button");class PA extends IA{constructor(t,s){s=A.mergeOptions({controlText:"Playlist"},s);super(t,s);Rt(this,"onPlaylistStateChanged_",({changes:t})=>{"items"in t&&this.toggleVisibility()});this.setIcon("chapters"),this.playlist().on("statechanged",this.onPlaylistStateChanged_)}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-chapters",!0)}dispose(){this.playlist().off("statechanged",this.onPlaylistStateChanged_),super.dispose()}buildCSSClass(){return`pbw-playlist-button vjs-hidden ${super.buildCSSClass()}`}handleClick(t){super.handleClick(t),this.player().getChild("PillarboxPlaylistMenuDialog").open()}toggleVisibility(){if(this.playlist().items.length>0){this.show();return}this.hide()}}A.registerComponent("PillarboxPlaylistButton",PA);const LA=A.getComponent("Button");let OA=class extends LA{constructor(e,t){var s,r;super(e,t),this.selected(t.index===this.playlist().currentIndex),this.controlText(`${(s=this.options_.item.data)==null?void 0:s.title} - ${A.formatTime((r=this.options_.item.data)==null?void 0:r.duration)}`)}playlist(){return this.player().pillarboxPlaylist()}handleClick(e){super.handleClick(e),this.playlist().select(this.options_.index)}selected(e){this.toggleClass("vjs-selected",e)}buildCSSClass(){return`pbw-playlist-item-button vjs-visible-text ${super.buildCSSClass()}`}};A.registerComponent("PillarboxPlaylistMenuItem",OA);const RA=A.getComponent("Button");class MA extends RA{constructor(e,t){t=A.mergeOptions({controlText:"Next Item"},t),super(e,t),this.setIcon("next-item")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-next-item",!0)}handleClick(e){super.handleClick(e),this.playlist().next()}}A.registerComponent("PillarboxPlaylistNextItemButton",MA);const NA=A.getComponent("Button");class BA extends NA{constructor(e,t){t=A.mergeOptions({controlText:"Previous Item"},t),super(e,t),this.setIcon("previous-item")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-previous-item",!0)}handleClick(e){super.handleClick(e),this.playlist().previous()}}A.registerComponent("PillarboxPlaylistPreviousItemButton",BA);const FA=A.getComponent("Button");class UA extends FA{constructor(e,t){t=A.mergeOptions({controlText:"Repeat"},t),super(e,t),this.controlText(this.repeatModeAsString()),this.setIcon("repeat")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-repeat",!0)}repeatModeAsString(){switch(this.playlist().repeat){case _t.NO_REPEAT:return"No Repeat";case _t.REPEAT_ALL:return"Repeat All";case _t.REPEAT_ONE:return"Repeat One"}}buildCSSClass(){return`${this.playlist().repeat?"vjs-selected":""} ${super.buildCSSClass()}`}handleClick(e){super.handleClick(e),this.playlist().toggleRepeat(),this.toggleClass("vjs-selected",!this.playlist().isNoRepeatMode()),this.toggleClass("pbw-repeat-one",this.playlist().isRepeatOneMode()),this.controlText(this.repeatModeAsString()),this.setAttribute("aria-pressed",!this.playlist().isNoRepeatMode())}}A.registerComponent("PillarboxPlaylistRepeatButton",UA);const $A=A.getComponent("Button");class jA extends $A{constructor(e,t){t=A.mergeOptions({controlText:"Shuffle"},t),super(e,t),this.setIcon("shuffle")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-shuffle",!0)}handleClick(e){super.handleClick(e),this.playlist().shuffle()}}A.registerComponent("PillarboxPlaylistShuffleButton",jA);const qA=A.getComponent("Component");class Zy extends qA{}Zy.prototype.options_={className:"pbw-playlist-controls",children:["pillarboxPlaylistRepeatButton","pillarboxPlaylistShuffleButton","pillarboxPlaylistPreviousItemButton","pillarboxPlaylistNextItemButton"]};A.registerComponent("PillarboxPlaylistControls",Zy);const VA=A.getComponent("PillarboxPlaylistMenuItem"),bd=A.getComponent("Component"),HA=A.getComponent("ModalDialog");class GA extends HA{constructor(t,s){s.temporary=!1,s=A.mergeOptions({pauseOnOpen:!1},s);super(t,s);Rt(this,"onPlaylistStateChanged_",({changes:t})=>{"items"in t&&(this.removeItems(),this.renderItems()),"currentIndex"in t&&this.select(t.currentIndex.to)});this.fill(),this.addChild("PillarboxPlaylistControls",s.pillarboxPlaylistControls),this.renderItems(),this.playlist().on("statechanged",this.onPlaylistStateChanged_)}buildCSSClass(){return`pbw-playlist-dialog ${super.buildCSSClass()}`}dispose(){this.playlist().off("statechanged",this.onPlaylistStateChanged_),super.dispose()}playlist(){return this.player().pillarboxPlaylist()}select(t){this.getChild("PillarboxPlaylistMenuItemsList").children().filter(r=>r.name()==="PillarboxPlaylistMenuItem").map(r=>r.getChild("PillarboxPlaylistMenuItemButton")).forEach(r=>r.selected(t===r.options().index))}removeItems(){this.removeChild(this.getChild("PillarboxPlaylistMenuItemsList"))}renderItems(){const t=new bd(this.player(),{name:"PillarboxPlaylistMenuItemsList",el:A.dom.createEl("ol",{className:"pbw-playlist-items"})});this.playlist().items.forEach((s,r)=>{const n=new bd(this.player(),{name:"PillarboxPlaylistMenuItem",el:A.dom.createEl("li",{className:"pbw-playlist-item"})});n.addChild(new VA(this.player(),{item:s,index:r,name:"PillarboxPlaylistMenuItemButton"})),t.addChild(n)}),this.addChild(t)}}A.registerComponent("PillarboxPlaylistMenuDialog",GA);const zA="Wiedergabeliste",WA="Mischen",KA={"Next Item":"Nächstes element","No Repeat":"Keine Wiederholung",Playlist:zA,"Previous Item":"Vorheriges Element","Repeat All":"Alle Wiederholen","Repeat One":"Einzelnes Wiederholen",Shuffle:WA},XA="Playlist",YA="Shuffle",QA={"Next Item":"Next Item","No Repeat":"No Repeat",Playlist:XA,"Previous Item":"Previous Item","Repeat All":"Repeat All","Repeat One":"Repeat One",Shuffle:YA},JA="Liste de lecture",ZA="Mélanger",eD={"Next Item":"Élément suivant","No Repeat":"Pas de Répétition",Playlist:JA,"Previous Item":"Élément précédent","Repeat All":"Répéter Tout","Repeat One":"Répéter Un",Shuffle:ZA},tD="Playlist",iD="Mescola",sD={"Next Item":"Elemento successivo","No Repeat":"Nessuna Ripetizione",Playlist:tD,"Previous Item":"Elemento precedente","Repeat All":"Ripeti Tutto","Repeat One":"Ripeti Uno",Shuffle:iD},rD="Glista da reprodukziun",nD="Maschadar",aD={"Next Item":"Element proxim","No Repeat":"Nagins Repeter",Playlist:rD,"Previous Item":"Element precedent","Repeat All":"Repeter Tut","Repeat One":"Repeter In",Shuffle:nD};function mr(i,e){A.addLanguage(i,{...A.options.language[i]??{},...e})}mr("de",KA);mr("en",QA);mr("fr",eD);mr("it",sD);mr("rm",aD);const oD=A.getPlugin("plugin"),uD=A.log.createLogger("pillarbox-playlist-ui");class e_ extends oD{constructor(e,t){if(super(e),!e.usingPlugin("pillarboxPlaylist")){uD.error("pillarbox-playlist plugin is required");return}t=this.options_=A.obj.merge(this.options_,t),e.options({pillarboxPlaylistMenuDialog:t.pillarboxPlaylistMenuDialog??!0,controlBar:this.mergeControlBarOptions(e,t)})}mergeControlBarOptions(e,t){if(e.options_.controlBar===!1)return e.options_.controlBar;const s=A.obj.merge(A.getComponent("ControlBar").prototype.options_,e.options_.controlBar),r=s.children.findIndex(n=>n===t.insertChildBefore);if(t.insertChildBefore&&r!==-1){const n=[...s.children];return n.splice(r,0,"pillarboxPlaylistButton"),s.children=n,s}return s.pillarboxPlaylistButton=t.pillarboxPlaylistButton??!0,s}}e_.prototype.options_={insertChildBefore:"fullscreenToggle"};A.registerPlugin("pillarboxPlaylistUI",e_);const Nu=new URLSearchParams(location.search),lD=Nu.has("debug"),cD=Nu.get("ilHost")||void 0,dD=Nu.get("language");window.player=ye("player",{debug:lD,language:dD,autoplay:!0,srgOptions:{dataProviderHost:cD},plugins:{pillarboxPlaylist:{autoadvance:!0,repeat:_t.REPEAT_ALL},pillarboxPlaylistUI:!0}});const hD=["urn:rts:video:14827742","urn:srf:video:05457f66-fd67-4131-8e0a-6d85743efc39","urn:rtr:video:33136b80-bec6-40cd-a771-b8954c805098","urn:rts:video:9883196"];Promise.all(hD.map(async i=>{const t=(await Q.getMediaComposition(i,Q.dataProvider(player))).getMainChapter();return{sources:[{src:i,type:"srgssr/urn"}],data:{title:t.title,duration:t.duration/1e3},poster:t.imageUrl}})).then(i=>{player.pillarboxPlaylist().load(i)});window.player=player;window.pillarbox=ye;
diff --git a/pr-preview/pr-31/packages/pillarbox-playlist/index.html b/pr-preview/pr-31/packages/pillarbox-playlist/index.html
new file mode 100644
index 0000000..13592fb
--- /dev/null
+++ b/pr-preview/pr-31/packages/pillarbox-playlist/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Pillarbox-Playlist Demo
+
+
+
+
+
+
+
+
+
diff --git a/pr-preview/pr-31/packages/skip-button/assets/index-9QwUlAKx.css b/pr-preview/pr-31/packages/skip-button/assets/index-9QwUlAKx.css
new file mode 100644
index 0000000..a1f89c5
--- /dev/null
+++ b/pr-preview/pr-31/packages/skip-button/assets/index-9QwUlAKx.css
@@ -0,0 +1 @@
+.vjs-control.vjs-button.pbw-skip-button{position:absolute;bottom:5em;padding-left:1.333em;color:#fff;font-size:1.2em;background-color:#000000b3;cursor:pointer}.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level,.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before,.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js,.pillarbox-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen,.pillarbox-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen,.pillarbox-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"],[tabindex="-1"].pillarbox-js{outline:none}.video-js *,.pillarbox-js *,.video-js *:before,.pillarbox-js *:before,.video-js *:after,.pillarbox-js *:after{box-sizing:inherit}.video-js ul,.pillarbox-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.vjs-fluid.pillarbox-js,.video-js.vjs-16-9,.vjs-16-9.pillarbox-js,.video-js.vjs-4-3,.vjs-4-3.pillarbox-js,.video-js.vjs-9-16,.vjs-9-16.pillarbox-js,.video-js.vjs-1-1,.vjs-1-1.pillarbox-js{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.vjs-fluid.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode),.vjs-fill.pillarbox-js:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech,.pillarbox-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech,.vjs-audio-only-mode.pillarbox-js .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,.vjs-full-window .vjs-fullscreen.pillarbox-js,body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),.vjs-fullscreen.pillarbox-js:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive,.vjs-fullscreen.vjs-user-inactive.pillarbox-js{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen,.pillarbox-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button,.pillarbox-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.pillarbox-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.pillarbox-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button,.pillarbox-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button,.pillarbox-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*,.pillarbox-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.pillarbox-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline,.pillarbox-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before,.pillarbox-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.pillarbox-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.pillarbox-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active,.pillarbox-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar,.pillarbox-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing,.pillarbox-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control,.pillarbox-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text,.pillarbox-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.pillarbox-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.pillarbox-js .vjs-control:hover:before,.video-js .vjs-control:focus,.pillarbox-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text,.pillarbox-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer,.pillarbox-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control,.pillarbox-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled,.pillarbox-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder,.pillarbox-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder,.pillarbox-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.pillarbox-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.pillarbox-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.pillarbox-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress,.pillarbox-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div,.pillarbox-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip,.pillarbox-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip,.pillarbox-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display,.pillarbox-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.pillarbox-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider,.pillarbox-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled,.pillarbox-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus,.pillarbox-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control,.pillarbox-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control,.pillarbox-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control,.pillarbox-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar,.pillarbox-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical,.pillarbox-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu,.pillarbox-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip,.pillarbox-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display,.pillarbox-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display,.pillarbox-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display,.pillarbox-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control,.pillarbox-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.pillarbox-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control,.vjs-liveui.pillarbox-js .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control,.pillarbox-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.vjs-live.pillarbox-js:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control,.pillarbox-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control,.pillarbox-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.pillarbox-js .vjs-current-time,.video-js .vjs-duration,.pillarbox-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control,.pillarbox-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.vjs-controls-disabled.pillarbox-js .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track,.pillarbox-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.vjs-controls-disabled.pillarbox-js video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control,.pillarbox-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-audio-only-mode.pillarbox-js .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control,.pillarbox-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-audio-only-mode.pillarbox-js .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button,.vjs-audio-only-mode.pillarbox-js .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button,.vjs-audio-only-mode.pillarbox-js .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button,.vjs-audio-only-mode.pillarbox-js .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.vjs-layout-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.vjs-layout-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.vjs-layout-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.vjs-layout-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.vjs-layout-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.vjs-layout-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.vjs-layout-x-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.vjs-layout-x-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.vjs-layout-x-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.vjs-layout-x-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.vjs-layout-x-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.vjs-layout-x-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.vjs-layout-tiny.pillarbox-js .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.vjs-layout-tiny.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.vjs-layout-tiny.pillarbox-js .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.vjs-layout-tiny.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.vjs-layout-tiny.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control,.vjs-layout-tiny.pillarbox-js .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.vjs-layout-x-small.pillarbox-js .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control,.vjs-layout-tiny.pillarbox-js .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer,.vjs-layout-x-small.pillarbox-js .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.pillarbox-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.pillarbox-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.pillarbox-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.pillarbox-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.pillarbox-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30,.pillarbox-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster),.pillarbox-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible),.js-focus-visible .pillarbox-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible),.pillarbox-js *:focus:not(:focus-visible){outline:none}.pillarbox-js:hover .vjs-big-play-button{background-color:#16161688;transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button{width:2em;height:2em;margin:0;font-size:2.25em;background:#0000;border:.1em solid #fff;border-radius:50%;transform:translate(-50%,-50%);transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:initial;display:flex;align-items:center;justify-content:center;font-size:1.75em}.pillarbox-js .vjs-modal-dialog.vjs-text-track-settings{top:50%;left:50%;max-width:25em;max-height:50em;background:#161616f2;border-radius:.5em;box-shadow:2px 2px 3px #0005;transform:translate(-50%,-50%);overscroll-behavior:contain}.pillarbox-js .vjs-text-track-settings .vjs-modal-dialog-content{display:flex;flex-direction:column;padding:1em 1.5em 0}.pillarbox-js .vjs-text-track-settings legend{font-size:1em}.pillarbox-js .vjs-text-track-settings fieldset span{padding-inline:0}.pillarbox-js .vjs-text-track-settings fieldset{display:flex;margin:0 0 1em;padding:0}.pillarbox-js.video-js .vjs-text-track-settings select,.pillarbox-js .vjs-text-track-settings select{margin:.25em 0 0;padding:.5em;color:#fff;background:#3f3f3f;border:none;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.pillarbox-js.video-js .vjs-text-track-settings select:focus-within,.pillarbox-js .vjs-text-track-settings select:focus-within{outline:solid}.pillarbox-js .vjs-track-settings-controls{display:flex;flex-direction:row;gap:1em;justify-content:end}.pillarbox-js .vjs-track-settings-controls button{margin-block:1em;padding:.25em .5em;color:#fff;background:#3f3f3f}.pillarbox-js .vjs-track-settings-controls button:hover{background:#5c5c5c}.pillarbox-js .vjs-track-settings-controls .vjs-default-button{margin-right:0}.pillarbox-js .vjs-control{height:3em}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-control-bar{align-items:flex-end;height:6em;padding-inline:1em;background:linear-gradient(#000,#0000 0%,#000000b3)}.pillarbox-js.vjs-audio-only-mode .vjs-control-bar{background-color:#1e232c}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-custom-control-spacer{display:block;flex:auto}.pillarbox-js .vjs-error-display .vjs-modal-dialog-content{display:flex;align-items:center;justify-content:center}.pillarbox-js.vjs-layout-tiny{font-size:8px}.pillarbox-js.vjs-layout-x-small{font-size:10px}.pillarbox-js.vjs-layout-small{font-size:12px}.pillarbox-js.vjs-layout-medium{font-size:14px}.pillarbox-js.vjs-layout-large{font-size:16px}.pillarbox-js.vjs-layout-x-large{font-size:18px}.pillarbox-js.vjs-layout-huge{font-size:20px}.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-time-divider,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-current-time,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-duration{display:block;padding:0;font-weight:700}.pillarbox-js.vjs-layout-tiny .vjs-progress-control,.pillarbox-js.vjs-layout-x-small .vjs-progress-control{display:flex}.pillarbox-js.vjs-layout-x-small.vjs-audio-only-mode .vjs-custom-control-spacer{display:none}.pillarbox-js .vjs-loading-spinner{border:.25em solid rgba(0,0,0,0)}.pillarbox-js .vjs-loading-spinner{display:flex;align-items:center;justify-content:center}@keyframes vjs-spinner-fade{0%{border-top-color:#333}20%{border-top-color:#333}35%{border-top-color:#fff}60%{border-top-color:#333}to{border-top-color:#333}}.pillarbox-js .vjs-menu .vjs-menu-item{border-radius:.25em}.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):focus,.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):hover{background-color:#3f3f3f}.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:focus,.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:hover{background-color:#0000}.pillarbox-js .vjs-menu .vjs-menu-item .vjs-selected{color:#222;background-color:#fff;pointer-events:none}.pillarbox-js .vjs-menu-button-popup.vjs-hover .vjs-menu{display:none}.pillarbox-js .vjs-menu-button-popup .vjs-menu{right:0;bottom:0;left:unset;width:100%;margin:0}.pillarbox-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content{right:50%;bottom:5em;display:grid;gap:.25em;min-width:13em;padding:1em .5em;background:#161616f2;border-radius:.5em;transform:translate(50%);overscroll-behavior:contain}.pillarbox-js .vjs-slider{background-color:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-text-track-display{top:0;right:0;bottom:4em;left:0}.pillarbox-js .vjs-current-time{margin-left:1em}.pillarbox-js .vjs-time-divider{min-width:1em;text-align:center}.pillarbox-js .vjs-remaining-time{display:none}.pillarbox-js.vjs-audio-only-mode .vjs-current-time,.pillarbox-js.vjs-audio-only-mode .vjs-time-divider,.pillarbox-js.vjs-audio-only-mode .vjs-duration{order:1}.pillarbox-js.vjs-audio-only-mode .vjs-duration{margin-right:1em}.pillarbox-js .vjs-title-bar{padding-bottom:2em;background:linear-gradient(rgba(0,0,0,.6) 0%,transparent 100%)}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-progress-control{position:absolute;bottom:3em;width:calc(100% - 2em);height:1em}.pillarbox-js .vjs-progress-holder{margin:0}.pillarbox-js .vjs-load-progress{background:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-load-progress div{background:#0000}.pillarbox-js.vjs-scrubbing .vjs-play-progress .vjs-time-tooltip,.pillarbox-js.vjs-seeking .vjs-play-progress .vjs-time-tooltip{display:none}.pillarbox-js .vjs-play-progress{color:#af001e;background:#af001e;border-radius:1em}.pillarbox-js .vjs-play-progress:before{font-size:0px;text-shadow:0px 0px 1px #000}.pillarbox-js .vjs-progress-control:hover .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip{right:0%!important;transform:translate(50%)}.pillarbox-js .vjs-progress-holder:focus-visible .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-time-tooltip,.pillarbox-js .vjs-mouse-display .vjs-time-tooltip{top:-3em;padding:.4em;color:#fff;font-weight:700;text-shadow:1px 1px 3px #000,1px 1px 2px #000;background-color:#0000}.pillarbox-js .vjs-volume-level{border-radius:1em}.pillarbox-js .vjs-volume-tooltip{top:-2em;padding:.4em;font-weight:700;text-shadow:1px 1px 3px #000;background-color:#0000}
diff --git a/pr-preview/pr-31/packages/skip-button/assets/index-CihQ5nO6.js b/pr-preview/pr-31/packages/skip-button/assets/index-CihQ5nO6.js
new file mode 100644
index 0000000..2852657
--- /dev/null
+++ b/pr-preview/pr-31/packages/skip-button/assets/index-CihQ5nO6.js
@@ -0,0 +1,220 @@
+var oT=Object.defineProperty;var uT=(i,e,t)=>e in i?oT(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var xa=(i,e,t)=>(uT(i,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();var en=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function gd(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var Os;typeof window<"u"?Os=window:typeof en<"u"?Os=en:typeof self<"u"?Os=self:Os={};var An=Os;const E=Yt(An),lT={},cT=Object.freeze(Object.defineProperty({__proto__:null,default:lT},Symbol.toStringTag,{value:"Module"})),dT=gd(cT);var Il=typeof en<"u"?en:typeof window<"u"?window:{},hT=dT,Rs;typeof document<"u"?Rs=document:(Rs=Il["__GLOBAL_DOCUMENT_CACHE@4"],Rs||(Rs=Il["__GLOBAL_DOCUMENT_CACHE@4"]=hT));var yd=Rs;const F=Yt(yd);var Ya={exports:{}};(function(i,e){function t(l){if(l&&typeof l=="object"){var f=l.which||l.keyCode||l.charCode;f&&(l=f)}if(typeof l=="number")return a[l];var m=String(l),y=s[m.toLowerCase()];if(y)return y;var y=r[m.toLowerCase()];if(y)return y;if(m.length===1)return m.charCodeAt(0)}t.isEventKey=function(f,m){if(f&&typeof f=="object"){var y=f.which||f.keyCode||f.charCode;if(y==null)return!1;if(typeof m=="string"){var T=s[m.toLowerCase()];if(T)return T===y;var T=r[m.toLowerCase()];if(T)return T===y}else if(typeof m=="number")return m===y;return!1}},e=i.exports=t;var s=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
+ * Programatically add the following
+ */for(n=97;n<123;n++)s[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)s[n-48]=n;for(n=1;n<13;n++)s["f"+n]=n+111;for(n=0;n<10;n++)s["numpad "+n]=n+96;var a=e.names=e.title={};for(n in s)a[s[n]]=n;for(var o in r)s[o]=r[o]})(Ya,Ya.exports);var fT=Ya.exports;const W=Yt(fT);var pT=mT;function mT(i,e){var t,s=null;try{t=JSON.parse(i,e)}catch(r){s=r}return[s,t]}const gT=Yt(pT);var Io={exports:{}};function rt(){return rt=Object.assign?Object.assign.bind():function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;if(t)if(ST.TextDecoder){var o=ET(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function ET(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var CT=xT,_d=An,AT=_T,DT=vT;St.httpHandler=CT;/**
+ * @license
+ * slighly modified parse-headers 2.0.2
+ * Copyright (c) 2014 David Björklund
+ * Available under the MIT license
+ *
+ */var wT=function(e){var t={};return e&&e.trim().split(`
+`).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Io.exports=St;Io.exports.default=St;St.XMLHttpRequest=_d.XMLHttpRequest||LT;St.XDomainRequest="withCredentials"in new St.XMLHttpRequest?St.XMLHttpRequest:_d.XDomainRequest;kT(["get","put","post","patch","head","delete"],function(i){St[i==="delete"?"del":i]=function(e,t,s){return t=vd(e,t,s),t.method=i.toUpperCase(),Td(t)}});function kT(i,e){for(var t=0;t"u")throw new Error("callback argument missing");var e=!1,t=function(M,R,P){e||(e=!0,i.callback(M,R,P))};function s(){o.readyState===4&&setTimeout(a,0)}function r(){var k=void 0;if(o.response?k=o.response:k=o.responseText||PT(o),A)try{k=JSON.parse(k)}catch{}return k}function n(k){return clearTimeout(D),k instanceof Error||(k=new Error(""+(k||"Unknown XMLHttpRequest Error"))),k.statusCode=0,t(k,w)}function a(){if(!f){var k;clearTimeout(D),i.useXDR&&o.status===void 0?k=200:k=o.status===1223?204:o.status;var M=w,R=null;return k!==0?(M={body:r(),statusCode:k,method:y,headers:{},url:m,rawRequest:o},o.getAllResponseHeaders&&(M.headers=wT(o.getAllResponseHeaders()))):R=new Error("Internal XMLHttpRequest Error"),t(R,M,M.body)}}var o=i.xhr||null;o||(i.cors||i.useXDR?o=new St.XDomainRequest:o=new St.XMLHttpRequest);var l,f,m=o.url=i.uri||i.url,y=o.method=i.method||"GET",T=i.body||i.data,S=o.headers=i.headers||{},_=!!i.sync,A=!1,D,w={body:void 0,headers:{},statusCode:0,method:y,url:m,rawRequest:o};if("json"in i&&i.json!==!1&&(A=!0,S.accept||S.Accept||(S.Accept="application/json"),y!=="GET"&&y!=="HEAD"&&(S["content-type"]||S["Content-Type"]||(S["Content-Type"]="application/json"),T=JSON.stringify(i.json===!0?T:i.json))),o.onreadystatechange=s,o.onload=a,o.onerror=n,o.onprogress=function(){},o.onabort=function(){f=!0},o.ontimeout=n,o.open(y,m,!_,i.username,i.password),_||(o.withCredentials=!!i.withCredentials),!_&&i.timeout>0&&(D=setTimeout(function(){if(!f){f=!0,o.abort("timeout");var k=new Error("XMLHttpRequest timeout");k.code="ETIMEDOUT",n(k)}},i.timeout)),o.setRequestHeader)for(l in S)S.hasOwnProperty(l)&&o.setRequestHeader(l,S[l]);else if(i.headers&&!IT(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(o.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(o),o.send(T||null),o}function PT(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function LT(){}var OT=Io.exports;const bd=Yt(OT);var Sd={exports:{}},Pl=yd,Po=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function Ze(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}Ze.prototype=Po(Error.prototype);Ze.prototype.constructor=Ze;Ze.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Lo(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function $s(){this.values=Po(null)}$s.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s=0&&e<=100)?(this.set(i,e),!0):!1}};function Ms(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var o=a[0].trim(),l=a[1].trim();e(o,l)}}}function RT(i,e,t){var s=i;function r(){var o=Lo(i);if(o===null)throw new Ze(Ze.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){var f=new $s;Ms(o,function(m,y){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===y){f.set(m,t[T].region);break}break;case"vertical":f.alt(m,y,["rl","lr"]);break;case"line":var S=y.split(","),_=S[0];f.integer(m,_),f.percent(m,_)&&f.set("snapToLines",!1),f.alt(m,_,["auto"]),S.length===2&&f.alt("lineAlign",S[1],["start","center","end"]);break;case"position":S=y.split(","),f.percent(m,S[0]),S.length===2&&f.alt("positionAlign",S[1],["start","center","end"]);break;case"size":f.percent(m,y);break;case"align":f.alt(m,y,["start","center","end","left","right"]);break}},/:/,/\s/),l.region=f.get("region",null),l.vertical=f.get("vertical","");try{l.line=f.get("line","auto")}catch{}l.lineAlign=f.get("lineAlign","start"),l.snapToLines=f.get("snapToLines",!0),l.size=f.get("size",100);try{l.align=f.get("align","center")}catch{l.align=f.get("align","middle")}try{l.position=f.get("position","auto")}catch{l.position=f.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},l.align)}l.positionAlign=f.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},l.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new Ze(Ze.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Ea=Pl.createElement&&Pl.createElement("textarea"),MT={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Ll={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},NT={v:"title",lang:"lang"},Ol={rt:"ruby"};function xd(i,e){function t(){if(!e)return null;function _(D){return e=e.substr(D.length),D}var A=e.match(/^([^<]*)(<[^>]*>?)?/);return _(A[1]?A[1]:A[2])}function s(_){return Ea.innerHTML=_,_=Ea.textContent,Ea.textContent="",_}function r(_,A){return!Ol[A.localName]||Ol[A.localName]===_.localName}function n(_,A){var D=MT[_];if(!D)return null;var w=i.document.createElement(D),k=NT[_];return k&&A&&(w[k]=A.trim()),w}for(var a=i.document.createElement("div"),o=a,l,f=[];(l=t())!==null;){if(l[0]==="<"){if(l[1]==="/"){f.length&&f[f.length-1]===l.substr(2).replace(">","")&&(f.pop(),o=o.parentNode);continue}var m=Lo(l.substr(1,l.length-2)),y;if(m){y=i.document.createProcessingInstruction("timestamp",m),o.appendChild(y);continue}var T=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(y=n(T[1],T[3]),!y)||!r(o,y))continue;if(T[2]){var S=T[2].split(".");S.forEach(function(_){var A=/^bg_/.test(_),D=A?_.slice(3):_;if(Ll.hasOwnProperty(D)){var w=A?"background-color":"color",k=Ll[D];y.style[w]=k}}),y.className=S.join(" ")}f.push(T[1]),o.appendChild(y),o=y;continue}o.appendChild(i.document.createTextNode(s(l)))}return a}var Rl=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function BT(i){for(var e=0;e=t[0]&&i<=t[1])return!0}return!1}function FT(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(o,l){for(var f=l.childNodes.length-1;f>=0;f--)o.push(l.childNodes[f])}function n(o){if(!o||!o.length)return null;var l=o.pop(),f=l.textContent||l.innerText;if(f){var m=f.match(/^.*(\n|\r)/);return m?(o.length=0,m[0]):f}if(l.tagName==="ruby")return n(o);if(l.childNodes)return r(o,l),n(o)}for(r(e,i);t=n(e);)for(var a=0;a=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;ri.left&&this.topi.top};Fe.prototype.overlapsAny=function(i){for(var e=0;e=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Fe.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.lefti.right;case"+y":return this.topi.bottom}};Fe.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Fe.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Fe.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function $T(i,e,t,s){function r(D,w){for(var k,M=new Fe(D),R=1,P=0;PU&&(k=new Fe(D),R=U),D=new Fe(M)}return k||M}var n=new Fe(e),a=e.cue,o=UT(a),l=[];if(a.snapToLines){var f;switch(a.vertical){case"":l=["+y","-y"],f="height";break;case"rl":l=["+x","-x"],f="width";break;case"lr":l=["-x","+x"],f="width";break}var m=n.lineHeight,y=m*Math.round(o),T=t[f]+m,S=l[0];Math.abs(y)>T&&(y=y<0?-1:1,y*=Math.ceil(T/m)*m),o<0&&(y+=a.vertical===""?t.height:t.width,l=l.reverse()),n.move(S,y)}else{var _=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=_/2;break;case"end":o-=_;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],n=new Fe(e)}var A=r(n,l);e.move(A.toCSSCompatValues(t))}function ns(){}ns.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};ns.convertCueToDOMTree=function(i,e){return!i||!e?null:xd(i,e)};var qT=.05,jT="sans-serif",VT="1.5%";ns.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=VT,t.appendChild(s);function r(m){for(var y=0;y")===-1){e.cue.id=a;continue}case"CUE":try{RT(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=a.indexOf("-->")!==-1;if(!a||f&&(l=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=`
+`),e.cue.text+=a.replace(/\u2028/g,`
+`).replace(/u2029/g,`
+`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=`
+
+`,i.parse()),i.state==="INITIAL")throw new Ze(Ze.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var HT=ns,GT="auto",zT={"":1,lr:1,rl:1},WT={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function KT(i){if(typeof i!="string")return!1;var e=zT[i.toLowerCase()];return e?i.toLowerCase():!1}function Ca(i){if(typeof i!="string")return!1;var e=WT[i.toLowerCase()];return e?i.toLowerCase():!1}function Ed(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,o=t,l=null,f="",m=!0,y="auto",T="start",S="auto",_="auto",A=100,D="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(w){s=""+w}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(w){r=!!w}},startTime:{enumerable:!0,get:function(){return n},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");n=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");a=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(w){o=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(w){l=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(w){var k=KT(w);if(k===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=k,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(w){m=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(w){if(typeof w!="number"&&w!==GT)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(w){var k=Ca(w);k?(T=k,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return S},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");S=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return _},set:function(w){var k=Ca(w);k?(_=k,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return A},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");A=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return D},set:function(w){var k=Ca(w);if(!k)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");D=k,this.hasBeenReset=!0}}}),this.displayState=void 0}Ed.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var XT=Ed,YT={"":!0,up:!0};function QT(i){if(typeof i!="string")return!1;var e=YT[i.toLowerCase()];return e?i.toLowerCase():!1}function Cs(i){return typeof i=="number"&&i>=0&&i<=100}function JT(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!Cs(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(o){if(!Cs(o))throw new Error("RegionAnchorX must be between 0 and 100.");s=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!Cs(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!Cs(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Cs(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return a},set:function(o){var l=QT(o);l===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=l}}})}var ZT=JT,Bt=An,Ti=Sd.exports={WebVTT:HT,VTTCue:XT,VTTRegion:ZT};Bt.vttjs=Ti;Bt.WebVTT=Ti.WebVTT;var e2=Ti.VTTCue,t2=Ti.VTTRegion,i2=Bt.VTTCue,s2=Bt.VTTRegion;Ti.shim=function(){Bt.VTTCue=e2,Bt.VTTRegion=t2};Ti.restore=function(){Bt.VTTCue=i2,Bt.VTTRegion=s2};Bt.VTTCue||Ti.shim();var r2=Sd.exports;const Ml=Yt(r2);var Cd={exports:{}};(function(i,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,f,m){if(m=m||{},l=l.trim(),f=f.trim(),!f){if(!m.alwaysNormalize)return l;var y=o.parseURL(l);if(!y)throw new Error("Error trying to parse base URL.");return y.path=o.normalizePath(y.path),o.buildURLFromParts(y)}var T=o.parseURL(f);if(!T)throw new Error("Error trying to parse relative URL.");if(T.scheme)return m.alwaysNormalize?(T.path=o.normalizePath(T.path),o.buildURLFromParts(T)):f;var S=o.parseURL(l);if(!S)throw new Error("Error trying to parse base URL.");if(!S.netLoc&&S.path&&S.path[0]!=="/"){var _=r.exec(S.path);S.netLoc=_[1],S.path=_[2]}S.netLoc&&!S.path&&(S.path="/");var A={scheme:S.scheme,netLoc:T.netLoc,path:null,params:T.params,query:T.query,fragment:T.fragment};if(!T.netLoc&&(A.netLoc=S.netLoc,T.path[0]!=="/"))if(!T.path)A.path=S.path,T.params||(A.params=S.params,T.query||(A.query=S.query));else{var D=S.path,w=D.substring(0,D.lastIndexOf("/")+1)+T.path;A.path=o.normalizePath(w)}return A.path===null&&(A.path=m.alwaysNormalize?o.normalizePath(T.path):T.path),o.buildURLFromParts(A)},parseURL:function(l){var f=s.exec(l);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};i.exports=o})()})(Cd);var n2=Cd.exports;const Nl=Yt(n2);var Bl="http://example.com",wn=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=E.location&&E.location.href||"");var s=typeof E.URL=="function",r=/^\/\//.test(e),n=!E.location&&!/\/\//i.test(e);if(s?e=new E.URL(e,E.location||Bl):/\/\//i.test(e)||(e=Nl.buildAbsoluteURL(E.location&&E.location.href||"",e)),s){var a=new URL(t,e);return n?a.href.slice(Bl.length):r?a.href.slice(a.protocol.length):a.href}return Nl.buildAbsoluteURL(e,t)},Oo=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a-1;t=this.buffer.indexOf(`
+`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const l2=" ",Aa=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},c2=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Ye=function(i){const e={};if(!i)return e;const t=i.split(c2());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e};class d2 extends Oo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;an),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const h2=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Ht=function(i){const e={};return Object.keys(i).forEach(function(t){e[h2(t)]=i[t]}),e},Da=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]{s.uri||!s.parts&&!s.preloadHints||(!s.map&&r&&(s.map=r),!s.key&&n&&(s.key=n),!s.timeline&&typeof m=="number"&&(s.timeline=m),this.manifest.preloadSegment=s)}),this.parseStream.on("data",function(_){let A,D;({tag(){({version(){_.version&&(this.manifest.version=_.version)},"allow-cache"(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const w={};"length"in _&&(s.byterange=w,w.length=_.length,"offset"in _||(_.offset=y)),"offset"in _&&(s.byterange=w,w.offset=_.offset),y=w.offset+w.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),_.title&&(s.title=_.title),_.duration>0&&(s.duration=_.duration),_.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){n=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===f){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:o2(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(n.iv=_.attributes.IV)},"media-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,m=_.number},"playlist-type"(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map(){r={},_.uri&&(r.uri=_.uri),_.byterange&&(r.byterange=_.byterange),n&&(r.key=n)},"stream-inf"(){if(this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),rt(s.attributes,_.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const w=this.manifest.mediaGroups[_.attributes.TYPE];w[_.attributes["GROUP-ID"]]=w[_.attributes["GROUP-ID"]]||{},A=w[_.attributes["GROUP-ID"]],D={default:/yes/i.test(_.attributes.DEFAULT)},D.default?D.autoselect=!0:D.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(D.language=_.attributes.LANGUAGE),_.attributes.URI&&(D.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(D.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(D.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(D.forced=/yes/i.test(_.attributes.FORCED)),A[_.attributes.NAME]=D},discontinuity(){m+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),s.dateTimeString=_.dateTimeString,s.dateTimeObject=_.dateTimeObject;const{lastProgramDateTime:w}=this;this.lastProgramDateTime=new Date(_.dateTimeString).getTime(),w===null&&this.manifest.segments.reduceRight((k,M)=>(M.programDateTime=k-M.duration*1e3,M.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,Da.call(this,this.manifest)},start(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out"(){s.cueOut=_.data},"cue-out-cont"(){s.cueOutCont=_.data},"cue-in"(){s.cueIn=_.data},skip(){this.manifest.skip=Ht(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const w=this.manifest.segments.length,k=Ht(_.attributes);s.parts=s.parts||[],s.parts.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=T),T=k.byterange.offset+k.byterange.length);const M=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${M} for segment #${w}`,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((R,P)=>{R.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${P} lacks required attribute(s): LAST-PART`})})},"server-control"(){const w=this.manifest.serverControl=Ht(_.attributes);w.hasOwnProperty("canBlockReload")||(w.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Da.call(this,this.manifest),w.canSkipDateranges&&!w.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const w=this.manifest.segments.length,k=Ht(_.attributes),M=k.type&&k.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=M?T:0,M&&(T=k.byterange.offset+k.byterange.length)));const R=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${R} for segment #${w}`,_.attributes,["TYPE","URI"]),!!k.type)for(let P=0;PP.id===k.id);this.manifest.dateRanges[R]=rt(this.manifest.dateRanges[R],k),S[k.id]=rt(S[k.id],k),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=Ht(_.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",_.attributes,["SERVER-URI"])}}[_.tagType]||o).call(e)},uri(){s.uri=_.uri,t.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),n&&(s.key=n),s.timeline=m,r&&(s.map=r),T=0,this.lastProgramDateTime!==null&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=s.duration*1e3),s={}},comment(){},custom(){_.segment?(s.custom=s.custom||{},s.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(e)})}warnOnMissingAttributes_(e,t,s){const r=[];s.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
+`),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var pi={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},p2=["video","audio","text"],Fl=["Video","Audio","Text"],Ad=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,s,r){var n=("00"+Number(s).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},gt=function(e){e===void 0&&(e="");var t=e.split(","),s=[];return t.forEach(function(r){r=r.trim();var n;p2.forEach(function(a){var o=pi[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=r.substring(0,o[1].length),f=r.replace(l,"");s.push({type:l,details:f,mediaType:a})}}),n||s.push({type:r,details:"",mediaType:"unknown"})}),s},m2=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var s=e.mediaGroups.AUDIO[t];if(!s)return null;for(var r in s){var n=s[r];if(n.default&&n.playlists)return gt(n.playlists[0].attributes.CODECS)}return null},Dd=function(e){return e===void 0&&(e=""),pi.audio.test(e.trim().toLowerCase())},g2=function(e){return e===void 0&&(e=""),pi.text.test(e.trim().toLowerCase())},Ws=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Ad(n.trim())}),s="video";t.length===1&&Dd(t[0])?s="audio":t.length===1&&g2(t[0])&&(s="application");var r="mp4";return t.every(function(n){return pi.mp4.test(n)})?r="mp4":t.every(function(n){return pi.webm.test(n)})?r="webm":t.every(function(n){return pi.ogg.test(n)})&&(r="ogg"),s+"/"+r+';codecs="'+e+'"'}},Yr=function(e){return e===void 0&&(e=""),E.MediaSource&&E.MediaSource.isTypeSupported&&E.MediaSource.isTypeSupported(Ws(e))||!1},wa=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var s=0;sy&&(m-=y,m-=y,m-=Ie(2))}return Number(m)},E2=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ie(e);for(var a=b2(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l=t.length&&f.call(t,function(m,y){var T=l[y]?l[y]&e[a+y]:e[a+y];return m===T})},A2=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];s(o,r,n,a)}})},D2=function(e){return E.atob?E.atob(e):Buffer.from(e,"base64").toString("binary")};function w2(i){for(var e=D2(i),t=new Uint8Array(e.length),s=0;s=0&&i=0){for(var r=e.length-1;s0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==zi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==zi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function Vd(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||""+i.charCodeAt()+";"}ir(Ke,ae);ir(Ke,ae.prototype);function Xs(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Xs(i,e))return!0;while(i=i.nextSibling)}function sr(){this.ownerDocument=this}function B2(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===Ks.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Hd(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===Ks.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function No(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function Gd(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,No(i.ownerDocument,i),e}function F2(i){return i&&(i.nodeType===ae.DOCUMENT_NODE||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.ELEMENT_NODE)}function U2(i){return i&&(Et(i)||Bo(i)||Ut(i)||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.COMMENT_NODE||i.nodeType===ae.PROCESSING_INSTRUCTION_NODE)}function Ut(i){return i&&i.nodeType===ae.DOCUMENT_TYPE_NODE}function Et(i){return i&&i.nodeType===ae.ELEMENT_NODE}function Bo(i){return i&&i.nodeType===ae.TEXT_NODE}function Hl(i,e){var t=i.childNodes||[];if(xt(t,Et)||Ut(e))return!1;var s=xt(t,Ut);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Gl(i,e){var t=i.childNodes||[];function s(n){return Et(n)&&n!==e}if(xt(t,s))return!1;var r=xt(t,Ut);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function $2(i,e,t){if(!F2(i))throw new xe(Ve,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new xe($d,"child not in parent");if(!U2(e)||Ut(e)&&i.nodeType!==ae.DOCUMENT_NODE)throw new xe(Ve,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function q2(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ae.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Et);if(n.length>1||xt(r,Bo))throw new xe(Ve,"More than one element or text in fragment");if(n.length===1&&!Hl(i,t))throw new xe(Ve,"Element in fragment can not be inserted before doctype")}if(Et(e)&&!Hl(i,t))throw new xe(Ve,"Only one element can be added and only after doctype");if(Ut(e)){if(xt(s,Ut))throw new xe(Ve,"Only one doctype is allowed");var a=xt(s,Et);if(t&&s.indexOf(a)1||xt(r,Bo))throw new xe(Ve,"More than one element or text in fragment");if(n.length===1&&!Gl(i,t))throw new xe(Ve,"Element in fragment can not be inserted before doctype")}if(Et(e)&&!Gl(i,t))throw new xe(Ve,"Only one element can be added and only after doctype");if(Ut(e)){let l=function(f){return Ut(f)&&f!==t};var o=l;if(xt(s,l))throw new xe(Ve,"Only one doctype is allowed");var a=xt(s,Et);if(t&&s.indexOf(a)0&&Xs(t.documentElement,function(r){if(r!==t&&r.nodeType===dt){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var o=$l(n);a=e.every(R2(o))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new _i;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Mt;var t=e.attributes=new rn;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new In;return i.ownerDocument=this,i.childNodes=new Mt,i},createTextNode:function(i){var e=new Fo;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Uo;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new $o;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new jo;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new an;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new qo;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new _i,s=e.split(":"),r=t.attributes=new rn;return t.childNodes=new Mt,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new an,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};We(sr,ae);function _i(){this._nsMap={}}_i.prototype={nodeType:dt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===Ft?this.insertBefore(i,null):j2(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Wi(this,function(e){var t=[];return Xs(e,function(s){s!==e&&s.nodeType==dt&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Wi(this,function(t){var s=[];return Xs(t,function(r){r!==t&&r.nodeType===dt&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};sr.prototype.getElementsByTagName=_i.prototype.getElementsByTagName;sr.prototype.getElementsByTagNameNS=_i.prototype.getElementsByTagNameNS;We(_i,ae);function an(){}an.prototype.nodeType=zi;We(an,ae);function rr(){}rr.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(ke[Ve])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};We(rr,ae);function Fo(){}Fo.prototype={nodeName:"#text",nodeType:sn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};We(Fo,rr);function Uo(){}Uo.prototype={nodeName:"#comment",nodeType:Bd};We(Uo,rr);function $o(){}$o.prototype={nodeName:"#cdata-section",nodeType:Rd};We($o,rr);function kn(){}kn.prototype.nodeType=Ud;We(kn,ae);function Wd(){}Wd.prototype.nodeType=N2;We(Wd,ae);function Kd(){}Kd.prototype.nodeType=M2;We(Kd,ae);function qo(){}qo.prototype.nodeType=Md;We(qo,ae);function In(){}In.prototype.nodeName="#document-fragment";In.prototype.nodeType=Ft;We(In,ae);function jo(){}jo.prototype.nodeType=Nd;We(jo,ae);function Xd(){}Xd.prototype.serializeToString=function(i,e,t){return Yd.call(i,e,t)};ae.prototype.toString=Yd;function Yd(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Ri(this,t,i,e,a),t.join("")}function zl(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===Ks.XML||r===Ks.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function ka(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Vd),'"')}function Ri(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case dt:var n=i.attributes,a=n.length,w=i.firstChild,o=i.tagName;t=Ks.isHTML(i.namespaceURI)||t;var l=o;if(!t&&!i.prefix&&i.namespaceURI){for(var f,m=0;m=0;y--){var T=r[y];if(T.prefix===""&&T.namespace===i.namespaceURI){f=T.namespace;break}}if(f!==i.namespaceURI)for(var y=r.length-1;y>=0;y--){var T=r[y];if(T.namespace===i.namespaceURI){T.prefix&&(l=T.prefix+":"+o);break}}}e.push("<",l);for(var S=0;S"),t&&/^script$/i.test(o))for(;w;)w.data?e.push(w.data):Ri(w,e,t,s,r.slice()),w=w.nextSibling;else for(;w;)Ri(w,e,t,s,r.slice()),w=w.nextSibling;e.push("",l,">")}else e.push("/>");return;case Fd:case Ft:for(var w=i.firstChild;w;)Ri(w,e,t,s,r.slice()),w=w.nextSibling;return;case zi:return ka(e,i.name,i.value);case sn:return e.push(i.data.replace(/[<&>]/g,Vd));case Rd:return e.push("");case Bd:return e.push("");case Ud:var k=i.publicId,M=i.systemId;if(e.push("");else if(M&&M!=".")e.push(" SYSTEM ",M,">");else{var R=i.internalSubset;R&&e.push(" [",R,"]"),e.push(">")}return;case Nd:return e.push("",i.target," ",i.data,"?>");case Md:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Qd(i,e,t){var s;switch(e.nodeType){case dt:s=e.cloneNode(!1),s.ownerDocument=i;case Ft:break;case zi:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(Qd(i,r,t)),r=r.nextSibling;return s}function Ja(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Mt),s.ownerDocument=i,s.nodeType){case dt:var a=e.attributes,o=s.attributes=new rn,l=a.length;o._ownerElement=s;for(var f=0;f",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
+`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),i.entityMap=i.HTML_ENTITIES})(Zd);var Vo={},Ys=qt.NAMESPACE,Za=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Wl=new RegExp("[\\-\\.0-9"+Za.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Kl=new RegExp("^"+Za.source+Wl.source+"*(?::"+Za.source+Wl.source+"*)?$"),As=0,Gt=1,Ci=2,Ds=3,Ai=4,Di=5,ws=6,Ur=7;function Ki(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Ki)}Ki.prototype=new Error;Ki.prototype.name=Ki.name;function eh(){}eh.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),th(e,e={}),V2(i,e,t,s,this.errorHandler),s.endDocument()}};function V2(i,e,t,s,r){function n(ie){if(ie>65535){ie-=65536;var Te=55296+(ie>>10),kt=56320+(ie&1023);return String.fromCharCode(Te,kt)}else return String.fromCharCode(ie)}function a(ie){var Te=ie.slice(1,-1);return Object.hasOwnProperty.call(t,Te)?t[Te]:Te.charAt(0)==="#"?n(parseInt(Te.substr(1).replace("x","0x"))):(r.error("entity not found:"+ie),ie)}function o(ie){if(ie>A){var Te=i.substring(A,ie).replace(/?\w+;/g,a);T&&l(A),s.characters(Te,0,ie-A),A=ie}}function l(ie,Te){for(;ie>=m&&(Te=y.exec(i));)f=Te.index,m=f+Te[0].length,T.lineNumber++;T.columnNumber=ie-f+1}for(var f=0,m=0,y=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,S=[{currentNSMap:e}],_={},A=0;;){try{var D=i.indexOf("<",A);if(D<0){if(!i.substr(A).match(/^\s*$/)){var w=s.doc,k=w.createTextNode(i.substr(A));w.appendChild(k),s.currentElement=k}return}switch(D>A&&o(D),i.charAt(D+1)){case"/":var ee=i.indexOf(">",D+3),M=i.substring(D+2,ee).replace(/[ \t\n\r]+$/g,""),R=S.pop();ee<0?(M=i.substring(D+2).replace(/[\s<].*/,""),r.error("end tag name: "+M+" is not complete:"+R.tagName),ee=D+1+M.length):M.match(/\s)&&(M=M.replace(/[\s<].*/,""),r.error("end tag name: "+M+" maybe not complete"),ee=D+1+M.length);var P=R.localNSMap,U=R.tagName==M,j=U||R.tagName&&R.tagName.toLowerCase()==M.toLowerCase();if(j){if(s.endElement(R.uri,R.localName,M),P)for(var Q in P)Object.prototype.hasOwnProperty.call(P,Q)&&s.endPrefixMapping(Q);U||r.fatalError("end tag name: "+M+" is not match the current start tagName:"+R.tagName)}else S.push(R);ee++;break;case"?":T&&l(D),ee=K2(i,D,s);break;case"!":T&&l(D),ee=W2(i,D,s,r);break;default:T&&l(D);var X=new ih,le=S[S.length-1].currentNSMap,ee=H2(i,D,X,le,a,r),he=X.length;if(!X.closed&&z2(i,ee,X.tagName,_)&&(X.closed=!0,t.nbsp||r.warning("unclosed xml attribute")),T&&he){for(var V=Xl(T,{}),te=0;teA?A=ee:o(Math.max(D,A)+1)}}function Xl(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function H2(i,e,t,s,r,n){function a(T,S,_){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,S.replace(/[\t\n\r]/g," ").replace(/?\w+;/g,r),_)}for(var o,l,f=++e,m=As;;){var y=i.charAt(f);switch(y){case"=":if(m===Gt)o=i.slice(e,f),m=Ds;else if(m===Ci)m=Ds;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Ds||m===Gt)if(m===Gt&&(n.warning('attribute value must after "="'),o=i.slice(e,f)),e=f+1,f=i.indexOf(y,e),f>0)l=i.slice(e,f),a(o,l,e-1),m=Di;else throw new Error("attribute value no end '"+y+"' match");else if(m==Ai)l=i.slice(e,f),a(o,l,e),n.warning('attribute "'+o+'" missed start quot('+y+")!!"),e=f+1,m=Di;else throw new Error('attribute value must after "="');break;case"/":switch(m){case As:t.setTagName(i.slice(e,f));case Di:case ws:case Ur:m=Ur,t.closed=!0;case Ai:case Gt:break;case Ci:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==As&&t.setTagName(i.slice(e,f)),f;case">":switch(m){case As:t.setTagName(i.slice(e,f));case Di:case ws:case Ur:break;case Ai:case Gt:l=i.slice(e,f),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case Ci:m===Ci&&(l=o),m==Ai?(n.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!Ys.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Ds:throw new Error("attribute value missed!!")}return f;case"":y=" ";default:if(y<=" ")switch(m){case As:t.setTagName(i.slice(e,f)),m=ws;break;case Gt:o=i.slice(e,f),m=Ci;break;case Ai:var l=i.slice(e,f);n.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case Di:m=ws;break}else switch(m){case Ci:t.tagName,(!Ys.isHTML(s[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=f,m=Gt;break;case Di:n.warning('attribute space is required"'+o+'"!!');case ws:m=Gt,e=f;break;case Ds:m=Ai,e=f;break;case Ur:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}function Yl(i,e,t){for(var s=i.tagName,r=null,y=i.length;y--;){var n=i[y],a=n.qName,o=n.value,T=a.indexOf(":");if(T>0)var l=n.prefix=a.slice(0,T),f=a.slice(T+1),m=l==="xmlns"&&f;else f=a,l=null,m=a==="xmlns"&&"";n.localName=f,m!==!1&&(r==null&&(r={},th(t,t={})),t[m]=r[m]=o,n.uri=Ys.XMLNS,e.startPrefixMapping(m,o))}for(var y=i.length;y--;){n=i[y];var l=n.prefix;l&&(l==="xml"&&(n.uri=Ys.XML),l!=="xmlns"&&(n.uri=t[l||""]))}var T=s.indexOf(":");T>0?(l=i.prefix=s.slice(0,T),f=i.localName=s.slice(T+1)):(l=null,f=i.localName=s);var S=i.uri=t[l||""];if(e.startElement(S,f,s,i),i.closed){if(e.endElement(S,f,s),r)for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&e.endPrefixMapping(l)}else return i.currentNSMap=t,i.localNSMap=r,!0}function G2(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf(""+t+">",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function z2(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf(""+t+">"),r",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=X2(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],f=!1,m=!1;o>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],m=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var y=a[o-1];return t.startDTD(l,f,m),t.endDTD(),y.index+y[0].length}}return-1}function K2(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function ih(){this.attributeNames={}}ih.prototype={setTagName:function(i){if(!Kl.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Kl.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function X2(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Vo.XMLReader=eh;Vo.ParseError=Ki;var Y2=qt,Q2=Qt,Ql=Zd,sh=Vo,J2=Q2.DOMImplementation,Jl=Y2.NAMESPACE,Z2=sh.ParseError,eb=sh.XMLReader;function rh(i){return i.replace(/\r[\n\u0085]/g,`
+`).replace(/[\r\u0085\u2028]/g,`
+`)}function nh(i){this.options=i||{locator:{}}}nh.prototype.parseFromString=function(i,e){var t=this.options,s=new eb,r=t.domBuilder||new nr,n=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),f=l?Ql.HTML_ENTITIES:Ql.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=tb(n,r,a),s.domBuilder=t.domBuilder||r,l&&(o[""]=Jl.HTML),o.xml=o.xml||Jl.XML;var m=t.normalizeLineEndings||rh;return i&&typeof i=="string"?s.parse(m(i),o,f):s.errorHandler.error("invalid doc source"),r.doc};function tb(i,e,t){if(!i){if(e instanceof nr)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&r&&(o=i.length==2?function(l){i(a,l)}:i),s[a]=o&&function(l){o("[xmldom "+a+"] "+l+eo(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function nr(){this.cdata=!1}function wi(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}nr.prototype={startDocument:function(){this.doc=new J2().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;$r(this,n),this.currentElement=n,this.locator&&wi(this.locator,n);for(var o=0;o=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){nr.prototype[i]=function(){return null}});function $r(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Pn.__DOMHandler=nr;Pn.normalizeLineEndings=rh;Pn.DOMParser=nh;var ib=Pn.DOMParser;/*! @name mpd-parser @version 1.3.0 @license Apache-2.0 */const ec=i=>!!i&&typeof i=="object",we=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):ec(e[s])&&ec(t[s])?e[s]=we(e[s],t[s]):e[s]=t[s]}),e),{}),ah=i=>Object.keys(i).map(e=>i[e]),sb=(i,e)=>{const t=[];for(let s=i;si.reduce((e,t)=>e.concat(t),[]),oh=i=>{if(!i.length)return[];const e=[];for(let t=0;ti.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),nb=(i,e)=>ah(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var Yi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Qs=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:wn(i||"",e)};if(t||s){const a=(t||s).split("-");let o=E.BigInt?E.BigInt(a[0]):parseInt(a[0],10),l=E.BigInt?E.BigInt(a[1]):parseInt(a[1],10);o{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=E.BigInt(i.offset)+E.BigInt(i.length)-E.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},tc=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),ob={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=tc(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=i,f=tc(i.endNumber),m=(e+t)/1e3,y=s+a,S=m+o-y,_=Math.ceil(S*r/n),A=Math.floor((m-y-l)*r/n),D=Math.floor((m-y)*r/n);return{start:Math.max(0,A),end:typeof f=="number"?f:Math.min(_,D)}}},ub=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Ho=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:o}=ob[e](i),l=sb(a,o).map(ub(i));if(e==="static"){const f=l.length-1,m=typeof r=="number"?r:n;l[f].duration=m-t/s*f}return l},uh=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=i;if(!e)throw new Error(Yi.NO_BASE_URL);const f=Qs({baseUrl:e,source:t.sourceURL,range:t.range}),m=Qs({baseUrl:e,source:e,indexRange:r});if(m.map=f,l){const y=Ho(i);y.length&&(m.duration=y[0].duration,m.timeline=y[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=o,[m]},Go=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,l=e.timescale,f=e.references.filter(D=>D.referenceType!==1),m=[],y=i.endList?"static":"dynamic",T=i.sidx.timeline;let S=T,_=i.mediaSequence||0,A;typeof e.firstOffset=="bigint"?A=E.BigInt(o)+e.firstOffset:A=o+e.firstOffset;for(let D=0;Dnb(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),db=(i,e)=>{for(let t=0;t{let e=[];return A2(i,lb,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},sc=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},hb=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:l}){return l===s.timeline});const r=db(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),sc({playlist:s,mediaSequence:r.segments[a].number})})},fb=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(ic(i)),s=e.playlists.concat(ic(e));return e.timelineStarts=lh([i.timelineStarts,e.timelineStarts]),hb({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},Ln=i=>i&&i.uri+"-"+ab(i.byterange),Ia=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=ah(s.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=rb(s.segments||[],"discontinuity"),s))},zo=(i,e)=>{const t=Ln(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Go(i,s,i.sidx.resolvedUri),i},pb=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=zo(i[t],e);return i},mb=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},gb=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},yb=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let f=a.attributes.label||"main";if(l&&!a.attributes.label){const y=o?` (${o})`:"";f=`${a.attributes.lang}${y}`}n[f]||(n[f]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const m=zo(mb(a,t),e);return n[f].playlists.push(m),typeof s>"u"&&o==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},_b=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text";return t[r]||(t[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(zo(gb(s),e)),t},{}),vb=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),Tb=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},bb=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",Sb=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",xb=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",Eb=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},rc=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],Cb=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:f}=i[0].attributes,m=Ia(i.filter(bb)).map(Tb),y=Ia(i.filter(Sb)),T=Ia(i.filter(xb)),S=i.map(R=>R.attributes.captionServices).filter(Boolean),_={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:pb(m,s)};f>=0&&(_.minimumUpdatePeriod=f*1e3),e&&(_.locations=e),t&&(_.contentSteering=t),o==="dynamic"&&(_.suggestedPresentationDelay=l),n&&n.length>0&&(_.eventStream=n);const A=_.playlists.length===0,D=y.length?yb(y,s,A):null,w=T.length?_b(T,s):null,k=m.concat(rc(D),rc(w)),M=k.map(({timelineStarts:R})=>R);return _.timelineStarts=lh(M),Eb(k,_.timelineStarts),D&&(_.mediaGroups.AUDIO.audio=D),w&&(_.mediaGroups.SUBTITLES.subs=w),S.length&&(_.mediaGroups["CLOSED-CAPTIONS"].cc=vb(S)),r?fb({oldManifest:r,newManifest:_}):_},Ab=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=i,f=(s+r)/1e3,m=n+o,T=f+l-m;return Math.ceil((T*a-e)/t)},ch=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=i,f=[];let m=-1;for(let y=0;ym&&(m=A);let D;if(_<0){const M=y+1;M===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?D=Ab(i,m,S):D=(n*a-m)/S:D=(e[M].t-m)/S}else D=_+1;const w=o+f.length+D;let k=o+f.length;for(;k(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},nc=(i,e)=>i.replace(Db,wb(e)),kb=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Ho(i):ch(i,e),Ib=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=Qs({baseUrl:i.baseUrl,source:nc(s.sourceURL,t),range:s.range});return kb(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=nc(i.media||"",t),l=i.timescale||1,f=i.presentationTimeOffset||0,m=i.periodStart+(a.time-f)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:wn(i.baseUrl||"",o),map:r,number:a.number,presentationTime:m}})},Pb=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=Qs({baseUrl:t,source:s.sourceURL,range:s.range}),n=Qs({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},Lb=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Yi.SEGMENT_TIME_UNSPECIFIED);const n=s.map(l=>Pb(i,l));let a;return t&&(a=Ho(i)),e&&(a=ch(i,e)),a.map((l,f)=>{if(n[f]){const m=n[f],y=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=l.timeline,m.duration=l.duration,m.number=l.number,m.presentationTime=r+(l.time-T)/y,m}}).filter(l=>l)},Ob=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=Ib,t=we(i,e.template)):e.base?(s=uh,t=we(i,e.base)):e.list&&(s=Lb,t=we(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},Rb=i=>i.map(Ob),ge=(i,e)=>oh(i.childNodes).filter(({tagName:t})=>t===e),ar=i=>i.textContent.trim(),Mb=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),ki=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[l,f,m,y,T,S]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(m||0)*86400+parseFloat(y||0)*3600+parseFloat(T||0)*60+parseFloat(S||0)},Nb=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),ac={mediaPresentationDuration(i){return ki(i)},availabilityStartTime(i){return Nb(i)/1e3},minimumUpdatePeriod(i){return ki(i)},suggestedPresentationDelay(i){return ki(i)},type(i){return i},timeShiftBufferDepth(i){return ki(i)},start(i){return ki(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return Mb(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?ki(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},Ee=i=>i&&i.attributes?oh(i.attributes).reduce((e,t)=>{const s=ac[t.name]||ac.DEFAULT;return e[t.name]=s(t.value),e},{}):{},Bb={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},On=(i,e)=>e.length?Xi(i.map(function(t){return e.map(function(s){const r=ar(s),n=wn(t.baseUrl,r),a=we(Ee(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Wo=i=>{const e=ge(i,"SegmentTemplate")[0],t=ge(i,"SegmentList")[0],s=t&&ge(t,"SegmentURL").map(y=>we({tag:"SegmentURL"},Ee(y))),r=ge(i,"SegmentBase")[0],n=t||e,a=n&&ge(n,"SegmentTimeline")[0],o=t||r||e,l=o&&ge(o,"Initialization")[0],f=e&&Ee(e);f&&l?f.initialization=l&&Ee(l):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const m={template:f,segmentTimeline:a&&ge(a,"S").map(y=>Ee(y)),list:t&&we(Ee(t),{segmentUrls:s,initialization:Ee(l)}),base:r&&we(Ee(r),{initialization:Ee(l)})};return Object.keys(m).forEach(y=>{m[y]||delete m[y]}),m},Fb=(i,e,t)=>s=>{const r=ge(s,"BaseURL"),n=On(e,r),a=we(i,Ee(s)),o=Wo(s);return n.map(l=>({segmentInfo:we(t,o),attributes:we(a,l)}))},Ub=i=>i.reduce((e,t)=>{const s=Ee(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=Bb[s.schemeIdUri];if(r){e[r]={attributes:s};const n=ge(t,"cenc:pssh")[0];if(n){const a=ar(n);e[r].pssh=a&&w2(a)}}return e},{}),$b=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?s.language=l:o==="er"?s.easyReader=Number(l):o==="war"?s.aspectRatio=Number(l):o==="3D"&&(s["3D"]=Number(l))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},qb=i=>Xi(ge(i.node,"EventStream").map(e=>{const t=Ee(e),s=t.schemeIdUri;return ge(e,"Event").map(r=>{const n=Ee(r),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,f=a/o+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:f,end:f+l/o,messageData:ar(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),jb=(i,e,t)=>s=>{const r=Ee(s),n=On(e,ge(s,"BaseURL")),a=ge(s,"Role")[0],o={role:Ee(a)};let l=we(i,r,o);const f=ge(s,"Accessibility")[0],m=$b(Ee(f));m&&(l=we(l,{captionServices:m}));const y=ge(s,"Label")[0];if(y&&y.childNodes.length){const D=y.childNodes[0].nodeValue.trim();l=we(l,{label:D})}const T=Ub(ge(s,"ContentProtection"));Object.keys(T).length&&(l=we(l,{contentProtection:T}));const S=Wo(s),_=ge(s,"Representation"),A=we(t,S);return Xi(_.map(Fb(l,n,A)))},Vb=(i,e)=>(t,s)=>{const r=On(e,ge(t.node,"BaseURL")),n=we(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=ge(t.node,"AdaptationSet"),o=Wo(t.node);return Xi(a.map(jb(n,r,o)))},Hb=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=we({serverURL:ar(i[0])},Ee(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},Gb=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,zb=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=ge(i,"Period");if(!a.length)throw new Error(Yi.INVALID_NUMBER_OF_PERIOD);const o=ge(i,"Location"),l=Ee(i),f=On([{baseUrl:t}],ge(i,"BaseURL")),m=ge(i,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=s,l.clientOffset=r,o.length&&(l.locations=o.map(ar));const y=[];return a.forEach((T,S)=>{const _=Ee(T),A=y[S-1];_.start=Gb({attributes:_,priorPeriodAttributes:A?A.attributes:null,mpdType:l.type}),y.push({node:T,attributes:_})}),{locations:l.locations,contentSteeringInfo:Hb(m,n),representationInfo:Xi(y.map(Vb(l,f))),eventStream:Xi(y.map(qb))}},dh=i=>{if(i==="")throw new Error(Yi.DASH_EMPTY_MANIFEST);const e=new ib;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(Yi.DASH_INVALID_XML);return s},Wb=i=>{const e=ge(i,"UTCTiming")[0];if(!e)return null;const t=Ee(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;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":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Yi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Kb=(i,e={})=>{const t=zb(dh(i),e),s=Rb(t.representationInfo);return Cb({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Xb=i=>Wb(dh(i));var hh=Math.pow(2,32),Yb=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},Zb=Jb;const e1=Yt(Zb);var t1=H([73,68,51]),i1=function(e,t){t===void 0&&(t=0),e=H(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Ns=function i(e,t){return t===void 0&&(t=0),e=H(e),e.length-t<10||!me(e,t1,{offset:t})?t:(t+=i1(e,t),i(e,t))},uc=function(e){return typeof e=="string"?Id(e):e},s1=function(e){return Array.isArray(e)?e.map(function(t){return uc(t)}):[uc(e)]},r1=function i(e,t,s){s===void 0&&(s=!1),t=s1(t),e=H(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(s)break;l=e.length}var f=e.subarray(n+8,l);me(o,t[0])&&(t.length===1?r.push(f):r.push.apply(r,i(f,t.slice(1),s))),n=l}return r},qr={EBML:H([26,69,223,163]),DocType:H([66,130]),Segment:H([24,83,128,103]),SegmentInfo:H([21,73,169,102]),Tracks:H([22,84,174,107]),Track:H([174]),TrackNumber:H([215]),DefaultDuration:H([35,227,131]),TrackEntry:H([174]),TrackType:H([131]),FlagDefault:H([136]),CodecID:H([134]),CodecPrivate:H([99,162]),VideoTrack:H([224]),AudioTrack:H([225]),Cluster:H([31,67,182,117]),Timestamp:H([231]),TimestampScale:H([42,215,177]),BlockGroup:H([160]),BlockDuration:H([155]),Block:H([161]),SimpleBlock:H([163])},to=[128,64,32,16,8,4,2,1],n1=function(e){for(var t=1,s=0;s=t.length)return t.length;var r=on(t,s,!1);if(me(e.bytes,r.bytes))return s;var n=on(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},cc=function i(e,t){t=a1(t),e=H(e);var s=[];if(!t.length)return s;for(var r=0;re.length?e.length:o+a.value,f=e.subarray(o,l);me(t[0],n.bytes)&&(t.length===1?s.push(f):s=s.concat(i(f,t.slice(1))));var m=n.length+a.length+f.length;r+=m}return s},u1=H([0,0,0,1]),l1=H([0,0,1]),c1=H([0,0,3]),d1=function(e){for(var t=[],s=1;s>1&63),s.indexOf(f)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},h1=function(e,t,s){return fh(e,"h264",t,s)},f1=function(e,t,s){return fh(e,"h265",t,s)},Ne={webm:H([119,101,98,109]),matroska:H([109,97,116,114,111,115,107,97]),flac:H([102,76,97,67]),ogg:H([79,103,103,83]),ac3:H([11,119]),riff:H([82,73,70,70]),avi:H([65,86,73]),wav:H([87,65,86,69]),"3gp":H([102,116,121,112,51,103]),mp4:H([102,116,121,112]),fmp4:H([115,116,121,112]),mov:H([102,116,121,112,113,116]),moov:H([109,111,111,118]),moof:H([109,111,111,102])},Qi={aac:function(e){var t=Ns(e);return me(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Ns(e);return me(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=cc(e,[qr.EBML,qr.DocType])[0];return me(t,Ne.webm)},mkv:function(e){var t=cc(e,[qr.EBML,qr.DocType])[0];return me(t,Ne.matroska)},mp4:function(e){if(Qi["3gp"](e)||Qi.mov(e))return!1;if(me(e,Ne.mp4,{offset:4})||me(e,Ne.fmp4,{offset:4})||me(e,Ne.moof,{offset:4})||me(e,Ne.moov,{offset:4}))return!0},mov:function(e){return me(e,Ne.mov,{offset:4})},"3gp":function(e){return me(e,Ne["3gp"],{offset:4})},ac3:function(e){var t=Ns(e);return me(e,Ne.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+1880},Xo=9e4,Yo,Qo,Rn,Jo,ph,mh,gh;Yo=function(i){return i*Xo};Qo=function(i,e){return i*e};Rn=function(i){return i/Xo};Jo=function(i,e){return i/e};ph=function(i,e){return Yo(Jo(i,e))};mh=function(i,e){return Qo(Rn(i),e)};gh=function(i,e,t){return Rn(t?i:i-e)};var hi={ONE_SECOND_IN_TS:Xo,secondsToVideoTs:Yo,secondsToAudioTs:Qo,videoTsToSeconds:Rn,audioTsToSeconds:Jo,audioTsToVideoTs:ph,videoTsToAudioTs:mh,metadataTsToSeconds:gh};/**
+ * @license
+ * Video.js 8.12.0
+ * Copyright Brightcove, Inc.
+ * Available under Apache License Version 2.0
+ *
+ *
+ * Includes vtt.js
+ * Available under Apache License Version 2.0
+ *
+ */var so="8.12.0";const Ot={},Kt=function(i,e){return Ot[i]=Ot[i]||[],e&&(Ot[i]=Ot[i].concat(e)),Ot[i]},g1=function(i,e){Kt(i,e)},yh=function(i,e){const t=Kt(i).indexOf(e);return t<=-1?!1:(Ot[i]=Ot[i].slice(),Ot[i].splice(t,1),!0)},y1=function(i,e){Kt(i,[].concat(e).map(t=>{const s=(...r)=>(yh(i,s),t(...r));return s}))},un={prefixed:!0},Qr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],dc=Qr[0];let Bs;for(let i=0;i