Welcome to mirror list, hosted at ThFree Co, Russian Federation.

files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js « js - github.com/nextcloud/files_videoplayer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 073059fe4cdc7476d388209bc2ec475b1ab226f5 (plain)
1
2
3
/*! For license information please see files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.LICENSE.txt */
(self.webpackChunkfiles_videoplayer=self.webpackChunkfiles_videoplayer||[]).push([["vendors-node_modules_video_js_dist_video_es_js"],{4029:(e,t,i)=>{"use strict";var n=i(5320),r=Object.prototype.toString,a=Object.prototype.hasOwnProperty,s=function(e,t,i){for(var n=0,r=e.length;n<r;n++)a.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))},o=function(e,t,i){for(var n=0,r=e.length;n<r;n++)null==i?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)},u=function(e,t,i){for(var n in e)a.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))};e.exports=function(e,t,i){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=i),"[object Array]"===r.call(e)?s(e,t,a):"string"==typeof e?o(e,t,a):u(e,t,a)}},9144:(e,t,i)=>{var n,r=void 0!==i.g?i.g:"undefined"!=typeof window?window:{},a=i(5893);"undefined"!=typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"])||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=n},8908:(e,t,i)=>{var n;n="undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},e.exports=n},5320:e=>{"use strict";var t,i,n=Function.prototype.toString,r="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof r&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw i}}),i={},r((function(){throw 42}),null,t)}catch(e){e!==i&&(r=null)}else r=null;var a=/^\s*class\b/,s=function(e){try{var t=n.call(e);return a.test(t)}catch(e){return!1}},o=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=r?function(e){if(e===l)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{r(e,null,t)}catch(e){if(e!==i)return!1}return!s(e)}:function(e){if(e===l)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(u)return function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}}(e);if(s(e))return!1;var t=o.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},7376:e=>{e.exports=function(e){var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},4827:(e,t,i)=>{"use strict";var n,r=i(1961),a=i(5220);(n=function(){var e=new Uint8Array,t=0;n.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s,o,u=0,l=0;for(e.length?(o=e.length,(e=new Uint8Array(i.byteLength+o)).set(e.subarray(0,o)),e.set(i,o)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!=(255&e[l])||240!=(240&e[l+1]))l++;else{if(e.length-l<7)break;if(l+(u=a.parseAdtsSize(e,l))>e.length)break;s={type:"audio",data:e.subarray(l,l+u),pts:t,dts:t},this.trigger("data",s),l+=u}else{if(e.length-l<10)break;if(l+(u=a.parseId3TagSize(e,l))>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+u)},this.trigger("data",r),l+=u}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array}}).prototype=new r,e.exports=n},5220:e=>{"use strict";var t=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]};e.exports={isLikelyAacData:function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},parseId3TagSize:function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var i=0;i+5<e.length;){if(255===e[i]&&240==(246&e[i+1]))return t[(60&e[i+2])>>>2];i++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=i(e.subarray(10,14)));do{if((n=i(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var a=0;a<r.byteLength;a++)if(0===r[a]){var s=unescape(function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r}(r,0,a));if("com.apple.streaming.transportStreamTimestamp"===s){var o=r.subarray(a+1),u=(1&o[3])<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return u*=4,u+=3&o[7]}break}}t+=10,t+=n}while(t<e.byteLength);return null}}},4886:(e,t,i)=>{"use strict";var n,r=i(1961),a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(n=function(){var e;n.prototype.init.call(this),this.push=function(t){var i,n,r,s,o,u,l=0,c=0;if("audio"===t.type)for(e?(s=e,(e=new Uint8Array(s.byteLength+t.data.byteLength)).set(s),e.set(t.data,s.byteLength)):e=t.data;l+5<e.length;)if(255===e[l]&&240==(246&e[l+1])){if(n=2*(1&~e[l+1]),i=(3&e[l+3])<<11|e[l+4]<<3|(224&e[l+5])>>5,u=9e4*(o=1024*(1+(3&e[l+6])))/a[(60&e[l+2])>>>2],r=l+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+c*u,dts:t.dts+c*u,sampleCount:o,audioobjecttype:1+(e[l+2]>>>6&3),channelcount:(1&e[l+2])<<2|(192&e[l+3])>>>6,samplerate:a[(60&e[l+2])>>>2],samplingfrequencyindex:(60&e[l+2])>>>2,samplesize:16,data:e.subarray(l+7+n,r)}),e.byteLength===r)return void(e=void 0);c++,e=e.subarray(r)}else l++},this.flush=function(){this.trigger("done")}}).prototype=new r,e.exports=n},6618:(e,t,i)=>{"use strict";var n,r,a,s=i(1961),o=i(9798);(r=function(){var e,t,i=0;r.prototype.init.call(this),this.push=function(n){var r;for(t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}}).prototype=new s,a={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(n=function(){var e,t,i,s,u,l,c,h=new r;n.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,h.push(e))},h.on("data",(function(n){var r={trackId:t,pts:i,dts:s,data:n};switch(31&n[0]){case 5:r.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:r.nalUnitType="sei_rbsp",r.escapedRBSP=u(n.subarray(1));break;case 7:r.nalUnitType="seq_parameter_set_rbsp",r.escapedRBSP=u(n.subarray(1)),r.config=l(r.escapedRBSP);break;case 8:r.nalUnitType="pic_parameter_set_rbsp";break;case 9:r.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",r)})),h.on("done",(function(){e.trigger("done")})),this.flush=function(){h.flush()},c=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},u=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},l=function(e){var t,i,n,r,s,u,l,h,d,p,f,m,g,y=0,v=0,_=0,b=0,T=1;if(i=(t=new o(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),a[i]&&(3===(s=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==s?8:12,g=0;g<f;g++)t.readBoolean()&&c(g<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(u=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===u)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),g=0;g<l;g++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),h=t.readUnsignedExpGolomb(),d=t.readUnsignedExpGolomb(),0===(p=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb(),_=t.readUnsignedExpGolomb(),b=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:m=[1,1];break;case 2:m=[12,11];break;case 3:m=[10,11];break;case 4:m=[16,11];break;case 5:m=[40,33];break;case 6:m=[24,11];break;case 7:m=[20,11];break;case 8:m=[32,11];break;case 9:m=[80,33];break;case 10:m=[18,11];break;case 11:m=[15,11];break;case 12:m=[64,33];break;case 13:m=[160,99];break;case 14:m=[4,3];break;case 15:m=[3,2];break;case 16:m=[2,1];break;case 255:m=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}m&&(T=m[0]/m[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(h+1)-2*y-2*v)*T),height:(2-p)*(d+1)*16-2*_-2*b}}}).prototype=new s,e.exports={H264Stream:n,NalByteStream:r}},4212:e=>{var t,i=[33,16,5,32,164,27],n=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],r=function(e){for(var t=[];e--;)t.push(0);return t},a={96e3:[i,[227,64],r(154),[56]],88200:[i,[231],r(170),[56]],64e3:[i,[248,192],r(240),[56]],48e3:[i,[255,192],r(268),[55,148,128],r(54),[112]],44100:[i,[255,192],r(268),[55,163,128],r(84),[112]],32e3:[i,[255,192],r(268),[55,234],r(226),[112]],24e3:[i,[255,192],r(268),[55,255,128],r(268),[111,112],r(126),[224]],16e3:[i,[255,192],r(268),[55,255,128],r(268),[111,255],r(269),[223,108],r(195),[1,192]],12e3:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,253,128],r(259),[56]],11025:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,255,192],r(268),[55,175,128],r(108),[112]],8e3:[n,r(268),[3,121,16],r(47),[7]]};e.exports=(t=a,Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{}))},3754:(e,t,i)=>{"use strict";var n=i(5108),r=i(1961),a=i(6221),s=function(){s.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new h(0,0),new h(0,1),new h(1,0),new h(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};s.prototype=new r,s.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=a.parseSei(e.escapedRBSP)).payloadType===a.USER_DATA_REGISTERED_ITU_T_T35&&(i=a.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=a.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},s.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},s.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},s.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},s.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},s.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var o={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},u=function(e){return null===e?"":(e=o[e]||e,String.fromCharCode(e))},l=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],c=function(){for(var e=[],t=15;t--;)e.push("");return e},h=function(e,t){h.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=c();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=c();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=c()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=u((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=u((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=l.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=u(n),a+=u(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};h.prototype=new r,h.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return n.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},h.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=c(),this.nonDisplayed_=c(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},h.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},h.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},h.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},h.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},h.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},h.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},h.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},h.prototype.isNormalChar=function(e){return e>=32&&e<=127},h.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=c(),this.displayed_=c()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},h.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},h.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},h.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},h.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},h.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},h.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},e.exports={CaptionStream:s,Cea608Stream:h}},7379:(e,t,i)=>{"use strict";var n,r,a,s=i(1961),o=i(3754),u=i(5215),l=i(817).TimestampRolloverStream,c=i(5215),h=188;(n=function(){var e=new Uint8Array(h),t=0;n.prototype.init.call(this),this.push=function(i){var n,r=0,a=h;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=h,a+=h);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===h&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new s,(r=function(){var e,t,i,n;r.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===u.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===u.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===u.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=u.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=u.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new s,r.STREAM_TYPES={h264:27,adts:15},a=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(t,i,n){var r,a,s=new Uint8Array(t.size),o={type:i},u=0,l=0;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,u=0;u<t.data.length;u++)a=t.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,h,d;c=s,(h=o).packetLength=6+(c[4]<<8|c[5]),h.dataAlignmentIndicator=0!=(4&c[6]),192&(d=c[7])&&(h.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,h.pts*=4,h.pts+=(6&c[13])>>>1,h.dts=h.pts,64&d&&(h.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,h.dts*=4,h.dts+=(6&c[18])>>>1)),h.data=c.subarray(9+c[8]),r="video"===i||o.packetLength<=t.size,(n||r)&&(t.size=0,t.data.length=0),r&&e.trigger("data",o)}};a.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case u.H264_STREAM_TYPE:case c.H264_STREAM_TYPE:e=t,s="video";break;case u.ADTS_STREAM_TYPE:e=i,s="audio";break;case u.METADATA_STREAM_TYPE:e=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){r(t,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}},a.prototype=new s;var d={PAT_PID:0,MP2T_PACKET_LENGTH:h,TransportPacketStream:n,TransportParseStream:r,ElementaryStream:a,TimestampRolloverStream:l,CaptionStream:o.CaptionStream,Cea608Stream:o.Cea608Stream,MetadataStream:i(8659)};for(var p in u)u.hasOwnProperty(p)&&(d[p]=u[p]);e.exports=d},8659:(e,t,i)=>{"use strict";var n,r=i(5108),a=i(1961),s=i(5215),o=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},u=function(e,t,i){return decodeURIComponent(o(e,t,i))},l=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},c={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.value=u(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.url=u(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,i;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(i=e.data,unescape(o(i,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};(n=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},a=0,o=[],u=0;if(n.prototype.init.call(this),this.dispatchType=s.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,h,d;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(u=0,o.length=0),0===o.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&r.log("Skipping unrecognized metadata packet");else if(o.push(e),u+=e.data.byteLength,1===o.length&&(a=l(e.data.subarray(6,10)),a+=10),!(u<a)){for(t={data:new Uint8Array(a),frames:[],pts:o[0].pts,dts:o[0].dts},d=0;d<a;)t.data.set(o[0].data.subarray(0,a-d),d),d+=o[0].data.byteLength,u-=o[0].data.byteLength,o.shift();n=10,64&t.data[5]&&(n+=4,n+=l(t.data.subarray(10,14)),a-=l(t.data.subarray(16,20)));do{if((s=l(t.data.subarray(n+4,n+8)))<1)return r.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((h={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=h.id,c[h.id]&&(c[h.id](h),"com.apple.streaming.transportStreamTimestamp"===h.owner)){var p=h.data,f=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;f*=4,f+=3&p[7],h.timeStamp=f,void 0===t.pts&&void 0===t.dts&&(t.pts=h.timeStamp,t.dts=h.timeStamp),this.trigger("timestamp",h)}t.frames.push(h),n+=10,n+=s}while(n<a);this.trigger("data",t)}}}).prototype=new a,e.exports=n},4149:(e,t,i)=>{"use strict";var n=i(5215),r=function(e){var t=31&e[1];return t<<=8,t|=e[2]},a=function(e){return!!(64&e[1])},s=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},o=function(e){switch(e){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}};e.exports={parseType:function(e,t){var i=r(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=a(e),i=4+s(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=a(e),n=4+s(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var o=12+((15&e[n+10])<<8|e[n+11]);o<r;){var u=n+o;t[(31&e[u+1])<<8|e[u+2]]=e[u],o+=5+((15&e[u+3])<<8|e[u+4])}return t}},parsePayloadUnitStartIndicator:a,parsePesType:function(e,t){switch(t[r(e)]){case n.H264_STREAM_TYPE:return"video";case n.ADTS_STREAM_TYPE:return"audio";case n.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!a(e))return null;var t=4+s(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+s(e),i=e.subarray(t),n=0,r=0,a=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0);do{n++}while(1!==i[n]&&n<i.length);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),a}}},5215:e=>{"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},817:(e,t,i)=>{"use strict";var n=i(1961),r=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},a=function(e){var t,i;a.prototype.init.call(this),this.type_=e,this.push=function(e){e.type===this.type_&&(void 0===i&&(i=e.dts),e.dts=r(e.dts,i),e.pts=r(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.discontinuity=function(){i=void 0,t=void 0}};a.prototype=new n,e.exports={TimestampRolloverStream:a,handleRollover:r}},7091:(e,t,i)=>{var n=i(4212),r=i(1489);e.exports={prefixWithSilence:function(e,t,i,a){var s,o,u,l,c=0,h=0,d=0;if(t.length&&(s=r.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(9e4/(e.samplerate/1024)),i&&a&&(c=s-Math.max(i,a),d=(h=Math.floor(c/o))*o),!(h<1||d>45e3))){for((u=n[e.samplerate])||(u=t[0].data),l=0;l<h;l++)t.splice(l,0,{data:u});e.baseMediaDecodeTime-=Math.floor(r.videoTsToAudioTs(d,e.samplerate))}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r}}},6659:(e,t,i)=>{"use strict";var n=i(6221).discardEmulationPreventionBytes,r=i(3754).CaptionStream,a=i(7661),s=i(2628),o=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},u=function(e,t){var i=a.findBox(e,["moof","traf"]),r=a.findBox(e,["mdat"]),u={},l=[];return r.forEach((function(e,t){var n=i[t];l.push({mdat:e,traf:n})})),l.forEach((function(e){var i,r,l=e.mdat,c=e.traf,h=a.findBox(c,["tfhd"]),d=s.parseTfhd(h[0]),p=d.trackId,f=a.findBox(c,["tfdt"]),m=f.length>0?s.parseTfdt(f[0]).baseMediaDecodeTime:0,g=a.findBox(c,["trun"]);t===p&&g.length>0&&(i=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,o=i.trackId,u=[];return e.forEach((function(e){var t=s.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=o,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),u=u.concat(t)})),u}(g,m,d),r=function(e,t,i){var r,a,s,u,l=new DataView(e.buffer,e.byteOffset,e.byteLength),c=[];for(a=0;a+4<e.length;a+=s)if(s=l.getUint32(a),a+=4,!(s<=0)&&6==(31&e[a])){var h=e.subarray(a+1,a+1+s),d=o(a,t);r={nalUnitType:"sei_rbsp",size:s,data:h,escapedRBSP:n(h),trackId:i},d?(r.pts=d.pts,r.dts=d.dts,u=d):(r.pts=u.pts,r.dts=u.dts),c.push(r)}return c}(l,i,p),u[p]||(u[p]=[]),u[p]=u[p].concat(r))})),u};e.exports=function(){var e,t,i,n,a,s=!1;this.isInitialized=function(){return s},this.init=function(){e=new r,s=!0,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,a.captions.push(e),a.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,r,s){var o;if(!this.isInitialized())return null;if(!r||!s)return null;if(this.isNewInit(r,s))i=r[0],n=s[i];else if(!i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,r,s)}return o=function(e,t,i){return t?{seiNals:u(e,t)[t],timescale:i}:null}(e,i,n),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),a):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){a.captions=[],a.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,a?this.clearParsedCaptions():a={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},9586:e=>{var t=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i};e.exports={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},groupFramesIntoGops:function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,i){var n,r,a,s,o,u=i||0,l=[];for(n=0;n<e.length;n++)for(s=e[n],r=0;r<s.length;r++)o=s[r],u+=(a=t(o,u)).size,l.push(a);return l},concatenateNalData:function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c}}},272:(e,t,i)=>{e.exports={generator:i(2014),probe:i(7661),Transmuxer:i(5064).Transmuxer,AudioSegmentStream:i(5064).AudioSegmentStream,VideoSegmentStream:i(5064).VideoSegmentStream,CaptionParser:i(6659)}},2014:e=>{"use strict";var t,i,n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,w,C,E,A,L,O,P,x,U,I,D,R,M,B,N,j,F,V,H=Math.pow(2,32)-1;!function(){var e;if(k={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in k)k.hasOwnProperty(e)&&(k[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),E=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new Uint8Array([0,0,0,1]),A=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]),L=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]),O={video:A,audio:L},U=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),x=new Uint8Array([0,0,0,0,0,0,0,0]),I=new Uint8Array([0,0,0,0,0,0,0,0]),D=I,R=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M=I,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},i=function(){return t(k.dinf,t(k.dref,U))},n=function(e){return t(k.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},r=function(){return t(k.ftyp,w,C,w,E)},g=function(e){return t(k.hdlr,O[e])},a=function(e){return t(k.mdat,e)},m=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(k.mdhd,i)},f=function(e){return t(k.mdia,m(e),g(e.type),o(e))},s=function(e){return t(k.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return t(k.minf,"video"===e.type?t(k.vmhd,P):t(k.smhd,x),i(),v(e))},u=function(e,i){for(var n=[],r=i.length;r--;)n[r]=b(i[r]);return t.apply(null,[k.moof,s(e)].concat(n))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=d(e[i]);return t.apply(null,[k.moov,h(4294967295)].concat(n).concat(c(e)))},c=function(e){for(var i=e.length,n=[];i--;)n[i]=T(e[i]);return t.apply(null,[k.mvex].concat(n))},h=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 t(k.mvhd,i)},y=function(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(k.sdtp,a)},v=function(e){return t(k.stbl,_(e),t(k.stts,M),t(k.stsc,D),t(k.stsz,R),t(k.stco,I))},_=function(e){return t(k.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?B(e):N(e))},B=function(e){var i,n=e.sps||[],r=e.pps||[],a=[],s=[];for(i=0;i<n.length;i++)a.push((65280&n[i].byteLength)>>>8),a.push(255&n[i].byteLength),a=a.concat(Array.prototype.slice.call(n[i]));for(i=0;i<r.length;i++)s.push((65280&r[i].byteLength)>>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));return t(k.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),t(k.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length]).concat(a).concat([r.length]).concat(s))),t(k.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},N=function(e){return t(k.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},p=function(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(k.tkhd,i)},b=function(e){var i,n,r,a,s,o;return i=t(k.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/(H+1)),o=Math.floor(e.baseMediaDecodeTime%(H+1)),n=t(k.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=S(e,92),t(k.traf,i,n,r)):(a=y(e),r=S(e,a.length+92),t(k.traf,i,n,r,a))},d=function(e){return e.duration=e.duration||4294967295,t(k.trak,p(e),f(e))},T=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(k.trex,i)},V=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},F=function(e,i){var n,r,a,s;for(i+=20+16*(r=e.samples||[]).length,n=V(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return t(k.trun,new Uint8Array(n))},j=function(e,i){var n,r,a,s;for(i+=20+8*(r=e.samples||[]).length,n=V(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return t(k.trun,new Uint8Array(n))},S=function(e,t){return"audio"===e.type?j(e,t):F(e,t)},e.exports={ftyp:r,mdat:a,moof:u,moov:l,initSegment:function(e){var t,i=r(),n=l(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}}},7661:(e,t,i)=>{"use strict";var n,r,a,s,o,u=i(1976).toUnsigned;n=function(e,t){var i,a,s,o,l,c=[];if(!t.length)return null;for(i=0;i<e.byteLength;)a=u(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=r(e.subarray(i+4,i+8)),o=a>1?i+a:e.byteLength,s===t[0]&&(1===t.length?c.push(e.subarray(i+8,o)):(l=n(e.subarray(i+8,o),t.slice(1))).length&&(c=c.concat(l))),i=o;return c},r=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},a=function(e){return n(e,["moov","trak"]).reduce((function(e,t){var i,r,a,s,o;return(i=n(t,["tkhd"])[0])?(r=i[0],s=u(i[a=0===r?12:20]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3]),(o=n(t,["mdia","mdhd"])[0])?(a=0===(r=o[0])?12:20,e[s]=u(o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3]),e):null):null}),{})},s=function(e,t){var i,r,a;return i=n(t,["moof","traf"]),r=[].concat.apply([],i.map((function(t){return n(t,["tfhd"]).map((function(i){var r,a,s;return r=u(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),a=e[r]||9e4,s=n(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=u(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=u(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],(s=s||1/0)/a}))}))),a=Math.min.apply(null,r),isFinite(a)?a:0},o=function(e){var t=n(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=n(e,["mdia","hdlr"]),a=n(e,["tkhd"]);t.forEach((function(e,t){var n,s,o=r(e.subarray(8,12)),u=a[t];"vide"===o&&(s=0===(n=new DataView(u.buffer,u.byteOffset,u.byteLength)).getUint8(0)?n.getUint32(12):n.getUint32(20),i.push(s))}))})),i},e.exports={findBox:n,parseType:r,timescale:a,startTime:s,videoTrackIds:o}},5557:e=>{e.exports={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/9e4,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}}},5064:(e,t,i)=>{"use strict";var n,r,a,s,o=i(1961),u=i(2014),l=i(9586),c=i(7091),h=i(5557),d=i(7379),p=i(4886),f=i(6618).H264Stream,m=i(4827),g=i(5220).isLikelyAacData,y=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],v=["width","height","profileIdc","levelIdc","profileCompatibility"],_=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};(r=function(e,t){var i=[],n=0,a=0,s=0,o=1/0;t=t||{},r.prototype.init.call(this),this.push=function(t){h.collectDtsInfo(e,t),e&&y.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(t){a=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){o=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var r,l,d,p;0!==i.length?(r=c.trimAdtsFramesByEarliestDts(i,e,a),e.baseMediaDecodeTime=h.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),c.prefixWithSilence(e,r,s,o),e.samples=c.generateSampleTable(r),d=u.mdat(c.concatenateFrameData(r)),i=[],l=u.moof(n,[e]),p=new Uint8Array(l.byteLength+d.byteLength),n++,p.set(l),p.set(d,l.byteLength),h.clearDtsInfo(e),this.trigger("data",{track:e,boxes:p}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}}).prototype=new o,(n=function(e,t){var i,r,a=0,s=[],o=[];t=t||{},n.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){h.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],v.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var i,n,r,c,d,p;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=l.groupNalsIntoFrames(s),(r=l.groupFramesIntoGops(i))[0][0].keyFrame||((n=this.getGopForFusion_(s[0],e))?(r.unshift(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.pts=n.pts,r.dts=n.dts,r.duration+=n.duration):r=l.extendFirstKeyFrame(r)),o.length){var f;if(!(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r)))return this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");h.clearDtsInfo(e),r=f}h.collectDtsInfo(e,r),e.samples=l.generateSampleTable(r),d=u.mdat(l.concatenateNalData(r)),e.baseMediaDecodeTime=h.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",r.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),c=u.moof(a,[e]),p=new Uint8Array(c.byteLength+d.byteLength),a++,p.set(c),p.set(d,c.byteLength),this.trigger("data",{track:e,boxes:p}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){h.clearDtsInfo(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&_(e.pps[0],a.pps[0])&&e.sps&&_(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,s,u,l;for(a=e.byteLength,s=e.nalCount,u=e.duration,t=i=0;t<o.length&&i<e.length&&(n=o[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,a-=r.byteLength,s-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,s,u;for(t=o.length-1,i=e.length-1,a=null,s=!1;t>=0&&i>=0;){if(n=o[t],r=e[i],n.pts===r.pts){s=!0;break}n.pts>r.pts?t--:(t===o.length-1&&(a=i),i--)}if(!s&&null===a)return null;if(0===(u=s?i:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){o=e}}).prototype=new o,(s=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,s.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}}).prototype=new o,s.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,v.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,y.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=u.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=o),i.cueTime/=9e4,s.metadata.push(i);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(a=function(e){var t,i,o=this,u=!0;a.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new d.MetadataStream,t.aacStream=new m,t.audioTimestampRolloverStream=new d.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new d.TimestampRolloverStream("timed-metadata"),t.adtsStream=new p,t.coalesceStream=new s(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(n){"timed-metadata"!==n.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new r(i,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a,a.type="ts",a.metadataStream=new d.MetadataStream,a.packetStream=new d.TransportPacketStream,a.parseStream=new d.TransportParseStream,a.elementaryStream=new d.ElementaryStream,a.videoTimestampRolloverStream=new d.TimestampRolloverStream("video"),a.audioTimestampRolloverStream=new d.TimestampRolloverStream("audio"),a.timedMetadataTimestampRolloverStream=new d.TimestampRolloverStream("timed-metadata"),a.adtsStream=new p,a.h264Stream=new f,a.captionStream=new d.CaptionStream,a.coalesceStream=new s(e,a.metadataStream),a.headOfPipeline=a.packetStream,a.packetStream.pipe(a.parseStream).pipe(a.elementaryStream),a.elementaryStream.pipe(a.videoTimestampRolloverStream).pipe(a.h264Stream),a.elementaryStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream),a.elementaryStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream),a.h264Stream.pipe(a.captionStream).pipe(a.coalesceStream),a.elementaryStream.on("data",(function(s){var u;if("metadata"===s.type){for(u=s.tracks.length;u--;)t||"video"!==s.tracks[u].type?i||"audio"!==s.tracks[u].type||((i=s.tracks[u]).timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime):(t=s.tracks[u]).timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime;t&&!a.videoSegmentStream&&(a.coalesceStream.numberOfTracks++,a.videoSegmentStream=new n(t,e),a.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,a.audioSegmentStream.setEarliestDts(e.dts))})),a.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),a.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&a.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)),i&&!a.audioSegmentStream&&(a.coalesceStream.numberOfTracks++,a.audioSegmentStream=new r(i,e),a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream))}})),a.coalesceStream.on("data",this.trigger.bind(this,"data")),a.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,h.clearDtsInfo(i),e.keepOriginalTimestamps||(i.timelineStartInfo.baseMediaDecodeTime=n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[],r.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,h.clearDtsInfo(t),r.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=n)),r.timedMetadataTimestampRolloverStream&&r.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(u){var t=g(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),u=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){u=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new o,e.exports={Transmuxer:a,VideoSegmentStream:n,AudioSegmentStream:r,AUDIO_PROPERTIES:y,VIDEO_PROPERTIES:v}},6221:e=>{"use strict";e.exports={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}t+=r,n=0,r=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},discardEmulationPreventionBytes:function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},USER_DATA_REGISTERED_ITU_T_T35:4}},2628:(e,t,i)=>{"use strict";var n,r,a=i(7661).parseType,s=function(e){return new Date(1e3*e-20828448e5)},o=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},u=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4<e.length;t+=i)if(i=n.getUint32(t),t+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},l={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:n(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;for(t=e[n],n++,r=0;r<t;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:a(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(a(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:n(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:n(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:a(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:u(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=s(i.getUint32(n)),n+=8,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=s(i.getUint32(n)),n+=4,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,t=i.getUint16(n),r.language+=String.fromCharCode(96+(t>>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:n(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:n(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=n(e.subarray(28))[0]),i},moof:function(e){return{boxes:n(e)}},moov:function(e){return{boxes:n(e)}},mvex:function(e){return{boxes:n(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(t.getUint32(i)),i+=8,n.modificationTime=s(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=s(t.getUint32(i)),i+=4,n.modificationTime=s(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:n(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:n(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)n.entries.push(i.getUint32(t));return n},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(t=8;r;t+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return n},styp:function(e){return l.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(t.getUint32(i)),i+=8,n.modificationTime=s(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=8,n.duration=t.getUint32(i)):(n.creationTime=s(t.getUint32(i)),i+=4,n.modificationTime=s(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=4,n.duration=t.getUint32(i)),i+=4,i+=8,n.layer=t.getUint16(i),i+=2,n.alternateGroup=t.getUint16(i),i+=2,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.width=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.height=t.getUint16(i)+t.getUint16(i+2)/16,n},traf:function(e){return{boxes:n(e)}},trak:function(e){return{boxes:n(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],u=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],h=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),a&&h&&(t={flags:o(e.subarray(d,d+4))},d+=4,s&&(t.duration=n.getUint32(d),d+=4),u&&(t.size=n.getUint32(d),d+=4),c&&(t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),h--);h--;)t={},s&&(t.duration=n.getUint32(d),d+=4),u&&(t.size=n.getUint32(d),d+=4),l&&(t.flags=o(e.subarray(d,d+4)),d+=4),c&&(t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};n=function(e){for(var t,i,n,r,s,o=0,u=[],c=new ArrayBuffer(e.length),h=new Uint8Array(c),d=0;d<e.length;++d)h[d]=e[d];for(t=new DataView(c);o<e.byteLength;)i=t.getUint32(o),n=a(e.subarray(o+4,o+8)),r=i>1?o+i:e.byteLength,(s=(l[n]||function(e){return{data:e}})(e.subarray(o+8,r))).size=i,s.type=n,u.push(s),o=r;return u},r=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+"  "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map((function(e){return i+"  "+e})).join("\n")+"\n"+i+"  >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map((function(e,t){return 0===t?e:i+"  "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+r(e.boxes,t+1):"")})).join("\n")},e.exports={inspect:n,textify:r,parseTfdt:l.tfdt,parseHdlr:l.hdlr,parseTfhd:l.tfhd,parseTrun:l.trun}},5547:(e,t,i)=>{"use strict";var n=i(5215),r=i(817).handleRollover,a={};a.ts=i(4149),a.aac=i(5220);var s=9e4,o=188,u=71,l=function(e,t,i){for(var n,r,s,l,c=0,h=o,d=!1;h<=e.byteLength;)if(e[c]!==u||e[h]!==u&&h!==e.byteLength)c++,h++;else{if(n=e.subarray(c,h),"pes"===a.ts.parseType(n,t.pid))r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="audio",i.audio.push(l),d=!0);if(d)break;c+=o,h+=o}for(c=(h=e.byteLength)-o,d=!1;c>=0;)if(e[c]!==u||e[h]!==u&&h!==e.byteLength)c--,h--;else{if(n=e.subarray(c,h),"pes"===a.ts.parseType(n,t.pid))r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="audio",i.audio.push(l),d=!0);if(d)break;c-=o,h-=o}},c=function(e,t,i){for(var n,r,s,l,c,h,d,p=0,f=o,m=!1,g={data:[],size:0};f<e.byteLength;)if(e[p]!==u||e[f]!==u)p++,f++;else{if(n=e.subarray(p,f),"pes"===a.ts.parseType(n,t.pid))if(r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!m&&(l=a.ts.parsePesTime(n))&&(l.type="video",i.video.push(l),m=!0),!i.firstKeyFrame)){if(s&&0!==g.size){for(c=new Uint8Array(g.size),h=0;g.data.length;)d=g.data.shift(),c.set(d,h),h+=d.byteLength;a.ts.videoPacketContainsKeyFrame(c)&&(i.firstKeyFrame=a.ts.parsePesTime(c),i.firstKeyFrame.type="video"),g.size=0}g.data.push(n),g.size+=n.byteLength}if(m&&i.firstKeyFrame)break;p+=o,f+=o}for(p=(f=e.byteLength)-o,m=!1;p>=0;)if(e[p]!==u||e[f]!==u)p--,f--;else{if(n=e.subarray(p,f),"pes"===a.ts.parseType(n,t.pid))r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="video",i.video.push(l),m=!0);if(m)break;p-=o,f-=o}},h=function(e){var t={pid:null,table:null},i={};for(var r in function(e,t){for(var i,n=0,r=o;r<e.byteLength;)if(e[n]!==u||e[r]!==u)n++,r++;else{switch(i=e.subarray(n,r),a.ts.parseType(i,t.pid)){case"pat":t.pid||(t.pid=a.ts.parsePat(i));break;case"pmt":t.table||(t.table=a.ts.parsePmt(i))}if(t.pid&&t.table)return;n+=o,r+=o}}(e,t),t.table){if(t.table.hasOwnProperty(r))switch(t.table[r]){case n.H264_STREAM_TYPE:i.video=[],c(e,t,i),0===i.video.length&&delete i.video;break;case n.ADTS_STREAM_TYPE:i.audio=[],l(e,t,i),0===i.audio.length&&delete i.audio}}return i};e.exports={inspect:function(e,t){var i;return i=a.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,o=null,u=0,l=0;e.length-l>=3;){switch(a.aac.parseType(e,l)){case"timed-metadata":if(e.length-l<10){i=!0;break}if((u=a.aac.parseId3TagSize(e,l))>e.length){i=!0;break}null===o&&(t=e.subarray(l,l+u),o=a.aac.parseAacTimestamp(t)),l+=u;break;case"audio":if(e.length-l<7){i=!0;break}if((u=a.aac.parseAdtsSize(e,l))>e.length){i=!0;break}null===r&&(t=e.subarray(l,l+u),r=a.aac.parseSampleRate(t)),n++,l+=u;break;default:l++}if(i)return null}if(null===r||null===o)return null;var c=s/r;return{audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*c,pts:o+1024*n*c}]}}(e):h(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;void 0===i&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=r(e.dts,i),e.pts=r(e.pts,i),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s}))}if(e.video&&e.video.length){var n=t;if(void 0===n&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=r(e.dts,n),e.pts=r(e.pts,n),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s})),e.firstKeyFrame){var a=e.firstKeyFrame;a.dts=r(a.dts,n),a.pts=r(a.pts,n),a.dtsTime=a.dts/s,a.ptsTime=a.dts/s}}}(i,t),i):null},parseAudioPes_:l}},1976:e=>{e.exports={toUnsigned:function(e){return e>>>0}}},1489:e=>{var t,i,n,r,a,s;t=function(e){return 9e4*e},i=function(e,t){return e*t},n=function(e){return e/9e4},r=function(e,t){return e/t},a=function(e,i){return t(r(e,i))},s=function(e,t){return i(n(e),t)},e.exports={secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:n,audioTsToSeconds:r,audioTsToVideoTs:a,videoTsToAudioTs:s}},9798:e=>{"use strict";var t;t=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},e.exports=t},1961:e=>{"use strict";var t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},e.exports=t},4947:(e,t,i)=>{var n=i(2745),r=i(4029);e.exports=function(e){if(!e)return{};var t={};return r(n(e).split("\n"),(function(e){var i,r=e.indexOf(":"),a=n(e.slice(0,r)).toLowerCase(),s=n(e.slice(r+1));void 0===t[a]?t[a]=s:(i=t[a],"[object Array]"===Object.prototype.toString.call(i)?t[a].push(s):t[a]=[t[a],s])})),t}},5974:e=>{e.exports=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]}},2745:(e,t)=>{(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},7753:e=>{function t(e){return e.replace(/\n\r?\s*/g,"")}e.exports=function(e){for(var i="",n=0;n<arguments.length;n++)i+=t(e[n])+(arguments[n+1]||"");return i}},9945:function(e){var t,i,n,r,a;t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,i=/^([^\/?#]*)(.*)$/,n=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,a={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return n.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+s.path;l.path=a.normalizePath(h)}else l.path=o.path,s.params||(l.params=o.params,s.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(l)},parseURL:function(e){var i=t.exec(e);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a},1272:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>_u});var n=i(5974),r=i.n(n),a=i(3407),s=i.n(a),o=i(7753),u=i.n(o),l=i(1875),c=i.n(l),h=i(9945),d=i.n(h),p=i(8908),f=i.n(p),m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},y=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},v=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},_=function(){function e(){m(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e],i=void 0,n=void 0,r=void 0;if(t)if(2===arguments.length)for(n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=t.length,i=0;i<n;++i)t[i].apply(this,r)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),b=function(e){function t(){m(this,t);var i=v(this,e.call(this));return i.buffer="",i}return y(t,e),t.prototype.push=function(e){var t=void 0;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(_),T=function(e){for(var t=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},n=t.length,r=void 0;n--;)""!==t[n]&&((r=/([^=]*)=(.*)/.exec(t[n]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),i[r[0]]=r[1]);return i},S=function(e){function t(){m(this,t);var i=v(this,e.call(this));return i.customParsers=[],i}return y(t,e),t.prototype.push=function(e){var t=void 0,i=void 0;if(0!==(e=e.replace(/^[\u0000\s]+|[\u0000\s]+$/g,"")).length)if("#"===e[0]){for(var n=0;n<this.customParsers.length;n++)if(this.customParsers[n].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"totalduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"byterange"},t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){var r=T(t[1]);if(r.URI&&(i.uri=r.URI),r.BYTERANGE){var a=r.BYTERANGE.split("@"),s=a[0],o=a[1];i.byterange={},s&&(i.byterange.length=parseInt(s,10)),o&&(i.byterange.offset=parseInt(o,10))}}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=T(t[1]),i.attributes.RESOLUTION){var u=i.attributes.RESOLUTION.split("x"),l={};u[0]&&(l.width=parseInt(u[0],10)),u[1]&&(l.height=parseInt(u[1],10)),i.attributes.RESOLUTION=l}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=T(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e))this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=T(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=T(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}else this.trigger("data",{type:"comment",text:e.slice(1)})}else this.trigger("data",{type:"uri",uri:e})},t.prototype.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push((function(e){if(i.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:a}),!0}))},t}(_),k=function(e){function t(){m(this,t);var i=v(this,e.call(this));i.lineStream=new b,i.parseStream=new S,i.lineStream.pipe(i.parseStream);var n=i,r=[],a={},s=void 0,o=void 0,u=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;return i.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},i.parseStream.on("data",(function(e){var t=void 0,i=void 0;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(a.byterange=t,t.length=e.length,"offset"in e||(this.trigger("info",{message:"defaulting offset to zero"}),e.offset=0)),"offset"in e&&(a.byterange=t,t.offset=e.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"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"})),e.duration>0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){e.attributes?"NONE"!==e.attributes.METHOD?e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(o.iv=e.attributes.IV)):this.trigger("warn",{message:"ignoring key declaration without URI"}):o=null:this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){s={},e.uri&&(s.uri=e.uri),e.byterange&&(s.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(a.attributes||(a.attributes={}),g(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(i={default:/yes/i.test(e.attributes.DEFAULT)}).default?i.autoselect=!0:i.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(i.language=e.attributes.LANGUAGE),e.attributes.URI&&(i.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(i.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(i.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(i.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=i}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),a.dateTimeString=e.dateTimeString,a.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data}}[e.tagType]||u).call(n)},uri:function(){a.uri=e.uri,r.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),o&&(a.key=o),a.timeline=c,s&&(a.map=s),a={}},comment:function(){},custom:function(){e.segment?(a.custom=a.custom||{},a.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(n)})),i}return y(t,e),t.prototype.push=function(e){this.lineStream.push(e)},t.prototype.end=function(){this.lineStream.push("\n")},t.prototype.addParser=function(e){this.parseStream.addParser(e)},t}(_),w=i(9144),C=i.n(w),E=function(e){return!!e&&"object"==typeof e},A=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce((function(t,i){return Object.keys(i).forEach((function(n){Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=t[n].concat(i[n]):E(t[n])&&E(i[n])?t[n]=e(t[n],i[n]):t[n]=i[n]})),t}),{})},L=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},O=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},P=function(e){var t;return(t=e.reduce((function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0].discontinuity=!0,(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,i;return e.discontinuityStarts=(t=e.segments,i="discontinuity",t.reduce((function(e,t,n){return t[i]&&e.push(n),e}),[])),e}))},x=function(e){var t,i=e.attributes,n=e.segments,r={attributes:(t={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r},U=function(e){var t,i=e.attributes,n=e.segments,r={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r},I=function(e){var t;if(!e.length)return{};var i=e[0].attributes,n=i.sourceDuration,r=i.minimumUpdatePeriod,a=void 0===r?0:r,s=P(e.filter((function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType}))).map(U),o=P(e.filter((function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType}))),u=e.filter((function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType})),l={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:n,playlists:s,minimumUpdatePeriod:1e3*a};return o.length&&(l.mediaGroups.AUDIO.audio=o.reduce((function(e,t){var i=t.attributes.role&&t.attributes.role.value||"main",n=t.attributes.lang||"",r="main";return n&&(r=t.attributes.lang+" ("+i+")"),e[r]&&e[r].playlists[0].attributes.BANDWIDTH>t.attributes.bandwidth||(e[r]={language:n,autoselect:!0,default:"main"===i,playlists:[x(t)],uri:""}),e}),{})),u.length&&(l.mediaGroups.SUBTITLES.subs=function(e){return e.reduce((function(e,t){var i,n,r,a,s=t.attributes.lang||"text";return e[s]||(e[s]={language:s,default:!1,autoselect:!1,playlists:[(i=t,r=i.attributes,a=i.segments,void 0===a&&(a=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration),{attributes:(n={NAME:r.id,BANDWIDTH:r.bandwidth},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:a,mediaSequence:a.length?a[0].number:1})],uri:""}),e}),{})}(u)),l};"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self&&self;var D,R,M=(D=function(e,t){var i,n,r,a,s;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=n.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(h)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=i.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s},D(R={exports:{}},R.exports),R.exports),B=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=M.buildAbsoluteURL(f().location.href,e)),M.buildAbsoluteURL(e,t))},N=function(e){var t=e.baseUrl,i=void 0===t?"":t,n=e.source,r=void 0===n?"":n,a=e.range,s=void 0===a?"":a,o={uri:r,resolvedUri:B(i||"",r)};if(s){var u=s.split("-"),l=parseInt(u[0],10),c=parseInt(u[1],10);o.byterange={length:c-l,offset:l}}return o},j=function(e,t,i){var n=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,h=(n+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((h*o-t)/i)},F=function(e,t){for(var i=e.type,n=void 0===i?"static":i,r=e.minimumUpdatePeriod,a=void 0===r?0:r,s=e.media,o=void 0===s?"":s,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,h=e.startNumber,d=void 0===h?1:h,p=e.periodIndex,f=[],m=-1,g=0;g<t.length;g++){var y=t[g],v=y.d,_=y.r||0,b=y.t||0;m<0&&(m=b),b&&b>m&&(m=b);var T=void 0;if(_<0){var S=g+1;T=S===t.length?"dynamic"===n&&a>0&&o.indexOf("$Number$")>0?j(e,m,v):(u*c-m)/v:(t[S].t-m)/v}else T=_+1;for(var k=d+f.length+T,w=d+f.length;w<k;)f.push({number:w,duration:v/c,time:m,timeline:p}),m+=v,w++}return f},V={static:function(e){var t=e.duration,i=e.timescale,n=void 0===i?1:i,r=e.sourceDuration;return{start:0,end:Math.ceil(r/(t/n))}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,h=e.timeShiftBufferDepth,d=void 0===h?1/0:h,p=(t+i)/1e3,f=n+u,m=p+c-f,g=Math.ceil(m*a/s),y=Math.floor((p-f-d)*a/s),v=Math.floor((p-f)*a/s);return{start:Math.max(0,y),end:Math.min(g,v)}}},H=function(e){var t=e.type,i=void 0===t?"static":t,n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.sourceDuration,o=V[i](e),u=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}(o.start,o.end).map(function(e){return function(t,i){var n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.periodIndex,o=e.startNumber;return{number:(void 0===o?1:o)+t,duration:n/a,timeline:s,time:i*n}}}(e));if("static"===i){var l=u.length-1;u[l].duration=s-n/a*l}return u},q=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,z=function(e,t){return e.replace(q,function(e){return function(t,i,n,r){if("$$"===t)return"$";if(void 0===e[i])return t;var a=""+e[i];return"RepresentationID"===i?a:(r=n?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}}(t))},W=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,a=N({baseUrl:e.baseUrl,source:z(r.sourceURL,i),range:r.range}),s=function(e,t){return e.duration||t?e.duration?H(e):F(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t);return s.map((function(t){i.Number=t.number,i.Time=t.time;var n=z(e.media||"",i);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:B(e.baseUrl||"",n),map:a,number:t.number}}))},G="INVALID_NUMBER_OF_PERIOD",X="DASH_EMPTY_MANIFEST",Y="DASH_INVALID_XML",$="NO_BASE_URL",K="SEGMENT_TIME_UNSPECIFIED",Q="UNSUPPORTED_UTC_TIMING_SCHEME",J=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!i&&!t||i&&t)throw new Error(K);var a,s=r.map((function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,a=N({baseUrl:i,source:r.sourceURL,range:r.range}),s=N({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return i&&(a=H(e)),t&&(a=F(e,t)),a.map((function(e,t){if(s[t]){var i=s[t];return i.timeline=e.timeline,i.duration=e.duration,i.number=e.number,i}})).filter((function(e){return e}))},Z=function(e){var t=e.baseUrl,i=e.initialization,n=void 0===i?{}:i,r=e.sourceDuration,a=e.timescale,s=void 0===a?1:a,o=e.indexRange,u=void 0===o?"":o,l=e.duration;if(!t)throw new Error($);var c=N({baseUrl:t,source:n.sourceURL,range:n.range}),h=N({baseUrl:t,source:t,range:u});if(h.map=c,l){var d=H(e);d.length&&(h.duration=d[0].duration,h.timeline=d[0].timeline)}else r&&(h.duration=r/s,h.timeline=0);return h.number=0,[h]},ee=function(e){var t,i,n=e.attributes,r=e.segmentInfo;if(r.template?(i=W,t=A(n,r.template)):r.base?(i=Z,t=A(n,r.base)):r.list&&(i=J,t=A(n,r.list)),!i)return{attributes:n};var a=i(t,r.timeline);if(t.duration){var s=t,o=s.duration,u=s.timescale,l=void 0===u?1:u;t.duration=o/l}else a.length?t.duration=a.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return{attributes:t,segments:a}},te=function(e,t){return O(e.childNodes).filter((function(e){return e.tagName===t}))},ie=function(e){return e.textContent.trim()},ne=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},re={mediaPresentationDuration:function(e){return ne(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return ne(e)},timeShiftBufferDepth:function(e){return ne(e)},start:function(e){return ne(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?ne(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},ae=function(e){return e&&e.attributes?O(e.attributes).reduce((function(e,t){var i=re[t.name]||re.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}};var se={"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"},oe=function(e,t){return t.length?L(e.map((function(e){return t.map((function(t){return B(e,ie(t))}))}))):e},ue=function(e){var t=te(e,"SegmentTemplate")[0],i=te(e,"SegmentList")[0],n=i&&te(i,"SegmentURL").map((function(e){return A({tag:"SegmentURL"},ae(e))})),r=te(e,"SegmentBase")[0],a=i||t,s=a&&te(a,"SegmentTimeline")[0],o=i||r||t,u=o&&te(o,"Initialization")[0],l=t&&ae(t);l&&u?l.initialization=u&&ae(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:s&&te(s,"S").map((function(e){return ae(e)})),list:i&&A(ae(i),{segmentUrls:n,initialization:ae(u)}),base:r&&A(ae(r),{initialization:ae(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},le=function(e){return e.reduce((function(e,t){var i=ae(t),n=se[i.schemeIdUri];if(n){e[n]={attributes:i};var r=te(t,"cenc:pssh")[0];if(r){var a=ie(r),s=a&&function(e){for(var t=f().atob(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}(a);e[n].pssh=s}}return e}),{})},ce=function(e,t,i){return function(n){var r=ae(n),a=oe(t,te(n,"BaseURL")),s=te(n,"Role")[0],o={role:ae(s)},u=A(e,r,o),l=le(te(n,"ContentProtection"));Object.keys(l).length&&(u=A(u,{contentProtection:l}));var c=ue(n),h=te(n,"Representation"),d=A(i,c);return L(h.map(function(e,t,i){return function(n){var r=te(n,"BaseURL"),a=oe(t,r),s=A(e,ae(n)),o=ue(n);return a.map((function(e){return{segmentInfo:A(i,o),attributes:A(s,{baseUrl:e})}}))}}(u,a,d)))}},he=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,a=i.NOW,s=void 0===a?Date.now():a,o=i.clientOffset,u=void 0===o?0:o,l=te(e,"Period");if(!l.length)throw new Error(G);var c=ae(e),h=oe([r],te(e,"BaseURL"));return c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=s,c.clientOffset=u,L(l.map(function(e,t){return function(i,n){var r=oe(t,te(i,"BaseURL")),a=ae(i),s=parseInt(a.id,10),o=f().isNaN(s)?n:s,u=A(e,{periodIndex:o}),l=te(i,"AdaptationSet"),c=ue(i);return L(l.map(ce(u,r,c)))}}(c,h)))},de=function(e){if(""===e)throw new Error(X);var t=(new(f().DOMParser)).parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null;if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(Y);return i},pe=function(e,t){return I(he(de(e),t).map(ee))},fe=function(e){return function(e){var t=te(e,"UTCTiming")[0];if(!t)return null;var i=ae(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(Q)}return i}(de(e))},me=i(7661),ge=i.n(me),ye=i(272),ve=i(5547),_e=i.n(ve);var be=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Te=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Se=null,ke=function(){function e(t){be(this,e),Se||(Se=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!n[s];s^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),i[a]=i[a].slice(0);return e}()),this._tables=[[Se[0][0].slice(),Se[0][1].slice(),Se[0][2].slice(),Se[0][3].slice(),Se[0][4].slice()],[Se[1][0].slice(),Se[1][1].slice(),Se[1][2].slice(),Se[1][3].slice(),Se[1][4].slice()]];var i=void 0,n=void 0,r=void 0,a=void 0,s=void 0,o=this._tables[0][4],u=this._tables[1],l=t.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");for(a=t.slice(0),s=[],this._key=[a,s],i=l;i<4*l+28;i++)r=a[i-1],(i%l==0||8===l&&i%l==4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],i%l==0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),a[i]=a[i-l]^r;for(n=0;i;n++,i--)r=a[3&n?i:i-4],s[n]=i<=4||n<4?r:u[0][o[r>>>24]]^u[1][o[r>>16&255]]^u[2][o[r>>8&255]]^u[3][o[255&r]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s=this._key[1],o=e^s[0],u=n^s[1],l=i^s[2],c=t^s[3],h=void 0,d=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=v[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[g+1],p=v[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[g+2],c=v[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[g++],h=o,o=u,u=l,l=c,c=h},e}(),we=function(){function e(){be(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),Ce=function(e){function t(){be(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,we));return i.jobs=[],i.delay=1,i.timeout_=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},t.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(we),Ee=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},Ae=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new ke(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),s=new Int32Array(a.buffer),o=void 0,u=void 0,l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0;for(o=i[0],u=i[1],l=i[2],c=i[3],m=0;m<n.length;m+=4)h=Ee(n[m]),d=Ee(n[m+1]),p=Ee(n[m+2]),f=Ee(n[m+3]),r.decrypt(h,d,p,f,s,m),s[m]=Ee(s[m]^o),s[m+1]=Ee(s[m+1]^u),s[m+2]=Ee(s[m+2]^l),s[m+3]=Ee(s[m+3]^c),o=h,u=d,l=p,c=f;return a},Le=function(){function e(t,i,n,r){be(this,e);var a=e.STEP,s=new Int32Array(t.buffer),o=new Uint8Array(t.byteLength),u=0;for(this.asyncStream_=new Ce,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o)),u=a;u<s.length;u+=a)n=new Uint32Array([Ee(s[u-4]),Ee(s[u-3]),Ee(s[u-2]),Ee(s[u-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o));this.asyncStream_.push((function(){var e;r(null,(e=o).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,i,n){return function(){var r=Ae(e,t,i);n.set(r,e.byteOffset)}},Te(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}(),Oe=i(5108),Pe="7.4.1";function xe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Ue(e,t){return Ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ue(e,t)}function Ie(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function De(e,t,i){return De=Ie()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&Ue(r,i.prototype),r},De.apply(null,arguments)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Me(e,t){return t||(t=e.slice(0)),e.raw=t,e}var Be=[];var Ne=function e(t){var i,n="info",r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",n,t)};return i=function(e,t){return function(i,n,r){var a=t.levels[n],s=new RegExp("^("+a+")$");if("log"!==i&&r.unshift(i.toUpperCase()+":"),r.unshift(e+":"),Be&&Be.push([].concat(r)),f().console){var o=f().console[i];o||"debug"!==i||(o=f().console.info||f().console.log),o&&a&&s.test(i)&&o[Array.isArray(r)?"apply":"call"](f().console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return Be?[].concat(Be):[]}).filter=function(e){return(Be||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){Be&&(Be.length=0)},r.history.disable=function(){null!==Be&&(Be.length=0,Be=null)},r.history.enable=function(){null===Be&&(Be=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("error",n,t)},r.warn=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("warn",n,t)},r.debug=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("debug",n,t)},r}("VIDEOJS"),je=Ne.createLogger,Fe=Object.prototype.toString,Ve=function(e){return ze(e)?Object.keys(e):[]};function He(e,t){Ve(e).forEach((function(i){return t(e[i],i)}))}function qe(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[e].concat(i)):(i.forEach((function(t){t&&He(t,(function(t,i){e[i]=t}))})),e)}function ze(e){return!!e&&"object"==typeof e}function We(e){return ze(e)&&"[object Object]"===Fe.call(e)&&e.constructor===Object}function Ge(e,t){if(!e||!t)return"";if("function"==typeof f().getComputedStyle){var i=f().getComputedStyle(e);return i?i[t]:""}return""}function Xe(){var e=Me(["Setting attributes in the second argument of createEl()\n                has been deprecated. Use the third argument instead.\n                createEl(type, properties, attributes). Attempting to set "," to ","."]);return Xe=function(){return e},e}function Ye(e){return"string"==typeof e&&/\S/.test(e)}function $e(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function Ke(){return C()===f().document}function Qe(e){return ze(e)&&1===e.nodeType}function Je(){try{return f().parent!==f().self}catch(e){return!0}}function Ze(e){return function(t,i){if(!Ye(t))return C()[e](null);Ye(i)&&(i=C().querySelector(i));var n=Qe(i)?i:C();return n[e]&&n[e](t)}}function et(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=C().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Ne.warn(u()(Xe(),e,i)),r.setAttribute(e,i)):"textContent"===e?tt(r,i):r[e]=i})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&bt(r,n),r}function tt(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function it(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function nt(e,t){return $e(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function rt(e,t){return e.classList?e.classList.add(t):nt(e,t)||(e.className=(e.className+" "+t).trim()),e}function at(e,t){return e.classList?e.classList.remove(t):($e(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function st(e,t,i){var n=nt(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?rt(e,t):at(e,t),e}function ot(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function ut(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function lt(e,t){return e.getAttribute(t)}function ct(e,t,i){e.setAttribute(t,i)}function ht(e,t){e.removeAttribute(t)}function dt(){C().body.focus(),C().onselectstart=function(){return!1}}function pt(){C().onselectstart=function(){return!0}}function ft(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Ge(e,"height"))),i.width||(i.width=parseFloat(Ge(e,"width"))),i}}function mt(e){var t;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=C().documentElement,n=C().body,r=i.clientLeft||n.clientLeft||0,a=f().pageXOffset||n.scrollLeft,s=t.left+a-r,o=i.clientTop||n.clientTop||0,u=f().pageYOffset||n.scrollTop,l=t.top+u-o;return{left:Math.round(s),top:Math.round(l)}}function gt(e,t){var i={},n=mt(e),r=e.offsetWidth,a=e.offsetHeight,s=n.top,o=n.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-u+a)/a)),i.x=Math.max(0,Math.min(1,(l-o)/r)),i}function yt(e){return ze(e)&&3===e.nodeType}function vt(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function _t(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Qe(e)||yt(e)?e:"string"==typeof e&&/\S/.test(e)?C().createTextNode(e):void 0})).filter((function(e){return e}))}function bt(e,t){return _t(t).forEach((function(t){return e.appendChild(t)})),e}function Tt(e,t){return bt(vt(e),t)}function St(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var kt=Ze("querySelector"),wt=Ze("querySelectorAll"),Ct=Object.freeze({isReal:Ke,isEl:Qe,isInFrame:Je,createEl:et,textContent:tt,prependTo:it,hasClass:nt,addClass:rt,removeClass:at,toggleClass:st,setAttributes:ot,getAttributes:ut,getAttribute:lt,setAttribute:ct,removeAttribute:ht,blockTextSelection:dt,unblockTextSelection:pt,getBoundingClientRect:ft,findPosition:mt,getPointerPosition:gt,isTextNode:yt,emptyEl:vt,normalizeContent:_t,appendContent:bt,insertContent:Tt,isSingleLeftClick:St,$:kt,$$:wt}),Et=1;function At(){return Et++}var Lt={},Ot="vdata"+(new Date).getTime();function Pt(e){var t=e[Ot];return t||(t=e[Ot]=At()),Lt[t]||(Lt[t]={}),Lt[t]}function xt(e){var t=e[Ot];return!!t&&!!Object.getOwnPropertyNames(Lt[t]).length}function Ut(e){var t=e[Ot];if(t){delete Lt[t];try{delete e[Ot]}catch(t){e.removeAttribute?e.removeAttribute(Ot):e[Ot]=null}}}function It(e,t){var i=Pt(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Ut(e)}function Dt(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function Rt(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||f().event;for(var r in e={},n)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&n.preventDefault||(e[r]=n[r]));if(e.target||(e.target=e.srcElement||C()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var a=C().documentElement,s=C().body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var Mt=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){Mt=!0}});f().addEventListener("test",null,e),f().removeEventListener("test",null,e)}catch(e){}}();var Bt=["touchstart","touchmove"];function Nt(e,t,i){if(Array.isArray(t))return Dt(Nt,e,t,i);var n=Pt(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=At()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=Rt(t);var r=n.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,i)}catch(e){Ne.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){var r=!1;Mt&&Bt.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function jt(e,t,i){if(xt(e)){var n=Pt(e);if(n.handlers){if(Array.isArray(t))return Dt(jt,e,t,i);var r=function(e,t){n.handlers[t]=[],It(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s<a.length;s++)a[s].guid===i.guid&&a.splice(s--,1);It(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function Ft(e,t,i){var n=xt(e)?Pt(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Rt(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)Ft.call(null,r,t,i);else if(!r&&!t.defaultPrevented){var a=Pt(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function Vt(e,t,i){if(Array.isArray(t))return Dt(Vt,e,t,i);var n=function n(){jt(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||At(),Nt(e,t,n)}var Ht,qt=Object.freeze({fixEvent:Rt,on:Nt,off:jt,trigger:Ft,one:Vt}),zt=!1,Wt=function(){if(Ke()&&!1!==Ht.options.autoSetup){var e=Array.prototype.slice.call(C().getElementsByTagName("video")),t=Array.prototype.slice.call(C().getElementsByTagName("audio")),i=Array.prototype.slice.call(C().getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r<a;r++){var s=n[r];if(!s||!s.getAttribute){Gt(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&Ht(s)}else zt||Gt(1)}};function Gt(e,t){t&&(Ht=t),f().setTimeout(Wt,e)}Ke()&&"complete"===C().readyState?zt=!0:Vt(f(),"load",(function(){zt=!0}));var Xt,Yt=function(e){var t=C().createElement("style");return t.className=e,t},$t=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Kt=function(e,t,i){t.guid||(t.guid=At());var n=function(){return t.apply(e,arguments)};return n.guid=i?i+"_"+t.guid:t.guid,n},Qt=function(e,t){var i=Date.now();return function(){var n=Date.now();n-i>=t&&(e.apply(void 0,arguments),i=n)}},Jt=function(){};Jt.prototype.allowedEvents_={},Jt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Nt(this,e,t),this.addEventListener=i},Jt.prototype.addEventListener=Jt.prototype.on,Jt.prototype.off=function(e,t){jt(this,e,t)},Jt.prototype.removeEventListener=Jt.prototype.off,Jt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Vt(this,e,t),this.addEventListener=i},Jt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Rt(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ft(this,e)},Jt.prototype.dispatchEvent=Jt.prototype.trigger,Jt.prototype.queueTrigger=function(e){var t=this;Xt||(Xt=new Map);var i=e.type||e,n=Xt.get(this);n||(n=new Map,Xt.set(this,n));var r=n.get(i);n.delete(i),f().clearTimeout(r);var a=f().setTimeout((function(){0===n.size&&(n=null,Xt.delete(t)),t.trigger(e)}),0);n.set(i,a)};var Zt=function(e){return e instanceof Jt||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},ei=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ti=function(e){if(!e.nodeName&&!Zt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},ii=function(e){if(!ei(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ni=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},ri=function(e,t){var i,n,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(i=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],r=t[1]):(i=t[0],n=t[1],r=t[2]),ti(i),ii(n),ni(r),{isTargetingSelf:a,target:i,type:n,listener:r=Kt(e,r)}},ai=function(e,t,i,n){ti(e),e.nodeName?qt[t](e,i,n):e[t](i,n)},si={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ri(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(ai(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,ai(this,"on","dispose",l),ai(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ri(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)ai(s,"one",o,u);else{var l=function t(){e.off(s,o,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];u.apply(null,n)};l.guid=u.guid,ai(s,"one",o,l)}},off:function(e,t,i){if(!e||ei(e))jt(this.eventBusEl_,e,t);else{var n=e,r=t;ti(n),ii(r),ni(i),i=Kt(this,i),this.off("dispose",i),n.nodeName?(jt(n,r,i),jt(n,"dispose",i)):Zt(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(e,t){return Ft(this.eventBusEl_,e,t)}};function oi(e,t){void 0===t&&(t={});var i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=et("span",{className:"vjs-event-bus"});return qe(e,si),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),f().setTimeout((function(){e.eventBusEl_=null}),0)})),e}var ui={state:{},setState:function(e){var t,i=this;return"function"==typeof e&&(e=e()),He(e,(function(e,n){i.state[n]!==e&&((t=t||{})[n]={from:i.state[n],to:e}),i.state[n]=e})),t&&Zt(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function li(e,t){return qe(e,ui),e.state=qe({},e.state,t),"function"==typeof e.handleStateChanged&&Zt(e)&&e.on("statechanged",e.handleStateChanged),e}function ci(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function hi(){for(var e={},t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){t&&He(t,(function(t,i){We(t)?(We(e[i])||(e[i]={}),e[i]=hi(e[i],t)):e[i]=t}))})),e}var di=function(){function e(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.options_=hi({},this.options_),t=this.options_=hi(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var n=e&&e.id&&e.id()||"no_player";this.id_=n+"_component_"+At()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&oi(this,{eventBusKey:this.el_?"el_":null}),li(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Ut(this.el_),this.el_=null),this.player_=null},t.player=function(){return this.player_},t.options=function(e){return Ne.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=hi(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return et(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r}))),u},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return e=ci(e),this.childNameIndex_[e]},t.addChild=function(t,i,n){var r,a;if(void 0===i&&(i={}),void 0===n&&(n=this.children_.length),"string"==typeof t){a=ci(t);var s=i.componentClass||a;i.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;r=new o(this.player_||this,i)}else r=t;if(this.children_.splice(n,0,r),"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(a=a||r.name&&ci(r.name()))&&(this.childNameIndex_[a]=r),"function"==typeof r.el&&r.el()){var u=this.contentEl().children[n]||null;this.contentEl().insertBefore(r.el(),u)}return r},t.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||ci(t.name));return i&&!a.isTech(i)})).forEach((function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return kt(e,t||this.contentEl())},t.$$=function(e,t){return wt(e,t||this.contentEl())},t.hasClass=function(e){return nt(this.el_,e)},t.addClass=function(e){rt(this.el_,e)},t.removeClass=function(e){at(this.el_,e)},t.toggleClass=function(e,t){st(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return lt(this.el_,e)},t.setAttribute=function(e,t){ct(this.el_,e,t)},t.removeAttribute=function(e){ht(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+ci(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof f().getComputedStyle){var i=f().getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(0===(t=parseFloat(t))){var n="offset"+ci(e);t=this.el_[n]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=(new Date).getTime(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}}));var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){(i=null,!0===e)&&((new Date).getTime()-t<200&&(n.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Kt(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n,r=this;return e=Kt(this,e),i=f().setTimeout((function(){r.off("dispose",n),e()}),t),(n=function(){return r.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",n),i},t.clearTimeout=function(e){f().clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},t.setInterval=function(e,t){var i=this;e=Kt(this,e);var n=f().setInterval(e,t),r=function(){return i.clearInterval(n)};return r.guid="vjs-interval-"+n,this.on("dispose",r),n},t.clearInterval=function(e){f().clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},t.requestAnimationFrame=function(e){var t,i,n=this;return this.supportsRaf_?(e=Kt(this,e),t=f().requestAnimationFrame((function(){n.off("dispose",i),e()})),(i=function(){return n.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},t.cancelAnimationFrame=function(e){if(this.supportsRaf_){f().cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),a=r&&r.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(a||!s)throw n=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=ci(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=ci(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();di.prototype.supportsRaf_="function"==typeof f().requestAnimationFrame&&"function"==typeof f().cancelAnimationFrame,di.registerComponent("Component",di);var pi,fi=f().navigator&&f().navigator.userAgent||"",mi=/AppleWebKit\/([\d.]+)/i.exec(fi),gi=mi?parseFloat(mi.pop()):null,yi=/iPad/i.test(fi),vi=/iPhone/i.test(fi)&&!yi,_i=/iPod/i.test(fi),bi=vi||yi||_i,Ti=(pi=fi.match(/OS (\d+)_/i))&&pi[1]?pi[1]:null,Si=/Android/i.test(fi),ki=function(){var e=fi.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),wi=Si&&ki<5&&gi<537,Ci=/Firefox/i.test(fi),Ei=/Edge/i.test(fi),Ai=!Ei&&(/Chrome/i.test(fi)||/CriOS/i.test(fi)),Li=function(){var e=fi.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Oi=function(){var e=/MSIE\s(\d+)\.\d/.exec(fi),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(fi)&&/rv:11.0/.test(fi)&&(t=11),t}(),Pi=/Safari/i.test(fi)&&!Ai&&!Si&&!Ei,xi=(Pi||bi)&&!Ai,Ui=Ke()&&("ontouchstart"in f()||f().navigator.maxTouchPoints||f().DocumentTouch&&f().document instanceof f().DocumentTouch),Ii=Object.freeze({IS_IPAD:yi,IS_IPHONE:vi,IS_IPOD:_i,IS_IOS:bi,IOS_VERSION:Ti,IS_ANDROID:Si,ANDROID_VERSION:ki,IS_NATIVE_ANDROID:wi,IS_FIREFOX:Ci,IS_EDGE:Ei,IS_CHROME:Ai,CHROME_VERSION:Li,IE_VERSION:Oi,IS_SAFARI:Pi,IS_ANY_SAFARI:xi,TOUCH_ENABLED:Ui});function Di(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function Ri(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Di.bind(null,"start",0,e),end:Di.bind(null,"end",1,e)}}function Mi(e,t){return Array.isArray(e)?Ri(e):void 0===e||void 0===t?Ri():Ri([[e,t]])}function Bi(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=Mi(0,0));for(var a=0;a<e.length;a++)i=e.start(a),(n=e.end(a))>t&&(n=t),r+=n-i;return r/t}for(var Ni,ji={},Fi=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Vi=Fi[0],Hi=0;Hi<Fi.length;Hi++)if(Fi[Hi][1]in C()){Ni=Fi[Hi];break}if(Ni)for(var qi=0;qi<Ni.length;qi++)ji[Vi[qi]]=Ni[qi];function zi(e){if(e instanceof zi)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:ze(e)&&("number"==typeof e.code&&(this.code=e.code),qe(this,e)),this.message||(this.message=zi.defaultMessages[this.code]||"")}zi.prototype.code=0,zi.prototype.message="",zi.prototype.status=null,zi.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],zi.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Wi=0;Wi<zi.errorTypes.length;Wi++)zi[zi.errorTypes[Wi]]=Wi,zi.prototype[zi.errorTypes[Wi]]=Wi;function Gi(e){return null!=e&&"function"==typeof e.then}function Xi(e){Gi(e)&&e.then(null,(function(e){}))}var Yi=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i,n){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},$i=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track}));return Array.prototype.map.call(t,(function(e){var t=Yi(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Yi))},Ki=function(e,t){return e.forEach((function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return i.addCue(e)}))})),t.textTracks()},Qi=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=et("div",{className:"vjs-modal-dialog-content"},{role:"document"}),n.descEl_=et("p",{className:"vjs-modal-dialog-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),tt(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},i.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-modal-dialog vjs-hidden "+e.prototype.buildCSSClass.call(this)},i.handleKeyPress=function(e){27===e.which&&this.closeable()&&this.close()},i.label=function(){return this.localize(this.options_.label||"Modal Window")},i.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},i.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",Kt(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},i.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},i.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Kt(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},i.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close)}!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},i.fill=function(){this.fillWith(this.content())},i.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Tt(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},i.empty=function(){this.trigger("beforemodalempty"),vt(this.contentEl()),this.trigger("modalempty")},i.content=function(e){return void 0!==e&&(this.content_=e),this.content_},i.conditionalFocus_=function(){var e=C().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(C(),"keydown",this.handleKeyDown))},i.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(C(),"keydown",this.handleKeyDown)},i.handleKeyDown=function(e){if(9===e.which){for(var t,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){t=r;break}C().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}},i.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof f().HTMLAnchorElement||e instanceof f().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof f().HTMLInputElement||e instanceof f().HTMLSelectElement||e instanceof f().HTMLTextAreaElement||e instanceof f().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof f().HTMLIFrameElement||e instanceof f().HTMLObjectElement||e instanceof f().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(di);Qi.prototype.options_={pauseOnOpen:!0,temporary:!0},di.registerComponent("ModalDialog",Qi);var Ji=function(e){function t(t){var i;void 0===t&&(t=[]),(i=e.call(this)||this).tracks_=[],Object.defineProperty(Re(Re(i)),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<t.length;n++)i.addTrack(t[n]);return i}xe(t,e);var i=t.prototype;return i.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},i.removeTrack=function(e){for(var t,i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack"})},i.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(Jt);for(var Zi in Ji.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Ji.prototype.allowedEvents_)Ji.prototype["on"+Zi]=null;var en=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},tn=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].enabled){en(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}return xe(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&en(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",(function(){i.changing_||(i.changing_=!0,en(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ji),nn=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},rn=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].selected){nn(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(Re(Re(i)),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),i}return xe(t,e),t.prototype.addTrack=function(t){var i=this;t.selected&&nn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",(function(){i.changing_||(i.changing_=!0,nn(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ji),an=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",Kt(this,(function(){this.queueTrigger("change")})));-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",Kt(this,(function(){this.trigger("selectedlanguagechange")})))},t}(Ji),sn=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},t.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),on=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)},t.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),un={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},ln={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},cn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},hn={disabled:"disabled",hidden:"hidden",showing:"showing"},dn=function(e){function t(t){var i;void 0===t&&(t={}),i=e.call(this)||this;var n={id:t.id||"vjs_track_"+At(),kind:t.kind||"",label:t.label||"",language:t.language||""},r=function(e){Object.defineProperty(Re(Re(i)),e,{get:function(){return n[e]},set:function(){}})};for(var a in n)r(a);return i}return xe(t,e),t}(Jt),pn=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=C().createElement("a");i.href=e;var n,r=""===i.host&&"file:"!==i.protocol;r&&((n=C().createElement("div")).innerHTML='<a href="'+e+'"></a>',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),C().body.appendChild(n));for(var a={},s=0;s<t.length;s++)a[t[s]]=i[t[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=f().location.protocol),r&&C().body.removeChild(n),a},fn=function(e){if(!e.match(/^https?:\/\//)){var t=C().createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},mn=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},gn=function(e){var t=f().location,i=pn(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},yn=Object.freeze({parseUrl:pn,getAbsoluteURL:fn,getFileExtension:mn,isCrossOrigin:gn}),vn=function(e,t){var i=new(f().WebVTT.Parser)(f(),f().vttjs,f().WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(f().console&&f().console.groupCollapsed&&f().console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return Ne.error(e)})),f().console&&f().console.groupEnd&&f().console.groupEnd()),i.flush()},_n=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=hi(t,{kind:cn[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=hn[n.mode]||"disabled",a=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[];var s=new on(i.cues_),o=new on(i.activeCues_),u=!1,l=Kt(Re(Re(i)),(function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)}));return"disabled"!==r&&i.tech_.ready((function(){i.tech_.on("timeupdate",l)}),!0),Object.defineProperties(Re(Re(i)),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;hn[e]&&("disabled"!==(r=e)?this.tech_.ready((function(){t.tech_.on("timeupdate",l)}),!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(u=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),n.src?(i.src=n.src,function(e,t){var i={uri:e},n=gn(e);n&&(i.cors=n),c()(i,Kt(this,(function(e,i,n){if(e)return Ne.error(e,i);if(t.loaded_=!0,"function"!=typeof f().WebVTT){if(t.tech_){var r=function(){return vn(n,t)};t.tech_.on("vttjsloaded",r),t.tech_.on("vttjserror",(function(){Ne.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",r)}))}}else vn(n,t)})))}(n.src,Re(Re(i)))):i.loaded_=!0,i}xe(t,e);var i=t.prototype;return i.addCue=function(e){var t=e;if(f().vttjs&&!(e instanceof f().vttjs.VTTCue)){for(var i in t=new(f().vttjs.VTTCue)(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},i.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(dn);_n.prototype.allowedEvents_={cuechange:"cuechange"};var bn=function(e){function t(t){var i;void 0===t&&(t={});var n=hi(t,{kind:ln[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty(Re(Re(i)),"enabled",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("enabledchange"))}}),n.enabled&&(i.enabled=n.enabled),i.loaded_=!0,i}return xe(t,e),t}(dn),Tn=function(e){function t(t){var i;void 0===t&&(t={});var n=hi(t,{kind:un[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty(Re(Re(i)),"selected",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("selectedchange"))}}),n.selected&&(i.selected=n.selected),i}return xe(t,e),t}(dn),Sn=function(e){function t(t){var i,n;void 0===t&&(t={}),i=e.call(this)||this;var r=new _n(t);return i.kind=r.kind,i.src=r.src,i.srclang=r.language,i.label=r.label,i.default=r.default,Object.defineProperties(Re(Re(i)),{readyState:{get:function(){return n}},track:{get:function(){return r}}}),n=0,r.addEventListener("loadeddata",(function(){n=2,i.trigger({type:"load",target:Re(Re(i))})})),i}return xe(t,e),t}(Jt);Sn.prototype.allowedEvents_={load:"load"},Sn.NONE=0,Sn.LOADING=1,Sn.LOADED=2,Sn.ERROR=3;var kn={audio:{ListClass:tn,TrackClass:bn,capitalName:"Audio"},video:{ListClass:rn,TrackClass:Tn,capitalName:"Video"},text:{ListClass:an,TrackClass:_n,capitalName:"Text"}};Object.keys(kn).forEach((function(e){kn[e].getterName=e+"Tracks",kn[e].privateName=e+"Tracks_"}));var wn={remoteText:{ListClass:an,TrackClass:_n,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:sn,TrackClass:Sn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Cn=hi(kn,wn);wn.names=Object.keys(wn),kn.names=Object.keys(kn),Cn.names=[].concat(wn.names).concat(kn.names);var En=function(e){function t(t,i){var n;return void 0===t&&(t={}),void 0===i&&(i=function(){}),t.reportTouchActivity=!1,(n=e.call(this,null,t,i)||this).hasStarted_=!1,n.on("playing",(function(){this.hasStarted_=!0})),n.on("loadstart",(function(){this.hasStarted_=!1})),Cn.names.forEach((function(e){var i=Cn[e];t&&t[i.getterName]&&(n[i.privateName]=t[i.getterName])})),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.autoRemoteTextTracks_=new Cn.text.ListClass,n.initTrackListeners(),t.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}xe(t,e);var i=t.prototype;return i.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Kt(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return Mi(0,0)},i.bufferedPercent=function(){return Bi(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(kn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},i.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var i=t[e+"Tracks"]()||[],n=i.length;n--;){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}}))},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},i.reset=function(){},i.error=function(e){return void 0!==e&&(this.error_=new zi(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?Mi(0,0):Mi()},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;kn.names.forEach((function(t){var i=kn[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},i.addWebVttScript_=function(){var e=this;if(!f().WebVTT)if(C().body.contains(this.el())){if(!this.options_["vtt.js"]&&We(s())&&Object.keys(s()).length>0)return void this.trigger("vttjsloaded");var t=C().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),f().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var i=t[e];i.removeEventListener("cuechange",a),"showing"===i.mode&&i.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){i.off("addtrack",n),i.off("removetrack",r),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++){t[e].removeEventListener("cuechange",a)}}))},i.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r){void 0===r&&(r={});var a=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;var s=new Cn.text.TrackClass(r);return a.addTrack(s),s}(this,e,t,i)},i.createRemoteTextTrack=function(e){var t=hi(e,{tech:this});return new wn.remoteTextEl.TrackClass(t)},i.addRemoteTextTrack=function(e,t){var i=this;void 0===e&&(e={});var n=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(Ne.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready((function(){return i.autoRemoteTextTracks_.addTrack(n.track)})),n},i.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},i.getVideoPlaybackQuality=function(){return{}},i.setPoster=function(){},i.playsinline=function(){},i.setPlaysinline=function(){},i.overrideNativeAudioTracks=function(){},i.overrideNativeVideoTracks=function(){},i.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ci(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=ci(e),t.techs_&&t.techs_[e]?t.techs_[e]:f()&&f().videojs&&f().videojs[e]?(Ne.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),f().videojs[e]):void 0},t}(di);Cn.names.forEach((function(e){var t=Cn[e];En.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),En.prototype.featuresVolumeControl=!0,En.prototype.featuresMuteControl=!0,En.prototype.featuresFullscreenResize=!1,En.prototype.featuresPlaybackRate=!1,En.prototype.featuresProgressEvents=!1,En.prototype.featuresSourceset=!1,En.prototype.featuresTimeupdateEvents=!1,En.prototype.featuresNativeTextTracks=!1,En.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i,n=e.sourceHandlers||[],r=0;r<n.length;r++)if(i=n[r].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=0;r<n.length;r++)if(n[r].canHandleSource(t,i))return n[r];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:Ne.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.on("dispose",this.disposeSourceHandler)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},di.registerComponent("Tech",En),En.registerTech("Tech",En),En.defaultTechOrder_=[];var An={},Ln={},On={};function Pn(e,t,i){e.setTimeout((function(){return Mn(t,An[t.type],i,e)}),1)}function xn(e,t,i,n){void 0===n&&(n=null);var r="call"+ci(i),a=e.reduce(Rn(r),n),s=a===On,o=s?null:t[i](a);return function(e,t,i,n){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,o,s),o}var Un={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},In={setCurrentTime:1},Dn={play:1,pause:1};function Rn(e){return function(t,i){return t===On?On:i[e]?i[e](t):t}}function Mn(e,t,i,n,r,a){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===a&&(a=!1);var s=t,o=s[0],u=s.slice(1);if("string"==typeof o)Mn(e,An[o],i,n,r,a);else if(o){var l=function(e,t){var i=Ln[e.id()],n=null;if(null==i)return n=t(e),Ln[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var a=i[r],s=a[0],o=a[1];s===t&&(n=o)}return null===n&&(n=t(e),i.push([t,n])),n}(n,o);if(!l.setSource)return r.push(l),Mn(e,u,i,n,r,a);l.setSource(qe({},e),(function(t,s){if(t)return Mn(e,u,i,n,r,a);r.push(l),Mn(s,e.type===s.type?u:An[s.type],i,n,r,a)}))}else u.length?Mn(e,u,i,n,r,a):a?i(e,r):Mn(e,An["*"],i,n,r,!0)}var Bn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Nn=function(e){void 0===e&&(e="");var t=mn(e);return Bn[t.toLowerCase()]||""},jn=function e(t){if(Array.isArray(t)){var i=[];t.forEach((function(t){t=e(t),Array.isArray(t)?i=i.concat(t):ze(t)&&i.push(t)})),t=i}else t="string"==typeof t&&t.trim()?[Fn({src:t})]:ze(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[Fn(t)]:[];return t};function Fn(e){var t=Nn(e.src);return!e.type&&t&&(e.type=t),e}var Vn=function(e){function t(t,i,n){var r,a=hi({createEl:!1},i);if(r=e.call(this,t,a,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var s=0,o=i.playerOptions.techOrder;s<o.length;s++){var u=ci(o[s]),l=En.getTech(u);if(u||(l=di.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return r}return xe(t,e),t}(di);di.registerComponent("MediaLoader",Vn);var Hn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).emitTapEvents(),n.enable(),n}xe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i=qe({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&Ne.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=qe({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},i.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},i.createControlTextEl=function(e){return this.controlTextEl_=et("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},i.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,tt(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},i.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},i.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},i.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},i.handleClick=function(e){},i.handleFocus=function(e){Nt(C(),"keydown",Kt(this,this.handleKeyPress))},i.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},i.handleBlur=function(e){jt(C(),"keydown",Kt(this,this.handleKeyPress))},t}(di);di.registerComponent("ClickableComponent",Hn);var qn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update(),t.on("posterchange",Kt(Re(Re(n)),n.update)),n}xe(t,e);var i=t.prototype;return i.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},i.createEl=function(){return et("div",{className:"vjs-poster",tabIndex:-1})},i.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},i.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},i.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Xi(this.player_.play()):this.player_.pause())},t}(Hn);di.registerComponent("PosterImage",qn);var zn={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Wn(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Gn(e,t,i){try{e.style[t]=i}catch(e){return}}var Xn=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=Kt(Re(Re(r)),r.updateDisplay);return t.on("loadstart",Kt(Re(Re(r)),r.toggleDisplay)),t.on("texttrackchange",a),t.on("loadedmetadata",Kt(Re(Re(r)),r.preselectTrack)),t.ready(Kt(Re(Re(r)),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),f().addEventListener("orientationchange",a),t.on("dispose",(function(){return f().removeEventListener("orientationchange",a)}));for(var e=this.options_.playerOptions.tracks||[],i=0;i<e.length;i++)this.player_.addRemoteTextTrack(e[i],!0);this.preselectTrack()}}))),r}xe(t,e);var i=t.prototype;return i.preselectTrack=function(){for(var e,t,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<r.length;s++){var o=r[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in n?o.kind===a.kind?i=o:i||(i=o):a&&!a.enabled?(i=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in n&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},i.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},i.clearDisplay=function(){"function"==typeof f().WebVTT&&f().WebVTT.processCues(f(),[],this.el_)},i.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();for(var t=null,i=null,n=e.length;n--;){var r=e[n];"showing"===r.mode&&("descriptions"===r.kind?t=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},i.updateForTrack=function(e){if("function"==typeof f().WebVTT&&e.activeCues){for(var t=[],i=0;i<e.activeCues.length;i++)t.push(e.activeCues[i]);if(f().WebVTT.processCues(f(),t,this.el_),this.player_.textTrackSettings)for(var n=this.player_.textTrackSettings.getValues(),r=t.length;r--;){var a=t[r];if(a){var s=a.displayState;if(n.color&&(s.firstChild.style.color=n.color),n.textOpacity&&Gn(s.firstChild,"color",Wn(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(s.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Gn(s.firstChild,"backgroundColor",Wn(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Gn(s,"backgroundColor",Wn(n.windowColor,n.windowOpacity)):s.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===n.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),n.fontPercent&&1!==n.fontPercent){var o=f().parseFloat(s.style.fontSize);s.style.fontSize=o*n.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=zn[n.fontFamily])}}}},t}(di);di.registerComponent("TextTrackDisplay",Xn);var Yn=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"Video Player"),n=et("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},t}(di);di.registerComponent("LoadingSpinner",Yn);var $n=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.createEl=function(e,t,i){void 0===t&&(t={}),void 0===i&&(i={}),t=qe({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=qe({type:"button"},i);var n=di.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(n),n},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return Ne.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),di.prototype.addChild.call(this,e,t)},i.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Hn);di.registerComponent("Button",$n);var Kn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-big-play-button"},i.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Xi(t);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var r=function(){return n.focus()};Gi(t)?t.then(r,(function(){})):this.setTimeout(r,1)}else this.player_.focus()}},i.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}($n);Kn.prototype.controlText_="Play Video",di.registerComponent("BigPlayButton",Kn);var Qn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}($n);di.registerComponent("CloseButton",Qn);var Jn=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",n.handlePlay),n.on(t,"pause",n.handlePause),i.replay&&n.on(t,"ended",n.handleEnded),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}($n);Jn.prototype.controlText_="Play",di.registerComponent("PlayToggle",Jn);var Zn=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||s>0?r+":":"")+(n=((r||a>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)},er=Zn;function tr(e,t){return void 0===t&&(t=e),er(e,t)}var ir=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).throttledUpdateContent=Qt(Kt(Re(Re(n)),n.updateContent),25),n.on(t,"timeupdate",n.throttledUpdateContent),n}xe(t,e);var i=t.prototype;return i.createEl=function(t){var i=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=et("span",{className:i+"-display"},{"aria-live":"off",role:"presentation"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=C().createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},i.formatTime_=function(e){return tr(e)},i.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},i.updateContent=function(e){},t}(di);ir.prototype.labelText_="Time",ir.prototype.controlText_="Time",di.registerComponent("TimeDisplay",ir);var nr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"ended",n.handleEnded),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},i.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(ir);nr.prototype.labelText_="Current Time",nr.prototype.controlText_="Current Time",di.registerComponent("CurrentTimeDisplay",nr);var rr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.updateContent),n.on(t,"loadstart",n.updateContent),n.on(t,"loadedmetadata",n.throttledUpdateContent),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(ir);rr.prototype.labelText_="Duration",rr.prototype.controlText_="Duration",di.registerComponent("DurationDisplay",rr);var ar=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(di);di.registerComponent("TimeDivider",ar);var sr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.throttledUpdateContent),n.on(t,"ended",n.handleEnded),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},i.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},i.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(ir);sr.prototype.labelText_="Remaining Time",sr.prototype.controlText_="Remaining Time",di.registerComponent("RemainingTimeDisplay",sr);var or=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=et("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(di);di.registerComponent("LiveDisplay",or);var ur=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatus),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=et("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(e){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,e.prototype.dispose.call(this)},t}($n);ur.prototype.controlText_="Seek to live, currently playing live",di.registerComponent("SeekToLive",ur);var lr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}xe(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=qe({tabIndex:0},i),n=qe({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Ai||e.preventDefault(),dt(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;pt(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},i.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",n=t.el().style;return this.vertical()?n.height=i:n.width=i,e}}},i.calculateDistance=function(e){var t=gt(this.el_,e);return this.vertical()?t.y:t.x},i.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},i.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},i.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},i.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(di);di.registerComponent("Slider",lr);var cr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",n.update),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})},i.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this.player_.liveTracker,i=this.player_.buffered(),n=t&&t.isLive()?t.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),a=this.partEls_,s=this.$(".vjs-control-text-loaded-percentage"),o=function(e,t,i){var n=e/t||0;return n=100*(n>=1?1:n),i&&(n=n.toFixed(2)),n+"%"};this.el_.style.width=o(r,n),tt(s,o(r,n,!0));for(var u=0;u<i.length;u++){var l=i.start(u),c=i.end(u),h=a[u];h||(h=this.el_.appendChild(et()),a[u]=h),h.style.left=o(l,r),h.style.width=o(c-l,r)}for(var d=a.length;d>i.length;d--)this.el_.removeChild(a[d-1]);a.length=i.length},t}(di);di.registerComponent("LoadProgressBar",cr);var hr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=ft(this.el_),r=ft(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>n.width&&(u=n.width),this.el_.style.right="-"+u+"px",tt(this.el_,i)}},i.updateTime=function(e,t,i,n){var r=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+tr(u,o)}else a=tr(i,s);r.update(e,t,a),n&&n()}))},t}(di);di.registerComponent("TimeTooltip",hr);var dr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(di);dr.prototype.options_={children:[]},bi||Si||dr.prototype.options_.children.push("timeTooltip"),di.registerComponent("PlayProgressBar",dr);var pr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Qt(Kt(Re(Re(n)),n.update),25),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){i.el_.style.left=e.width*t+"px"}))},t}(di);pr.prototype.options_={children:["timeTooltip"]},di.registerComponent("MouseTimeDisplay",pr);var fr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}xe(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update=Qt(Kt(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.on(this.player_,"durationchange",this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],(function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval((function(){e.requestAnimationFrame((function(){e.update()}))}),30)})),this.on(this.player_,["ended","pause","waiting"],(function(t){e.player_.liveTracker&&e.player_.liveTracker.isLive()&&"ended"!==t.type||e.clearInterval(e.updateInterval)})),this.on(this.player_,["timeupdate","ended"],this.update)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update_=function(e,t){var i=this.player_.liveTracker,n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),i&&i.seekableEnd()===1/0?this.disable():this.enable(),this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[tr(e,n),tr(n,n)],"{1} of {2}")),this.bar.update(ft(this.el_),t)},i.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.handleEnded=function(e){this.update_(this.player_.duration(),1)},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e>=1?1:e||0},i.handleMouseDown=function(t){St(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e){if(St(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){var r=n.seekableStart(),a=n.liveCurrentTime();if((t=r+i*n.liveWindow())>=a&&(t=a),t<=r&&(t=r+.1),t===1/0)return}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currentTime(t)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Xi(this.player_.play())},i.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},i.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(lr);fr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},bi||Si||fr.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),fr.prototype.playerEvent="timeupdate",di.registerComponent("SeekBar",fr);var mr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=Qt(Kt(Re(Re(n)),n.handleMouseMove),25),n.throttledHandleMouseSeek=Qt(Kt(Re(Re(n)),n.handleMouseSeek),25),n.enable(),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),n=t.el(),r=ft(n),a=gt(n,e).x;a>1?a=1:a<0&&(a=0),i&&i.update(r,a)}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},i.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(di);mr.prototype.options_={children:["seekBar"]},di.registerComponent("ProgressControl",mr);var gr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",n.handleFullscreenChange),!1===C()[ji.fullscreenEnabled]&&n.disable(),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}($n);gr.prototype.controlText_="Fullscreen",di.registerComponent("FullscreenToggle",gr);var yr=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(di);di.registerComponent("VolumeLevel",yr);var vr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",n.updateLastVolume_),n.on(t,"volumechange",n.updateARIAAttributes),t.ready((function(){return n.updateARIAAttributes()})),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){St(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){St(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(lr);vr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},vr.prototype.playerEvent="volumechange",di.registerComponent("VolumeBar",vr);var _r=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||We(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(Re(Re(n=e.call(this,t,i)||this)),t),n.throttledHandleMouseMove=Qt(Kt(Re(Re(n)),n.handleMouseMove),25),n.on("mousedown",n.handleMouseDown),n.on("touchstart",n.handleMouseDown),n.on(n.volumeBar,["focus","slideractive"],(function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")})),n.on(n.volumeBar,["blur","sliderinactive"],(function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")})),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(di);_r.prototype.options_={children:["volumeBar"]},di.registerComponent("VolumeControl",_r);var br=function(e){function t(t,i){var n;return function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(Re(Re(n=e.call(this,t,i)||this)),t),n.on(t,["loadstart","volumechange"],n.update),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;bi&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)at(this.el_,"vjs-vol-"+i);rt(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}($n);br.prototype.controlText_="Mute",di.registerComponent("MuteToggle",br);var Tr=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||We(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).on(t,["loadstart"],n.volumePanelState_),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}xe(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(di);Tr.prototype.options_={children:["muteToggle","volumeControl"]},di.registerComponent("VolumePanel",Tr);var Sr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyPress),n}xe(t,e);var i=t.prototype;return i.addItem=function(e){this.addChild(e),e.on("blur",Kt(this,this.handleBlur)),e.on(["tap","click"],Kt(this,(function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())})))},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=et(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Nt(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||C().activeElement;if(!this.children().some((function(e){return e.el()===t}))){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(di);di.registerComponent("Menu",Sr);var kr=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new $n(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=$n.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0,n.on(n.menuButton_,"tap",n.handleClick),n.on(n.menuButton_,"click",n.handleClick),n.on(n.menuButton_,"focus",n.handleFocus),n.on(n.menuButton_,"blur",n.handleBlur),n.on(n.menuButton_,"mouseenter",(function(){n.menu.show()})),n.on("keydown",n.handleSubmenuKeyPress),n}xe(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},i.createMenu=function(){var e=new Sr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=et("li",{className:"vjs-menu-title",innerHTML:ci(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),it(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},i.createItems=function(){},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},i.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+$n.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},i.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},i.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},i.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},i.focus=function(){this.menuButton_.focus()},i.blur=function(){this.menuButton_.blur()},i.handleFocus=function(){Nt(C(),"keydown",Kt(this,this.handleKeyPress))},i.handleBlur=function(){jt(C(),"keydown",Kt(this,this.handleKeyPress))},i.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):13!==e.which&&38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},i.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},i.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),bi&&Je())return;this.menu.focus()}},i.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},i.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},i.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(di);di.registerComponent("MenuButton",kr);var wr=function(e){function t(t,i){var n,r=i.tracks;if((n=e.call(this,t,i)||this).items.length<=1&&n.hide(),!r)return Re(n);var a=Kt(Re(Re(n)),n.update);return r.addEventListener("removetrack",a),r.addEventListener("addtrack",a),n.player_.on("ready",a),n.player_.on("dispose",(function(){r.removeEventListener("removetrack",a),r.removeEventListener("addtrack",a)})),n}return xe(t,e),t}(kr);di.registerComponent("TrackButton",wr);var Cr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).selectable=i.selectable,n.isSelected_=i.selected||!1,n.multiSelectable=i.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}xe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",qe({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},i.handleClick=function(e){this.selected(!0)},i.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Hn);di.registerComponent("MenuItem",Cr);var Er=function(e){function t(t,i){var n,r=i.track,a=t.textTracks();i.label=r.label||r.language||"Unknown",i.selected="showing"===r.mode,(n=e.call(this,t,i)||this).track=r;var s,o=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(Re(Re(n)),t)},u=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleSelectedLanguageChange.apply(Re(Re(n)),t)};(t.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",u),n.on("dispose",(function(){t.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",u)})),void 0===a.onchange)&&n.on(["tap","click"],(function(){if("object"!=typeof f().Event)try{s=new(f().Event)("change")}catch(e){}s||(s=C().createEvent("Event")).initEvent("change",!0,!0),a.dispatchEvent(s)}));return n.handleTracksChange(),n}xe(t,e);var i=t.prototype;return i.handleClick=function(t){var i=this.track.kind,n=this.track.kinds,r=this.player_.textTracks();if(n||(n=[i]),e.prototype.handleClick.call(this,t),r)for(var a=0;a<r.length;a++){var s=r[a];s===this.track&&n.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},i.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},i.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},i.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Cr);di.registerComponent("TextTrackMenuItem",Er);var Ar=function(e){function t(t,i){return i.track={player:t,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,e.call(this,t,i)||this}xe(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Er);di.registerComponent("OffTextTrackMenuItem",Ar);var Lr=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return xe(t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=Er),this.label_&&(i=this.label_+" off"),e.push(new Ar(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var a=n[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(wr);di.registerComponent("TextTrackButton",Lr);var Or=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s<a.endTime,(n=e.call(this,t,i)||this).track=r,n.cue=a,r.addEventListener("cuechange",Kt(Re(Re(n)),n.update)),n}xe(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},i.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(Cr);di.registerComponent("ChaptersTrackMenuItem",Or);var Pr=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},i.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},i.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},i.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(ci(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],a=new Or(this.player_,{track:this.track_,cue:r});e.push(a)}return e},t}(Lr);Pr.prototype.kind_="chapters",Pr.prototype.controlText_="Chapters",di.registerComponent("ChaptersButton",Pr);var xr=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=t.textTracks(),s=Kt(Re(Re(r)),r.handleTracksChange);return a.addEventListener("change",s),r.on("dispose",(function(){a.removeEventListener("change",s)})),r}xe(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var a=t[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},i.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Lr);xr.prototype.kind_="descriptions",xr.prototype.controlText_="Descriptions",di.registerComponent("DescriptionsButton",xr);var Ur=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Lr);Ur.prototype.kind_="subtitles",Ur.prototype.controlText_="Subtitles",di.registerComponent("SubtitlesButton",Ur);var Ir=function(e){function t(t,i){var n;return i.track={player:t,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",(n=e.call(this,t,i)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+i.kind+" settings dialog"),n}return xe(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Er);di.registerComponent("CaptionSettingsMenuItem",Ir);var Dr=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ir(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Lr);Dr.prototype.kind_="captions",Dr.prototype.controlText_="Captions",di.registerComponent("CaptionsButton",Dr);var Rr=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(r+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n      "),r+="</span>",e.prototype.createEl.call(this,t,qe({innerHTML:r},i),n)},t}(Er);di.registerComponent("SubsCapsMenuItem",Rr);var Mr=function(e){function t(t,i){var n;return void 0===i&&(i={}),(n=e.call(this,t,i)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(ci(n.label_)),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ir(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Rr)},t}(Lr);Mr.prototype.kinds_=["captions","subtitles"],Mr.prototype.controlText_="Subtitles",di.registerComponent("SubsCapsButton",Mr);var Br=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(Re(Re(n)),t)};return a.addEventListener("change",s),n.on("dispose",(function(){a.removeEventListener("change",s)})),n}xe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(r+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n      "),r+="</span>",e.prototype.createEl.call(this,t,qe({innerHTML:r},i),n)},i.handleClick=function(t){var i=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0;n<i.length;n++){var r=i[n];r.enabled=r===this.track}},i.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Cr);di.registerComponent("AudioTrackMenuItem",Br);var Nr=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.audioTracks(),e.call(this,t,i)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Br(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(wr);Nr.prototype.controlText_="Audio Track",di.registerComponent("AudioTrackButton",Nr);var jr=function(e){function t(t,i){var n,r=i.rate,a=parseFloat(r,10);return i.label=r,i.selected=1===a,i.selectable=!0,i.multiSelectable=!1,(n=e.call(this,t,i)||this).label=r,n.rate=a,n.on(t,"ratechange",n.update),n}xe(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},i.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Cr);jr.prototype.contentElType="button",di.registerComponent("PlaybackRateMenuItem",jr);var Fr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateVisibility(),n.updateLabel(),n.on(t,"loadstart",n.updateVisibility),n.on(t,"ratechange",n.updateLabel),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=et("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},i.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},i.createMenu=function(){var e=new Sr(this.player()),t=this.playbackRates();if(t)for(var i=t.length-1;i>=0;i--)e.addChild(new jr(this.player(),{rate:t[i]+"x"}));return e},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},i.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(kr);Fr.prototype.controlText_="Playback Rate",di.registerComponent("PlaybackRateMenuButton",Fr);var Vr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(di);di.registerComponent("Spacer",Vr);var Hr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Vr);di.registerComponent("CustomControlSpacer",Hr);var qr=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(di);qr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},di.registerComponent("ControlBar",qr);var zr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",n.open),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Qi);zr.prototype.options_=hi(Qi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),di.registerComponent("ErrorDisplay",zr);var Wr="vjs-text-track-settings",Gr=["#000","Black"],Xr=["#00F","Blue"],Yr=["#0FF","Cyan"],$r=["#0F0","Green"],Kr=["#F0F","Magenta"],Qr=["#F00","Red"],Jr=["#FFF","White"],Zr=["#FF0","Yellow"],ea=["1","Opaque"],ta=["0.5","Semi-Transparent"],ia=["0","Transparent"],na={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Gr,Jr,Qr,$r,Xr,Zr,Kr,Yr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[ea,ta,ia]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Jr,Gr,Qr,$r,Xr,Zr,Kr,Yr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[ea,ta]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[ia,ta,ea]}};function ra(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}na.windowColor.options=na.backgroundColor.options;var aa=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=Kt(Re(Re(n)),n.updateDisplay),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=et("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",(function(){n.saveSettings(),n.close()})),n.on(n.$(".vjs-default-button"),"click",(function(){n.setDefaults(),n.updateDisplay()})),He(na,(function(e){n.on(n.$(e.selector),"change",n.updateDisplay)})),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}xe(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=na[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"</"+i+">",'<select aria-labelledby="'+s+'">'].concat(r.options.map((function(e){var t=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',n.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},i.createElColors_=function(){return et("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return et("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return et("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e=this;return function(e,t,i){return void 0===i&&(i=0),Ve(e).reduce((function(i,n){return t(i,e[n],n)}),i)}(na,(function(t,i,n){var r,a,s=(r=e.$(i.selector),a=i.parser,ra(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(t[n]=s),t}),{})},i.setValues=function(e){var t=this;He(na,(function(i,n){!function(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(ra(e.options[n].value,i)===t){e.selectedIndex=n;break}}(t.$(i.selector),e[n],i.parser)}))},i.setDefaults=function(){var e=this;He(na,(function(t){var i=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=i}))},i.restoreSettings=function(){var e;try{e=JSON.parse(f().localStorage.getItem(Wr))}catch(e){Ne.warn(e)}e&&this.setValues(e)},i.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?f().localStorage.setItem(Wr,JSON.stringify(e)):f().localStorage.removeItem(Wr)}catch(e){Ne.warn(e)}}},i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},i.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(C(),"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(Qi);di.registerComponent("TextTrackSettings",aa);var sa=function(e){function t(t,i){var n,r=i.ResizeObserver||f().ResizeObserver;null===i.ResizeObserver&&(r=!1);var a=hi({createEl:!r,reportTouchActivity:!1},i);return(n=e.call(this,t,a)||this).ResizeObserver=i.ResizeObserver||f().ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=function(e,t,i,n){var r;void 0===n&&(n=f());var a=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return a.cancel=function(){n.clearTimeout(r),r=null},a}((function(){n.resizeHandler()}),100,!1,Re(Re(n))),r?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(t.el())):(n.loadListener_=function(){n.el_&&n.el_.contentWindow&&Nt(n.el_.contentWindow,"resize",n.debouncedHandler_)},n.one("load",n.loadListener_)),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},i.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},i.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&jt(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(di);di.registerComponent("ResizeManager",sa);var oa=function(e){function t(t,i){var n,r=hi({createEl:!1},i);return(n=e.call(this,t,r)||this).reset_(),n.on(n.player_,"durationchange",n.handleDurationchange),n}xe(t,e);var i=t.prototype;return i.isBehind_=function(){if(!this.timeupdateSeen_)return!1;var e=this.liveCurrentTime(),t=this.player_.currentTime(),i=this.seekableIncrement_;return e!==1/0&&e-(2*i+.07)>=t},i.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(e&&e.length){var t=this.seekableEnd();t!==this.lastSeekEnd_&&(this.lastSeekEnd_&&(this.seekableIncrement_=Math.abs(t-this.lastSeekEnd_)),this.pastSeekEnd_=0,this.lastSeekEnd_=t,this.trigger("seekableendchange")),this.pastSeekEnd_=this.pastSeekEnd()+.03,this.isBehind_()!==this.behindLiveEdge()&&(this.behindLiveEdge_=this.isBehind_(),this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.player_.duration()===1/0?this.startTracking():this.stopTracking()},i.startTracking=function(){var e=this;this.isTracking()||(this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,"play",this.trackLive_),this.on(this.player_,"pause",this.trackLive_),this.one(this.player_,"play",this.handlePlay),this.timeupdateSeen_||(this.handleTimeupdate=function(){e.timeupdateSeen_=!0,e.handleTimeupdate=null},this.one(this.player_,"timeupdate",this.handleTimeupdate)))},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},i.reset_=function(){this.pastSeekEnd_=0,this.lastSeekEnd_=null,this.behindLiveEdge_=null,this.timeupdateSeen_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.seekableIncrement_=12,this.off(this.player_,"play",this.trackLive_),this.off(this.player_,"pause",this.trackLive_),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.seekToLiveEdge),this.handleTimeupdate&&(this.off(this.player_,"timeupdate",this.handleTimeupdate),this.handleTimeupdate=null)},i.stopTracking=function(){this.isTracking()&&this.reset_()},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?1/0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){return this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.atLiveEdge()||(this.player_.currentTime(this.liveCurrentTime()),this.player_.paused()&&this.player_.play())},i.dispose=function(){this.stopTracking(),e.prototype.dispose.call(this)},t}(di);di.registerComponent("LiveTracker",oa);var ua=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a<i.length;a++){var s=i[a].src;s&&-1===n.indexOf(s)&&n.push(s)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},la=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=C().createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=C().createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",f().Element.prototype.appendChild.call(this,i),this.innerHTML}}),ca=function(e,t){for(var i={},n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},ha=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},n=function(e){return ca([e.el(),f().HTMLMediaElement.prototype,f().Element.prototype,la],"innerHTML")}(e),r=function(i){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var s=i.apply(t,r);return ua(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",hi(n,{set:r(n.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach((function(e){t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}},da=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?fn(f().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return f().Element.prototype.setAttribute.call(this,"src",e),e}}),pa=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=function(e){return ca([e.el(),f().HTMLMediaElement.prototype,da],"src")}(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",hi(i,{set:function(n){var r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(i,r){var a=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),a},t.load=function(){var i=r.call(t);return ua(e)||(e.triggerSourceset(""),ha(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):ua(e)||ha(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}};function fa(){var e=Me(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n            This may prevent text tracks from loading."]);return fa=function(){return e},e}var ma=function(e){function t(t,i){var n;n=e.call(this,t,i)||this;var r=t.source,a=!1;if(r&&(n.el_.currentSrc!==r.src||t.tag&&3===t.tag.initNetworkState_)?n.setSource(r):n.handleLateInit_(n.el_),t.enableSourceset&&n.setupSourcesetHandling_(),n.el_.hasChildNodes()){for(var s=n.el_.childNodes,o=s.length,l=[];o--;){var c=s[o];"track"===c.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(c),n.remoteTextTracks().addTrack(c.track),n.textTracks().addTrack(c.track),a||n.el_.hasAttribute("crossorigin")||!gn(c.src)||(a=!0)):l.push(c))}for(var h=0;h<l.length;h++)n.el_.removeChild(l[h])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&a&&Ne.warn(u()(fa())),n.restoreMetadataTracksInIOSNativePlayer_(),(Ui||vi||wi)&&!0===t.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}xe(t,e);var i=t.prototype;return i.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},i.setupSourcesetHandling_=function(){pa(this)},i.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),i=function(){e=[];for(var i=0;i<t.length;i++){var n=t[i];"metadata"===n.kind&&e.push({track:n,storedMode:n.mode})}};i(),t.addEventListener("change",i),this.on("dispose",(function(){return t.removeEventListener("change",i)}));var n=function i(){for(var n=0;n<e.length;n++){var r=e[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",i)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",i),t.removeEventListener("change",n),t.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",n)}))},i.overrideNative_=function(e,t){var i=this;if(t===this["featuresNative"+e+"Tracks"]){var n=e.toLowerCase();this[n+"TracksListeners_"]&&Object.keys(this[n+"TracksListeners_"]).forEach((function(e){i.el()[n+"Tracks"].removeEventListener(e,i[n+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[n+"TracksListeners_"]=null,this.proxyNativeTracksForType_(n)}},i.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},i.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},i.proxyNativeTracksForType_=function(e){var t=this,i=kn[e],n=this.el()[i.getterName],r=this[i.getterName]();if(this["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var a={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var i=!1,a=0;a<n.length;a++)if(n[a]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[i.getterName+"Listeners_"]=a,Object.keys(a).forEach((function(e){var i=a[e];n.addEventListener(e,i),t.on("dispose",(function(t){return n.removeEventListener(e,i)}))})),this.on("loadstart",s),this.on("dispose",(function(e){return t.off("loadstart",s)}))}},i.proxyNativeTracks_=function(){var e=this;kn.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},i.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=C().createElement("video");var n=hi({},this.options_.tag&&ut(this.options_.tag));Ui&&!0===this.options_.nativeControlsForTouch||delete n.controls,ot(e,qe(n,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&ct(e,"preload",this.options_.preload);for(var r=["loop","muted","playsinline","autoplay"],a=0;a<r.length;a++){var s=r[a],o=this.options_[s];void 0!==o&&(o?ct(e,s,s):ht(e,s),e[s]=o)}return e},i.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},i.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(e){Ne(e,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&Si&&Ai&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=f().navigator&&f().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},i.exitFullScreen=function(){this.el_.webkitExitFullScreen()},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=C().createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),f().performance&&"function"==typeof f().performance.now?e.creationTime=f().performance.now():f().performance&&f().performance.timing&&"number"==typeof f().performance.timing.navigationStart&&(e.creationTime=f().Date.now()-f().performance.timing.navigationStart),e},t}(En);if(Ke()){ma.TEST_VID=C().createElement("video");var ga=C().createElement("track");ga.kind="captions",ga.srclang="en",ga.label="English",ma.TEST_VID.appendChild(ga)}ma.isSupported=function(){try{ma.TEST_VID.volume=.5}catch(e){return!1}return!(!ma.TEST_VID||!ma.TEST_VID.canPlayType)},ma.canPlayType=function(e){return ma.TEST_VID.canPlayType(e)},ma.canPlaySource=function(e,t){return ma.canPlayType(e.type)},ma.canControlVolume=function(){try{var e=ma.TEST_VID.volume;return ma.TEST_VID.volume=e/2+.1,e!==ma.TEST_VID.volume}catch(e){return!1}},ma.canMuteVolume=function(){try{var e=ma.TEST_VID.muted;return ma.TEST_VID.muted=!e,ma.TEST_VID.muted?ct(ma.TEST_VID,"muted","muted"):ht(ma.TEST_VID,"muted"),e!==ma.TEST_VID.muted}catch(e){return!1}},ma.canControlPlaybackRate=function(){if(Si&&Ai&&Li<58)return!1;try{var e=ma.TEST_VID.playbackRate;return ma.TEST_VID.playbackRate=e/2+.1,e!==ma.TEST_VID.playbackRate}catch(e){return!1}},ma.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(C().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(C().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(C().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(C().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},ma.supportsNativeTextTracks=function(){return xi||bi&&Ai},ma.supportsNativeVideoTracks=function(){return!(!ma.TEST_VID||!ma.TEST_VID.videoTracks)},ma.supportsNativeAudioTracks=function(){return!(!ma.TEST_VID||!ma.TEST_VID.audioTracks)},ma.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],ma.prototype.featuresVolumeControl=ma.canControlVolume(),ma.prototype.featuresMuteControl=ma.canMuteVolume(),ma.prototype.featuresPlaybackRate=ma.canControlPlaybackRate(),ma.prototype.featuresSourceset=ma.canOverrideAttributes(),ma.prototype.movingMediaElementInDOM=!bi,ma.prototype.featuresFullscreenResize=!0,ma.prototype.featuresProgressEvents=!0,ma.prototype.featuresTimeupdateEvents=!0,ma.prototype.featuresNativeTextTracks=ma.supportsNativeTextTracks(),ma.prototype.featuresNativeVideoTracks=ma.supportsNativeVideoTracks(),ma.prototype.featuresNativeAudioTracks=ma.supportsNativeAudioTracks();var ya=ma.TEST_VID&&ma.TEST_VID.constructor.prototype.canPlayType,va=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;function _a(){var e=Me(["\n        Using the tech directly can be dangerous. I hope you know what you're doing.\n        See https://github.com/videojs/video.js/issues/2617 for more info.\n      "]);return _a=function(){return e},e}ma.patchCanPlayType=function(){ki>=4&&!Ci&&!Ai&&(ma.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&va.test(e)?"maybe":ya.call(this,e)})},ma.unpatchCanPlayType=function(){var e=ma.TEST_VID.constructor.prototype.canPlayType;return ma.TEST_VID.constructor.prototype.canPlayType=ya,e},ma.patchCanPlayType(),ma.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},ma.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){ma.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){ma.prototype["set"+ci(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach((function(e){ma.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach((function(e){ma.prototype["set"+ci(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){ma.prototype[e]=function(){return this.el_[e]()}})),En.withSourceHandlers(ma),ma.nativeSourceHandler={},ma.nativeSourceHandler.canPlayType=function(e){try{return ma.TEST_VID.canPlayType(e)}catch(e){return""}},ma.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return ma.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=mn(e.src);return ma.nativeSourceHandler.canPlayType("video/"+i)}return""},ma.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},ma.nativeSourceHandler.dispose=function(){},ma.registerSourceHandler(ma.nativeSourceHandler),En.registerTech("Html5",ma);var ba=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ta={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Sa=["tiny","xsmall","small","medium","large","xlarge","huge"],ka={};Sa.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;ka[e]="vjs-layout-"+t}));var wa={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ca=function(e){function t(i,n,r){var a;if(i.id=i.id||n.id||"vjs_video_"+At(),(n=qe(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else for(var o=i;o&&1===o.nodeType;){if(ut(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang");break}o=o.parentNode}if((a=e.call(this,null,n,r)||this).log=je(a.id_),a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&ut(i),a.language(a.options_.language),n.languages){var u={};Object.getOwnPropertyNames(n.languages).forEach((function(e){u[e.toLowerCase()]=n.languages[e]})),a.languages_=u}else a.languages_=t.prototype.options_.languages;a.cache_={},a.poster_=n.poster||"",a.controls_=!!n.controls,a.cache_.lastVolume=1,i.controls=!1,i.removeAttribute("controls"),i.hasAttribute("autoplay")?a.options_.autoplay=!0:a.autoplay(a.options_.autoplay),a.scrubbing_=!1,a.el_=a.createEl(),a.cache_.lastPlaybackRate=a.defaultPlaybackRate(),oi(Re(Re(a)),{eventBusKey:"el_"}),a.fluid_&&a.on("playerreset",a.updateStyleEl_);var l=hi(a.options_);if(n.plugins){var c=n.plugins;Object.keys(c).forEach((function(e){if("function"!=typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](c[e])}),Re(Re(a)))}a.options_.playerOptions=l,a.middleware_=[],a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),bi||a.addClass("vjs-workinghover"),t.players[a.id_]=Re(Re(a));var h=Pe.split(".")[0];return a.addClass("vjs-v"+h),a.userActive(!0),a.reportUserActivity(),a.one("play",a.listenForUserActivity_),a.on("fullscreenchange",a.handleFullscreenChange_),a.on("stageclick",a.handleStageClick_),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.changingSrc_=!1,a.playWaitingForReady_=!1,a.playOnLoadstart_=null,a}xe(t,e);var i=t.prototype;return i.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Ln[this.id()]=null,e.prototype.dispose.call(this)},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=ut(i);if(r){for(t=this.el_=i,i=this.tag=C().createElement("video");t.children.length;)i.appendChild(t.firstChild);nt(t,"video-js")||rt(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach((function(e){i[e]=t[e]}))}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",Oi&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach((function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==f().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Yt("vjs-styles-dimensions");var s=kt(".vjs-styles-defaults"),o=kt("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var u=i.getElementsByTagName("a"),l=0;l<u.length;l++){var c=u.item(l);rt(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!n&&i.parentNode.insertBefore(t,i),it(i,t),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=t,t},i.width=function(e){return this.dimension("width",e)},i.height=function(e){return this.dimension("height",e)},i.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?Ne.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},i.fluid=function(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,Zt(this)&&this.off("playerreset",this.updateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Zt(t=function(){this.on("playerreset",this.updateStyleEl_)})?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},i.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},i.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},i.updateStyleEl_=function(){if(!0!==f().VIDEOJS_NO_DYNAMIC_STYLE){var e,t,i,n=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),$t(this.styleEl_,"\n      ."+i+" {\n        width: "+e+"px;\n        height: "+t+"px;\n      }\n\n      ."+i+".vjs-fluid {\n        padding-top: "+100*r+"%;\n      }\n    ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=ci(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(En.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a={source:t,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Cn.names.forEach((function(e){var t=Cn[e];a[t.getterName]=i[t.privateName]})),qe(a,this.options_[n]),qe(a,this.options_[r]),qe(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);var s=En.getTech(e);if(!s)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new s(a),this.tech_.ready(Kt(this,this.handleTechReady_),!0),Ki(this.textTracksJson_||[],this.tech_),ba.forEach((function(e){i.on(i.tech_,e,i["handleTech"+ci(e)+"_"])})),Object.keys(Ta).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Ta[e]+"_"].bind(i),event:t}):i["handleTech"+Ta[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||it(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;Cn.names.forEach((function(t){var i=Cn[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=$i(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&Ne.warn(u()(_a())),this.tech_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function(){var e=t.muted();t.muted(!0);var i=t.play();if(i&&i.then&&i.catch)return i.catch((function(i){t.muted(e)}))};if("any"===e?(i=this.play())&&i.then&&i.catch&&i.catch((function(){return n()})):i="muted"===e?n():this.play(),i&&i.then&&i.catch)return i.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(i){t.trigger({type:"autoplay-failure",autoplay:e})}))}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===t)return a.type}return Nn(t)}(this,t)),this.cache_.source=hi({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=ut(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},i.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var i=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=function(){}),i(r),!e.src){this.tech_.one(["sourceset","loadstart"],(function e(i){if("sourceset"!==i.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}t.tech_.off(["sourceset","loadstart"],e)}))}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},i.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},i.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},i.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))}))},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&(Ne.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){St(e)&&this.controls_&&(this.paused()?Xi(this.play()):this.pause())},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||(this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.preventDefault()},i.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.handleStageClick_=function(){this.reportUserActivity()},i.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.techCall_=function(e,t){this.ready((function(){if(e in In)return function(e,t,i,n){return t[i](e.reduce(Rn(i),n))}(this.middleware_,this.tech_,e,t);if(e in Dn)return xn(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Ne(e),e}}),!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Un)return function(e,t,i){return e.reduceRight(Rn(i),t[i]())}(this.middleware_,this.tech_,e);if(e in Dn)return xn(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Ne("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Ne("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Ne(t),t}}},i.play=function(){var e=this,t=this.options_.Promise||f().Promise;return t?new t((function(t){e.play_(t)})):this.play_()},i.play_=function(e){var t=this;if(void 0===e&&(e=Xi),this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void e(this.techGet_("play"));this.playOnLoadstart_=function(){t.playOnLoadstart_=null,e(t.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready((function(){t.playWaitingForReady_=!1,e(t.play())}))}},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||Mi(0,0)},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){return void 0!==e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?(this.addClass("vjs-live"),this.options_.liveui&&this.player_.liveTracker&&this.addClass("vjs-liveui")):(this.removeClass("vjs-live"),this.removeClass("vjs-liveui")),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=Mi(0,0)),e},i.bufferedPercent=function(){return Bi(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0===e)return!!this.isFullscreen_;this.isFullscreen_=!!e},i.requestFullscreen=function(){var e=ji;this.isFullscreen(!0),e.requestFullscreen?(Nt(C(),e.fullscreenchange,Kt(this,(function t(i){this.isFullscreen(C()[e.fullscreenElement]),!1===this.isFullscreen()&&jt(C(),e.fullscreenchange,t),this.trigger("fullscreenchange")}))),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},i.exitFullscreen=function(){var e=ji;this.isFullscreen(!1),e.requestFullscreen?C()[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},i.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=C().documentElement.style.overflow,Nt(C(),"keydown",Kt(this,this.fullWindowOnEscKey)),C().documentElement.style.overflow="hidden",rt(C().body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},i.exitFullWindow=function(){this.isFullWindow=!1,jt(C(),"keydown",this.fullWindowOnEscKey),C().documentElement.style.overflow=this.docOrigOverflow,at(C().body,"vjs-full-window"),this.trigger("exitFullWindow")},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=En.getTech(r);if(a||(a=di.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else Ne.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},i.selectSource=function(e){var t,i=this,n=this.options_.techOrder.map((function(e){return[e,En.getTech(e)]})).filter((function(e){var t=e[0],i=e[1];return i?i.isSupported():(Ne.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),r=function(e,t,i){var n;return e.some((function(e){return t.some((function(t){if(n=i(e,t))return!0}))})),n},a=function(e,t){var n=e[0];if(e[1].canPlaySource(t,i.options_[n.toLowerCase()]))return{source:t,tech:n}};return t=this.options_.sourceOrder?r(e,n,function(e){return function(t,i){return e(i,t)}}(a)):r(n,e,a),t||!1},i.src=function(e){var t=this;if(void 0===e)return this.cache_.src||"";var i=jn(e);i.length?(this.changingSrc_=!0,this.cache_.sources=i,this.updateSourceCaches_(i[0]),Pn(this,i[0],(function(e,n){var r,a;if(t.middleware_=n,t.cache_.sources=i,t.updateSourceCaches_(e),t.src_(e))return i.length>1?t.src(i.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());r=n,a=t.tech_,r.forEach((function(e){return e.setTech&&e.setTech(a)}))}))):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,ci(t)!==ci(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){n.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),Zt(this)&&this.trigger("playerreset")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new zi(e),this.addClass("vjs-error"),Ne.error("(CODE:"+this.error_.code+" "+zi.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n,r=Kt(this,this.reportUserActivity);this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,r())})),this.on("mouseup",(function(t){r(),this.clearInterval(e)})),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(n);var e=this.options_.inactivityTimeout;e<=0||(n=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},i.languages=function(){return hi(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=hi(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];(n=hi(n)).player=void 0,e.tracks[i]=n}return e},i.createModal=function(e,t){var i=this;(t=t||{}).content=e||"";var n=new Qi(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},i.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<Sa.length;i++){var n=Sa[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(ka[e]),this.addClass(ka[n]),this.breakpoint_=n;break}}},i.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},i.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=qe({},wa,e),this.updateCurrentBreakpoint_()),qe(this.breakpoints_)},i.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},i.currentBreakpoint=function(){return this.breakpoint_},i.currentBreakpointClass=function(){return ka[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},i=ut(e),n=i["data-setup"];if(nt(e,"vjs-fill")&&(i.fill=!0),nt(e,"vjs-fluid")&&(i.fluid=!0),null!==n){var a=r()(n||"{}"),s=a[0],o=a[1];s&&Ne.error(s),qe(i,o)}if(qe(t,i),e.hasChildNodes())for(var u=e.childNodes,l=0,c=u.length;l<c;l++){var h=u[l],d=h.nodeName.toLowerCase();"source"===d?t.sources.push(ut(h)):"track"===d&&t.tracks.push(ut(h))}return t},i.flexNotSupported_=function(){var e=C().createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(di);Cn.names.forEach((function(e){var t=Cn[e];Ca.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),Ca.players={};var Ea=f().navigator;Ca.prototype.options_={techOrder:En.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ea&&(Ea.languages&&Ea.languages[0]||Ea.userLanguage||Ea.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Ca.prototype[e]=function(){return this.techGet_(e)}})),ba.forEach((function(e){Ca.prototype["handleTech"+ci(e)+"_"]=function(){return this.trigger(e)}})),di.registerComponent("Player",Ca);var Aa="plugin",La={},Oa=function(e){return La.hasOwnProperty(e)},Pa=function(e){return Oa(e)?La[e]:void 0},xa=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},Ua=function(e,t,i){var n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},Ia=function(e,t){return t.prototype.name=e,function(){Ua(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=De(t,[this].concat(n));return this[e]=function(){return a},Ua(this,a.getEventHash()),a}},Da=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,oi(this),delete this.trigger,li(this,this.constructor.defaultState),xa(t,this.name),this.dispose=Kt(this,this.dispose),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),Ft(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=Ia(e,La[e])},e.isBasic=function(t){var i="string"==typeof t?Pa(t):t;return"function"==typeof i&&!e.prototype.isPrototypeOf(i.prototype)},e.registerPlugin=function(t,i){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(Oa(t))Ne.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Ca.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof i+".");return La[t]=i,t!==Aa&&(e.isBasic(i)?Ca.prototype[t]=function(e,t){var i=function(){Ua(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return xa(this,e),Ua(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(t,i):Ca.prototype[t]=Ia(t,i)),i},e.deregisterPlugin=function(e){if(e===Aa)throw new Error("Cannot de-register base plugin.");Oa(e)&&(delete La[e],delete Ca.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(La)),e.forEach((function(e){var i=Pa(e);i&&((t=t||{})[e]=i)})),t},e.getPluginVersion=function(e){var t=Pa(e);return t&&t.VERSION||""},e}();Da.getPlugin=Pa,Da.BASE_PLUGIN_NAME=Aa,Da.registerPlugin(Aa,Da),Ca.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},Ca.prototype.hasPlugin=function(e){return!!Oa(e)};var Ra=function(e){return 0===e.indexOf("#")?e.slice(1):e};function Ma(e,t,i){var n=Ma.getPlayer(e);if(n)return t&&Ne.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"==typeof e?kt("#"+Ra(e)):e;if(!Qe(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");C().body.contains(r)||Ne.warn("The element supplied is not included in the DOM"),t=t||{},Ma.hooks("beforesetup").forEach((function(e){var i=e(r,hi(t));ze(i)&&!Array.isArray(i)?t=hi(t,i):Ne.error("please return an object in beforesetup hooks")}));var a=di.getComponent("Player");return n=new a(r,t,i),Ma.hooks("setup").forEach((function(e){return e(n)})),n}if(Ma.hooks_={},Ma.hooks=function(e,t){return Ma.hooks_[e]=Ma.hooks_[e]||[],t&&(Ma.hooks_[e]=Ma.hooks_[e].concat(t)),Ma.hooks_[e]},Ma.hook=function(e,t){Ma.hooks(e,t)},Ma.hookOnce=function(e,t){Ma.hooks(e,[].concat(t).map((function(t){return function i(){return Ma.removeHook(e,i),t.apply(void 0,arguments)}})))},Ma.removeHook=function(e,t){var i=Ma.hooks(e).indexOf(t);return!(i<=-1)&&(Ma.hooks_[e]=Ma.hooks_[e].slice(),Ma.hooks_[e].splice(i,1),!0)},!0!==f().VIDEOJS_NO_DYNAMIC_STYLE&&Ke()){var Ba=kt(".vjs-styles-defaults");if(!Ba){Ba=Yt("vjs-styles-defaults");var Na=kt("head");Na&&Na.insertBefore(Ba,Na.firstChild),$t(Ba,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ")}}Gt(1,Ma),Ma.VERSION=Pe,Ma.options=Ca.prototype.options_,Ma.getPlayers=function(){return Ca.players},Ma.getPlayer=function(e){var t,i=Ca.players;if("string"==typeof e){var n=Ra(e),r=i[n];if(r)return r;t=kt("#"+n)}else t=e;if(Qe(t)){var a=t,s=a.player,o=a.playerId;if(s||i[o])return s||i[o]}},Ma.getAllPlayers=function(){return Object.keys(Ca.players).map((function(e){return Ca.players[e]})).filter(Boolean)},Ma.players=Ca.players,Ma.getComponent=di.getComponent,Ma.registerComponent=function(e,t){En.isTech(t)&&Ne.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),di.registerComponent.call(di,e,t)},Ma.getTech=En.getTech,Ma.registerTech=En.registerTech,Ma.use=function(e,t){An[e]=An[e]||[],An[e].push(t)},Object.defineProperty(Ma,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Ma.middleware,"TERMINATOR",{value:On,writeable:!1,enumerable:!0}),Ma.browser=Ii,Ma.TOUCH_ENABLED=Ui,Ma.extend=function(e,t){void 0===t&&(t={});var i=function(){e.apply(this,arguments)},n={};for(var r in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),n=t):"function"==typeof t&&(i=t),function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)}(i,e),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i},Ma.mergeOptions=hi,Ma.bind=Kt,Ma.registerPlugin=Da.registerPlugin,Ma.deregisterPlugin=Da.deregisterPlugin,Ma.plugin=function(e,t){return Ne.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Da.registerPlugin(e,t)},Ma.getPlugins=Da.getPlugins,Ma.getPlugin=Da.getPlugin,Ma.getPluginVersion=Da.getPluginVersion,Ma.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),Ma.options.languages=hi(Ma.options.languages,((i={})[e]=t,i)),Ma.options.languages[e]},Ma.log=Ne,Ma.createLogger=je,Ma.createTimeRange=Ma.createTimeRanges=Mi,Ma.formatTime=tr,Ma.setFormatTime=function(e){er=e},Ma.resetFormatTime=function(){er=Zn},Ma.parseUrl=pn,Ma.isCrossOrigin=gn,Ma.EventTarget=Jt,Ma.on=Nt,Ma.one=Vt,Ma.off=jt,Ma.trigger=Ft,Ma.xhr=c(),Ma.TextTrack=_n,Ma.AudioTrack=bn,Ma.VideoTrack=Tn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){Ma[e]=function(){return Ne.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Ct[e].apply(null,arguments)}})),Ma.computedStyle=Ge,Ma.dom=Ct,Ma.url=yn;var ja=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=d().buildAbsoluteURL(f().location.href,e)),d().buildAbsoluteURL(e,t))},Fa=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Va=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Ha=function e(t,i,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,i);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,i,n)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(n):void 0},qa=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},za=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Wa=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Ga=Ma.mergeOptions,Xa=Ma.EventTarget,Ya=Ma.log,$a=function(e,t){["AUDIO","SUBTITLES"].forEach((function(i){for(var n in e.mediaGroups[i])for(var r in e.mediaGroups[i][n]){var a=e.mediaGroups[i][n][r];t(a,i,n,r)}}))},Ka=function(e,t){var i=Ga(e,{}),n=i.playlists[t.uri];if(!n)return null;if(n.segments&&t.segments&&n.segments.length===t.segments.length&&n.mediaSequence===t.mediaSequence)return null;var r=Ga(n,t);n.segments&&(r.segments=function(e,t,i){var n=t.slice();i=i||0;for(var r=Math.min(e.length,t.length+i),a=i;a<r;a++)n[a-i]=Ga(e[a],n[a-i]);return n}(n.segments,t.segments,t.mediaSequence-n.mediaSequence)),r.segments.forEach((function(e){!function(e,t){e.resolvedUri||(e.resolvedUri=ja(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=ja(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=ja(t,e.map.uri))}(e,r.resolvedUri)}));for(var a=0;a<i.playlists.length;a++)i.playlists[a].uri===t.uri&&(i.playlists[a]=r);return i.playlists[t.uri]=r,i},Qa=function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];e.playlists[i.uri]=i,i.resolvedUri=ja(e.uri,i.uri),i.id=t,i.attributes||(i.attributes={},Ya.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}},Ja=function(e){$a(e,(function(t){t.uri&&(t.resolvedUri=ja(e.uri,t.uri))}))},Za=function(e,t){var i=e.segments[e.segments.length-1];return t&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10)},es=function(e){function t(e,i,n){Fa(this,t);var r=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(r.srcUrl=e,r.hls_=i,r.withCredentials=n,!r.srcUrl)throw new Error("A non-empty playlist URL is required");return r.state="HAVE_NOTHING",r.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===r.state&&(r.state="HAVE_CURRENT_METADATA",r.request=r.hls_.xhr({uri:ja(r.master.uri,r.media().uri),withCredentials:r.withCredentials},(function(e,t){if(r.request)return e?r.playlistRequestError(r.request,r.media().uri,"HAVE_METADATA"):void r.haveMetadata(r.request,r.media().uri)})))})),r}return qa(t,e),Va(t,[{key:"playlistRequestError",value:function(e,t,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(e,t){var i=this;this.request=null,this.state="HAVE_METADATA";var n=new k;n.push(e.responseText),n.end(),n.manifest.uri=t,n.manifest.attributes=n.manifest.attributes||{};var r=Ka(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[n.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(f().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=f().setTimeout((function(){i.trigger("mediaupdatetimeout")}),Za(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var n=!this.media_||e.uri!==this.media_.uri;if(this.master.playlists[e.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(n){if(this.state="SWITCHING_MEDIA",this.request){if(ja(this.master.uri,e.uri)===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.hls_.xhr({uri:ja(this.master.uri,e.uri),withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.playlistRequestError(t.request,e.uri,i);t.haveMetadata(r,e.uri),"HAVE_MASTER"===i?t.trigger("loadedmetadata"):t.trigger("mediachange")}}))}}},{key:"pause",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}},{key:"load",value:function(e){var t=this;f().clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f().setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");var n=new k;return n.push(i.responseText),n.end(),e.state="HAVE_MASTER",n.manifest.uri=e.srcUrl,n.manifest.playlists?(e.master=n.manifest,Qa(e.master),Ja(e.master),e.trigger("loadedplaylist"),void(e.request||e.media(n.manifest.playlists[0]))):(e.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:f().location.href,playlists:[{uri:e.srcUrl,id:0}]},e.master.playlists[e.srcUrl]=e.master.playlists[0],e.master.playlists[0].resolvedUri=e.srcUrl,e.master.playlists[0].attributes=e.master.playlists[0].attributes||{},e.haveMetadata(i,e.srcUrl),e.trigger("loadedmetadata"))}}))}}]),t}(Xa),ts=Ma.createTimeRange,is=function(e,t,i){var n,r;return void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence?0:(n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t),n.precise?n.result:(r=function(e,t){for(var i=0,n=void 0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(n=e.segments[r]).start)return{result:n.start-i,precise:!0};if(i+=n.duration,void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}}(e,t),r.precise?r.result:n.result+i))},ns=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return f()[1/0]}return is(e,t,i)},rs=function(e,t,i){var n=0;if(t>i){var r=[i,t];t=r[0],i=r[1]}if(t<0){for(var a=t;a<Math.min(0,i);a++)n+=e.targetDuration;t=0}for(var s=t;s<i;s++)n+=e.segments[s].duration;return n},as=function(e){if(!e.segments.length)return 0;for(var t=e.segments.length-1,i=e.segments[t].duration||e.targetDuration,n=i+2*e.targetDuration;t--&&!((i+=e.segments[t].duration)>=n););return Math.max(0,t)},ss=function(e,t,i){if(!e||!e.segments)return null;if(e.endList)return ns(e);if(null===t)return null;t=t||0;var n=i?as(e):e.segments.length;return is(e,e.mediaSequence+n,t)},os=function(e){return e-Math.floor(e)==0},us=function(e,t){if(os(t))return t+.1*e;for(var i=t.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),a=t*r;if(os(a)||n===i)return(a+e)/r}},ls=us.bind(null,1),cs=us.bind(null,-1),hs=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ds=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ps=function(e){var t=hs(e);return!e.disabled&&!t},fs=function(e,t){return t.attributes&&t.attributes[e]},ms=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!ps(e)&&(e.attributes.BANDWIDTH||0)<i})).length},gs={duration:ns,seekable:function(e,t){var i=t||0,n=ss(e,t,!0);return null===n?ts():ts(i,n)},safeLiveIndex:as,getMediaInfoForTime:function(e,t,i,n){var r=void 0,a=void 0,s=e.segments.length,o=t-n;if(o<0){if(i>0)for(r=i-1;r>=0;r--)if(a=e.segments[r],(o+=cs(a.duration))>0)return{mediaIndex:r,startTime:n-rs(e,i,r)};return{mediaIndex:0,startTime:t}}if(i<0){for(r=i;r<0;r++)if((o-=e.targetDuration)<0)return{mediaIndex:0,startTime:t};i=0}for(r=i;r<s;r++)if(a=e.segments[r],(o-=ls(a.duration))<0)return{mediaIndex:r,startTime:n+rs(e,i,r)};return{mediaIndex:s-1,startTime:t}},isEnabled:ps,isDisabled:function(e){return e.disabled},isBlacklisted:hs,isIncompatible:ds,playlistEnd:ss,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},isFmp4:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].map)return!0;return!1},hasAttribute:fs,estimateSegmentRequestTime:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!fs("BANDWIDTH",i))return NaN;var r=e*i.attributes.BANDWIDTH;return(r-8*n)/t},isLowestEnabledRendition:ms},ys=Ma.xhr,vs=Ma.mergeOptions,_s=function(){return function e(t,i){t=vs({timeout:45e3},t);var n=e.beforeRequest||Ma.Hls.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r)}var a=ys(t,(function(e,t){var n=a.response;!e&&n&&(a.responseTime=Date.now(),a.roundTripTime=a.responseTime-a.requestTime,a.bytesReceived=n.byteLength||n.length,a.bandwidth||(a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3))),t.headers&&(a.responseHeaders=t.headers),e&&"ETIMEDOUT"===e.code&&(a.timedout=!0),e||a.aborted||200===t.statusCode||206===t.statusCode||0===t.statusCode||(e=new Error("XHR Failed with a response of: "+(a&&(n||a.responseText)))),i(e,a)})),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a}},bs=function(e,t){return e.start(t)+"-"+e.end(t)},Ts=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Ss=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},ks=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},ws=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Cs=function(e){for(var t=Array.prototype.slice.call(e),i=16,n="",r=0;r<t.length/i;r++)n+=t.slice(r*i,r*i+i).map(Ts).join("")+" "+t.slice(r*i,r*i+i).map(Ss).join("")+"\n";return n},Es=Object.freeze({createTransferableMessage:ks,initSegmentId:ws,hexDump:Cs,tagDump:function(e){var t=e.bytes;return Cs(t)},textRanges:function(e){var t="",i=void 0;for(i=0;i<e.length;i++)t+=bs(e,i)+" ";return t}}),As=function(e,t,i,n){var r=void 0;if("stream"===t){r=new Date(1e3*n+i.getTime());var a=e.toISOString(),s=i.toISOString(),o=r.toISOString();return s<=a&&a<=o}if("player"===t)return r=n+i,i<=e&&e<=r},Ls=function(e,t,i){if(!i.segments||0===i.segments.length)return null;if("player"!==t&&"stream"!==t)return null;for(var n=0,r=0;r<i.segments.length;r++){var a=i.segments[r],s=n+a.duration,o=void 0,u=void 0;"player"===t?(o=a.start,u=n):(o=a.dateTimeObject,u=a.dateTimeObject);var l=void 0!==a.start&&void 0!==a.end&&As(e,t,o,a.end-a.start),c=As(e,t,u,a.duration);if(l)return{segment:a,estimatedStart:u,type:"accurate"};if(c)return{segment:a,estimatedStart:u,type:"estimate"};n=s}return null},Os=function(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i,r=e.callback;if(!r)throw new Error("getStreamTime: callback must be provided");if(!t||void 0===n)return r({message:"getStreamTime: playlist and time must be provided"});var a=function(e,t){return Ls(e,"player",t)}(n,t);if(!a)return r({message:"valid streamTime was not found"});if("estimate"===a.type)return r({message:"Accurate streamTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:n};return a.segment.dateTimeObject&&(s.programDateTime=a.segment.dateTimeObject.toISOString()),r(null,s)},Ps=function e(t){var i=t.streamTime,n=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToStreamTime: callback must be provided");if(void 0===i||!n||!s)return c({message:"seekToStreamTime: streamTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var h=function(e,t){var i=void 0;try{i=new Date(e)}catch(e){return null}return Ls(i,"stream",t)}(i,n);if(!h)return c({message:i+" was not found in the stream"});if("estimate"===h.type)return 0===a?c({message:i+" is not buffered yet. Try again"}):e({streamTime:i,playlist:n,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c});var d=h.segment,p=function(e,t){var i=void 0,n=void 0;try{i=new Date(e),n=new Date(t)}catch(e){}var r=i.getTime();return(n.getTime()-r)/1e3}(d.dateTimeObject,i),f=d.start+p;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),s(f)},xs=1/30,Us=.1,Is=function(e,t){var i=[],n=void 0;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return Ma.createTimeRanges(i)},Ds=function(e,t){return Is(e,(function(e,i){return e-xs<=t&&i+xs>=t}))},Rs=function(e,t){return Is(e,(function(e){return e-xs>=t}))},Ms=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Bs=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Ns=function(e,t,i){var n=void 0,r=void 0;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime<=t&&r.endTime>=e&&i.removeCue(r)},js=function(e){return isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e},Fs=function(e,t,i){var n=f().WebKitDataCue||f().VTTCue;if(t&&t.forEach((function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new n(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))}),e),i){var r=js(e.mediaSource_.duration);if(i.forEach((function(e){var t=e.cueTime+this.timestampOffset;e.frames.forEach((function(e){var i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return Ma.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Ma.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Ma.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(i),this.metadataTrack_.addCue(i)}),this)}),e),e.metadataTrack_&&e.metadataTrack_.cues&&e.metadataTrack_.cues.length){for(var a=e.metadataTrack_.cues,s=[],o=0;o<a.length;o++)a[o]&&s.push(a[o]);var u=s.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),l=Object.keys(u).sort((function(e,t){return Number(e)-Number(t)}));l.forEach((function(e,t){var i=u[e],n=Number(l[t+1])||r;i.forEach((function(e){e.endTime=n}))}))}}},Vs="undefined"!=typeof window?window:{},Hs="undefined"==typeof Symbol?"__target":Symbol(),qs=Vs.BlobBuilder||Vs.WebKitBlobBuilder||Vs.MozBlobBuilder||Vs.MSBlobBuilder,zs=Vs.URL||Vs.webkitURL||zs&&zs.msURL,Ws=Vs.Worker;function Gs(e,t){return function(i){var n=this;if(!t)return new Ws(e);if(Ws&&!i){var r=Ks(t.toString().replace(/^function.+?{/,"").slice(0,-1));return this[Hs]=new Ws(r),function(e,t){if(!e||!t)return;var i=e.terminate;e.objURL=t,e.terminate=function(){e.objURL&&zs.revokeObjectURL(e.objURL),i.call(e)}}(this[Hs],r),this[Hs]}var a={postMessage:function(e){n.onmessage&&setTimeout((function(){n.onmessage({data:e,target:a})}))}};t.call(a),this.postMessage=function(e){setTimeout((function(){a.onmessage({data:e,target:n})}))},this.isThisThread=!0}}if(Ws){var Xs,Ys=Ks("self.onmessage = function () {}"),$s=new Uint8Array(1);try{(Xs=new Ws(Ys)).postMessage($s,[$s.buffer])}catch(e){Ws=null}finally{zs.revokeObjectURL(Ys),Xs&&Xs.terminate()}}function Ks(e){try{return zs.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){var t=new qs;return t.append(e),zs.createObjectURL(t.getBlob(type))}}var Qs=new Gs("./transmuxer-worker.worker.js",(function(e,t){var i=this;!function(){var e,t,n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,w,C,E,A,L,O,P,x,U,I,D,R,M,B,N,j,F,V=Math.pow(2,32)-1;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),w=new Uint8Array([0,0,0,1]),E=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]),A=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),L={video:E,audio:A},x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0]),U=new Uint8Array([0,0,0,0,0,0,0,0]),I=U,D=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=U,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),e=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},t=function(){return e(S.dinf,e(S.dref,x))},n=function(t){return e(S.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},m=function(t){return e(S.hdlr,L[t])},f=function(t){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(i[12]=t.samplerate>>>24&255,i[13]=t.samplerate>>>16&255,i[14]=t.samplerate>>>8&255,i[15]=255&t.samplerate),e(S.mdhd,i)},p=function(t){return e(S.mdia,f(t),m(t.type),s(t))},a=function(t){return e(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},s=function(i){return e(S.minf,"video"===i.type?e(S.vmhd,O):e(S.smhd,P),t(),y(i))},o=function(t,i){for(var n=[],r=i.length;r--;)n[r]=_(i[r]);return e.apply(null,[S.moof,a(t)].concat(n))},u=function(t){for(var i=t.length,n=[];i--;)n[i]=h(t[i]);return e.apply(null,[S.moov,c(4294967295)].concat(n).concat(l(t)))},l=function(t){for(var i=t.length,n=[];i--;)n[i]=b(t[i]);return e.apply(null,[S.mvex].concat(n))},c=function(t){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e(S.mvhd,i)},g=function(t){var i,n,r=t.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return e(S.sdtp,a)},y=function(t){return e(S.stbl,v(t),e(S.stts,R),e(S.stsc,I),e(S.stsz,D),e(S.stco,U))},v=function(t){return e(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===t.type?M(t):B(t))},M=function(t){var i,n=t.sps||[],r=t.pps||[],a=[],s=[];for(i=0;i<n.length;i++)a.push((65280&n[i].byteLength)>>>8),a.push(255&n[i].byteLength),a=a.concat(Array.prototype.slice.call(n[i]));for(i=0;i<r.length;i++)s.push((65280&r[i].byteLength)>>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));return e(S.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,(65280&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.height,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]),e(S.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([n.length]).concat(a).concat([r.length]).concat(s))),e(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},B=function(t){return e(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),n(t))},d=function(t){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.duration,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,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return e(S.tkhd,i)},_=function(t){var i,n,r,a,s,o;return i=e(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(t.baseMediaDecodeTime/(V+1)),o=Math.floor(t.baseMediaDecodeTime%(V+1)),n=e(S.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===t.type?(r=T(t,92),e(S.traf,i,n,r)):(a=g(t),r=T(t,a.length+92),e(S.traf,i,n,r,a))},h=function(t){return t.duration=t.duration||4294967295,e(S.trak,d(t),p(t))},b=function(t){var i=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(i[i.length-1]=0),e(S.trex,i)},F=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(t,i){var n,r,a,s;for(i+=20+16*(r=t.samples||[]).length,n=F(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return e(S.trun,new Uint8Array(n))},N=function(t,i){var n,r,a,s;for(i+=20+8*(r=t.samples||[]).length,n=F(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return e(S.trun,new Uint8Array(n))},T=function(e,t){return"audio"===e.type?N(e,t):j(e,t)};var H,q,z,W,G,X={ftyp:r=function(){return e(S.ftyp,k,w,k,C)},mdat:function(t){return e(S.mdat,t)},moof:o,moov:u,initSegment:function(e){var t,i=r(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},Y=function(e){return e>>>0};H=function(e,t){var i,n,r,a,s,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Y(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=q(e.subarray(i+4,i+8)),a=n>1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,a)):(s=H(e.subarray(i+8,a),t.slice(1))).length&&(o=o.concat(s))),i=a;return o},z=function(e){return H(e,["moov","trak"]).reduce((function(e,t){var i,n,r,a,s;return(i=H(t,["tkhd"])[0])?(n=i[0],a=Y(i[r=0===n?12:20]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),(s=H(t,["mdia","mdhd"])[0])?(r=0===(n=s[0])?12:20,e[a]=Y(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null}),{})},W=function(e,t){var i,n,r;return i=H(t,["moof","traf"]),n=[].concat.apply([],i.map((function(t){return H(t,["tfhd"]).map((function(i){var n,r,a;return n=Y(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,a=H(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=Y(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Y(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],(a=a||1/0)/r}))}))),r=Math.min.apply(null,n),isFinite(r)?r:0},G=function(e){var t=H(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=H(e,["mdia","hdlr"]),n=H(e,["tkhd"]);t.forEach((function(e,t){var r,a,s=q(e.subarray(8,12)),o=n[t];"vide"===s&&(a=0===(r=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?r.getUint32(12):r.getUint32(20),i.push(a))}))})),i};var $={findBox:H,parseType:q=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},timescale:z,startTime:W,videoTrackIds:G},K=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};K.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},K.prototype.push=function(e){this.trigger("data",e)},K.prototype.flush=function(e){this.trigger("done",e)};var Q,J,Z,ee,te,ie,ne,re=K,ae=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},se=function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},oe=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},ue=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},le=function(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;i<e.length;i++)for(a=e[i],n=0;n<a.length;n++)s=a[n],o+=(r=ae(s,o)).size,u.push(r);return u},ce=function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},he=[33,16,5,32,164,27],de=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],pe=function(e){for(var t=[];e--;)t.push(0);return t},fe={96e3:[he,[227,64],pe(154),[56]],88200:[he,[231],pe(170),[56]],64e3:[he,[248,192],pe(240),[56]],48e3:[he,[255,192],pe(268),[55,148,128],pe(54),[112]],44100:[he,[255,192],pe(268),[55,163,128],pe(84),[112]],32e3:[he,[255,192],pe(268),[55,234],pe(226),[112]],24e3:[he,[255,192],pe(268),[55,255,128],pe(268),[111,112],pe(126),[224]],16e3:[he,[255,192],pe(268),[55,255,128],pe(268),[111,255],pe(269),[223,108],pe(195),[1,192]],12e3:[de,pe(268),[3,127,248],pe(268),[6,255,240],pe(268),[13,255,224],pe(268),[27,253,128],pe(259),[56]],11025:[de,pe(268),[3,127,248],pe(268),[6,255,240],pe(268),[13,255,224],pe(268),[27,255,192],pe(268),[55,175,128],pe(108),[112]],8e3:[de,pe(268),[3,121,16],pe(47),[7]]},me=(Q=fe,Object.keys(Q).reduce((function(e,t){return e[t]=new Uint8Array(Q[t].reduce((function(e,t){return e.concat(t)}),[])),e}),{}));ie=function(e,t){return J(te(e,t))},ne=function(e,t){return Z(ee(e),t)};J=function(e){return 9e4*e},Z=function(e,t){return e*t},ee=function(e){return e/9e4},te=function(e,t){return e/t};var ge=ie,ye=ne,ve=function(e,t,i,n){var r,a,s,o,u=0,l=0,c=0;if(t.length&&(r=ge(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(9e4/(e.samplerate/1024)),i&&n&&(u=r-Math.max(i,n),c=(l=Math.floor(u/a))*a),!(l<1||c>45e3))){for((s=me[e.samplerate])||(s=t[0].data),o=0;o<l;o++)t.splice(o,0,{data:s});e.baseMediaDecodeTime-=Math.floor(ye(c,e.samplerate))}},_e=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},be=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},Te=function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r},Se=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ke=function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/9e4,i=Math.floor(i)),i},we=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Ce=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}t+=r,n=0,r=0}return i},Ee=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ae=function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},Le=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},Pe=4,xe=function e(){e.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new Me(0,0),new Me(0,1),new Me(1,0),new Me(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};(xe.prototype=new re).push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=Ce(e.escapedRBSP)).payloadType===Pe&&(i=Ee(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=Ae(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},xe.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},xe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},xe.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},xe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},xe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var Ue={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},Ie=function(e){return null===e?"":(e=Ue[e]||e,String.fromCharCode(e))},De=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Re=function(){for(var e=[],t=15;t--;)e.push("");return e},Me=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Re();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Re();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Re()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=Ie((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Ie((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=De.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=Ie(n),a+=Ie(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Me.prototype=new re,Me.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return Oe.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Me.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Re(),this.nonDisplayed_=Re(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Me.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Me.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Me.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Me.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Me.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Me.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Me.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Me.prototype.isNormalChar=function(e){return e>=32&&e<=127},Me.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Re(),this.displayed_=Re()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Me.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},Me.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Me.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},Me.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},Me.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Me.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i};var Be={CaptionStream:xe,Cea608Stream:Me},Ne={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},je=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Fe=function e(t){var i,n;e.prototype.init.call(this),this.type_=t,this.push=function(e){e.type===this.type_&&(void 0===n&&(n=e.dts),e.dts=je(e.dts,n),e.pts=je(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.discontinuity=function(){n=void 0,i=void 0}};Fe.prototype=new re;var Ve,He=Fe,qe=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},ze=function(e,t,i){return decodeURIComponent(qe(e,t,i))},We=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ge={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.value=ze(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.url=ze(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,i;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(i=e.data,unescape(qe(i,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};Ve=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},n=0,r=[],a=0;if(Ve.prototype.init.call(this),this.dispatchType=Ne.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,s,o,u,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&Oe.log("Skipping unrecognized metadata packet");else if(r.push(e),a+=e.data.byteLength,1===r.length&&(n=We(e.data.subarray(6,10)),n+=10),!(a<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)t.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();s=10,64&t.data[5]&&(s+=4,s+=We(t.data.subarray(10,14)),n-=We(t.data.subarray(16,20)));do{if((o=We(t.data.subarray(s+4,s+8)))<1)return Oe.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]),data:t.data.subarray(s+10,s+o+10)}).key=u.id,Ge[u.id]&&(Ge[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,h=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;h*=4,h+=3&c[7],u.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),s+=10,s+=o}while(s<n);this.trigger("data",t)}}},Ve.prototype=new re;var Xe,Ye,$e,Ke=Ve,Qe=He,Je=188;(Xe=function(){var e=new Uint8Array(Je),t=0;Xe.prototype.init.call(this),this.push=function(i){var n,r=0,a=Je;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=Je,a+=Je);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===Je&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new re,Ye=function(){var e,t,i,n;Ye.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===Ne.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===Ne.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===Ne.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ne.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ne.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},Ye.prototype=new re,Ye.STREAM_TYPES={h264:27,adts:15},$e=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(t,i,n){var r,a,s=new Uint8Array(t.size),o={type:i},u=0,l=0;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,u=0;u<t.data.length;u++)a=t.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,h,d;c=s,(h=o).packetLength=6+(c[4]<<8|c[5]),h.dataAlignmentIndicator=0!=(4&c[6]),192&(d=c[7])&&(h.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,h.pts*=4,h.pts+=(6&c[13])>>>1,h.dts=h.pts,64&d&&(h.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,h.dts*=4,h.dts+=(6&c[18])>>>1)),h.data=c.subarray(9+c[8]),r="video"===i||o.packetLength<=t.size,(n||r)&&(t.size=0,t.data.length=0),r&&e.trigger("data",o)}};$e.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case Ne.H264_STREAM_TYPE:case Ne.H264_STREAM_TYPE:e=t,s="video";break;case Ne.ADTS_STREAM_TYPE:e=i,s="audio";break;case Ne.METADATA_STREAM_TYPE:e=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){r(t,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}},$e.prototype=new re;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Je,TransportPacketStream:Xe,TransportParseStream:Ye,ElementaryStream:$e,TimestampRolloverStream:Qe,CaptionStream:Be.CaptionStream,Cea608Stream:Be.Cea608Stream,MetadataStream:Ke};for(var et in Ne)Ne.hasOwnProperty(et)&&(Ze[et]=Ne[et]);var tt,it=Ze,nt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];tt=function(){var e;tt.prototype.init.call(this),this.push=function(t){var i,n,r,a,s,o,u=0,l=0;if("audio"===t.type)for(e?(a=e,(e=new Uint8Array(a.byteLength+t.data.byteLength)).set(a),e.set(t.data,a.byteLength)):e=t.data;u+5<e.length;)if(255===e[u]&&240==(246&e[u+1])){if(n=2*(1&~e[u+1]),i=(3&e[u+3])<<11|e[u+4]<<3|(224&e[u+5])>>5,o=9e4*(s=1024*(1+(3&e[u+6])))/nt[(60&e[u+2])>>>2],r=u+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+l*o,dts:t.dts+l*o,sampleCount:s,audioobjecttype:1+(e[u+2]>>>6&3),channelcount:(1&e[u+2])<<2|(192&e[u+3])>>>6,samplerate:nt[(60&e[u+2])>>>2],samplingfrequencyindex:(60&e[u+2])>>>2,samplesize:16,data:e.subarray(u+7+n,r)}),e.byteLength===r)return void(e=void 0);l++,e=e.subarray(r)}else u++},this.flush=function(){this.trigger("done")}},tt.prototype=new re;var rt,at,st,ot=tt,ut=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};at=function(){var e,t,i=0;at.prototype.init.call(this),this.push=function(n){var r;for(t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}},at.prototype=new re,st={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},rt=function(){var e,t,i,n,r,a,s,o=new at;rt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:i,dts:n,data:s};switch(31&s[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),this.flush=function(){o.flush()},s=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},r=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},a=function(e){var t,i,n,r,a,o,u,l,c,h,d,p,f,m=0,g=0,y=0,v=0,_=1;if(i=(t=new ut(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),st[i]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(d=3!==a?8:12,f=0;f<d;f++)t.readBoolean()&&s(f<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),f=0;f<u;f++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(h=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:p=[1,1];break;case 2:p=[12,11];break;case 3:p=[10,11];break;case 4:p=[16,11];break;case 5:p=[40,33];break;case 6:p=[24,11];break;case 7:p=[20,11];break;case 8:p=[32,11];break;case 9:p=[80,33];break;case 10:p=[18,11];break;case 11:p=[15,11];break;case 12:p=[64,33];break;case 13:p=[160,99];break;case 14:p=[4,3];break;case 15:p=[3,2];break;case 16:p=[2,1];break;case 255:p=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}p&&(_=p[0]/p[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(l+1)-2*m-2*g)*_),height:(2-h)*(c+1)*16-2*y-2*v}}},rt.prototype=new re;var lt,ct={H264Stream:rt,NalByteStream:at},ht=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},dt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},pt=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i};(lt=function(){var e=new Uint8Array,t=0;lt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(i.byteLength+s)).set(e.subarray(0,s)),e.set(i,s)):e=i;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=pt(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=dt(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array}}).prototype=new re;var ft,mt,gt,yt,vt=lt,_t=ct.H264Stream,bt=ht,Tt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],St=["width","height","profileIdc","levelIdc","profileCompatibility"],kt=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};mt=function(e,t){var i=[],n=0,r=0,a=0,s=1/0;t=t||{},mt.prototype.init.call(this),this.push=function(t){we(e,t),e&&Tt.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(t){r=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c;0!==i.length?(o=_e(i,e,r),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),ve(e,o,a,s),e.samples=be(o),l=X.mdat(Te(o)),i=[],u=X.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),Se(e),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}},mt.prototype=new re,ft=function(e,t){var i,n,r=0,a=[],s=[];t=t||{},ft.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){we(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],St.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,n,o,u,l,c;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=se(a),(o=oe(i))[0][0].keyFrame||((n=this.getGopForFusion_(a[0],e))?(o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=ue(o)),s.length){var h;if(!(h=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Se(e),o=h}we(e,o),e.samples=le(o),l=X.mdat(ce(o)),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=X.moof(r,[e]),c=new Uint8Array(u.byteLength+l.byteLength),r++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){Se(e),i=void 0,n=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&kt(e.pps[0],a.pps[0])&&e.sps&&kt(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;t<s.length&&i<e.length&&(n=s[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--)}if(!o&&null===a)return null;if(0===(u=o?i:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},ft.prototype=new re,yt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,yt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}},yt.prototype=new re,yt.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,St.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Tt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=X.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=o),i.cueTime/=9e4,s.metadata.push(i);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},gt=function(e){var t,i,n=this,r=!0;gt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new it.MetadataStream,t.aacStream=new vt,t.audioTimestampRolloverStream=new it.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new it.TimestampRolloverStream("timed-metadata"),t.adtsStream=new ot,t.coalesceStream=new yt(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(r){"timed-metadata"!==r.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new mt(i,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new it.MetadataStream,r.packetStream=new it.TransportPacketStream,r.parseStream=new it.TransportParseStream,r.elementaryStream=new it.ElementaryStream,r.videoTimestampRolloverStream=new it.TimestampRolloverStream("video"),r.audioTimestampRolloverStream=new it.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new it.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ot,r.h264Stream=new _t,r.captionStream=new it.CaptionStream,r.coalesceStream=new yt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream),r.elementaryStream.pipe(r.videoTimestampRolloverStream).pipe(r.h264Stream),r.elementaryStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.elementaryStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new ft(t,e),r.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,r.audioSegmentStream.setEarliestDts(e.dts))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new mt(i,e),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream))}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Se(i),e.keepOriginalTimestamps||(i.timelineStartInfo.baseMediaDecodeTime=n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[],r.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Se(t),r.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=n)),r.timedMetadataTimestampRolloverStream&&r.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(r){var t=bt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},gt.prototype=new re;var wt,Ct,Et={Transmuxer:gt,VideoSegmentStream:ft,AudioSegmentStream:mt,AUDIO_PROPERTIES:Tt,VIDEO_PROPERTIES:St},At=$.parseType,Lt=function(e){return new Date(1e3*e-20828448e5)},Ot=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Pt=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4<e.length;t+=i)if(i=n.getUint32(t),t+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},xt={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:wt(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;for(t=e[n],n++,r=0;r<t;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:At(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(At(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:wt(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:wt(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:At(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:Pt(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=Lt(i.getUint32(n)),n+=8,r.modificationTime=Lt(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=Lt(i.getUint32(n)),n+=4,r.modificationTime=Lt(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,t=i.getUint16(n),r.language+=String.fromCharCode(96+(t>>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:wt(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:wt(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=wt(e.subarray(28))[0]),i},moof:function(e){return{boxes:wt(e)}},moov:function(e){return{boxes:wt(e)}},mvex:function(e){return{boxes:wt(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=Lt(t.getUint32(i)),i+=8,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=Lt(t.getUint32(i)),i+=4,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:wt(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:wt(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)n.entries.push(i.getUint32(t));return n},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(t=8;r;t+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return n},styp:function(e){return xt.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=Lt(t.getUint32(i)),i+=8,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=8,n.duration=t.getUint32(i)):(n.creationTime=Lt(t.getUint32(i)),i+=4,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=4,n.duration=t.getUint32(i)),i+=4,i+=8,n.layer=t.getUint16(i),i+=2,n.alternateGroup=t.getUint16(i),i+=2,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.width=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.height=t.getUint16(i)+t.getUint16(i+2)/16,n},traf:function(e){return{boxes:wt(e)}},trak:function(e){return{boxes:wt(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),a&&c&&(t={flags:Ot(e.subarray(h,h+4))},h+=4,s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=Ot(e.subarray(h,h+4)),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};wt=function(e){for(var t,i,n,r,a,s=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c<e.length;++c)l[c]=e[c];for(t=new DataView(u);s<e.byteLength;)i=t.getUint32(s),n=At(e.subarray(s+4,s+8)),r=i>1?s+i:e.byteLength,(a=(xt[n]||function(e){return{data:e}})(e.subarray(s+8,r))).size=i,a.type=n,o.push(a),s=r;return o},Ct=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+"  "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map((function(e){return i+"  "+e})).join("\n")+"\n"+i+"  >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map((function(e,t){return 0===t?e:i+"  "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+Ct(e.boxes,t+1):"")})).join("\n")};var Ut={inspect:wt,textify:Ct,parseTfdt:xt.tfdt,parseHdlr:xt.hdlr,parseTfhd:xt.tfhd,parseTrun:xt.trun},It=Le,Dt=Be.CaptionStream,Rt=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},Mt=function(e,t){var i=$.findBox(e,["moof","traf"]),n=$.findBox(e,["mdat"]),r={},a=[];return n.forEach((function(e,t){var n=i[t];a.push({mdat:e,traf:n})})),a.forEach((function(e){var i,n,a=e.mdat,s=e.traf,o=$.findBox(s,["tfhd"]),u=Ut.parseTfhd(o[0]),l=u.trackId,c=$.findBox(s,["tfdt"]),h=c.length>0?Ut.parseTfdt(c[0]).baseMediaDecodeTime:0,d=$.findBox(s,["trun"]);t===l&&d.length>0&&(i=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,s=i.trackId,o=[];return e.forEach((function(e){var t=Ut.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),o=o.concat(t)})),o}(d,h,u),n=function(e,t,i){var n,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0)&&6==(31&e[r])){var l=e.subarray(r+1,r+1+a),c=Rt(r,t);n={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:It(l),trackId:i},c?(n.pts=c.pts,n.dts=c.dts,s=c):(n.pts=s.pts,n.dts=s.dts),u.push(n)}return u}(a,i,l),r[l]||(r[l]=[]),r[l]=r[l].concat(n))})),r},Bt=function(){var e,t,i,n,r,a=!1;this.isInitialized=function(){return a},this.init=function(){e=new Dt,a=!0,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))i=a[0],n=s[i];else if(!i||!n)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return o=function(e,t,i){return t?{seiNals:Mt(e,t)[t],timescale:i}:null}(e,i,n),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},Nt={generator:X,probe:$,Transmuxer:Et.Transmuxer,AudioSegmentStream:Et.AudioSegmentStream,VideoSegmentStream:Et.VideoSegmentStream,CaptionParser:Bt},jt=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Ft=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=i||{},this.self=t,this.init()}return jt(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Nt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.captionStream&&t.captionStream.on("data",(function(t){e.postMessage({action:"caption",data:t})})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})}))}(this.self,this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(e){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]),e}(),Vt=new function(e){e.onmessage=function(t){"init"===t.data.action&&t.data.options?this.messageHandlers=new Ft(e,t.data.options):(this.messageHandlers||(this.messageHandlers=new Ft(e)),t.data&&t.data.action&&"init"!==t.data.action&&this.messageHandlers[t.data.action]&&this.messageHandlers[t.data.action](t.data))}}(i)}()})),Js={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},Zs=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}))}))},eo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={codecCount:0},i=void 0;return t.codecCount=e.split(",").length,t.codecCount=t.codecCount||2,(i=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(e))&&(t.videoCodec=i[2],t.videoObjectTypeIndicator=i[3]),t.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),t.audioProfile=t.audioProfile&&t.audioProfile[2],t},to=function(e,t,i){return e+"/"+t+'; codecs="'+i.filter((function(e){return!!e})).join(", ")+'"'},io=function(e,t){var i=function(e){return e.segments&&e.segments.length&&e.segments[0].map?"mp4":"mp2t"}(t),n=function(e){var t=e.attributes||{};return t.CODECS?eo(t.CODECS):Js}(t),r=t.attributes||{},a=!0,s=!1;if(!t)return[];if(e.mediaGroups.AUDIO&&r.AUDIO){var o=e.mediaGroups.AUDIO[r.AUDIO];if(o)for(var u in s=!0,a=!1,o)if(!o[u].uri&&!o[u].playlists){a=!0;break}}s&&!n.audioProfile&&(a||(n.audioProfile=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return eo(r.playlists[0].attributes.CODECS).audioProfile}return null}(e,r.AUDIO)),n.audioProfile||(Ma.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),n.audioProfile=Js.audioProfile));var l={};n.videoCodec&&(l.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(l.audio="mp4a.40."+n.audioProfile);var c=to("audio",i,[l.audio]),h=to("video",i,[l.video]),d=to("video",i,[l.video,l.audio]);return s?!a&&l.video?[h,c]:a||l.video?[d,c]:[c,c]:l.video?[d]:[c]},no=function(e){return/mp4a\.\d+.\d+/i.test(e)},ro=function(e){return/avc1\.[\da-f]+/i.test(e)},ao=function(e,t,i){if(null==t||!e.length)return[];var n=Math.ceil(9e4*(t-i+3)),r=void 0;for(r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)},so=function(e){function t(e,i){Fa(this,t);var n=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Ma.EventTarget));n.timestampOffset_=0,n.pendingBuffers_=[],n.bufferUpdating_=!1,n.mediaSource_=e,n.codecs_=i,n.audioCodec_=null,n.videoCodec_=null,n.audioDisabled_=!1,n.appendAudioInitSegment_=!0,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=Ma.browser.IE_VERSION>=11;var r={remux:!1,alignGopsAtEnd:n.safeAppend_};return n.codecs_.forEach((function(e){no(e)?n.audioCodec_=e:ro(e)&&(n.videoCodec_=e)})),n.transmuxer_=new Qs,n.transmuxer_.postMessage({action:"init",options:r}),n.transmuxer_.onmessage=function(e){return"data"===e.data.action?n.data_(e):"done"===e.data.action?n.done_(e):"gopInfo"===e.data.action?n.appendGopInfo_(e):void 0},Object.defineProperty(n,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"==typeof e&&e>=0&&(this.timestampOffset_=e,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e}))}}),Object.defineProperty(n,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=e),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=e)}}),Object.defineProperty(n,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(n,"buffered",{get:function(){return function(e,t,i){var n=null,r=null,a=0,s=[],o=[];if(!e&&!t)return Ma.createTimeRange();if(!e)return t.buffered;if(!t)return e.buffered;if(i)return e.buffered;if(0===e.buffered.length&&0===t.buffered.length)return Ma.createTimeRange();for(var u=e.buffered,l=t.buffered,c=u.length;c--;)s.push({time:u.start(c),type:"start"}),s.push({time:u.end(c),type:"end"});for(c=l.length;c--;)s.push({time:l.start(c),type:"start"}),s.push({time:l.end(c),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),c=0;c<s.length;c++)"start"===s[c].type?2==++a&&(n=s[c].time):"end"===s[c].type&&1==--a&&(r=s[c].time),null!==n&&null!==r&&(o.push([n,r]),n=null,r=null);return Ma.createTimeRanges(o)}(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),n}return qa(t,e),Va(t,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength),t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength),function(e,t,i){var n=t.player_;if(i.captions&&i.captions.length)for(var r in e.inbandTextTracks_||(e.inbandTextTracks_={}),i.captionStreams)if(!e.inbandTextTracks_[r]){n.tech_.trigger({type:"usage",name:"hls-608"});var a=n.textTracks().getTrackById(r);e.inbandTextTracks_[r]=a||n.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}i.metadata&&i.metadata.length&&!e.metadataTrack_&&(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)}(this,this.mediaSource_,t),this.pendingBuffers_.push(t)}},{key:"done_",value:function(e){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"createRealSourceBuffers_",value:function(){var e=this,t=["audio","video"];t.forEach((function(i){if(e[i+"Codec_"]&&!e[i+"Buffer_"]){var n=null;if(e.mediaSource_[i+"Buffer_"])(n=e.mediaSource_[i+"Buffer_"]).updating=!1;else{var r=i+'/mp4;codecs="'+e[i+"Codec_"]+'"';n=function(e,t){var i=e.addSourceBuffer(t),n=Object.create(null);n.updating=!1,n.realBuffer_=i;var r=function(e){"function"==typeof i[e]?n[e]=function(){return i[e].apply(i,arguments)}:void 0===n[e]&&Object.defineProperty(n,e,{get:function(){return i[e]},set:function(t){return i[e]=t}})};for(var a in i)r(a);return n}(e.mediaSource_.nativeMediaSource_,r),e.mediaSource_[i+"Buffer_"]=n}e[i+"Buffer_"]=n,["update","updatestart","updateend"].forEach((function(r){n.addEventListener(r,(function(){if("audio"!==i||!e.audioDisabled_)return"updateend"===r&&(e[i+"Buffer_"].updating=!1),t.every((function(t){return!("audio"!==t||!e.audioDisabled_)||(i===t||!e[t+"Buffer_"]||!e[t+"Buffer_"].updating)}))?e.trigger(r):void 0}))}))}}))}},{key:"appendBuffer",value:function(e){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var t=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:ao(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(e,t),this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil(9e4*(t-n)),a=Math.ceil(9e4*(i-n)),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(e,t)),Ns(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)Ns(e,t,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};e=this.pendingBuffers_.reduce((function(e,t){var i=t.type,n=t.data,r=t.initSegment;return e[i].segments.push(n),e[i].bytes+=n.byteLength,e[i].initSegment=r,t.captions&&(e.captions=e.captions.concat(t.captions)),t.info&&(e[i].info=t.info),t.metadata&&(e.metadata=e.metadata.concat(t.metadata)),e}),e),this.videoBuffer_||this.audioBuffer_||(0===e.video.bytes&&(this.videoCodec_=null),0===e.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),e.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info}),e.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:e.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(e.audio.segments.unshift(e.audio.initSegment),e.audio.bytes+=e.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var t=!1;this.videoBuffer_&&e.video.bytes?(e.video.segments.unshift(e.video.initSegment),e.video.bytes+=e.video.initSegment.byteLength,this.concatAndAppendSegments_(e.video,this.videoBuffer_),Fs(this,e.captions,e.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(t=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(e.audio,this.audioBuffer_),this.pendingBuffers_.length=0,t&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var i=0,n=void 0;if(e.bytes){n=new Uint8Array(e.bytes),e.segments.forEach((function(e){n.set(e,i),i+=e.byteLength}));try{t.updating=!0,t.appendBuffer(n)}catch(e){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),t}(Ma.EventTarget),oo=function(e){function t(){Fa(this,t);var e=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=void 0;for(i in e.nativeMediaSource_=new(f().MediaSource),e.nativeMediaSource_)i in t.prototype||"function"!=typeof e.nativeMediaSource_[i]||(e[i]=e.nativeMediaSource_[i].bind(e.nativeMediaSource_));return e.duration_=NaN,Object.defineProperty(e,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(e){this.duration_=e,e===1/0||(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(e,"seekable",{get:function(){return this.duration_===1/0?Ma.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(e,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(e,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),e.sourceBuffers=[],e.activeSourceBuffers_=[],e.updateActiveSourceBuffers_=function(){if(e.activeSourceBuffers_.length=0,1===e.sourceBuffers.length){var t=e.sourceBuffers[0];return t.appendAudioInitSegment_=!0,t.audioDisabled_=!t.audioCodec_,void e.activeSourceBuffers_.push(t)}for(var i=!1,n=!0,r=0;r<e.player_.audioTracks().length;r++){var a=e.player_.audioTracks()[r];if(a.enabled&&"main"!==a.kind){i=!0,n=!1;break}}e.sourceBuffers.forEach((function(t,r){if(t.appendAudioInitSegment_=!0,t.videoCodec_&&t.audioCodec_)t.audioDisabled_=i;else if(t.videoCodec_&&!t.audioCodec_)t.audioDisabled_=!0,n=!1;else if(!t.videoCodec_&&t.audioCodec_&&(t.audioDisabled_=r?n:!n,t.audioDisabled_))return;e.activeSourceBuffers_.push(t)}))},e.onPlayerMediachange_=function(){e.sourceBuffers.forEach((function(e){e.appendAudioInitSegment_=!0}))},e.onHlsReset_=function(){e.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.postMessage({action:"resetCaptions"})}))},e.onHlsSegmentTimeMapping_=function(t){e.sourceBuffers.forEach((function(e){return e.timeMapping_=t.mapping}))},["sourceopen","sourceclose","sourceended"].forEach((function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))}),e),e.on("sourceopen",(function(t){var i=C().querySelector('[src="'+e.url_+'"]');i&&(e.player_=Ma(i.parentNode),e.player_&&(e.player_.tech_.on("hls-reset",e.onHlsReset_),e.player_.tech_.on("hls-segment-time-mapping",e.onHlsSegmentTimeMapping_),e.player_.audioTracks&&e.player_.audioTracks()&&(e.player_.audioTracks().on("change",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("addtrack",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("removetrack",e.updateActiveSourceBuffers_)),e.player_.on("mediachange",e.onPlayerMediachange_)))})),e.on("sourceended",(function(t){for(var i=js(e.duration),n=0;n<e.sourceBuffers.length;n++){var r=e.sourceBuffers[n],a=r.metadataTrack_&&r.metadataTrack_.cues;a&&a.length&&(a[a.length-1].endTime=i)}})),e.on("sourceclose",(function(e){this.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.terminate()})),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_&&this.player_.tech_.el_&&(this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))})),e}return qa(t,e),Va(t,[{key:"addSeekableRange_",value:function(e,t){var i=void 0;if(this.duration!==1/0)throw(i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",i.code=11,i;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t=void 0,i=function(e){var t={type:"",parameters:{}},i=e.trim().split(";");return t.type=i.shift().trim(),i.forEach((function(e){var i=e.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),r=i[1].replace(/"/g,"").trim();t.parameters[n]=r}})),t}(e);if(/^(video|audio)\/mp2t$/i.test(i.type)){var n=[];i.parameters&&i.parameters.codecs&&(n=i.parameters.codecs.split(","),n=(n=Zs(n)).filter((function(e){return no(e)||ro(e)}))),0===n.length&&(n=["avc1.4d400d","mp4a.40.2"]),t=new so(this,n),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),t.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else t=this.nativeMediaSource_.addSourceBuffer(e);return this.sourceBuffers.push(t),t}}]),t}(Ma.EventTarget),uo=0;Ma.mediaSources={};var lo=function(e,t){var i=Ma.mediaSources[e];if(!i)throw new Error("Media Source not found (Video.js)");i.trigger({type:"sourceopen",swfId:t})},co=function(){return!!f().MediaSource&&!!f().MediaSource.isTypeSupported&&f().MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},ho=function(){if(this.MediaSource={open:lo,supportsNativeMediaSources:co},co())return new oo;throw new Error("Cannot use create a virtual MediaSource for this video")};ho.open=lo,ho.supportsNativeMediaSources=co;var po={createObjectURL:function(e){var t=void 0;return e instanceof oo?(t=f().URL.createObjectURL(e.nativeMediaSource_),e.url_=t,t):e instanceof oo?(t="blob:vjs-media-source/"+uo,uo++,Ma.mediaSources[t]=e,t):(t=f().URL.createObjectURL(e),e.url_=t,t)}};Ma.MediaSource=ho,Ma.URL=po;var fo=Ma.EventTarget,mo=Ma.mergeOptions,go=function(e,t){for(var i=mo(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),n=0;n<t.playlists.length;n++){var r=Ka(i,t.playlists[n]);r&&(i=r)}return $a(t,(function(e,t,n,r){if(e.playlists&&e.playlists.length){var a=e.playlists[0].uri,s=Ka(i,e.playlists[0]);s&&((i=s).mediaGroups[t][n][r].playlists[0]=i.playlists[a])}})),i},yo=function(e){function t(e,i,n,r){Fa(this,t);var a=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(a.hls_=i,a.withCredentials=n,!e)throw new Error("A non-empty playlist URL or playlist is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_()})),"string"==typeof e?(a.srcUrl=e,a.state="HAVE_NOTHING",za(a)):(a.masterPlaylistLoader_=r,a.state="HAVE_METADATA",a.started=!0,a.media(e),f().setTimeout((function(){a.trigger("loadedmetadata")}),0),a)}return qa(t,e),Va(t,[{key:"dispose",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var t=this.state;if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var i=!this.media_||e.uri!==this.media_.uri;this.state="HAVE_METADATA",i&&(this.media_&&this.trigger("mediachanging"),this.media_=e,this.refreshMedia_(),"HAVE_MASTER"!==t&&this.trigger("mediachange"))}},{key:"pause",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(e){var t=this;f().clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f().setTimeout((function(){return t.load()}),n)}else this.started?this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var e=pe(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_});e.uri=this.srcUrl;for(var t=0;t<e.playlists.length;t++){var i="placeholder-uri-"+t;e.playlists[t].uri=i,e.playlists[i]=e.playlists[t]}return $a(e,(function(t,i,n,r){if(t.playlists&&t.playlists.length){var a="placeholder-uri-"+i+"-"+n+"-"+r;t.playlists[0].uri=a,e.playlists[a]=t.playlists[0]}})),Qa(e),Ja(e),e}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"DASH playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?e.masterLoaded_=Date.parse(i.responseHeaders.date):e.masterLoaded_=Date.now(),e.syncClientServerClock_(e.onClientServerClockSync_.bind(e))}}))}},{key:"syncClientServerClock_",value:function(e){var t=this,i=fe(this.masterXml_);return null===i?(this.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.clientOffset_=i.value-Date.now(),e()):void(this.request=this.hls_.xhr({uri:ja(this.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.clientOffset_=t.masterLoaded_-Date.now(),e();var a=void 0;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.clientOffset_=a-Date.now(),e()}})))}},{key:"onClientServerClockSync_",value:function(){var e=this;this.master=this.parseMasterXml(),this.state="HAVE_MASTER",this.trigger("loadedplaylist"),this.media_||this.media(this.master.playlists[0]),f().setTimeout((function(){e.trigger("loadedmetadata")}),0),this.master.minimumUpdatePeriod&&f().setTimeout((function(){e.trigger("minimumUpdatePeriod")}),this.master.minimumUpdatePeriod)}},{key:"refreshXml_",value:function(){var e=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"DASH playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.masterXml_=i.responseText;var n=e.parseMasterXml();e.master=go(e.master,n),f().setTimeout((function(){e.trigger("minimumUpdatePeriod")}),e.master.minimumUpdatePeriod)}}))}},{key:"refreshMedia_",value:function(){var e=this,t=void 0,i=void 0;this.masterPlaylistLoader_?(t=this.masterPlaylistLoader_.master,i=this.masterPlaylistLoader_.parseMasterXml()):(t=this.master,i=this.parseMasterXml());var n=go(t,i);n?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=n:this.master=n,this.media_=n.playlists[this.media_.uri]):this.trigger("playlistunchanged"),this.media().endList||(this.mediaUpdateTimeout=f().setTimeout((function(){e.trigger("mediaupdatetimeout")}),Za(this.media(),!!n))),this.trigger("loadedplaylist")}}]),t}(fo),vo=function(e){return Ma.log.debug?Ma.log.debug.bind(Ma,"VHS:",e+" >"):function(){}};function _o(){}var bo=function(){function e(t,i,n,r){Fa(this,e),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,this.type_=n,this.mimeType_=i,this.logger_=vo("SourceUpdater["+n+"]["+i+"]"),"closed"===t.readyState?t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,i,r)):this.createSourceBuffer_(i,r)}return Va(e,[{key:"createSourceBuffer_",value:function(e,t){var i=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e),this.logger_("created SourceBuffer"),t&&(t.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?t.on("sourcebufferadded",(function(){i.start_()})):this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0,this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null,e.logger_("buffered ["+Ms(e.buffered())+"]"),t&&t(),e.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(e){var t=this;this.processedAppend_&&this.queueCallback_((function(){t.sourceBuffer_.abort()}),e)}},{key:"appendBuffer",value:function(e,t){var i=this;this.processedAppend_=!0,this.queueCallback_((function(){i.sourceBuffer_.appendBuffer(e)}),t)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:Ma.createTimeRanges()}},{key:"remove",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_o;this.processedAppend_&&this.queueCallback_((function(){i.logger_("remove ["+e+" => "+t+"]"),i.sourceBuffer_.remove(e,t)}),n)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(e){var t=this;return void 0!==e&&(this.queueCallback_((function(){t.sourceBuffer_.timestampOffset=e})),this.timestampOffset_=e),this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]),this.runCallback_()}},{key:"runCallback_",value:function(){var e=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(e=this.callbacks_.shift(),this.pendingCallback_=e[1],e[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()}}]),e}(),To={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},So=2,ko=-101,wo=-102,Co=function(e){var t,i,n={};return e.byterange&&(n.Range=(t=e.byterange,i=t.offset+t.length-1,"bytes="+t.offset+"-"+i)),n},Eo=function(e){e.forEach((function(e){e.abort()}))},Ao=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:ko,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:wo,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:So,xhr:t}:null},Lo=function(e,t,i){var n=0,r=!1;return function(a,s){if(!r)return a?(r=!0,Eo(e),i(a,s)):(n+=1)===e.length?(s.endOfAllRequests=Date.now(),s.encryptedBytes?function(e,t,i){e.addEventListener("message",(function n(r){if(r.data.source===t.requestId){e.removeEventListener("message",n);var a=r.data.decrypted;return t.bytes=new Uint8Array(a.bytes,a.byteOffset,a.byteLength),i(null,t)}})),e.postMessage(ks({source:t.requestId,encrypted:t.encryptedBytes,key:t.key.bytes,iv:t.key.iv}),[t.encryptedBytes.buffer,t.key.bytes.buffer])}(t,s,i):i(null,s)):void 0}},Oo=function(e,t){return function(i){var n,r,a;return e.stats=Ma.mergeOptions(e.stats,(r=(n=i).target,(a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-r.requestTime||0}).bytesReceived=n.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)}},Po=function(e,t,i,n,r,a,s){var o=[],u=Lo(o,i,s);if(r.key){var l=Ma.mergeOptions(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),c=function(e,t){return function(i,n){var r=n.response,a=Ao(i,n);if(a)return t(a,e);if(16!==r.byteLength)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:So,xhr:n},e);var s=new DataView(r);return e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]),t(null,e)}}(r,u),h=e(l,c);o.push(h)}if(r.map&&!r.map.bytes){var d=Ma.mergeOptions(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Co(r.map)}),p=function(e,t,i){return function(n,r){var a=r.response,s=Ao(n,r);return s?i(s,e):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:So,xhr:r},e):(e.map.bytes=new Uint8Array(r.response),t.isInitialized()||t.init(),e.map.timescales=ge().timescale(e.map.bytes),e.map.videoTrackIds=ge().videoTrackIds(e.map.bytes),i(null,e))}}(r,n,u),f=e(d,p);o.push(f)}var m=Ma.mergeOptions(t,{uri:r.resolvedUri,responseType:"arraybuffer",headers:Co(r)}),g=function(e,t,i){return function(n,r){var a=r.response,s=Ao(n,r),o=void 0;return s?i(s,e):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:So,xhr:r},e):(e.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(r),e.key?e.encryptedBytes=new Uint8Array(r.response):e.bytes=new Uint8Array(r.response),e.map&&e.map.bytes&&(t.isInitialized()||t.init(),(o=t.parse(e.bytes,e.map.videoTrackIds,e.map.timescales))&&o.captions&&(e.captionStreams=o.captionStreams,e.fmp4Captions=o.captions)),i(null,e))}}(r,n,u),y=e(m,g);return y.addEventListener("progress",Oo(r,a)),o.push(y),function(){return Eo(o)}},xo=function(e,t){var i;return e&&(i=f().getComputedStyle(e))?i[t]:""},Uo=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Io=function(e,t){var i=void 0,n=void 0;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||f().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||f().Number.MAX_VALUE)},Do=function(e,t,i){if(!e||!t)return!1;var n=i===e.segments.length;return e.endList&&"open"===t.readyState&&n},Ro=function(e){return"number"==typeof e&&isFinite(e)},Mo=function(e){function t(e){Fa(this,t);var i=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=e.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.hasPlayed_=e.hasPlayed,i.currentTime_=e.currentTime,i.seekable_=e.seekable,i.seeking_=e.seeking,i.duration_=e.duration,i.mediaSource_=e.mediaSource,i.hls_=e.hls,i.loaderType_=e.loaderType,i.startingMedia_=void 0,i.segmentMetadataTrack_=e.segmentMetadataTrack,i.goalBufferLength_=e.goalBufferLength,i.sourceType_=e.sourceType,i.inbandTextTracks_=e.inbandTextTracks,i.state_="INIT",i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.mimeType_=null,i.sourceUpdater_=null,i.xhrOptions_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.captionParser_=new ye.CaptionParser,i.decrypter_=e.decrypter,i.syncController_=e.syncController,i.syncPoint_={segmentIndex:0,time:0},i.syncController_.on("syncinfoupdate",(function(){return i.trigger("syncinfoupdate")})),i.mediaSource_.addEventListener("sourceopen",(function(){return i.ended_=!1})),i.fetchAtBuffer_=!1,i.logger_=vo("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(i,"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e)}}),i}return qa(t,e),Va(t,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_(),this.captionParser_.reset()}},{key:"abort",value:function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(e){return void 0!==e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():Ma.createTimeRanges()}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ws(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,timescales:e.timescales,videoTrackIds:e.videoTrackIds}),n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new bo(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.hasPlayed_()||(e.syncInfo={mediaSequence:e.mediaSequence,time:0});var r=i?i.id:null;if(this.logger_("playlist update ["+r+" => "+e.id+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(i&&i.uri===e.uri){var a=e.mediaSequence-i.mediaSequence;this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex&&(this.mediaIndex-=a),n&&(n.mediaIndex-=a,n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,e)}else null!==this.mediaIndex&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){this.mimeType_||(this.mimeType_=e,this.sourceBufferEmitter_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(e){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_(),e),this.captionParser_.clearAllCaptions(),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(e,t,i){if(this.sourceUpdater_&&this.sourceUpdater_.remove(e,t,i),Ns(e,t,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)Ns(e,t,this.inbandTextTracks_[n])}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=f().setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=f().setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(e)Do(this.playlist_,this.mediaSource_,e.mediaIndex)?this.endOfStream():(e.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&((e.timeline!==this.currentTimeline_||null!==e.startOfSegment&&e.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),e.timestampOffset=e.startOfSegment,this.captionParser_.clearAllCaptions()),this.loadSegment_(e))}}},{key:"checkBuffer_",value:function(e,t,i,n,r,a){var s=0,o=void 0;e.length&&(s=e.end(e.length-1));var u=Math.max(0,s-r);if(!t.segments.length)return null;if(u>=this.goalBufferLength_())return null;if(!n&&u>=1)return null;if(null===a)return i=this.getSyncSegmentCandidate_(t),this.generateSegmentInfo_(t,i,null,!0);if(null!==i){var l=t.segments[i];return o=l&&l.end?l.end:s,this.generateSegmentInfo_(t,i+1,o,!1)}if(this.fetchAtBuffer_){var c=gs.getMediaInfoForTime(t,s,a.segmentIndex,a.time);i=c.mediaIndex,o=c.startTime}else{var h=gs.getMediaInfoForTime(t,r,a.segmentIndex,a.time);i=h.mediaIndex,o=h.startTime}return this.generateSegmentInfo_(t,i,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_)return 0;var i=e.segments.map((function(e,t){return{timeline:e.timeline,segmentIndex:t}})).filter((function(e){return e.timeline===t.currentTimeline_}));return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,i,n){if(t<0||t>=e.segments.length)return null;var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:i,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return!1;var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=gs.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),a=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=a)return!1;var s=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!gs.isIncompatible(e)})),c=l.filter(gs.isEnabled);c.length||(c=l.filter((function(e){return!gs.isDisabled(e)})));var h=c.filter(gs.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var t=u.getSyncPoint(e,r,o,i)?1:2;return{playlist:e,rebufferingImpact:gs.estimateSegmentRequestTime(a,n,e)*t-s}})),d=h.filter((function(e){return e.rebufferingImpact<=0}));return Uo(d,(function(e,t){return Io(t.playlist,e.playlist)})),d.length?d[0]:(Uo(h,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),h[0]||null)}({master:this.hls_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a-s.rebufferingImpact,u=.5;return a<=xs&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u?!1:(this.bandwidth=s.playlist.attributes.BANDWIDTH*To.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(e,t){this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(t.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),e.abortRequests=Po(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(e){var t=function(e,t,i){var n=void 0;return n=e.length&&e.start(0)>0&&e.start(0)<t?e.start(0):t-30,Math.min(n,t-i)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,i={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};if(t.key){var n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key={resolvedUri:t.key.resolvedUri,iv:n}}return t.map&&(i.map=this.initSegment(t.map)),i}},{key:"segmentRequestFinished_",value:function(e,t){if(this.mediaRequests+=1,t.stats&&(this.mediaBytesTransferred+=t.stats.bytesReceived,this.mediaTransferDuration+=t.stats.roundTripTime),this.pendingSegment_){if(t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===wo?void(this.mediaRequestsAborted+=1):(this.pause(),e.code===ko?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));this.bandwidth=t.stats.bandwidth,this.roundTrip=t.stats.roundTripTime,t.map&&(t.map=this.initSegment(t.map,!0)),this.processSegmentResponse_(t)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(e){var t=this.pendingSegment_;t.bytes=e.bytes,e.map&&(t.segment.map.bytes=e.map.bytes),t.endOfAllRequests=e.endOfAllRequests,e.fmp4Captions&&(!function(e,t,i){for(var n in i)if(!e[n]){t.trigger({type:"usage",name:"hls-608"});var r=t.textTracks().getTrackById(n);e[n]=r||t.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track}}(this.inbandTextTracks_,this.hls_.tech_,e.captionStreams),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=window.WebKitDataCue||window.VTTCue;i.forEach((function(e){var i=e.stream,a=e.startTime,s=e.endTime;t[i]&&(a+=n,s+=n,t[i].addCue(new r(a,s,e.text)))}))}}({inbandTextTracks:this.inbandTextTracks_,captionArray:e.fmp4Captions,timestampOffset:0}),this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_){var t=this.pendingSegment_,i=t.segment,n=this.syncController_.probeSegmentInfo(t);void 0===this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r,a,s,o=(r=this.loaderType_,a=this.startingMedia_,s=n,"main"===r&&a&&s?s.containsAudio||s.containsVideo?a.containsVideo&&!s.containsVideo?"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.":!a.containsVideo&&s.containsVideo?"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:"Neither audio nor video found in segment.":null);if(o)return this.error({message:o,blacklistDuration:1/0}),void this.trigger("error");if(t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(t.timestampOffset),this.trigger("timestampoffset"));var u=this.syncController_.mappingForTimeline(t.timeline);if(null!==u&&this.trigger({type:"segmenttimemapping",mapping:u}),this.state="APPENDING",i.map){var l=ws(i.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==l){var c=this.initSegment(i.map);this.sourceUpdater_.appendBuffer(c.bytes,(function(){e.activeInitSegmentId_=l}))}}t.byteLength=t.bytes.byteLength,"number"==typeof i.start&&"number"==typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.logger_(function(e){var t=e.segment,i=t.start,n=t.end,r=e.playlist,a=r.mediaSequence,s=r.id,o=r.segments,u=void 0===o?[]:o,l=e.mediaIndex,c=e.timeline;return["appending ["+l+"] of ["+a+", "+(a+u.length)+"] from playlist ["+s+"]","["+i+" => "+n+"] in timeline ["+c+"]"].join(" ")}(t)),this.sourceUpdater_.appendBuffer(t.bytes,this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_,t=e.segment,i=null!==this.mediaIndex;(this.pendingSegment_=null,this.recordThroughput_(e),this.addSegmentMetadataCue_(e),this.state="READY",this.mediaIndex=e.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration)?this.resetEverything():(i&&this.trigger("bandwidthupdate"),this.trigger("progress"),Do(e.playlist,this.mediaSource_,e.mediaIndex+1)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Ro(i)&&Ro(n)){Ns(i,n,this.segmentMetadataTrack_);var r=f().WebKitDataCue||f().VTTCue,a={dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.uri,start:i,end:n},s=new r(i,n,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}}}]),t}(Ma.EventTarget),Bo=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},No=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),jo=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Fa(this,t);var n=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));return n.mediaSource_=null,n.subtitlesTrack_=null,n}return qa(t,e),Va(t,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return Ma.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Ma.createTimeRanges([[t,i]])}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ws(e),n=this.initSegments_[i];if(t&&!n&&e.bytes){var r=No.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(No,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){Ns(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(t=this.skipEmptySegments_(t)){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}}},{key:"skipEmptySegments_",value:function(e){for(;e&&e.segment.empty;)e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest);return e}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var t=this.pendingSegment_,i=t.segment;if("function"!=typeof f().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=function(){e.handleSegment_()};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",n),void this.subtitlesTrack_.tech_.one("vttjserror",(function(){e.subtitlesTrack_.tech_.off("vttjsloaded",n),e.error({message:"Error loading vtt.js"}),e.state="READY",e.pause(),e.trigger("error")}))}i.requested=!0;try{this.parseVTTCues_(t)}catch(e){return this.error({message:e.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(t,this.syncController_.timelines[t.timeline],this.playlist_),t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");t.byteLength=t.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,t.cues.length&&this.remove(t.cues[0].endTime,t.cues[t.cues.length-1].endTime),t.cues.forEach((function(t){e.subtitlesTrack_.addCue(t)})),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(e){var t=void 0,i=!1;"function"==typeof f().TextDecoder?t=new(f().TextDecoder)("utf8"):(t=f().WebVTT.StringDecoder(),i=!0);var n=new(f().WebVTT.Parser)(f(),f().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){return e.timestampmap=t},n.onparsingerror=function(e){Ma.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=Bo(r)),n.parse(r)}var a=e.bytes;i&&(a=Bo(a)),n.parse(a),n.flush()}},{key:"updateTimeMapping_",value:function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/9e4-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0}}]),t}(Mo),Fo=function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},Vo=_e().inspect,Ho=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0}}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!e.datetimeToDisplayTime)return null;var a=t.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.dateTimeObject){var c=l.dateTimeObject.getTime()/1e3+e.datetimeToDisplayTime,h=Math.abs(r-c);if(null!==o&&o<h)break;o=h,s={time:c,segmentIndex:u}}}return s}},{name:"Segment",run:function(e,t,i,n,r){var a=t.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.timeline===n&&void 0!==l.start){var c=Math.abs(r-l.start);if(null!==o&&o<c)break;(!s||null===o||o>=c)&&(o=c,s={time:l.start,segmentIndex:u})}}return s}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var h=Math.abs(r-c.time);if(null!==s&&s<h)break;(!a||null===s||s>=h)&&(s=h,a={time:c.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence}:null}}],qo=function(e){function t(){Fa(this,t);var e=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.inspectCache_=void 0,e.timelines=[],e.discontinuities=[],e.datetimeToDisplayTime=null,e.logger_=vo("SyncController"),e}return qa(t,e),Va(t,[{key:"getSyncPoint",value:function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+rs(e,n.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,i,n){for(var r=[],a=0;a<Ho.length;a++){var s=Ho[a],o=s.run(this,e,t,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r}},{key:"selectSyncPoint_",value:function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<n&&(n=s,i=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+"]"),i}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var i=t.mediaSequence-e.mediaSequence-1;i>=0;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){if(!this.datetimeToDisplayTime&&e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-t}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t=e.segment,i=e.playlist,n=void 0;return(n=t.map?this.probeMp4Segment_(e):this.probeTsSegment_(e))&&this.calculateSegmentTimeMapping_(e,n)&&(this.saveDiscontinuitySyncInfo_(e),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:t.start})),n}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,i=ge().timescale(t.map.bytes),n=ge().startTime(i,e.bytes);return null!==e.timestampOffset&&(e.timestampOffset-=n),{start:n,end:n+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=Vo(e.bytes,this.inspectCache_),i=void 0,n=void 0;return t?(t.video&&2===t.video.length?(this.inspectCache_=t.video[1].dts,i=t.video[0].dtsTime,n=t.video[1].dtsTime):t.audio&&2===t.audio.length&&(this.inspectCache_=t.audio[1].dts,i=t.audio[0].dtsTime,n=t.audio[1].dtsTime),{start:i,end:n,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var i=e.segment,n=this.timelines[e.timeline];if(null!==e.timestampOffset)n={time:e.startOfSegment,mapping:e.startOfSegment-t.start},this.timelines[e.timeline]=n,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+n.time+"] [mapping: "+n.mapping+"]"),i.start=e.startOfSegment,i.end=t.end+n.mapping;else{if(!n)return!1;i.start=t.start+n.mapping,i.end=t.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r=t.discontinuityStarts[n],a=t.discontinuitySequence+n+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?i.start-rs(t,e.mediaIndex,r):i.end+rs(t,e.mediaIndex+1,r),this.discontinuities[a]={time:u,accuracy:o}}}}}]),t}(Ma.EventTarget),zo=new Gs("./decrypter-worker.worker.js",(function(e,t){var i=this;!function(){var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),n=null,r=function(){function t(i){e(this,t),n||(n=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!n[s];s^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),i[a]=i[a].slice(0);return e}()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];var r=void 0,a=void 0,s=void 0,o=void 0,u=void 0,l=this._tables[0][4],c=this._tables[1],h=i.length,d=1;if(4!==h&&6!==h&&8!==h)throw new Error("Invalid aes key size");for(o=i.slice(0),u=[],this._key=[o,u],r=h;r<4*h+28;r++)s=o[r-1],(r%h==0||8===h&&r%h==4)&&(s=l[s>>>24]<<24^l[s>>16&255]<<16^l[s>>8&255]<<8^l[255&s],r%h==0&&(s=s<<8^s>>>24^d<<24,d=d<<1^283*(d>>7))),o[r]=o[r-h]^s;for(a=0;r;a++,r--)s=o[3&a?r:r-4],u[a]=r<=4||a<4?s:c[0][l[s>>>24]]^c[1][l[s>>16&255]]^c[2][l[s>>8&255]]^c[3][l[255&s]]}return t.prototype.decrypt=function(e,t,i,n,r,a){var s=this._key[1],o=e^s[0],u=n^s[1],l=i^s[2],c=t^s[3],h=void 0,d=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=v[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[g+1],p=v[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[g+2],c=v[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[g++],h=o,o=u,u=l,l=c,c=h},t}(),a=function(){function t(){e(this,t),this.listeners={}}return t.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},t.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.prototype.dispose=function(){this.listeners={}},t.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},t}(),s=function(t){function i(){e(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,t.call(this,a));return n.jobs=[],n.delay=1,n.timeout_=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,t),i.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},i}(a),o=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},u=function(){function i(t,n,r,a){e(this,i);var u=i.STEP,l=new Int32Array(t.buffer),c=new Uint8Array(t.byteLength),h=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+u),n,r,c)),h=u;h<l.length;h+=u)r=new Uint32Array([o(l[h-4]),o(l[h-3]),o(l[h-2]),o(l[h-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+u),n,r,c));this.asyncStream_.push((function(){var e;a(null,(e=c).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return i.prototype.decryptChunk_=function(e,t,i,n){return function(){var a=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new r(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),u=new Int32Array(s.buffer),l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=void 0;for(l=i[0],c=i[1],h=i[2],d=i[3],y=0;y<n.length;y+=4)p=o(n[y]),f=o(n[y+1]),m=o(n[y+2]),g=o(n[y+3]),a.decrypt(p,f,m,g,u,y),u[y]=o(u[y]^l),u[y+1]=o(u[y+1]^c),u[y+2]=o(u[y+2]^h),u[y+3]=o(u[y+3]^d),l=p,c=f,h=m,d=g;return s}(e,t,i);n.set(a,e.byteOffset)}},t(i,null,[{key:"STEP",get:function(){return 32e3}}]),i}(),l=new function(e){e.onmessage=function(t){var i=t.data,n=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength),r=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4),a=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new u(n,r,a,(function(t,n){var r,a;e.postMessage((r={source:i.source,decrypted:n},a={},Object.keys(r).forEach((function(e){var t=r[e];ArrayBuffer.isView(t)?a[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:a[e]=t})),a),[n.buffer])}))}}(i)}()})),Wo=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Go=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Xo=function(e,t){t.activePlaylistLoader=e,e.load()},Yo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Go(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Ma.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Ma.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Go(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},$o={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Yo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Yo[e](e,i))}},Ko=function(e,t){return function(i){return i.attributes[e]===t}},Qo=function(e){return function(t){return t.resolvedUri===e}},Jo={AUDIO:function(e,t){var i=t.hls,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions.withCredentials,s=t.master,o=s.mediaGroups,u=s.playlists,l=t.mediaTypes[e],c=l.groups,h=l.tracks,d=t.masterPlaylistLoader;for(var p in o[e]&&0!==Object.keys(o[e]).length||(o[e]={main:{default:{default:!0}}}),o[e]){c[p]||(c[p]=[]);var f=u.filter(Ko(e,p));for(var m in o[e][p]){var g=o[e][p][m];f.filter(Qo(g.resolvedUri)).length&&delete g.resolvedUri;var y=void 0;if(y=g.resolvedUri?new es(g.resolvedUri,i,a):g.playlists&&"dash"===n?new yo(g.playlists[0],i,a,d):null,g=Ma.mergeOptions({id:m,playlistLoader:y},g),$o[e](e,g.playlistLoader,t),c[p].push(g),void 0===h[m]){var v=new Ma.AudioTrack({id:m,kind:Wo(g),enabled:!1,language:g.language,default:g.default,label:m});h[m]=v}}}r.on("error",Yo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.hls,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions.withCredentials,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,h=t.masterPlaylistLoader;for(var d in o[e])for(var p in l[d]||(l[d]=[]),o[e][d])if(!o[e][d][p].forced){var f=o[e][d][p],m=void 0;if("hls"===r?m=new es(f.resolvedUri,n,s):"dash"===r&&(m=new yo(f.playlists[0],n,s,h)),f=Ma.mergeOptions({id:p,playlistLoader:m},f),$o[e](e,f.playlistLoader,t),l[d].push(f),void 0===c[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",Yo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(l.instreamId.match(/CC\d/)&&(a[o].push(Ma.mergeOptions({id:u},l)),void 0===s[u])){var c=i.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default&&l.autoselect,language:l.language,label:u},!1).track;s[u]=c}}}},Zo={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if("showing"===i[n].mode)return i[n];return null}}},eu=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){Jo[t](t,e)}));var t=e.mediaTypes,i=e.masterPlaylistLoader,n=e.tech,r=e.hls;["AUDIO","SUBTITLES"].forEach((function(i){t[i].activeGroup=function(e,t){return function(i){var n=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=n.media();if(!a)return null;var s=null;return a.attributes[e]&&(s=r[a.attributes[e]]),s=s||r.main,void 0===i?s:null===i?null:s.filter((function(e){return e.id===i.id}))[0]||null}}(i,e),t[i].activeTrack=Zo[i](i,e),t[i].onGroupChanged=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Go(n,a),o&&(o.playlistLoader?(n.resyncLoader(),Xo(o.playlistLoader,a)):u&&r.resetEverything())}}(i,e),t[i].onTrackChanged=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Go(n,a),o&&(o.playlistLoader?u!==o.playlistLoader?(n.track&&n.track(s),n.resetEverything(),Xo(o.playlistLoader,a)):Xo(o.playlistLoader,a):r.resetEverything())}}(i,e)}));var a=t.AUDIO.activeGroup(),s=(a.filter((function(e){return e.default}))[0]||a[0]).id;t.AUDIO.tracks[s].enabled=!0,t.AUDIO.onTrackChanged(),i.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))}));var o=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})};for(var u in n.audioTracks().addEventListener("change",o),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){n.audioTracks().removeEventListener("change",o),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[u])},tu=void 0,iu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],nu=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},ru=function(e){function t(e){Fa(this,t);var i,n=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=e.url,a=e.withCredentials,s=e.tech,o=e.bandwidth,u=e.externHls,l=e.useCueTags,c=e.blacklistDuration,h=e.enableLowInitialPlaylist,d=e.sourceType,p=e.seekTo;if(!r)throw new Error("A non-empty playlist URL is required");tu=u,n.withCredentials=a,n.tech_=s,n.hls_=s.hls,n.seekTo_=p,n.sourceType_=d,n.useCueTags_=l,n.blacklistDuration=c,n.enableLowInitialPlaylist=h,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:n.withCredentials,timeout:null},n.mediaTypes_=(i={},["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(e){i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:_o,activeTrack:_o,onGroupChanged:_o,onTrackChanged:_o}})),i),n.mediaSource=new Ma.MediaSource,n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_.bind(n)),n.seekable_=Ma.createTimeRanges(),n.hasPlayed_=function(){return!1},n.syncController_=new qo(e),n.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new zo,n.inbandTextTracks_={};var f={hls:n.hls_,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.mediaSource.duration},hasPlayed:function(){return n.hasPlayed_()},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:o,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_};return n.masterPlaylistLoader_="dash"===n.sourceType_?new yo(r,n.hls_,n.withCredentials):new es(r,n.hls_,n.withCredentials),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new Mo(Ma.mergeOptions(f,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),e),n.audioSegmentLoader_=new Mo(Ma.mergeOptions(f,{loaderType:"audio"}),e),n.subtitleSegmentLoader_=new jo(Ma.mergeOptions(f,{loaderType:"vtt"}),e),n.setupSegmentLoaderListeners_(),iu.forEach((function(e){n[e+"_"]=nu.bind(n,e)})),n.logger_=vo("MPC"),n.masterPlaylistLoader_.load(),n}return qa(t,e),Va(t,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;ms(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),eu({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,hls:e.hls_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t);try{e.setupSourceBuffers_()}catch(t){return Ma.log.warn("Failed to create SourceBuffers",t),e.mediaSource.endOfStream("decode")}e.setupFirstPlay(),e.trigger("selectedinitialmedia")})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){var t=e.masterPlaylistLoader_.media();if(!t){e.excludeUnsupportedVariants_();var i=void 0;return e.enableLowInitialPlaylist&&(i=e.selectInitialPlaylist()),i||(i=e.selectPlaylist()),e.initialMedia_=i,void e.masterPlaylistLoader_.media(e.initialMedia_)}if(e.useCueTags_&&e.updateAdCues_(t),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.updateDuration(),e.tech_.paused()||(e.mainSegmentLoader_.load(),e.audioSegmentLoader_&&e.audioSegmentLoader_.load()),!t.endList){var n=function(){var t=e.seekable();0!==t.length&&e.mediaSource.addSeekableRange_(t.start(0),t.end(0))};if(e.duration()!==1/0){e.tech_.one("durationchange",(function t(){e.duration()===1/0?n():e.tech_.one("durationchange",t)}))}else n()}})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;ms(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))}},{key:"triggerPresenceUsage_",value:function(e,t){var i=e.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var a in i.AUDIO)for(var s in i.AUDIO[a]){i.AUDIO[a][s].uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),tu.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),tu.Playlist.isFmp4(t)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist(),i=e.masterPlaylistLoader_.media(),n=e.tech_.buffered(),r=n.length?n.end(n.length-1)-e.tech_.currentTime():0,a=e.bufferLowWaterLine();(!i.endList||e.duration()<To.MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<i.attributes.BANDWIDTH||r>=a)&&e.masterPlaylistLoader_.media(t),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("ended",(function(){e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)})),this.mainSegmentLoader_.on("reseteverything",(function(){e.tech_.trigger("hls-reset")})),this.mainSegmentLoader_.on("segmenttimemapping",(function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})})),this.audioSegmentLoader_.on("ended",(function(){e.onEndOfStream()}))}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetEverything((function(){Ma.browser.IE_VERSION||Ma.browser.IS_EDGE?e.tech_.setCurrentTime(e.tech_.currentTime()+.04):e.tech_.setCurrentTime(e.tech_.currentTime())})))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.seekTo_(0),this.hasPlayed_()&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.seekTo_(e.end(e.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_())return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(Ma.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.seekTo_(i.end(0)),e.hasPlayed_=function(){return!0}})),!1;this.trigger("firstplay"),this.seekTo_(i.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(e){return Ma.log.warn("Failed to create Source Buffers",e),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),e&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===t)return!1;var i=tu.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-n<=Us;var a=r.end(r.length-1);return a-n<=Us&&i-a<=Us}},{key:"blacklistCurrentPlaylist",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],i=void 0,n=void 0;if(i=e.playlist||this.masterPlaylistLoader_.media(),t=t||e.blacklistDuration||this.blacklistDuration,!i){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(e){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(ps).length;return r?(Ma.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(r)):(i.excludeUntil=Date.now()+1e3*t,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),n=this.selectPlaylist(),Ma.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(n))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(e){var t=Ds(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:tu.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0,t=void 0;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var n=this.syncController_.getExpiredTime(i,this.mediaSource.duration);if(null!==n&&0!==(e=tu.Playlist.seekable(i,n)).length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(i,this.mediaSource.duration)))return;if(0===(t=tu.Playlist.seekable(i,n)).length)return}t?t.start(0)>e.end(0)||e.start(0)>t.end(0)?this.seekable_=e:this.seekable_=Ma.createTimeRanges([[t.start(0)>e.start(0)?t.start(0):e.start(0),t.end(0)<e.end(0)?t.end(0):e.end(0)]]):this.seekable_=e,this.logger_("seekable updated ["+Ms(this.seekable_)+"]"),this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){var e=this,t=this.mediaSource.duration,i=tu.Playlist.duration(this.masterPlaylistLoader_.media()),n=this.tech_.buffered(),r=function t(){e.mediaSource.duration=i,e.tech_.trigger("durationchange"),e.mediaSource.removeEventListener("sourceopen",t)};n.length>0&&(i=Math.max(i,n.end(n.length-1))),t!==i&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",r):r())}},{key:"dispose",value:function(){var e=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e,t=this.masterPlaylistLoader_.media();if(t&&"open"===this.mediaSource.readyState){if((e=io(this.masterPlaylistLoader_.master,t)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+t.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(e),this.excludeIncompatibleVariants_(t)}}},{key:"configureLoaderMimeTypes_",value:function(e){var t=e.length>1&&-1===e[0].indexOf(",")&&e[0]!==e[1]?new Ma.EventTarget:null;this.mainSegmentLoader_.mimeType(e[0],t),e[1]&&this.audioSegmentLoader_.mimeType(e[1],t)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach((function(e){var t;e.attributes.CODECS&&f().MediaSource&&f().MediaSource.isTypeSupported&&!f().MediaSource.isTypeSupported('video/mp4; codecs="'+(t=e.attributes.CODECS,t.replace(/avc1\.(\d+)\.(\d+)/i,(function(e){return Zs([e])[0]}))+'"'))&&(e.excludeUntil=1/0)}))}},{key:"excludeIncompatibleVariants_",value:function(e){var t=2,i=null,n=void 0;e.attributes.CODECS&&(n=eo(e.attributes.CODECS),i=n.videoCodec,t=n.codecCount),this.master().playlists.forEach((function(e){var n={codecCount:2,videoCodec:null};e.attributes.CODECS&&(n=eo(e.attributes.CODECS)),n.codecCount!==t&&(e.excludeUntil=1/0),n.videoCodec!==i&&(e.excludeUntil=1/0)}))}},{key:"updateAdCues_",value:function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.segments)for(var n=i,r=void 0,a=0;a<e.segments.length;a++){var s=e.segments[a];if(r||(r=Fo(t,n+s.duration/2)),r){if("cueIn"in s){r.endTime=n,r.adEndTime=n,n+=s.duration,r=null;continue}if(n<r.endTime){n+=s.duration;continue}r.endTime+=s.duration}else if("cueOut"in s&&((r=new(f().VTTCue)(n,n+s.duration,s.cueOut)).adStartTime=n,r.adEndTime=n+parseFloat(s.cueOut),t.addCue(r)),"cueOutCont"in s){var o=void 0,u=void 0,l=s.cueOutCont.split("/").map(parseFloat),c=Wa(l,2);o=c[0],u=c[1],(r=new(f().VTTCue)(n,n+s.duration,"")).adStartTime=n-o,r.adEndTime=r.adStartTime+u,t.addCue(r)}n+=s.duration}}(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=To.GOAL_BUFFER_LENGTH,i=To.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,To.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=To.BUFFER_LOW_WATER_LINE,i=To.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,To.MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,n)}}]),t}(Ma.EventTarget),au=function e(t,i,n){Fa(this,e);var r,a,s,o=t.masterPlaylistController_,u=o[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(o);if(i.attributes.RESOLUTION){var l=i.attributes.RESOLUTION;this.width=l.width,this.height=l.height}this.bandwidth=i.attributes.BANDWIDTH,this.id=n,this.enabled=(r=t.playlists,a=i.uri,s=u,function(e){var t=r.master.playlists[a],i=ds(t),n=ps(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(s(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})},su=["seeking","seeked","pause","playing","error"],ou=function(){function e(t){var i=this;Fa(this,e),this.tech_=t.tech,this.seekable=t.seekable,this.seekTo=t.seekTo,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=vo("PlaybackWatcher"),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.techWaiting_()},a=function(){return i.cancelTimer_()},s=function(){return i.fixesBadSeeks_()};this.tech_.on("seekablechanged",s),this.tech_.on("waiting",r),this.tech_.on(su,a),this.tech_.on("canplay",n),this.dispose=function(){i.logger_("dispose"),i.tech_.off("seekablechanged",s),i.tech_.off("waiting",r),i.tech_.off(su,a),i.tech_.off("canplay",n),i.checkCurrentTimeTimeout_&&f().clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}return Va(e,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&f().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=f().setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Us>=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)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking(),t=this.seekable(),i=this.tech_.currentTime(),n=void 0;e&&this.afterSeekableWindow_(t,i)&&(n=t.end(t.length-1));e&&this.beforeSeekableWindow_(t,i)&&(n=t.start(0)+Us);return void 0!==n&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Ms(t)+". Seeking to "+n+"."),this.seekTo(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Ds(t,e);return i.length&&e+3<=i.end(0)?(this.cancelTimer_(),this.seekTo(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.seekTo(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.buffered(),r=Rs(n,t);if(this.videoUnderflow_(r,n,t))return this.cancelTimer_(),this.seekTo(t),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(r.length>0){var a=r.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+a+", seeking to "+r.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,t),!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t){return!!e.length&&t>e.end(e.length-1)+Us}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-Us)}},{key:"videoUnderflow_",value:function(e,t,i){if(0===e.length){var n=this.gapFromVideoUnderflow_(t,i);if(n)return this.logger_("Encountered a gap in video from "+n.start+" to "+n.end+". Seeking to current time "+i),!0}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Rs(t,i);this.cancelTimer_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.seekTo(n.start(0)+xs),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var i=function(e){if(e.length<2)return Ma.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return Ma.createTimeRanges(t)}(e),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(t-r<4&&t-r>2)return{start:r,end:a}}return null}}]),e}(),uu={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},lu=function e(t,i){var n=0,r=0,a=Ma.mergeOptions(uu,i);t.ready((function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){if(Date.now()-n<1e3*a.errorInterval)t.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(a.getSource&&"function"==typeof a.getSource)return n=Date.now(),a.getSource.call(t,o);Ma.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}},cu=function(e){lu(this,e)};Ma.use("*",(function(e){return{setSource:function(e,t){t(null,e)},setCurrentTime:function(t){return e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(t),t},play:function(){e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(e.currentTime())}}}));var hu={PlaylistLoader:es,Playlist:gs,Decrypter:Le,AsyncStream:Ce,decrypt:Ae,utils:Es,STANDARD_PLAYLIST_SELECTOR:function(){return function(e,t,i,n,r){var a=e.playlists.map((function(e){var t,i;return t=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height,{bandwidth:e.attributes.BANDWIDTH||f().Number.MAX_VALUE,width:t,height:i,playlist:e}}));Uo(a,(function(e,t){return e.bandwidth-t.bandwidth}));var s=(a=a.filter((function(e){return!gs.isIncompatible(e.playlist)}))).filter((function(e){return gs.isEnabled(e.playlist)}));s.length||(s=a.filter((function(e){return!gs.isDisabled(e.playlist)})));var o=s.filter((function(e){return e.bandwidth*To.BANDWIDTH_VARIANCE<t})),u=o[o.length-1],l=o.filter((function(e){return e.bandwidth===u.bandwidth}))[0];if(!1===r){var c=l||s[0]||a[0];return c?c.playlist:null}var h=o.filter((function(e){return e.width&&e.height}));Uo(h,(function(e,t){return e.width-t.width}));var d=h.filter((function(e){return e.width===i&&e.height===n}));u=d[d.length-1];var p=d.filter((function(e){return e.bandwidth===u.bandwidth}))[0],m=void 0,g=void 0,y=void 0;p||(g=(m=h.filter((function(e){return e.width>i||e.height>n}))).filter((function(e){return e.width===m[0].width&&e.height===m[0].height})),u=g[g.length-1],y=g.filter((function(e){return e.bandwidth===u.bandwidth}))[0]);var v=y||p||l||s[0]||a[0];return v?v.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(xo(this.tech_.el(),"width"),10),parseInt(xo(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.master.playlists.filter(gs.isEnabled);return Uo(e,(function(e,t){return Io(e,t)})),e.filter((function(e){return eo(e.attributes.CODECS).videoCodec}))[0]||null},comparePlaylistBandwidth:Io,comparePlaylistResolution:function(e,t){var i=void 0,n=void 0;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||f().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||f().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:_s()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach((function(e){Object.defineProperty(hu,e,{get:function(){return Ma.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),To[e]},set:function(t){Ma.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Ma.log.warn("value of Hls."+e+" must be greater than or equal to 0"):To[e]=t}})}));var du="videojs-vhs",pu=function(e){if(/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e))return"hls";return/^application\/dash\+xml/i.test(e)?"dash":null},fu=function(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.uri){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};hu.canPlaySource=function(){return Ma.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var mu=function(e){if("dash"===e.options_.sourceType){var t=Ma.players[e.tech_.options_.playerId];if(t.eme){var i=function(e,t,i){if(!e)return e;var n={};for(var r in e)n[r]={audioContentType:'audio/mp4; codecs="'+i.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+t.attributes.CODECS+'"'},t.contentProtection&&t.contentProtection[r]&&t.contentProtection[r].pssh&&(n[r].pssh=t.contentProtection[r].pssh),"string"==typeof e[r]&&(n[r].url=e[r]);return Ma.mergeOptions(e,n)}(e.source_.keySystems,e.playlists.media(),e.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());i&&(t.currentSource().keySystems=i,t.eme.initializeMediaKeys&&t.eme.initializeMediaKeys())}}},gu=function(){if(!window.localStorage)return null;var e=window.localStorage.getItem(du);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};hu.supportsNativeHls=function(){var e=C().createElement("video");if(!Ma.getTech("Html5").isSupported())return!1;return["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(e.canPlayType(t))}))}(),hu.supportsNativeDash=!!Ma.getTech("Html5").isSupported()&&/maybe|probably/i.test(C().createElement("video").canPlayType("application/dash+xml")),hu.supportsTypeNatively=function(e){return"hls"===e?hu.supportsNativeHls:"dash"===e&&hu.supportsNativeDash},hu.isSupported=function(){return Ma.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var yu=function(e){function t(e,i,n){Fa(this,t);var r=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i,n.hls));if(i.options_&&i.options_.playerId){var a=Ma(i.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return Ma.log.warn("player.hls is deprecated. Use player.tech().hls instead."),i.trigger({type:"usage",name:"hls-player-access"}),r},configurable:!0}),a.vhs=r,a.dash=r,r.player_=a}if(r.tech_=i,r.source_=e,r.stats={},r.setOptions_(),r.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(C(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=C().fullscreenElement||C().webkitFullscreenElement||C().mozFullScreenElement||C().msFullscreenElement;t&&t.contains(r.tech_.el())&&r.masterPlaylistController_.smoothQualityChange_()})),r.on(r.tech_,"seeking",(function(){this.tech_.seeking()&&0===this.tech_.currentTime()&&this.tech_.player_.loop()&&this.setCurrentTime(0)})),r.on(r.tech_,"error",(function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),r.on(r.tech_,"play",r.play),r}return qa(t,e),Va(t,[{key:"setOptions_",value:function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=gu();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=To.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===To.INITIAL_BANDWIDTH,["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange"].forEach((function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function(e,t){var i=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=hu,this.options_.sourceType=pu(t),this.options_.seekTo=function(e){i.tech_.setCurrentTime(e),i.setCurrentTime(e)},this.masterPlaylistController_=new ru(this.options_),this.playbackWatcher_=new ou(Ma.mergeOptions(this.options_,{seekable:function(){return i.seekable()}})),this.masterPlaylistController_.on("error",(function(){Ma.players[i.tech_.options_.playerId].error(i.masterPlaylistController_.error)})),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):hu.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=hu.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=void 0;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set:function(){Ma.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:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return Bs(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Bs(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!window.localStorage)return!1;var t=gu();t=t?Ma.mergeOptions(t,e):e;try{window.localStorage.setItem(du,JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e,t;t=(e=i).playlists,e.representations=function(){return t.master.playlists.filter((function(e){return!ds(e)})).map((function(t,i){return new au(e,t,t.uri)}))},mu(i)})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.tech_.ready((function(){return i.setupQualityLevels_()})),this.tech_.el()&&this.tech_.src(Ma.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var e=this,t=Ma.players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),fu(t,i.playlists)})),this.playlists.on("mediachange",(function(){fu(e.qualityLevels_,e.playlists)})))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.hls&&delete this.tech_.hls,Ha(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"convertToStreamTime",value:function(e,t){return Os({playlist:this.masterPlaylistController_.media(),time:e,callback:t})}},{key:"seekToStreamTime",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return Ps({streamTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}]),t}(Ma.getComponent("Component")),vu={name:"videojs-http-streaming",VERSION:"1.5.1",canHandleSource:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ma.mergeOptions(Ma.options,t);return vu.canPlayType(e.type,i)},handleSource:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Ma.mergeOptions(Ma.options,i);return t.hls=new yu(e,t,n),t.hls.xhr=_s(),t.hls.src(e.src,e.type),t.hls},canPlayType:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ma.mergeOptions(Ma.options,t),n=i.hls.overrideNative,r=pu(e),a=r&&(!hu.supportsTypeNatively(r)||n);return a?"maybe":""}};void 0!==Ma.MediaSource&&void 0!==Ma.URL||(Ma.MediaSource=ho,Ma.URL=po),ho.supportsNativeMediaSources()&&Ma.getTech("Html5").registerSourceHandler(vu,0),Ma.HlsHandler=yu,Ma.HlsSourceHandler=vu,Ma.Hls=hu,Ma.use||Ma.registerComponent("Hls",hu),Ma.options.hls=Ma.options.hls||{},Ma.registerPlugin?Ma.registerPlugin("reloadSourceOnError",cu):Ma.plugin("reloadSourceOnError",cu);const _u=Ma},3407:(e,t,i)=>{var n=i(8908),r=e.exports={WebVTT:i(3706),VTTCue:i(2230),VTTRegion:i(3710)};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},3706:e=>{var t=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function i(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function n(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function r(){this.values=t(null)}function a(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function s(e,t,s){var o=e;function u(){var t=n(e);if(null===t)throw new i(i.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=u(),l(),"--\x3e"!==e.substr(0,3))throw new i(i.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),l(),t.endTime=u(),l(),function(e,t){var i=new r;a(e,(function(e,t){switch(e){case"region":for(var n=s.length-1;n>=0;n--)if(s[n].id===t){i.set(e,s[n].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];i.integer(e,a),i.percent(e,a)&&i.set("snapToLines",!1),i.alt(e,a,["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start","middle","end"]);break;case"position":r=t.split(","),i.percent(e,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start","middle","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical",""),t.line=i.get("line","auto"),t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align","middle"),t.position=i.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=i.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}i.prototype=t(Error.prototype),i.prototype.constructor=i,i.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var o={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},u={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},l={v:"title",lang:"lang"},c={rt:"ruby"};function h(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function r(e){return o[e]}function a(e){for(;v=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(v[0],r);return e}function s(e,t){return!c[t.localName]||c[t.localName]===e.localName}function h(t,i){var n=u[t];if(!n)return null;var r=e.document.createElement(n);r.localName=n;var a=l[t];return a&&i&&(r[a]=i.trim()),r}for(var d,p=e.document.createElement("div"),f=p,m=[];null!==(d=i());)if("<"!==d[0])f.appendChild(e.document.createTextNode(a(d)));else{if("/"===d[1]){m.length&&m[m.length-1]===d.substr(2).replace(">","")&&(m.pop(),f=f.parentNode);continue}var g,y=n(d.substr(1,d.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),f.appendChild(g);continue}var v=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(g=h(v[1],v[3])))continue;if(!s(f,g))continue;v[2]&&(g.className=v[2].substr(1).replace("."," ")),m.push(v[1]),f.appendChild(g),f=g}return p}var d=[[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 p(e){for(var t=0;t<d.length;t++){var i=d[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function f(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a<i.length;a++)if(p(i.charCodeAt(a)))return"rtl";return"ltr"}function m(){}function g(e,t,i){m.call(this),this.cue=t,this.cueDiv=h(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:f(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":r=t.position;break;case"middle":r=t.position-t.size/2;break;case"end":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function y(e){var t,i,n,r;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function v(e,t,i,n){var r=new y(t),a=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,c=l*Math.round(s),h=i[u]+l,d=o[0];Math.abs(c)>h&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),s<0&&(c+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(d,c)}else{var p=r.lineHeight/i.height*100;switch(a.lineAlign){case"middle":s-=p/2;break;case"end":s-=p}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new y(t)}var f=function(e,t){for(var r,a=new y(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var u=e.intersectPercentage(i);s>u&&(r=new y(e),s=u),e=new y(a)}return r||a}(r,o);t.move(f.toCSSCompatValues(i))}function _(){}m.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},m.prototype.formatStyle=function(e,t){return 0===e?0:e+t},g.prototype=t(m.prototype),g.prototype.constructor=g,y.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},y.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},y.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},y.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},y.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},y.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},y.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},y.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},_.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},_.convertCueToDOMTree=function(e,t){return e&&t?h(e,t):null};_.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=y.getSimpleBoxPosition(n),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var i,o,u=0;u<t.length;u++)o=t[u],i=new g(e,o,s),n.appendChild(i.div),v(0,i,a,r),o.displayState=i.div,r.push(y.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},_.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},_.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof i))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function o(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function u(e){e.match(/X-TIMESTAMP-MAP/)?a(e,(function(e,i){if("X-TIMESTAMP-MAP"===e)!function(e){var i=new r;a(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",n(t))}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)}),/=/):a(e,(function(e,i){if("Region"===e)!function(e){var i=new r;if(a(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var a=new r;if(a.percent("x",n[0]),a.percent("y",n[1]),!a.has("x")||!a.has("y"))break;i.set(e+"X",a.get("x")),i.set(e+"Y",a.get("y"));break;case"scroll":i.alt(e,t,["up"])}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}(i)}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var l;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var c=(l=o()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new i(i.Errors.BadSignature);t.state="HEADER"}for(var h=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(h?h=!1:l=o(),t.state){case"HEADER":/:/.test(l)?u(l):l||(t.state="ID");continue;case"NOTE":l||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(l)){t.state="NOTE";break}if(!l)continue;if(t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,""),t.state="CUE",-1===l.indexOf("--\x3e")){t.cue.id=l;continue}case"CUE":try{s(l,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var d=-1!==l.indexOf("--\x3e");if(!l||d&&(h=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=l;continue;case"BADCUE":l||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new i(i.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=_},2230:e=>{var t={"":1,lr:1,rl:1},i={start:1,middle:1,end:1,left:1,right:1};function n(e){return"string"==typeof e&&(!!i[e.toLowerCase()]&&e.toLowerCase())}function r(e,i,r){this.hasBeenReset=!1;var a="",s=!1,o=e,u=i,l=r,c=null,h="",d=!0,p="auto",f="start",m=50,g="middle",y=50,v="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return a},set:function(e){a=""+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(e){l=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return c},set:function(e){c=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");h=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");f=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}r.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=r},3710:e=>{var t={"":!0,up:!0};function i(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,n=3,r=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return n},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");n=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");u=i}}})}},1875:(e,t,i)=>{"use strict";var n=i(8908),r=i(7376),a=i(4947),s=i(7529);function o(e,t,i){var n=e;return r(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=s(t,{uri:e}),n.callback=i,n}function u(e,t,i){return l(t=o(e,t,i))}function l(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML;return null}(c),y)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,v)}function s(){if(!l){var t;clearTimeout(h),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var r=v,s=null;return 0!==t?(r={body:n(),statusCode:t,method:p,headers:{},url:d,rawRequest:c},c.getAllResponseHeaders&&(r.headers=a(c.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,r,r.body)}}var o,l,c=e.xhr||null;c||(c=e.cors||e.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var h,d=c.url=e.uri||e.url,p=c.method=e.method||"GET",f=e.body||e.data,m=c.headers=e.headers||{},g=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:c};if("json"in e&&!1!==e.json&&(y=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(s,0)},c.onload=s,c.onerror=r,c.onprogress=function(){},c.onabort=function(){l=!0},c.ontimeout=r,c.open(p,d,!g,e.username,e.password),g||(c.withCredentials=!!e.withCredentials),!g&&e.timeout>0&&(h=setTimeout((function(){if(!l){l=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),c.setRequestHeader)for(o in m)m.hasOwnProperty(o)&&c.setRequestHeader(o,m[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(f||null),c}e.exports=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){u["delete"===e?"del":e]=function(t,i,n){return(i=o(t,i,n)).method=e.toUpperCase(),l(i)}}))},7529:e=>{e.exports=function(){for(var e={},i=0;i<arguments.length;i++){var n=arguments[i];for(var r in n)t.call(n,r)&&(e[r]=n[r])}return e};var t=Object.prototype.hasOwnProperty}}]);
//# sourceMappingURL=files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map?v=f87ebe9feae884a73782