@eyevinn/web-player 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webplayer.css +1 -1
- package/dist/webplayer.min.js +6 -6
- package/package.json +4 -4
package/dist/webplayer.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webplayer=t():e.webplayer=t()}(window,(function(){return function(e){function t(t){for(var n,i,a=t[0],o=t[1],s=0,l=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&l.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);for(u&&u(t);l.length;)l.shift()()}var n={},r={0:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(){return Promise.resolve()},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonpwebplayer=window.webpackJsonpwebplayer||[],o=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var u=o;return i(i.s=271)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){var e=void 0,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){var i=void 0,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r=void 0;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r)}}}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return r(e,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability"}}]),e}());t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(4)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=1,u=2,l=3,c=4,d=5;function f(e){e=e||{};var t,n=this.context,a=(0,r.default)(n).getInstance(),o=e.settings,f=[],h=void 0,p=void 0,g=void 0;function v(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function m(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[s,this].concat(t))}function y(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[u,this].concat(t))}function E(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[c,this].concat(t))}function _(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[d,this].concat(t))}function b(e,t){var n="",r=null;h&&(r=(new Date).getTime(),n+="["+(r-g)+"]"),p&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var s=arguments.length,u=Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){n+=e+" "})),f[e]&&o.get().debug.logLevel>=e&&f[e](n),o&&o.get().debug.dispatchEvent&&a.trigger(i.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:m.bind(e),error:y.bind(e),warn:E.bind(e),info:T.bind(e),debug:_.bind(e)}},setLogTimestampVisible:function(e){h=e},setCalleeNameVisible:function(e){p=e}},h=!0,p=!0,g=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(f[s]=v(window.console.error),f[u]=v(window.console.error),f[l]=v(window.console.warn),f[c]=v(window.console.info),f[d]=v(window.console.debug)),t}f.__dashjs_factory_name="Debug";var h=a.default.getSingletonFactory(f);h.LOG_LEVEL_NONE=0,h.LOG_LEVEL_FATAL=s,h.LOG_LEVEL_ERROR=u,h.LOG_LEVEL_WARNING=l,h.LOG_LEVEL_INFO=c,h.LOG_LEVEL_DEBUG=d,a.default.updateSingletonFactory(f.__dashjs_factory_name,h),t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(20));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.default.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}o.__dashjs_factory_name="EventBus";var s=r.default.getSingletonFactory(o);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(o.__dashjs_factory_name,s),t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(103);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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}var s=new(function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return d}));var r,i,a,o,s=n(25);function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(o=r||(r={}))[o.UNKNOWN=0]="UNKNOWN",o[o.HLS=1]="HLS",o[o.DASH=2]="DASH",o[o.MSS=3]="MSS",function(e){e[e.UNKNOWN_MANIFEST_TYPE=0]="UNKNOWN_MANIFEST_TYPE"}(i||(i={})),function(e){e.PLAY="play",e.PAUSE="pause",e.PLAYING="playing",e.TIME_UPDATE="timeupdate",e.SEEKING="seeking",e.SEEKED="seeked",e.WAITING="waiting",e.STALLED="stalled",e.VOLUME_CHANGE="volumechange",e.ENDED="ended",e.UNREADY="unready",e.READYING="readying",e.READY="ready",e.STATE_CHANGE="state_change",e.AUDIO_TRACK_CHANGE="audio_track_change",e.TEXT_TRACK_CHANGE="text_track_change",e.BUFFERING="buffering",e.LIVE_ENDED="live_ended",e.BITRATE_CHANGE="bitrate_change",e.PLAYER_STOPPED="player_stopped",e.ERROR="error"}(a||(a={}));var p,g=function(){function e(){this.emitter=Object(s.a)()}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();function v(e){return e?e.id+"|"+e.label+"|"+e.language:null}!function(e){e[e.IDLE=0]="IDLE",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.PLAYING=3]="PLAYING",e[e.PAUSED=4]="PAUSED",e[e.SEEKING=5]="SEEKING",e[e.BUFFERING=6]="BUFFERING",e[e.BITRATE_CHANGE=7]="BITRATE_CHANGE",e[e.PLAYER_STOPPED=8]="PLAYER_STOPPED"}(p||(p={}));var m,y=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).state={playbackState:p.IDLE,currentTime:0,duration:0,isLive:!1,isAtLiveEdge:!1,isSeekable:!0,isMuted:r.muted,audioTracks:[],textTracks:[]},n.video=r,n.video.addEventListener("play",n.onPlay=n.onPlay.bind(d(n))),n.video.addEventListener("playing",n.onPlaying=n.onPlaying.bind(d(n))),n.video.addEventListener("pause",n.onPause=n.onPause.bind(d(n))),n.video.addEventListener("timeupdate",n.onTimeUpdate=n.onTimeUpdate.bind(d(n))),n.video.addEventListener("waiting",n.onWaiting=n.onWaiting.bind(d(n))),n.video.addEventListener("seeking",n.onSeeking=n.onSeeking.bind(d(n))),n.video.addEventListener("seeked",n.onSeeked=n.onSeeked.bind(d(n))),n.video.addEventListener("canplay",n.onLoadedData=n.onLoadedData.bind(d(n))),n.video.addEventListener("volumechange",n.onVolumeChange=n.onVolumeChange.bind(d(n))),n.video.addEventListener("ended",n.onEnded=n.onEnded.bind(d(n))),n.video.audioTracks&&n.video.audioTracks.addEventListener("change",n.onAudioTrackChange=n.onAudioTrackChange.bind(d(n))),n}c(t,e);var n=t.prototype;return n.updateState=function(e){var t=this;Object.keys(e).forEach((function(n){void 0!==t.state[n]&&(t.state[n]=e[n])})),this.emit(a.STATE_CHANGE,{state:this.state})},n.onLoadedData=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING,duration:this.duration,isLive:this.isLive,audioTracks:this.audioTracks,textTracks:this.textTracks})},n.onPlay=function(){this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAY)},n.onPause=function(){this.updateState({playbackState:p.PAUSED}),this.emit(a.PAUSE)},n.onPlaying=function(){this.state.playbackState!==p.PLAYING&&this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAYING)},n.onTimeUpdate=function(){this.updateState({currentTime:this.currentTime,duration:this.duration,isAtLiveEdge:this.currentTime>=this.duration-10,isSeekable:!this.isLive||this.duration>=300}),this.emit(a.TIME_UPDATE,{currentTime:this.currentTime,duration:this.duration})},n.onWaiting=function(){this.state.playbackState!==p.SEEKING&&(this.updateState({playbackState:p.BUFFERING}),this.emit(a.BUFFERING)),this.emit(a.WAITING)},n.onSeeking=function(){this.updateState({playbackState:p.SEEKING}),this.emit(a.SEEKING)},n.onSeeked=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING}),this.emit(a.SEEKED)},n.onVolumeChange=function(){this.state.isMuted!==this.isMuted&&this.updateState({isMuted:this.isMuted}),this.emit(a.VOLUME_CHANGE,{volume:this.video.volume})},n.onAudioTrackChange=function(){this.updateState({audioTracks:this.audioTracks}),this.emit(a.AUDIO_TRACK_CHANGE)},n.onTextTrackChange=function(){this.updateState({textTracks:this.textTracks}),this.emit(a.TEXT_TRACK_CHANGE)},n.onEnded=function(){this.emit(a.ENDED),this.updateState({playbackState:p.IDLE})},n.onBitrateChange=function(){},n.play=function(){var e=this.video.play();return e?e.then((function(){return!0}),(function(){return!1})):Promise.resolve(!0)},n.pause=function(){this.video.pause()},n.mute=function(){this.video.muted=!0},n.unmute=function(){this.video.muted=!1},n.load=function(e){var t=this;return this.updateState({playbackState:p.LOADING}),new Promise((function(n,r){t.video.src=e,t.video.load(),n()}))},n.stop=function(){this.video.src="",this.video.load(),this.updateState({playbackState:p.IDLE,isLive:!1,currentTime:this.currentTime,duration:this.duration}),this.emit(a.PLAYER_STOPPED)},n.seekToLive=function(){this.currentTime=this.duration-10},n.getVideoLevels=function(){return[]},n.destroy=function(){this.stop(),this.video.removeEventListener("timeupdate",this.onTimeUpdate)},l(t,[{key:"currentLevel",set:function(e){},get:function(){}},{key:"isPlaying",get:function(){return!this.video.paused}},{key:"isMuted",get:function(){return this.video.muted}},{key:"isLive",get:function(){return 1/0===this.video.duration}},{key:"duration",get:function(){return this.isLive&&this.video.seekable.length?this.video.seekable.end(0):this.video.duration||0}},{key:"currentTime",get:function(){return this.video.currentTime},set:function(e){this.state.isSeekable&&(this.video.currentTime=this.isLive?Math.min(e,this.duration-10):e)}},{key:"audioTrack",get:function(){var e=this.audioTracks.find((function(e){return e.enabled}));return null==e?void 0:e.id},set:function(e){if(this.video.audioTracks)for(var t,n=h(this.video.audioTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=r.id===e}}},{key:"audioTracks",get:function(){var e;return Array.from(null!=(e=this.video.audioTracks)?e:[]).map((function(e){return{id:e.id,label:e.label,language:e.language,enabled:e.enabled}}))}},{key:"textTrack",get:function(){return v(this.textTracks.find((function(e){return e.enabled})))},set:function(e){if(this.video.textTracks)for(var t,n=h(this.video.textTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=v(r)===e}}},{key:"textTracks",get:function(){var e;return Array.from(null!=(e=this.video.textTracks)?e:[]).filter((function(e){return"metadata"!==e.kind})).map((function(e){return{id:v(e),label:e.label,language:e.language,enabled:e.enabled}}))}}]),t}(g),E={"application/x-mpegURL":r.HLS,"application/octet-stream":r.UNKNOWN,"binary/octet-stream":r.UNKNOWN,"application/vnd.apple.mpegurl":r.HLS,"application/dash+xml":r.DASH,"application/vnd.apple.mpegurl;charset=UTF-8":r.HLS,"application/vnd.ms-sstr+xml":r.MSS},T=((m={})[r.HLS]="application/vnd.apple.mpegurl",m[r.DASH]="application/dash+xml",m[r.MSS]="application/vnd.ms-sstr+xml",m);function _(e,t,n){if(!e.s){if(n instanceof b){if(!n.s)return void(n.o=_.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(_.bind(null,e,t),_.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var b=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{_(r,1,a(this.v))}catch(e){_(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?_(r,1,t?t(i):i):n?_(r,1,n(i)):_(r,2,i)}catch(e){_(r,2,e)}},r},e}(),S=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).video=r,n}c(t,e);var o=t.prototype;return o.load=function(e,t){void 0===t&&(t=!1);try{var o=this;return o.video.muted=t,o.video.autoplay=t,o.video.setAttribute("playsinline",""),o.emit(a.READYING),o.reset(),o.currentSrc=e,Promise.resolve(function(e){return fetch(e).then((function(t){return E[t.headers.get("content-type")]||(e.match(/\.m3u8/)?r.HLS:e.match(/\.mpd/)?r.DASH:e.toLowerCase().match(/\/manifest/)?r.MSS:r.UNKNOWN)})).catch((function(){return r.UNKNOWN}))}(e)).then((function(t){function s(){return o.tech=new u({video:o.video}),o.tech.on("*",o.onEvent.bind(o)),o.emit(a.READY),o.tech.load(e)}if(t===r.UNKNOWN)throw{errorCode:i.UNKNOWN_MANIFEST_TYPE};var u,l=function(e,t){var n,r=-1;e:{for(var i=0;i<t.length;i++){var a=t[i][0];if(a){var o=a();if(o&&o.then)break e;if(o===e){r=i;break}}else r=i}if(-1!==r){do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then){n=!0;break e}var l=t[r][2];r++}while(l&&!l());return u}}var c=new b,d=_.bind(null,c,2);return(n?u.then(f):o.then((function n(o){for(;;){if(o===e){r=i;break}if(++i===t.length){if(-1!==r)break;return void _(c,1,u)}if(a=t[i][0]){if((o=a())&&o.then)return void o.then(n).then(void 0,d)}else r=i}do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then)return void u.then(f).then(void 0,d);var l=t[r][2];r++}while(l&&!l());_(c,1,u)}))).then(void 0,d),c;function f(e){for(;;){var n=t[r][2];if(!n||n())break;r++;for(var i=t[r][1];!i;)r++,i=t[r][1];if((e=i())&&e.then)return void e.then(f).then(void 0,d)}_(c,1,e)}}(t,[[function(){return r.HLS},function(){var e=function(){if(!function(e){return!!document.createElement("video").canPlayType(T[e])}(r.HLS)||(e=window.navigator.userAgent.toLowerCase(),!/safari/.test(e)&&!/iphone|ipad|ipod/.test(e)||!/apple computer/.test(window.navigator.vendor.toLowerCase())))return Promise.resolve(Promise.resolve().then(n.bind(null,98))).then((function(e){u=e.default}));var e;u=y}();if(e&&e.then)return e.then((function(){}))}],[function(){return r.DASH},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,99))).then((function(e){u=e.default}))}],[function(){return r.MSS},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,100))).then((function(e){u=e.default}))}]]);return l&&l.then?l.then(s):s()}))}catch(e){return Promise.reject(e)}},o.onEvent=function(e,t){this.emit(e,t)},o.getVideoLevels=function(){if(this.tech)return this.tech.getVideoLevels()},o.play=function(){var e;return null==(e=this.tech)?void 0:e.play()},o.pause=function(){var e;return null==(e=this.tech)?void 0:e.pause()},o.stop=function(){return this.destroy()},o.seekTo=function(e){var t=e.position,n=e.change,r=e.percentage;this.tech&&(r?t=r/100*this.tech.duration:n&&(t=this.tech.currentTime+n),this.tech.currentTime=t)},o.seekToLive=function(){var e;return null==(e=this.tech)?void 0:e.seekToLive()},o.setAudioTrack=function(e){this.tech&&(this.tech.audioTrack=e)},o.setTextTrack=function(e){this.tech&&(this.tech.textTrack=e)},o.mute=function(){var e;null==(e=this.tech)||e.mute()},o.unmute=function(){var e;null==(e=this.tech)||e.unmute()},o.reset=function(){this.tech&&(this.tech.destroy(),this.tech=null,this.emit(a.UNREADY))},l(t,[{key:"isPlaying",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isPlaying)&&e}},{key:"isMuted",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isMuted)&&e}},{key:"isLive",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isLive)&&e}},{key:"currentTime",get:function(){var e;return null==(e=this.tech)?void 0:e.currentTime}},{key:"currentLevel",get:function(){if(this.tech)return this.tech.currentLevel},set:function(e){this.tech&&(this.tech.currentLevel=e)}}]),t}(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},function(e,t,n){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webplayer=t():e.webplayer=t()}(window,(function(){return function(e){function t(t){for(var n,i,a=t[0],o=t[1],s=0,l=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&l.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);for(u&&u(t);l.length;)l.shift()()}var n={},r={0:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(){return Promise.resolve()},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonpwebplayer=window.webpackJsonpwebplayer||[],o=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var u=o;return i(i.s=271)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){var e=void 0,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){var i=void 0,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r=void 0;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r)}}}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return r(e,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability"}}]),e}());t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(5)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=1,u=2,l=3,c=4,d=5;function f(e){e=e||{};var t,n=this.context,a=(0,r.default)(n).getInstance(),o=e.settings,f=[],h=void 0,p=void 0,g=void 0;function v(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function m(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[s,this].concat(t))}function y(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[u,this].concat(t))}function E(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[c,this].concat(t))}function _(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[d,this].concat(t))}function b(e,t){var n="",r=null;h&&(r=(new Date).getTime(),n+="["+(r-g)+"]"),p&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var s=arguments.length,u=Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){n+=e+" "})),f[e]&&o.get().debug.logLevel>=e&&f[e](n),o&&o.get().debug.dispatchEvent&&a.trigger(i.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:m.bind(e),error:y.bind(e),warn:E.bind(e),info:T.bind(e),debug:_.bind(e)}},setLogTimestampVisible:function(e){h=e},setCalleeNameVisible:function(e){p=e}},h=!0,p=!0,g=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(f[s]=v(window.console.error),f[u]=v(window.console.error),f[l]=v(window.console.warn),f[c]=v(window.console.info),f[d]=v(window.console.debug)),t}f.__dashjs_factory_name="Debug";var h=a.default.getSingletonFactory(f);h.LOG_LEVEL_NONE=0,h.LOG_LEVEL_FATAL=s,h.LOG_LEVEL_ERROR=u,h.LOG_LEVEL_WARNING=l,h.LOG_LEVEL_INFO=c,h.LOG_LEVEL_DEBUG=d,a.default.updateSingletonFactory(f.__dashjs_factory_name,h),t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(20));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.default.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}o.__dashjs_factory_name="EventBus";var s=r.default.getSingletonFactory(o);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(o.__dashjs_factory_name,s),t.default=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return v}));var r,i,a,o,s=n(25);function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o=r||(r={}))[o.UNKNOWN=0]="UNKNOWN",o[o.HLS=1]="HLS",o[o.DASH=2]="DASH",o[o.MSS=3]="MSS",function(e){e[e.UNKNOWN_MANIFEST_TYPE=0]="UNKNOWN_MANIFEST_TYPE"}(i||(i={})),function(e){e.PLAY="play",e.PAUSE="pause",e.PLAYING="playing",e.TIME_UPDATE="timeupdate",e.SEEKING="seeking",e.SEEKED="seeked",e.WAITING="waiting",e.STALLED="stalled",e.VOLUME_CHANGE="volumechange",e.ENDED="ended",e.UNREADY="unready",e.READYING="readying",e.READY="ready",e.LOADED_METADATA="loadedmetadata",e.STATE_CHANGE="state_change",e.AUDIO_TRACK_CHANGE="audio_track_change",e.TEXT_TRACK_CHANGE="text_track_change",e.BUFFERING="buffering",e.LIVE_ENDED="live_ended",e.BITRATE_CHANGE="bitrate_change",e.PLAYER_STOPPED="player_stopped",e.ERROR="error"}(a||(a={}));var p,g=function(){function e(){this.emitter=Object(s.a)()}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();function v(e){return e?e.id+"|"+e.label+"|"+e.language:null}!function(e){e[e.IDLE=0]="IDLE",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.PLAYING=3]="PLAYING",e[e.PAUSED=4]="PAUSED",e[e.SEEKING=5]="SEEKING",e[e.BUFFERING=6]="BUFFERING",e[e.BITRATE_CHANGE=7]="BITRATE_CHANGE",e[e.PLAYER_STOPPED=8]="PLAYER_STOPPED"}(p||(p={}));var m,y=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).name="BaseTech",n.state={playbackState:p.IDLE,currentTime:0,duration:0,isLive:!1,isAtLiveEdge:!1,isSeekable:!0,isMuted:r.muted,audioTracks:[],textTracks:[],volume:r.volume},n.video=r,n.video.addEventListener("play",n.onPlay=n.onPlay.bind(d(n))),n.video.addEventListener("playing",n.onPlaying=n.onPlaying.bind(d(n))),n.video.addEventListener("pause",n.onPause=n.onPause.bind(d(n))),n.video.addEventListener("timeupdate",n.onTimeUpdate=n.onTimeUpdate.bind(d(n))),n.video.addEventListener("waiting",n.onWaiting=n.onWaiting.bind(d(n))),n.video.addEventListener("seeking",n.onSeeking=n.onSeeking.bind(d(n))),n.video.addEventListener("seeked",n.onSeeked=n.onSeeked.bind(d(n))),n.video.addEventListener("canplay",n.onLoadedData=n.onLoadedData.bind(d(n))),n.video.addEventListener("volumechange",n.onVolumeChange=n.onVolumeChange.bind(d(n))),n.video.addEventListener("ended",n.onEnded=n.onEnded.bind(d(n))),n.video.audioTracks&&n.video.audioTracks.addEventListener("change",n.onAudioTrackChange=n.onAudioTrackChange.bind(d(n))),n}c(t,e);var n=t.prototype;return n.updateState=function(e){var t=this;Object.keys(e).forEach((function(n){void 0!==t.state[n]&&(t.state[n]=e[n])})),this.emit(a.STATE_CHANGE,{state:this.state})},n.onLoadedData=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING,duration:this.duration,isLive:this.isLive,audioTracks:this.audioTracks,textTracks:this.textTracks}),this.emit(a.LOADED_METADATA,this.state)},n.onPlay=function(){this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAY)},n.onPause=function(){this.updateState({playbackState:p.PAUSED}),this.emit(a.PAUSE)},n.onPlaying=function(){this.state.playbackState!==p.PLAYING&&this.updateState({playbackState:p.PLAYING}),this.emit(a.PLAYING)},n.onTimeUpdate=function(){this.updateState({currentTime:this.currentTime,duration:this.duration,isAtLiveEdge:this.currentTime>=this.duration-10,isSeekable:!this.isLive||this.duration>=300}),this.emit(a.TIME_UPDATE,{currentTime:this.currentTime,duration:this.duration})},n.onWaiting=function(){this.state.playbackState!==p.SEEKING&&(this.updateState({playbackState:p.BUFFERING}),this.emit(a.BUFFERING)),this.emit(a.WAITING)},n.onSeeking=function(){this.updateState({playbackState:p.SEEKING}),this.emit(a.SEEKING)},n.onSeeked=function(){this.updateState({playbackState:this.video.paused?p.PAUSED:p.PLAYING}),this.emit(a.SEEKED)},n.onVolumeChange=function(){var e={volume:this.video.volume};this.state.isMuted!==this.isMuted&&(e.isMuted=this.isMuted),this.updateState(e),this.emit(a.VOLUME_CHANGE,{volume:this.video.volume})},n.onAudioTrackChange=function(){this.updateState({audioTracks:this.audioTracks}),this.emit(a.AUDIO_TRACK_CHANGE)},n.onTextTrackChange=function(){this.updateState({textTracks:this.textTracks}),this.emit(a.TEXT_TRACK_CHANGE)},n.onEnded=function(){this.emit(a.ENDED),this.updateState({playbackState:p.IDLE})},n.onBitrateChange=function(){},n.play=function(){var e=this.video.play();return e?e.then((function(){return!0}),(function(){return!1})):Promise.resolve(!0)},n.pause=function(){this.video.pause()},n.mute=function(){this.video.muted=!0},n.unmute=function(){this.video.muted=!1},n.load=function(e){var t=this;return this.setDefaultState(),new Promise((function(n,r){t.video.src=e,t.video.load(),n()}))},n.setDefaultState=function(){this.updateState({playbackState:p.LOADING,currentTime:0,duration:0,isLive:!1,isAtLiveEdge:!1,isSeekable:!0,isMuted:this.video.muted,audioTracks:[],textTracks:[],volume:this.video.volume})},n.stop=function(){this.video.src="",this.video.load(),this.updateState({playbackState:p.IDLE,isLive:!1,currentTime:this.currentTime,duration:this.duration}),this.emit(a.PLAYER_STOPPED)},n.seekToLive=function(){this.currentTime=this.duration-10},n.getVideoLevels=function(){return[]},n.destroy=function(){this.stop(),this.video.removeEventListener("timeupdate",this.onTimeUpdate)},l(t,[{key:"currentLevel",set:function(e){},get:function(){}},{key:"isPlaying",get:function(){return!this.video.paused}},{key:"isMuted",get:function(){return this.video.muted}},{key:"isLive",get:function(){return 1/0===this.video.duration}},{key:"duration",get:function(){return this.isLive&&this.video.seekable.length?this.video.seekable.end(0):this.video.duration||0}},{key:"currentTime",get:function(){return this.video.currentTime},set:function(e){this.state.isSeekable&&(this.video.currentTime=this.isLive?Math.min(e,this.duration-10):e)}},{key:"audioTrack",get:function(){var e=this.audioTracks.find((function(e){return e.enabled}));return null==e?void 0:e.id},set:function(e){if(this.video.audioTracks)for(var t,n=h(this.video.audioTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=r.id===e}}},{key:"audioTracks",get:function(){var e;return Array.from(null!=(e=this.video.audioTracks)?e:[]).map((function(e){return{id:e.id,label:e.label,language:e.language,enabled:e.enabled}}))}},{key:"textTrack",get:function(){return v(this.textTracks.find((function(e){return e.enabled})))},set:function(e){if(this.video.textTracks)for(var t,n=h(this.video.textTracks||[]);!(t=n()).done;){var r=t.value;r.enabled=v(r)===e}}},{key:"textTracks",get:function(){var e;return Array.from(null!=(e=this.video.textTracks)?e:[]).filter((function(e){return"metadata"!==e.kind})).map((function(e){return{id:v(e),label:e.label,language:e.language,enabled:e.enabled}}))}},{key:"volume",get:function(){return this.video.volume},set:function(e){this.video.volume=e}}]),t}(g),E={"application/x-mpegURL":r.HLS,"application/octet-stream":r.UNKNOWN,"binary/octet-stream":r.UNKNOWN,"application/vnd.apple.mpegurl":r.HLS,"application/dash+xml":r.DASH,"application/vnd.apple.mpegurl;charset=UTF-8":r.HLS,"application/vnd.ms-sstr+xml":r.MSS},T=((m={})[r.HLS]="application/vnd.apple.mpegurl",m[r.DASH]="application/dash+xml",m[r.MSS]="application/vnd.ms-sstr+xml",m);function _(e,t,n){if(!e.s){if(n instanceof b){if(!n.s)return void(n.o=_.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(_.bind(null,e,t),_.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var b=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{_(r,1,a(this.v))}catch(e){_(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?_(r,1,t?t(i):i):n?_(r,1,n(i)):_(r,2,i)}catch(e){_(r,2,e)}},r},e}(),S=function(e){function t(t){var n,r=t.video;return(n=e.call(this)||this).video=r,n}c(t,e);var o=t.prototype;return o.load=function(e,t){void 0===t&&(t=!1);try{var o=this;return o.video.muted=t,o.video.autoplay=t,o.video.setAttribute("playsinline",""),o.emit(a.READYING),o.reset(),o.currentSrc=e,Promise.resolve(function(e){return fetch(e).then((function(t){return E[t.headers.get("content-type")]||(e.match(/\.m3u8/)?r.HLS:e.match(/\.mpd/)?r.DASH:e.toLowerCase().match(/\/manifest/)?r.MSS:r.UNKNOWN)})).catch((function(){return r.UNKNOWN}))}(e)).then((function(t){function s(){return o.tech=new u({video:o.video}),o.tech.on("*",o.onEvent.bind(o)),o.emit(a.READY),o.tech.load(e)}if(t===r.UNKNOWN)throw{errorCode:i.UNKNOWN_MANIFEST_TYPE};var u,l=function(e,t){var n,r=-1;e:{for(var i=0;i<t.length;i++){var a=t[i][0];if(a){var o=a();if(o&&o.then)break e;if(o===e){r=i;break}}else r=i}if(-1!==r){do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then){n=!0;break e}var l=t[r][2];r++}while(l&&!l());return u}}var c=new b,d=_.bind(null,c,2);return(n?u.then(f):o.then((function n(o){for(;;){if(o===e){r=i;break}if(++i===t.length){if(-1!==r)break;return void _(c,1,u)}if(a=t[i][0]){if((o=a())&&o.then)return void o.then(n).then(void 0,d)}else r=i}do{for(var s=t[r][1];!s;)r++,s=t[r][1];var u=s();if(u&&u.then)return void u.then(f).then(void 0,d);var l=t[r][2];r++}while(l&&!l());_(c,1,u)}))).then(void 0,d),c;function f(e){for(;;){var n=t[r][2];if(!n||n())break;r++;for(var i=t[r][1];!i;)r++,i=t[r][1];if((e=i())&&e.then)return void e.then(f).then(void 0,d)}_(c,1,e)}}(t,[[function(){return r.HLS},function(){var e=function(){if(!function(e){return!!document.createElement("video").canPlayType(T[e])}(r.HLS)||(e=window.navigator.userAgent.toLowerCase(),!/safari/.test(e)&&!/iphone|ipad|ipod/.test(e)||!/apple computer/.test(window.navigator.vendor.toLowerCase())))return Promise.resolve(Promise.resolve().then(n.bind(null,98))).then((function(e){u=e.default}));var e;u=y}();if(e&&e.then)return e.then((function(){}))}],[function(){return r.DASH},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,99))).then((function(e){u=e.default}))}],[function(){return r.MSS},function(){return Promise.resolve(Promise.resolve().then(n.bind(null,100))).then((function(e){u=e.default}))}]]);return l&&l.then?l.then(s):s()}))}catch(e){return Promise.reject(e)}},o.onEvent=function(e,t){this.emit(e,t)},o.getVideoLevels=function(){if(this.tech)return this.tech.getVideoLevels()},o.play=function(){var e;return null==(e=this.tech)?void 0:e.play()},o.pause=function(){var e;return null==(e=this.tech)?void 0:e.pause()},o.stop=function(){return this.destroy()},o.seekTo=function(e){var t=e.position,n=e.change,r=e.percentage;this.tech&&(r?t=r/100*this.tech.duration:n&&(t=this.tech.currentTime+n),this.tech.currentTime=t)},o.seekToLive=function(){var e;return null==(e=this.tech)?void 0:e.seekToLive()},o.setAudioTrack=function(e){this.tech&&(this.tech.audioTrack=e)},o.setTextTrack=function(e){this.tech&&(this.tech.textTrack=e)},o.setVolume=function(e){var t=e.change;if(this.tech){var n=t?this.tech.volume+t:e.percentage/100;n>1&&(n=1),n<0&&(n=0),this.tech.volume=n}},o.getVolume=function(){var e;return null==(e=this.tech)?void 0:e.volume},o.mute=function(){var e;null==(e=this.tech)||e.mute()},o.unmute=function(){var e;null==(e=this.tech)||e.unmute()},o.reset=function(){this.tech&&(this.tech.destroy(),this.tech=null,this.emit(a.UNREADY))},l(t,[{key:"isPlaying",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isPlaying)&&e}},{key:"isMuted",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isMuted)&&e}},{key:"isLive",get:function(){var e,t;return null!=(e=null==(t=this.tech)?void 0:t.isLive)&&e}},{key:"currentTime",get:function(){var e;return null==(e=this.tech)?void 0:e.currentTime}},{key:"currentLevel",get:function(){if(this.tech)return this.tech.currentLevel},set:function(e){this.tech&&(this.tech.currentLevel=e)}}]),t}(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(103);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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}var s=new(function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},function(e,t,n){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
|
|
2
2
|
/*!*********************************************!*\
|
|
3
3
|
!*** ./node_modules/eventemitter3/index.js ***!
|
|
4
4
|
\*********************************************/
|
|
@@ -367,16 +367,16 @@
|
|
|
367
367
|
Copyright (c) 2017 Jed Watson.
|
|
368
368
|
Licensed under the MIT License (MIT), see
|
|
369
369
|
http://jedwatson.github.io/classnames
|
|
370
|
-
*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var o=i.apply(null,r);o&&e.push(o)}else if("object"===a)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.SOURCE_INITIALIZED="sourceInitialized",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.GAP_CAUSED_SEEK_TO_PERIOD_END="gapCausedSeekToPeriodEnd",e.GAP_CAUSED_INTERNAL_SEEK="gapCausedInternalSeek",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unescapeDollarsInTemplate=function(e){return e?e.split("$$").join("$"):e},t.replaceIDForTemplate=function(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)},t.replaceTokenForTemplate=s,t.getIndexBasedSegment=function(e,t,n,r){var i,a,o=void 0;o=n.segmentDuration,isNaN(o)&&(o=n.adaptation.period.duration);i=parseFloat((n.adaptation.period.start+r*o).toFixed(5)),a=parseFloat((i+o).toFixed(5));var s=u(n,o,i,e.calcMediaTimeFromPresentationTime(i,n),e.calcAvailabilityStartTimeFromPresentationTime(i,n.adaptation.period.mpd,t),e,a,t,r);if(!l(e,n,s,t))return null;return s},t.getTimeBasedSegment=function(e,t,n,r,i,a,o,c,d,f){var h,p,g=r/a,v=Math.min(i/a,n.adaptation.period.mpd.maxSegmentDuration),m=void 0;if(h=e.calcPresentationTimeFromMediaTime(g,n),p=h+v,m=u(n,v,h,g,n.adaptation.period.mpd.manifest.loadedTime,e,p,t,d),!l(e,n,m,t))return null;return m.replacementTime=f||r,o=s(o,"Number",m.replacementNumber),o=s(o,"Time",m.replacementTime),m.media=o,m.mediaRange=c,m};var r,i=n(52),a=(r=i)&&r.__esModule?r:{default:r};function o(e,t){for(;e.length<t;)e="0"+e;return e}function s(e,t,n){var r=void 0,i=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=t.length,d="%0".length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((i=e.indexOf("$",r+c))<0)return e;if((a=e.indexOf("%0",r+c))>r&&a<i)switch(s=e.charAt(i-1),u=parseInt(e.substring(a+d,i-1),10),s){case"d":case"i":case"u":l=o(n.toString(),u);break;case"x":l=o(n.toString(16),u);break;case"X":l=o(n.toString(16),u).toUpperCase();break;case"o":l=o(n.toString(8),u);break;default:return e}else l=n;e=e.substring(0,r)+l+e.substring(i+1)}}function u(e,t,n,r,i,o,s,u,l){var c,d=new a.default;return d.representation=e,d.duration=t,d.presentationStartTime=n,d.mediaStartTime=r,d.availabilityStartTime=i,d.availabilityEndTime=o.calcAvailabilityEndTimeFromPresentationTime(s,e.adaptation.period.mpd,u),d.wallStartTime=o.calcWallTimeForSegment(d,u),d.replacementNumber=(c=l,d.representation.startNumber+c),d.availabilityIdx=l,d}function l(e,t,n,r){var i=e.getPeriodEnd(t,r),a=e.calcPeriodRelativeTimeFromMpdRelativeTime(t,i);if(e.calcPeriodRelativeTimeFromMpdRelativeTime(t,n.presentationStartTime)>=a){if(!r)return!1;if(t.segmentAvailabilityRange&&n.presentationStartTime>=t.segmentAvailabilityRange.end)return!1}return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=l(n(0)),a=l(n(30)),o=l(n(2)),s=l(n(1)),u=n(8);function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(){var e,t,n={debug:{logLevel:o.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{metricsMaxListDepth:1e3,abandonLoadTimeout:1e4,liveDelayFragmentCount:NaN,liveDelay:null,scheduleWhilePaused:!0,fastSwitchEnabled:!1,flushBufferAtTrackSwitch:!1,calcSegmentAvailabilityRangeFromTimeline:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,stableBufferTime:12,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,longFormContentDurationThreshold:600,wallclockTimeUpdateInterval:50,lowLatencyEnabled:!1,keepProtectionMediaKeys:!1,useManifestDateHeaderTimeSource:!0,useSuggestedPresentationDelay:!0,useAppendWindow:!0,manifestUpdateRetryInterval:100,stallThreshold:.5,filterUnsupportedEssentialProperties:!0,eventControllerRefreshDelay:100,utcSynchronization:{backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso&ms"}},liveCatchup:{minDrift:.02,maxDrift:0,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:s.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,fragmentRequestTimeout:0,retryIntervals:(e={},c(e,u.HTTPRequest.MPD_TYPE,500),c(e,u.HTTPRequest.XLINK_EXPANSION_TYPE,500),c(e,u.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.INIT_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.OTHER_TYPE,1e3),c(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},c(t,u.HTTPRequest.MPD_TYPE,3),c(t,u.HTTPRequest.XLINK_EXPANSION_TYPE,1),c(t,u.HTTPRequest.MEDIA_SEGMENT_TYPE,3),c(t,u.HTTPRequest.INIT_SEGMENT_TYPE,3),c(t,u.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),c(t,u.HTTPRequest.INDEX_SEGMENT_TYPE,3),c(t,u.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),c(t,u.HTTPRequest.OTHER_TYPE,3),c(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.default.ABR_STRATEGY_DYNAMIC,bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.default.CMCD_MODE_QUERY}}},i=a.default.clone(n);return{get:function(){return i},update:function(e){"object"===(void 0===e?"undefined":r(e))&&function e(t,n,i){for(var o in t)t.hasOwnProperty(o)&&n.hasOwnProperty(o)&&("object"===r(t[o])&&null!==t[o]?e(t[o],n[o],i.slice()+o+"."):n[o]=a.default.clone(t[o]))}(e,i,"")},reset:function(){i=a.default.clone(n)}}}d.__dashjs_factory_name="Settings";var f=i.default.getSingletonFactory(d);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,o=void 0,s=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,o="";var u=void 0,l=void 0;for(u=0;u<4;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<6;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,o=o.toLowerCase(),t.getUint32(r),r+=4,n[o]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}}]),e}();t.default=i},function(e,t,n){"use strict";t.a=function(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map((function(e){e(n)})),(e.get("*")||[]).slice().map((function(e){e(t,n)}))}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(16));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).eventBus,n=e.events,r=e.dashMetrics,a=e.fragmentLoader,o=e.debug,s=e.streamInfo,u=e.type,l=void 0,c=void 0,d=void 0,f=void 0;function h(e){var t;return!!e&&(t=!1,d.some((function(n){if(r=e,a=n,!isNaN(r.index)&&r.startTime===a.startTime&&r.adaptationIndex===a.adaptationIndex&&r.type===a.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===i.default.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,a})),t)}function p(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function g(e){d=d.filter((function(t){var n=p(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function v(e,t){t<=e+.5||(d=d.filter((function(n){var r=p(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function m(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,o=a+i.duration;if(n=isNaN(n)?p(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n<o||isNaN(a)&&isNaN(t))return i}return null}function y(e,t){r.addSchedulingInfo(e,t),r.addRequestsQueue(e.mediaType,f,d)}function E(e){e.sender===a&&(f.splice(f.indexOf(e.request),1),e.response&&!e.error&&d.push(e.request),y(e.request,e.error?"failed":"executed"),t.trigger(n.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:s.id,mediaType:u}))}function T(e){e.sender===a&&t.trigger(n.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:s.id,mediaType:u})}function _(e){e.sender===a&&t.trigger(n.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:s.id,mediaType:u})}function b(){d=[],f=[]}return l={getStreamId:function(){return s.id},getType:function(){return u},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var r=function(e){var t=void 0;switch(e){case"loading":t=f;break;case"executed":t=d;break;default:t=[]}return t}(t);n=n.concat(function(e,t){if(t.hasOwnProperty("time"))return[m(e,t.time,t.threshold)];return e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(r,e))})),n},isFragmentLoaded:h,isFragmentLoadedOrPending:function(e){var t=!1,n=0,r=void 0;if(!(t=h(e)))for(n=0;n<f.length;n++)r=f[n],e.url===r.url&&e.startTime===r.startTime&&(t=!0);return t},removeExecutedRequestsBeforeTime:g,removeExecutedRequestsAfterTime:function(e){d=d.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)v(n,e.start(r)),n=e.end(r);t>0&&v(n,t)}else g()},abortRequests:function(){c.debug("abort requests"),a.abort(),f=[]},executeRequest:function(e){switch(e.action){case i.default.ACTION_COMPLETE:d.push(e),y(e,"executed"),c.debug("STREAM_COMPLETED"),t.trigger(n.STREAM_COMPLETED,{request:e},{streamId:e.mediaInfo.streamInfo.id,mediaType:e.mediaType});break;case i.default.ACTION_DOWNLOAD:y(e,"loading"),f.push(e),function(e){t.trigger(n.FRAGMENT_LOADING_STARTED,{request:e},{streamId:s.id,mediaType:u}),a.load(e)}(e);break;default:c.warn("Unknown request action.")}},reset:function(){t.off(n.LOADING_COMPLETED,E,this),t.off(n.LOADING_DATA_PROGRESS,T,this),t.off(n.LOADING_ABANDONED,_,this),a&&a.reset(),b()},addExecutedRequest:function(e){d.push(e)}},c=o.getLogger(l),b(),t.on(n.LOADING_COMPLETED,E,l),t.on(n.LOADING_DATA_PROGRESS,T,l),t.on(n.LOADING_ABANDONED,_,l),l}o.__dashjs_factory_name="FragmentModel";var s=r.default.getClassFactory(o);s.FRAGMENT_MODEL_LOADING="loading",s.FRAGMENT_MODEL_EXECUTED="executed",s.FRAGMENT_MODEL_CANCELED="canceled",s.FRAGMENT_MODEL_FAILED="failed",r.default.updateClassFactory(o.__dashjs_factory_name,s),t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(2)),i=u(n(109)),a=u(n(0)),o=u(n(43)),s=u(n(111));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=void 0,t=void 0,n=this.context;function a(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=o.default.parseBuffer(e),r=(0,i.default)(n).create();return r.setData(t),r}function u(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function l(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:a,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new s.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,i=void 0,a=0;n<r.byteLength;){var o=u(r,n),c=l(r,n+4);if(0===o)break;n+o<=r.byteLength&&(e.indexOf(c)>=0?i=new s.default(n,!0,o):a=n+o),n+=o}return i||new s.default(a,!1)},getMediaTimescaleFromMoov:function(e){var t=a(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r=a(e),i=r.getBoxes("moof"),o=r.getBoxes("mfhd"),s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0;n=r.getBoxes("moof").length,t=o[o.length-1].sequence_number,u=0,d=[];var _=-1,b=-1;for(v=0;v<i.length;v++){var S=i[v],A=S.getChildBoxes("traf");for(p=0;p<A.length;p++){var I=A[p],w=I.getChildBox("tfhd"),R=I.getChildBox("tfdt");c=R.baseMediaDecodeTime;var D=I.getChildBoxes("trun"),C=I.getChildBoxes("subs");for(g=0;g<D.length;g++){var M=D[g];for(u=M.sample_count,E=(w.base_data_offset||0)+(M.data_offset||0),h=0;h<u;h++){s=void 0!==(f=M.samples[h]).sample_duration?f.sample_duration:w.default_sample_duration,l=void 0!==f.sample_size?f.sample_size:w.default_sample_size;var L={dts:c,cts:c+(void 0!==f.sample_composition_time_offset?f.sample_composition_time_offset:0),duration:s,offset:S.offset+E,size:l,subSizes:[l]};if(C)for(m=0;m<C.length;m++){var N=C[m];if(_<N.entry_count-1&&h>b&&(_++,b+=N.entries[_].sample_delta),h==b){L.subSizes=[];var O=N.entries[_];for(y=0;y<O.subsample_count;y++)L.subSizes.push(O.subsamples[y].subsample_size)}}d.push(L),E+=l,c+=s}}T=c-R.baseMediaDecodeTime}}return{sampleList:d,lastSequenceNumber:t,totalDuration:T,numSequences:n}},findInitRange:function(t){var n=null,r=a(t);if(!r)return n;var i=r.getBox("ftyp"),o=r.getBox("moov");return e.debug("Searching for initialization."),o&&o.isComplete&&(n=(i?i.offset:o.offset)+"-"+(o.offset+o.size-1),e.debug("Found the initialization. Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new s.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,i=void 0,a=0;n<r.byteLength;){var o=u(r,n),c=l(r,n+4);if(0===o)break;n+o<=r.byteLength&&(e.indexOf(c)>=0?i=new s.default(n,!0,o,c):a=n+o),n+=o}return i||new s.default(a,!1)}},e=(0,r.default)(n).getInstance().getLogger(t),t}l.__dashjs_factory_name="BoxParser",t.default=a.default.getSingletonFactory(l)},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(46).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(81));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){e=e||{};var t=this.context,n=void 0,r=void 0;return n=(0,i.default)(t).getInstance(),{load:function(i){var a=n.getLoader(i&&i.request?i.request.url:null);(r=a(t).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.useFetch||null,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})).load(i)},abort:function(){r&&r.abort()}}}o.__dashjs_factory_name="URLLoader";var s=r.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"mixin",value:function(t,n,i){var a=void 0,o={};if(t)for(var s in n)n.hasOwnProperty(s)&&(a=n[s],s in t&&(t[s]===a||s in o&&o[s]===a)||("object"===r(t[s])&&null!==t[s]?t[s]=e.mixin(t[s],a,i):t[s]=i(a)));return t}},{key:"clone",value:function(t){if(!t||"object"!==(void 0===t?"undefined":r(t)))return t;var n=void 0;if(t instanceof Array){n=[];for(var i=0,a=t.length;i<a;++i)i in t&&n.push(e.clone(t[i]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],o=a.indexOf(": ");o>0&&(t[a.substring(0,o)]=a.substring(o+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return t}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(75);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}]),e}();t.default=i},function(e,t,n){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){var n=t.split(","),r=[];for(var i in n){var a=n[i].split(" ");if(1===a.length&&"none"===a[0])return"none";if(a.length>1&&a.length<5){var o=[null,null,null,null],s=e.parseLength(a.shift());if(null===s)return null;if(o[0]=s,null===(s=e.parseLength(a.shift())))return null;if(o[1]=s,0===a.length){r.push(o);continue}if(null!==(s=e.parseLength(a[0]))&&(o[2]=s,a.shift()),0===a.length){r.push(o);continue}var u=e.parseColor(a[0]);if(null===u)return null;o[3]=u,r.push(o)}}return r},e.parsePosition=function(t){var n=t.split(" "),r=function(e){return"center"===e||"left"===e||"top"===e||"bottom"===e||"right"===e};if(n.length>4)return null;for(var i in n)if(!r(n[i])){var a=e.parseLength(n[i]);if(null===a)return null;n[i]=a}for(var o={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},s=0;s<n.length;){var u=n[s++];if(r(u)){var l={value:0,unit:"%"};2!==n.length&&s<n.length&&!r(n[s])&&(l=n[s++]),"right"===u?(o.h.edge=u,o.h.offset=l):"bottom"===u?(o.v.edge=u,o.v.offset=l):"left"===u?o.h.offset=l:"top"===u&&(o.v.offset=l)}else{if(1!==n.length&&2!==n.length)return null;1===s?o.h.offset=u:o.v.offset=u}}return o},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return 0===this.rw&&0===this.rh},e.toComputedLength=function(t,n,r,i,a,o){return"%"===n&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):"em"===n&&r?new e.ComputedLength(r.rw*t,r.rh*t):"c"===n&&a?new e.ComputedLength(t*a.rw,t*a.rh):"px"===n&&o?new e.ComputedLength(t*o.rw,t*o.rh):"rh"===n?new e.ComputedLength(0,t/100):"rw"===n?new e.ComputedLength(t/100,0):null}}(t)},function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,l=[],c=!1,d=-1;function f(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(u=l,l=[];++d<t;)u&&u[d].run();d=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(a=new Array(s-1),o=0;o<a.length;)a[o++]=arguments[o];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n(36))},function(e,t,n){var r=n(46),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}return r(e,[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(24)),i=h(n(258)),a=h(n(259)),o=h(n(260)),s=h(n(261)),u=h(n(262)),l=h(n(263)),c=h(n(264)),d=h(n(265)),f=h(n(18));function h(e){return e&&e.__esModule?e:{default:e}}function p(){var e=this.context,t=void 0,n=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0;return t={initialize:function(){p=[];var t=void 0;t=(0,s.default)(e).getInstance({BASE64:g}),p.push(t),t=(0,o.default)(e).getInstance({BASE64:g}),p.push(t),t=(0,i.default)(e).getInstance({BASE64:g}),p.push(t),v=t,t=(0,a.default)(e).getInstance({BASE64:g,debug:n}),p.push(t),m=t},setProtectionData:function(e){for(var t,n,r=0;r<p.length;r++){var i=p[r];i.hasOwnProperty("init")&&i.init((t=i.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===v||e===m},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return p},setKeySystems:function(e){p=e},getKeySystemBySystemString:function(e){for(var t=0;t<p.length;t++)if(p[t].systemString===e)return p[t];return null},getSupportedKeySystemsFromContentProtection:function(e){var t=void 0,n=void 0,i=void 0,a=void 0,o=[];if(e){var s=r.default.findCencContentProtection(e);for(i=0;i<p.length;++i)for(n=p[i],a=0;a<e.length;++a)if((t=e[a]).schemeIdUri.toLowerCase()===n.schemeIdURI){var u=n.getInitData(t,s);o.push({ks:p[i],initData:u,cdmData:n.getCDMData(),sessionId:n.getSessionId(t)})}}return o},getSupportedKeySystems:function(e,t){for(var n=[],i=r.default.parsePSSHList(e),a=void 0,o=void 0,s=void 0,u=0;u<p.length;++u)o=(a=p[u]).systemString,s=!t||o in t,a.uuid in i&&s&&n.push({ks:a,initData:i[a.uuid],cdmData:a.getCDMData(),sessionId:a.getSessionId()});return n},getLicenseServer:function(t,n,r){if("license-release"===r||"individualization-request"===r)return null;var i=null;return n&&n.hasOwnProperty("drmtoday")?i=(0,u.default)(e).getInstance({BASE64:g}):t.systemString===f.default.WIDEVINE_KEYSTEM_STRING?i=(0,c.default)(e).getInstance():t.systemString===f.default.PLAYREADY_KEYSTEM_STRING?i=(0,l.default)(e).getInstance():t.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(i=(0,d.default)(e).getInstance()),i},processClearKeyLicenseRequest:function(e,t,n){try{return e.getClearKeysFromProtectionData(t,n)}catch(e){return h.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(e){e&&(e.debug&&(n=e.debug,h=n.getLogger(t)),e.BASE64&&(g=e.BASE64))}}}p.__dashjs_factory_name="ProtectionKeyController",t.default=dashjs.FactoryMaker.getSingletonFactory(p)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsMediaSource=t.Debug=t.MediaPlayerFactory=t.MetricsReporting=t.Protection=t.MediaPlayer=void 0;var r=n(101),i=n(91),a=l(n(234)),o=l(n(253)),s=l(n(270)),u=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}dashjs.Protection=o.default,dashjs.MetricsReporting=a.default,dashjs.MediaPlayerFactory=s.default,dashjs.Debug=u.default,dashjs.supportsMediaSource=i.supportsMediaSource,t.default=dashjs,t.MediaPlayer=r.MediaPlayer,t.Protection=o.default,t.MetricsReporting=a.default,t.MediaPlayerFactory=s.default,t.Debug=u.default,t.supportsMediaSource=i.supportsMediaSource},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(1)),i=f(n(0)),a=f(n(107)),o=f(n(44)),s=f(n(131)),u=f(n(132)),l=f(n(3)),c=f(n(4)),d=n(15);function f(e){return e&&e.__esModule?e:{default:e}}function h(){var e=this.context,t=void 0,n=void 0,i=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0;function M(e){void 0===C&&null!==e.fromStreamInfo&&(C=this.getCurrentTrackIdx())}function L(){void 0===C&&(C=this.getCurrentTrackIdx())}function N(){void 0!==C&&(this.setTextTrack(C),C=void 0)}function O(e){var t=this,n=e.tracks,r=e.index;_&&n.some((function(e,n){if(p.matchSettings(_,e))return t.setTextTrack(n),r=n,!0})),(!1===A||void 0===A&&!_||D)&&this.setTextTrack(-1),S=r,T.trigger(c.default.TEXT_TRACKS_ADDED,{enabled:P(),index:r,tracks:n}),R=!0}function x(e){if(!b&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===r.default.FRAGMENTED_TEXT&&(_={lang:t.lang,role:t.roles[0],accessibility:t.accessibility[0]})}}function P(){var e=!0;return I&&!w&&(e=!1),e}function k(){I=!0,R=!1,D=!1}return t={setConfig:function(e){e&&(e.errHandler&&(i=e.errHandler),e.adapter&&(f=e.adapter),e.manifestModel&&(h=e.manifestModel),e.mediaController&&(p=e.mediaController),e.videoModel&&(g=e.videoModel),e.streamController&&(v=e.streamController),e.textTracks&&(m=e.textTracks),e.vttParser&&(y=e.vttParser),e.ttmlParser&&(E=e.ttmlParser),n.setConfig({errHandler:i,adapter:f,manifestModel:h,mediaController:p,videoModel:g,streamController:v,textTracks:m,vttParser:y,ttmlParser:E}))},getTextSourceBuffer:function(){return n},getAllTracksAreDisabled:function(){return I},addEmbeddedTrack:function(e){n.addEmbeddedTrack(e)},getTextDefaultLanguage:function(){return _&&_.lang||""},setTextDefaultLanguage:function(e){(0,d.checkParameterType)(e,"string"),_||(_={}),_.lang=e,b=!0},setTextDefaultEnabled:function(e){(0,d.checkParameterType)(e,"boolean"),(A=e)?I=!1:this.setTextTrack(-1)},getTextDefaultEnabled:function(){return void 0!==A&&A},setInitialSettings:function(e){_=e,b=!0},enableText:function(e){(0,d.checkParameterType)(e,"boolean"),!A&&e&&(A=!0),P()!==e&&(e&&this.setTextTrack(S),e||(S=this.getCurrentTrackIdx(),R?this.setTextTrack(-1):D=!0))},isTextEnabled:P,setTextTrack:function(e){var t=n.getConfig(),i=t.fragmentModel,a=t.fragmentedTracks,o=t.videoModel,s=void 0,u=void 0;I=-1===e;var l=m.getCurrentTrackIdx();if(l!==e){I&&p&&p.saveTextSettingsDisabled(),m.setModeForTrackIdx(l,r.default.TEXT_HIDDEN),m.setCurrentTrackIdx(e),m.setModeForTrackIdx(e,r.default.TEXT_SHOWING);var c=m.getCurrentTrackInfo();if(c&&c.isFragmented&&!c.isEmbedded)for(var d=0;d<a.length;d++){var f=a[d];if(c.lang===f.lang&&c.index===f.index&&(f.id?c.id===f.id:c.id===f.index))if(f!==p.getCurrentTrackFor(r.default.FRAGMENTED_TEXT,v.getActiveStreamInfo()))i.abortRequests(),i.removeExecutedRequestsBeforeTime(),n.remove(),m.deleteCuesFromTrackIdx(l),p.setTrack(f),n.setCurrentFragmentedTrackIdx(d);else if(-1===l){for(var h=v.getActiveStreamProcessors(),g=0;g<h.length;g++)if(h[g].getType()===r.default.FRAGMENTED_TEXT){u=h[g];break}u.setBufferingTime(o.getTime()),u.getScheduleController().start()}}else if(c&&!c.isFragmented){for(var y=v.getActiveStreamProcessors(),E=0;E<y.length;E++)if(y[E].getType()===r.default.TEXT){s=(u=y[E]).getMediaInfoArr();break}if(u&&s)for(var T=0;T<s.length;T++)if(s[T].index===c.index&&s[T].lang===c.lang){u.selectMediaInfo(s[T]);break}}}},getCurrentTrackIdx:function(){return m.getCurrentTrackIdx()},enableForcedTextStreaming:function(e){(0,d.checkParameterType)(e,"boolean"),w=e},reset:function(){k(),n.resetEmbedded(),n.reset()}},_=null,S=-1,w=!1,R=!1,b=!1,D=!1,m=(0,o.default)(e).getInstance(),y=(0,s.default)(e).getInstance(),E=(0,u.default)(e).getInstance(),n=(0,a.default)(e).getInstance(),T=(0,l.default)(e).getInstance(),m.initialize(),T.on(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,O,t),T.on(c.default.CURRENT_TRACK_CHANGED,x,t),T.on(c.default.PERIOD_SWITCH_STARTED,M,t),T.on(c.default.STREAM_COMPLETED,L,t),T.on(c.default.PERIOD_SWITCH_COMPLETED,N,t),k(),t}h.__dashjs_factory_name="TextController",t.default=i.default.getSingletonFactory(h)},function(e,t,n){
|
|
370
|
+
*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var o=i.apply(null,r);o&&e.push(o)}else if("object"===a)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.SOURCE_INITIALIZED="sourceInitialized",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.GAP_CAUSED_SEEK_TO_PERIOD_END="gapCausedSeekToPeriodEnd",e.GAP_CAUSED_INTERNAL_SEEK="gapCausedInternalSeek",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unescapeDollarsInTemplate=function(e){return e?e.split("$$").join("$"):e},t.replaceIDForTemplate=function(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)},t.replaceTokenForTemplate=s,t.getIndexBasedSegment=function(e,t,n,r){var i,a,o=void 0;o=n.segmentDuration,isNaN(o)&&(o=n.adaptation.period.duration);i=parseFloat((n.adaptation.period.start+r*o).toFixed(5)),a=parseFloat((i+o).toFixed(5));var s=u(n,o,i,e.calcMediaTimeFromPresentationTime(i,n),e.calcAvailabilityStartTimeFromPresentationTime(i,n.adaptation.period.mpd,t),e,a,t,r);if(!l(e,n,s,t))return null;return s},t.getTimeBasedSegment=function(e,t,n,r,i,a,o,c,d,f){var h,p,g=r/a,v=Math.min(i/a,n.adaptation.period.mpd.maxSegmentDuration),m=void 0;if(h=e.calcPresentationTimeFromMediaTime(g,n),p=h+v,m=u(n,v,h,g,n.adaptation.period.mpd.manifest.loadedTime,e,p,t,d),!l(e,n,m,t))return null;return m.replacementTime=f||r,o=s(o,"Number",m.replacementNumber),o=s(o,"Time",m.replacementTime),m.media=o,m.mediaRange=c,m};var r,i=n(52),a=(r=i)&&r.__esModule?r:{default:r};function o(e,t){for(;e.length<t;)e="0"+e;return e}function s(e,t,n){var r=void 0,i=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=t.length,d="%0".length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((i=e.indexOf("$",r+c))<0)return e;if((a=e.indexOf("%0",r+c))>r&&a<i)switch(s=e.charAt(i-1),u=parseInt(e.substring(a+d,i-1),10),s){case"d":case"i":case"u":l=o(n.toString(),u);break;case"x":l=o(n.toString(16),u);break;case"X":l=o(n.toString(16),u).toUpperCase();break;case"o":l=o(n.toString(8),u);break;default:return e}else l=n;e=e.substring(0,r)+l+e.substring(i+1)}}function u(e,t,n,r,i,o,s,u,l){var c,d=new a.default;return d.representation=e,d.duration=t,d.presentationStartTime=n,d.mediaStartTime=r,d.availabilityStartTime=i,d.availabilityEndTime=o.calcAvailabilityEndTimeFromPresentationTime(s,e.adaptation.period.mpd,u),d.wallStartTime=o.calcWallTimeForSegment(d,u),d.replacementNumber=(c=l,d.representation.startNumber+c),d.availabilityIdx=l,d}function l(e,t,n,r){var i=e.getPeriodEnd(t,r),a=e.calcPeriodRelativeTimeFromMpdRelativeTime(t,i);if(e.calcPeriodRelativeTimeFromMpdRelativeTime(t,n.presentationStartTime)>=a){if(!r)return!1;if(t.segmentAvailabilityRange&&n.presentationStartTime>=t.segmentAvailabilityRange.end)return!1}return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=l(n(0)),a=l(n(30)),o=l(n(2)),s=l(n(1)),u=n(8);function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(){var e,t,n={debug:{logLevel:o.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{metricsMaxListDepth:1e3,abandonLoadTimeout:1e4,liveDelayFragmentCount:NaN,liveDelay:null,scheduleWhilePaused:!0,fastSwitchEnabled:!1,flushBufferAtTrackSwitch:!1,calcSegmentAvailabilityRangeFromTimeline:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,stableBufferTime:12,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,longFormContentDurationThreshold:600,wallclockTimeUpdateInterval:50,lowLatencyEnabled:!1,keepProtectionMediaKeys:!1,useManifestDateHeaderTimeSource:!0,useSuggestedPresentationDelay:!0,useAppendWindow:!0,manifestUpdateRetryInterval:100,stallThreshold:.5,filterUnsupportedEssentialProperties:!0,eventControllerRefreshDelay:100,utcSynchronization:{backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso&ms"}},liveCatchup:{minDrift:.02,maxDrift:0,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:s.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,fragmentRequestTimeout:0,retryIntervals:(e={},c(e,u.HTTPRequest.MPD_TYPE,500),c(e,u.HTTPRequest.XLINK_EXPANSION_TYPE,500),c(e,u.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.INIT_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),c(e,u.HTTPRequest.OTHER_TYPE,1e3),c(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},c(t,u.HTTPRequest.MPD_TYPE,3),c(t,u.HTTPRequest.XLINK_EXPANSION_TYPE,1),c(t,u.HTTPRequest.MEDIA_SEGMENT_TYPE,3),c(t,u.HTTPRequest.INIT_SEGMENT_TYPE,3),c(t,u.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),c(t,u.HTTPRequest.INDEX_SEGMENT_TYPE,3),c(t,u.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),c(t,u.HTTPRequest.OTHER_TYPE,3),c(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.default.ABR_STRATEGY_DYNAMIC,bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.default.CMCD_MODE_QUERY}}},i=a.default.clone(n);return{get:function(){return i},update:function(e){"object"===(void 0===e?"undefined":r(e))&&function e(t,n,i){for(var o in t)t.hasOwnProperty(o)&&n.hasOwnProperty(o)&&("object"===r(t[o])&&null!==t[o]?e(t[o],n[o],i.slice()+o+"."):n[o]=a.default.clone(t[o]))}(e,i,"")},reset:function(){i=a.default.clone(n)}}}d.__dashjs_factory_name="Settings";var f=i.default.getSingletonFactory(d);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,o=void 0,s=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,o="";var u=void 0,l=void 0;for(u=0;u<4;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<6;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,o=o.toLowerCase(),t.getUint32(r),r+=4,n[o]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}}]),e}();t.default=i},function(e,t,n){"use strict";t.a=function(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map((function(e){e(n)})),(e.get("*")||[]).slice().map((function(e){e(t,n)}))}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(16));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).eventBus,n=e.events,r=e.dashMetrics,a=e.fragmentLoader,o=e.debug,s=e.streamInfo,u=e.type,l=void 0,c=void 0,d=void 0,f=void 0;function h(e){var t;return!!e&&(t=!1,d.some((function(n){if(r=e,a=n,!isNaN(r.index)&&r.startTime===a.startTime&&r.adaptationIndex===a.adaptationIndex&&r.type===a.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===i.default.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,a})),t)}function p(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function g(e){d=d.filter((function(t){var n=p(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function v(e,t){t<=e+.5||(d=d.filter((function(n){var r=p(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function m(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,o=a+i.duration;if(n=isNaN(n)?p(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n<o||isNaN(a)&&isNaN(t))return i}return null}function y(e,t){r.addSchedulingInfo(e,t),r.addRequestsQueue(e.mediaType,f,d)}function E(e){e.sender===a&&(f.splice(f.indexOf(e.request),1),e.response&&!e.error&&d.push(e.request),y(e.request,e.error?"failed":"executed"),t.trigger(n.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:s.id,mediaType:u}))}function T(e){e.sender===a&&t.trigger(n.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:s.id,mediaType:u})}function _(e){e.sender===a&&t.trigger(n.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:s.id,mediaType:u})}function b(){d=[],f=[]}return l={getStreamId:function(){return s.id},getType:function(){return u},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var r=function(e){var t=void 0;switch(e){case"loading":t=f;break;case"executed":t=d;break;default:t=[]}return t}(t);n=n.concat(function(e,t){if(t.hasOwnProperty("time"))return[m(e,t.time,t.threshold)];return e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(r,e))})),n},isFragmentLoaded:h,isFragmentLoadedOrPending:function(e){var t=!1,n=0,r=void 0;if(!(t=h(e)))for(n=0;n<f.length;n++)r=f[n],e.url===r.url&&e.startTime===r.startTime&&(t=!0);return t},removeExecutedRequestsBeforeTime:g,removeExecutedRequestsAfterTime:function(e){d=d.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)v(n,e.start(r)),n=e.end(r);t>0&&v(n,t)}else g()},abortRequests:function(){c.debug("abort requests"),a.abort(),f=[]},executeRequest:function(e){switch(e.action){case i.default.ACTION_COMPLETE:d.push(e),y(e,"executed"),c.debug("STREAM_COMPLETED"),t.trigger(n.STREAM_COMPLETED,{request:e},{streamId:e.mediaInfo.streamInfo.id,mediaType:e.mediaType});break;case i.default.ACTION_DOWNLOAD:y(e,"loading"),f.push(e),function(e){t.trigger(n.FRAGMENT_LOADING_STARTED,{request:e},{streamId:s.id,mediaType:u}),a.load(e)}(e);break;default:c.warn("Unknown request action.")}},reset:function(){t.off(n.LOADING_COMPLETED,E,this),t.off(n.LOADING_DATA_PROGRESS,T,this),t.off(n.LOADING_ABANDONED,_,this),a&&a.reset(),b()},addExecutedRequest:function(e){d.push(e)}},c=o.getLogger(l),b(),t.on(n.LOADING_COMPLETED,E,l),t.on(n.LOADING_DATA_PROGRESS,T,l),t.on(n.LOADING_ABANDONED,_,l),l}o.__dashjs_factory_name="FragmentModel";var s=r.default.getClassFactory(o);s.FRAGMENT_MODEL_LOADING="loading",s.FRAGMENT_MODEL_EXECUTED="executed",s.FRAGMENT_MODEL_CANCELED="canceled",s.FRAGMENT_MODEL_FAILED="failed",r.default.updateClassFactory(o.__dashjs_factory_name,s),t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(2)),i=u(n(109)),a=u(n(0)),o=u(n(43)),s=u(n(111));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=void 0,t=void 0,n=this.context;function a(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=o.default.parseBuffer(e),r=(0,i.default)(n).create();return r.setData(t),r}function u(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function l(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:a,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new s.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,i=void 0,a=0;n<r.byteLength;){var o=u(r,n),c=l(r,n+4);if(0===o)break;n+o<=r.byteLength&&(e.indexOf(c)>=0?i=new s.default(n,!0,o):a=n+o),n+=o}return i||new s.default(a,!1)},getMediaTimescaleFromMoov:function(e){var t=a(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r=a(e),i=r.getBoxes("moof"),o=r.getBoxes("mfhd"),s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0;n=r.getBoxes("moof").length,t=o[o.length-1].sequence_number,u=0,d=[];var _=-1,b=-1;for(v=0;v<i.length;v++){var S=i[v],A=S.getChildBoxes("traf");for(p=0;p<A.length;p++){var I=A[p],w=I.getChildBox("tfhd"),R=I.getChildBox("tfdt");c=R.baseMediaDecodeTime;var D=I.getChildBoxes("trun"),C=I.getChildBoxes("subs");for(g=0;g<D.length;g++){var M=D[g];for(u=M.sample_count,E=(w.base_data_offset||0)+(M.data_offset||0),h=0;h<u;h++){s=void 0!==(f=M.samples[h]).sample_duration?f.sample_duration:w.default_sample_duration,l=void 0!==f.sample_size?f.sample_size:w.default_sample_size;var L={dts:c,cts:c+(void 0!==f.sample_composition_time_offset?f.sample_composition_time_offset:0),duration:s,offset:S.offset+E,size:l,subSizes:[l]};if(C)for(m=0;m<C.length;m++){var N=C[m];if(_<N.entry_count-1&&h>b&&(_++,b+=N.entries[_].sample_delta),h==b){L.subSizes=[];var O=N.entries[_];for(y=0;y<O.subsample_count;y++)L.subSizes.push(O.subsamples[y].subsample_size)}}d.push(L),E+=l,c+=s}}T=c-R.baseMediaDecodeTime}}return{sampleList:d,lastSequenceNumber:t,totalDuration:T,numSequences:n}},findInitRange:function(t){var n=null,r=a(t);if(!r)return n;var i=r.getBox("ftyp"),o=r.getBox("moov");return e.debug("Searching for initialization."),o&&o.isComplete&&(n=(i?i.offset:o.offset)+"-"+(o.offset+o.size-1),e.debug("Found the initialization. Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new s.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,i=void 0,a=0;n<r.byteLength;){var o=u(r,n),c=l(r,n+4);if(0===o)break;n+o<=r.byteLength&&(e.indexOf(c)>=0?i=new s.default(n,!0,o,c):a=n+o),n+=o}return i||new s.default(a,!1)}},e=(0,r.default)(n).getInstance().getLogger(t),t}l.__dashjs_factory_name="BoxParser",t.default=a.default.getSingletonFactory(l)},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(46).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(81));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){e=e||{};var t=this.context,n=void 0,r=void 0;return n=(0,i.default)(t).getInstance(),{load:function(i){var a=n.getLoader(i&&i.request?i.request.url:null);(r=a(t).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.useFetch||null,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})).load(i)},abort:function(){r&&r.abort()}}}o.__dashjs_factory_name="URLLoader";var s=r.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"mixin",value:function(t,n,i){var a=void 0,o={};if(t)for(var s in n)n.hasOwnProperty(s)&&(a=n[s],s in t&&(t[s]===a||s in o&&o[s]===a)||("object"===r(t[s])&&null!==t[s]?t[s]=e.mixin(t[s],a,i):t[s]=i(a)));return t}},{key:"clone",value:function(t){if(!t||"object"!==(void 0===t?"undefined":r(t)))return t;var n=void 0;if(t instanceof Array){n=[];for(var i=0,a=t.length;i<a;++i)i in t&&n.push(e.clone(t[i]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],o=a.indexOf(": ");o>0&&(t[a.substring(0,o)]=a.substring(o+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return t}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(75);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}]),e}();t.default=i},function(e,t,n){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){var n=t.split(","),r=[];for(var i in n){var a=n[i].split(" ");if(1===a.length&&"none"===a[0])return"none";if(a.length>1&&a.length<5){var o=[null,null,null,null],s=e.parseLength(a.shift());if(null===s)return null;if(o[0]=s,null===(s=e.parseLength(a.shift())))return null;if(o[1]=s,0===a.length){r.push(o);continue}if(null!==(s=e.parseLength(a[0]))&&(o[2]=s,a.shift()),0===a.length){r.push(o);continue}var u=e.parseColor(a[0]);if(null===u)return null;o[3]=u,r.push(o)}}return r},e.parsePosition=function(t){var n=t.split(" "),r=function(e){return"center"===e||"left"===e||"top"===e||"bottom"===e||"right"===e};if(n.length>4)return null;for(var i in n)if(!r(n[i])){var a=e.parseLength(n[i]);if(null===a)return null;n[i]=a}for(var o={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},s=0;s<n.length;){var u=n[s++];if(r(u)){var l={value:0,unit:"%"};2!==n.length&&s<n.length&&!r(n[s])&&(l=n[s++]),"right"===u?(o.h.edge=u,o.h.offset=l):"bottom"===u?(o.v.edge=u,o.v.offset=l):"left"===u?o.h.offset=l:"top"===u&&(o.v.offset=l)}else{if(1!==n.length&&2!==n.length)return null;1===s?o.h.offset=u:o.v.offset=u}}return o},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return 0===this.rw&&0===this.rh},e.toComputedLength=function(t,n,r,i,a,o){return"%"===n&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):"em"===n&&r?new e.ComputedLength(r.rw*t,r.rh*t):"c"===n&&a?new e.ComputedLength(t*a.rw,t*a.rh):"px"===n&&o?new e.ComputedLength(t*o.rw,t*o.rh):"rh"===n?new e.ComputedLength(0,t/100):"rw"===n?new e.ComputedLength(t/100,0):null}}(t)},function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,l=[],c=!1,d=-1;function f(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(u=l,l=[];++d<t;)u&&u[d].run();d=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(a=new Array(s-1),o=0;o<a.length;)a[o++]=arguments[o];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n(36))},function(e,t,n){var r=n(46),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}return r(e,[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(24)),i=h(n(258)),a=h(n(259)),o=h(n(260)),s=h(n(261)),u=h(n(262)),l=h(n(263)),c=h(n(264)),d=h(n(265)),f=h(n(18));function h(e){return e&&e.__esModule?e:{default:e}}function p(){var e=this.context,t=void 0,n=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0;return t={initialize:function(){p=[];var t=void 0;t=(0,s.default)(e).getInstance({BASE64:g}),p.push(t),t=(0,o.default)(e).getInstance({BASE64:g}),p.push(t),t=(0,i.default)(e).getInstance({BASE64:g}),p.push(t),v=t,t=(0,a.default)(e).getInstance({BASE64:g,debug:n}),p.push(t),m=t},setProtectionData:function(e){for(var t,n,r=0;r<p.length;r++){var i=p[r];i.hasOwnProperty("init")&&i.init((t=i.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===v||e===m},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return p},setKeySystems:function(e){p=e},getKeySystemBySystemString:function(e){for(var t=0;t<p.length;t++)if(p[t].systemString===e)return p[t];return null},getSupportedKeySystemsFromContentProtection:function(e){var t=void 0,n=void 0,i=void 0,a=void 0,o=[];if(e){var s=r.default.findCencContentProtection(e);for(i=0;i<p.length;++i)for(n=p[i],a=0;a<e.length;++a)if((t=e[a]).schemeIdUri.toLowerCase()===n.schemeIdURI){var u=n.getInitData(t,s);o.push({ks:p[i],initData:u,cdmData:n.getCDMData(),sessionId:n.getSessionId(t)})}}return o},getSupportedKeySystems:function(e,t){for(var n=[],i=r.default.parsePSSHList(e),a=void 0,o=void 0,s=void 0,u=0;u<p.length;++u)o=(a=p[u]).systemString,s=!t||o in t,a.uuid in i&&s&&n.push({ks:a,initData:i[a.uuid],cdmData:a.getCDMData(),sessionId:a.getSessionId()});return n},getLicenseServer:function(t,n,r){if("license-release"===r||"individualization-request"===r)return null;var i=null;return n&&n.hasOwnProperty("drmtoday")?i=(0,u.default)(e).getInstance({BASE64:g}):t.systemString===f.default.WIDEVINE_KEYSTEM_STRING?i=(0,c.default)(e).getInstance():t.systemString===f.default.PLAYREADY_KEYSTEM_STRING?i=(0,l.default)(e).getInstance():t.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(i=(0,d.default)(e).getInstance()),i},processClearKeyLicenseRequest:function(e,t,n){try{return e.getClearKeysFromProtectionData(t,n)}catch(e){return h.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(e){e&&(e.debug&&(n=e.debug,h=n.getLogger(t)),e.BASE64&&(g=e.BASE64))}}}p.__dashjs_factory_name="ProtectionKeyController",t.default=dashjs.FactoryMaker.getSingletonFactory(p)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsMediaSource=t.Debug=t.MediaPlayerFactory=t.MetricsReporting=t.Protection=t.MediaPlayer=void 0;var r=n(101),i=n(91),a=l(n(234)),o=l(n(253)),s=l(n(270)),u=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}dashjs.Protection=o.default,dashjs.MetricsReporting=a.default,dashjs.MediaPlayerFactory=s.default,dashjs.Debug=u.default,dashjs.supportsMediaSource=i.supportsMediaSource,t.default=dashjs,t.MediaPlayer=r.MediaPlayer,t.Protection=o.default,t.MetricsReporting=a.default,t.MediaPlayerFactory=s.default,t.Debug=u.default,t.supportsMediaSource=i.supportsMediaSource},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(1)),i=f(n(0)),a=f(n(107)),o=f(n(44)),s=f(n(131)),u=f(n(132)),l=f(n(3)),c=f(n(5)),d=n(15);function f(e){return e&&e.__esModule?e:{default:e}}function h(){var e=this.context,t=void 0,n=void 0,i=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0;function M(e){void 0===C&&null!==e.fromStreamInfo&&(C=this.getCurrentTrackIdx())}function L(){void 0===C&&(C=this.getCurrentTrackIdx())}function N(){void 0!==C&&(this.setTextTrack(C),C=void 0)}function O(e){var t=this,n=e.tracks,r=e.index;_&&n.some((function(e,n){if(p.matchSettings(_,e))return t.setTextTrack(n),r=n,!0})),(!1===A||void 0===A&&!_||D)&&this.setTextTrack(-1),S=r,T.trigger(c.default.TEXT_TRACKS_ADDED,{enabled:P(),index:r,tracks:n}),R=!0}function x(e){if(!b&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===r.default.FRAGMENTED_TEXT&&(_={lang:t.lang,role:t.roles[0],accessibility:t.accessibility[0]})}}function P(){var e=!0;return I&&!w&&(e=!1),e}function k(){I=!0,R=!1,D=!1}return t={setConfig:function(e){e&&(e.errHandler&&(i=e.errHandler),e.adapter&&(f=e.adapter),e.manifestModel&&(h=e.manifestModel),e.mediaController&&(p=e.mediaController),e.videoModel&&(g=e.videoModel),e.streamController&&(v=e.streamController),e.textTracks&&(m=e.textTracks),e.vttParser&&(y=e.vttParser),e.ttmlParser&&(E=e.ttmlParser),n.setConfig({errHandler:i,adapter:f,manifestModel:h,mediaController:p,videoModel:g,streamController:v,textTracks:m,vttParser:y,ttmlParser:E}))},getTextSourceBuffer:function(){return n},getAllTracksAreDisabled:function(){return I},addEmbeddedTrack:function(e){n.addEmbeddedTrack(e)},getTextDefaultLanguage:function(){return _&&_.lang||""},setTextDefaultLanguage:function(e){(0,d.checkParameterType)(e,"string"),_||(_={}),_.lang=e,b=!0},setTextDefaultEnabled:function(e){(0,d.checkParameterType)(e,"boolean"),(A=e)?I=!1:this.setTextTrack(-1)},getTextDefaultEnabled:function(){return void 0!==A&&A},setInitialSettings:function(e){_=e,b=!0},enableText:function(e){(0,d.checkParameterType)(e,"boolean"),!A&&e&&(A=!0),P()!==e&&(e&&this.setTextTrack(S),e||(S=this.getCurrentTrackIdx(),R?this.setTextTrack(-1):D=!0))},isTextEnabled:P,setTextTrack:function(e){var t=n.getConfig(),i=t.fragmentModel,a=t.fragmentedTracks,o=t.videoModel,s=void 0,u=void 0;I=-1===e;var l=m.getCurrentTrackIdx();if(l!==e){I&&p&&p.saveTextSettingsDisabled(),m.setModeForTrackIdx(l,r.default.TEXT_HIDDEN),m.setCurrentTrackIdx(e),m.setModeForTrackIdx(e,r.default.TEXT_SHOWING);var c=m.getCurrentTrackInfo();if(c&&c.isFragmented&&!c.isEmbedded)for(var d=0;d<a.length;d++){var f=a[d];if(c.lang===f.lang&&c.index===f.index&&(f.id?c.id===f.id:c.id===f.index))if(f!==p.getCurrentTrackFor(r.default.FRAGMENTED_TEXT,v.getActiveStreamInfo()))i.abortRequests(),i.removeExecutedRequestsBeforeTime(),n.remove(),m.deleteCuesFromTrackIdx(l),p.setTrack(f),n.setCurrentFragmentedTrackIdx(d);else if(-1===l){for(var h=v.getActiveStreamProcessors(),g=0;g<h.length;g++)if(h[g].getType()===r.default.FRAGMENTED_TEXT){u=h[g];break}u.setBufferingTime(o.getTime()),u.getScheduleController().start()}}else if(c&&!c.isFragmented){for(var y=v.getActiveStreamProcessors(),E=0;E<y.length;E++)if(y[E].getType()===r.default.TEXT){s=(u=y[E]).getMediaInfoArr();break}if(u&&s)for(var T=0;T<s.length;T++)if(s[T].index===c.index&&s[T].lang===c.lang){u.selectMediaInfo(s[T]);break}}}},getCurrentTrackIdx:function(){return m.getCurrentTrackIdx()},enableForcedTextStreaming:function(e){(0,d.checkParameterType)(e,"boolean"),w=e},reset:function(){k(),n.resetEmbedded(),n.reset()}},_=null,S=-1,w=!1,R=!1,b=!1,D=!1,m=(0,o.default)(e).getInstance(),y=(0,s.default)(e).getInstance(),E=(0,u.default)(e).getInstance(),n=(0,a.default)(e).getInstance(),T=(0,l.default)(e).getInstance(),m.initialize(),T.on(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,O,t),T.on(c.default.CURRENT_TRACK_CHANGED,x,t),T.on(c.default.PERIOD_SWITCH_STARTED,M,t),T.on(c.default.STREAM_COMPLETED,L,t),T.on(c.default.PERIOD_SWITCH_COMPLETED,N,t),k(),t}h.__dashjs_factory_name="TextController",t.default=i.default.getSingletonFactory(h)},function(e,t,n){
|
|
371
371
|
/*! codem-isoboxer v0.3.6 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */
|
|
372
|
-
var r={parseBuffer:function(e){return new i(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new i},createBox:function(e,t,n){var r=a.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,n){var i=r.createBox(e,t,n);return i.version=0,i.flags=0,i},Utils:{}};r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},r.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=r.parseBuffer,t.addBoxProcessor=r.addBoxProcessor,t.createFile=r.createFile,t.createBox=r.createBox,t.createFullBox=r.createFullBox,t.Utils=r.Utils,r.Cursor=function(e){this.offset=void 0===e?0:e};var i=function(e){this._cursor=new r.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};i.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},i.prototype.fetchAll=function(e,t){var n=[];return i._sweep.call(this,e,n,t),n},i.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=a.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},i._sweep=function(e,t,n){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;i._sweep.call(this.boxes[r],e,t,n)}},i.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},i.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)};var a=function(){this._cursor=new r.Cursor};a.parse=function(e){var t=new a;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},a.create=function(e){var t=new a;return t.type=e,t.boxes=[],t},a.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],a.prototype._boxProcessors={},a.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},a.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},a.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},a.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},a.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},a.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},a.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(a.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},a.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},a.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},a.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},a.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},a.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},a.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},a.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(a.parse(this))},a.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)},a.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},a.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},a.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},a.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},a.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},a.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},a.prototype._writeUTF8String=function(e){var t=r.Utils.utf8ToByteArray(e);if(this._rawo)for(var n=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)n.setUint8(i,t[i]);else this.size+=t.length},a.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},a.prototype._boxProcessors.avc1=a.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},a.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},a.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},a.prototype._boxProcessors.free=a.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},a.prototype._boxProcessors.ftyp=a.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},a.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},a.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(1)),i=c(n(3)),a=c(n(4)),o=c(n(0)),s=c(n(2)),u=n(69),l=n(15);function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=(0,i.default)(e).getInstance(),n=void 0,o=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0;function w(e){var t=f[e].kind,n=void 0!==f[e].id?f[e].id:f[e].lang,r=f[e].lang,i=f[e].isTTML,a=f[e].isEmbedded;return d.addTextTrack(t,n,r,i,a)}function R(e,t,n,r,i,a){var o=0,s=0;e/t>n/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,c=0,d=0;return o/s>i?(d=s,c=s*i):(c=o,d=o/i),u=(e-c)/2,l=(t-d)/2,a?{x:u+.1*c,y:l+.1*d,w:.8*c,h:.8*d}:{x:u,y:l,w:c,h:d}}function D(e,n){var r=d.getClientWidth(),i=d.getClientHeight(),o=d.getVideoWidth(),s=d.getVideoHeight(),u=d.getVideoRelativeOffsetTop(),l=d.getVideoRelativeOffsetLeft();if(0!==o&&0!==s){var c=o/s,f=!1;e.isFromCEA608&&(c=3.5/3,f=!0);var h=R.call(this,r,i,o,s,c,f),p=h.w,T=h.h,S=h.x,I=h.y;if(p!=m||T!=y||S!=g||I!=v||n){if(g=S+l,v=I+u,m=p,y=T,E){var w=E.style;w&&(w.left=g+"px",w.top=v+"px",w.width=m+"px",w.height=y+"px",w.zIndex=_&&document[_]||b?A:null,t.trigger(a.default.CAPTION_CONTAINER_RESIZE))}var D=e.activeCues;if(D)for(var C=D.length,M=0;M<C;++M){var L=D[M];L.scaleCue(L)}}}}function C(e){var t=m,n=y,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e.cellResolution){var u=[t/e.cellResolution[0],n/e.cellResolution[1]];if(e.linePadding)for(r in e.linePadding)if(e.linePadding.hasOwnProperty(r)){i=(e.linePadding[r]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),c=0;c<l.length;c++)l[c].style.cssText=l[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i),l[c].style.cssText=l[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.fontSize){for(r in e.fontSize)if(e.fontSize.hasOwnProperty(r)){"%"===e.fontSize[r][0]?a=e.fontSize[r][1]/100:"c"===e.fontSize[r][0]&&(a=e.fontSize[r][1]),i=(a*u[1]).toString(),s="defaultFontSize"!==r?document.getElementsByClassName(r):document.getElementsByClassName("paragraph");for(var d=0;d<s.length;d++)s[d].style.cssText=s[d].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.lineHeight)for(r in e.lineHeight)if(e.lineHeight.hasOwnProperty(r)){"%"===e.lineHeight[r][0]?o=e.lineHeight[r][1]/100:"c"===e.fontSize[r][0]&&(o=e.lineHeight[r][1]),i=(o*u[1]).toString(),s=document.getElementsByClassName(r);for(var f=0;f<s.length;f++)s[f].style.cssText=s[f].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&E.removeChild(h),M(e)}}function M(e){if(E){var n=document.createElement("div");E.appendChild(n),S=(0,u.renderHTML)(e.isd,n,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var o=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[o]}return null}),E.clientHeight,E.clientWidth,!1,(function(e){o.info("renderCaption :",e)}),S,!0),n.id=e.cueID,t.trigger(a.default.CAPTION_RENDERED,{captionDiv:n,currentTrackIdx:p})}}function L(e){return e>=0&&f[e]?d.getTextTrack(f[e].kind,f[e].id,f[e].lang,f[e].isTTML,f[e].isEmbedded):null}function N(e){var t=this;if(e!==p){var n=L(p=e);O.call(this,n),T&&(clearInterval(T),T=null),n&&"html"===n.renderingType&&(D.call(this,n,!0),window.ResizeObserver?(I=new window.ResizeObserver((function(){D.call(t,n,!0)}))).observe(d.getElement()):T=setInterval(D.bind(this,n),500))}}function O(e){U.call(this),e&&"html"===e.renderingType?k.call(this):F.call(this)}function x(e,t,n){return(isNaN(t)||e.startTime>=t)&&(isNaN(n)||e.endTime<=n)}function P(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)x(r[i],t,n)&&e.removeCue(r[i])}function k(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,n=d.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){o.info(""+e.message)}}}function F(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function U(){if(E)for(;E.firstChild;)E.removeChild(E.firstChild)}return n={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(c=window.VTTCue||window.TextTrackCue,f=[],h=[],p=-1,g=0,v=0,m=0,y=0,E=null,T=null,b=!1,A=2147483647,S=null,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},setDisplayCConTop:function(e){(0,l.checkParameterType)(e,"boolean"),b=e,E&&!document[_]&&(E.style.zIndex=e?A:null)},addTextTrack:function(e,n){if(f.length!==n){if(f.push(e),f.length===n){f.sort((function(e,t){return e.index-t.index})),E=d.getTTMLRenderingDiv();for(var i=-1,s=0;s<f.length;s++){var u=w.call(this,s);h.push(u),f[s].defaultTrack&&(u.default=!0,i=s);var l=L(s);l&&(l.mode=r.default.TEXT_SHOWING,E&&(f[s].isTTML||f[s].isEmbedded)?l.renderingType="html":l.renderingType="default"),this.addCaptions(s,0,f[s].captionData),t.trigger(a.default.TEXT_TRACK_ADDED)}if(N.call(this,i),i>=0){t.on(a.default.PLAYBACK_METADATA_LOADED,(function e(){var n=L(i);n&&D.call(this,n,!0),t.off(a.default.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var c=0;c<f.length;c++){var g=L(c);g&&(g.mode=c===i?r.default.TEXT_SHOWING:r.default.TEXT_HIDDEN)}}t.trigger(a.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:p,tracks:f})}}else o.error("Trying to add too many tracks.")},addCaptions:function(e,n,i){var s=L(e),u=this;if(s&&Array.isArray(i)&&0!==i.length)for(var l=0;l<i.length;l++){var d=void 0,f=i[l];s.cellResolution=f.cellResolution,s.isFromCEA608=f.isFromCEA608,"html"===f.type&&E?((d=new c(f.start-n,f.end-n,"")).cueHTMLElement=f.cueHTMLElement,d.isd=f.isd,d.images=f.images,d.embeddedImages=f.embeddedImages,d.cueID=f.cueID,d.scaleCue=C.bind(u),d.cellResolution=f.cellResolution,d.lineHeight=f.lineHeight,d.linePadding=f.linePadding,d.fontSize=f.fontSize,E.style.left=g+"px",E.style.top=v+"px",E.style.width=m+"px",E.style.height=y+"px",d.onenter=function(){s.mode===r.default.TEXT_SHOWING&&(this.isd?(M(this),o.debug("Cue enter id:"+this.cueID)):(E.appendChild(this.cueHTMLElement),C.call(u,this),t.trigger(a.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:p})))},d.onexit=function(){if(E)for(var e=E.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(o.debug("Cue exit id:"+e[t].id),E.removeChild(e[t]),--t)}):f.data&&(d=new c(f.start-n,f.end-n,f.data),f.styles&&(void 0!==f.styles.align&&"align"in d&&(d.align=f.styles.align),void 0!==f.styles.line&&"line"in d&&(d.line=f.styles.line),void 0!==f.styles.position&&"position"in d&&(d.position=f.styles.position),void 0!==f.styles.size&&"size"in d&&(d.size=f.styles.size)),d.onenter=function(){s.mode===r.default.TEXT_SHOWING&&t.trigger(a.default.CAPTION_RENDERED,{currentTrackIdx:p})});try{d?s.addCue(d):o.error("impossible to display subtitles.")}catch(e){throw P(s),s.addCue(d),e}}},getCurrentTrackIdx:function(){return p},setCurrentTrackIdx:N,getTrackIdxForId:function(e){for(var t=-1,n=0;n<f.length;n++)if(f[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return f[p]},setModeForTrackIdx:function(e,t){var n=L(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=L(e);r&&P(r,t,n)},deleteAllTextTracks:function(){for(var e=h?h.length:0,t=0;t<e;t++){var n=L(t);n&&(P.call(this,n),n.mode="disabled")}h=[],f=[],T&&(clearInterval(T),T=null),I&&d&&(I.unobserve(d.getElement()),I=null),p=-1,U.call(this)},deleteTextTrack:function(e){d.removeChild(h[e]),h.splice(e,1)},setConfig:function(e){e&&e.videoModel&&(d=e.videoModel)}},o=(0,s.default)(e).getInstance().getLogger(n),n}d.__dashjs_factory_name="TextTracks",t.default=o.default.getSingletonFactory(d)},function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,o,s){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=o,this.compute=s}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,1);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(1,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"fontFamily","default",["span"],!0,!0,(function(e){var t=e.split(","),n=[];for(var r in t)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"shear","0%",["p"],!0,!0,n.parseLength,(function(e,t,n,r){return"%"!==r.unit?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value})),new r(t.ns_tts,"fontSize","1c",["span"],!0,!0,n.parseLength,(function(t,r,i,a,o){return n.toComputedLength(a.value,a.unit,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,t.cellLength.h,t.pxLength.h)})),new r(t.ns_tts,"fontStyle","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,r,i,a,o){var s;if("normal"===a)s=a;else if(null===(s=n.toComputedLength(a.value,a.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)))return null;return s})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,0);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(0,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;var r=[];for(var i in t){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,r,i,a,o){var s;if(1===a.length)s=[a[0],a[0],a[0],a[0]];else if(2===a.length)s=[a[0],a[1],a[0],a[1]];else if(3===a.length)s=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;s=[a[0],a[1],a[2],a[3]]}var u=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===u||"lr"===u)s=[s[0],s[3],s[2],s[1]];else if("rltb"===u||"rl"===u)s=[s[0],s[1],s[2],s[3]];else if("tblr"===u)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==u&&"tb"!==u)return null;s=[s[3],s[2],s[1],s[0]]}var l=[];for(var c in s)if(0===s[c].value)l[c]=new n.ComputedLength(0,0);else if(l[c]=n.toComputedLength(s[c].value,s[c].unit,i.styleAttrs[e.byName.fontSize.qname],"0"===c||"2"===c?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,"0"===c||"2"===c?t.cellLength.h:t.cellLength.w,"0"===c||"2"===c?t.pxLength.h:t.pxLength.w),null===l[c])return null;return l})),new r(t.ns_tts,"position","top left",["region"],!1,!0,(function(e){return n.parsePosition(e)}),(function(t,r,i,a){var o,s;return null===(o=n.toComputedLength(a.v.offset.value,a.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))?null:("bottom"===a.v.edge&&(o=new n.ComputedLength(-o.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-o.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),s=n.toComputedLength(a.h.offset.value,a.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),null===o?null:("right"===a.h.edge&&(s=new n.ComputedLength(t.dimensions.w.rw-s.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-s.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:o,w:s}))})),new r(t.ns_tts,"ruby","none",["span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(e){return"center"!==e&&"spaceAround"!==e?null:e}),null),new r(t.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(e){var t=e.split(" "),r=[null,null];if(0===t.length||t.length>2)return null;if("none"!==t[0]&&"both"!==t[0]&&"after"!==t[0]&&"before"!==t[0]&&"outside"!==t[0])return null;if(r[0]=t[0],2===t.length&&"none"!==t[0]){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r}),(function(t,r,i,a,o){if("none"===a[0])return a;var s=null;return null===(s=null===a[1]?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(a[1].value,a[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))?null:[a[0],s]})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textCombine","none",["span"],!0,!0,(function(e){var t=e.split(" ");return 1!==t.length||"none"!==t[0]&&"all"!==t[0]?null:[t[0]]}),null),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(e){var t=e.split(" "),r={style:null,symbol:null,color:null,position:null};for(var i in t)if("none"===t[i]||"auto"===t[i])r.style=t[i];else if("filled"===t[i]||"open"===t[i])r.style=t[i];else if("circle"===t[i]||"dot"===t[i]||"sesame"===t[i])r.symbol=t[i];else if("current"===t[i])r.color=t[i];else if("outside"===t[i]||"before"===t[i]||"after"===t[i])r.position=t[i];else if(r.color=n.parseColor(t[i]),null===r.color)return null;return null==r.style&&null==r.symbol?r.style="auto":(r.symbol=r.symbol||"circle",r.style=r.style||"filled"),r.position=r.position||"outside",r.color=r.color||"current",r}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,r,i,a,o){if("none"===a)return a;var s={};return null===a.color?s.color=i.styleAttrs[e.byName.color.qname]:s.color=a.color,s.thickness=n.toComputedLength(a.thickness.value,a.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),null===s.thickness?null:s})),new r(t.ns_tts,"textShadow","none",["span"],!0,!0,n.parseTextShadow,(function(t,r,i,a){if("none"===a)return a;var o=[];for(var s in a){var u={};if(u.x_off=n.toComputedLength(a[s][0].value,a[s][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),null===u.x_off)return null;if(u.y_off=n.toComputedLength(a[s][1].value,a[s][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.y_off)return null;if(null===a[s][2])u.b_radius=0;else if(u.b_radius=n.toComputedLength(a[s][2].value,a[s][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.b_radius)return null;null===a[s][3]?u.color=i.styleAttrs[e.byName.color.qname]:u.color=a[s][3],o.push(u)}return o})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,r,i,a){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){"use strict";(function(e){
|
|
372
|
+
var r={parseBuffer:function(e){return new i(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new i},createBox:function(e,t,n){var r=a.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,n){var i=r.createBox(e,t,n);return i.version=0,i.flags=0,i},Utils:{}};r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},r.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=r.parseBuffer,t.addBoxProcessor=r.addBoxProcessor,t.createFile=r.createFile,t.createBox=r.createBox,t.createFullBox=r.createFullBox,t.Utils=r.Utils,r.Cursor=function(e){this.offset=void 0===e?0:e};var i=function(e){this._cursor=new r.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};i.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},i.prototype.fetchAll=function(e,t){var n=[];return i._sweep.call(this,e,n,t),n},i.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=a.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},i._sweep=function(e,t,n){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;i._sweep.call(this.boxes[r],e,t,n)}},i.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},i.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)};var a=function(){this._cursor=new r.Cursor};a.parse=function(e){var t=new a;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},a.create=function(e){var t=new a;return t.type=e,t.boxes=[],t},a.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],a.prototype._boxProcessors={},a.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},a.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},a.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},a.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},a.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},a.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},a.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(a.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},a.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},a.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},a.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},a.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},a.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},a.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},a.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(a.parse(this))},a.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)},a.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},a.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},a.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},a.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},a.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},a.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},a.prototype._writeUTF8String=function(e){var t=r.Utils.utf8ToByteArray(e);if(this._rawo)for(var n=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)n.setUint8(i,t[i]);else this.size+=t.length},a.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},a.prototype._boxProcessors.avc1=a.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},a.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},a.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},a.prototype._boxProcessors.free=a.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},a.prototype._boxProcessors.ftyp=a.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},a.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},a.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(1)),i=c(n(3)),a=c(n(5)),o=c(n(0)),s=c(n(2)),u=n(69),l=n(15);function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=(0,i.default)(e).getInstance(),n=void 0,o=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0;function w(e){var t=f[e].kind,n=void 0!==f[e].id?f[e].id:f[e].lang,r=f[e].lang,i=f[e].isTTML,a=f[e].isEmbedded;return d.addTextTrack(t,n,r,i,a)}function R(e,t,n,r,i,a){var o=0,s=0;e/t>n/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,c=0,d=0;return o/s>i?(d=s,c=s*i):(c=o,d=o/i),u=(e-c)/2,l=(t-d)/2,a?{x:u+.1*c,y:l+.1*d,w:.8*c,h:.8*d}:{x:u,y:l,w:c,h:d}}function D(e,n){var r=d.getClientWidth(),i=d.getClientHeight(),o=d.getVideoWidth(),s=d.getVideoHeight(),u=d.getVideoRelativeOffsetTop(),l=d.getVideoRelativeOffsetLeft();if(0!==o&&0!==s){var c=o/s,f=!1;e.isFromCEA608&&(c=3.5/3,f=!0);var h=R.call(this,r,i,o,s,c,f),p=h.w,T=h.h,S=h.x,I=h.y;if(p!=m||T!=y||S!=g||I!=v||n){if(g=S+l,v=I+u,m=p,y=T,E){var w=E.style;w&&(w.left=g+"px",w.top=v+"px",w.width=m+"px",w.height=y+"px",w.zIndex=_&&document[_]||b?A:null,t.trigger(a.default.CAPTION_CONTAINER_RESIZE))}var D=e.activeCues;if(D)for(var C=D.length,M=0;M<C;++M){var L=D[M];L.scaleCue(L)}}}}function C(e){var t=m,n=y,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e.cellResolution){var u=[t/e.cellResolution[0],n/e.cellResolution[1]];if(e.linePadding)for(r in e.linePadding)if(e.linePadding.hasOwnProperty(r)){i=(e.linePadding[r]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),c=0;c<l.length;c++)l[c].style.cssText=l[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i),l[c].style.cssText=l[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.fontSize){for(r in e.fontSize)if(e.fontSize.hasOwnProperty(r)){"%"===e.fontSize[r][0]?a=e.fontSize[r][1]/100:"c"===e.fontSize[r][0]&&(a=e.fontSize[r][1]),i=(a*u[1]).toString(),s="defaultFontSize"!==r?document.getElementsByClassName(r):document.getElementsByClassName("paragraph");for(var d=0;d<s.length;d++)s[d].style.cssText=s[d].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.lineHeight)for(r in e.lineHeight)if(e.lineHeight.hasOwnProperty(r)){"%"===e.lineHeight[r][0]?o=e.lineHeight[r][1]/100:"c"===e.fontSize[r][0]&&(o=e.lineHeight[r][1]),i=(o*u[1]).toString(),s=document.getElementsByClassName(r);for(var f=0;f<s.length;f++)s[f].style.cssText=s[f].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&E.removeChild(h),M(e)}}function M(e){if(E){var n=document.createElement("div");E.appendChild(n),S=(0,u.renderHTML)(e.isd,n,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var o=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[o]}return null}),E.clientHeight,E.clientWidth,!1,(function(e){o.info("renderCaption :",e)}),S,!0),n.id=e.cueID,t.trigger(a.default.CAPTION_RENDERED,{captionDiv:n,currentTrackIdx:p})}}function L(e){return e>=0&&f[e]?d.getTextTrack(f[e].kind,f[e].id,f[e].lang,f[e].isTTML,f[e].isEmbedded):null}function N(e){var t=this;if(e!==p){var n=L(p=e);O.call(this,n),T&&(clearInterval(T),T=null),n&&"html"===n.renderingType&&(D.call(this,n,!0),window.ResizeObserver?(I=new window.ResizeObserver((function(){D.call(t,n,!0)}))).observe(d.getElement()):T=setInterval(D.bind(this,n),500))}}function O(e){U.call(this),e&&"html"===e.renderingType?k.call(this):F.call(this)}function x(e,t,n){return(isNaN(t)||e.startTime>=t)&&(isNaN(n)||e.endTime<=n)}function P(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)x(r[i],t,n)&&e.removeCue(r[i])}function k(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,n=d.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){o.info(""+e.message)}}}function F(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function U(){if(E)for(;E.firstChild;)E.removeChild(E.firstChild)}return n={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(c=window.VTTCue||window.TextTrackCue,f=[],h=[],p=-1,g=0,v=0,m=0,y=0,E=null,T=null,b=!1,A=2147483647,S=null,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},setDisplayCConTop:function(e){(0,l.checkParameterType)(e,"boolean"),b=e,E&&!document[_]&&(E.style.zIndex=e?A:null)},addTextTrack:function(e,n){if(f.length!==n){if(f.push(e),f.length===n){f.sort((function(e,t){return e.index-t.index})),E=d.getTTMLRenderingDiv();for(var i=-1,s=0;s<f.length;s++){var u=w.call(this,s);h.push(u),f[s].defaultTrack&&(u.default=!0,i=s);var l=L(s);l&&(l.mode=r.default.TEXT_SHOWING,E&&(f[s].isTTML||f[s].isEmbedded)?l.renderingType="html":l.renderingType="default"),this.addCaptions(s,0,f[s].captionData),t.trigger(a.default.TEXT_TRACK_ADDED)}if(N.call(this,i),i>=0){t.on(a.default.PLAYBACK_METADATA_LOADED,(function e(){var n=L(i);n&&D.call(this,n,!0),t.off(a.default.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var c=0;c<f.length;c++){var g=L(c);g&&(g.mode=c===i?r.default.TEXT_SHOWING:r.default.TEXT_HIDDEN)}}t.trigger(a.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:p,tracks:f})}}else o.error("Trying to add too many tracks.")},addCaptions:function(e,n,i){var s=L(e),u=this;if(s&&Array.isArray(i)&&0!==i.length)for(var l=0;l<i.length;l++){var d=void 0,f=i[l];s.cellResolution=f.cellResolution,s.isFromCEA608=f.isFromCEA608,"html"===f.type&&E?((d=new c(f.start-n,f.end-n,"")).cueHTMLElement=f.cueHTMLElement,d.isd=f.isd,d.images=f.images,d.embeddedImages=f.embeddedImages,d.cueID=f.cueID,d.scaleCue=C.bind(u),d.cellResolution=f.cellResolution,d.lineHeight=f.lineHeight,d.linePadding=f.linePadding,d.fontSize=f.fontSize,E.style.left=g+"px",E.style.top=v+"px",E.style.width=m+"px",E.style.height=y+"px",d.onenter=function(){s.mode===r.default.TEXT_SHOWING&&(this.isd?(M(this),o.debug("Cue enter id:"+this.cueID)):(E.appendChild(this.cueHTMLElement),C.call(u,this),t.trigger(a.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:p})))},d.onexit=function(){if(E)for(var e=E.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(o.debug("Cue exit id:"+e[t].id),E.removeChild(e[t]),--t)}):f.data&&(d=new c(f.start-n,f.end-n,f.data),f.styles&&(void 0!==f.styles.align&&"align"in d&&(d.align=f.styles.align),void 0!==f.styles.line&&"line"in d&&(d.line=f.styles.line),void 0!==f.styles.position&&"position"in d&&(d.position=f.styles.position),void 0!==f.styles.size&&"size"in d&&(d.size=f.styles.size)),d.onenter=function(){s.mode===r.default.TEXT_SHOWING&&t.trigger(a.default.CAPTION_RENDERED,{currentTrackIdx:p})});try{d?s.addCue(d):o.error("impossible to display subtitles.")}catch(e){throw P(s),s.addCue(d),e}}},getCurrentTrackIdx:function(){return p},setCurrentTrackIdx:N,getTrackIdxForId:function(e){for(var t=-1,n=0;n<f.length;n++)if(f[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return f[p]},setModeForTrackIdx:function(e,t){var n=L(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=L(e);r&&P(r,t,n)},deleteAllTextTracks:function(){for(var e=h?h.length:0,t=0;t<e;t++){var n=L(t);n&&(P.call(this,n),n.mode="disabled")}h=[],f=[],T&&(clearInterval(T),T=null),I&&d&&(I.unobserve(d.getElement()),I=null),p=-1,U.call(this)},deleteTextTrack:function(e){d.removeChild(h[e]),h.splice(e,1)},setConfig:function(e){e&&e.videoModel&&(d=e.videoModel)}},o=(0,s.default)(e).getInstance().getLogger(n),n}d.__dashjs_factory_name="TextTracks",t.default=o.default.getSingletonFactory(d)},function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,o,s){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=o,this.compute=s}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,1);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(1,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"fontFamily","default",["span"],!0,!0,(function(e){var t=e.split(","),n=[];for(var r in t)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"shear","0%",["p"],!0,!0,n.parseLength,(function(e,t,n,r){return"%"!==r.unit?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value})),new r(t.ns_tts,"fontSize","1c",["span"],!0,!0,n.parseLength,(function(t,r,i,a,o){return n.toComputedLength(a.value,a.unit,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,t.cellLength.h,t.pxLength.h)})),new r(t.ns_tts,"fontStyle","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,r,i,a,o){var s;if("normal"===a)s=a;else if(null===(s=n.toComputedLength(a.value,a.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)))return null;return s})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,0);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(0,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;var r=[];for(var i in t){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,r,i,a,o){var s;if(1===a.length)s=[a[0],a[0],a[0],a[0]];else if(2===a.length)s=[a[0],a[1],a[0],a[1]];else if(3===a.length)s=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;s=[a[0],a[1],a[2],a[3]]}var u=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===u||"lr"===u)s=[s[0],s[3],s[2],s[1]];else if("rltb"===u||"rl"===u)s=[s[0],s[1],s[2],s[3]];else if("tblr"===u)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==u&&"tb"!==u)return null;s=[s[3],s[2],s[1],s[0]]}var l=[];for(var c in s)if(0===s[c].value)l[c]=new n.ComputedLength(0,0);else if(l[c]=n.toComputedLength(s[c].value,s[c].unit,i.styleAttrs[e.byName.fontSize.qname],"0"===c||"2"===c?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,"0"===c||"2"===c?t.cellLength.h:t.cellLength.w,"0"===c||"2"===c?t.pxLength.h:t.pxLength.w),null===l[c])return null;return l})),new r(t.ns_tts,"position","top left",["region"],!1,!0,(function(e){return n.parsePosition(e)}),(function(t,r,i,a){var o,s;return null===(o=n.toComputedLength(a.v.offset.value,a.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))?null:("bottom"===a.v.edge&&(o=new n.ComputedLength(-o.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-o.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),s=n.toComputedLength(a.h.offset.value,a.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),null===o?null:("right"===a.h.edge&&(s=new n.ComputedLength(t.dimensions.w.rw-s.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-s.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:o,w:s}))})),new r(t.ns_tts,"ruby","none",["span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(e){return"center"!==e&&"spaceAround"!==e?null:e}),null),new r(t.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(e){var t=e.split(" "),r=[null,null];if(0===t.length||t.length>2)return null;if("none"!==t[0]&&"both"!==t[0]&&"after"!==t[0]&&"before"!==t[0]&&"outside"!==t[0])return null;if(r[0]=t[0],2===t.length&&"none"!==t[0]){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r}),(function(t,r,i,a,o){if("none"===a[0])return a;var s=null;return null===(s=null===a[1]?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(a[1].value,a[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))?null:[a[0],s]})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textCombine","none",["span"],!0,!0,(function(e){var t=e.split(" ");return 1!==t.length||"none"!==t[0]&&"all"!==t[0]?null:[t[0]]}),null),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(e){var t=e.split(" "),r={style:null,symbol:null,color:null,position:null};for(var i in t)if("none"===t[i]||"auto"===t[i])r.style=t[i];else if("filled"===t[i]||"open"===t[i])r.style=t[i];else if("circle"===t[i]||"dot"===t[i]||"sesame"===t[i])r.symbol=t[i];else if("current"===t[i])r.color=t[i];else if("outside"===t[i]||"before"===t[i]||"after"===t[i])r.position=t[i];else if(r.color=n.parseColor(t[i]),null===r.color)return null;return null==r.style&&null==r.symbol?r.style="auto":(r.symbol=r.symbol||"circle",r.style=r.style||"filled"),r.position=r.position||"outside",r.color=r.color||"current",r}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,r,i,a,o){if("none"===a)return a;var s={};return null===a.color?s.color=i.styleAttrs[e.byName.color.qname]:s.color=a.color,s.thickness=n.toComputedLength(a.thickness.value,a.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),null===s.thickness?null:s})),new r(t.ns_tts,"textShadow","none",["span"],!0,!0,n.parseTextShadow,(function(t,r,i,a){if("none"===a)return a;var o=[];for(var s in a){var u={};if(u.x_off=n.toComputedLength(a[s][0].value,a[s][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),null===u.x_off)return null;if(u.y_off=n.toComputedLength(a[s][1].value,a[s][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.y_off)return null;if(null===a[s][2])u.b_radius=0;else if(u.b_radius=n.toComputedLength(a[s][2].value,a[s][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.b_radius)return null;null===a[s][3]?u.color=i.styleAttrs[e.byName.color.qname]:u.color=a[s][3],o.push(u)}return o})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,r,i,a){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){"use strict";(function(e){
|
|
373
373
|
/*!
|
|
374
374
|
* The buffer module from node.js, for the browser.
|
|
375
375
|
*
|
|
376
376
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
377
377
|
* @license MIT
|
|
378
378
|
*/
|
|
379
|
-
var r=n(115),i=n(116),a=n(70);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(c(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=n;a<s;a++)if(l(e,a)===l(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,f=0;f<u;f++)if(l(e,a+f)!==l(t,f)){d=!1;break}if(d)return a}return-1}function E(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function T(e,t,n,r){return H(G(t,e.length-n),e,n,r)}function _(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return _(e,t,n,r)}function S(e,t,n,r){return H(j(t),e,n,r)}function A(e,t,n,r){return H(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,l=e[i],c=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),d=0;d<s;++d)if(l[d]!==c[d]){a=l[d],o=c[d];break}return a<o?-1:o<a?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=B(e[a]);return i}function M(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function L(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function x(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function P(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function k(e,t,n,r,a){return a||P(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,a){return a||P(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=u.isBuffer(e)?e:G(new u(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function j(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(14))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(){void 0!==a&&e.removeListener("error",a),n([].slice.call(arguments))}var a;"error"!==t&&(a=function(n){e.removeListener(t,i),r(n)},e.once("error",a)),e.once(t,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,s;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):v(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=v(u,l);for(n=0;n<l;++n)a(c[n],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(71)).Stream=t,t.Readable=t,t.Writable=n(49),t.Duplex=n(17),t.Transform=n(74),t.PassThrough=n(124)},function(e,t,n){"use strict";(function(t,r,i){var a=n(37);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;y.WritableState=m;var l=Object.create(n(28));l.inherits=n(21);var c={deprecate:n(123)},d=n(72),f=n(38).Buffer,h=i.Uint8Array||function(){};var p,g=n(73);function v(){}function m(e,t){s=s||n(17),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===e.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),A(e,t))}(e,n,r,t,i);else{var o=b(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?u(T,e,n,o,i):T(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||n(17),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),d.call(this)}function E(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function T(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),A(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,E(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,d=n.callback;if(E(e,t,!1,t.objectMode?1:l.length,l,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=b(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(y,d),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof m)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,s=!i.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=v),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,s,r,i,a);return u}(this,i,s,e,t,n)),o},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=g.destroy,y.prototype._undestroy=g.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(36),n(121).setImmediate,n(14))},function(e,t,n){"use strict";var r=n(38).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}o.__dashjs_factory_name="InitCache",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}o.__dashjs_factory_name="RequestModifier",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(){r(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};i.INITIAL_PLAYOUT_START_REASON="initial_playout",i.SEEK_START_REASON="seek",i.RESUME_FROM_PAUSE_START_REASON="resume",i.METRICS_COLLECTION_START_REASON="metrics_collection_start";var a=function e(){r(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};a.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",a.REBUFFERING_REASON="rebuffering",a.USER_REQUEST_STOP_REASON="user_request",a.END_OF_PERIOD_STOP_REASON="end_of_period",a.END_OF_CONTENT_STOP_REASON="end_of_content",a.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",a.FAILURE_STOP_REASON="failure",t.PlayList=i,t.PlayListTrace=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).requestModifier;return{load:function(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&(i=t.modifyRequestHeader(i)),e.headers)for(var a in e.headers){var o=e.headers[a];o&&i.setRequestHeader(a,o)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}o.__dashjs_factory_name="XHRLoader";var s=a.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=T(n(1)),i=T(n(9)),a=T(n(167)),o=T(n(168)),s=T(n(169)),u=T(n(170)),l=T(n(83)),c=T(n(84)),d=T(n(85)),f=T(n(171)),h=T(n(86)),p=T(n(13)),g=T(n(0)),v=T(n(2)),m=T(n(6)),y=T(n(11)),E=n(57);function T(e){return e&&e.__esModule?e:{default:e}}function _(){var e=void 0,t=void 0,n=void 0,g=void 0,T=this.context,_=(0,p.default)(T).getInstance(),b=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function S(e,t){var n=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=!1,d=!1;if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.hasOwnProperty("ContentComponent_asArray")&&(s=e.ContentComponent_asArray),u=t!==r.default.TEXT?new RegExp(t):new RegExp("(vtt|ttml)"),e.Representation_asArray&&e.Representation_asArray.length&&e.Representation_asArray.length>0){var f=x(e.Representation_asArray[0]);if(f&&f.length>0&&E.THUMBNAILS_SCHEME_ID_URIS.indexOf(f[0].schemeIdUri)>=0)return t===r.default.IMAGE;if(e.Representation_asArray[0].hasOwnProperty(i.default.CODECS)&&(0===(l=e.Representation_asArray[0].codecs).search(r.default.STPP)||0===l.search(r.default.WVTT)))return t===r.default.FRAGMENTED_TEXT}if(s){if(s.length>1)return t===r.default.MUXED;s[0]&&s[0].contentType===t&&(c=!0,d=!0)}if(e.hasOwnProperty(i.default.MIME_TYPE)&&(c=u.test(e.mimeType),d=!0),!d)for(n=0,a=e.Representation_asArray&&e.Representation_asArray.length?e.Representation_asArray.length:0;!d&&n<a;)(o=e.Representation_asArray[n]).hasOwnProperty(i.default.MIME_TYPE)&&(c=u.test(o.mimeType),d=!0),n++;return c}function A(e){return S(e,r.default.AUDIO)}function I(e){return S(e,r.default.VIDEO)}function w(e){return S(e,r.default.FRAGMENTED_TEXT)}function R(e){return S(e,r.default.IMAGE)}function D(e){return"text/vtt"===e||"application/ttml+xml"===e}function C(){return function(e,t){return e.bandwidth-t.bandwidth}}function M(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function L(e,t){return e&&e.Period_asArray&&b(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function N(e){return e&&e.Period_asArray?e.Period_asArray:[]}function O(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===i.default.DYNAMIC),t}function x(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function P(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=s.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(i.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function k(e,t){var n=[],a=void 0;if(!e)return n;for(a=0;a<e.length;a++){var o=new f.default;if(o.timescale=1,o.representation=t,!e[a].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");o.schemeIdUri=e[a].schemeIdUri,e[a].hasOwnProperty(i.default.TIMESCALE)&&(o.timescale=e[a].timescale),e[a].hasOwnProperty(i.default.VALUE)&&(o.value=e[a].value),n.push(o)}return n}function F(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var a=new d.default,o=n.__text||n;return _.isRelative(o)&&(r=!0,e.baseUri&&(o=_.resolve(o,e.baseUri))),a.url=o,n.hasOwnProperty(i.default.SERVICE_LOCATION)&&n.serviceLocation.length?a.serviceLocation=n.serviceLocation:a.serviceLocation=o,n.hasOwnProperty(i.default.DVB_PRIORITY)&&(a.dvb_priority=n[i.default.DVB_PRIORITY]),n.hasOwnProperty(i.default.DVB_WEIGHT)&&(a.dvb_weight=n[i.default.DVB_WEIGHT]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)&&(a.availabilityTimeOffset=n[i.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)&&(a.availabilityTimeComplete="false"!==n[i.default.AVAILABILITY_TIME_COMPLETE]),t.push(a),r}})),t}return e={getIsTypeOf:S,getIsTextTrack:D,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(i.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var r=L(t,n);return r.length>0&&b(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=L(t,n),i=0;i<r.length;i++){if((0,h.default)(T).getInstance().areEqual(r[i],e))return i}return-1},getAdaptationForId:function(e,t,n){var r,a=L(t,n),o=void 0;for(o=0,r=a.length;o<r;o++)if(a[o].hasOwnProperty(i.default.ID)&&a[o].id===e)return a[o];return null},getAdaptationsForType:function(e,t,n){var r,i=L(e,t),a=void 0,o=[];for(a=0,r=i.length;a<r;a++)S(i[a],n)&&o.push(M(i[a]));return o},getRealPeriods:N,getRealPeriodForIndex:function(e,t){var n=N(t);return n.length>0&&b(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=b(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(i.default.CENC_DEFAULT_KID)?e[i.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(i.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:O,getId:function(e){return e&&e[i.default.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(i.default.PUBLISH_TIME)?new Date(e[i.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=M(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&b(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,o,s,u=[],l=function(e){if(e&&e.period&&b(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&b(e.index))return M(t.AdaptationSet_asArray[e.index])}}(e),c=void 0,d=void 0;if(l&&l.Representation_asArray){if(e&&e.period&&b(e.period.index)){var f=F(e.period.mpd.manifest);f&&(d=f[0])}for(var h=0,p=l.Representation_asArray.length;h<p;++h){var g=l.Representation_asArray[h],v=new a.default;if(v.index=h,v.adaptation=e,g.hasOwnProperty(i.default.ID)&&(v.id=g.id),g.hasOwnProperty(i.default.CODECS)&&(v.codecs=g.codecs),g.hasOwnProperty(i.default.CODEC_PRIVATE_DATA)&&(v.codecPrivateData=g.codecPrivateData),g.hasOwnProperty(i.default.BANDWITH)&&(v.bandwidth=g.bandwidth),g.hasOwnProperty(i.default.WIDTH)&&(v.width=g.width),g.hasOwnProperty(i.default.HEIGHT)&&(v.height=g.height),g.hasOwnProperty(i.default.SCAN_TYPE)&&(v.scanType=g.scanType),g.hasOwnProperty(i.default.MAX_PLAYOUT_RATE)&&(v.maxPlayoutRate=g.maxPlayoutRate),g.hasOwnProperty(i.default.SEGMENT_BASE)?(c=g.SegmentBase,v.segmentInfoType=i.default.SEGMENT_BASE):g.hasOwnProperty(i.default.SEGMENT_LIST)?(c=g.SegmentList).hasOwnProperty(i.default.SEGMENT_TIMELINE)?v.segmentInfoType=i.default.SEGMENT_TIMELINE:v.segmentInfoType=i.default.SEGMENT_LIST:g.hasOwnProperty(i.default.SEGMENT_TEMPLATE)?((c=g.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)?v.segmentInfoType=i.default.SEGMENT_TIMELINE:v.segmentInfoType=i.default.SEGMENT_TEMPLATE,c.hasOwnProperty(i.default.INITIALIZATION_MINUS)&&(v.initialization=c.initialization.split("$Bandwidth$").join(g.bandwidth).split("$RepresentationID$").join(g.id))):v.segmentInfoType=i.default.BASE_URL,v.essentialProperties=x(g),c){if(c.hasOwnProperty(i.default.INITIALIZATION)){var m=c.Initialization;m.hasOwnProperty(i.default.SOURCE_URL)&&(v.initialization=m.sourceURL),m.hasOwnProperty(i.default.RANGE)&&(v.range=m.range)}else g.hasOwnProperty(i.default.MIME_TYPE)&&D(g.mimeType)&&(v.range=0);c.hasOwnProperty(i.default.TIMESCALE)&&(v.timescale=c.timescale),c.hasOwnProperty(i.default.DURATION)?v.segmentDuration=c.duration/v.timescale:g.hasOwnProperty(i.default.SEGMENT_TEMPLATE)&&(c=g.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)&&(v.segmentDuration=(r=c.SegmentTimeline,o=void 0,s=void 0,o=r.S_asArray[0],s=r.S_asArray[1],(o.hasOwnProperty("d")?o.d:s.t-o.t)/v.timescale)),c.hasOwnProperty(i.default.MEDIA)&&(v.media=c.media),c.hasOwnProperty(i.default.START_NUMBER)&&(v.startNumber=c.startNumber),c.hasOwnProperty(i.default.INDEX_RANGE)&&(v.indexRange=c.indexRange),c.hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(v.presentationTimeOffset=c.presentationTimeOffset/v.timescale),c.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)?v.availabilityTimeOffset=c.availabilityTimeOffset:d&&void 0!==d.availabilityTimeOffset&&(v.availabilityTimeOffset=d.availabilityTimeOffset),c.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)?v.availabilityTimeComplete="false"!==c.availabilityTimeComplete:d&&void 0!==d.availabilityTimeComplete&&(v.availabilityTimeComplete=d.availabilityTimeComplete)}v.MSETimeOffset=(n=void 0,void 0,n=(t=v).presentationTimeOffset,t.adaptation.period.start-n),v.path=[e.period.index,e.index,h],u.push(v)}}return u},getAdaptationsForPeriod:function(e){var t=e&&b(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,n=[],a=void 0,s=void 0,u=void 0;if(t&&t.AdaptationSet_asArray)for(u=0;u<t.AdaptationSet_asArray.length;u++)s=t.AdaptationSet_asArray[u],a=new o.default,s.hasOwnProperty(i.default.ID)&&(a.id=s.id),a.index=u,a.period=e,S(s,r.default.MUXED)?a.type=r.default.MUXED:A(s)?a.type=r.default.AUDIO:I(s)?a.type=r.default.VIDEO:w(s)?a.type=r.default.FRAGMENTED_TEXT:R(s)?a.type=r.default.IMAGE:a.type=r.default.TEXT,n.push(a);return n},getRegularPeriods:function(e){var a,o=!!e&&O(e.manifest),u=[],l=null,c=null,d=null,f=null,h=void 0;for(h=0,a=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;h<a;h++)(c=e.manifest.Period_asArray[h]).hasOwnProperty(i.default.START)?(f=new s.default).start=c.start:null!==l&&l.hasOwnProperty(i.default.DURATION)&&null!==d?(f=new s.default).start=parseFloat((d.start+d.duration).toFixed(5)):0!==h||o||((f=new s.default).start=0),null!==d&&isNaN(d.duration)&&(null!==f?d.duration=parseFloat((f.start-d.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==f&&(f.id=P(c,h),f.index=h,f.mpd=e,c.hasOwnProperty(i.default.DURATION)&&(f.duration=c.duration),u.push(f),l=c,d=f),c=null,f=null;return 0===u.length||null!==d&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(r.default.MISSING_CONFIG_ERROR)}();var t=O(e.mpd.manifest),i=void 0;e.mpd.manifest.mediaPresentationDuration?i=e.mpd.manifest.mediaPresentationDuration:e.duration?i=e.duration:t?i=Number.POSITIVE_INFINITY:n.error(new m.default(y.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e));return i}(d)-d.start).toFixed(5))),u},getMpd:function(e){var t=new u.default;return e&&(t.manifest=e,e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(i.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(i.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(i.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(i.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,n=t?t.Period_asArray:null,a=n&&e&&b(e.index)?n[e.index].EventStream_asArray:null,o=[],s=void 0,u=void 0;if(a)for(s=0;s<a.length;s++){var l=new f.default;if(l.period=e,l.timescale=1,!a[s].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(l.schemeIdUri=a[s][r.default.SCHEME_ID_URI],a[s].hasOwnProperty(i.default.TIMESCALE)&&(l.timescale=a[s][i.default.TIMESCALE]),a[s].hasOwnProperty(i.default.VALUE)&&(l.value=a[s][i.default.VALUE]),a[s].hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(l.presentationTimeOffset=a[s][i.default.PRESENTATION_TIME_OFFSET]),u=0;a[s].Event_asArray&&u<a[s].Event_asArray.length;u++){var d=a[s].Event_asArray[u],h=new c.default;if(h.presentationTime=0,h.eventStream=l,d.hasOwnProperty(i.default.PRESENTATION_TIME)){h.presentationTime=d.presentationTime;var p=l.presentationTimeOffset?l.presentationTimeOffset/l.timescale:0;h.calculatedPresentationTime=h.presentationTime/l.timescale+e.start-p}d.hasOwnProperty(i.default.DURATION)&&(h.duration=d.duration/l.timescale),d.hasOwnProperty(i.default.ID)&&(h.id=d.id),d.Signal&&d.Signal.Binary?h.messageData=g.decodeArray(d.Signal.Binary.toString()):h.messageData=d.messageData||d.__text,o.push(h)}}return o},getEssentialPropertiesForRepresentation:x,getEventStreamForAdaptationSet:function(e,t){var n=void 0,r=void 0,i=void 0;return e&&e.Period_asArray&&t&&t.period&&b(t.period.index)&&(r=e.Period_asArray[t.period.index])&&r.AdaptationSet_asArray&&b(t.index)&&(i=r.AdaptationSet_asArray[t.index])&&(n=i.InbandEventStream_asArray),k(n,null)},getEventStreamForRepresentation:function(e,t){var n=void 0,r=void 0,i=void 0,a=void 0;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&b(t.adaptation.period.index)&&(r=e.Period_asArray[t.adaptation.period.index])&&r.AdaptationSet_asArray&&b(t.adaptation.index)&&(i=r.AdaptationSet_asArray[t.adaptation.index])&&i.Representation_asArray&&b(t.index)&&(a=i.Representation_asArray[t.index])&&(n=a.InbandEventStream_asArray),k(n,t)},getUTCTimingSources:function(e){var t=O(e),n=!!e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME),a=e?e.UTCTiming_asArray:null,o=[];return(t||n)&&a&&a.forEach((function(e){var t=new l.default;e.hasOwnProperty(r.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(i.default.VALUE)&&(t.value=e.value.toString(),o.push(t)))})),o},getBaseURLsFromElement:F,getRepresentationSortFunction:C,getLocation:function(e){if(e&&e.hasOwnProperty(r.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(i.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(i.default.SERVICE_DESCRIPTION)){var n=!0,a=!1,o=void 0;try{for(var s,u=e.ServiceDescription_asArray[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var l=s.value,c=void 0,d=void 0,f=void 0,h=void 0;for(var p in l)l.hasOwnProperty(p)&&(p===i.default.ID?c=l[p]:p===i.default.SERVICE_DESCRIPTION_SCOPE?d=l[p].schemeIdUri:p===i.default.SERVICE_DESCRIPTION_LATENCY?f={target:l[p].target,max:l[p].max,min:l[p].min}:p===i.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(h={max:l[p].max,min:l[p].min}));d===r.default.SERVICE_DESCRIPTION_LL_SCHEME&&(f||h)&&t.push({id:c,schemeIdUri:d,latency:f,playbackRate:h})}}catch(e){a=!0,o=e}finally{try{!n&&u.return&&u.return()}finally{if(a)throw o}}}return t},getSupplementalPropperties:function(e){var t={};if(e&&e.hasOwnProperty(i.default.SUPPLEMENTAL_PROPERTY)){var n=!0,a=!1,o=void 0;try{for(var s,u=e.SupplementalProperty_asArray[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var l=s.value;l.hasOwnProperty(r.default.SCHEME_ID_URI)&&l.hasOwnProperty(i.default.VALUE)&&(t[l[r.default.SCHEME_ID_URI]]=l[i.default.VALUE])}}catch(e){a=!0,o=e}finally{try{!n&&u.return&&u.return()}finally{if(a)throw o}}}return t},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(g=e.BASE64))}},t=(0,v.default)(T).getInstance().getLogger(e),e}_.__dashjs_factory_name="DashManifestModel",t.default=g.default.getSingletonFactory(_)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THUMBNAILS_SCHEME_ID_URIS=void 0;var r=h(n(1)),i=h(n(9)),a=h(n(0)),o=h(n(173)),s=h(n(13)),u=n(22),l=h(n(4)),c=h(n(27)),d=h(n(55)),f=h(n(80));function h(e){return e&&e.__esModule?e:{default:e}}var p=t.THUMBNAILS_SCHEME_ID_URIS=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function g(e){var t,n=this.context,a=e.adapter,h=e.baseURLController,g=e.streamInfo,v=e.timelineConverter,m=e.debug,y=e.eventBus,E=e.events,T=e.dashConstants,_=(0,s.default)(n).getInstance(),b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0;function D(){M(),w=(0,d.default)(n).create({}),R=(0,c.default)(n).getInstance(),(S=(0,f.default)(n).create({streamInfo:g,timelineConverter:v,baseURLController:h,debug:m,eventBus:y,events:E,dashConstants:T,urlUtils:_})).initialize(!!a&&a.getIsDynamic()),function(){if(!g||!a)return;if(!(I=a.getMediaInfoForType(g,r.default.IMAGE)))return;var e=a.getVoRepresentations(I);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.default.SEGMENT_TIMELINE)&&C(e),e.segmentInfoType===i.default.SEGMENT_BASE&&C(e,!0)}));b.length>0&&(b.sort((function(e,t){return e.bitrate-t.bitrate})),A=b.length-1)}()}function C(e,t){var n=new o.default;n.id=e.id,n.bitrate=e.bandwidth,n.width=e.width,n.height=e.height,n.tilesHor=1,n.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(p.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(n.tilesHor=parseInt(t[0],10),n.tilesVert=parseInt(t[1],10))}})),t?y.trigger(l.default.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:g.id,mediaType:r.default.IMAGE,mimeType:I.mimeType,representation:e,callback:function(e,t,r,i){var o=[];r=function(e,t){var n,r=[],i=0,o=void 0,s=void 0,l=void 0;for(o=0,n=e.length;o<n;o++)s=e[o],(l=(0,u.getTimeBasedSegment)(v,a.getIsDynamic(),t,s.startTime,s.duration,s.timescale,s.media,s.mediaRange,i))&&(r.push(l),l=null,i++);return r}(r,i),n.segmentDuration=r[0].duration,n.readThumbnail=function(e,t){var n=null;o.some((function(t){if(t.start<=e&&t.end>e)return n=t.url,!0})),n?t(n):r.some((function(n){if(n.mediaStartTime<=e&&n.mediaStartTime+n.duration>e){var r=h.resolve(i.path);return w.load({method:"get",url:r.url,request:{range:n.mediaRange,responseType:"arraybuffer"},onload:function(e){var r=R.getSamplesInfo(e.target.response),i=new Blob([e.target.response.slice(r.sampleList[0].offset,r.sampleList[0].offset+r.sampleList[0].size)],{type:"image/jpeg"}),a=window.URL.createObjectURL(i);o.push({start:n.mediaStartTime,end:n.mediaStartTime+n.duration,url:a}),t&&t(a)}}),!0}}))}}}):(n.startNumber=e.startNumber,n.segmentDuration=e.segmentDuration,n.timescale=e.timescale,n.templateUrl=function(e){var t=_.isRelative(e.media)?_.resolve(e.media,h.resolve(e.path).url):e.media;if(!t)return"";return(0,u.replaceIDForTemplate)(t,e.id)}(e)),n.tilesHor>0&&n.tilesVert>0&&(n.widthPerTile=n.width/n.tilesHor,n.heightPerTile=n.height/n.tilesVert,b.push(n))}function M(){b=[],A=-1,I=null}return t={initialize:D,getTracks:function(){return b},reset:M,setTrackByIndex:function(e){b&&0!==b.length&&(e>=b.length&&(e=b.length-1),A=e)},getCurrentTrack:function(){return A<0?null:b[A]},getCurrentTrackIndex:function(){return A},getThumbnailRequestForTime:function(e){for(var t=void 0,n=a.getVoRepresentations(I),r=0;r<n.length;r++)if(b[A].id===n[r].id){t=n[r];break}return S.getSegmentRequestForTime(I,t,e)}},D(),t}g.__dashjs_factory_name="ThumbnailTracks",t.default=a.default.getClassFactory(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}return r(e,[{key:"toJWK",value:function(){var e=void 0,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,o=new ArrayBuffer(a),s=new Uint8Array(o);for(e=0;e<a;e++)s[e]=i.charCodeAt(e);return o}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=W(n(65)),i=W(n(1)),a=W(n(9)),o=W(n(10)),s=W(n(102)),u=W(n(104)),l=W(n(180)),c=W(n(181)),d=W(n(182)),f=W(n(188)),h=W(n(200)),p=W(n(91)),g=W(n(201)),v=W(n(44)),m=W(n(53)),y=W(n(42)),E=W(n(202)),T=W(n(204)),_=W(n(205)),b=W(n(77)),S=W(n(81)),A=W(n(206)),I=W(n(82)),w=W(n(207)),R=W(n(2)),D=W(n(11)),C=W(n(3)),M=W(n(4)),L=W(n(20)),N=W(n(0)),O=W(n(23)),x=n(92),P=W(n(208)),k=W(n(212)),F=W(n(220)),U=W(n(232)),B=n(8),G=W(n(233)),j=W(n(43)),H=W(n(6)),K=n(15),V=W(n(87)),q=W(n(13)),Y=W(n(27));function W(e){return e&&e.__esModule?e:{default:e}}function z(){var e="You must first call initialize() and set a source before calling this method",t="You must first call initialize() and set a valid source and view before calling this method",n="You must first call attachView() to set the video element before calling this method",W="You must first call attachSource() with a valid source before calling this method",z=this.context,X=(0,C.default)(z).getInstance(),Q=(0,O.default)(z).getInstance(),J=(0,R.default)(z).getInstance({settings:Q}),Z=void 0,$=void 0,ee=void 0,te=void 0,ne=void 0,re=void 0,ie=void 0,ae=void 0,oe=void 0,se=void 0,ue=void 0,le=void 0,ce=void 0,de=void 0,fe=void 0,he=void 0,pe=void 0,ge=void 0,ve=void 0,me=void 0,ye=void 0,Ee=void 0,Te=void 0,_e=void 0,be=void 0,Se=void 0,Ae=void 0,Ie=void 0,we=void 0,Re=void 0,De=void 0,Ce=void 0,Me=void 0,Le=void 0,Ne=void 0,Oe=void 0;function xe(){ze(null),qe(null),te=null,ce&&(ce.reset(),ce=null),de&&(de.reset(),de=null),Me.reset(),Q.reset(),he&&(he.reset(),he=null)}function Pe(){return!!ee&&!!we.getElement()}function ke(){return(0,x.getVersionString)()}function Fe(){if(!ie)throw t;return be.isPaused()}function Ue(e){var t=Se.getCurrentDVRInfo();if(!t)return 0;var n=be.getLiveDelay(),r=t.range.start+e;return r>t.range.end-n&&(r=t.range.end-n),r}function Be(e){if(!ie)throw t;var n=Ve().currentTime;if(void 0!==e)n=Te.getTimeRelativeToStreamId(n,e);else if(be.getIsDynamic()){var r=Se.getCurrentDVRInfo();n=null===r||0===n?0:Math.max(0,n-r.range.start)}return n}function Ge(){if(!ie)throw t;var e=Ve().duration;if(be.getIsDynamic()){var n=Se.getCurrentDVRInfo();e=n?n.range.end-n.range.start:0}return e}function je(e){(0,K.checkParameterType)(e,"boolean"),ae=e}function He(){ge.restoreDefaultUTCTimingSources()}function Ke(){return Se}function Ve(){if(!we.getElement())throw n;return we.getElement()}function qe(e){if(!ne)throw"MediaPlayer not initialized!";we.setElement(e),e&&(Ze(),function(){if(de)return;var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(z).create();de=t.createMetricsReporting({debug:J,eventBus:X,mediaElement:Ve(),adapter:pe,dashMetrics:Se,events:M.default,constants:i.default,metricsConstants:o.default})}}(),function(){if(fe)return;var e=dashjs.MssHandler;"function"==typeof e&&(D.default.extend(e.errors),fe=e(z).create({eventBus:X,mediaPlayerModel:ge,dashMetrics:Se,manifestModel:Ae,playbackController:be,streamController:Te,protectionController:ce,baseURLController:me,errHandler:ve,events:M.default,constants:i.default,debug:J,initSegmentType:B.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:G.default,ISOBoxer:j.default,settings:Q}))}(),Te&&Te.switchToVideoElement()),ie&&Qe(),tt()}function Ye(t){if(!re)throw e;var n=Te.getActiveStreamInfo();return le.getTracksFor(t,n)}function We(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function ze(e){if(!ne)throw"MediaPlayer not initialized!";"string"==typeof e&&De.initialize(e),ee=e,(re||ie)&&Qe(),Pe()&&tt()}function Xe(){if(!re)throw e;var t=Te.getActiveStreamInfo();return t?Te.getStreamById(t.id):null}function Qe(){ie=!1,re=!1,pe.reset(),Te.reset(),_e.reset(),be.reset(),oe.reset(),le.reset(),Re.reset(),ce&&(Q.get().streaming.keepProtectionMediaKeys?ce.stop():(ce.reset(),ce=null,Ze())),Ie.reset()}function Je(){return(0,f.default)(z).create({debug:J,errHandler:ve,dashMetrics:Se,mediaPlayerModel:ge,requestModifier:(0,m.default)(z).getInstance(),mssHandler:fe,settings:Q})}function Ze(){if(ce)return ce;var e=dashjs.Protection;if("function"==typeof e){var t=e(z).create();return M.default.extend(e.events),L.default.extend(e.events,{publicOnly:!0}),D.default.extend(e.errors),ye||(ye=(0,p.default)(z).getInstance()),(ce=t.createProtectionSystem({debug:J,errHandler:ve,videoModel:we,capabilities:ye,eventBus:X,events:M.default,BASE64:G.default,constants:i.default,cmcdModel:Ie,settings:Q}))&&(ce.setLicenseRequestFilters(Le),ce.setLicenseResponseFilters(Ne)),ce}return null}function $e(){if(!ne)throw"MediaPlayer not initialized!";if(he)return he;var e=dashjs.OfflineController;if("function"==typeof e){M.default.extend(e.events),L.default.extend(e.events,{publicOnly:!0}),D.default.extend(e.errors);var t=Je(),n=(0,V.default)(z).create();return n.setConfig({manifestModel:Ae,adapter:pe,manifestLoader:t,errHandler:ve}),he=e(z).create({debug:J,manifestUpdater:n,baseURLController:me,manifestLoader:t,manifestModel:Ae,mediaPlayerModel:ge,abrController:oe,playbackController:be,adapter:pe,errHandler:ve,dashMetrics:Se,timelineConverter:ue,schemeLoaderFactory:se,eventBus:X,events:M.default,errors:D.default,constants:i.default,settings:Q,dashConstants:a.default,urlUtils:(0,q.default)(z).getInstance()})}return null}function et(e){var t=Se.getCurrentDVRInfo();return t?e+(t.manifestInfo.availableFrom.getTime()/1e3+t.range.start):0}function tt(){var e;he&&he.resetRecords(),!re&&ee&&(re=!0,$.info("Streaming Initialized"),e=Je(),Te||(Te=(0,u.default)(z).getInstance()),Ee.setConfig({capabilities:ye,adapter:pe,settings:Q}),Ee.setCustomCapabilitiesFilters(Oe),Te.setConfig({capabilities:ye,capabilitiesFilter:Ee,manifestLoader:e,manifestModel:Ae,mediaPlayerModel:ge,protectionController:ce,adapter:pe,dashMetrics:Se,errHandler:ve,timelineConverter:ue,videoModel:we,playbackController:be,abrController:oe,mediaController:le,textController:Re,settings:Q,baseURLController:me}),_e.setConfig({settings:Q,playbackController:be,streamController:Te,videoModel:we,timelineConverter:ue,adapter:pe}),be.setConfig({streamController:Te,dashMetrics:Se,mediaPlayerModel:ge,adapter:pe,videoModel:we,timelineConverter:ue,uriFragmentModel:De,settings:Q}),oe.setConfig({streamController:Te,domStorage:Ce,mediaPlayerModel:ge,dashMetrics:Se,adapter:pe,videoModel:we,settings:Q}),Re.setConfig({errHandler:ve,manifestModel:Ae,adapter:pe,mediaController:le,streamController:Te,videoModel:we}),Ie.setConfig({abrController:oe,dashMetrics:Se,playbackController:be}),Te.initialize(ae,te),_e.initialize(),Ie.initialize(),"string"==typeof ee?Te.load(ee):Te.loadWithManifest(ee)),!ie&&Pe()&&(ie=!0,$.info("Playback Initialized"))}return Z={initialize:function(e,t,n){ye||(ye=(0,p.default)(z).getInstance()),ve=(0,h.default)(z).getInstance(),ye.supportsMediaSource()?ne||(ne=!0,ue=(0,U.default)(z).getInstance(),oe||(oe=(0,b.default)(z).getInstance()).setConfig({settings:Q}),se||(se=(0,S.default)(z).getInstance()),be||(be=(0,s.default)(z).getInstance()),le||(le=(0,c.default)(z).getInstance()),Te||(Te=(0,u.default)(z).getInstance()),_e||(_e=(0,l.default)(z).getInstance()),Ee||(Ee=(0,g.default)(z).getInstance()),pe=(0,k.default)(z).getInstance(),Ae=(0,T.default)(z).getInstance(),Ie=(0,I.default)(z).getInstance(),Se=(0,F.default)(z).getInstance({settings:Q}),Re=(0,y.default)(z).getInstance(),Ce=(0,w.default)(z).getInstance({settings:Q}),pe.setConfig({constants:i.default,cea608parser:r.default,errHandler:ve,BASE64:G.default}),me||(me=(0,d.default)(z).create()),me.setConfig({adapter:pe}),(Me=(0,P.default)(z).getInstance({dashMetrics:Se,mediaPlayerModel:ge,errHandler:ve,baseURLController:me,events:M.default,eventBus:X,debug:J,boxParser:(0,Y.default)(z).getInstance(),requestModifier:(0,m.default)(z).getInstance(),errors:D.default})).initialize(),le.setConfig({domStorage:Ce,settings:Q}),He(),je(void 0===n||n),$e(),e&&qe(e),t&&ze(t),$.info("[dash.js "+ke()+"] MediaPlayer has been initialized")):ve.error(new H.default(D.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,D.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(ye=e.capabilities),e.capabilitiesFilter&&(Ee=e.capabilitiesFilter),e.streamController&&(Te=e.streamController),e.gapController&&(_e=e.gapController),e.playbackController&&(be=e.playbackController),e.mediaPlayerModel&&(ge=e.mediaPlayerModel),e.abrController&&(oe=e.abrController),e.schemeLoaderFactory&&(se=e.schemeLoaderFactory),e.mediaController&&(le=e.mediaController),e.settings&&(Q=e.settings))},on:function(e,t,n,r){X.on(e,t,n,r)},off:function(e,t,n){X.off(e,t,n)},extend:function(e,t,n){N.default.extend(e,t,n,z)},attachView:qe,attachSource:ze,isReady:Pe,preload:function(){if(we.getElement()||re)return!1;if(!ee)throw W;tt()},play:function(){if(!ie)throw t;(!ae||Fe()&&ie)&&be.play()},isPaused:Fe,pause:function(){if(!ie)throw t;be.pause()},isSeeking:function(){if(!ie)throw t;return be.isSeeking()},isDynamic:function(){if(!ie)throw t;return be.getIsDynamic()},seek:function(e){if(!ie)throw t;if((0,K.checkParameterType)(e,"number"),isNaN(e))throw i.default.BAD_ARGUMENT_ERROR;var n=be.getIsDynamic()?Ue(e):e;be.seek(n)},setPlaybackRate:function(e){Ve().playbackRate=e},getPlaybackRate:function(){return Ve().playbackRate},setMute:function(e){(0,K.checkParameterType)(e,"boolean"),Ve().muted=e},isMuted:function(){return Ve().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw i.default.BAD_ARGUMENT_ERROR;Ve().volume=e},getVolume:function(){return Ve().volume},time:Be,duration:Ge,timeAsUTC:function(){if(!ie)throw t;return Be()<0?NaN:et(Be())},durationAsUTC:function(){if(!ie)throw t;return et(Ge())},getActiveStream:Xe,getDVRWindowSize:function(){var e=Se.getCurrentDVRInfo();return e?e.manifestInfo.DVRWindowSize:0},getDVRSeekOffset:Ue,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),o=i.toLocaleTimeString(t,{hour12:n});return r?o+" "+a:o},getVersion:ke,getDebug:function(){return J},getBufferLength:function(e){var t=[i.default.VIDEO,i.default.AUDIO,i.default.FRAGMENTED_TEXT];if(e){if(-1!==t.indexOf(e)){var n=Ke().getCurrentBufferLevel(e);return n||NaN}return $.warn("getBufferLength requested for invalid type"),NaN}var r=t.map((function(e){return Ye(e).length>0?Ke().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return we?we.getTTMLRenderingDiv():null},getVideoElement:Ve,getSource:function(){if(!ee)throw W;return ee},getCurrentLiveLatency:function(){if(!ne)throw"MediaPlayer not initialized!";return ie?be.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(t){if(!re)throw e;return oe.getTopBitrateInfoFor(t)},setAutoPlay:je,getAutoPlay:function(){return ae},getDashMetrics:Ke,getQualityFor:function(t){if(!re)throw e;if(t===i.default.IMAGE){var n=Xe();if(!n)return-1;var r=n.getThumbnailController();return r?r.getCurrentTrackIndex():-1}return oe.getQualityFor(t)},setQualityFor:function(t,n){if(!re)throw e;if(t===i.default.IMAGE){var r=Xe();if(!r)return;var a=r.getThumbnailController();a&&a.setTrackByIndex(n)}oe.setPlaybackQuality(t,Te.getActiveStreamInfo(),n)},updatePortalSize:function(){oe.setElementSize(),oe.setWindowResizeEventCalled(!0)},setTextDefaultLanguage:function(e){$.warn('setTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use setInitialMediaSettingsFor("fragmentedText", { lang: lang }) instead'),void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.setTextDefaultLanguage(e)},getTextDefaultLanguage:function(){return $.warn('getTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use getInitialMediaSettingsFor("fragmentedText").lang instead'),void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.getTextDefaultLanguage()},setTextDefaultEnabled:function(e){void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.setTextDefaultEnabled(e)},getTextDefaultEnabled:function(){return void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.getTextDefaultEnabled()},enableText:function(e){void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.enableText(e)},enableForcedTextStreaming:function(e){void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.enableForcedTextStreaming(e)},isTextEnabled:function(){return void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.isTextEnabled()},setTextTrack:function(e){if(!ie)throw t;void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.setTextTrack(e)},getBitrateInfoListFor:function(t){if(!re)throw e;var n=Xe();return n?n.getBitrateListFor(t):[]},getStreamsFromManifest:function(t){if(!re)throw e;return pe.getStreamsInfo(t)},getTracksFor:Ye,getTracksForTypeFromManifest:function(t,n,r){if(!re)throw e;return(r=r||pe.getStreamsInfo(n,1)[0])?pe.getAllMediaInfoForType(r,t,n):[]},getCurrentTrackFor:function(t){if(!re)throw e;var n=Te.getActiveStreamInfo();return le.getCurrentTrackFor(t,n)},setInitialMediaSettingsFor:function(e,t){if(!ne)throw"MediaPlayer not initialized!";le.setInitialSettings(e,t),e===i.default.FRAGMENTED_TEXT&&Re.setInitialSettings(t)},getInitialMediaSettingsFor:function(e){if(!ne)throw"MediaPlayer not initialized!";return le.getInitialSettings(e)},setCurrentTrack:function(t){if(!re)throw e;le.setTrack(t)},getTrackSwitchModeFor:function(e){if(!ne)throw"MediaPlayer not initialized!";return le.getSwitchMode(e)},setTrackSwitchModeFor:function(e,t){if(!ne)throw"MediaPlayer not initialized!";le.setSwitchMode(e,t)},setSelectionModeForInitialTrack:function(e){if(!ne)throw"MediaPlayer not initialized!";le.setSelectionModeForInitialTrack(e)},getSelectionModeForInitialTrack:function(){if(!ne)throw"MediaPlayer not initialized!";return le.getSelectionModeForInitialTrack()},addABRCustomRule:function(e,t,n){ge.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){ge.removeABRCustomRule(e)},removeAllABRCustomRule:function(){ge.removeABRCustomRule()},getAverageThroughput:function(e){var t=oe.getThroughputHistory();return t?t.getAverageThroughput(e):0},retrieveManifest:function(e,t){var n=Je(),r=this;X.on(M.default.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),X.off(M.default.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),De.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){ge.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){ge.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){ge.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:He,setXHRWithCredentialsForType:function(e,t){ge.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return ge.getXHRWithCredentialsForType(e)},getProtectionController:function(){return Ze()},attachProtectionController:function(e){ce=e},setProtectionData:function(e){te=e,Te&&Te.setProtectionData(te)},registerLicenseRequestFilter:function(e){Le.push(e),ce&&ce.setLicenseRequestFilters(Le)},registerLicenseResponseFilter:function(e){Ne.push(e),ce&&ce.setLicenseResponseFilters(Ne)},unregisterLicenseRequestFilter:function(e){We(Le,e),ce&&ce.setLicenseRequestFilters(Le)},unregisterLicenseResponseFilter:function(e){We(Ne,e),ce&&ce.setLicenseResponseFilters(Ne)},registerCustomCapabilitiesFilter:function(e){Oe.push(e),Ee&&Ee.setCustomCapabilitiesFilters(Oe)},unregisterCustomCapabilitiesFilter:function(e){We(Oe,e),Ee&&Ee.setCustomCapabilitiesFilters(Oe)},displayCaptionsOnTop:function(e){var t=(0,v.default)(z).getInstance();t.setConfig({videoModel:we}),t.initialize(),t.setDisplayCConTop(e)},attachTTMLRenderingDiv:function(e){if(!we.getElement())throw n;we.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=NaN;return Re&&(e=Re.getCurrentTrackIdx()),e},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=be.getIsDynamic()?Ue(e):e,r=Te.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i){var a=Te.getTimeRelativeToStreamId(n,r.getId());return i.provide(a,t)}t(null)}else t(null)}},getDashAdapter:function(){return pe},getOfflineController:function(){return $e()},getSettings:function(){return Q.get()},updateSettings:function(e){Q.update(e)},resetSettings:function(){Q.reset()},reset:xe,destroy:function(){xe(),Le=[],Ne=[],Oe=[],N.default.deleteSingletonInstances(z)}},$=J.getLogger(Z),ne=!1,ie=!1,re=!1,ae=!0,ce=null,he=null,te=null,pe=null,Me=null,M.default.extend(L.default),ge=(0,_.default)(z).getInstance(),we=(0,A.default)(z).getInstance(),De=(0,E.default)(z).getInstance(),Le=[],Ne=[],Oe=[],Z}z.__dashjs_factory_name="MediaPlayer";var X=N.default.getClassFactory(z);X.events=L.default,X.errors=D.default,N.default.updateClassFactory(z.__dashjs_factory_name,X),t.default=X},function(e,t,n){"use strict";!function(e){var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},i={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},l=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},c=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};c.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var d=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new c(t,n,r,i,a)};d.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var f=function(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new d);this.pos=0,this.currPenState=new c};f.prototype={equals:function(e){for(var t=!0,n=0;n<32;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<32;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<32;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(u.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=32?u.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new f);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){u.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){u.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),u.log("INFO","Rolling up")}else u.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+': "'+a+'"'):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var p=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};p.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,u.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";u.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(u.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){u.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){u.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){u.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){u.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){u.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){u.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){u.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){u.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){u.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){u.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){u.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(u.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,u.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){u.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var g=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new p(1,t),new p(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};g.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,u.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47)&&!((23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127)&&!((16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o=t;o=17===a?t+80:18===a?t+112:t+144,u.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=l(i);u.log("DEBUG","Char codes = "+s.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=s[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}};e.logger=u,e.PenState=c,e.CaptionScreen=h,e.Cea608Parser=g,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],o=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==i&&49==a&&1195456820==o&&3==s};i<t+n;){if(r=e.getUint32(i),6===(31&e.getUint8(i+4)))for(var s=i+5,u=-1;s<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(s),s++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(s),s++;o(u,c,e,s)&&a.push([s,c]),s+=c}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var c=e.getUint8(n);n++,s&&(127&l)+(127&c)!=0&&(0===u?(r[0].push(l),r[0].push(c)):1===u&&(r[1].push(l),r[1].push(c)))}return r}}(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=m(n(1)),i=m(n(10)),a=m(n(26)),o=m(n(67)),s=m(n(133)),u=m(n(77)),l=m(n(3)),c=m(n(4)),d=m(n(0)),f=m(n(2)),h=m(n(51)),p=m(n(6)),g=m(n(11)),v=n(8);function m(e){return e&&e.__esModule?e:{default:e}}function y(e){e=e||{};var t=this.context,n=(0,l.default)(t).getInstance(),d=e.errHandler,m=e.fragmentModel,y=e.representationController,E=e.mediaController,T=e.adapter,_=e.textController,b=e.abrController,S=e.playbackController,A=e.streamInfo,I=e.type,w=e.settings,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0;function Q(e){return T.convertDataToRepresentationInfo(y.getRepresentationForQuality(e))}function J(e,n){if(!V||!e)return null;var r=e[0];if(O)try{k=n&&n[I]?(0,o.default)(t).create(O,r,ne.bind(this),n[I]):(0,o.default)(t).create(O,r,ne.bind(this),null),w.get().streaming.useAppendWindow&&k.updateAppendWindow(A),"function"==typeof k.getBuffer().initialize&&k.getBuffer().initialize(I,A,e,m)}catch(e){D.fatal("Caught error on create SourceBuffer: "+e),d.error(new p.default(g.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,g.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+I))}else k=(0,s.default)(t).create(ne.bind(this));return ye(Q(C)),k}function Z(e){D.info("Init fragment finished loading saving to",I+"'s init cache"),V.save(e.chunk),D.debug("Append Init fragment",I," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),ee(e.chunk)}function $(e){var t=e.chunk;if(z){X=t;var n=k&&k.getAllBufferRanges();n&&n.length>0&&S.getTimeToStreamEnd()>w.get().streaming.stallThreshold&&(D.debug("Clearing buffer because track changed - "+(n.end(n.length-1)+.5)),ge([{start:0,end:n.end(n.length-1)+.5,force:!0}]))}else ee(t)}function ee(e){k.append(e),e.mediaInfo.type===r.default.VIDEO&&Re(c.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function te(e){if(e&&e.length>0)for(var t=0,n=e.length;t<n;t++)D.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",S.getTime())}function ne(e){if(e.error){if(22===e.error.code&&(K=!0,N=.8*Ie(),D.warn("Quota exceeded, Critical Buffer: "+N),N>0)){var t=Math.max(.2*N,1),n=N-t,i=Math.min(w.get().streaming.bufferTimeAtTopQuality,.9*n),a=Math.min(w.get().streaming.bufferTimeAtTopQualityLongForm,.9*n),o={streaming:{bufferToKeep:parseFloat(t.toFixed(5)),bufferTimeAtTopQuality:parseFloat(i.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(a.toFixed(5))}};w.update(o)}22!==e.error.code&&we()||(D.warn("Clearing playback buffer to overcome quota exceed situation"),Re(c.default.QUOTA_EXCEEDED,{criticalBufferLevel:N,quotaExceededTime:e.chunk.start}),ge(pe()))}else{K=!1,(G=e.chunk)&&!isNaN(G.index)&&(x=Math.max(G.index,x),de());var s=k.getAllBufferRanges();if(G.segmentType===v.HTTPRequest.MEDIA_SEGMENT_TYPE)te(s),oe(),function(){if(I!==r.default.AUDIO&&I!==r.default.VIDEO)return;if(isNaN(q))return;var e=S.getTime(),t=le(q,0);if(e===q&&t)return;var n=y.getCurrentRepresentation().segmentDuration;if(!(t=le(q,n)))return;Math.abs(e-q)>n?q<=t.end&&(S.seek(Math.max(q,t.start),!1,!0),q=NaN):e<t.start&&(S.seek(t.start,!1,!0),q=NaN)}();else if(z){var u=S.getTime();D.debug("AppendToBuffer seek target should be "+u),Re(c.default.SEEK_TARGET,{time:u})}var l=!1;U&&(U.indexOf(G)>0&&(l=!0),U=null),G&&!l&&Re(G.endFragment?c.default.BYTES_APPENDED_END_FRAGMENT:c.default.BYTES_APPENDED,{quality:G.quality,startTime:G.start,index:G.index,bufferedRanges:s,mediaType:I})}}function re(e){C!==e.newQuality&&(ye(this.getRepresentationInfo(e.newQuality)),C=e.newQuality)}function ie(e){k&&(q=e.seekTime,M&&(Y=!0,M=!1,P=Number.POSITIVE_INFINITY),I!==r.default.FRAGMENTED_TEXT?function(){if(!k)return;k.waitForUpdateEnd((function(){var e=function(){if(!k)return;var e=[],t=k.getAllBufferRanges();if(!t||0===t.length)return e;var n=S.getTime(),r=t.end(t.length-1)+.5,i=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(i){var o={start:0,end:i.startTime-w.get().streaming.stallThreshold},s=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:i.startTime-i.duration/2,threshold:.01})[0];s&&s.startTime!=i.startTime&&(o.end=s.startTime),o.start<o.end&&o.end>t.start(0)&&e.push(o);var u={start:i.startTime+i.duration+w.get().streaming.stallThreshold,end:r},l=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:i.startTime+i.duration+w.get().streaming.stallThreshold,threshold:.01})[0];l&&l.startTime!==i.startTime&&(u.start=l.startTime+l.duration+w.get().streaming.stallThreshold),u.start<u.end&&u.start<r&&e.push(u)}else D.debug("getAllRangesWithSafetyFactor - No request found in current time position, removing full buffer 0 -",r),e.push({start:0,end:r});return e}();e&&0!==e.length||oe(),ge(e)}))}():oe())}function ae(){q=NaN}function oe(){(!z||I===r.default.FRAGMENTED_TEXT&&_.isTextEnabled())&&ce()}function se(){fe()}function ue(){q=NaN,fe()}function le(e,t){var n=k.getAllBufferRanges(),r=0,i=0,a=null,o=null,s=0,u=void 0,l=void 0,c=isNaN(t)?.15:t;if(null!=n){for(l=0,u=n.length;l<u;l++)if(r=n.start(l),i=n.end(l),null===a)s=Math.abs(r-e),(e>=r&&e<i||s<=c)&&(a=r,o=i);else{if(!((s=r-o)<=c))break;o=i}if(null!==a)return{start:a,end:o}}return null}function ce(){var e,t,n;S&&(e=(isNaN(q)?S.getTime():q)||0,w.get().streaming.jumpGaps&&(t=w.get().streaming.smallGapLimit),L=null===(n=le(e,t))?0:n.end-e,Re(c.default.BUFFER_LEVEL_UPDATED,{bufferLevel:L}),fe())}function de(){x>=P-1&&!M&&void 0===k.discharge&&(M=!0,D.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for "+I),Re(c.default.BUFFERING_COMPLETED))}function fe(){I!==r.default.AUDIO&&I!==r.default.VIDEO||(Y&&!M&&L>0&&S&&S.getTimeToStreamEnd()-L<.1&&(Y=!1,M=!0,D.debug("checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type "+I),Re(c.default.BUFFERING_COMPLETED)),(!w.get().streaming.lowLatencyEnabled&&L<w.get().streaming.stallThreshold||0===L)&&!M?he(i.default.BUFFER_EMPTY):(M||L>=A.manifestInfo.minBufferTime)&&he(i.default.BUFFER_LOADED))}function he(e){B===e||e===i.default.BUFFER_EMPTY&&0===S.getTime()||I===r.default.FRAGMENTED_TEXT&&!_.isTextEnabled()||(B=e,Re(c.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Re(e===i.default.BUFFER_LOADED?c.default.BUFFER_LOADED:c.default.BUFFER_EMPTY),D.debug(e===i.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function pe(){var e=[],t=k.getAllBufferRanges();if(!t||0===t.length)return e;var n=S.getTime(),r=Math.max(0,n-w.get().streaming.bufferToKeep),i=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&S.getIsDynamic())return[];if(t.start(0)<=r){for(var o={start:0,end:r},s=0;s<t.length&&t.end(s)<=r;s++)o.end=t.end(s);o.start<o.end&&e.push(o)}return e}function ge(e){e&&k&&0!==e.length&&(W.push.apply(W,e),H||ve())}function ve(){if(0===W.length||!k)return D.debug("Nothing to prune, halt pruning"),W=[],void(H=!1);var e=k.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return D.debug("SourceBuffer is empty (or does not exist), halt pruning"),W=[],void(H=!1);var t=W.shift();D.debug("Removing buffer from:",t.start,"to",t.end),H=!0,S.getTime()<t.end&&(M=!1,x=0),k.remove(t.start,t.end,t.force)}function me(e){k===e.buffer&&(D.debug("onRemoved buffer from:",e.from,"to",e.to),te(k.getAllBufferRanges()),0===W.length&&(H=!1),e.unintended&&(D.warn("Detected unintended removal from:",e.from,"to",e.to,"setting index handler time to",e.from),Re(c.default.SEEK_TARGET,{time:e.from,mediaType:I,streamId:A.id})),H?ve():(z?(z=!1,X&&ee(X)):ce(),Re(c.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:we(),quotaExceeded:K})))}function ye(e){e&&void 0!==e.MSETimeOffset&&k&&k.updateTimestampOffset&&k.updateTimestampOffset(e.MSETimeOffset)}function Ee(e){e.error||M||ye(e.currentRepresentation)}function Te(e){P=e.request.index,de()}function _e(e){if(e.newMediaInfo.streamInfo.id===A.id&&e.newMediaInfo.type===I){var t=k&&k.getAllBufferRanges();t&&(D.info("Track change asked"),E.getSwitchMode(I)===r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&t&&t.length>0&&S.getTimeToStreamEnd()>w.get().streaming.stallThreshold&&(M=!1,P=Number.POSITIVE_INFINITY))}}function be(){++j*(w.get().streaming.wallclockTimeUpdateInterval/1e3)>=w.get().streaming.bufferPruningInterval&&(j=0,k&&I!==r.default.FRAGMENTED_TEXT&&(M||ge(pe())))}function Se(){fe()}function Ae(e,t){O=e,k&&t&&"function"==typeof k.discharge&&(F=k,J(t))}function Ie(){var e,t=k.getAllBufferRanges(),n=0,r=void 0;if(!t)return n;for(r=0,e=t.length;r<e;r++)n+=t.end(r)-t.start(r);return n}function we(){return Ie()<N}function Re(e,t){var r=t||{};n.trigger(e,r,{streamId:A.id,mediaType:I})}function De(e,t){N=Number.POSITIVE_INFINITY,B=void 0,C=u.default.QUALITY_DEFAULT,P=Number.POSITIVE_INFINITY,x=0,G=null,M=!1,H=!1,K=!1,Y=!1,L=0,j=0,W=[],q=NaN,k&&(e||k.abort(),k.reset(t),k=null),z=!1}return R={initialize:function(e){Ae(e),C=b.getQualityFor(I),n.on(c.default.DATA_UPDATE_COMPLETED,Ee,this),n.on(c.default.INIT_FRAGMENT_LOADED,Z,this),n.on(c.default.MEDIA_FRAGMENT_LOADED,$,this),n.on(c.default.QUALITY_CHANGE_REQUESTED,re,this),n.on(c.default.STREAM_COMPLETED,Te,this),n.on(c.default.PLAYBACK_PLAYING,ue,this),n.on(c.default.PLAYBACK_PROGRESS,oe,this),n.on(c.default.PLAYBACK_TIME_UPDATED,oe,this),n.on(c.default.PLAYBACK_RATE_CHANGED,Se,this),n.on(c.default.PLAYBACK_SEEKING,ie,this),n.on(c.default.PLAYBACK_SEEKED,ae,this),n.on(c.default.PLAYBACK_STALLED,se,this),n.on(c.default.WALLCLOCK_TIME_UPDATED,be,this),n.on(c.default.CURRENT_TRACK_CHANGED,_e,this,{priority:l.default.EVENT_PRIORITY_HIGH}),n.on(c.default.SOURCEBUFFER_REMOVE_COMPLETED,me,this)},getStreamId:function(){return A.id},getType:function(){return I},getBufferControllerType:function(){return"BufferController"},getRepresentationInfo:Q,createBuffer:J,dischargePreBuffer:function(){if(k&&F&&"function"==typeof F.discharge){var e=F.getAllBufferRanges();if(e.length>0){for(var t="Beginning "+I+"PreBuffer discharge, adding buffer for:",n=0;n<e.length;n++)t+=" start: "+e.start(n)+", end: "+e.end(n)+";";D.debug(t)}else D.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");U=[];for(var r=F.discharge(),i=null,a=0;a<r.length;a++){var o=r[a];if("InitializationSegment"!==o.segmentType){var s=V.extract(o.streamId,o.representationId);s&&i!==s&&(U.push(s),k.append(s),i=s)}U.push(o),k.append(o)}F.reset(),F=null}},getBuffer:function(){return k},setBuffer:function(e){k=e},getBufferLevel:function(){return L},getRangeAt:le,setMediaSource:Ae,getMediaSource:function(){return O},appendInitSegment:function(e){var t=V.extract(A.id,e);return!!t&&(D.info("Append Init fragment",I," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),ee(t),!0)},replaceBuffer:function(){z=!0},getIsBufferingCompleted:function(){return M},getIsPruningInProgress:function(){return H},reset:function(e,t){n.off(c.default.DATA_UPDATE_COMPLETED,Ee,this),n.off(c.default.INIT_FRAGMENT_LOADED,Z,this),n.off(c.default.MEDIA_FRAGMENT_LOADED,$,this),n.off(c.default.QUALITY_CHANGE_REQUESTED,re,this),n.off(c.default.STREAM_COMPLETED,Te,this),n.off(c.default.PLAYBACK_PLAYING,ue,this),n.off(c.default.PLAYBACK_PROGRESS,oe,this),n.off(c.default.PLAYBACK_TIME_UPDATED,oe,this),n.off(c.default.PLAYBACK_RATE_CHANGED,Se,this),n.off(c.default.PLAYBACK_SEEKING,ie,this),n.off(c.default.PLAYBACK_SEEKED,ae,this),n.off(c.default.PLAYBACK_STALLED,se,this),n.off(c.default.WALLCLOCK_TIME_UPDATED,be,this),n.off(c.default.CURRENT_TRACK_CHANGED,_e,this),n.off(c.default.SOURCEBUFFER_REMOVE_COMPLETED,me,this),De(e,t)},updateAppendWindow:function(){k&&!M&&k.updateAppendWindow(A)}},D=(0,f.default)(t).getInstance().getLogger(R),V=(0,h.default)(t).getInstance(),De(),R}y.__dashjs_factory_name="BufferController",t.default=d.default.getClassFactory(y)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(2)),i=c(n(6)),a=c(n(3)),o=c(n(4)),s=c(n(0)),u=c(n(42)),l=c(n(11));function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,n,s){var c=this.context,d=(0,a.default)(c).getInstance(),f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=[],E=[],T=n;function _(){try{return g.buffered}catch(e){return p.error("getAllBufferRanges exception: "+e.message),null}}function b(t){g&&D((function(){try{var n=e.duration,r=0;t&&!isNaN(t.start)&&!isNaN(t.duration)&&isFinite(t.duration)&&(n=t.start+t.duration),t&&!isNaN(t.start)&&(r=t.start),g.appendWindowStart=0,g.appendWindowEnd=n,g.appendWindowStart=r,p.debug("Updated append window. Set start to "+g.appendWindowStart+" and end to "+g.appendWindowEnd)}catch(e){p.warn("Failed to set append window")}}))}function S(){var e=this;if(E.length>0){v=!0;var t=E[0];E.splice(0,1);var n=[],r=function(){var r=_();!function(e,t,n,r){t&&t.length>0&&t.length<n.length&&function(e,t){for(var n=0;n<e.length;n++){var r=Math.round(e.start(n)),i=Math.round(e.end(n));if(i===t.start||r===t.end||t.start>=r&&t.end<=i)return!0}return!1}(t,r)&&d.trigger(o.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:e,from:n.end(n.length-2),to:n.start(n.length-1),unintended:!0})}(e,n,r,t),E.length>0?S.call(this):(v=!1,T&&T({chunk:t}))};try{0===t.bytes.length?r.call(this):(n=_(),g.appendBuffer?g.appendBuffer(t.bytes):g.append(t.bytes,t),D(r.bind(this)))}catch(e){p.fatal('SourceBuffer append failed "'+e+'"'),E.length>0?S():v=!1,T&&T({chunk:t,error:new i.default(e.code,e.message)})}}}function A(){if(y.length>0){var e=y.shift();g.updating?D(e):(e(),A())}}function I(){g.updating||A()}function w(){g.updating||A()}function R(){p.error("SourceBufferSink error")}function D(e){y.push(e),g.updating||A()}return f={getType:function(){return h},getAllBufferRanges:_,getBuffer:function(){return g},append:function(e){e?(E.push(e),v||D(S.bind(this))):T({chunk:e,error:new i.default(l.default.APPEND_ERROR_CODE,l.default.APPEND_ERROR_MESSAGE)})},remove:function(t,n,r){var a=this;D((function(){try{t>=0&&n>t&&(r||"ended"!==e.readyState)&&g.remove(t,n),D((function(){d.trigger(o.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:t,to:n,unintended:!1})}))}catch(e){d.trigger(o.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:t,to:n,unintended:!1,error:new i.default(e.code,e.message)})}}))},abort:function(){try{("open"===e.readyState||g.setTextTrack&&"ended"===e.readyState)&&g.abort()}catch(e){p.error('SourceBuffer append abort failed: "'+e+'"')}E=[]},reset:function(t){if(g){if("function"==typeof g.removeEventListener&&(g.removeEventListener("updateend",w,!1),g.removeEventListener("error",R,!1),g.removeEventListener("abort",R,!1)),clearInterval(m),y=[],!t){try{g.getClassName&&"TextSourceBuffer"===g.getClassName()||(p.debug("Removing sourcebuffer from media source"),e.removeSourceBuffer(g))}catch(e){p.error("Failed to remove source buffer from media source.")}g=null}v=!1}E=[],T=null},updateTimestampOffset:function(e){g.timestampOffset===e||isNaN(e)||D((function(){e<0&&(e+=.001),g.timestampOffset=e}))},hasDiscontinuitiesAfter:function(e){try{var t=_();if(t&&t.length>1)for(var n=0,r=t.length;n<r;n++)if(n>0&&e<t.start(n)&&t.start(n)>t.end(n-1)+.1)return!0}catch(e){p.error("hasDiscontinuities exception: "+e.message)}return!1},waitForUpdateEnd:D,updateAppendWindow:b},function(){p=(0,r.default)(c).getInstance().getLogger(f),v=!1,h=t.type;var n=t.codec;try{if(n.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))throw new Error("not really supported");(g=s||e.addSourceBuffer(n)).changeType&&s&&(p.debug("Doing period transition with changeType"),g.changeType(n)),b();if("function"==typeof g.addEventListener)try{g.addEventListener("updateend",w,!1),g.addEventListener("error",R,!1),g.addEventListener("abort",R,!1)}catch(e){m=setInterval(I,50)}else m=setInterval(I,50)}catch(e){if(!t.isText&&-1===n.indexOf('codecs="stpp')&&-1===n.indexOf('codecs="wvtt'))throw e;var i=(0,u.default)(c).getInstance();g=i.getTextSourceBuffer()}}(),f}d.__dashjs_factory_name="SourceBufferSink";var f=s.default.getClassFactory(d);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r},o=n(15);function s(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,o.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,o.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}s.__dashjs_factory_name="CustomTimeRanges",t.default=a.default.getClassFactory(s)},function(e,t,n){t.generateISD=n(112).generateISD,t.fromXML=n(113).fromXML,t.renderHTML=n(129).render},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t,r){var i=n(37);e.exports=E;var a,o=n(70);E.ReadableState=y;n(47).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(72),l=n(38).Buffer,c=t.Uint8Array||function(){};var d=Object.create(n(28));d.inherits=n(21);var f=n(118),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,g=n(119),v=n(73);d.inherits(E,u);var m=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(a=a||n(17));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(50).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function E(e){if(a=a||n(17),!(this instanceof E))return new E(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function T(e,t,n,r,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,o)):(i||(a=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?_(e,o,t,!1):I(e,o)):_(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function _(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),I(e,t)}Object.defineProperty(E.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=v.destroy,E.prototype._undestroy=v.undestroy,E.prototype._destroy=function(e,t){this.push(null),t(e)},E.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),T(this,e,t,!1,n)},E.prototype.unshift=function(e){return T(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){return p||(p=n(50).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function b(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){h("emit readable"),e.emit("readable"),C(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(w,e,t))}function w(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function D(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function L(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(N,t,e))}function N(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}E.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):S(this),null;if(0===(e=b(e,t))&&t.ended)return 0===t.length&&L(this),null;var r,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=b(n,t))),null===(r=e>0?M(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&L(this)),null!==r&&this.emit("data",r),r},E.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},E.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:E;function l(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",d),e.removeListener("error",v),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",E),n.removeListener("data",g),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",l);var d=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",d);var f=!1;var p=!1;function g(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==O(a.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function v(t){h("onerror",t),E(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",y),E()}function y(){h("onfinish"),e.removeListener("close",m),E()}function E(){h("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",m),e.once("finish",y),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var o=O(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},E.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):i.nextTick(R,this))}return n},E.prototype.addListener=E.prototype.on,E.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(D,e,t))}(this,e)),this},E.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},E.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(h("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<m.length;a++)e.on(m[a],this.emit.bind(this,m[a]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),E._fromList=M}).call(this,n(14),n(36))},function(e,t,n){e.exports=n(47).EventEmitter},function(e,t,n){"use strict";var r=n(37);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";e.exports=o;var r=n(17),i=Object.create(n(28));function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);r.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){u(e,t,n)})):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n(21),i.inherits(o,r),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=E(n(78)),i=E(n(1)),a=E(n(10)),o=E(n(79)),s=E(n(26)),u=E(n(3)),l=E(n(4)),c=E(n(0)),d=E(n(146)),f=E(n(12)),h=E(n(147)),p=E(n(148)),g=E(n(149)),v=E(n(2)),m=n(8),y=n(15);function E(e){return e&&e.__esModule?e:{default:e}}function T(){var e=this.context,t=(0,v.default)(e).getInstance(),n=(0,u.default)(e).getInstance(),c=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0;function K(){(T=(0,r.default)(e).create({dashMetrics:j,mediaPlayerModel:N,settings:H})).initialize()}function V(){b={},S={},I={},A={},P={},U={},B={},G={},void 0===R&&(R=!1),x=void 0,k=void 0,F=void 0,clearTimeout(w),w=null}function q(e){e.mediaType===i.default.VIDEO&&(void 0!==x&&k.push(x,L.getPlaybackQuality()),x=e.newQuality)}function Y(e){e.metric!==a.default.HTTP_REQUEST||!e.value||e.value.type!==m.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||F.push(e.mediaType,e.value,H.get().streaming.abr.useDeadTimeLatency),e.metric!==a.default.BUFFER_LEVEL||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||function(e,t){var n=H.get().streaming.abr.ABRStrategy;if(n===i.default.ABR_STRATEGY_L2A)return U[e]=!1,G[e]=!1,void(B[e]=!0);if(n===i.default.ABR_STRATEGY_LoLP)return U[e]=!1,G[e]=!0,void(B[e]=!1);if(n===i.default.ABR_STRATEGY_BOLA)return U[e]=!0,G[e]=!1,void(B[e]=!1);if(n===i.default.ABR_STRATEGY_THROUGHPUT)return U[e]=!1,G[e]=!1,void(B[e]=!1);!function(e,t){var n=N.getStableBufferTime(),r=n,i=.5*n,a=U[e],o=t>(a?i:r);U[e]=o,o!==a&&(o?E.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+t.toFixed(3)+")."):E.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+t.toFixed(3)+")."))}(e,t)}(e.mediaType,.001*e.value.level)}function W(e,t){return b[t]=b[t]||{},b[t].hasOwnProperty(e)||(b[t][e]=0),function(e,t){if(t!==i.default.VIDEO||!H.get().streaming.abr.limitBitrateByPortal||!A[t])return e;R||ae();var n=M.getAdaptationForType(0,t).Representation,r=e;if(D>0&&C>0){for(;r>0&&n[r]&&D<n[r].width&&D-n[r-1].width<n[r].width-D;)r-=1;for(;r<n.length-1&&n[r].width===n[r+1].width;)r+=1}return r}(function(e,t,n){var r=H.get().streaming.abr.maxRepresentationRatio[t];if(isNaN(r)||r>=1||r<0)return e;return Math.min(e,Math.round(n*r))}(function(e,t){var n=e;if(!A[t])return n;var r=X(t);void 0!==r&&(n=Math.max(e,r));var i=z(t);void 0!==i&&(n=Math.min(n,i));return n}(b[t][e],e),e,b[t][e]),e)}function z(e){var t=function(e){return H.get().streaming.abr.maxBitrate[e]}(e);return t>-1?$(A[e].getMediaInfo(),t):void 0}function X(e){var t=function(e){return H.get().streaming.abr.minBitrate[e]}(e);if(t>-1){var n=A[e].getMediaInfo(),r=ee(n),i=$(n,t);return r[i]&&i<r.length-1&&r[i].bitrate<1e3*t&&i++,i}}function Q(e,t,n,r){var i=t.id,a=ie(e);(0,y.checkInteger)(n);var o=W(e,i);n!==a&&n>=0&&n<=o&&J(e,a,n,o,r)}function J(e,t,r,i,a){if(e&&A[e]){var o=A[e].getStreamInfo(),s=o?o.id:null;if(H.get().debug.logLevel===v.default.LOG_LEVEL_DEBUG){var u=j.getCurrentBufferLevel(e);E.info("["+e+"] switch from "+t+" to "+r+"/"+i+" (buffer: "+u+") "+(a?JSON.stringify(a):"."))}!function(e,t,n){S[t]=S[t]||{},S[t][e]=n}(e,s,r),n.trigger(l.default.QUALITY_CHANGE_REQUESTED,{oldQuality:t,newQuality:r,reason:a},{streamId:o.id,mediaType:e});var c=F.getAverageThroughput(e);isNaN(c)||O.setSavedBitrateSettings(e,c)}}function Z(e,t){I[e].state=t}function $(e,t,n){var r=e&&e.type?A[e.type].getRepresentationInfo():null;if(H.get().streaming.abr.useDeadTimeLatency&&n&&r&&r.fragmentDuration){n/=1e3;var i=r.fragmentDuration;if(n>i)return 0;t*=1-n/i}for(var a=ee(e),o=a.length-1;o>=0;o--){if(1e3*t>=a[o].bitrate)return o}return 0}function ee(e){var t=[];if(!e||!e.bitrateList)return t;for(var n=e.bitrateList,r=e.type,i=void 0,a=0,s=n.length;a<s;a++)(i=new o.default).mediaType=r,i.qualityIndex=a,i.bitrate=n[a].bandwidth,i.width=n[a].width,i.height=n[a].height,i.scanType=n[a].scanType,t.push(i);return t}function te(e){return U[e]}function ne(e){return B[e]}function re(e){return G[e]}function ie(e){if(e&&A[e]){var t=A[e].getStreamInfo(),n=t?t.id:null;if(n)return S[n]=S[n]||{},S[n].hasOwnProperty(e)||(S[n][e]=0),S[n][e]}return 0}function ae(){if(L){var e=H.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;D=L.getClientWidth()*e,C=L.getClientHeight()*e}}function oe(t){var n=t.request.mediaType;if(H.get().streaming.abr.autoSwitchBitrate[n]){var r=A[n];if(!r)return;var i=(0,d.default)(e).create({abrController:c,streamProcessor:r,currentRequest:t.request,useBufferOccupancyABR:te(n),useL2AABR:ne(n),useLoLPABR:re(n),videoModel:L}),o=T.shouldAbandonFragment(i);if(o.quality>f.default.NO_CHANGE){var u=r.getFragmentModel();u.getRequests({state:s.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(u.abortRequests(),Z(n,a.default.ABANDON_LOAD),P[n].reset(),P[n].push({oldValue:ie(n),newValue:o.quality,confidence:1,reason:o.reason}),Q(n,_.getActiveStreamInfo(),o.quality,o.reason),clearTimeout(w),w=setTimeout((function(){Z(n,a.default.ALLOW_LOAD),w=null}),H.get().streaming.abandonLoadTimeout))}}}return c={isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=ie(i.default.AUDIO),r=ie(i.default.VIDEO);return n===W(i.default.AUDIO,t)&&r===W(i.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return function(e,t,n){b[t]=b[t]||{},b[t][e]=n}(t,n,r),r},getThroughputHistory:function(){return F},getBitrateList:ee,getQualityForBitrate:$,getTopBitrateInfoFor:function(e){if(e&&A&&A[e]){var t=A[e].getStreamInfo();if(t&&t.id){var n=W(e,t.id),r=ee(A[e].getMediaInfo());return r[n]?r[n]:null}}return null},getMaxAllowedIndexFor:z,getMinAllowedIndexFor:X,getInitialBitrateFor:function(e){if(function(){if(!O||!O.hasOwnProperty("getSavedBitrateSettings"))throw new Error(i.default.MISSING_CONFIG_ERROR)}(),e===i.default.TEXT||e===i.default.FRAGMENTED_TEXT)return NaN;var t=O.getSavedBitrateSettings(e),n=H.get().streaming.abr.initialBitrate[e],r=H.get().streaming.abr.initialRepresentationRatio[e];if(-1===n)if(r>-1){var a=M.getAdaptationForType(0,e).Representation;if(Array.isArray(a))n=a[Math.max(Math.round(a.length*r)-1,0)].bandwidth;else n=0}else n=isNaN(t)?e===i.default.VIDEO?1e3:100:t;return n},getQualityFor:ie,getAbandonmentStateFor:function(e){return I[e]?I[e].state:null},setPlaybackQuality:Q,checkPlaybackQuality:function(t){if(t&&A&&A[t]){var n=A[t].getStreamInfo(),r=n?n.id:null,i=ie(t),o=(0,d.default)(e).create({abrController:c,streamProcessor:A[t],currentValue:i,switchHistory:P[t],droppedFramesHistory:k,useBufferOccupancyABR:te(t),useL2AABR:ne(t),useLoLPABR:re(t),videoModel:L});if(k){var s=L.getPlaybackQuality();s&&k.push(x,s)}if(H.get().streaming.abr.autoSwitchBitrate[t]){var u=X(t),l=W(t,r),h=T.getMaxQuality(o),p=h.quality;if(void 0!==u&&(p>f.default.NO_CHANGE?p:i)<u&&(p=u),p>l&&(p=l),P[t].push({oldValue:i,newValue:p}),p>f.default.NO_CHANGE&&p!=i)(I[t].state===a.default.ALLOW_LOAD||p>i)&&J(t,i,p,l,h.reason);else if(H.get().debug.logLevel===v.default.LOG_LEVEL_DEBUG){var g=j.getCurrentBufferLevel(t,!0);E.debug("["+t+"] stay on "+i+"/"+l+" (buffer: "+g+")")}}}},getTopQualityIndexFor:W,setElementSize:ae,setWindowResizeEventCalled:function(e){R=e},createAbrRulesCollection:K,registerStreamType:function(t,r){P[t]=P[t]||(0,h.default)(e).create(),A[t]=r,I[t]=I[t]||{},I[t].state=a.default.ALLOW_LOAD,U[t]=!1,B[t]=!1,G[t]=!1,n.on(l.default.LOADING_PROGRESS,oe,c),t===i.default.VIDEO&&(n.on(l.default.QUALITY_CHANGE_RENDERED,q,c),k=k||(0,p.default)(e).create(),ae()),n.on(l.default.METRIC_ADDED,Y,c),n.on(l.default.PERIOD_SWITCH_COMPLETED,K,c),F=F||(0,g.default)(e).create({settings:H})},unRegisterStreamType:function(e){delete A[e]},setConfig:function(e){e&&(e.streamController&&(_=e.streamController),e.domStorage&&(O=e.domStorage),e.mediaPlayerModel&&(N=e.mediaPlayerModel),e.dashMetrics&&(j=e.dashMetrics),e.adapter&&(M=e.adapter),e.videoModel&&(L=e.videoModel),e.settings&&(H=e.settings))},reset:function(){V(),n.off(l.default.LOADING_PROGRESS,oe,c),n.off(l.default.QUALITY_CHANGE_RENDERED,q,c),n.off(l.default.METRIC_ADDED,Y,c),n.off(l.default.PERIOD_SWITCH_COMPLETED,K,c),T&&T.reset()}},E=t.getLogger(c),V(),c}T.__dashjs_factory_name="AbrController";var _=c.default.getSingletonFactory(T);_.QUALITY_DEFAULT=0,c.default.updateSingletonFactory(T.__dashjs_factory_name,_),t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(134)),i=p(n(135)),a=p(n(136)),o=p(n(137)),s=p(n(138)),u=p(n(139)),l=p(n(140)),c=p(n(141)),d=p(n(0)),f=p(n(12)),h=p(n(1));function p(e){return e&&e.__esModule?e:{default:e}}function g(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,d=e.dashMetrics,p=e.settings,g=void 0,v=void 0;function m(e){return e.filter((function(e){return e.quality>f.default.NO_CHANGE}))}function y(e){var n,r={},i=null,a=void 0,o=void 0,s=void 0,u=void 0;if(0!==e.length){for(r[f.default.PRIORITY.STRONG]={quality:f.default.NO_CHANGE,reason:null},r[f.default.PRIORITY.WEAK]={quality:f.default.NO_CHANGE,reason:null},r[f.default.PRIORITY.DEFAULT]={quality:f.default.NO_CHANGE,reason:null},a=0,n=e.length;a<n;a+=1)(o=e[a]).quality!==f.default.NO_CHANGE&&(r[o.priority].quality===f.default.NO_CHANGE||r[o.priority].quality>o.quality)&&(r[o.priority].quality=o.quality,r[o.priority].reason=o.reason||null);return r[f.default.PRIORITY.WEAK].quality!==f.default.NO_CHANGE&&(i=r[f.default.PRIORITY.WEAK]),r[f.default.PRIORITY.DEFAULT].quality!==f.default.NO_CHANGE&&(i=r[f.default.PRIORITY.DEFAULT]),r[f.default.PRIORITY.STRONG].quality!==f.default.NO_CHANGE&&(i=r[f.default.PRIORITY.STRONG]),i&&(s=i.quality,u=i.reason),(0,f.default)(t).create(s,u)}}return{initialize:function(){g=[],v=[],p.get().streaming.abr.useDefaultABRRules&&(p.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_L2A?g.push((0,l.default)(t).create({dashMetrics:d,mediaPlayerModel:n,settings:p})):p.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_LoLP?g.push((0,c.default)(t).create({dashMetrics:d})):(g.push((0,u.default)(t).create({dashMetrics:d,mediaPlayerModel:n,settings:p})),g.push((0,r.default)(t).create({dashMetrics:d})),g.push((0,i.default)(t).create({dashMetrics:d})),g.push((0,s.default)(t).create()),g.push((0,o.default)(t).create()),v.push((0,a.default)(t).create({dashMetrics:d,mediaPlayerModel:n,settings:p})))),n.getABRCustomRules().forEach((function(e){"qualitySwitchRules"===e.type&&g.push(e.rule(t).create()),"abandonFragmentRules"===e.type&&v.push(e.rule(t).create())}))},reset:function(){[g,v].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),g=[],v=[]},getMaxQuality:function(e){return y(m(g.map((function(t){return t.getMaxIndex(e)}))))||(0,f.default)(t).create()},getMinSwitchRequest:y,shouldAbandonFragment:function(e){return y(m(v.map((function(t){return t.shouldAbandon(e)}))))||(0,f.default)(t).create()},getQualitySwitchRules:function(){return g}}}g.__dashjs_factory_name="ABRRulesCollection";var v=d.default.getClassFactory(g);v.QUALITY_SWITCH_RULES="qualitySwitchRules",v.ABANDON_FRAGMENT_RULES="abandonFragmentRules",d.default.updateSingletonFactory(g.__dashjs_factory_name,v),t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(16)),i=n(8),a=u(n(0)),o=n(22),s=u(n(156));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t=this.context,n=e.eventBus,a=e.events,u=e.debug,l=e.dashConstants,c=e.urlUtils,d=e.type,f=e.streamInfo,h=e.timelineConverter,p=e.dashMetrics,g=e.baseURLController,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0;function I(){return d}function w(){y=-1,E=null}function R(){w(),T=null,A=null,S=null}function D(e,t,n){var r=g.resolve(n.path),i=void 0,a=void 0;return r&&t!==r.url&&c.isRelative(t)?(i=r.url,a=r.serviceLocation,t&&(i=c.resolve(t,i))):i=t,!c.isRelative(i)&&(e.url=i,e.serviceLocation=a,!0)}function C(e){var t,r,i;t=e.representation,r=t.hasInitialization(),i=t.hasSegments(),r&&i?n.trigger(a.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:f.id,mediaType:d}):A.update(t,S,r,i)}function M(e,t){if(null==t)return null;var n=new r.default,a=t.representation,s=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,u=t.media;return u=(0,o.replaceTokenForTemplate)(u,"Number",t.replacementNumber),u=(0,o.replaceTokenForTemplate)(u,"Time",t.replacementTime),u=(0,o.replaceTokenForTemplate)(u,"Bandwidth",s),u=(0,o.replaceIDForTemplate)(u,a.id),u=(0,o.unescapeDollarsInTemplate)(u),n.mediaType=I(),n.type=i.HTTPRequest.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.availabilityIdx,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,D(n,u,a)?n:void 0}function L(e){var t=!1;if(!e)return t;if(_){if(b)t=!0;else if(E){var n=parseFloat((E.presentationStartTime-e.adaptation.period.start).toFixed(5));t=(E.duration>0?n+1.5*E.duration:n)>=e.adaptation.period.duration}}else y>=e.availableSegmentsNumber&&(t=!0);return t}function N(e){var t=e.representation;t.segments&&n.trigger(a.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:f.id,mediaType:d})}function O(e){if(!e.error){var t,r=e.segments,i=e.representation,s=[],u=0,l=void 0,c=void 0,g=void 0;for(l=0,t=r?r.length:0;l<t;l++)c=r[l],(g=(0,o.getTimeBasedSegment)(h,_,i,c.startTime,c.duration,c.timescale,c.media,c.mediaRange,u))&&(s.push(g),g=null,u++);if(s.length>0)if(i.segmentAvailabilityRange={start:s[0].presentationStartTime,end:s[s.length-1].presentationStartTime},i.availableSegmentsNumber=s.length,i.segments=s,_)!function(e){h.setExpectedLiveEdge(e),p.updateManifestUpdateInfo({presentationStartTime:e})}(s[s.length-1].presentationStartTime-8);i.hasInitialization()&&n.trigger(a.REPRESENTATION_UPDATE_COMPLETED,{representation:i},{streamId:f.id,mediaType:d})}}function x(){m.debug("Dynamic stream complete"),b=!0}return v={initialize:function(e){_=e,b=!1,A.initialize(e)},getStreamId:function(){return f.id},getType:I,getStreamInfo:function(){return f},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.default,s=t.adaptation.period,u=s.start;if(a.mediaType=n,a.type=i.HTTPRequest.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=h.calcAvailabilityStartTimeFromPresentationTime(u,s.mpd,_),a.availabilityEndTime=h.calcAvailabilityEndTimeFromPresentationTime(u+s.duration,s.mpd,_),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,D(a,t.initialization,t))return a.url=(0,o.replaceTokenForTemplate)(a.url,"Bandwidth",t.bandwidth),a}(e,t,I()):null},getRequestForSegment:M,getSegmentRequestForTime:function(e,t,n,i){var a=null;if(!t||!t.segmentInfoType)return a;var o=y,s=!!i&&i.keepIdx,u=!(!i||!i.ignoreIsFinished);T!==n&&(T=n,m.debug("Getting the request for time : "+n));var c=A.getSegmentByTime(t,n);return c?(y=c.availabilityIdx,E=c,m.debug("Index for time "+n+" is "+y),a=M(e,c)):!u&&L(t)&&((a=new r.default).action=r.default.ACTION_COMPLETE,a.index=y-1,a.mediaType=d,a.mediaInfo=e,m.debug("Signal complete in getSegmentRequestForTime")),s&&o>=0&&(y=t.segmentInfoType===l.SEGMENT_TIMELINE&&_?y:o),a},getNextSegmentRequest:function(e,t){var n=null;if(!t||!t.segmentInfoType)return null;T=null;var i=y+1;m.debug("Getting the next request at index: "+i);var a=A.getSegmentByIndex(t,i,E?E.mediaStartTime:-1);return a||!function(e){return!isFinite(e.adaptation.period.duration)}(t)||b?(a?(n=M(e,a),y=a.availabilityIdx):y=_?i-1:i,a?E=a:L(t)&&((n=new r.default).action=r.default.ACTION_COMPLETE,n.index=y-1,n.mediaType=I(),n.mediaInfo=e,m.debug("Signal complete")),n):(m.debug(I()+" No segment found at index: "+i+". Wait for next loop"),null)},setCurrentIndex:function(e){y=e},getCurrentIndex:function(){return y},isMediaFinished:L,reset:function(){R(),n.off(a.INITIALIZATION_LOADED,N,v),n.off(a.SEGMENTS_LOADED,O,v),n.off(a.REPRESENTATION_UPDATE_STARTED,C,v),n.off(a.DYNAMIC_TO_STATIC,x,v)},resetIndex:w,setMimeType:function(e){S=e},getNextSegmentRequestIdempotent:function(e,t){var n=y+1,r=A.getSegmentByIndex(t,n,E?E.mediaStartTime:-1);return r?M(e,r):null}},m=u.getLogger(v),R(),A=(0,s.default)(t).create(e),n.on(a.INITIALIZATION_LOADED,N,v),n.on(a.SEGMENTS_LOADED,O,v),n.on(a.REPRESENTATION_UPDATE_STARTED,C,v),n.on(a.DYNAMIC_TO_STATIC,x,v),v}l.__dashjs_factory_name="DashHandler",t.default=a.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(165));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return i.default},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}o.__dashjs_factory_name="SchemeLoaderFactory";var s=r.default.getSingletonFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(3)),i=h(n(20)),a=h(n(31)),o=h(n(0)),s=h(n(2)),u=h(n(23)),l=h(n(1)),c=n(8),d=h(n(56)),f=h(n(30));function h(e){return e&&e.__esModule?e:{default:e}}var p="m",g="a",v="v",m="i",y="c",E="tt",T="k",_="o",b="d",S="s",A="v",I="l";function w(){var e=void 0,t=void 0,n=void 0,o=void 0,h=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=this.context,N=(0,r.default)(L).getInstance(),O=(0,u.default)(L).getInstance();function x(){n={pr:1,nor:null,st:null,sf:null,sid:""+f.default.generateUuid(),cid:null},C={},D={},M={},k()}function P(){k()}function k(){if(w){var e=w.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(R=t.getProcessors())}}}function F(e,t){var n={},r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;e[u]&&(n[u]=e[u])}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}function U(e){try{return e.type===c.HTTPRequest.MPD_TYPE?((t=B()).ot=""+p,t):e.type===c.HTTPRequest.MEDIA_SEGMENT_TYPE?(function(e){M.hasOwnProperty(e)||(M[e]=!1);D.hasOwnProperty(e)||(D[e]=!1);C.hasOwnProperty(e)||(C[e]=!1)}(e.mediaType),function(e){var t=B(),r=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),i=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),a=function(e){try{return 100*parseInt(o.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),s=function(e){try{var t=n.pr,r=h.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),u=G(e.mediaType),c=function(e){try{var t=o.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),d=n.pr,f=function(e){if(!R||0===R.length)return;var t=!0,n=!1,r=void 0;try{for(var i,a=R[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;if(o.getType()===e)return o.probeNextRequest()}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}(e.mediaType),p=void 0;e.mediaType===l.default.VIDEO&&(p=v);e.mediaType===l.default.AUDIO&&(p=g);e.mediaType===l.default.FRAGMENTED_TEXT&&(p="application/mp4"===e.mediaInfo.mimeType?E:y);var m=O.get().streaming.cmcd.rtp;m||(m=function(e){var t=w.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,a=e.duration,o=G(r);0===o&&(o=500);var s=i.bitrateList[n].bandwidth*a/1e3/(o/t/1e3),u=O.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(O.get().streaming.cmcd.rtpSafetyFactor)?O.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(s*u/100)+1)}(e));if(t.rtp=m,f)if(e.url!==f.url){var T=new URL(f.url);t.nor=T.pathname}else f.range&&(t.nrr=f.range);r&&(t.br=r);p&&(t.ot=p);isNaN(i)||(t.d=i);isNaN(a)||(t.mtp=a);isNaN(s)||(t.dl=s);isNaN(u)||(t.bl=u);isNaN(c)||(t.tb=c);isNaN(d)||1===d||(t.pr=d);C[e.mediaType]&&(t.bs=!0,C[e.mediaType]=!1);!D[e.mediaType]&&M[e.mediaType]||(t.su=!0,D[e.mediaType]=!1,M[e.mediaType]=!0);return t}(e)):e.type===c.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=B();return e.ot=""+m,e.su=!0,e}():e.type===c.HTTPRequest.OTHER_TYPE||e.type===c.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=B();return e.ot=""+_,e}():e.type===c.HTTPRequest.LICENSE?function(e){var t=B();return t.ot=T,t}():null}catch(e){return null}var t}function B(){var e={},t=O.get().streaming.cmcd.cid?O.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=O.get().streaming.cmcd.sid?O.get().streaming.cmcd.sid:n.sid,e.sid=""+e.sid,t&&(e.cid=""+t),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function G(e){try{var t=h.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function j(e){try{n.pr=e.playbackRate}catch(e){}}function H(t){try{var r=e.getIsDynamic(t.data)?""+I:""+A,i=t.protocol&&"MSS"===t.protocol?""+S:""+b;n.st=""+r,n.sf=""+i}catch(e){}}function K(e){try{e.state&&e.mediaType&&e.state===i.default.BUFFER_EMPTY&&(C[e.mediaType]||(C[e.mediaType]=!0),D[e.mediaType]||(D[e.mediaType]=!0))}catch(e){}}function V(){for(var e in C)C.hasOwnProperty(e)&&(C[e]=!0);for(var t in D)D.hasOwnProperty(t)&&(D[t]=!0)}function q(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){if("v"===r&&1===e[r])return t;"string"!=typeof e[r]||"ot"===r&&"sf"===r&&"st"===r?t+=r+"="+e[r]:t+=r+'="'+e[r].replace(/"/g,'"')+'"';return i<n-1&&(t+=","),t}),"");return r=r.replace(/=true/g,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){var t=U(e),n=q(t);return N.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:"CMCD",value:n}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){var t=U(e),n=F(t,["br","d","ot","tb"]),r=F(t,["bl","dl","mtp","nor","nrr","su"]),i=F(t,["bs","rtp"]),o=F(t,["cid","pr","sf","sid","st","v"]),s={"CMCD-Object":q(n),"CMCD-Request":q(r),"CMCD-Status":q(i),"CMCD-Session":q(o)};return N.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t}),s}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(o=e.abrController),e.dashMetrics&&(h=e.dashMetrics),e.playbackController&&(w=e.playbackController))},reset:function(){N.off(i.default.PLAYBACK_RATE_CHANGED,j,this),N.off(i.default.MANIFEST_LOADED,H,this),N.off(i.default.BUFFER_LEVEL_STATE_CHANGED,K,t),N.off(i.default.PLAYBACK_SEEKED,V,t),x()},initialize:function(){N.on(i.default.PLAYBACK_RATE_CHANGED,j,t),N.on(i.default.MANIFEST_LOADED,H,t),N.on(i.default.BUFFER_LEVEL_STATE_CHANGED,K,t),N.on(i.default.PLAYBACK_SEEKED,V,t),N.on(i.default.PERIOD_SWITCH_COMPLETED,P,t)}},(0,s.default)(L).getInstance().getLogger(t),e=(0,d.default)(L).getInstance(),x(),t}w.__dashjs_factory_name="CmcdModel",t.default=o.default.getSingletonFactory(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};r.DEFAULT_DVB_PRIORITY=1,r.DEFAULT_DVB_WEIGHT=1,t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(172));function a(e){return e&&e.__esModule?e:{default:e}}function o(){return{areEqual:function(e,t){return(0,i.default)(e,t)}}}o.__dashjs_factory_name="ObjectUtils",t.default=r.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(3)),i=c(n(4)),a=c(n(0)),o=c(n(2)),s=c(n(11)),u=c(n(9)),l=c(n(13));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=(0,r.default)(e).getInstance(),n=(0,l.default)(e).getInstance(),a=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0;function _(){d=NaN,g=!1,h=!0,p=!1,b()}function b(){null!==f&&(clearTimeout(f),f=null)}function S(e){b(),p||(isNaN(e)&&!isNaN(d)&&(e=1e3*d),isNaN(e)||(c.debug("Refresh manifest in "+e+" milliseconds."),f=setTimeout(w,e)))}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];g=!0;var t=m.getValue(),r=t.url,i=y.getPatchLocation(t),a=y.getLocation(t);i&&!e?r=i:a&&(r=a),n.isRelative(r)&&(r=n.resolve(r,t.url)),v.load(r)}function I(e){if(e){if(y.getIsPatch(e)){var n=e;e=m.getValue();var r=y.isPatchValid(e,n),a=r;if(r){var o=y.getPublishTime(e);a=y.applyPatchToManifest(e,n);var s=y.getPublishTime(e);a=o.getTime()!=s.getTime()}if(!a)return c.debug("Patch provided is invalid, performing full manifest refresh"),void A(!0);e.loadedTime=new Date}}else(e=m.getValue()).loadedTime=new Date;if(m.getValue()&&m.getValue().type===u.default.DYNAMIC&&e.type===u.default.STATIC)return t.trigger(i.default.DYNAMIC_TO_STATIC),g=!1,void(p=!0);m.setValue(e);var l=new Date,f=(l.getTime()-e.loadedTime.getTime())/1e3;1e3*(d=y.getManifestUpdatePeriod(e,f))>2147483647&&(d=2147483.647),t.trigger(i.default.MANIFEST_UPDATED,{manifest:e}),c.info("Manifest has been refreshed at "+l+"["+l.getTime()/1e3+"] "),h||S()}function w(){h||(g?S(T.get().streaming.manifestUpdateRetryInterval):A())}function R(e){e.error?e.error.code===s.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&E.error(e.error):I(e.manifest)}function D(){h=!1,S()}function C(){(h=!T.get().streaming.scheduleWhilePaused)&&b()}function M(){g=!1}return a={initialize:function(){_(),t.on(i.default.STREAMS_COMPOSED,M,this),t.on(i.default.PLAYBACK_STARTED,D,this),t.on(i.default.PLAYBACK_PAUSED,C,this),t.on(i.default.INTERNAL_MANIFEST_LOADED,R,this)},setManifest:function(e){I(e)},refreshManifest:A,setConfig:function(e){e&&(e.manifestModel&&(m=e.manifestModel),e.adapter&&(y=e.adapter),e.manifestLoader&&(v=e.manifestLoader),e.errHandler&&(E=e.errHandler),e.settings&&(T=e.settings))},reset:function(){t.off(i.default.PLAYBACK_STARTED,D,this),t.off(i.default.PLAYBACK_PAUSED,C,this),t.off(i.default.STREAMS_COMPOSED,M,this),t.off(i.default.INTERNAL_MANIFEST_LOADED,R,this),_()}},c=(0,o.default)(e).getInstance().getLogger(a),a}d.__dashjs_factory_name="ManifestUpdater",t.default=a.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.url=e||null,i.type=n||null,i.mediaType=r.default.STREAM,i.responseType="",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}(i(n(16)).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0);void 0===e.attributePrefix&&(e.attributePrefix="_");e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0);e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0);void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0);e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1);e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1);void 0===e.ignoreRoot&&(e.ignoreRoot=!1)}();var t=1,n=3,r=4,i=8,a=9;function o(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function s(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function u(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function l(t,n,r){switch(e.arrayAccessForm){case"property":t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]}!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&u(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function c(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function d(n,r,i,a){return!(r==t&&e.xmlElementsFilter.length>0)||u(e.xmlElementsFilter,n,i,a)}function f(s,h){if(s.nodeType==a){for(var p=new Object,g=s.childNodes,v=0;v<g.length;v++){if((y=g[v]).nodeType==t)if(e.ignoreRoot)p=f(y);else(p={})[E=o(y)]=f(y)}return p}if(s.nodeType==t){(p=new Object).__cnt=0;var m=[];for(g=s.childNodes,v=0;v<g.length;v++){var y,E=o(y=g[v]);if(y.nodeType!=i){var T=h+"."+E;if(d(p,y.nodeType,E,T))if(p.__cnt++,null==p[E]){var _=f(y,T);if("#text"!=E||/[^\s]/.test(_))(b={})[E]=_,m.push(b);p[E]=_,l(p,E,T)}else{null!=p[E]&&(p[E]instanceof Array||(p[E]=[p[E]],l(p,E,T)));var b;_=f(y,T);if("#text"!=E||/[^\s]/.test(_))(b={})[E]=_,m.push(b);p[E][p[E].length]=_}}}p.__children=m;for(var S=o(s),A=0;A<s.attributes.length;A++){var I=s.attributes[A];p.__cnt++;for(var w=I.value,R=0,D=e.matchers.length;R<D;R++){var C=e.matchers[R];C.test(I,S)&&(w=C.converter(I.value))}p[e.attributePrefix+I.name]=w}var M=function(e){return e.prefix}(s);return null!=M&&""!=M&&(p.__cnt++,p.__prefix=M),null!=p["#text"]&&(p.__text=p["#text"],p.__text instanceof Array&&(p.__text=p.__text.join("\n")),e.stripWhitespaces&&(p.__text=p.__text.trim()),delete p["#text"],"property"==e.arrayAccessForm&&delete p["#text_asArray"],p.__text=function(t,n,r){if(e.datetimeAccessFormPaths.length>0){var i=r.split(".#")[0];return u(e.datetimeAccessFormPaths,t,n,i)?c(t):t}return t}(p.__text,E,h+"."+E)),null!=p["#cdata-section"]&&(p.__cdata=p["#cdata-section"],delete p["#cdata-section"],"property"==e.arrayAccessForm&&delete p["#cdata-section_asArray"]),0==p.__cnt&&"text"==e.emptyNodeForm?p="":1==p.__cnt&&null!=p.__text?p=p.__text:1!=p.__cnt||null==p.__cdata||e.keepCData?p.__cnt>1&&null!=p.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==p.__text||""==p.__text.trim())&&delete p.__text:p=p.__cdata,delete p.__cnt,!e.enableToStringFunc||null==p.__text&&null==p.__cdata||(p.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),p}if(s.nodeType==n||s.nodeType==r)return s.nodeValue}function h(t,n,r,i){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=r)for(var o=0;o<r.length;o++){var u=r[o],l=t[u];e.escapeMode&&(l=s(l)),a+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?a+='"'+l+'"':a+="'"+l+"'"}return a+=i?"/>":">"}function p(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function g(t,n){return"property"==e.arrayAccessForm&&(r=n.toString(),i="_asArray",-1!==r.indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function v(e){var t=0;if(e instanceof Object)for(var n in e)g(e,n)||t++;return t}function m(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||u(e.jsonPropertiesFilter,t,n,r)}function y(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function E(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=s(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=s(t):n+=t),n}function T(e,t){return""===e?t:e+"."+t}function _(e,t,n,r){var i="";if(0==e.length)i+=h(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=h(e[a],t,y(e[a]),!1),i+=b(e[a],T(r,t)),i+=p(e[a],t);return i}function b(e,t){var n="";if(v(e)>0)for(var r in e)if(!g(e,r)&&(""==t||m(e,r,T(t,r)))){var i=e[r],a=y(i);if(null==i||null==i)n+=h(i,r,a,!0);else if(i instanceof Object)if(i instanceof Array)n+=_(i,r,a,t);else if(i instanceof Date)n+=h(i,r,a,!1),n+=i.toISOString(),n+=p(i,r);else{v(i)>0||null!=i.__text||null!=i.__cdata?(n+=h(i,r,a,!1),n+=b(i,T(t,r)),n+=p(i,r)):n+=h(i,r,a,!0)}else n+=h(i,r,a,!1),n+=E(i),n+=p(i,r)}return n+=E(e)}this.parseXmlString=function(e){var t;window.ActiveXObject||window;if(void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?c(e):e},this.xml2json=function(e){return f(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return b(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(198),o=(r=a)&&r.__esModule?r:{default:r};var s=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=r||[],Array.isArray(n)&&n.forEach((function(e){i._properties.push(new o.default(e))}))}return i(e,[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsMediaSource=u;var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r},o=n(57);var s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function u(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function l(){var e,t=void 0;return e={supportsMediaSource:u,supportsEncryptedMedia:function(){return t},supportsCodec:function(e){return!(!("MediaSource"in window)||!MediaSource.isTypeSupported(e))||!(!("WebKitMediaSource"in window)||!WebKitMediaSource.isTypeSupported(e))},setEncryptedMediaSupported:function(e){t=e},supportsEssentialProperty:function(e){try{return-1!==o.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n=e.split(".")[0],r=0===t.indexOf(n),i=void 0,a=0;a<s.length;a++)if(s[a].codec===n){i=s[a];break}return i?r||i.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):r}},t=!1,e}l.__dashjs_factory_name="Capabilities",t.default=a.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVersionString=function(){return"3.2.2"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(241),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t={"urn:dvb:dash:reporting:2014":a.default},n=this.context,r=void 0,i=e.debug?e.debug.getLogger(r):{},o=e.metricsConstants;return r={create:function(e,r){var a=void 0;try{(a=t[e.schemeIdUri](n).create({metricsConstants:o})).initialize(e,r)}catch(t){a=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri "+e.schemeIdUri+" ("+t.message+")")}return a},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}}}o.__dashjs_factory_name="ReportingFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(245)),i=s(n(246)),a=s(n(247)),o=s(n(248));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=void 0,n=(e=e||{}).debug?e.debug.getLogger(t):{},s=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,u=this.context,l={BufferLevel:r.default,DVBErrors:i.default,HttpList:a.default,PlayList:o.default,RepSwitchList:o.default,TcpList:o.default};return t={create:function(t,r){var i,a=t.match(s);if(a){try{(i=l[a[1]](u).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(a[1],r,a[3],a[5])}catch(e){i=null,n.error("MetricsHandlerFactory: Could not create handler for type "+a[1]+" with args "+a[3]+", "+a[5]+" ("+e.message+")")}return i}},register:function(e,t){l[e]=t},unregister:function(e){delete l[e]}}}u.__dashjs_factory_name="MetricsHandlerFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},function(e,t,n){"use strict";function r(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="HandlerHelpers",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){(function(e){
|
|
379
|
+
var r=n(115),i=n(116),a=n(70);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(c(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=n;a<s;a++)if(l(e,a)===l(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,f=0;f<u;f++)if(l(e,a+f)!==l(t,f)){d=!1;break}if(d)return a}return-1}function E(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function T(e,t,n,r){return H(G(t,e.length-n),e,n,r)}function _(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return _(e,t,n,r)}function S(e,t,n,r){return H(j(t),e,n,r)}function A(e,t,n,r){return H(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,l=e[i],c=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),d=0;d<s;++d)if(l[d]!==c[d]){a=l[d],o=c[d];break}return a<o?-1:o<a?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=B(e[a]);return i}function M(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function L(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function x(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function P(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function k(e,t,n,r,a){return a||P(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,a){return a||P(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=u.isBuffer(e)?e:G(new u(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function j(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(14))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(){void 0!==a&&e.removeListener("error",a),n([].slice.call(arguments))}var a;"error"!==t&&(a=function(n){e.removeListener(t,i),r(n)},e.once("error",a)),e.once(t,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,s;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):v(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=v(u,l);for(n=0;n<l;++n)a(c[n],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(71)).Stream=t,t.Readable=t,t.Writable=n(49),t.Duplex=n(17),t.Transform=n(74),t.PassThrough=n(124)},function(e,t,n){"use strict";(function(t,r,i){var a=n(37);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;y.WritableState=m;var l=Object.create(n(28));l.inherits=n(21);var c={deprecate:n(123)},d=n(72),f=n(38).Buffer,h=i.Uint8Array||function(){};var p,g=n(73);function v(){}function m(e,t){s=s||n(17),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===e.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),A(e,t))}(e,n,r,t,i);else{var o=b(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?u(T,e,n,o,i):T(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||n(17),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),d.call(this)}function E(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function T(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),A(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,E(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,d=n.callback;if(E(e,t,!1,t.objectMode?1:l.length,l,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=b(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(y,d),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof m)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,s=!i.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=v),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,s,r,i,a);return u}(this,i,s,e,t,n)),o},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=g.destroy,y.prototype._undestroy=g.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(36),n(121).setImmediate,n(14))},function(e,t,n){"use strict";var r=n(38).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}o.__dashjs_factory_name="InitCache",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}o.__dashjs_factory_name="RequestModifier",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(){r(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};i.INITIAL_PLAYOUT_START_REASON="initial_playout",i.SEEK_START_REASON="seek",i.RESUME_FROM_PAUSE_START_REASON="resume",i.METRICS_COLLECTION_START_REASON="metrics_collection_start";var a=function e(){r(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};a.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",a.REBUFFERING_REASON="rebuffering",a.USER_REQUEST_STOP_REASON="user_request",a.END_OF_PERIOD_STOP_REASON="end_of_period",a.END_OF_CONTENT_STOP_REASON="end_of_content",a.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",a.FAILURE_STOP_REASON="failure",t.PlayList=i,t.PlayListTrace=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).requestModifier;return{load:function(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&(i=t.modifyRequestHeader(i)),e.headers)for(var a in e.headers){var o=e.headers[a];o&&i.setRequestHeader(a,o)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}o.__dashjs_factory_name="XHRLoader";var s=a.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=T(n(1)),i=T(n(9)),a=T(n(167)),o=T(n(168)),s=T(n(169)),u=T(n(170)),l=T(n(83)),c=T(n(84)),d=T(n(85)),f=T(n(171)),h=T(n(86)),p=T(n(13)),g=T(n(0)),v=T(n(2)),m=T(n(6)),y=T(n(11)),E=n(57);function T(e){return e&&e.__esModule?e:{default:e}}function _(){var e=void 0,t=void 0,n=void 0,g=void 0,T=this.context,_=(0,p.default)(T).getInstance(),b=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function S(e,t){var n=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=!1,d=!1;if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.hasOwnProperty("ContentComponent_asArray")&&(s=e.ContentComponent_asArray),u=t!==r.default.TEXT?new RegExp(t):new RegExp("(vtt|ttml)"),e.Representation_asArray&&e.Representation_asArray.length&&e.Representation_asArray.length>0){var f=x(e.Representation_asArray[0]);if(f&&f.length>0&&E.THUMBNAILS_SCHEME_ID_URIS.indexOf(f[0].schemeIdUri)>=0)return t===r.default.IMAGE;if(e.Representation_asArray[0].hasOwnProperty(i.default.CODECS)&&(0===(l=e.Representation_asArray[0].codecs).search(r.default.STPP)||0===l.search(r.default.WVTT)))return t===r.default.FRAGMENTED_TEXT}if(s){if(s.length>1)return t===r.default.MUXED;s[0]&&s[0].contentType===t&&(c=!0,d=!0)}if(e.hasOwnProperty(i.default.MIME_TYPE)&&(c=u.test(e.mimeType),d=!0),!d)for(n=0,a=e.Representation_asArray&&e.Representation_asArray.length?e.Representation_asArray.length:0;!d&&n<a;)(o=e.Representation_asArray[n]).hasOwnProperty(i.default.MIME_TYPE)&&(c=u.test(o.mimeType),d=!0),n++;return c}function A(e){return S(e,r.default.AUDIO)}function I(e){return S(e,r.default.VIDEO)}function w(e){return S(e,r.default.FRAGMENTED_TEXT)}function R(e){return S(e,r.default.IMAGE)}function D(e){return"text/vtt"===e||"application/ttml+xml"===e}function C(){return function(e,t){return e.bandwidth-t.bandwidth}}function M(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function L(e,t){return e&&e.Period_asArray&&b(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function N(e){return e&&e.Period_asArray?e.Period_asArray:[]}function O(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===i.default.DYNAMIC),t}function x(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function P(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=s.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(i.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function k(e,t){var n=[],a=void 0;if(!e)return n;for(a=0;a<e.length;a++){var o=new f.default;if(o.timescale=1,o.representation=t,!e[a].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");o.schemeIdUri=e[a].schemeIdUri,e[a].hasOwnProperty(i.default.TIMESCALE)&&(o.timescale=e[a].timescale),e[a].hasOwnProperty(i.default.VALUE)&&(o.value=e[a].value),n.push(o)}return n}function F(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var a=new d.default,o=n.__text||n;return _.isRelative(o)&&(r=!0,e.baseUri&&(o=_.resolve(o,e.baseUri))),a.url=o,n.hasOwnProperty(i.default.SERVICE_LOCATION)&&n.serviceLocation.length?a.serviceLocation=n.serviceLocation:a.serviceLocation=o,n.hasOwnProperty(i.default.DVB_PRIORITY)&&(a.dvb_priority=n[i.default.DVB_PRIORITY]),n.hasOwnProperty(i.default.DVB_WEIGHT)&&(a.dvb_weight=n[i.default.DVB_WEIGHT]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)&&(a.availabilityTimeOffset=n[i.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)&&(a.availabilityTimeComplete="false"!==n[i.default.AVAILABILITY_TIME_COMPLETE]),t.push(a),r}})),t}return e={getIsTypeOf:S,getIsTextTrack:D,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(i.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var r=L(t,n);return r.length>0&&b(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=L(t,n),i=0;i<r.length;i++){if((0,h.default)(T).getInstance().areEqual(r[i],e))return i}return-1},getAdaptationForId:function(e,t,n){var r,a=L(t,n),o=void 0;for(o=0,r=a.length;o<r;o++)if(a[o].hasOwnProperty(i.default.ID)&&a[o].id===e)return a[o];return null},getAdaptationsForType:function(e,t,n){var r,i=L(e,t),a=void 0,o=[];for(a=0,r=i.length;a<r;a++)S(i[a],n)&&o.push(M(i[a]));return o},getRealPeriods:N,getRealPeriodForIndex:function(e,t){var n=N(t);return n.length>0&&b(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=b(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(i.default.CENC_DEFAULT_KID)?e[i.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(i.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:O,getId:function(e){return e&&e[i.default.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(i.default.PUBLISH_TIME)?new Date(e[i.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=M(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&b(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,o,s,u=[],l=function(e){if(e&&e.period&&b(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&b(e.index))return M(t.AdaptationSet_asArray[e.index])}}(e),c=void 0,d=void 0;if(l&&l.Representation_asArray){if(e&&e.period&&b(e.period.index)){var f=F(e.period.mpd.manifest);f&&(d=f[0])}for(var h=0,p=l.Representation_asArray.length;h<p;++h){var g=l.Representation_asArray[h],v=new a.default;if(v.index=h,v.adaptation=e,g.hasOwnProperty(i.default.ID)&&(v.id=g.id),g.hasOwnProperty(i.default.CODECS)&&(v.codecs=g.codecs),g.hasOwnProperty(i.default.CODEC_PRIVATE_DATA)&&(v.codecPrivateData=g.codecPrivateData),g.hasOwnProperty(i.default.BANDWITH)&&(v.bandwidth=g.bandwidth),g.hasOwnProperty(i.default.WIDTH)&&(v.width=g.width),g.hasOwnProperty(i.default.HEIGHT)&&(v.height=g.height),g.hasOwnProperty(i.default.SCAN_TYPE)&&(v.scanType=g.scanType),g.hasOwnProperty(i.default.MAX_PLAYOUT_RATE)&&(v.maxPlayoutRate=g.maxPlayoutRate),g.hasOwnProperty(i.default.SEGMENT_BASE)?(c=g.SegmentBase,v.segmentInfoType=i.default.SEGMENT_BASE):g.hasOwnProperty(i.default.SEGMENT_LIST)?(c=g.SegmentList).hasOwnProperty(i.default.SEGMENT_TIMELINE)?v.segmentInfoType=i.default.SEGMENT_TIMELINE:v.segmentInfoType=i.default.SEGMENT_LIST:g.hasOwnProperty(i.default.SEGMENT_TEMPLATE)?((c=g.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)?v.segmentInfoType=i.default.SEGMENT_TIMELINE:v.segmentInfoType=i.default.SEGMENT_TEMPLATE,c.hasOwnProperty(i.default.INITIALIZATION_MINUS)&&(v.initialization=c.initialization.split("$Bandwidth$").join(g.bandwidth).split("$RepresentationID$").join(g.id))):v.segmentInfoType=i.default.BASE_URL,v.essentialProperties=x(g),c){if(c.hasOwnProperty(i.default.INITIALIZATION)){var m=c.Initialization;m.hasOwnProperty(i.default.SOURCE_URL)&&(v.initialization=m.sourceURL),m.hasOwnProperty(i.default.RANGE)&&(v.range=m.range)}else g.hasOwnProperty(i.default.MIME_TYPE)&&D(g.mimeType)&&(v.range=0);c.hasOwnProperty(i.default.TIMESCALE)&&(v.timescale=c.timescale),c.hasOwnProperty(i.default.DURATION)?v.segmentDuration=c.duration/v.timescale:g.hasOwnProperty(i.default.SEGMENT_TEMPLATE)&&(c=g.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)&&(v.segmentDuration=(r=c.SegmentTimeline,o=void 0,s=void 0,o=r.S_asArray[0],s=r.S_asArray[1],(o.hasOwnProperty("d")?o.d:s.t-o.t)/v.timescale)),c.hasOwnProperty(i.default.MEDIA)&&(v.media=c.media),c.hasOwnProperty(i.default.START_NUMBER)&&(v.startNumber=c.startNumber),c.hasOwnProperty(i.default.INDEX_RANGE)&&(v.indexRange=c.indexRange),c.hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(v.presentationTimeOffset=c.presentationTimeOffset/v.timescale),c.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)?v.availabilityTimeOffset=c.availabilityTimeOffset:d&&void 0!==d.availabilityTimeOffset&&(v.availabilityTimeOffset=d.availabilityTimeOffset),c.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)?v.availabilityTimeComplete="false"!==c.availabilityTimeComplete:d&&void 0!==d.availabilityTimeComplete&&(v.availabilityTimeComplete=d.availabilityTimeComplete)}v.MSETimeOffset=(n=void 0,void 0,n=(t=v).presentationTimeOffset,t.adaptation.period.start-n),v.path=[e.period.index,e.index,h],u.push(v)}}return u},getAdaptationsForPeriod:function(e){var t=e&&b(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,n=[],a=void 0,s=void 0,u=void 0;if(t&&t.AdaptationSet_asArray)for(u=0;u<t.AdaptationSet_asArray.length;u++)s=t.AdaptationSet_asArray[u],a=new o.default,s.hasOwnProperty(i.default.ID)&&(a.id=s.id),a.index=u,a.period=e,S(s,r.default.MUXED)?a.type=r.default.MUXED:A(s)?a.type=r.default.AUDIO:I(s)?a.type=r.default.VIDEO:w(s)?a.type=r.default.FRAGMENTED_TEXT:R(s)?a.type=r.default.IMAGE:a.type=r.default.TEXT,n.push(a);return n},getRegularPeriods:function(e){var a,o=!!e&&O(e.manifest),u=[],l=null,c=null,d=null,f=null,h=void 0;for(h=0,a=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;h<a;h++)(c=e.manifest.Period_asArray[h]).hasOwnProperty(i.default.START)?(f=new s.default).start=c.start:null!==l&&l.hasOwnProperty(i.default.DURATION)&&null!==d?(f=new s.default).start=parseFloat((d.start+d.duration).toFixed(5)):0!==h||o||((f=new s.default).start=0),null!==d&&isNaN(d.duration)&&(null!==f?d.duration=parseFloat((f.start-d.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==f&&(f.id=P(c,h),f.index=h,f.mpd=e,c.hasOwnProperty(i.default.DURATION)&&(f.duration=c.duration),u.push(f),l=c,d=f),c=null,f=null;return 0===u.length||null!==d&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(r.default.MISSING_CONFIG_ERROR)}();var t=O(e.mpd.manifest),i=void 0;e.mpd.manifest.mediaPresentationDuration?i=e.mpd.manifest.mediaPresentationDuration:e.duration?i=e.duration:t?i=Number.POSITIVE_INFINITY:n.error(new m.default(y.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e));return i}(d)-d.start).toFixed(5))),u},getMpd:function(e){var t=new u.default;return e&&(t.manifest=e,e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(i.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(i.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(i.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(i.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,n=t?t.Period_asArray:null,a=n&&e&&b(e.index)?n[e.index].EventStream_asArray:null,o=[],s=void 0,u=void 0;if(a)for(s=0;s<a.length;s++){var l=new f.default;if(l.period=e,l.timescale=1,!a[s].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(l.schemeIdUri=a[s][r.default.SCHEME_ID_URI],a[s].hasOwnProperty(i.default.TIMESCALE)&&(l.timescale=a[s][i.default.TIMESCALE]),a[s].hasOwnProperty(i.default.VALUE)&&(l.value=a[s][i.default.VALUE]),a[s].hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(l.presentationTimeOffset=a[s][i.default.PRESENTATION_TIME_OFFSET]),u=0;a[s].Event_asArray&&u<a[s].Event_asArray.length;u++){var d=a[s].Event_asArray[u],h=new c.default;if(h.presentationTime=0,h.eventStream=l,d.hasOwnProperty(i.default.PRESENTATION_TIME)){h.presentationTime=d.presentationTime;var p=l.presentationTimeOffset?l.presentationTimeOffset/l.timescale:0;h.calculatedPresentationTime=h.presentationTime/l.timescale+e.start-p}d.hasOwnProperty(i.default.DURATION)&&(h.duration=d.duration/l.timescale),d.hasOwnProperty(i.default.ID)&&(h.id=d.id),d.Signal&&d.Signal.Binary?h.messageData=g.decodeArray(d.Signal.Binary.toString()):h.messageData=d.messageData||d.__text,o.push(h)}}return o},getEssentialPropertiesForRepresentation:x,getEventStreamForAdaptationSet:function(e,t){var n=void 0,r=void 0,i=void 0;return e&&e.Period_asArray&&t&&t.period&&b(t.period.index)&&(r=e.Period_asArray[t.period.index])&&r.AdaptationSet_asArray&&b(t.index)&&(i=r.AdaptationSet_asArray[t.index])&&(n=i.InbandEventStream_asArray),k(n,null)},getEventStreamForRepresentation:function(e,t){var n=void 0,r=void 0,i=void 0,a=void 0;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&b(t.adaptation.period.index)&&(r=e.Period_asArray[t.adaptation.period.index])&&r.AdaptationSet_asArray&&b(t.adaptation.index)&&(i=r.AdaptationSet_asArray[t.adaptation.index])&&i.Representation_asArray&&b(t.index)&&(a=i.Representation_asArray[t.index])&&(n=a.InbandEventStream_asArray),k(n,t)},getUTCTimingSources:function(e){var t=O(e),n=!!e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME),a=e?e.UTCTiming_asArray:null,o=[];return(t||n)&&a&&a.forEach((function(e){var t=new l.default;e.hasOwnProperty(r.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(i.default.VALUE)&&(t.value=e.value.toString(),o.push(t)))})),o},getBaseURLsFromElement:F,getRepresentationSortFunction:C,getLocation:function(e){if(e&&e.hasOwnProperty(r.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(i.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(i.default.SERVICE_DESCRIPTION)){var n=!0,a=!1,o=void 0;try{for(var s,u=e.ServiceDescription_asArray[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var l=s.value,c=void 0,d=void 0,f=void 0,h=void 0;for(var p in l)l.hasOwnProperty(p)&&(p===i.default.ID?c=l[p]:p===i.default.SERVICE_DESCRIPTION_SCOPE?d=l[p].schemeIdUri:p===i.default.SERVICE_DESCRIPTION_LATENCY?f={target:l[p].target,max:l[p].max,min:l[p].min}:p===i.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(h={max:l[p].max,min:l[p].min}));d===r.default.SERVICE_DESCRIPTION_LL_SCHEME&&(f||h)&&t.push({id:c,schemeIdUri:d,latency:f,playbackRate:h})}}catch(e){a=!0,o=e}finally{try{!n&&u.return&&u.return()}finally{if(a)throw o}}}return t},getSupplementalPropperties:function(e){var t={};if(e&&e.hasOwnProperty(i.default.SUPPLEMENTAL_PROPERTY)){var n=!0,a=!1,o=void 0;try{for(var s,u=e.SupplementalProperty_asArray[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var l=s.value;l.hasOwnProperty(r.default.SCHEME_ID_URI)&&l.hasOwnProperty(i.default.VALUE)&&(t[l[r.default.SCHEME_ID_URI]]=l[i.default.VALUE])}}catch(e){a=!0,o=e}finally{try{!n&&u.return&&u.return()}finally{if(a)throw o}}}return t},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(g=e.BASE64))}},t=(0,v.default)(T).getInstance().getLogger(e),e}_.__dashjs_factory_name="DashManifestModel",t.default=g.default.getSingletonFactory(_)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THUMBNAILS_SCHEME_ID_URIS=void 0;var r=h(n(1)),i=h(n(9)),a=h(n(0)),o=h(n(173)),s=h(n(13)),u=n(22),l=h(n(5)),c=h(n(27)),d=h(n(55)),f=h(n(80));function h(e){return e&&e.__esModule?e:{default:e}}var p=t.THUMBNAILS_SCHEME_ID_URIS=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function g(e){var t,n=this.context,a=e.adapter,h=e.baseURLController,g=e.streamInfo,v=e.timelineConverter,m=e.debug,y=e.eventBus,E=e.events,T=e.dashConstants,_=(0,s.default)(n).getInstance(),b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0;function D(){M(),w=(0,d.default)(n).create({}),R=(0,c.default)(n).getInstance(),(S=(0,f.default)(n).create({streamInfo:g,timelineConverter:v,baseURLController:h,debug:m,eventBus:y,events:E,dashConstants:T,urlUtils:_})).initialize(!!a&&a.getIsDynamic()),function(){if(!g||!a)return;if(!(I=a.getMediaInfoForType(g,r.default.IMAGE)))return;var e=a.getVoRepresentations(I);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.default.SEGMENT_TIMELINE)&&C(e),e.segmentInfoType===i.default.SEGMENT_BASE&&C(e,!0)}));b.length>0&&(b.sort((function(e,t){return e.bitrate-t.bitrate})),A=b.length-1)}()}function C(e,t){var n=new o.default;n.id=e.id,n.bitrate=e.bandwidth,n.width=e.width,n.height=e.height,n.tilesHor=1,n.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(p.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(n.tilesHor=parseInt(t[0],10),n.tilesVert=parseInt(t[1],10))}})),t?y.trigger(l.default.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:g.id,mediaType:r.default.IMAGE,mimeType:I.mimeType,representation:e,callback:function(e,t,r,i){var o=[];r=function(e,t){var n,r=[],i=0,o=void 0,s=void 0,l=void 0;for(o=0,n=e.length;o<n;o++)s=e[o],(l=(0,u.getTimeBasedSegment)(v,a.getIsDynamic(),t,s.startTime,s.duration,s.timescale,s.media,s.mediaRange,i))&&(r.push(l),l=null,i++);return r}(r,i),n.segmentDuration=r[0].duration,n.readThumbnail=function(e,t){var n=null;o.some((function(t){if(t.start<=e&&t.end>e)return n=t.url,!0})),n?t(n):r.some((function(n){if(n.mediaStartTime<=e&&n.mediaStartTime+n.duration>e){var r=h.resolve(i.path);return w.load({method:"get",url:r.url,request:{range:n.mediaRange,responseType:"arraybuffer"},onload:function(e){var r=R.getSamplesInfo(e.target.response),i=new Blob([e.target.response.slice(r.sampleList[0].offset,r.sampleList[0].offset+r.sampleList[0].size)],{type:"image/jpeg"}),a=window.URL.createObjectURL(i);o.push({start:n.mediaStartTime,end:n.mediaStartTime+n.duration,url:a}),t&&t(a)}}),!0}}))}}}):(n.startNumber=e.startNumber,n.segmentDuration=e.segmentDuration,n.timescale=e.timescale,n.templateUrl=function(e){var t=_.isRelative(e.media)?_.resolve(e.media,h.resolve(e.path).url):e.media;if(!t)return"";return(0,u.replaceIDForTemplate)(t,e.id)}(e)),n.tilesHor>0&&n.tilesVert>0&&(n.widthPerTile=n.width/n.tilesHor,n.heightPerTile=n.height/n.tilesVert,b.push(n))}function M(){b=[],A=-1,I=null}return t={initialize:D,getTracks:function(){return b},reset:M,setTrackByIndex:function(e){b&&0!==b.length&&(e>=b.length&&(e=b.length-1),A=e)},getCurrentTrack:function(){return A<0?null:b[A]},getCurrentTrackIndex:function(){return A},getThumbnailRequestForTime:function(e){for(var t=void 0,n=a.getVoRepresentations(I),r=0;r<n.length;r++)if(b[A].id===n[r].id){t=n[r];break}return S.getSegmentRequestForTime(I,t,e)}},D(),t}g.__dashjs_factory_name="ThumbnailTracks",t.default=a.default.getClassFactory(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}return r(e,[{key:"toJWK",value:function(){var e=void 0,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,o=new ArrayBuffer(a),s=new Uint8Array(o);for(e=0;e<a;e++)s[e]=i.charCodeAt(e);return o}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=W(n(65)),i=W(n(1)),a=W(n(9)),o=W(n(10)),s=W(n(102)),u=W(n(104)),l=W(n(180)),c=W(n(181)),d=W(n(182)),f=W(n(188)),h=W(n(200)),p=W(n(91)),g=W(n(201)),v=W(n(44)),m=W(n(53)),y=W(n(42)),E=W(n(202)),T=W(n(204)),_=W(n(205)),b=W(n(77)),S=W(n(81)),A=W(n(206)),I=W(n(82)),w=W(n(207)),R=W(n(2)),D=W(n(11)),C=W(n(3)),M=W(n(5)),L=W(n(20)),N=W(n(0)),O=W(n(23)),x=n(92),P=W(n(208)),k=W(n(212)),F=W(n(220)),U=W(n(232)),B=n(8),G=W(n(233)),j=W(n(43)),H=W(n(6)),K=n(15),V=W(n(87)),q=W(n(13)),Y=W(n(27));function W(e){return e&&e.__esModule?e:{default:e}}function z(){var e="You must first call initialize() and set a source before calling this method",t="You must first call initialize() and set a valid source and view before calling this method",n="You must first call attachView() to set the video element before calling this method",W="You must first call attachSource() with a valid source before calling this method",z=this.context,X=(0,C.default)(z).getInstance(),Q=(0,O.default)(z).getInstance(),J=(0,R.default)(z).getInstance({settings:Q}),Z=void 0,$=void 0,ee=void 0,te=void 0,ne=void 0,re=void 0,ie=void 0,ae=void 0,oe=void 0,se=void 0,ue=void 0,le=void 0,ce=void 0,de=void 0,fe=void 0,he=void 0,pe=void 0,ge=void 0,ve=void 0,me=void 0,ye=void 0,Ee=void 0,Te=void 0,_e=void 0,be=void 0,Se=void 0,Ae=void 0,Ie=void 0,we=void 0,Re=void 0,De=void 0,Ce=void 0,Me=void 0,Le=void 0,Ne=void 0,Oe=void 0;function xe(){ze(null),qe(null),te=null,ce&&(ce.reset(),ce=null),de&&(de.reset(),de=null),Me.reset(),Q.reset(),he&&(he.reset(),he=null)}function Pe(){return!!ee&&!!we.getElement()}function ke(){return(0,x.getVersionString)()}function Fe(){if(!ie)throw t;return be.isPaused()}function Ue(e){var t=Se.getCurrentDVRInfo();if(!t)return 0;var n=be.getLiveDelay(),r=t.range.start+e;return r>t.range.end-n&&(r=t.range.end-n),r}function Be(e){if(!ie)throw t;var n=Ve().currentTime;if(void 0!==e)n=Te.getTimeRelativeToStreamId(n,e);else if(be.getIsDynamic()){var r=Se.getCurrentDVRInfo();n=null===r||0===n?0:Math.max(0,n-r.range.start)}return n}function Ge(){if(!ie)throw t;var e=Ve().duration;if(be.getIsDynamic()){var n=Se.getCurrentDVRInfo();e=n?n.range.end-n.range.start:0}return e}function je(e){(0,K.checkParameterType)(e,"boolean"),ae=e}function He(){ge.restoreDefaultUTCTimingSources()}function Ke(){return Se}function Ve(){if(!we.getElement())throw n;return we.getElement()}function qe(e){if(!ne)throw"MediaPlayer not initialized!";we.setElement(e),e&&(Ze(),function(){if(de)return;var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(z).create();de=t.createMetricsReporting({debug:J,eventBus:X,mediaElement:Ve(),adapter:pe,dashMetrics:Se,events:M.default,constants:i.default,metricsConstants:o.default})}}(),function(){if(fe)return;var e=dashjs.MssHandler;"function"==typeof e&&(D.default.extend(e.errors),fe=e(z).create({eventBus:X,mediaPlayerModel:ge,dashMetrics:Se,manifestModel:Ae,playbackController:be,streamController:Te,protectionController:ce,baseURLController:me,errHandler:ve,events:M.default,constants:i.default,debug:J,initSegmentType:B.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:G.default,ISOBoxer:j.default,settings:Q}))}(),Te&&Te.switchToVideoElement()),ie&&Qe(),tt()}function Ye(t){if(!re)throw e;var n=Te.getActiveStreamInfo();return le.getTracksFor(t,n)}function We(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function ze(e){if(!ne)throw"MediaPlayer not initialized!";"string"==typeof e&&De.initialize(e),ee=e,(re||ie)&&Qe(),Pe()&&tt()}function Xe(){if(!re)throw e;var t=Te.getActiveStreamInfo();return t?Te.getStreamById(t.id):null}function Qe(){ie=!1,re=!1,pe.reset(),Te.reset(),_e.reset(),be.reset(),oe.reset(),le.reset(),Re.reset(),ce&&(Q.get().streaming.keepProtectionMediaKeys?ce.stop():(ce.reset(),ce=null,Ze())),Ie.reset()}function Je(){return(0,f.default)(z).create({debug:J,errHandler:ve,dashMetrics:Se,mediaPlayerModel:ge,requestModifier:(0,m.default)(z).getInstance(),mssHandler:fe,settings:Q})}function Ze(){if(ce)return ce;var e=dashjs.Protection;if("function"==typeof e){var t=e(z).create();return M.default.extend(e.events),L.default.extend(e.events,{publicOnly:!0}),D.default.extend(e.errors),ye||(ye=(0,p.default)(z).getInstance()),(ce=t.createProtectionSystem({debug:J,errHandler:ve,videoModel:we,capabilities:ye,eventBus:X,events:M.default,BASE64:G.default,constants:i.default,cmcdModel:Ie,settings:Q}))&&(ce.setLicenseRequestFilters(Le),ce.setLicenseResponseFilters(Ne)),ce}return null}function $e(){if(!ne)throw"MediaPlayer not initialized!";if(he)return he;var e=dashjs.OfflineController;if("function"==typeof e){M.default.extend(e.events),L.default.extend(e.events,{publicOnly:!0}),D.default.extend(e.errors);var t=Je(),n=(0,V.default)(z).create();return n.setConfig({manifestModel:Ae,adapter:pe,manifestLoader:t,errHandler:ve}),he=e(z).create({debug:J,manifestUpdater:n,baseURLController:me,manifestLoader:t,manifestModel:Ae,mediaPlayerModel:ge,abrController:oe,playbackController:be,adapter:pe,errHandler:ve,dashMetrics:Se,timelineConverter:ue,schemeLoaderFactory:se,eventBus:X,events:M.default,errors:D.default,constants:i.default,settings:Q,dashConstants:a.default,urlUtils:(0,q.default)(z).getInstance()})}return null}function et(e){var t=Se.getCurrentDVRInfo();return t?e+(t.manifestInfo.availableFrom.getTime()/1e3+t.range.start):0}function tt(){var e;he&&he.resetRecords(),!re&&ee&&(re=!0,$.info("Streaming Initialized"),e=Je(),Te||(Te=(0,u.default)(z).getInstance()),Ee.setConfig({capabilities:ye,adapter:pe,settings:Q}),Ee.setCustomCapabilitiesFilters(Oe),Te.setConfig({capabilities:ye,capabilitiesFilter:Ee,manifestLoader:e,manifestModel:Ae,mediaPlayerModel:ge,protectionController:ce,adapter:pe,dashMetrics:Se,errHandler:ve,timelineConverter:ue,videoModel:we,playbackController:be,abrController:oe,mediaController:le,textController:Re,settings:Q,baseURLController:me}),_e.setConfig({settings:Q,playbackController:be,streamController:Te,videoModel:we,timelineConverter:ue,adapter:pe}),be.setConfig({streamController:Te,dashMetrics:Se,mediaPlayerModel:ge,adapter:pe,videoModel:we,timelineConverter:ue,uriFragmentModel:De,settings:Q}),oe.setConfig({streamController:Te,domStorage:Ce,mediaPlayerModel:ge,dashMetrics:Se,adapter:pe,videoModel:we,settings:Q}),Re.setConfig({errHandler:ve,manifestModel:Ae,adapter:pe,mediaController:le,streamController:Te,videoModel:we}),Ie.setConfig({abrController:oe,dashMetrics:Se,playbackController:be}),Te.initialize(ae,te),_e.initialize(),Ie.initialize(),"string"==typeof ee?Te.load(ee):Te.loadWithManifest(ee)),!ie&&Pe()&&(ie=!0,$.info("Playback Initialized"))}return Z={initialize:function(e,t,n){ye||(ye=(0,p.default)(z).getInstance()),ve=(0,h.default)(z).getInstance(),ye.supportsMediaSource()?ne||(ne=!0,ue=(0,U.default)(z).getInstance(),oe||(oe=(0,b.default)(z).getInstance()).setConfig({settings:Q}),se||(se=(0,S.default)(z).getInstance()),be||(be=(0,s.default)(z).getInstance()),le||(le=(0,c.default)(z).getInstance()),Te||(Te=(0,u.default)(z).getInstance()),_e||(_e=(0,l.default)(z).getInstance()),Ee||(Ee=(0,g.default)(z).getInstance()),pe=(0,k.default)(z).getInstance(),Ae=(0,T.default)(z).getInstance(),Ie=(0,I.default)(z).getInstance(),Se=(0,F.default)(z).getInstance({settings:Q}),Re=(0,y.default)(z).getInstance(),Ce=(0,w.default)(z).getInstance({settings:Q}),pe.setConfig({constants:i.default,cea608parser:r.default,errHandler:ve,BASE64:G.default}),me||(me=(0,d.default)(z).create()),me.setConfig({adapter:pe}),(Me=(0,P.default)(z).getInstance({dashMetrics:Se,mediaPlayerModel:ge,errHandler:ve,baseURLController:me,events:M.default,eventBus:X,debug:J,boxParser:(0,Y.default)(z).getInstance(),requestModifier:(0,m.default)(z).getInstance(),errors:D.default})).initialize(),le.setConfig({domStorage:Ce,settings:Q}),He(),je(void 0===n||n),$e(),e&&qe(e),t&&ze(t),$.info("[dash.js "+ke()+"] MediaPlayer has been initialized")):ve.error(new H.default(D.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,D.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(ye=e.capabilities),e.capabilitiesFilter&&(Ee=e.capabilitiesFilter),e.streamController&&(Te=e.streamController),e.gapController&&(_e=e.gapController),e.playbackController&&(be=e.playbackController),e.mediaPlayerModel&&(ge=e.mediaPlayerModel),e.abrController&&(oe=e.abrController),e.schemeLoaderFactory&&(se=e.schemeLoaderFactory),e.mediaController&&(le=e.mediaController),e.settings&&(Q=e.settings))},on:function(e,t,n,r){X.on(e,t,n,r)},off:function(e,t,n){X.off(e,t,n)},extend:function(e,t,n){N.default.extend(e,t,n,z)},attachView:qe,attachSource:ze,isReady:Pe,preload:function(){if(we.getElement()||re)return!1;if(!ee)throw W;tt()},play:function(){if(!ie)throw t;(!ae||Fe()&&ie)&&be.play()},isPaused:Fe,pause:function(){if(!ie)throw t;be.pause()},isSeeking:function(){if(!ie)throw t;return be.isSeeking()},isDynamic:function(){if(!ie)throw t;return be.getIsDynamic()},seek:function(e){if(!ie)throw t;if((0,K.checkParameterType)(e,"number"),isNaN(e))throw i.default.BAD_ARGUMENT_ERROR;var n=be.getIsDynamic()?Ue(e):e;be.seek(n)},setPlaybackRate:function(e){Ve().playbackRate=e},getPlaybackRate:function(){return Ve().playbackRate},setMute:function(e){(0,K.checkParameterType)(e,"boolean"),Ve().muted=e},isMuted:function(){return Ve().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw i.default.BAD_ARGUMENT_ERROR;Ve().volume=e},getVolume:function(){return Ve().volume},time:Be,duration:Ge,timeAsUTC:function(){if(!ie)throw t;return Be()<0?NaN:et(Be())},durationAsUTC:function(){if(!ie)throw t;return et(Ge())},getActiveStream:Xe,getDVRWindowSize:function(){var e=Se.getCurrentDVRInfo();return e?e.manifestInfo.DVRWindowSize:0},getDVRSeekOffset:Ue,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),o=i.toLocaleTimeString(t,{hour12:n});return r?o+" "+a:o},getVersion:ke,getDebug:function(){return J},getBufferLength:function(e){var t=[i.default.VIDEO,i.default.AUDIO,i.default.FRAGMENTED_TEXT];if(e){if(-1!==t.indexOf(e)){var n=Ke().getCurrentBufferLevel(e);return n||NaN}return $.warn("getBufferLength requested for invalid type"),NaN}var r=t.map((function(e){return Ye(e).length>0?Ke().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return we?we.getTTMLRenderingDiv():null},getVideoElement:Ve,getSource:function(){if(!ee)throw W;return ee},getCurrentLiveLatency:function(){if(!ne)throw"MediaPlayer not initialized!";return ie?be.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(t){if(!re)throw e;return oe.getTopBitrateInfoFor(t)},setAutoPlay:je,getAutoPlay:function(){return ae},getDashMetrics:Ke,getQualityFor:function(t){if(!re)throw e;if(t===i.default.IMAGE){var n=Xe();if(!n)return-1;var r=n.getThumbnailController();return r?r.getCurrentTrackIndex():-1}return oe.getQualityFor(t)},setQualityFor:function(t,n){if(!re)throw e;if(t===i.default.IMAGE){var r=Xe();if(!r)return;var a=r.getThumbnailController();a&&a.setTrackByIndex(n)}oe.setPlaybackQuality(t,Te.getActiveStreamInfo(),n)},updatePortalSize:function(){oe.setElementSize(),oe.setWindowResizeEventCalled(!0)},setTextDefaultLanguage:function(e){$.warn('setTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use setInitialMediaSettingsFor("fragmentedText", { lang: lang }) instead'),void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.setTextDefaultLanguage(e)},getTextDefaultLanguage:function(){return $.warn('getTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use getInitialMediaSettingsFor("fragmentedText").lang instead'),void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.getTextDefaultLanguage()},setTextDefaultEnabled:function(e){void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.setTextDefaultEnabled(e)},getTextDefaultEnabled:function(){return void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.getTextDefaultEnabled()},enableText:function(e){void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.enableText(e)},enableForcedTextStreaming:function(e){void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.enableForcedTextStreaming(e)},isTextEnabled:function(){return void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.isTextEnabled()},setTextTrack:function(e){if(!ie)throw t;void 0===Re&&(Re=(0,y.default)(z).getInstance()),Re.setTextTrack(e)},getBitrateInfoListFor:function(t){if(!re)throw e;var n=Xe();return n?n.getBitrateListFor(t):[]},getStreamsFromManifest:function(t){if(!re)throw e;return pe.getStreamsInfo(t)},getTracksFor:Ye,getTracksForTypeFromManifest:function(t,n,r){if(!re)throw e;return(r=r||pe.getStreamsInfo(n,1)[0])?pe.getAllMediaInfoForType(r,t,n):[]},getCurrentTrackFor:function(t){if(!re)throw e;var n=Te.getActiveStreamInfo();return le.getCurrentTrackFor(t,n)},setInitialMediaSettingsFor:function(e,t){if(!ne)throw"MediaPlayer not initialized!";le.setInitialSettings(e,t),e===i.default.FRAGMENTED_TEXT&&Re.setInitialSettings(t)},getInitialMediaSettingsFor:function(e){if(!ne)throw"MediaPlayer not initialized!";return le.getInitialSettings(e)},setCurrentTrack:function(t){if(!re)throw e;le.setTrack(t)},getTrackSwitchModeFor:function(e){if(!ne)throw"MediaPlayer not initialized!";return le.getSwitchMode(e)},setTrackSwitchModeFor:function(e,t){if(!ne)throw"MediaPlayer not initialized!";le.setSwitchMode(e,t)},setSelectionModeForInitialTrack:function(e){if(!ne)throw"MediaPlayer not initialized!";le.setSelectionModeForInitialTrack(e)},getSelectionModeForInitialTrack:function(){if(!ne)throw"MediaPlayer not initialized!";return le.getSelectionModeForInitialTrack()},addABRCustomRule:function(e,t,n){ge.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){ge.removeABRCustomRule(e)},removeAllABRCustomRule:function(){ge.removeABRCustomRule()},getAverageThroughput:function(e){var t=oe.getThroughputHistory();return t?t.getAverageThroughput(e):0},retrieveManifest:function(e,t){var n=Je(),r=this;X.on(M.default.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),X.off(M.default.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),De.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){ge.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){ge.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){ge.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:He,setXHRWithCredentialsForType:function(e,t){ge.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return ge.getXHRWithCredentialsForType(e)},getProtectionController:function(){return Ze()},attachProtectionController:function(e){ce=e},setProtectionData:function(e){te=e,Te&&Te.setProtectionData(te)},registerLicenseRequestFilter:function(e){Le.push(e),ce&&ce.setLicenseRequestFilters(Le)},registerLicenseResponseFilter:function(e){Ne.push(e),ce&&ce.setLicenseResponseFilters(Ne)},unregisterLicenseRequestFilter:function(e){We(Le,e),ce&&ce.setLicenseRequestFilters(Le)},unregisterLicenseResponseFilter:function(e){We(Ne,e),ce&&ce.setLicenseResponseFilters(Ne)},registerCustomCapabilitiesFilter:function(e){Oe.push(e),Ee&&Ee.setCustomCapabilitiesFilters(Oe)},unregisterCustomCapabilitiesFilter:function(e){We(Oe,e),Ee&&Ee.setCustomCapabilitiesFilters(Oe)},displayCaptionsOnTop:function(e){var t=(0,v.default)(z).getInstance();t.setConfig({videoModel:we}),t.initialize(),t.setDisplayCConTop(e)},attachTTMLRenderingDiv:function(e){if(!we.getElement())throw n;we.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=NaN;return Re&&(e=Re.getCurrentTrackIdx()),e},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=be.getIsDynamic()?Ue(e):e,r=Te.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i){var a=Te.getTimeRelativeToStreamId(n,r.getId());return i.provide(a,t)}t(null)}else t(null)}},getDashAdapter:function(){return pe},getOfflineController:function(){return $e()},getSettings:function(){return Q.get()},updateSettings:function(e){Q.update(e)},resetSettings:function(){Q.reset()},reset:xe,destroy:function(){xe(),Le=[],Ne=[],Oe=[],N.default.deleteSingletonInstances(z)}},$=J.getLogger(Z),ne=!1,ie=!1,re=!1,ae=!0,ce=null,he=null,te=null,pe=null,Me=null,M.default.extend(L.default),ge=(0,_.default)(z).getInstance(),we=(0,A.default)(z).getInstance(),De=(0,E.default)(z).getInstance(),Le=[],Ne=[],Oe=[],Z}z.__dashjs_factory_name="MediaPlayer";var X=N.default.getClassFactory(z);X.events=L.default,X.errors=D.default,N.default.updateClassFactory(z.__dashjs_factory_name,X),t.default=X},function(e,t,n){"use strict";!function(e){var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},i={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},l=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},c=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};c.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var d=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new c(t,n,r,i,a)};d.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var f=function(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new d);this.pos=0,this.currPenState=new c};f.prototype={equals:function(e){for(var t=!0,n=0;n<32;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<32;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<32;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(u.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=32?u.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new f);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){u.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){u.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),u.log("INFO","Rolling up")}else u.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+': "'+a+'"'):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var p=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};p.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,u.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";u.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(u.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){u.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){u.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){u.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){u.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){u.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){u.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){u.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){u.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){u.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){u.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){u.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(u.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,u.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){u.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var g=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new p(1,t),new p(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};g.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,u.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47)&&!((23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127)&&!((16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o=t;o=17===a?t+80:18===a?t+112:t+144,u.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=l(i);u.log("DEBUG","Char codes = "+s.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=s[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}};e.logger=u,e.PenState=c,e.CaptionScreen=h,e.Cea608Parser=g,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],o=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==i&&49==a&&1195456820==o&&3==s};i<t+n;){if(r=e.getUint32(i),6===(31&e.getUint8(i+4)))for(var s=i+5,u=-1;s<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(s),s++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(s),s++;o(u,c,e,s)&&a.push([s,c]),s+=c}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var c=e.getUint8(n);n++,s&&(127&l)+(127&c)!=0&&(0===u?(r[0].push(l),r[0].push(c)):1===u&&(r[1].push(l),r[1].push(c)))}return r}}(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=m(n(1)),i=m(n(10)),a=m(n(26)),o=m(n(67)),s=m(n(133)),u=m(n(77)),l=m(n(3)),c=m(n(5)),d=m(n(0)),f=m(n(2)),h=m(n(51)),p=m(n(6)),g=m(n(11)),v=n(8);function m(e){return e&&e.__esModule?e:{default:e}}function y(e){e=e||{};var t=this.context,n=(0,l.default)(t).getInstance(),d=e.errHandler,m=e.fragmentModel,y=e.representationController,E=e.mediaController,T=e.adapter,_=e.textController,b=e.abrController,S=e.playbackController,A=e.streamInfo,I=e.type,w=e.settings,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0;function Q(e){return T.convertDataToRepresentationInfo(y.getRepresentationForQuality(e))}function J(e,n){if(!V||!e)return null;var r=e[0];if(O)try{k=n&&n[I]?(0,o.default)(t).create(O,r,ne.bind(this),n[I]):(0,o.default)(t).create(O,r,ne.bind(this),null),w.get().streaming.useAppendWindow&&k.updateAppendWindow(A),"function"==typeof k.getBuffer().initialize&&k.getBuffer().initialize(I,A,e,m)}catch(e){D.fatal("Caught error on create SourceBuffer: "+e),d.error(new p.default(g.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,g.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+I))}else k=(0,s.default)(t).create(ne.bind(this));return ye(Q(C)),k}function Z(e){D.info("Init fragment finished loading saving to",I+"'s init cache"),V.save(e.chunk),D.debug("Append Init fragment",I," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),ee(e.chunk)}function $(e){var t=e.chunk;if(z){X=t;var n=k&&k.getAllBufferRanges();n&&n.length>0&&S.getTimeToStreamEnd()>w.get().streaming.stallThreshold&&(D.debug("Clearing buffer because track changed - "+(n.end(n.length-1)+.5)),ge([{start:0,end:n.end(n.length-1)+.5,force:!0}]))}else ee(t)}function ee(e){k.append(e),e.mediaInfo.type===r.default.VIDEO&&Re(c.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function te(e){if(e&&e.length>0)for(var t=0,n=e.length;t<n;t++)D.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",S.getTime())}function ne(e){if(e.error){if(22===e.error.code&&(K=!0,N=.8*Ie(),D.warn("Quota exceeded, Critical Buffer: "+N),N>0)){var t=Math.max(.2*N,1),n=N-t,i=Math.min(w.get().streaming.bufferTimeAtTopQuality,.9*n),a=Math.min(w.get().streaming.bufferTimeAtTopQualityLongForm,.9*n),o={streaming:{bufferToKeep:parseFloat(t.toFixed(5)),bufferTimeAtTopQuality:parseFloat(i.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(a.toFixed(5))}};w.update(o)}22!==e.error.code&&we()||(D.warn("Clearing playback buffer to overcome quota exceed situation"),Re(c.default.QUOTA_EXCEEDED,{criticalBufferLevel:N,quotaExceededTime:e.chunk.start}),ge(pe()))}else{K=!1,(G=e.chunk)&&!isNaN(G.index)&&(x=Math.max(G.index,x),de());var s=k.getAllBufferRanges();if(G.segmentType===v.HTTPRequest.MEDIA_SEGMENT_TYPE)te(s),oe(),function(){if(I!==r.default.AUDIO&&I!==r.default.VIDEO)return;if(isNaN(q))return;var e=S.getTime(),t=le(q,0);if(e===q&&t)return;var n=y.getCurrentRepresentation().segmentDuration;if(!(t=le(q,n)))return;Math.abs(e-q)>n?q<=t.end&&(S.seek(Math.max(q,t.start),!1,!0),q=NaN):e<t.start&&(S.seek(t.start,!1,!0),q=NaN)}();else if(z){var u=S.getTime();D.debug("AppendToBuffer seek target should be "+u),Re(c.default.SEEK_TARGET,{time:u})}var l=!1;U&&(U.indexOf(G)>0&&(l=!0),U=null),G&&!l&&Re(G.endFragment?c.default.BYTES_APPENDED_END_FRAGMENT:c.default.BYTES_APPENDED,{quality:G.quality,startTime:G.start,index:G.index,bufferedRanges:s,mediaType:I})}}function re(e){C!==e.newQuality&&(ye(this.getRepresentationInfo(e.newQuality)),C=e.newQuality)}function ie(e){k&&(q=e.seekTime,M&&(Y=!0,M=!1,P=Number.POSITIVE_INFINITY),I!==r.default.FRAGMENTED_TEXT?function(){if(!k)return;k.waitForUpdateEnd((function(){var e=function(){if(!k)return;var e=[],t=k.getAllBufferRanges();if(!t||0===t.length)return e;var n=S.getTime(),r=t.end(t.length-1)+.5,i=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(i){var o={start:0,end:i.startTime-w.get().streaming.stallThreshold},s=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:i.startTime-i.duration/2,threshold:.01})[0];s&&s.startTime!=i.startTime&&(o.end=s.startTime),o.start<o.end&&o.end>t.start(0)&&e.push(o);var u={start:i.startTime+i.duration+w.get().streaming.stallThreshold,end:r},l=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:i.startTime+i.duration+w.get().streaming.stallThreshold,threshold:.01})[0];l&&l.startTime!==i.startTime&&(u.start=l.startTime+l.duration+w.get().streaming.stallThreshold),u.start<u.end&&u.start<r&&e.push(u)}else D.debug("getAllRangesWithSafetyFactor - No request found in current time position, removing full buffer 0 -",r),e.push({start:0,end:r});return e}();e&&0!==e.length||oe(),ge(e)}))}():oe())}function ae(){q=NaN}function oe(){(!z||I===r.default.FRAGMENTED_TEXT&&_.isTextEnabled())&&ce()}function se(){fe()}function ue(){q=NaN,fe()}function le(e,t){var n=k.getAllBufferRanges(),r=0,i=0,a=null,o=null,s=0,u=void 0,l=void 0,c=isNaN(t)?.15:t;if(null!=n){for(l=0,u=n.length;l<u;l++)if(r=n.start(l),i=n.end(l),null===a)s=Math.abs(r-e),(e>=r&&e<i||s<=c)&&(a=r,o=i);else{if(!((s=r-o)<=c))break;o=i}if(null!==a)return{start:a,end:o}}return null}function ce(){var e,t,n;S&&(e=(isNaN(q)?S.getTime():q)||0,w.get().streaming.jumpGaps&&(t=w.get().streaming.smallGapLimit),L=null===(n=le(e,t))?0:n.end-e,Re(c.default.BUFFER_LEVEL_UPDATED,{bufferLevel:L}),fe())}function de(){x>=P-1&&!M&&void 0===k.discharge&&(M=!0,D.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for "+I),Re(c.default.BUFFERING_COMPLETED))}function fe(){I!==r.default.AUDIO&&I!==r.default.VIDEO||(Y&&!M&&L>0&&S&&S.getTimeToStreamEnd()-L<.1&&(Y=!1,M=!0,D.debug("checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type "+I),Re(c.default.BUFFERING_COMPLETED)),(!w.get().streaming.lowLatencyEnabled&&L<w.get().streaming.stallThreshold||0===L)&&!M?he(i.default.BUFFER_EMPTY):(M||L>=A.manifestInfo.minBufferTime)&&he(i.default.BUFFER_LOADED))}function he(e){B===e||e===i.default.BUFFER_EMPTY&&0===S.getTime()||I===r.default.FRAGMENTED_TEXT&&!_.isTextEnabled()||(B=e,Re(c.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Re(e===i.default.BUFFER_LOADED?c.default.BUFFER_LOADED:c.default.BUFFER_EMPTY),D.debug(e===i.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function pe(){var e=[],t=k.getAllBufferRanges();if(!t||0===t.length)return e;var n=S.getTime(),r=Math.max(0,n-w.get().streaming.bufferToKeep),i=m.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&S.getIsDynamic())return[];if(t.start(0)<=r){for(var o={start:0,end:r},s=0;s<t.length&&t.end(s)<=r;s++)o.end=t.end(s);o.start<o.end&&e.push(o)}return e}function ge(e){e&&k&&0!==e.length&&(W.push.apply(W,e),H||ve())}function ve(){if(0===W.length||!k)return D.debug("Nothing to prune, halt pruning"),W=[],void(H=!1);var e=k.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return D.debug("SourceBuffer is empty (or does not exist), halt pruning"),W=[],void(H=!1);var t=W.shift();D.debug("Removing buffer from:",t.start,"to",t.end),H=!0,S.getTime()<t.end&&(M=!1,x=0),k.remove(t.start,t.end,t.force)}function me(e){k===e.buffer&&(D.debug("onRemoved buffer from:",e.from,"to",e.to),te(k.getAllBufferRanges()),0===W.length&&(H=!1),e.unintended&&(D.warn("Detected unintended removal from:",e.from,"to",e.to,"setting index handler time to",e.from),Re(c.default.SEEK_TARGET,{time:e.from,mediaType:I,streamId:A.id})),H?ve():(z?(z=!1,X&&ee(X)):ce(),Re(c.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:we(),quotaExceeded:K})))}function ye(e){e&&void 0!==e.MSETimeOffset&&k&&k.updateTimestampOffset&&k.updateTimestampOffset(e.MSETimeOffset)}function Ee(e){e.error||M||ye(e.currentRepresentation)}function Te(e){P=e.request.index,de()}function _e(e){if(e.newMediaInfo.streamInfo.id===A.id&&e.newMediaInfo.type===I){var t=k&&k.getAllBufferRanges();t&&(D.info("Track change asked"),E.getSwitchMode(I)===r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&t&&t.length>0&&S.getTimeToStreamEnd()>w.get().streaming.stallThreshold&&(M=!1,P=Number.POSITIVE_INFINITY))}}function be(){++j*(w.get().streaming.wallclockTimeUpdateInterval/1e3)>=w.get().streaming.bufferPruningInterval&&(j=0,k&&I!==r.default.FRAGMENTED_TEXT&&(M||ge(pe())))}function Se(){fe()}function Ae(e,t){O=e,k&&t&&"function"==typeof k.discharge&&(F=k,J(t))}function Ie(){var e,t=k.getAllBufferRanges(),n=0,r=void 0;if(!t)return n;for(r=0,e=t.length;r<e;r++)n+=t.end(r)-t.start(r);return n}function we(){return Ie()<N}function Re(e,t){var r=t||{};n.trigger(e,r,{streamId:A.id,mediaType:I})}function De(e,t){N=Number.POSITIVE_INFINITY,B=void 0,C=u.default.QUALITY_DEFAULT,P=Number.POSITIVE_INFINITY,x=0,G=null,M=!1,H=!1,K=!1,Y=!1,L=0,j=0,W=[],q=NaN,k&&(e||k.abort(),k.reset(t),k=null),z=!1}return R={initialize:function(e){Ae(e),C=b.getQualityFor(I),n.on(c.default.DATA_UPDATE_COMPLETED,Ee,this),n.on(c.default.INIT_FRAGMENT_LOADED,Z,this),n.on(c.default.MEDIA_FRAGMENT_LOADED,$,this),n.on(c.default.QUALITY_CHANGE_REQUESTED,re,this),n.on(c.default.STREAM_COMPLETED,Te,this),n.on(c.default.PLAYBACK_PLAYING,ue,this),n.on(c.default.PLAYBACK_PROGRESS,oe,this),n.on(c.default.PLAYBACK_TIME_UPDATED,oe,this),n.on(c.default.PLAYBACK_RATE_CHANGED,Se,this),n.on(c.default.PLAYBACK_SEEKING,ie,this),n.on(c.default.PLAYBACK_SEEKED,ae,this),n.on(c.default.PLAYBACK_STALLED,se,this),n.on(c.default.WALLCLOCK_TIME_UPDATED,be,this),n.on(c.default.CURRENT_TRACK_CHANGED,_e,this,{priority:l.default.EVENT_PRIORITY_HIGH}),n.on(c.default.SOURCEBUFFER_REMOVE_COMPLETED,me,this)},getStreamId:function(){return A.id},getType:function(){return I},getBufferControllerType:function(){return"BufferController"},getRepresentationInfo:Q,createBuffer:J,dischargePreBuffer:function(){if(k&&F&&"function"==typeof F.discharge){var e=F.getAllBufferRanges();if(e.length>0){for(var t="Beginning "+I+"PreBuffer discharge, adding buffer for:",n=0;n<e.length;n++)t+=" start: "+e.start(n)+", end: "+e.end(n)+";";D.debug(t)}else D.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");U=[];for(var r=F.discharge(),i=null,a=0;a<r.length;a++){var o=r[a];if("InitializationSegment"!==o.segmentType){var s=V.extract(o.streamId,o.representationId);s&&i!==s&&(U.push(s),k.append(s),i=s)}U.push(o),k.append(o)}F.reset(),F=null}},getBuffer:function(){return k},setBuffer:function(e){k=e},getBufferLevel:function(){return L},getRangeAt:le,setMediaSource:Ae,getMediaSource:function(){return O},appendInitSegment:function(e){var t=V.extract(A.id,e);return!!t&&(D.info("Append Init fragment",I," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),ee(t),!0)},replaceBuffer:function(){z=!0},getIsBufferingCompleted:function(){return M},getIsPruningInProgress:function(){return H},reset:function(e,t){n.off(c.default.DATA_UPDATE_COMPLETED,Ee,this),n.off(c.default.INIT_FRAGMENT_LOADED,Z,this),n.off(c.default.MEDIA_FRAGMENT_LOADED,$,this),n.off(c.default.QUALITY_CHANGE_REQUESTED,re,this),n.off(c.default.STREAM_COMPLETED,Te,this),n.off(c.default.PLAYBACK_PLAYING,ue,this),n.off(c.default.PLAYBACK_PROGRESS,oe,this),n.off(c.default.PLAYBACK_TIME_UPDATED,oe,this),n.off(c.default.PLAYBACK_RATE_CHANGED,Se,this),n.off(c.default.PLAYBACK_SEEKING,ie,this),n.off(c.default.PLAYBACK_SEEKED,ae,this),n.off(c.default.PLAYBACK_STALLED,se,this),n.off(c.default.WALLCLOCK_TIME_UPDATED,be,this),n.off(c.default.CURRENT_TRACK_CHANGED,_e,this),n.off(c.default.SOURCEBUFFER_REMOVE_COMPLETED,me,this),De(e,t)},updateAppendWindow:function(){k&&!M&&k.updateAppendWindow(A)}},D=(0,f.default)(t).getInstance().getLogger(R),V=(0,h.default)(t).getInstance(),De(),R}y.__dashjs_factory_name="BufferController",t.default=d.default.getClassFactory(y)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(2)),i=c(n(6)),a=c(n(3)),o=c(n(5)),s=c(n(0)),u=c(n(42)),l=c(n(11));function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,n,s){var c=this.context,d=(0,a.default)(c).getInstance(),f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=[],E=[],T=n;function _(){try{return g.buffered}catch(e){return p.error("getAllBufferRanges exception: "+e.message),null}}function b(t){g&&D((function(){try{var n=e.duration,r=0;t&&!isNaN(t.start)&&!isNaN(t.duration)&&isFinite(t.duration)&&(n=t.start+t.duration),t&&!isNaN(t.start)&&(r=t.start),g.appendWindowStart=0,g.appendWindowEnd=n,g.appendWindowStart=r,p.debug("Updated append window. Set start to "+g.appendWindowStart+" and end to "+g.appendWindowEnd)}catch(e){p.warn("Failed to set append window")}}))}function S(){var e=this;if(E.length>0){v=!0;var t=E[0];E.splice(0,1);var n=[],r=function(){var r=_();!function(e,t,n,r){t&&t.length>0&&t.length<n.length&&function(e,t){for(var n=0;n<e.length;n++){var r=Math.round(e.start(n)),i=Math.round(e.end(n));if(i===t.start||r===t.end||t.start>=r&&t.end<=i)return!0}return!1}(t,r)&&d.trigger(o.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:e,from:n.end(n.length-2),to:n.start(n.length-1),unintended:!0})}(e,n,r,t),E.length>0?S.call(this):(v=!1,T&&T({chunk:t}))};try{0===t.bytes.length?r.call(this):(n=_(),g.appendBuffer?g.appendBuffer(t.bytes):g.append(t.bytes,t),D(r.bind(this)))}catch(e){p.fatal('SourceBuffer append failed "'+e+'"'),E.length>0?S():v=!1,T&&T({chunk:t,error:new i.default(e.code,e.message)})}}}function A(){if(y.length>0){var e=y.shift();g.updating?D(e):(e(),A())}}function I(){g.updating||A()}function w(){g.updating||A()}function R(){p.error("SourceBufferSink error")}function D(e){y.push(e),g.updating||A()}return f={getType:function(){return h},getAllBufferRanges:_,getBuffer:function(){return g},append:function(e){e?(E.push(e),v||D(S.bind(this))):T({chunk:e,error:new i.default(l.default.APPEND_ERROR_CODE,l.default.APPEND_ERROR_MESSAGE)})},remove:function(t,n,r){var a=this;D((function(){try{t>=0&&n>t&&(r||"ended"!==e.readyState)&&g.remove(t,n),D((function(){d.trigger(o.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:t,to:n,unintended:!1})}))}catch(e){d.trigger(o.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:t,to:n,unintended:!1,error:new i.default(e.code,e.message)})}}))},abort:function(){try{("open"===e.readyState||g.setTextTrack&&"ended"===e.readyState)&&g.abort()}catch(e){p.error('SourceBuffer append abort failed: "'+e+'"')}E=[]},reset:function(t){if(g){if("function"==typeof g.removeEventListener&&(g.removeEventListener("updateend",w,!1),g.removeEventListener("error",R,!1),g.removeEventListener("abort",R,!1)),clearInterval(m),y=[],!t){try{g.getClassName&&"TextSourceBuffer"===g.getClassName()||(p.debug("Removing sourcebuffer from media source"),e.removeSourceBuffer(g))}catch(e){p.error("Failed to remove source buffer from media source.")}g=null}v=!1}E=[],T=null},updateTimestampOffset:function(e){g.timestampOffset===e||isNaN(e)||D((function(){e<0&&(e+=.001),g.timestampOffset=e}))},hasDiscontinuitiesAfter:function(e){try{var t=_();if(t&&t.length>1)for(var n=0,r=t.length;n<r;n++)if(n>0&&e<t.start(n)&&t.start(n)>t.end(n-1)+.1)return!0}catch(e){p.error("hasDiscontinuities exception: "+e.message)}return!1},waitForUpdateEnd:D,updateAppendWindow:b},function(){p=(0,r.default)(c).getInstance().getLogger(f),v=!1,h=t.type;var n=t.codec;try{if(n.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))throw new Error("not really supported");(g=s||e.addSourceBuffer(n)).changeType&&s&&(p.debug("Doing period transition with changeType"),g.changeType(n)),b();if("function"==typeof g.addEventListener)try{g.addEventListener("updateend",w,!1),g.addEventListener("error",R,!1),g.addEventListener("abort",R,!1)}catch(e){m=setInterval(I,50)}else m=setInterval(I,50)}catch(e){if(!t.isText&&-1===n.indexOf('codecs="stpp')&&-1===n.indexOf('codecs="wvtt'))throw e;var i=(0,u.default)(c).getInstance();g=i.getTextSourceBuffer()}}(),f}d.__dashjs_factory_name="SourceBufferSink";var f=s.default.getClassFactory(d);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r},o=n(15);function s(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,o.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,o.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}s.__dashjs_factory_name="CustomTimeRanges",t.default=a.default.getClassFactory(s)},function(e,t,n){t.generateISD=n(112).generateISD,t.fromXML=n(113).fromXML,t.renderHTML=n(129).render},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t,r){var i=n(37);e.exports=E;var a,o=n(70);E.ReadableState=y;n(47).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(72),l=n(38).Buffer,c=t.Uint8Array||function(){};var d=Object.create(n(28));d.inherits=n(21);var f=n(118),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,g=n(119),v=n(73);d.inherits(E,u);var m=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(a=a||n(17));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(50).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function E(e){if(a=a||n(17),!(this instanceof E))return new E(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function T(e,t,n,r,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,o)):(i||(a=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?_(e,o,t,!1):I(e,o)):_(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function _(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),I(e,t)}Object.defineProperty(E.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=v.destroy,E.prototype._undestroy=v.undestroy,E.prototype._destroy=function(e,t){this.push(null),t(e)},E.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),T(this,e,t,!1,n)},E.prototype.unshift=function(e){return T(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){return p||(p=n(50).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function b(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){h("emit readable"),e.emit("readable"),C(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(w,e,t))}function w(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function D(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function L(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(N,t,e))}function N(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}E.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):S(this),null;if(0===(e=b(e,t))&&t.ended)return 0===t.length&&L(this),null;var r,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=b(n,t))),null===(r=e>0?M(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&L(this)),null!==r&&this.emit("data",r),r},E.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},E.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:E;function l(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",d),e.removeListener("error",v),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",E),n.removeListener("data",g),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",l);var d=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",d);var f=!1;var p=!1;function g(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==O(a.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function v(t){h("onerror",t),E(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",y),E()}function y(){h("onfinish"),e.removeListener("close",m),E()}function E(){h("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",m),e.once("finish",y),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var o=O(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},E.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):i.nextTick(R,this))}return n},E.prototype.addListener=E.prototype.on,E.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(D,e,t))}(this,e)),this},E.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},E.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(h("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<m.length;a++)e.on(m[a],this.emit.bind(this,m[a]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),E._fromList=M}).call(this,n(14),n(36))},function(e,t,n){e.exports=n(47).EventEmitter},function(e,t,n){"use strict";var r=n(37);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";e.exports=o;var r=n(17),i=Object.create(n(28));function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);r.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){u(e,t,n)})):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n(21),i.inherits(o,r),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=E(n(78)),i=E(n(1)),a=E(n(10)),o=E(n(79)),s=E(n(26)),u=E(n(3)),l=E(n(5)),c=E(n(0)),d=E(n(146)),f=E(n(12)),h=E(n(147)),p=E(n(148)),g=E(n(149)),v=E(n(2)),m=n(8),y=n(15);function E(e){return e&&e.__esModule?e:{default:e}}function T(){var e=this.context,t=(0,v.default)(e).getInstance(),n=(0,u.default)(e).getInstance(),c=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0;function K(){(T=(0,r.default)(e).create({dashMetrics:j,mediaPlayerModel:N,settings:H})).initialize()}function V(){b={},S={},I={},A={},P={},U={},B={},G={},void 0===R&&(R=!1),x=void 0,k=void 0,F=void 0,clearTimeout(w),w=null}function q(e){e.mediaType===i.default.VIDEO&&(void 0!==x&&k.push(x,L.getPlaybackQuality()),x=e.newQuality)}function Y(e){e.metric!==a.default.HTTP_REQUEST||!e.value||e.value.type!==m.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||F.push(e.mediaType,e.value,H.get().streaming.abr.useDeadTimeLatency),e.metric!==a.default.BUFFER_LEVEL||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||function(e,t){var n=H.get().streaming.abr.ABRStrategy;if(n===i.default.ABR_STRATEGY_L2A)return U[e]=!1,G[e]=!1,void(B[e]=!0);if(n===i.default.ABR_STRATEGY_LoLP)return U[e]=!1,G[e]=!0,void(B[e]=!1);if(n===i.default.ABR_STRATEGY_BOLA)return U[e]=!0,G[e]=!1,void(B[e]=!1);if(n===i.default.ABR_STRATEGY_THROUGHPUT)return U[e]=!1,G[e]=!1,void(B[e]=!1);!function(e,t){var n=N.getStableBufferTime(),r=n,i=.5*n,a=U[e],o=t>(a?i:r);U[e]=o,o!==a&&(o?E.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+t.toFixed(3)+")."):E.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+t.toFixed(3)+")."))}(e,t)}(e.mediaType,.001*e.value.level)}function W(e,t){return b[t]=b[t]||{},b[t].hasOwnProperty(e)||(b[t][e]=0),function(e,t){if(t!==i.default.VIDEO||!H.get().streaming.abr.limitBitrateByPortal||!A[t])return e;R||ae();var n=M.getAdaptationForType(0,t).Representation,r=e;if(D>0&&C>0){for(;r>0&&n[r]&&D<n[r].width&&D-n[r-1].width<n[r].width-D;)r-=1;for(;r<n.length-1&&n[r].width===n[r+1].width;)r+=1}return r}(function(e,t,n){var r=H.get().streaming.abr.maxRepresentationRatio[t];if(isNaN(r)||r>=1||r<0)return e;return Math.min(e,Math.round(n*r))}(function(e,t){var n=e;if(!A[t])return n;var r=X(t);void 0!==r&&(n=Math.max(e,r));var i=z(t);void 0!==i&&(n=Math.min(n,i));return n}(b[t][e],e),e,b[t][e]),e)}function z(e){var t=function(e){return H.get().streaming.abr.maxBitrate[e]}(e);return t>-1?$(A[e].getMediaInfo(),t):void 0}function X(e){var t=function(e){return H.get().streaming.abr.minBitrate[e]}(e);if(t>-1){var n=A[e].getMediaInfo(),r=ee(n),i=$(n,t);return r[i]&&i<r.length-1&&r[i].bitrate<1e3*t&&i++,i}}function Q(e,t,n,r){var i=t.id,a=ie(e);(0,y.checkInteger)(n);var o=W(e,i);n!==a&&n>=0&&n<=o&&J(e,a,n,o,r)}function J(e,t,r,i,a){if(e&&A[e]){var o=A[e].getStreamInfo(),s=o?o.id:null;if(H.get().debug.logLevel===v.default.LOG_LEVEL_DEBUG){var u=j.getCurrentBufferLevel(e);E.info("["+e+"] switch from "+t+" to "+r+"/"+i+" (buffer: "+u+") "+(a?JSON.stringify(a):"."))}!function(e,t,n){S[t]=S[t]||{},S[t][e]=n}(e,s,r),n.trigger(l.default.QUALITY_CHANGE_REQUESTED,{oldQuality:t,newQuality:r,reason:a},{streamId:o.id,mediaType:e});var c=F.getAverageThroughput(e);isNaN(c)||O.setSavedBitrateSettings(e,c)}}function Z(e,t){I[e].state=t}function $(e,t,n){var r=e&&e.type?A[e.type].getRepresentationInfo():null;if(H.get().streaming.abr.useDeadTimeLatency&&n&&r&&r.fragmentDuration){n/=1e3;var i=r.fragmentDuration;if(n>i)return 0;t*=1-n/i}for(var a=ee(e),o=a.length-1;o>=0;o--){if(1e3*t>=a[o].bitrate)return o}return 0}function ee(e){var t=[];if(!e||!e.bitrateList)return t;for(var n=e.bitrateList,r=e.type,i=void 0,a=0,s=n.length;a<s;a++)(i=new o.default).mediaType=r,i.qualityIndex=a,i.bitrate=n[a].bandwidth,i.width=n[a].width,i.height=n[a].height,i.scanType=n[a].scanType,t.push(i);return t}function te(e){return U[e]}function ne(e){return B[e]}function re(e){return G[e]}function ie(e){if(e&&A[e]){var t=A[e].getStreamInfo(),n=t?t.id:null;if(n)return S[n]=S[n]||{},S[n].hasOwnProperty(e)||(S[n][e]=0),S[n][e]}return 0}function ae(){if(L){var e=H.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;D=L.getClientWidth()*e,C=L.getClientHeight()*e}}function oe(t){var n=t.request.mediaType;if(H.get().streaming.abr.autoSwitchBitrate[n]){var r=A[n];if(!r)return;var i=(0,d.default)(e).create({abrController:c,streamProcessor:r,currentRequest:t.request,useBufferOccupancyABR:te(n),useL2AABR:ne(n),useLoLPABR:re(n),videoModel:L}),o=T.shouldAbandonFragment(i);if(o.quality>f.default.NO_CHANGE){var u=r.getFragmentModel();u.getRequests({state:s.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(u.abortRequests(),Z(n,a.default.ABANDON_LOAD),P[n].reset(),P[n].push({oldValue:ie(n),newValue:o.quality,confidence:1,reason:o.reason}),Q(n,_.getActiveStreamInfo(),o.quality,o.reason),clearTimeout(w),w=setTimeout((function(){Z(n,a.default.ALLOW_LOAD),w=null}),H.get().streaming.abandonLoadTimeout))}}}return c={isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=ie(i.default.AUDIO),r=ie(i.default.VIDEO);return n===W(i.default.AUDIO,t)&&r===W(i.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return function(e,t,n){b[t]=b[t]||{},b[t][e]=n}(t,n,r),r},getThroughputHistory:function(){return F},getBitrateList:ee,getQualityForBitrate:$,getTopBitrateInfoFor:function(e){if(e&&A&&A[e]){var t=A[e].getStreamInfo();if(t&&t.id){var n=W(e,t.id),r=ee(A[e].getMediaInfo());return r[n]?r[n]:null}}return null},getMaxAllowedIndexFor:z,getMinAllowedIndexFor:X,getInitialBitrateFor:function(e){if(function(){if(!O||!O.hasOwnProperty("getSavedBitrateSettings"))throw new Error(i.default.MISSING_CONFIG_ERROR)}(),e===i.default.TEXT||e===i.default.FRAGMENTED_TEXT)return NaN;var t=O.getSavedBitrateSettings(e),n=H.get().streaming.abr.initialBitrate[e],r=H.get().streaming.abr.initialRepresentationRatio[e];if(-1===n)if(r>-1){var a=M.getAdaptationForType(0,e).Representation;if(Array.isArray(a))n=a[Math.max(Math.round(a.length*r)-1,0)].bandwidth;else n=0}else n=isNaN(t)?e===i.default.VIDEO?1e3:100:t;return n},getQualityFor:ie,getAbandonmentStateFor:function(e){return I[e]?I[e].state:null},setPlaybackQuality:Q,checkPlaybackQuality:function(t){if(t&&A&&A[t]){var n=A[t].getStreamInfo(),r=n?n.id:null,i=ie(t),o=(0,d.default)(e).create({abrController:c,streamProcessor:A[t],currentValue:i,switchHistory:P[t],droppedFramesHistory:k,useBufferOccupancyABR:te(t),useL2AABR:ne(t),useLoLPABR:re(t),videoModel:L});if(k){var s=L.getPlaybackQuality();s&&k.push(x,s)}if(H.get().streaming.abr.autoSwitchBitrate[t]){var u=X(t),l=W(t,r),h=T.getMaxQuality(o),p=h.quality;if(void 0!==u&&(p>f.default.NO_CHANGE?p:i)<u&&(p=u),p>l&&(p=l),P[t].push({oldValue:i,newValue:p}),p>f.default.NO_CHANGE&&p!=i)(I[t].state===a.default.ALLOW_LOAD||p>i)&&J(t,i,p,l,h.reason);else if(H.get().debug.logLevel===v.default.LOG_LEVEL_DEBUG){var g=j.getCurrentBufferLevel(t,!0);E.debug("["+t+"] stay on "+i+"/"+l+" (buffer: "+g+")")}}}},getTopQualityIndexFor:W,setElementSize:ae,setWindowResizeEventCalled:function(e){R=e},createAbrRulesCollection:K,registerStreamType:function(t,r){P[t]=P[t]||(0,h.default)(e).create(),A[t]=r,I[t]=I[t]||{},I[t].state=a.default.ALLOW_LOAD,U[t]=!1,B[t]=!1,G[t]=!1,n.on(l.default.LOADING_PROGRESS,oe,c),t===i.default.VIDEO&&(n.on(l.default.QUALITY_CHANGE_RENDERED,q,c),k=k||(0,p.default)(e).create(),ae()),n.on(l.default.METRIC_ADDED,Y,c),n.on(l.default.PERIOD_SWITCH_COMPLETED,K,c),F=F||(0,g.default)(e).create({settings:H})},unRegisterStreamType:function(e){delete A[e]},setConfig:function(e){e&&(e.streamController&&(_=e.streamController),e.domStorage&&(O=e.domStorage),e.mediaPlayerModel&&(N=e.mediaPlayerModel),e.dashMetrics&&(j=e.dashMetrics),e.adapter&&(M=e.adapter),e.videoModel&&(L=e.videoModel),e.settings&&(H=e.settings))},reset:function(){V(),n.off(l.default.LOADING_PROGRESS,oe,c),n.off(l.default.QUALITY_CHANGE_RENDERED,q,c),n.off(l.default.METRIC_ADDED,Y,c),n.off(l.default.PERIOD_SWITCH_COMPLETED,K,c),T&&T.reset()}},E=t.getLogger(c),V(),c}T.__dashjs_factory_name="AbrController";var _=c.default.getSingletonFactory(T);_.QUALITY_DEFAULT=0,c.default.updateSingletonFactory(T.__dashjs_factory_name,_),t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(134)),i=p(n(135)),a=p(n(136)),o=p(n(137)),s=p(n(138)),u=p(n(139)),l=p(n(140)),c=p(n(141)),d=p(n(0)),f=p(n(12)),h=p(n(1));function p(e){return e&&e.__esModule?e:{default:e}}function g(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,d=e.dashMetrics,p=e.settings,g=void 0,v=void 0;function m(e){return e.filter((function(e){return e.quality>f.default.NO_CHANGE}))}function y(e){var n,r={},i=null,a=void 0,o=void 0,s=void 0,u=void 0;if(0!==e.length){for(r[f.default.PRIORITY.STRONG]={quality:f.default.NO_CHANGE,reason:null},r[f.default.PRIORITY.WEAK]={quality:f.default.NO_CHANGE,reason:null},r[f.default.PRIORITY.DEFAULT]={quality:f.default.NO_CHANGE,reason:null},a=0,n=e.length;a<n;a+=1)(o=e[a]).quality!==f.default.NO_CHANGE&&(r[o.priority].quality===f.default.NO_CHANGE||r[o.priority].quality>o.quality)&&(r[o.priority].quality=o.quality,r[o.priority].reason=o.reason||null);return r[f.default.PRIORITY.WEAK].quality!==f.default.NO_CHANGE&&(i=r[f.default.PRIORITY.WEAK]),r[f.default.PRIORITY.DEFAULT].quality!==f.default.NO_CHANGE&&(i=r[f.default.PRIORITY.DEFAULT]),r[f.default.PRIORITY.STRONG].quality!==f.default.NO_CHANGE&&(i=r[f.default.PRIORITY.STRONG]),i&&(s=i.quality,u=i.reason),(0,f.default)(t).create(s,u)}}return{initialize:function(){g=[],v=[],p.get().streaming.abr.useDefaultABRRules&&(p.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_L2A?g.push((0,l.default)(t).create({dashMetrics:d,mediaPlayerModel:n,settings:p})):p.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_LoLP?g.push((0,c.default)(t).create({dashMetrics:d})):(g.push((0,u.default)(t).create({dashMetrics:d,mediaPlayerModel:n,settings:p})),g.push((0,r.default)(t).create({dashMetrics:d})),g.push((0,i.default)(t).create({dashMetrics:d})),g.push((0,s.default)(t).create()),g.push((0,o.default)(t).create()),v.push((0,a.default)(t).create({dashMetrics:d,mediaPlayerModel:n,settings:p})))),n.getABRCustomRules().forEach((function(e){"qualitySwitchRules"===e.type&&g.push(e.rule(t).create()),"abandonFragmentRules"===e.type&&v.push(e.rule(t).create())}))},reset:function(){[g,v].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),g=[],v=[]},getMaxQuality:function(e){return y(m(g.map((function(t){return t.getMaxIndex(e)}))))||(0,f.default)(t).create()},getMinSwitchRequest:y,shouldAbandonFragment:function(e){return y(m(v.map((function(t){return t.shouldAbandon(e)}))))||(0,f.default)(t).create()},getQualitySwitchRules:function(){return g}}}g.__dashjs_factory_name="ABRRulesCollection";var v=d.default.getClassFactory(g);v.QUALITY_SWITCH_RULES="qualitySwitchRules",v.ABANDON_FRAGMENT_RULES="abandonFragmentRules",d.default.updateSingletonFactory(g.__dashjs_factory_name,v),t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(16)),i=n(8),a=u(n(0)),o=n(22),s=u(n(156));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t=this.context,n=e.eventBus,a=e.events,u=e.debug,l=e.dashConstants,c=e.urlUtils,d=e.type,f=e.streamInfo,h=e.timelineConverter,p=e.dashMetrics,g=e.baseURLController,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0;function I(){return d}function w(){y=-1,E=null}function R(){w(),T=null,A=null,S=null}function D(e,t,n){var r=g.resolve(n.path),i=void 0,a=void 0;return r&&t!==r.url&&c.isRelative(t)?(i=r.url,a=r.serviceLocation,t&&(i=c.resolve(t,i))):i=t,!c.isRelative(i)&&(e.url=i,e.serviceLocation=a,!0)}function C(e){var t,r,i;t=e.representation,r=t.hasInitialization(),i=t.hasSegments(),r&&i?n.trigger(a.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:f.id,mediaType:d}):A.update(t,S,r,i)}function M(e,t){if(null==t)return null;var n=new r.default,a=t.representation,s=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,u=t.media;return u=(0,o.replaceTokenForTemplate)(u,"Number",t.replacementNumber),u=(0,o.replaceTokenForTemplate)(u,"Time",t.replacementTime),u=(0,o.replaceTokenForTemplate)(u,"Bandwidth",s),u=(0,o.replaceIDForTemplate)(u,a.id),u=(0,o.unescapeDollarsInTemplate)(u),n.mediaType=I(),n.type=i.HTTPRequest.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.availabilityIdx,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,D(n,u,a)?n:void 0}function L(e){var t=!1;if(!e)return t;if(_){if(b)t=!0;else if(E){var n=parseFloat((E.presentationStartTime-e.adaptation.period.start).toFixed(5));t=(E.duration>0?n+1.5*E.duration:n)>=e.adaptation.period.duration}}else y>=e.availableSegmentsNumber&&(t=!0);return t}function N(e){var t=e.representation;t.segments&&n.trigger(a.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:f.id,mediaType:d})}function O(e){if(!e.error){var t,r=e.segments,i=e.representation,s=[],u=0,l=void 0,c=void 0,g=void 0;for(l=0,t=r?r.length:0;l<t;l++)c=r[l],(g=(0,o.getTimeBasedSegment)(h,_,i,c.startTime,c.duration,c.timescale,c.media,c.mediaRange,u))&&(s.push(g),g=null,u++);if(s.length>0)if(i.segmentAvailabilityRange={start:s[0].presentationStartTime,end:s[s.length-1].presentationStartTime},i.availableSegmentsNumber=s.length,i.segments=s,_)!function(e){h.setExpectedLiveEdge(e),p.updateManifestUpdateInfo({presentationStartTime:e})}(s[s.length-1].presentationStartTime-8);i.hasInitialization()&&n.trigger(a.REPRESENTATION_UPDATE_COMPLETED,{representation:i},{streamId:f.id,mediaType:d})}}function x(){m.debug("Dynamic stream complete"),b=!0}return v={initialize:function(e){_=e,b=!1,A.initialize(e)},getStreamId:function(){return f.id},getType:I,getStreamInfo:function(){return f},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.default,s=t.adaptation.period,u=s.start;if(a.mediaType=n,a.type=i.HTTPRequest.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=h.calcAvailabilityStartTimeFromPresentationTime(u,s.mpd,_),a.availabilityEndTime=h.calcAvailabilityEndTimeFromPresentationTime(u+s.duration,s.mpd,_),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,D(a,t.initialization,t))return a.url=(0,o.replaceTokenForTemplate)(a.url,"Bandwidth",t.bandwidth),a}(e,t,I()):null},getRequestForSegment:M,getSegmentRequestForTime:function(e,t,n,i){var a=null;if(!t||!t.segmentInfoType)return a;var o=y,s=!!i&&i.keepIdx,u=!(!i||!i.ignoreIsFinished);T!==n&&(T=n,m.debug("Getting the request for time : "+n));var c=A.getSegmentByTime(t,n);return c?(y=c.availabilityIdx,E=c,m.debug("Index for time "+n+" is "+y),a=M(e,c)):!u&&L(t)&&((a=new r.default).action=r.default.ACTION_COMPLETE,a.index=y-1,a.mediaType=d,a.mediaInfo=e,m.debug("Signal complete in getSegmentRequestForTime")),s&&o>=0&&(y=t.segmentInfoType===l.SEGMENT_TIMELINE&&_?y:o),a},getNextSegmentRequest:function(e,t){var n=null;if(!t||!t.segmentInfoType)return null;T=null;var i=y+1;m.debug("Getting the next request at index: "+i);var a=A.getSegmentByIndex(t,i,E?E.mediaStartTime:-1);return a||!function(e){return!isFinite(e.adaptation.period.duration)}(t)||b?(a?(n=M(e,a),y=a.availabilityIdx):y=_?i-1:i,a?E=a:L(t)&&((n=new r.default).action=r.default.ACTION_COMPLETE,n.index=y-1,n.mediaType=I(),n.mediaInfo=e,m.debug("Signal complete")),n):(m.debug(I()+" No segment found at index: "+i+". Wait for next loop"),null)},setCurrentIndex:function(e){y=e},getCurrentIndex:function(){return y},isMediaFinished:L,reset:function(){R(),n.off(a.INITIALIZATION_LOADED,N,v),n.off(a.SEGMENTS_LOADED,O,v),n.off(a.REPRESENTATION_UPDATE_STARTED,C,v),n.off(a.DYNAMIC_TO_STATIC,x,v)},resetIndex:w,setMimeType:function(e){S=e},getNextSegmentRequestIdempotent:function(e,t){var n=y+1,r=A.getSegmentByIndex(t,n,E?E.mediaStartTime:-1);return r?M(e,r):null}},m=u.getLogger(v),R(),A=(0,s.default)(t).create(e),n.on(a.INITIALIZATION_LOADED,N,v),n.on(a.SEGMENTS_LOADED,O,v),n.on(a.REPRESENTATION_UPDATE_STARTED,C,v),n.on(a.DYNAMIC_TO_STATIC,x,v),v}l.__dashjs_factory_name="DashHandler",t.default=a.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(165));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return i.default},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}o.__dashjs_factory_name="SchemeLoaderFactory";var s=r.default.getSingletonFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(3)),i=h(n(20)),a=h(n(31)),o=h(n(0)),s=h(n(2)),u=h(n(23)),l=h(n(1)),c=n(8),d=h(n(56)),f=h(n(30));function h(e){return e&&e.__esModule?e:{default:e}}var p="m",g="a",v="v",m="i",y="c",E="tt",T="k",_="o",b="d",S="s",A="v",I="l";function w(){var e=void 0,t=void 0,n=void 0,o=void 0,h=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=this.context,N=(0,r.default)(L).getInstance(),O=(0,u.default)(L).getInstance();function x(){n={pr:1,nor:null,st:null,sf:null,sid:""+f.default.generateUuid(),cid:null},C={},D={},M={},k()}function P(){k()}function k(){if(w){var e=w.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(R=t.getProcessors())}}}function F(e,t){var n={},r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;e[u]&&(n[u]=e[u])}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}function U(e){try{return e.type===c.HTTPRequest.MPD_TYPE?((t=B()).ot=""+p,t):e.type===c.HTTPRequest.MEDIA_SEGMENT_TYPE?(function(e){M.hasOwnProperty(e)||(M[e]=!1);D.hasOwnProperty(e)||(D[e]=!1);C.hasOwnProperty(e)||(C[e]=!1)}(e.mediaType),function(e){var t=B(),r=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),i=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),a=function(e){try{return 100*parseInt(o.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),s=function(e){try{var t=n.pr,r=h.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),u=G(e.mediaType),c=function(e){try{var t=o.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),d=n.pr,f=function(e){if(!R||0===R.length)return;var t=!0,n=!1,r=void 0;try{for(var i,a=R[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;if(o.getType()===e)return o.probeNextRequest()}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}(e.mediaType),p=void 0;e.mediaType===l.default.VIDEO&&(p=v);e.mediaType===l.default.AUDIO&&(p=g);e.mediaType===l.default.FRAGMENTED_TEXT&&(p="application/mp4"===e.mediaInfo.mimeType?E:y);var m=O.get().streaming.cmcd.rtp;m||(m=function(e){var t=w.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,a=e.duration,o=G(r);0===o&&(o=500);var s=i.bitrateList[n].bandwidth*a/1e3/(o/t/1e3),u=O.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(O.get().streaming.cmcd.rtpSafetyFactor)?O.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(s*u/100)+1)}(e));if(t.rtp=m,f)if(e.url!==f.url){var T=new URL(f.url);t.nor=T.pathname}else f.range&&(t.nrr=f.range);r&&(t.br=r);p&&(t.ot=p);isNaN(i)||(t.d=i);isNaN(a)||(t.mtp=a);isNaN(s)||(t.dl=s);isNaN(u)||(t.bl=u);isNaN(c)||(t.tb=c);isNaN(d)||1===d||(t.pr=d);C[e.mediaType]&&(t.bs=!0,C[e.mediaType]=!1);!D[e.mediaType]&&M[e.mediaType]||(t.su=!0,D[e.mediaType]=!1,M[e.mediaType]=!0);return t}(e)):e.type===c.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=B();return e.ot=""+m,e.su=!0,e}():e.type===c.HTTPRequest.OTHER_TYPE||e.type===c.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=B();return e.ot=""+_,e}():e.type===c.HTTPRequest.LICENSE?function(e){var t=B();return t.ot=T,t}():null}catch(e){return null}var t}function B(){var e={},t=O.get().streaming.cmcd.cid?O.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=O.get().streaming.cmcd.sid?O.get().streaming.cmcd.sid:n.sid,e.sid=""+e.sid,t&&(e.cid=""+t),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function G(e){try{var t=h.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function j(e){try{n.pr=e.playbackRate}catch(e){}}function H(t){try{var r=e.getIsDynamic(t.data)?""+I:""+A,i=t.protocol&&"MSS"===t.protocol?""+S:""+b;n.st=""+r,n.sf=""+i}catch(e){}}function K(e){try{e.state&&e.mediaType&&e.state===i.default.BUFFER_EMPTY&&(C[e.mediaType]||(C[e.mediaType]=!0),D[e.mediaType]||(D[e.mediaType]=!0))}catch(e){}}function V(){for(var e in C)C.hasOwnProperty(e)&&(C[e]=!0);for(var t in D)D.hasOwnProperty(t)&&(D[t]=!0)}function q(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){if("v"===r&&1===e[r])return t;"string"!=typeof e[r]||"ot"===r&&"sf"===r&&"st"===r?t+=r+"="+e[r]:t+=r+'="'+e[r].replace(/"/g,'"')+'"';return i<n-1&&(t+=","),t}),"");return r=r.replace(/=true/g,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){var t=U(e),n=q(t);return N.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:"CMCD",value:n}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){var t=U(e),n=F(t,["br","d","ot","tb"]),r=F(t,["bl","dl","mtp","nor","nrr","su"]),i=F(t,["bs","rtp"]),o=F(t,["cid","pr","sf","sid","st","v"]),s={"CMCD-Object":q(n),"CMCD-Request":q(r),"CMCD-Status":q(i),"CMCD-Session":q(o)};return N.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t}),s}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(o=e.abrController),e.dashMetrics&&(h=e.dashMetrics),e.playbackController&&(w=e.playbackController))},reset:function(){N.off(i.default.PLAYBACK_RATE_CHANGED,j,this),N.off(i.default.MANIFEST_LOADED,H,this),N.off(i.default.BUFFER_LEVEL_STATE_CHANGED,K,t),N.off(i.default.PLAYBACK_SEEKED,V,t),x()},initialize:function(){N.on(i.default.PLAYBACK_RATE_CHANGED,j,t),N.on(i.default.MANIFEST_LOADED,H,t),N.on(i.default.BUFFER_LEVEL_STATE_CHANGED,K,t),N.on(i.default.PLAYBACK_SEEKED,V,t),N.on(i.default.PERIOD_SWITCH_COMPLETED,P,t)}},(0,s.default)(L).getInstance().getLogger(t),e=(0,d.default)(L).getInstance(),x(),t}w.__dashjs_factory_name="CmcdModel",t.default=o.default.getSingletonFactory(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};r.DEFAULT_DVB_PRIORITY=1,r.DEFAULT_DVB_WEIGHT=1,t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(172));function a(e){return e&&e.__esModule?e:{default:e}}function o(){return{areEqual:function(e,t){return(0,i.default)(e,t)}}}o.__dashjs_factory_name="ObjectUtils",t.default=r.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(3)),i=c(n(5)),a=c(n(0)),o=c(n(2)),s=c(n(11)),u=c(n(9)),l=c(n(13));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=(0,r.default)(e).getInstance(),n=(0,l.default)(e).getInstance(),a=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0;function _(){d=NaN,g=!1,h=!0,p=!1,b()}function b(){null!==f&&(clearTimeout(f),f=null)}function S(e){b(),p||(isNaN(e)&&!isNaN(d)&&(e=1e3*d),isNaN(e)||(c.debug("Refresh manifest in "+e+" milliseconds."),f=setTimeout(w,e)))}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];g=!0;var t=m.getValue(),r=t.url,i=y.getPatchLocation(t),a=y.getLocation(t);i&&!e?r=i:a&&(r=a),n.isRelative(r)&&(r=n.resolve(r,t.url)),v.load(r)}function I(e){if(e){if(y.getIsPatch(e)){var n=e;e=m.getValue();var r=y.isPatchValid(e,n),a=r;if(r){var o=y.getPublishTime(e);a=y.applyPatchToManifest(e,n);var s=y.getPublishTime(e);a=o.getTime()!=s.getTime()}if(!a)return c.debug("Patch provided is invalid, performing full manifest refresh"),void A(!0);e.loadedTime=new Date}}else(e=m.getValue()).loadedTime=new Date;if(m.getValue()&&m.getValue().type===u.default.DYNAMIC&&e.type===u.default.STATIC)return t.trigger(i.default.DYNAMIC_TO_STATIC),g=!1,void(p=!0);m.setValue(e);var l=new Date,f=(l.getTime()-e.loadedTime.getTime())/1e3;1e3*(d=y.getManifestUpdatePeriod(e,f))>2147483647&&(d=2147483.647),t.trigger(i.default.MANIFEST_UPDATED,{manifest:e}),c.info("Manifest has been refreshed at "+l+"["+l.getTime()/1e3+"] "),h||S()}function w(){h||(g?S(T.get().streaming.manifestUpdateRetryInterval):A())}function R(e){e.error?e.error.code===s.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&E.error(e.error):I(e.manifest)}function D(){h=!1,S()}function C(){(h=!T.get().streaming.scheduleWhilePaused)&&b()}function M(){g=!1}return a={initialize:function(){_(),t.on(i.default.STREAMS_COMPOSED,M,this),t.on(i.default.PLAYBACK_STARTED,D,this),t.on(i.default.PLAYBACK_PAUSED,C,this),t.on(i.default.INTERNAL_MANIFEST_LOADED,R,this)},setManifest:function(e){I(e)},refreshManifest:A,setConfig:function(e){e&&(e.manifestModel&&(m=e.manifestModel),e.adapter&&(y=e.adapter),e.manifestLoader&&(v=e.manifestLoader),e.errHandler&&(E=e.errHandler),e.settings&&(T=e.settings))},reset:function(){t.off(i.default.PLAYBACK_STARTED,D,this),t.off(i.default.PLAYBACK_PAUSED,C,this),t.off(i.default.STREAMS_COMPOSED,M,this),t.off(i.default.INTERNAL_MANIFEST_LOADED,R,this),_()}},c=(0,o.default)(e).getInstance().getLogger(a),a}d.__dashjs_factory_name="ManifestUpdater",t.default=a.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.url=e||null,i.type=n||null,i.mediaType=r.default.STREAM,i.responseType="",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}(i(n(16)).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0);void 0===e.attributePrefix&&(e.attributePrefix="_");e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0);e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0);void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0);e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1);e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1);void 0===e.ignoreRoot&&(e.ignoreRoot=!1)}();var t=1,n=3,r=4,i=8,a=9;function o(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function s(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function u(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function l(t,n,r){switch(e.arrayAccessForm){case"property":t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]}!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&u(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function c(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function d(n,r,i,a){return!(r==t&&e.xmlElementsFilter.length>0)||u(e.xmlElementsFilter,n,i,a)}function f(s,h){if(s.nodeType==a){for(var p=new Object,g=s.childNodes,v=0;v<g.length;v++){if((y=g[v]).nodeType==t)if(e.ignoreRoot)p=f(y);else(p={})[E=o(y)]=f(y)}return p}if(s.nodeType==t){(p=new Object).__cnt=0;var m=[];for(g=s.childNodes,v=0;v<g.length;v++){var y,E=o(y=g[v]);if(y.nodeType!=i){var T=h+"."+E;if(d(p,y.nodeType,E,T))if(p.__cnt++,null==p[E]){var _=f(y,T);if("#text"!=E||/[^\s]/.test(_))(b={})[E]=_,m.push(b);p[E]=_,l(p,E,T)}else{null!=p[E]&&(p[E]instanceof Array||(p[E]=[p[E]],l(p,E,T)));var b;_=f(y,T);if("#text"!=E||/[^\s]/.test(_))(b={})[E]=_,m.push(b);p[E][p[E].length]=_}}}p.__children=m;for(var S=o(s),A=0;A<s.attributes.length;A++){var I=s.attributes[A];p.__cnt++;for(var w=I.value,R=0,D=e.matchers.length;R<D;R++){var C=e.matchers[R];C.test(I,S)&&(w=C.converter(I.value))}p[e.attributePrefix+I.name]=w}var M=function(e){return e.prefix}(s);return null!=M&&""!=M&&(p.__cnt++,p.__prefix=M),null!=p["#text"]&&(p.__text=p["#text"],p.__text instanceof Array&&(p.__text=p.__text.join("\n")),e.stripWhitespaces&&(p.__text=p.__text.trim()),delete p["#text"],"property"==e.arrayAccessForm&&delete p["#text_asArray"],p.__text=function(t,n,r){if(e.datetimeAccessFormPaths.length>0){var i=r.split(".#")[0];return u(e.datetimeAccessFormPaths,t,n,i)?c(t):t}return t}(p.__text,E,h+"."+E)),null!=p["#cdata-section"]&&(p.__cdata=p["#cdata-section"],delete p["#cdata-section"],"property"==e.arrayAccessForm&&delete p["#cdata-section_asArray"]),0==p.__cnt&&"text"==e.emptyNodeForm?p="":1==p.__cnt&&null!=p.__text?p=p.__text:1!=p.__cnt||null==p.__cdata||e.keepCData?p.__cnt>1&&null!=p.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==p.__text||""==p.__text.trim())&&delete p.__text:p=p.__cdata,delete p.__cnt,!e.enableToStringFunc||null==p.__text&&null==p.__cdata||(p.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),p}if(s.nodeType==n||s.nodeType==r)return s.nodeValue}function h(t,n,r,i){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=r)for(var o=0;o<r.length;o++){var u=r[o],l=t[u];e.escapeMode&&(l=s(l)),a+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?a+='"'+l+'"':a+="'"+l+"'"}return a+=i?"/>":">"}function p(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function g(t,n){return"property"==e.arrayAccessForm&&(r=n.toString(),i="_asArray",-1!==r.indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function v(e){var t=0;if(e instanceof Object)for(var n in e)g(e,n)||t++;return t}function m(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||u(e.jsonPropertiesFilter,t,n,r)}function y(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function E(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=s(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=s(t):n+=t),n}function T(e,t){return""===e?t:e+"."+t}function _(e,t,n,r){var i="";if(0==e.length)i+=h(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=h(e[a],t,y(e[a]),!1),i+=b(e[a],T(r,t)),i+=p(e[a],t);return i}function b(e,t){var n="";if(v(e)>0)for(var r in e)if(!g(e,r)&&(""==t||m(e,r,T(t,r)))){var i=e[r],a=y(i);if(null==i||null==i)n+=h(i,r,a,!0);else if(i instanceof Object)if(i instanceof Array)n+=_(i,r,a,t);else if(i instanceof Date)n+=h(i,r,a,!1),n+=i.toISOString(),n+=p(i,r);else{v(i)>0||null!=i.__text||null!=i.__cdata?(n+=h(i,r,a,!1),n+=b(i,T(t,r)),n+=p(i,r)):n+=h(i,r,a,!0)}else n+=h(i,r,a,!1),n+=E(i),n+=p(i,r)}return n+=E(e)}this.parseXmlString=function(e){var t;window.ActiveXObject||window;if(void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?c(e):e},this.xml2json=function(e){return f(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return b(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(198),o=(r=a)&&r.__esModule?r:{default:r};var s=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=r||[],Array.isArray(n)&&n.forEach((function(e){i._properties.push(new o.default(e))}))}return i(e,[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsMediaSource=u;var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r},o=n(57);var s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function u(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function l(){var e,t=void 0;return e={supportsMediaSource:u,supportsEncryptedMedia:function(){return t},supportsCodec:function(e){return!(!("MediaSource"in window)||!MediaSource.isTypeSupported(e))||!(!("WebKitMediaSource"in window)||!WebKitMediaSource.isTypeSupported(e))},setEncryptedMediaSupported:function(e){t=e},supportsEssentialProperty:function(e){try{return-1!==o.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n=e.split(".")[0],r=0===t.indexOf(n),i=void 0,a=0;a<s.length;a++)if(s[a].codec===n){i=s[a];break}return i?r||i.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):r}},t=!1,e}l.__dashjs_factory_name="Capabilities",t.default=a.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVersionString=function(){return"3.2.2"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(241),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t={"urn:dvb:dash:reporting:2014":a.default},n=this.context,r=void 0,i=e.debug?e.debug.getLogger(r):{},o=e.metricsConstants;return r={create:function(e,r){var a=void 0;try{(a=t[e.schemeIdUri](n).create({metricsConstants:o})).initialize(e,r)}catch(t){a=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri "+e.schemeIdUri+" ("+t.message+")")}return a},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}}}o.__dashjs_factory_name="ReportingFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(245)),i=s(n(246)),a=s(n(247)),o=s(n(248));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=void 0,n=(e=e||{}).debug?e.debug.getLogger(t):{},s=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,u=this.context,l={BufferLevel:r.default,DVBErrors:i.default,HttpList:a.default,PlayList:o.default,RepSwitchList:o.default,TcpList:o.default};return t={create:function(t,r){var i,a=t.match(s);if(a){try{(i=l[a[1]](u).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(a[1],r,a[3],a[5])}catch(e){i=null,n.error("MetricsHandlerFactory: Could not create handler for type "+a[1]+" with args "+a[3]+", "+a[5]+" ("+e.message+")")}return i}},register:function(e,t){l[e]=t},unregister:function(e){delete l[e]}}}u.__dashjs_factory_name="MetricsHandlerFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},function(e,t,n){"use strict";function r(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="HandlerHelpers",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){(function(e){
|
|
380
380
|
/*
|
|
381
381
|
@license
|
|
382
382
|
Shaka Player
|
|
@@ -408,5 +408,5 @@ var qn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]
|
|
|
408
408
|
Copyright 2019 Google LLC
|
|
409
409
|
SPDX-License-Identifier: Apache-2.0
|
|
410
410
|
*/
|
|
411
|
-
function og(){}function sg(){eg?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(eg=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=ug):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function ug(e,t){var n,r=this;return O((function(i){return 1==i.a?(console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),T(i,eg.call(r,e,t),2)):mg(n=i.b)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=eg,i.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=lg,i.return(lg.call(r,e,t)))}))}function lg(e,t){var n,r,i,a,o,s,u,c,d,f,h=this;return O((function(p){if(1==p.a){for(console.assert(h==navigator,'bad "this" for requestMediaKeySystemAccess'),n=vg(e),r=[],i=l(t),a=i.next();!a.done;a=i.next())o=a.value,s=cg(o.videoCapabilities,n),u=cg(o.audioCapabilities,n),o.videoCapabilities&&o.videoCapabilities.length&&!s.length||o.audioCapabilities&&o.audioCapabilities.length&&!u.length||((c=Object.assign({},o)).videoCapabilities=s,c.audioCapabilities=u,r.push(c));if(!r.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return T(p,eg.call(h,e,r),2)}return f=p.b,p.return(new gg(f,n))}))}function cg(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function dg(){}function fg(){tg?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(tg=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=hg):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function hg(e){var t,n,r=this;return O((function(i){return 1==i.a?(console.assert(r==navigator.mediaCapabilities,'bad "this" for decodingInfo'),T(i,tg.call(r,e),2)):(t=i.b,e.keySystemConfiguration?(n=t.keySystemAccess)&&mg(n)?(console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=tg,i.return(t)):(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=pg,i.return(pg.call(r,e))):i.return(t))}))}function pg(e){var t,n,r,i,a,o,s,u,l,c=this;return O((function(d){switch(d.a){case 1:return console.assert(c==navigator.mediaCapabilities,'bad "this" for decodingInfo'),t=null,e.keySystemConfiguration&&(n=e.keySystemConfiguration,r=n.keySystem,i=n.audio&&n.audio.encryptionScheme,a=n.video&&n.video.encryptionScheme,t=vg(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},i&&i!=t||a&&a!=t)?d.return(o):T(d,tg.call(c,e),2);case 2:if((s=d.b).keySystemAccess){s.keySystemAccess=new gg(s.keySystemAccess,t),d.m(3);break}if(!e.keySystemConfiguration){d.m(3);break}var f=e.keySystemConfiguration,h=[],p=[];return f.audio&&h.push({robustness:f.audio.robustness||"",contentType:e.audio.contentType}),f.video&&p.push({robustness:f.video.robustness||"",contentType:e.video.contentType}),f={initDataTypes:f.initDataType?[f.initDataType]:[],distinctiveIdentifier:f.distinctiveIdentifier,persistentState:f.persistentState,sessionTypes:f.sessionTypes},h.length&&(f.audioCapabilities=h),p.length&&(f.videoCapabilities=p),u=f,l=s,T(d,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[u]),5);case 5:l.keySystemAccess=d.b;case 3:return d.return(s)}}))}function gg(e,t){this.b=e,this.a=t,this.keySystem=e.keySystem}function vg(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function mg(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function yg(){}function Eg(){sg(),fg()}Dr["text/x-ssa"]=function(){return new Qp},G("EmeEncryptionSchemePolyfill",og),og.install=sg,G("McEncryptionSchemePolyfill",dg),dg.install=fg,gg.prototype.getConfiguration=function(){var e=this.b.getConfiguration();if(e.videoCapabilities)for(var t=l(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.a;if(e.audioCapabilities)for(n=(t=l(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.a;return e},gg.prototype.createMediaKeys=function(){return this.b.createMediaKeys()},G("EncryptionSchemePolyfills",yg),yg.install=Eg,void 0!==n&&n.exports&&(n.exports=yg)}.call(r,n,n,void 0),r.shaka)t[i]=r.shaka[i]}()}).call(this,n(14))},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(5),i=(n(25),n(7)),a=n.n(i),o={capLevelOnFPSDrop:!0,capLevelToPlayerSize:!0},s=function(e){function t(t){var n;return(n=e.call(this,t)||this).playlistDuration=0,n.hls=new a.a(o),n.hls.attachMedia(n.video),n.hls.on(a.a.Events.AUDIO_TRACK_SWITCHED,n.onAudioTrackChange.bind(Object(r.g)(n))),n.hls.on(a.a.Events.SUBTITLE_TRACK_SWITCH,n.onTextTrackChange.bind(Object(r.g)(n))),n.hls.on(a.a.Events.LEVEL_LOADED,n.onLevelLoaded.bind(Object(r.g)(n))),n.hls.on(a.a.Events.LEVEL_SWITCHED,n.onBitrateChange.bind(Object(r.g)(n))),n.hls.on(a.a.Events.ERROR,n.onErrorEvent.bind(Object(r.g)(n))),n}Object(r.d)(t,e),t.isSupported=function(){return a.a.isSupported()};var n=t.prototype;return n.load=function(e){var t=this;return this.state.playbackState!==r.b.IDLE&&this.stop(),this.updateState({playbackState:r.b.LOADING}),new Promise((function(n){t.hls.loadSource(e),t.hls.once(a.a.Events.MANIFEST_PARSED,(function(){t.removeUnsupportedLevels(),n()}))}))},n.removeUnsupportedLevels=function(){var e=this.hls.levels.findIndex((function(e){return!MediaSource.isTypeSupported('video/mp4; codecs="'+e.attrs.CODECS+'"')}));-1!==e&&(this.hls.removeLevel(e),this.removeUnsupportedLevels())},n.onTimeUpdate=function(){this.updateState({currentTime:this.currentTime,duration:this.duration,isAtLiveEdge:this.currentTime>=this.hls.liveSyncPosition-5,isSeekable:!this.isLive||this.playlistDuration>=300}),this.emit(r.e.TIME_UPDATE,{currentTime:this.currentTime,duration:this.duration})},n.onLevelLoaded=function(e,t){var n,r,i=null==t||null==(n=t.details)?void 0:n.live;this.isLiveFlag!==i&&(this.isLiveFlag=i,this.updateState({isLive:i})),this.playlistDuration=null==t||null==(r=t.details)?void 0:r.totalduration},n.getVideoLevels=function(){if(this.hls)return this.hls.levels.map((function(e,t){return{id:t,width:e.width,height:e.height,bitrate:e.bitrate}}))},n.onBitrateChange=function(){this.emit(r.e.BITRATE_CHANGE,this.currentLevel)},n.onErrorEvent=function(e,t){var n=null==t?void 0:t.fatal,i=this.errorFormat(t);this.emit(r.e.ERROR,{errorData:i,fatal:n})},n.seekToLive=function(){this.currentTime=this.hls.liveSyncPosition},n.errorFormat=function(e){var t={category:null==e?void 0:e.type,code:"-1",message:"",data:e};switch(null==e?void 0:e.details){case a.a.ErrorDetails.MANIFEST_LOAD_ERROR:case a.a.ErrorDetails.LEVEL_LOAD_ERROR:case a.a.ErrorDetails.FRAG_LOAD_ERROR:t.code=""+e.response.code,t.message=e.response.text;break;case a.a.ErrorDetails.MANIFEST_PARSING_ERROR:t.message=e.reason;break;case a.a.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case a.a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.a.ErrorDetails.KEY_LOAD_TIMEOUT:break;case a.a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.a.ErrorDetails.KEY_LOAD_ERROR:t.code=""+e.response.code,t.message=e.response.text}return t},n.destroy=function(){this.hls&&(this.hls.destroy(),this.hls=null),e.prototype.destroy.call(this)},Object(r.f)(t,[{key:"currentLevel",get:function(){var e=this;if(this.hls)return this.getVideoLevels().find((function(t){return t.id===e.hls.currentLevel}))},set:function(e){this.hls&&(e?this.hls.currentLevel=e.id:this.hls.nextLevel=-1)}},{key:"currentTime",get:function(){return this.video.currentTime},set:function(e){var t;this.state.isSeekable&&(this.video.currentTime=this.isLive?Math.min(e,null!=(t=this.hls.liveSyncPosition)?t:e):e)}},{key:"isLive",get:function(){return this.hls?this.isLiveFlag:isNaN(this.video.duration)}},{key:"audioTrack",get:function(){var e,t;return null==(e=this.hls)||null==(t=e.audioTrack)?void 0:t.toString()},set:function(e){this.hls&&(this.hls.audioTrack=parseInt(e))}},{key:"audioTracks",get:function(){var e,t=this;return(null==(e=this.hls)?void 0:e.audioTracks.map((function(e){return{id:e.id.toString(),label:e.name,language:e.lang,enabled:t.audioTrack===e.id.toString()}})))||[]}},{key:"textTrack",get:function(){var e,t;return null==(e=this.hls)||null==(t=e.subtitleTrack)?void 0:t.toString()},set:function(e){this.hls&&(this.hls.subtitleTrack=e?parseInt(e):-1)}},{key:"textTracks",get:function(){var e,t=this;return(null==(e=this.hls)?void 0:e.subtitleTracks.map((function(e){return{id:e.id.toString(),label:e.name,language:e.lang,enabled:t.textTrack===e.id.toString()}})))||[]}}]),t}(r.a);t.default=s},function(e,t,n){"use strict";n.r(t);var r=n(5),i=(n(25),n(96)),a=function(e){function t(t){var n;return(n=e.call(this,t)||this).shakaPlayer=new i.Player(n.video),n.shakaPlayer.addEventListener("variantchanged",n.onAudioTrackChange=n.onAudioTrackChange.bind(Object(r.g)(n))),n.shakaPlayer.addEventListener("adaptation",(function(){n.onBitrateChange()})),n.shakaPlayer.addEventListener("error",n.onError=n.onError.bind(Object(r.g)(n))),n}Object(r.d)(t,e);var n=t.prototype;return n.load=function(e){return this.updateState({playbackState:r.b.LOADING}),this.shakaPlayer.load(e).catch((function(){}))},n.onBitrateChange=function(){var e=this.shakaPlayer.getVariantTracks().filter((function(e){return e.active})),t=e.reduce((function(e,t){return e+t.bandwidth}),0),n=e.find((function(e){return"variant"===e.type}));this.emit(r.e.BITRATE_CHANGE,{bitrate:t,width:n.width,height:n.height})},n.onError=function(e){var t=null==e?void 0:e.detail;console.log(t);var n=t.severity>1,i={category:t.category.toString(),code:t.code.toString(),message:t.data[1].toString(),data:t.data};this.emit(r.e.ERROR,{errorData:i,fatal:n})},n.getVideoLevels=function(){if(this.shakaPlayer)return this.shakaPlayer.getVariantTracks().map((function(e){return{id:e.id,width:e.width,height:e.height,bitrate:e.bandwidth}}))},n.destroy=function(){this.shakaPlayer&&this.shakaPlayer.destroy(),e.prototype.destroy.call(this)},Object(r.f)(t,[{key:"isLive",get:function(){return this.shakaPlayer.isLive()}},{key:"duration",get:function(){var e=this.shakaPlayer.seekRange();return e.end-e.start||0}},{key:"audioTrack",get:function(){var e,t,n;return null==(e=this.shakaPlayer)||null==(t=e.getVariantTracks())||null==(n=t.find((function(e){return e.active})))?void 0:n.language},set:function(e){this.shakaPlayer&&this.shakaPlayer.selectAudioLanguage(e)}},{key:"audioTracks",get:function(){var e,t=this;return null==(e=this.shakaPlayer)?void 0:e.getAudioLanguages().map((function(e){return{id:e,language:e,label:e,enabled:t.audioTrack===e}}))}},{key:"currentLevel",set:function(e){if(this.shakaPlayer)if(e){this.shakaPlayer.configure({abr:{enabled:!1}});var t=this.shakaPlayer.getVariantTracks().find((function(t){return t.id==e.id}));this.shakaPlayer.selectVariantTrack(t,!0)}else this.shakaPlayer.configure({abr:{enabled:!0}})},get:function(){if(this.shakaPlayer){var e=this.shakaPlayer.getVariantTracks().find((function(e){return 1==e.active}));return{id:e.id,width:e.width,height:e.height,bitrate:e.bandwidth}}}}]),t}(r.a);t.default=a},function(e,t,n){"use strict";n.r(t);var r=n(5),i=(n(25),n(41)),a=function(e){function t(t){var n;return(n=e.call(this,t)||this).mediaPlayer=Object(i.MediaPlayer)().create(),n.mediaPlayer.initialize(),n.mediaPlayer.attachView(n.video),n}Object(r.d)(t,e);var n=t.prototype;return n.load=function(e){var t=this;return this.updateState({playbackState:r.b.LOADING}),new Promise((function(n,r){t.mediaPlayer.attachSource(e),t.mediaPlayer.on(i.MediaPlayer.events.MANIFEST_LOADED,(function(){n()})),t.mediaPlayer.on(i.MediaPlayer.events.ERROR,(function(e){r("Failed to load Mss Player")}))}))},n.destroy=function(){this.mediaPlayer&&(this.mediaPlayer.reset(),this.mediaPlayer=null),e.prototype.destroy.call(this)},Object(r.f)(t,[{key:"isLive",get:function(){return this.mediaPlayer.isDynamic()}}]),t}(r.a);t.default=a},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Debug=t.FactoryMaker=t.MediaPlayer=void 0;var r=s(n(64)),i=s(n(0)),a=s(n(2)),o=n(92);function s(e){return e&&e.__esModule?e:{default:e}}var u="undefined"!=typeof window&&window||e,l=u.dashjs;l||(l=u.dashjs={}),l.MediaPlayer=r.default,l.FactoryMaker=i.default,l.Debug=a.default,l.Version=(0,o.getVersionString)(),t.default=l,t.MediaPlayer=r.default,t.FactoryMaker=i.default,t.Debug=a.default}).call(this,n(14))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(1)),i=l(n(10)),a=l(n(3)),o=l(n(4)),s=l(n(0)),u=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}function c(){var e=this.context,t=(0,a.default)(e).getInstance(),n=void 0,s=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0;function L(e){if(!p||!isNaN(g)){var n=g;if(isNaN(n))if(E){n=e.liveStartTime;var r=c.getCurrentDVRInfo(),i=r?r.range:null;if(i){var a=Y(!0);isNaN(a)||(s.info("Start time from URI parameters: "+a),n=Math.max(Math.min(n,a),i.start))}}else{n=y.start;var u=Y(!1);!isNaN(u)&&u<n+y.duration&&(s.info("Start time from URI parameters: "+u),n=Math.max(n,u))}isNaN(n)||n===f.getTime()||(t.trigger(o.default.PLAYBACK_SEEKING,{seekTime:n}),U(n,!1,!0))}}function N(){return parseFloat((O()-B()).toFixed(5))}function O(){return y.start+y.duration}function x(){y&&f&&f.getElement()?f.play():_=!0}function P(){return y&&f?f.isPaused():null}function k(){y&&f&&f.pause()}function F(){return y&&f?f.isSeeking():null}function U(e,n,r){y&&f&&(e!==(isNaN(A)?f.getTime():A)&&((I=!0===r)||(A=e,t.trigger(o.default.PLAYBACK_SEEK_ASKED)),s.info("Requesting seek to time: "+e+(I?" (internal)":"")),f.setCurrentTime(e,n)))}function B(){return y&&f?f.getTime():null}function G(){var e=B();if(E&&!isNaN(S)){var t=S/1e3;e>t&&(e-=t)}return e}function j(){return y&&f?f.getPlaybackRate():null}function H(){return y&&f?f.getEnded():null}function K(){return E}function V(){if(!E||isNaN(S))return NaN;var e=G();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*h.getClientTimeOffset();return Math.max(((t-S-1e3*e)/1e3).toFixed(3),0)}function q(){_=!1,p=!1,g=NaN,m=0,S=0,A=NaN,f&&(t.off(o.default.STREAM_INITIALIZED,L,this),t.off(o.default.DATA_UPDATE_COMPLETED,Q,this),t.off(o.default.BUFFER_LEVEL_STATE_CHANGED,me,this),t.off(o.default.LOADING_PROGRESS,ve,this),t.off(o.default.PLAYBACK_PROGRESS,de,this),t.off(o.default.PLAYBACK_TIME_UPDATED,de,this),t.off(o.default.PLAYBACK_ENDED,le,this),t.off(o.default.STREAM_INITIALIZING,Ee,this),z(),f.removeEventListener("canplay",J),f.removeEventListener("play",Z),f.removeEventListener("waiting",$),f.removeEventListener("playing",ee),f.removeEventListener("pause",te),f.removeEventListener("error",ce),f.removeEventListener("seeking",ne),f.removeEventListener("seeked",re),f.removeEventListener("timeupdate",ie),f.removeEventListener("progress",ae),f.removeEventListener("ratechange",oe),f.removeEventListener("loadedmetadata",se),f.removeEventListener("stalled",ye),f.removeEventListener("ended",ue)),v=null,f=null,y=null,E=null}function Y(e){var t=C.getURIFragmentData();if(!t||!t.t)return NaN;var n=l.getStreams()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-S/1e3:parseInt(t.t)+n}function W(){if(null===v){v=setInterval((function(){var e;t.trigger(o.default.WALLCLOCK_TIME_UPDATED,{isDynamic:E,time:new Date}),K()&&P()&&(e=Date.now(),(!b||e>b+500)&&(b=e,ie()))}),M.get().streaming.wallclockTimeUpdateInterval)}}function z(){clearInterval(v),v=null}function X(e){if(!P()&&E&&0!==f.getReadyState()){var t=G(),n=function(e,t){var n=c.getCurrentDVRInfo(t),r=n?n.range:null;return r?(s.debug("Checking DVR window for at "+e+" with DVR window range "+r.start+" - "+r.end),e>r.end?Math.max(r.end-m,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?r.start:e):NaN}(t,e);!isNaN(n)&&n!==t&&!F()&&(s.debug("UpdateCurrentTime: Seek to actual time: "+n+" from currentTime: "+t),U(n))}}function Q(e){if(!e.error){var t=d.convertDataToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&y.id===n.id&&(y=n,X())}}function J(){t.trigger(o.default.CAN_PLAY)}function Z(){s.info("Native video element event: play"),X(),W(),t.trigger(o.default.PLAYBACK_STARTED,{startTime:B()})}function $(){s.info("Native video element event: waiting"),t.trigger(o.default.PLAYBACK_WAITING,{playingTime:B()})}function ee(){s.info("Native video element event: playing"),t.trigger(o.default.PLAYBACK_PLAYING,{playingTime:B()})}function te(){s.info("Native video element event: pause"),t.trigger(o.default.PLAYBACK_PAUSED,{ended:H()})}function ne(){if(I)I=!1;else{var e=B();isNaN(A)||A===e||(e=A),A=NaN,s.info("Seeking to: "+e),W(),t.trigger(o.default.PLAYBACK_SEEKING,{seekTime:e})}}function re(){s.info("Native video element event: seeked"),t.trigger(o.default.PLAYBACK_SEEKED)}function ie(){y&&t.trigger(o.default.PLAYBACK_TIME_UPDATED,{timeToEnd:N(),time:B()})}function ae(){t.trigger(o.default.PLAYBACK_PROGRESS)}function oe(){var e=j();s.info("Native video element event: ratechange: ",e),t.trigger(o.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function se(){s.info("Native video element event: loadedmetadata"),t.trigger(o.default.PLAYBACK_METADATA_LOADED),W()}function ue(){s.info("Native video element event: ended"),k(),z();var e=l?l.getActiveStreamInfo():null;e&&t.trigger(o.default.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(v&&e.isLast){s.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var t=e.seekTime?e.seekTime:O();f.setCurrentTime(t),k(),z()}}function ce(e){var n=e.target||e.srcElement;t.trigger(o.default.PLAYBACK_ERROR,{error:n.error})}function de(){E&&fe()&&M.get().streaming.liveCatchup.playbackRate>0&&!P()&&!F()&&(function(){try{if(fe()&&M.get().streaming.liveCatchup.playbackRate>0&&B()>0){var e=pe(),t=V(),n=T.getLiveDelay(),i=T.getLiveCatchupLatencyThreshold(),a=M.get().streaming.liveCatchup.minDrift;if(e===r.default.LIVE_CATCHUP_MODE_LOLP){var o=he(),s=M.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(o>n||r<i)}catch(e){return!1}}(t,n,a,o,s,i)}return function(e,t,n,r){try{return Math.abs(e-t)>r&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,i,a)}}catch(e){return!1}}()?function(){if(f){var e=void 0,t=f.getPlaybackRate(),n=M.get().streaming.liveCatchup.playbackRate,i=V(),a=T.getLiveDelay(),o=he();if(pe()===r.default.LIVE_CATCHUP_MODE_LOLP){M.get().streaming.liveCatchup.minDrift;var u=M.get().streaming.liveCatchup.playbackBufferMin;e=function(e,t,n,r,i,a,o){var u=e,l=void 0;if(a<i){var c=5*(a-i),d=2*u/(1+Math.pow(Math.E,-c));l=1-u+d,s.debug("[LoL+ playback control_buffer-based] bufferLevel: "+a+", newRate: "+l)}else{if(Math.abs(t-n)<=.02*n)l=1;else{var f=5*(t-n),h=2*u/(1+Math.pow(Math.E,-f));l=1-u+h}s.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+l)}R&&a>n/2&&(R=!1);Math.abs(o-l)<=D&&(l=null);return{newRate:l}}(n,i,a,0,u,o,t)}else e=function(e,t,n,r,i){var a=e,o=t-n,s=5*o,u=2*a/(1+Math.pow(Math.E,-s)),l=1-a+u;R&&(r>n/2?R=!1:o>0&&(l=1));Math.abs(i-l)<=D&&(l=null);return{newRate:l}}(n,i,a,o,t);var l=e.newRate;l&&f.setPlaybackRate(l);var d=i-a;M.get().streaming.liveCatchup.maxDrift>0&&!w&&d>M.get().streaming.liveCatchup.maxDrift?(s.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),w=!0,U(((h=c.getCurrentDVRInfo())?h.range:null).end-T.getLiveDelay(),!0,!1)):w=!1}var h}():ge())}function fe(){return M.get().streaming.liveCatchup.enabled||M.get().streaming.lowLatencyEnabled}function he(){var e=null;return l.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function pe(){var e=M.get().streaming.liveCatchup.playbackBufferMin;return M.get().streaming.liveCatchup.mode!==r.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?r.default.LIVE_CATCHUP_MODE_DEFAULT:r.default.LIVE_CATCHUP_MODE_LOLP}function ge(){f&&f.setPlaybackRate(1)}function ve(e){if(!1===e.stream&&M.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var t=1.2*e.request.duration;if(t>T.getLiveDelay()){s.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",t.toFixed(2));var n={streaming:{liveDelay:t}};M.update(n)}}}function me(e){e.streamId===y.id&&(fe()?e.state!==i.default.BUFFER_EMPTY||F()||R||(R=!0,ge()):f.setStallState(e.mediaType,e.state===i.default.BUFFER_EMPTY))}function ye(e){t.trigger(o.default.PLAYBACK_STALLED,{e:e})}function Ee(e){!function(e,t){if(e&&e.manifestInfo&&e.manifestInfo.serviceDescriptions){for(var n=void 0,i=0;i<e.manifestInfo.serviceDescriptions.length;i++){var a=e.manifestInfo.serviceDescriptions[i];if(a.schemeIdUri===r.default.SERVICE_DESCRIPTION_LL_SCHEME){n=a;break}}n&&t&&t.supplementalProperties&&"true"===t.supplementalProperties[r.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(n.latency&&n.latency.target>0&&(s.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),M.update({streaming:{lowLatencyEnabled:!0,liveDelay:n.latency.target/1e3,liveCatchup:{minDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(s.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),M.update({streaming:{lowLatencyEnabled:!0,liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(e.streamInfo,e.mediaInfo)}return n={initialize:function(e,n,r){y=e,f.addEventListener("canplay",J),f.addEventListener("play",Z),f.addEventListener("waiting",$),f.addEventListener("playing",ee),f.addEventListener("pause",te),f.addEventListener("error",ce),f.addEventListener("seeking",ne),f.addEventListener("seeked",re),f.addEventListener("timeupdate",ie),f.addEventListener("progress",ae),f.addEventListener("ratechange",oe),f.addEventListener("loadedmetadata",se),f.addEventListener("stalled",ye),f.addEventListener("ended",ue),E=y.manifestInfo.isDynamic,w=!1,R=!1,p=!0===n,g=r,I=!1;var i="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",s=/safari/.test(i)&&!/chrome/.test(i);D=s?.25:.02,t.on(o.default.STREAM_INITIALIZED,L,this),t.on(o.default.DATA_UPDATE_COMPLETED,Q,this),t.on(o.default.LOADING_PROGRESS,ve,this),t.on(o.default.BUFFER_LEVEL_STATE_CHANGED,me,this),t.on(o.default.PLAYBACK_PROGRESS,de,this),t.on(o.default.PLAYBACK_TIME_UPDATED,de,this),t.on(o.default.PLAYBACK_ENDED,le,this,{priority:a.default.EVENT_PRIORITY_HIGH}),t.on(o.default.STREAM_INITIALIZING,Ee,this),_&&(_=!1,x())},setConfig:function(e){e&&(e.streamController&&(l=e.streamController),e.dashMetrics&&(c=e.dashMetrics),e.mediaPlayerModel&&(T=e.mediaPlayerModel),e.adapter&&(d=e.adapter),e.videoModel&&(f=e.videoModel),e.timelineConverter&&(h=e.timelineConverter),e.uriFragmentModel&&(C=e.uriFragmentModel),e.settings&&(M=e.settings))},getStartTimeFromUriParameters:Y,getTimeToStreamEnd:N,getTime:B,getNormalizedTime:G,getPlaybackRate:j,getPlayedRanges:function(){return y&&f?f.getPlayedRanges():null},getEnded:H,getIsDynamic:K,getStreamController:function(){return l},computeAndSetLiveDelay:function(e,t,n){var r,i=void 0,a=void 0,o=!isNaN(e)&&isFinite(e)?e:NaN,s=d.getSuggestedPresentationDelay();if(i=M.get().streaming.lowLatencyEnabled?0:T.getLiveDelay()?T.getLiveDelay():null===M.get().streaming.liveDelayFragmentCount||isNaN(M.get().streaming.liveDelayFragmentCount)||isNaN(o)?!0===M.get().streaming.useSuggestedPresentationDelay&&null!==s&&!isNaN(s)&&s>0?s:isNaN(o)?isNaN(n)?4*y.manifestInfo.minBufferTime:4*n:4*o:o*M.get().streaming.liveDelayFragmentCount,null!==(r=d.getAvailabilityStartTime())&&(S=r),t>0){var u=Math.max(t-10,t/2);a=Math.min(i,u)}else a=i;return m=a,a},getLiveDelay:function(){return m},setLiveDelay:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&e<m||(m=e)},getCurrentLiveLatency:V,play:x,isPaused:P,pause:k,isSeeking:F,getStreamEndTime:O,seek:U,updateCurrentTime:X,reset:q},s=(0,u.default)(e).getInstance().getLogger(n),q(),n}c.__dashjs_factory_name="PlaybackController",t.default=s.default.getSingletonFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.BYTES_APPENDED="bytesAppended",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.DATA_UPDATE_STARTED="dataUpdateStarted",e.INBAND_EVENTS="inbandEvents",e.INITIALIZATION_LOADED="initializationLoaded",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.REPRESENTATION_UPDATE_STARTED="representationUpdateStarted",e.REPRESENTATION_UPDATE_COMPLETED="representationUpdateCompleted",e.SEGMENTS_LOADED="segmentsLoaded",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_COMPLETED="streamCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEGMENTBASE_INIT_REQUEST_NEEDED="segmentBaseInitRequestNeeded",e.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED="segmentBaseSegmentsListRequestNeeded",e.SEEK_TARGET="seekTarget",e}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}(((r=i)&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=_(n(1)),i=_(n(10)),a=_(n(105)),o=_(n(87)),s=_(n(3)),u=_(n(4)),l=_(n(0)),c=n(54),d=_(n(2)),f=_(n(51)),h=_(n(13)),p=_(n(20)),g=_(n(177)),v=_(n(178)),m=_(n(6)),y=_(n(11)),E=_(n(179)),T=_(n(76));function _(e){return e&&e.__esModule?e:{default:e}}function b(){var e=this.context,t=(0,s.default)(e).getInstance(),n=void 0,l=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0,Q=void 0,J=void 0,Z=void 0,$=void 0,ee=void 0,te=void 0,ne=void 0,re=void 0,ie=void 0;function ae(){if(Re()){var e=z.getPlaybackQuality();e&&R.addDroppedFrames(e)}}function oe(e){var t=ge(e.seekTime);t===G&&ne&&ne.length>0&&ne.forEach((function(e){e.deactivate(!0)})),t&&t!==G?(Ce(c.PlayListTrace.END_OF_PERIOD_STOP_REASON),Ee(t,G,e.seekTime)):Ce(c.PlayListTrace.USER_REQUEST_STOP_REASON),Me(c.PlayList.SEEK_START_REASON)}function se(e){var t=ye();Ce(c.PlayListTrace.END_OF_PERIOD_STOP_REASON),Ee(t,G,e.seekTime),Me(c.PlayList.SEEK_START_REASON)}function ue(){l.debug("[onPlaybackStarted]"),Z?(Z=!1,Me(c.PlayList.INITIAL_PLAYOUT_START_REASON)):J&&(J=!1,Me(c.PlayList.RESUME_FROM_PAUSE_START_REASON))}function le(e){l.debug("[onPlaybackPaused]"),e.ended||(J=!0,Ce(c.PlayListTrace.USER_REQUEST_STOP_REASON))}function ce(){$&&(clearInterval($),$=null)}function de(){ee||(ee=setInterval((function(){!function(){if(!G||!fe(G))return;var e=function(e){try{var t=e||(G||null);if(t){var n=t.getStreamInfo().start;return B.filter((function(e){return e.getStreamInfo().start>n}))}}catch(e){return[]}}(G),t=0,n=function(){var n=e[t],i=0===t?G:e[t-1];if(!n.getPreloadingScheduled()&&fe(i)&&W){var a=[r.default.VIDEO,r.default.AUDIO],o=!0;a.forEach((function(e){var t=w.getMediaInfoForType(n.getStreamInfo(),e);w.getVoRepresentations(t).forEach((function(e){var t=w.getIsDynamic(),n=U.calcSegmentAvailabilityRange(e,t);n.end<n.start&&(o=!1)}))})),o&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(W&&!e.getPreloaded()){var n=pe(e,t);n&&(e.setPreloadingScheduled(!0),l.info("[onStreamCanLoadNext] Preloading next stream with id "+e.getId()),!0,e.preload(W,te),ne.push(e),e.getProcessors().forEach((function(t){t.setBufferingTime(e.getStartTime())})))}}(n,i)}t+=1};for(;t<e.length;)n()}()}),500))}function fe(e){try{if(!e)return!1;var t=e.getProcessors().filter((function(e){return e.getType()===r.default.AUDIO||e.getType()===r.default.VIDEO}));if(!t||0===t.length)return!1;var n=t.filter((function(e){return!e.isBufferingCompleted()}));return n&&0===n.length}catch(e){return!1}}function he(){var e=Ne().isLast;W&&e&&(l.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),D.signalEndOfStream(W))}function pe(e,t){try{return ie.get().streaming.reuseExistingSourceBuffers&&t.isProtectionCompatible(e,t)&&(re||t.isMediaCodecCompatible(e,t))&&!function(e){try{var t=e.getStreamInfo(),n=w.getAdaptationForType(t.index,r.default.FRAGMENTED_TEXT,t);return!!n&&(-1!==n.codecs.indexOf("stpp")||-1!==n.codecs.indexOf("wvtt"))}catch(e){return!1}}(e)}catch(e){return!1}}function ge(e){if(isNaN(e))return null;var t=0,n=null,r=B.length;r>0&&(t+=B[0].getStartTime());for(var i=0;i<r;i++)if(n=B[i],e<(t=parseFloat((t+n.getDuration()).toFixed(5))))return n;return null}function ve(){return G?G.getProcessors():[]}function me(e){if(!G.getIsEndedEventSignaled()){G.setIsEndedEventSignaled(!0);var t=ye();t?(l.debug("StreamController onEnded, found next stream with id "+t.getStreamInfo().id),Ee(t,G,NaN)):(l.debug("StreamController no next stream found"),G.setIsEndedEventSignaled(!1)),Ce(t?c.PlayListTrace.END_OF_PERIOD_STOP_REASON:c.PlayListTrace.END_OF_CONTENT_STOP_REASON),!1}e&&e.isLast&&ce()}function ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||(G||null);if(t){for(var n=t.getStreamInfo().start,r=t.getStreamInfo().duration,i=parseFloat((n+r).toFixed(5)),a=0,o=-1,s=NaN;a<B.length;){var u=B[a],l=u.getStreamInfo().start-i;l>=0&&(isNaN(s)||l<s)&&(s=l,o=a),a+=1}return o>=0?B[o]:null}return null}function Ee(e,n,r){if(!(V||!e||n===e&&e.isActive())){V=!0,t.trigger(u.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;n&&(i=pe(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,l.info("Switch to stream "+e.getId()+". Seektime is "+r+", current playback time is "+X.getTime()),l.info("Seamless period switch is set to "+i),G=e,ne=ne.filter((function(e){return e.getId()!==G.getId()})),X.initialize(Ne(),!!n,r),z.getElement()?Te(r,null===n,!1,i):_e(r,i),!1}}function Te(e,n,r,i){var a=void 0;function o(){W&&"open"===W.readyState&&(l.debug("MediaSource is open!"),window.URL.revokeObjectURL(a),W.removeEventListener("sourceopen",o),W.removeEventListener("webkitsourceopen",o),be(),n||t.trigger(u.default.SOURCE_INITIALIZED),r?G.setMediaSource(W):_e(e,i))}W?i?(_e(e,i),n||t.trigger(u.default.SOURCE_INITIALIZED)):(D.detachMediaSource(z),W.addEventListener("sourceopen",o,!1),W.addEventListener("webkitsourceopen",o,!1),a=D.attachMediaSource(W,z),l.debug("MediaSource attached to element. Waiting on open...")):((W=D.createMediaSource()).addEventListener("sourceopen",o,!1),W.addEventListener("webkitsourceopen",o,!1),a=D.attachMediaSource(W,z),l.debug("MediaSource attached to element. Waiting on open..."))}function _e(e,n){if(te=G.activate(W,n?te:void 0)){var r=Object.keys(te);r.length>0&&te[r[0]].changeType&&(re=!0)}Z||isNaN(e)||(e===X.getTime()?t.trigger(u.default.SEEK_TARGET,{time:e},{streamId:G.getId()}):X.seek(e)),!K&&Z||X.play(),V=!1,t.trigger(u.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ne()})}function be(e){var t=e||Ne().manifestInfo.duration;D.setDuration(W,t)}function Se(e){for(var t=0,n=B.length;t<n;t++)if(B[t].getId()===e.id)return B[t];return null}function Ae(){try{var n=w.getStreamsInfo();if(0===n.length)throw new Error("There are no streams");R.updateManifestUpdateInfo({currentTime:X.getTime(),buffered:z.getBufferRange(),presentationStartTime:n[0].start,clientTimeOffset:U.getClientTimeOffset()}),B.length>0&&(B=B.filter((function(e){var t=n.filter((function(t){return t.id===e.getId()})).length>0||e.getId()===G.getId();return t||l.debug("Removing stream "+e.getId()),t})));for(var i=0,o=n.length;i<o;i++){var s=n[i],c=Se(s);c?c.updateData(s):(c=(0,a.default)(e).create({manifestModel:I,mediaPlayerModel:Q,dashMetrics:R,manifestUpdater:S,adapter:w,timelineConverter:U,capabilities:_,capabilitiesFilter:b,errHandler:F,baseURLController:M,abrController:L,playbackController:X,eventController:O,mediaController:N,textController:x,protectionController:j,videoModel:z,streamInfo:s,settings:ie}),B.push(c),c.initialize()),R.addManifestUpdateStreamInfo(s)}if(!G){if(w.getIsDynamic()&&B.length){var d=n[0].manifestInfo,f=function(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var i=e[0],a=[r.default.VIDEO,r.default.AUDIO,r.default.FRAGMENTED_TEXT].reduce((function(e,t){var n=w.getMediaInfoForType(i,t);return n&&e.push(n),e}),[]).reduce((function(e,t){var n=w.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=w.convertDataToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(a))}return isFinite(n)?n:NaN}catch(e){return NaN}}(n,d);X.computeAndSetLiveDelay(f,d.DVRWindowSize,d.minBufferTime)}var h=null;!(h=ge(X.getStartTimeFromUriParameters(w.getIsDynamic())))&&w.getIsDynamic()&&B.length&&(l.debug("Dynamic stream: Trying to find the correct starting period"),h=function(){try{var e=U.calcPresentationTimeFromWallTime(new Date,w.getRegularPeriods()[0]),t=X.getLiveDelay();return ge(e-t)}catch(e){return null}}()),Ee(null!==h?h:B[0],null,NaN),$||($=setInterval((function(){!V&&X.getTimeToStreamEnd()<=0&&t.trigger(u.default.PLAYBACK_ENDED,{isLast:Ne().isLast})}),200)),de()}t.trigger(u.default.STREAMS_COMPOSED)}catch(e){F.error(new m.default(y.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",I.getValue())),Y=!0,ke()}}function Ie(){var e=I.getValue();j&&(t.trigger(u.default.PROTECTION_CREATED,{controller:j,manifest:e}),j.setMediaElement(z.getElement()),H&&j.setProtectionData(H)),Ae()}function we(e){if(e.error)Y=!0,ke();else{var n=e.manifest;w.updatePeriods(n);var r=w.getUTCTimingSources();!w.getIsDynamic()||r&&0!==r.length||t.trigger(p.default.CONFORMANCE_VIOLATION,{level:T.default.LEVELS.WARNING,event:T.default.EVENTS.NO_UTC_TIMING_ELEMENT});var i=w.getIsDynamic()?r.concat(Q.getUTCTimingSources()):r,a=k.isHTTPS(e.manifest.url);i.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===Q.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(a?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),a?"https://":"http://"),l.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),M.initialize(n),C.attemptSync(i)}}function Re(){return!!G&&G.getHasVideoTrack()}function De(){return!!G&&G.getHasAudioTrack()}function Ce(e,t){t=t||new Date,ve().forEach((function(n){n.finalisePlayList(t,e)})),R.addPlayList()}function Me(e){R.createPlaylistMetrics(1e3*X.getTime(),e)}function Le(e){if(e.error){var t="";switch(e.error.code){case 1:t="MEDIA_ERR_ABORTED";break;case 2:t="MEDIA_ERR_NETWORK";break;case 3:t="MEDIA_ERR_DECODE";break;case 4:t="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:t="MEDIA_ERR_ENCRYPTED";break;default:t="UNKNOWN"}q=!0,e.error.message&&(t+=" ("+e.error.message+")"),e.error.msExtendedCode&&(t+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),l.fatal("Video Element Error: "+t),e.error&&l.fatal(e.error),F.error(new m.default(e.error.code,t)),ke()}}function Ne(){return G?G.getStreamInfo():null}function Oe(){if(!(A&&A.hasOwnProperty("load")&&U&&U.hasOwnProperty("initialize")&&U.hasOwnProperty("reset")&&U.hasOwnProperty("getClientTimeOffset")&&I&&F&&R&&X))throw new Error(r.default.MISSING_CONFIG_ERROR)}function xe(e){isNaN(e.newDuration)||be(e.newDuration)}function Pe(){B=[],j=null,V=!1,G=null,q=!1,Y=!1,Z=!0,J=!1,K=!0,$=null,!1,ee=null,!1,ne=[]}function ke(){Oe(),C.reset(),Ce(q||Y?c.PlayListTrace.FAILURE_STOP_REASON:c.PlayListTrace.USER_REQUEST_STOP_REASON);for(var e=0,r=B?B.length:0;e<r;e++){B[e].reset(q)}t.off(u.default.PLAYBACK_TIME_UPDATED,ae,n),t.off(u.default.PLAYBACK_SEEKING,oe,n),t.off(u.default.GAP_CAUSED_SEEK_TO_PERIOD_END,se,n),t.off(u.default.PLAYBACK_ERROR,Le,n),t.off(u.default.PLAYBACK_STARTED,ue,n),t.off(u.default.PLAYBACK_PAUSED,le,n),t.off(u.default.PLAYBACK_ENDED,me,n),t.off(u.default.MANIFEST_UPDATED,we,n),t.off(u.default.STREAM_BUFFERING_COMPLETED,he,n),t.off(u.default.MANIFEST_VALIDITY_CHANGED,xe,n),t.off(u.default.TIME_SYNCHRONIZATION_COMPLETED,Ie,n),t.off(p.default.METRIC_ADDED,Fe,n),M.reset(),S.reset(),O.reset(),R.clearAllCurrentMetrics(),I.setValue(null),A.reset(),U.reset(),P.reset(),W&&(D.detachMediaSource(z),W=null),z=null,j&&(j.setMediaElement(null),j=null,H=null,I.getValue()&&t.trigger(u.default.PROTECTION_DESTROYED,{data:I.getValue().url})),ce(),clearInterval(ee),ee=null,t.trigger(u.default.STREAM_TEARDOWN_COMPLETE),Pe()}function Fe(e){if(e.metric===i.default.DVR_INFO){var t=De()?r.default.AUDIO:r.default.VIDEO;e.mediaType===t&&D.setSeekable(W,e.value.range.start,e.value.range.end)}}return n={initialize:function(r,i){Oe(),K=r,H=i,U.initialize(),(S=(0,o.default)(e).create()).setConfig({manifestModel:I,adapter:w,manifestLoader:A,errHandler:F,settings:ie}),S.initialize(),(O=(0,E.default)(e).getInstance()).setConfig({manifestUpdater:S,playbackController:X,settings:ie}),O.start(),C.setConfig({dashMetrics:R,baseURLController:M,settings:ie}),C.initialize(),t.on(u.default.PLAYBACK_TIME_UPDATED,ae,n),t.on(u.default.PLAYBACK_SEEKING,oe,n),t.on(u.default.GAP_CAUSED_SEEK_TO_PERIOD_END,se,n),t.on(u.default.PLAYBACK_ERROR,Le,n),t.on(u.default.PLAYBACK_STARTED,ue,n),t.on(u.default.PLAYBACK_PAUSED,le,n),t.on(u.default.PLAYBACK_ENDED,me,n,{priority:s.default.EVENT_PRIORITY_HIGH}),t.on(u.default.MANIFEST_UPDATED,we,n),t.on(u.default.STREAM_BUFFERING_COMPLETED,he,n),t.on(u.default.MANIFEST_VALIDITY_CHANGED,xe,n),t.on(u.default.TIME_SYNCHRONIZATION_COMPLETED,Ie,n),t.on(p.default.METRIC_ADDED,Fe,n)},getActiveStreamInfo:Ne,hasVideoTrack:Re,hasAudioTrack:De,switchToVideoElement:function(e){G&&(X.initialize(Ne()),Te(e,!1,!0,!1))},getStreamById:function(e){return B.filter((function(t){return t.getId()===e}))[0]},getStreamForTime:ge,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,o=0;o<B.length;o++){if(i=(n=B[o]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){Oe(),A.load(e)},loadWithManifest:function(e){!function(){if(!S||!S.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),S.setManifest(e)},getActiveStreamProcessors:ve,setConfig:function(e){e&&(e.capabilities&&(_=e.capabilities),e.capabilitiesFilter&&(b=e.capabilitiesFilter),e.manifestLoader&&(A=e.manifestLoader),e.manifestModel&&(I=e.manifestModel),e.mediaPlayerModel&&(Q=e.mediaPlayerModel),e.protectionController&&(j=e.protectionController),e.adapter&&(w=e.adapter),e.dashMetrics&&(R=e.dashMetrics),e.errHandler&&(F=e.errHandler),e.timelineConverter&&(U=e.timelineConverter),e.videoModel&&(z=e.videoModel),e.playbackController&&(X=e.playbackController),e.abrController&&(L=e.abrController),e.mediaController&&(N=e.mediaController),e.textController&&(x=e.textController),e.settings&&(ie=e.settings),e.baseURLController&&(M=e.baseURLController))},setProtectionData:function(e){H=e},getIsStreamSwitchInProgress:function(){return V},getHasMediaOrIntialisationError:function(){return q||Y},hasStreamFinishedBuffering:fe,getStreams:function(){return B},getActiveStream:function(){return G},reset:ke},l=(0,d.default)(e).getInstance().getLogger(n),C=(0,g.default)(e).getInstance(),D=(0,v.default)(e).getInstance(),P=(0,f.default)(e).getInstance(),k=(0,h.default)(e).getInstance(),Pe(),n}b.__dashjs_factory_name="StreamController",t.default=l.default.getSingletonFactory(b)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(1)),i=v(n(9)),a=v(n(106)),o=v(n(162)),s=v(n(175)),u=v(n(3)),l=v(n(4)),c=v(n(2)),d=v(n(11)),f=v(n(0)),h=v(n(6)),p=v(n(27)),g=v(n(13));function v(e){return e&&e.__esModule?e:{default:e}}function m(e){e=e||{};var t=this.context,n=(0,u.default)(t).getInstance(),f=(0,g.default)(t).getInstance(),v=e.manifestModel,m=e.mediaPlayerModel,y=e.manifestUpdater,E=e.adapter,T=e.capabilities,_=e.capabilitiesFilter,b=e.errHandler,S=e.timelineConverter,A=e.dashMetrics,I=e.abrController,w=e.playbackController,R=e.eventController,D=e.mediaController,C=e.textController,M=e.protectionController,L=e.videoModel,N=e.settings,O=e.streamInfo,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0,Q=void 0,J=void 0;function Z(e){for(var t=k?k.length:0,r=0;r<t;r++){k[r].getFragmentModel().removeExecutedRequestsBeforeTime(ne()+te()),k[r].reset(!1,e)}k=[],U=!1,B=!1,be(!1),n.off(l.default.CURRENT_TRACK_CHANGED,le,x)}function $(){Z(),F=!1,G=!1,j=!1,H={},K=!1,z=!1,Q=!1}function ee(){w&&w.pause(),V&&(V.reset(),V=null),O=null,$(),n.off(l.default.DATA_UPDATE_COMPLETED,ge,x),n.off(l.default.BUFFERING_COMPLETED,pe,x),n.off(l.default.INBAND_EVENTS,ve,x),M&&(n.off(l.default.KEY_ERROR,se,x),n.off(l.default.SERVER_CERTIFICATE_UPDATED,se,x),n.off(l.default.LICENSE_REQUEST_COMPLETE,se,x),n.off(l.default.KEY_SYSTEM_SELECTED,se,x),n.off(l.default.KEY_SESSION_CREATED,se,x),n.off(l.default.KEY_STATUSES_CHANGED,se,x)),be(!1)}function te(){return O?O.duration:NaN}function ne(){return O?O.start:NaN}function re(){if(!O.manifestInfo.isDynamic)return NaN;for(var e=0;e<k.length;e++)if(k[e].getType()===r.default.AUDIO||k[e].getType()===r.default.VIDEO)return k[e].getLiveStartTime();return NaN}function ie(){return O?O.id:null}function ae(){return O}function oe(){if(!(L&&I&&I.hasOwnProperty("getBitrateList")&&E&&E.hasOwnProperty("getAllMediaInfoForType")&&E.hasOwnProperty("getEventsFor")))throw new Error(r.default.MISSING_CONFIG_ERROR)}function se(e){e.error&&(b.error(e.error),P.fatal(e.error.message),ee())}function ue(e){var t,n=e?e.type:null,i=void 0;if(n===r.default.MUXED)return i="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",P.fatal(i),b.error(new h.default(d.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,i,v.getValue())),!1;if(n===r.default.TEXT||n===r.default.FRAGMENTED_TEXT||n===r.default.EMBEDDED_TEXT||n===r.default.IMAGE)return!0;if(t=e.codec,P.debug(n+" codec: "+t),e.contentProtection&&!T.supportsEncryptedMedia())b.error(new h.default(d.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,d.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE));else if(!T.supportsCodec(t))return i=n+"Codec ("+t+") is not supported.",P.error(i),!1;return!0}function le(e){if(O&&e.newMediaInfo.streamInfo.id===O.id){var t=e.newMediaInfo,n=v.getValue();E.setCurrentMediaInfo(O.id,t.type,t);var i=me(t);if(i){var a=w.getTime();P.info("Stream - Process track changed at current time "+a),P.debug("Stream - Update stream controller"),n.refreshManifestOnSwitchTrack?(P.debug("Stream - Refreshing manifest for switch track"),J=e,y.refreshManifest()):(i.selectMediaInfo(t),t.type!==r.default.FRAGMENTED_TEXT?(I.updateTopQualityIndex(t),i.switchTrackAsked(),i.getFragmentModel().abortRequests()):(i.getScheduleController().setSeekTarget(a),i.setBufferingTime(a),i.resetIndexHandler()))}}}function ce(o,u){var c,d=E.getAllMediaInfoForType(O,o),f=null;if(d&&0!==d.length){o===r.default.VIDEO&&(G=!0),o===r.default.AUDIO&&(j=!0);for(var h=0,p=d.length;h<p;h++)if(f=d[h],o===r.default.EMBEDDED_TEXT)C.addEmbeddedTrack(f);else{if(!ue(f))continue;D.addTrack(f)}o!==r.default.EMBEDDED_TEXT&&0!==D.getTracksFor(o,O).length&&(o!==r.default.IMAGE?(D.checkInitialMediaSettingsForType(o,O),c=D.getCurrentTrackFor(o,O),n.trigger(l.default.STREAM_INITIALIZING,{streamInfo:O,mediaInfo:f}),function(n,i,o,s){var u=V.getModel(n?n.type:null),l=(0,a.default)(t).create({streamInfo:O,type:n?n.type:null,mimeType:n?n.mimeType:null,timelineConverter:S,adapter:E,manifestModel:v,mediaPlayerModel:m,fragmentModel:u,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,abrController:I,playbackController:w,mediaController:D,textController:C,errHandler:b,settings:N,boxParser:W});if(l.initialize(o,G),I.updateTopQualityIndex(n),s?(l.setBuffer(s.buffer),l.setBufferingTime(s.currentTime),k[s.replaceIdx]=l):k.push(l),!s||!s.ignoreMediaInfo)if(!n||n.type!==r.default.TEXT&&n.type!==r.default.FRAGMENTED_TEXT)l.addMediaInfo(n,!0);else{for(var c=void 0,d=0;d<i.length;d++)i[d].index===n.index&&(c=d),l.addMediaInfo(i[d]);l.selectMediaInfo(i[c])}}(c,d,u)):q=(0,s.default)(t).create({streamInfo:O,adapter:E,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:X,eventBus:n,events:l.default,dashConstants:i.default}))}else P.info("No "+o+" data.")}function de(){if(R){var e=E.getEventsFor(O);R.addInlineEvents(e)}}function fe(){for(var e=k.length,t=!!H.audio||!!H.video?new h.default(d.default.DATA_UPDATE_FAILED_ERROR_CODE,d.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,i=0;i<e;i++)if(k[i].isUpdating()||K)return;if(B){if(M){M.clearMediaInfoArrayByStreamId(ie());for(var a=0;a<e&&k[a];a++){var o=k[a].getType();if(o===r.default.AUDIO||o===r.default.VIDEO||o===r.default.FRAGMENTED_TEXT){var s=k[a].getMediaInfo();s&&M.initializeForMedia(s)}}}t?b.error(t):F||(F=!0,n.trigger(l.default.STREAM_INITIALIZED,{streamInfo:O,liveStartTime:Y?NaN:re()}));for(var u=0;u<e&&k[u];u++)k[u].getScheduleController().start()}}function he(e){for(var t={},n=0,r=k.length;n<r;n++){var i=k[n].createBuffer(e);i&&(t[k[n].getType()]=i.getBuffer())}return t}function pe(){var e=ye(),t=e.length;if(0!==t){for(var i=0;i<t;i++)if(!e[i].isBufferingCompleted()&&(e[i].getType()===r.default.AUDIO||e[i].getType()===r.default.VIDEO))return void P.warn("onBufferingCompleted - One streamProcessor has finished but",e[i].getType(),"one is not buffering completed");P.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),n.trigger(l.default.STREAM_BUFFERING_COMPLETED,{streamInfo:O})}else P.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function ge(e){H[e.mediaType]=e.error,fe()}function ve(e){var t;t=e.events,R&&R.addInbandEvents(t)}function me(e){return e?ye().filter((function(t){return t.getType()===e.type}))[0]:null}function ye(){for(var e=[],t=void 0,n=void 0,i=0;i<k.length;i++)(t=(n=k[i]).getType())!==r.default.AUDIO&&t!==r.default.VIDEO&&t!==r.default.FRAGMENTED_TEXT&&t!==r.default.TEXT||e.push(n);return e}function Ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():ae();if(!r||!i)return!1;var a=E.getAdaptationForType(r.index,t,r),o=E.getAdaptationForType(i.index,t,i);return a&&o?!(!Te(o)&&Te(a)):!a&&!o}function Te(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():ae();if(!r||!i)return!1;var a=E.getAdaptationForType(r.index,t,r),o=E.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var s=a&&o&&a.mimeType===o.mimeType,u=o.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),d=l.some((function(e){return u.some((function(t){return T.codecRootCompatibleWithCodec(t,e)}))}));return c||d&&s}function be(e){Y=e}function Se(){return Y}return x={initialize:function(){n.on(l.default.BUFFERING_COMPLETED,pe,x),n.on(l.default.DATA_UPDATE_COMPLETED,ge,x),n.on(l.default.INBAND_EVENTS,ve,x),M&&(n.on(l.default.KEY_ERROR,se,x),n.on(l.default.SERVER_CERTIFICATE_UPDATED,se,x),n.on(l.default.LICENSE_REQUEST_COMPLETE,se,x),n.on(l.default.KEY_SYSTEM_SELECTED,se,x),n.on(l.default.KEY_SESSION_CREATED,se,x),n.on(l.default.KEY_STATUSES_CHANGED,se,x)),n.trigger(l.default.STREAM_UPDATED,{streamInfo:O})},getStreamId:function(){return O?O.id:null},activate:function(e,t){if(!U){var i=void 0;return n.on(l.default.CURRENT_TRACK_CHANGED,le,x),Se()?(!function(){if(K=!0,oe(),_.filterUnsupportedFeaturesOfPeriod(O),B=!0,K=!1,0===k.length){var e="No streams to play.";b.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e,v.getValue())),P.debug(e)}else fe()}(),i=t):i=function(e,t){oe();var n=L.getElement();de(),K=!0,_.filterUnsupportedFeaturesOfPeriod(O),(!n||n&&/^VIDEO$/i.test(n.nodeName))&&ce(r.default.VIDEO,e);ce(r.default.AUDIO,e),ce(r.default.TEXT,e),ce(r.default.FRAGMENTED_TEXT,e),ce(r.default.EMBEDDED_TEXT,e),ce(r.default.MUXED,e),ce(r.default.IMAGE,e);var i=he(t);if(B=!0,K=!1,0===k.length){var a="No streams to play.";b.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,v.getValue())),P.fatal(a)}else fe();return i}(e,t),U=!0,i}return t},deactivate:Z,isActive:function(){return U},getDuration:te,getStartTime:ne,getId:ie,getStreamInfo:ae,getHasAudioTrack:function(){return j},getHasVideoTrack:function(){return G},preload:function(e,t){if(!Se()){de(),ce(r.default.VIDEO,e),ce(r.default.AUDIO,e),ce(r.default.TEXT,e),ce(r.default.FRAGMENTED_TEXT,e),ce(r.default.EMBEDDED_TEXT,e),ce(r.default.MUXED,e),ce(r.default.IMAGE,e),he(t),n.on(l.default.CURRENT_TRACK_CHANGED,le,x);for(var i=0;i<k.length&&k[i];i++)k[i].getScheduleController().start();be(!0)}},getThumbnailController:function(){return q},getBitrateListFor:function(e){if(oe(),e===r.default.IMAGE)return q?q.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<k.length;n++)if((t=k[n]).getType()===e)return t.getMediaInfo();return null}(e);return I.getBitrateList(t)},updateData:function(e){P.info("Manifest updated... updating data system wide."),U=!1,K=!0,O=e,n.trigger(l.default.STREAM_UPDATED,{streamInfo:O}),R&&de(),_.filterUnsupportedFeaturesOfPeriod(O);for(var t=0,i=k.length;t<i;t++){var a=k[t];a.updateStreamInfo(O);var o=E.getMediaInfoForType(O,a.getType());o&&(I.updateTopQualityIndex(o),a.addMediaInfo(o,!0))}if(J&&J.newMediaInfo.type!==r.default.FRAGMENTED_TEXT){var s=me(J.oldMediaInfo);if(!s)return;s.switchTrackAsked(),J=void 0}K=!1,fe()},reset:ee,getProcessors:ye,setMediaSource:function(e){for(var t=0;t<k.length;)ue(k[t].getMediaInfo())?(k[t].setMediaSource(e),t++):(k[t].reset(),k.splice(t,1));for(var n=0;n<k.length;n++)k[n].dischargePreBuffer();if(0===k.length){var r="No streams to play.";b.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,r+"nostreams",v.getValue())),P.fatal(r)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,r.default.VIDEO,t)&&_e(e,r.default.AUDIO,t)},isProtectionCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Ee(e,r.default.VIDEO,t)&&Ee(e,r.default.AUDIO,t)},getPreloaded:Se,getPreloadingScheduled:function(){return z},setPreloadingScheduled:function(e){z=e},getIsEndedEventSignaled:function(){return Q},setIsEndedEventSignaled:function(e){Q=e}},X=(0,c.default)(t).getInstance(),P=X.getLogger(x),$(),W=(0,p.default)(t).getInstance(),V=(0,o.default)(t).create({streamInfo:O,mediaPlayerModel:m,dashMetrics:A,errHandler:b,settings:N,boxParser:W,dashConstants:i.default,urlUtils:f}),x}m.__dashjs_factory_name="Stream",t.default=f.default.getClassFactory(m)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=I(n(1)),i=I(n(9)),a=I(n(10)),o=I(n(26)),s=I(n(66)),u=I(n(150)),l=I(n(152)),c=I(n(154)),d=I(n(155)),f=I(n(0)),h=n(15),p=I(n(3)),g=I(n(4)),v=I(n(80)),m=I(n(11)),y=I(n(6)),E=I(n(2)),T=I(n(53)),_=I(n(13)),b=I(n(27)),S=I(n(16)),A=n(54);function I(e){return e&&e.__esModule?e:{default:e}}function w(e){e=e||{};var t=this.context,n=(0,p.default)(t).getInstance(),f=e.streamInfo,I=e.type,w=e.errHandler,R=e.mimeType,D=e.timelineConverter,C=e.adapter,M=e.manifestModel,L=e.mediaPlayerModel,N=e.fragmentModel,O=e.abrController,x=e.playbackController,P=e.mediaController,k=e.textController,F=e.dashMetrics,U=e.settings,B=e.boxParser,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0,Q=void 0,J=void 0;function Z(){return I}function $(){V=[],K=null,Q=0}function ee(e){(e.error||Y.setCurrentRepresentation(C.convertDataToRepresentationInfo(e.currentRepresentation)),e.error&&e.error.code!==m.default.SEGMENTS_UPDATE_FAILED_ERROR_CODE)||x.getStreamController().getActiveStreamInfo().id===f.id&&oe()}function te(e){var t=ce(e.newQuality);Y.setCurrentRepresentation(t),F.pushPlayListTraceMetrics(new Date,A.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),F.createPlaylistTraceMetrics(t.id,1e3*x.getTime(),x.getPlaybackRate())}function ne(e){F.addBufferLevel(I,new Date,1e3*e.bufferLevel);var t=x.getStreamController().getActiveStreamInfo().id;M.getValue().doNotUpdateDVRWindowOnBufferUpdated||f.id!==t||oe()}function re(e){F.addBufferState(I,e.state,Y.getBufferTarget()),e.state!==a.default.BUFFER_EMPTY||x.isSeeking()||F.pushPlayListTraceMetrics(new Date,A.PlayListTrace.REBUFFERING_REASON)}function ie(e){N.syncExecutedRequestsWithBufferedRange(q.getBuffer().getAllBufferRanges(),f.duration),e.from>x.getTime()&&(Q=e.from,J=!0)}function ae(e){Q=e.quotaExceededTime,J=!0}function oe(){var e=f.manifestInfo,t=e.isDynamic,n=D.calcSegmentAvailabilityRange(W.getCurrentRepresentation(),t);F.addDVRInfo(Z(),x.getTime(),e,n)}function se(){return q?q.getBuffer():null}function ue(){return V}function le(){return K}function ce(e){var t=void 0;return void 0!==e?((0,h.checkInteger)(e),t=W?W.getRepresentationForQuality(e):null):t=W?W.getCurrentRepresentation():null,C.convertDataToRepresentationInfo(t)}function de(e){if(e.sender&&(!C.getIsTextTrack(R)||k.isTextEnabled())&&q&&e.representationId&&!q.appendInitSegment(e.representationId)){var t=X?X.getInitRequest(le(),W.getCurrentRepresentation()):null;Y.processInitRequest(t)}}function fe(e){var t=void 0;q.getIsPruningInProgress()||(t=function(e,t){var n=ce(),i=!isNaN(e),a=x.getNormalizedTime(),o=i?e:Q,s=!1,u=void 0;if(isNaN(o)||Z()===r.default.FRAGMENTED_TEXT&&!k.isTextEnabled())return null;if(q){var l=q.getRangeAt(o),c=q.getRangeAt(a);if((null!==l||null!==c)&&!i)if(!l||c&&c.start!=l.start&&c.end!=l.end)q.getBuffer().hasDiscontinuitiesAfter(a)&&Z()!==r.default.FRAGMENTED_TEXT&&(N.removeExecutedRequestsAfterTime(c.end),s=!0)}if(t)o=t.startTime+t.duration/2,u=ge(n,o,{timeThreshold:0,ignoreIsFinished:!0});else{var d=i||J||s;for(u=ge(n,d?o:void 0,{keepIdx:!d}),J=!1;u&&u.action!==S.default.ACTION_COMPLETE&&N.isFragmentLoaded(u);)u=ge(n)}return u}(e.seekTarget,e.replacement))&&(Y.setSeekTarget(NaN),e.replacement||(isNaN(t.startTime+t.duration)||(Q=t.startTime+t.duration),t.delayLoadingTime=(new Date).getTime()+Y.getTimeToLoadDelay(),Y.setTimeToLoadDelay(0))),Y.processMediaRequest(t)}function he(e){var r=e.chunk,i=r.bytes,a=r.quality,s=ce(a),u=W&&s?W.getRepresentationForQuality(s.quality):null,l=C.getEventsFor(s.mediaInfo),c=C.getEventsFor(s,u);if(l&&l.length>0||c&&c.length>0){var d=function(e,n,r,i){try{for(var a={},o=[],s=r.concat(i),u=0,l=s.length;u<l;u++)a[s[u].schemeIdUri+"/"+s[u].value]=s[u];var c=(0,b.default)(t).getInstance().parse(e),d=c.getBoxes("emsg");if(!d||0===d.length)return o;for(var f=c.getBox("sidx"),h=!f||isNaN(f.earliest_presentation_time)||isNaN(f.timescale)?n&&!isNaN(n.mediaStartTime)?n.mediaStartTime:0:f.earliest_presentation_time/f.timescale,p=Math.max(h,0),g=W.getCurrentRepresentation(),v=0,m=d.length;v<m;v++){var y=C.getEvent(d[v],a,p,g);y&&o.push(y)}return o}catch(e){return[]}}(i,N.getRequests({state:o.default.FRAGMENT_MODEL_EXECUTED,quality:a,index:r.index})[0],l,c);n.trigger(g.default.INBAND_EVENTS,{events:d},{streamId:f.id})}}function pe(e){Q=e.time,Y.setSeekTarget(e.time)}function ge(e,t,n){var r=null;if(X){var i=W&&e?W.getRepresentationForQuality(e.quality):null;r=void 0!==t&&void 0!==n?X.getSegmentRequestForTime(le(),i,t,n):X.getNextSegmentRequest(le(),i)}return r}return G={initialize:function(a,o){X=(0,v.default)(t).create({streamInfo:f,type:I,timelineConverter:D,dashMetrics:F,mediaPlayerModel:L,baseURLController:e.baseURLController,errHandler:w,settings:U,boxParser:B,events:g.default,eventBus:n,errors:m.default,debug:(0,E.default)(t).getInstance(),requestModifier:(0,T.default)(t).getInstance(),dashConstants:i.default,constants:r.default,urlUtils:(0,_.default)(t).getInstance()}),(H=f.manifestInfo.isDynamic)&&(z=(0,d.default)(t).create({timelineConverter:D})),X.initialize(H),O.registerStreamType(I,G),W=(0,c.default)(t).create({streamInfo:f,type:I,abrController:O,dashMetrics:F,playbackController:x,timelineConverter:D,dashConstants:i.default,events:g.default,eventBus:n,errors:m.default}),(q=function(e){var n=null;if(!e)return w.error(new y.default(m.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,m.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null;n=e===r.default.VIDEO||e===r.default.AUDIO?(0,s.default)(t).create({streamInfo:f,type:e,mediaPlayerModel:L,manifestModel:M,fragmentModel:N,errHandler:w,mediaController:P,representationController:W,adapter:C,textController:k,abrController:O,playbackController:x,settings:U}):(0,u.default)(t).create({streamInfo:f,type:e,mimeType:R,mediaPlayerModel:L,manifestModel:M,fragmentModel:N,errHandler:w,mediaController:P,representationController:W,adapter:C,textController:k,abrController:O,playbackController:x,settings:U});return n}(I))&&q.initialize(a),(Y=(0,l.default)(t).create({streamInfo:f,type:I,mimeType:R,adapter:C,dashMetrics:F,mediaPlayerModel:L,fragmentModel:N,abrController:O,playbackController:x,textController:k,mediaController:P,bufferController:q,settings:U})).initialize(o),Q=0,J=!1},getStreamId:function(){return f.id},getType:Z,isUpdating:function(){return!!W&&W.isUpdating()},getBufferController:function(){return q},getFragmentModel:function(){return N},getScheduleController:function(){return Y},getRepresentationController:function(){return W},getRepresentationInfo:ce,getBufferLevel:function(){return q?q.getBufferLevel():0},isBufferingCompleted:function(){return!!q&&q.getIsBufferingCompleted()},createBuffer:function(e){return se()||q?q.createBuffer(V,e):null},updateStreamInfo:function(e){f=e,U.get().streaming.useAppendWindow&&q.updateAppendWindow()},getStreamInfo:function(){return f},selectMediaInfo:function(e){e===K||e&&K&&e.type!==K.type||(K=e);var t=C.getRealAdaptation(f,K),n=C.getVoRepresentations(K);if(W){var i=W.getData(),a=O.getTopQualityIndexFor(I,f.id),o=O.getMinAllowedIndexFor(I),s=void 0,u=null;null!==i&&i.id==t.id||I===r.default.FRAGMENTED_TEXT?s=O.getQualityFor(I):(u=O.getThroughputHistory().getAverageThroughput(I)||O.getInitialBitrateFor(I),s=O.getQualityForBitrate(K,u)),void 0!==o&&s<o&&(s=o),s>a&&(s=a),X.setMimeType(K?K.mimeType:null),W.updateData(t,n,I,s)}},addMediaInfo:function(e,t){-1===V.indexOf(e)&&V.push(e),t&&this.selectMediaInfo(e)},getLiveStartTime:function(){if(!H)return NaN;if(!z)return NaN;var e=NaN,t=ce(),n=z.getLiveEdge(t);if(isNaN(n))return NaN;var r=function(e,t){try{var n=null,r=x.getLiveDelay(),i=isNaN(f.manifestInfo.DVRWindowSize)?r:f.manifestInfo.DVRWindowSize,a=.1*i,o=void 0;if(!isFinite(i)||ge(t,e-i+a,{ignoreIsFinished:!0}))for(;!n&&r<=i;)(n=ge(t,o=e-r,{ignoreIsFinished:!0}))||(r+=1);return n&&x.setLiveDelay(r,!0),j.debug("live edge: "+e+", live delay: "+r+", live target: "+o),n}catch(e){return null}}(n,t);return r&&(e=U.get().streaming.lowLatencyEnabled?r.duration<L.getLiveDelay()?r.startTime:r.startTime+r.duration-L.getLiveDelay():r.startTime),e},switchTrackAsked:function(){Y.switchTrackAsked()},getMediaInfoArr:ue,getMediaInfo:le,getMediaSource:function(){return q.getMediaSource()},setMediaSource:function(e){q.setMediaSource(e,ue())},dischargePreBuffer:function(){q.dischargePreBuffer()},getBuffer:se,setBuffer:function(e){q.setBuffer(e)},setBufferingTime:function(e){Q=e},resetIndexHandler:function(){X&&X.resetIndex()},getInitRequest:function(e){(0,h.checkInteger)(e);var t=W?W.getRepresentationForQuality(e):null;return X?X.getInitRequest(le(),t):null},getFragmentRequest:ge,finalisePlayList:function(e,t){F.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=ce(),t=W&&e?W.getRepresentationForQuality(e.quality):null;return X.getNextSegmentRequestIdempotent(le(),t)},reset:function(e,t){X&&X.reset(),q&&(q.reset(e,t),q=null),Y&&(Y.reset(),Y=null),W&&(W.reset(),W=null),z&&(z.reset(),z=null),O&&!t&&O.unRegisterStreamType(I),n.off(g.default.DATA_UPDATE_COMPLETED,ee,G),n.off(g.default.QUALITY_CHANGE_REQUESTED,te,G),n.off(g.default.INIT_FRAGMENT_NEEDED,de,G),n.off(g.default.MEDIA_FRAGMENT_NEEDED,fe,G),n.off(g.default.MEDIA_FRAGMENT_LOADED,he,G),n.off(g.default.BUFFER_LEVEL_UPDATED,ne,G),n.off(g.default.BUFFER_LEVEL_STATE_CHANGED,re,G),n.off(g.default.BUFFER_CLEARED,ie,G),n.off(g.default.SEEK_TARGET,pe,G),$(),I=null,f=null}},j=(0,E.default)(t).getInstance().getLogger(G),$(),n.on(g.default.DATA_UPDATE_COMPLETED,ee,G,{priority:p.default.EVENT_PRIORITY_HIGH}),n.on(g.default.QUALITY_CHANGE_REQUESTED,te,G),n.on(g.default.INIT_FRAGMENT_NEEDED,de,G),n.on(g.default.MEDIA_FRAGMENT_NEEDED,fe,G),n.on(g.default.MEDIA_FRAGMENT_LOADED,he,G),n.on(g.default.BUFFER_LEVEL_UPDATED,ne,G),n.on(g.default.BUFFER_LEVEL_STATE_CHANGED,re,G),n.on(g.default.BUFFER_CLEARED,ie,G),n.on(g.default.QUOTA_EXCEEDED,ae,G),n.on(g.default.SEEK_TARGET,pe,G),G}w.__dashjs_factory_name="StreamProcessor",t.default=f.default.getClassFactory(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=y(n(1)),i=n(8),a=y(n(108)),o=y(n(27)),s=y(n(68)),u=y(n(0)),l=y(n(2)),c=y(n(44)),d=y(n(130)),f=y(n(43)),h=y(n(65)),p=y(n(3)),g=y(n(4)),v=y(n(6)),m=y(n(11));function y(e){return e&&e.__esModule?e:{default:e}}function E(){var e=this.context,t=(0,p.default)(e).getInstance(),n=!1,u=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0;function K(){C=null,L=NaN,N=[],P=null,M=!1}function V(){K(),R=[],A=null}function q(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&X(t.bytes,t)}function Y(){F=[],(D=(0,c.default)(e).getInstance()).setConfig({videoModel:O}),D.initialize(),E=(0,o.default)(e).getInstance(),k=null,U=0,G=[],B=null,n=!0,j=(0,d.default)(e).getInstance();var r=x.getActiveStreamProcessors();for(var i in r)if("video"===r[i].getType()){H=r[i].getRepresentationInfo().MSETimeOffset;break}t.on(g.default.VIDEO_CHUNK_RECEIVED,q,this),t.on(g.default.BUFFER_CLEARED,J,this)}function W(e){k=e}function z(e,t){var n,i,o=new a.default,s={subtitle:"subtitles",caption:"captions"};o.captionData=e,o.lang=t.lang,o.labels=t.labels,o.id=t.id?t.id:t.index,o.index=t.index,o.isTTML=(n=!1,t.codec&&t.codec.search(r.default.STPP)>=0&&(n=!0),t.mimeType&&t.mimeType.search(r.default.TTML)>=0&&(n=!0),n),o.defaultTrack=function(e){var t=!1;F.length>1&&e.isEmbedded?t=e.id&&e.id===r.default.CC1:1===F.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===F.length&&(t=e.index===R[0].index);return t}(t),o.isFragmented=!_.getIsTextTrack(t.mimeType),o.isEmbedded=!!t.isEmbedded,o.kind=i=(i=t.roles.length>0?s[t.roles[0]]:s.caption)===s.caption||i===s.subtitle?i:s.caption,o.roles=t.roles,o.accessibility=t.accessibility;var u=(R?R.length:0)+F.length;D.addTextTrack(o,u)}function X(e,t){var n=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=t.mediaInfo,p=d.type,g=d.mimeType,_=d.codec||g;if(_){if(p===r.default.FRAGMENTED_TEXT)if(M||"InitializationSegment"!==t.segmentType){if(!M)return;if(a=(l=E.getSamplesInfo(e)).sampleList,null===P&&a.length>0&&(P=a[0].cts-t.start*L),_.search(r.default.STPP)>=0)for(A=null!==A?A:Q(_),o=0;o<a.length;o++){var S=a[o],I=S.cts,w=I-P;this.buffered.add(w/L,(w+S.duration)/L);var R=new DataView(e,S.offset,S.subSizes[0]);c=f.default.Utils.dataViewToString(R,r.default.UTF8);var N=[],x=S.offset+S.subSizes[0];for(s=1;s<S.subSizes.length;s++){var K=new Uint8Array(e,x,S.subSizes[s]),V=String.fromCharCode.apply(null,K);N.push(V),x+=S.subSizes[s]}try{var q=b.getValue().ttmlTimeIsRelative?I/L:0;n=A.parse(c,q,I/L,(I+S.duration)/L,N),D.addCaptions(k,P/L,n)}catch(e){C.removeExecutedRequestsBeforeTime(),this.remove(),y.error("TTML parser error: "+e.message)}}else{var Y=[];for(o=0;o<a.length;o++){var W=a[o];W.cts-=P,this.buffered.add(W.cts/L,(W.cts+W.duration)/L);var X=e.slice(W.offset,W.offset+W.size),J=f.default.parseBuffer(X);for(s=0;s<J.boxes.length;s++){var Z=J.boxes[s];if(y.debug("VTT box1: "+Z.type),"vtte"!==Z.type&&"vttc"===Z.type)for(y.debug("VTT vttc boxes.length = "+Z.boxes.length),u=0;u<Z.boxes.length;u++){var $=Z.boxes[u];if(y.debug("VTT box2: "+$.type),"payl"===$.type){var ee=$.cue_text;y.debug("VTT cue_text = "+ee);var te=W.cts/L,ne=(W.cts+W.duration)/L;Y.push({start:te,end:ne,data:ee,styles:{}}),y.debug("VTT "+te+"-"+ne+" : "+ee)}}}}Y.length>0&&D.addCaptions(k,0,Y)}}else M=!0,L=E.getMediaTimescaleFromMoov(e);else if(p===r.default.TEXT){var re=new DataView(e,0,e.byteLength);c=f.default.Utils.dataViewToString(re,r.default.UTF8);try{n=Q(_).parse(c,0),D.addCaptions(D.getCurrentTrackIdx(),0,n)}catch(e){T.error(new v.default(m.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,m.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,c))}}else if(p===r.default.VIDEO)if(t.segmentType===i.HTTPRequest.INIT_SEGMENT_TYPE){if(0===U)for(U=E.getMediaTimescaleFromMoov(e),o=0;o<F.length;o++)z(null,F[o])}else{if(0===U)return void y.warn("CEA-608: No timescale for embeddedTextTrack yet");var ie=function(e,t){return function(e,n,r){var i=null;i=O.getTTMLRenderingDiv()?j.createHTMLCaptionsFromScreen(O.getElement(),e,n,r):[{start:e,end:n,data:r.getDisplayText(),styles:{}}],i&&D.addCaptions(t,0,i)}},ae=(l=E.getSamplesInfo(e)).lastSequenceNumber;if(!G[0]&&!G[1]){var oe=void 0,se=void 0;for(o=0;o<F.length;o++){if(F[o].id===r.default.CC1?(0,se=D.getTrackIdxForId(r.default.CC1)):F[o].id===r.default.CC3&&(1,se=D.getTrackIdxForId(r.default.CC3)),-1===se)return void y.warn("CEA-608: data before track is ready.");oe=ie(0,se),G[o]=new h.default.Cea608Parser(o+1,{newCue:oe},null)}}if(U){if(null!==B&&ae!==B+l.numSequences)for(o=0;o<G.length;o++)G[o]&&G[o].reset();for(var ue=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),i=0;i<t.length;i++)for(var a=t[i],o=h.default.findCea608Nalus(r,a.offset,a.size),s=null,u=0,l=0;l<o.length;l++)for(var c=h.default.extractCea608DataFromRange(r,o[l]),d=0;d<2;d++)c[d].length>0&&(a.cts!==s?u=0:u+=1,n.fields[d].push([a.cts+H*U,c[d],u]),s=a.cts);return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,l.sampleList),le=0;le<G.length;le++){var ce=ue.fields[le],de=G[le];if(de)for(o=0;o<ce.length;o++)de.addData(ce[o][0]/U,ce[o][1])}B=ae}}}else y.error("No text type defined")}function Q(e){var t=void 0;return e.search(r.default.VTT)>=0?t=I:(e.search(r.default.TTML)>=0||e.search(r.default.STPP)>=0)&&(t=w),t}function J(e){F.forEach((function(t){var n=D.getTrackIdxForId(t.id);n>=0&&D.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return u={initialize:function(t,i,a,l){n||Y(),D.setConfig({videoModel:O}),D.initialize(),E||(E=(0,o.default)(e).getInstance()),function(t,n,i,a){var o=!_.getIsTextTrack(t);if(R=R.concat(i),o){C=a,u.buffered=(0,s.default)(e).create(),N=S.getTracksFor(r.default.FRAGMENTED_TEXT,n);for(var l=S.getCurrentTrackFor(r.default.FRAGMENTED_TEXT,n),c=0;c<N.length;c++)if(N[c]===l){W(c);break}}for(var d=0;d<R.length;d++)z(null,R[d])}(t,i,a,l)},append:X,abort:function(){D.deleteAllTextTracks(),K(),E=null,R=[]},addEmbeddedTrack:function(e){if(n||Y(),e)if(e.id===r.default.CC1||e.id===r.default.CC3){for(var t=0;t<F.length;t++)if(F[t].id===e.id)return;F.push(e)}else y.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){t.off(g.default.VIDEO_CHUNK_RECEIVED,q,this),t.off(g.default.BUFFER_CLEARED,J,this),D&&D.deleteAllTextTracks(),n=!1,F=[],G=[null,null],B=null},setConfig:function(e){e&&(e.errHandler&&(T=e.errHandler),e.adapter&&(_=e.adapter),e.manifestModel&&(b=e.manifestModel),e.mediaController&&(S=e.mediaController),e.videoModel&&(O=e.videoModel),e.streamController&&(x=e.streamController),e.textTracks&&(D=e.textTracks),e.vttParser&&(I=e.vttParser),e.ttmlParser&&(w=e.ttmlParser))},getConfig:function(){return{fragmentModel:C,fragmentedTracks:N,videoModel:O}},setCurrentFragmentedTrackIdx:W,remove:function(e,t){void 0===e&&e===t&&(e=this.buffered.start(0),t=this.buffered.end(this.buffered.length-1)),this.buffered.remove(e,t)},reset:function(){V(),x=null,O=null,D=null}},y=(0,l.default)(e).getInstance().getLogger(u),V(),u}E.__dashjs_factory_name="TextSourceBuffer",t.default=u.default.getSingletonFactory(E)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.captionData=null,this.label=null,this.lang=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(110)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i=e.fetchAll(t),a=void 0,o=0,s=i.length;o<s;o++)(a=n(i[o]))&&r.push(a);return r}function n(e){if(!e)return null;var t=new r.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}o.__dashjs_factory_name="IsoFile",t.default=i.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,o=t.samples.length;a<o;a++){var s={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(s)}}}}return r(e,[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r}},function(e,t,n){!function(e,t,n,r){e.generateISD=function(e,t,n){var r=new o(e),i={};for(var s in e.head.layout.regions){var u=a(e,t,e.head.layout.regions[s],e.body,null,"",e.head.layout.regions[s],n,i);null!==u&&r.contents.push(u.element)}return r};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function a(e,t,o,l,c,d,f,h,p){if(t<f.begin||t>=f.end)return null;var g="regionID"in f&&""!==f.regionID?f.regionID:d;if(null!==c&&g!==o.id&&(!("contents"in f)||"contents"in f&&0===f.contents.length||""!==g))return null;var v=new s(f);for(var m in f.sets)t<f.sets[m].begin||t>=f.sets[m].end||(v.styleAttrs[f.sets[m].qname]=f.sets[m].value);var y,E={};for(var T in v.styleAttrs)if(E[T]=!0,T===n.byName.writingMode.qname&&!(n.byName.direction.qname in v.styleAttrs)){var _=v.styleAttrs[T];"lrtb"===_||"lr"===_?v.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==_&&"rl"!==_||(v.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==c)for(var b in n.all){var S=n.all[b];if(S.qname===n.byName.textDecoration.qname){var A=c.styleAttrs[S.qname],I=v.styleAttrs[S.qname],w=[];void 0===I?w=A:-1===I.indexOf("none")?((-1===I.indexOf("noUnderline")&&-1!==A.indexOf("underline")||-1!==I.indexOf("underline"))&&w.push("underline"),(-1===I.indexOf("noLineThrough")&&-1!==A.indexOf("lineThrough")||-1!==I.indexOf("lineThrough"))&&w.push("lineThrough"),(-1===I.indexOf("noOverline")&&-1!==A.indexOf("overline")||-1!==I.indexOf("overline"))&&w.push("overline")):w.push("none"),v.styleAttrs[S.qname]=w}else if(S.qname!==n.byName.fontSize.qname||S.qname in v.styleAttrs||"span"!==v.kind||"textContainer"!==v.styleAttrs[n.byName.ruby.qname])if(S.qname!==n.byName.fontSize.qname||S.qname in v.styleAttrs||"span"!==v.kind||"text"!==v.styleAttrs[n.byName.ruby.qname])S.inherit&&S.qname in c.styleAttrs&&!(S.qname in v.styleAttrs)&&(v.styleAttrs[S.qname]=c.styleAttrs[S.qname]);else{var R=c.styleAttrs[n.byName.fontSize.qname];"textContainer"===c.styleAttrs[n.byName.ruby.qname]?v.styleAttrs[S.qname]=R:v.styleAttrs[S.qname]=new r.ComputedLength(.5*R.rw,.5*R.rh)}else{var D=c.styleAttrs[n.byName.fontSize.qname];v.styleAttrs[S.qname]=new r.ComputedLength(.5*D.rw,.5*D.rh)}}for(var C in n.all){var M=n.all[C];if(!(M.qname in v.styleAttrs)&&!(M.qname===n.byName.position.qname&&n.byName.origin.qname in v.styleAttrs||M.qname===n.byName.origin.qname&&n.byName.position.qname in v.styleAttrs)){var L=e.head.styling.initials[M.qname]||M.initial;("region"===v.kind||!1===M.inherit&&null!==L)&&(v.styleAttrs[M.qname]=M.parse(L),E[M.qname]=!0)}}for(var N in n.all){var O=n.all[N];if(O.qname in E&&null!==O.compute){var x=O.compute(e,c,v,v.styleAttrs[O.qname],p);null!==x?v.styleAttrs[O.qname]=x:(v.styleAttrs[O.qname]=O.compute(e,c,v,O.parse(O.initial),p),u(h,"Style '"+O.qname+"' on element '"+v.kind+"' cannot be computed"))}}if("none"===v.styleAttrs[n.byName.display.qname])return null;for(var P in null===c?y=null===l?[]:[l]:"contents"in f&&(y=f.contents),y){var k=a(e,t,o,l,v,g,y[P],h,p);null!==k&&v.contents.push(k.element)}for(var F in v.styleAttrs){var U=!1;if("span"===v.kind){var B=v.styleAttrs[n.byName.ruby.qname];(U=("container"===B||"textContainer"===B||"baseContainer"===B)&&-1!==i.indexOf(F))||(U="container"!==B&&F===n.byName.rubyAlign.qname),U||(U=!("textContainer"===B||"text"===B)&&F===n.byName.rubyPosition.qname)}if(!U)U=-1===n.byQName[F].applies.indexOf(v.kind);U&&delete v.styleAttrs[F]}if("span"===v.kind&&v.text&&"default"===v.space){var G=v.text.replace(/[\t\r\n ]+/g," ");v.text=G}if("p"===v.kind){var j=[];!function e(t,n){if("contents"in t)for(var r in t.contents)e(t.contents[r],n);else"span"!==t.kind&&"br"!==t.kind||n.push(t)}(v,j);for(var H=0,K="after_br",V=0;;)if("after_br"===K)H>=j.length||"br"===j[H].kind?(K="before_br",V=H,H--):("preserve"!==j[H].space&&(j[H].text=j[H].text.replace(/^[\t\r\n ]+/g,"")),j[H].text.length>0?(K="looking_br",H++):j.splice(H,1));else if("before_br"===K)if(H<0||"br"===j[H].kind){if(K="after_br",(H=V+1)>=j.length)break}else if("preserve"!==j[H].space&&(j[H].text=j[H].text.replace(/[\t\r\n ]+$/g,"")),j[H].text.length>0){if(K="after_br",(H=V+1)>=j.length)break}else j.splice(H,1),H--;else H>=j.length||"br"===j[H].kind?(K="before_br",V=H,H--):H++;!function e(t){if("br"===t.kind)return!1;if("text"in t)return 0===t.text.length;if("contents"in t){for(var n=t.contents.length;n--;)e(t.contents[n])&&t.contents.splice(n,1);return 0===t.contents.length}}(v)}return"div"===v.kind&&n.byName.backgroundImage.qname in v.styleAttrs||"br"===v.kind||"image"===v.kind||"contents"in v&&v.contents.length>0||"span"===v.kind&&null!==v.text||"region"===v.kind&&"always"===v.styleAttrs[n.byName.showBackground.qname]?{region_id:g,element:v}:null}function o(e){this.contents=[],this.aspectRatio=e.aspectRatio}function s(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"src"in e&&(this.src=e.src),"type"in e&&(this.type=e.type),"text"in e?this.text=e.text:("region"===this.kind||"contents"in e)&&(this.contents=[]),"space"in e&&(this.space=e.space)}function u(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscStyles?n(45):imscStyles,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,o=0;r&&(o=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var s=t.begin,u=null;for(var l in t.sets)a(e,t.sets[l],u,t),s="seq"===t.timeContainer?t.sets[l].end:Math.max(s,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],u,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),u=t.contents[c];else s=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=o+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function s(){this.events=[],this.head=new u,this.body=null}function u(){this.styling=new l,this.layout=new f}function l(){this.styles={},this.initials={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function d(){this.styleAttrs=null}function f(){this.regions={}}function h(e,t){p.call(this,"image"),this.src=e,this.type=t}function p(e){this.kind=e}function g(e){this.id=e}function v(e){this.regionID=e}function m(e){this.styleAttrs=e}function y(e){this.sets=e}function E(e){this.contents=e}function T(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function _(){p.call(this,"body")}function b(){p.call(this,"div")}function S(){p.call(this,"p")}function A(){p.call(this,"span")}function I(){p.call(this,"span")}function w(){p.call(this,"br")}function R(){}function D(){}function C(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function M(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function L(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,o=r.byQName[a];if(void 0!==o){var s=o.parse(e.attributes[i].value);null!==s?(n[a]=s,o===r.byName.zIndex&&F(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):U(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function N(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function O(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function x(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(x(e,e.styles[r],n),k(e.styles[r].styleAttrs,t.styleAttrs)):U(n,"Non-existant style id referenced")}}function P(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?k(e.styles[a].styleAttrs,n):U(r,"Non-existant style id referenced")}}function k(e,t){for(var n in e)n in t||(t[n]=e[n])}function F(e,t){if(e&&e.warn&&e.warn(t))throw t}function U(e,t){if(e&&e.error&&e.error(t))throw t}function B(e,t){throw e&&e.fatal&&e.fatal(t),t}function G(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,p){var g=t.parser(!0,{xmlns:!0}),v=[],m=[],y=[],E=0,T=null;g.onclosetag=function(e){if(v[0]instanceof l)for(var t in v[0].styles)x(v[0],v[0].styles[t],i);else if(v[0]instanceof S||v[0]instanceof A){if(v[0].contents.length>1){var r,a=[v[0].contents[0]];for(r=1;r<v[0].contents.length;r++)v[0].contents[r]instanceof I&&a[a.length-1]instanceof I?a[a.length-1].text+=v[0].contents[r].text:a.push(v[0].contents[r]);v[0].contents=a}v[0]instanceof A&&1===v[0].contents.length&&v[0].contents[0]instanceof I&&(v[0].text=v[0].contents[0].text,delete v[0].contents)}else v[0]instanceof o&&(v[0].node.uri===n.ns_tt&&"metadata"===v[0].node.local?E--:E>0&&p&&"onCloseTag"in p&&p.onCloseTag());y.shift(),m.shift(),v.shift()},g.ontext=function(e){if(void 0===v[0]);else if(v[0]instanceof A||v[0]instanceof S){if(v[0]instanceof A){var t=v[0].styleAttrs[r.byName.ruby.qname];if("container"===t||"textContainer"===t||"baseContainer"===t)return}var n=new I;n.initFromText(T,v[0],e,y[0],i),v[0].contents.push(n)}else v[0]instanceof o&&E>0&&p&&"onText"in p&&p.onText(e)},g.onopentag=function(e){var t=e.attributes["xml:space"];t?y.unshift(t.value):0===y.length?y.unshift("default"):y.unshift(y[0]);var a=e.attributes["xml:lang"];if(a?m.unshift(a.value):0===m.length?m.unshift(""):m.unshift(m[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==T&&B(i,"Two <tt> elements at ("+this.line+","+this.column+")"),(T=new s).initFromNode(e,i),v.unshift(T);else if("head"===e.local)v[0]instanceof s||B(i,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),v.unshift(T.head);else if("styling"===e.local)v[0]instanceof u||B(i,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),v.unshift(T.head.styling);else if("style"===e.local){var g;v[0]instanceof l?((g=new c).initFromNode(e,i),g.id?T.head.styling.styles[g.id]=g:U(i,"<style> element missing @id attribute"),v.unshift(g)):v[0]instanceof R?((g=new c).initFromNode(e,i),k(g.styleAttrs,v[0].styleAttrs),v.unshift(g)):B(i,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("initial"===e.local){var I;if(v[0]instanceof l){for(var C in(I=new d).initFromNode(e,i),I.styleAttrs)T.head.styling.initials[C]=I.styleAttrs[C];v.unshift(I)}else B(i,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if("layout"===e.local)v[0]instanceof u||B(i,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),v.unshift(T.head.layout);else if("region"===e.local){v[0]instanceof f||B(i,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var M=new R;M.initFromNode(T,e,i),!M.id||M.id in T.head.layout.regions?U(i,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):T.head.layout.regions[M.id]=M,v.unshift(M)}else if("body"===e.local){v[0]instanceof s||B(i,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==T.body&&B(i,"Second <body> element at "+this.line+","+this.column+")");var L=new _;L.initFromNode(T,e,i),T.body=L,v.unshift(L)}else if("div"===e.local){v[0]instanceof b||v[0]instanceof _||B(i,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var N=new b;N.initFromNode(T,v[0],e,i);var O=N.styleAttrs[r.byName.backgroundImage.qname];O&&(N.contents.push(new h(O)),delete N.styleAttrs[r.byName.backgroundImage.qname]),v[0].contents.push(N),v.unshift(N)}else if("image"===e.local){v[0]instanceof b||B(i,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var x=new h;x.initFromNode(T,v[0],e,i),v[0].contents.push(x),v.unshift(x)}else if("p"===e.local){v[0]instanceof b||B(i,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var P=new S;P.initFromNode(T,v[0],e,i),v[0].contents.push(P),v.unshift(P)}else if("span"===e.local){v[0]instanceof A||v[0]instanceof S||B(i,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var F=new A;F.initFromNode(T,v[0],e,y[0],i),v[0].contents.push(F),v.unshift(F)}else if("br"===e.local){v[0]instanceof A||v[0]instanceof S||B(i,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var G=new w;G.initFromNode(T,v[0],e,i),v[0].contents.push(G),v.unshift(G)}else if("set"===e.local){v[0]instanceof A||v[0]instanceof S||v[0]instanceof b||v[0]instanceof _||v[0]instanceof R||v[0]instanceof w||B(i,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var j=new D;j.initFromNode(T,v[0],e,i),v[0].sets.push(j),v.unshift(j)}else v.unshift(new o(e));else v.unshift(new o(e));if(v[0]instanceof o)if(e.uri===n.ns_tt&&"metadata"===e.local)E++;else if(E>0&&p&&"onOpenTag"in p){var H=[];for(var K in e.attributes)H[e.attributes[K].uri+" "+e.attributes[K].local]={uri:e.attributes[K].uri,local:e.attributes[K].local,value:e.attributes[K].value};p.onOpenTag(e.uri,e.local,H)}},g.write(e).close(),delete T.head.styling.styles;var C=!1;for(var M in T.head.layout.regions){C=!0;break}if(!C){var L=R.prototype.createDefaultRegion();T.head.layout.regions[L.id]=L}for(var N in T.head.layout.regions)a(T,T.head.layout.regions[N],null,null);return T.body&&a(T,T.body,null,null),T.body&&function e(t){if(!("contents"in t))return;for(var n=("styleAttrs"in t?t.styleAttrs[r.byName.ruby.qname]:null),i="span"===t.kind&&("container"===n||"textContainer"===n||"baseContainer"===n),a=t.contents.length-1;a>=0;a--)!i||"styleAttrs"in t.contents[a]&&r.byName.ruby.qname in t.contents[a].styleAttrs?e(t.contents[a]):delete t.contents[a]}(T.body),T},s.prototype.initFromNode=function(e,t){var r=function(e,t){var r=N(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var o=/(\d+) (\d+)/.exec(r);null!==o?(a=parseInt(o[1]),i=parseInt(o[2])):F(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,t);this.cellLength={h:new i.ComputedLength(0,1/r.h),w:new i.ComputedLength(1/r.w,0)};var a=function(e,t){var r,i=N(e,n.ns_ttp,"frameRate"),a=30;if(null!==i){null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):F(t,"Malformed frame rate attribute (using initial value instead)")}var o=N(e,n.ns_ttp,"frameRateMultiplier"),s=1;if(null!==o){null!==(r=/(\d+) (\d+)/.exec(o))?s=parseInt(r[1])/parseInt(r[2]):F(t,"Malformed frame rate multiplier attribute (using initial value instead)")}var u=s*a,l=1,c=N(e,n.ns_ttp,"tickRate");if(null===c)null!==i&&(l=u);else{null!==(r=/(\d+)/.exec(c))?l=parseInt(r[1]):F(t,"Malformed tick rate attribute (using initial value instead)")}return{effectiveFrameRate:u,tickRate:l}}(e,t);this.effectiveFrameRate=a.effectiveFrameRate,this.tickRate=a.tickRate,this.aspectRatio=function(e,t){var r=N(e,n.ns_ittp,"aspectRatio");null===r&&(r=N(e,n.ns_ttp,"displayAspectRatio"));var i=null;if(null!==r){var a=/(\d+)\s+(\d+)/.exec(r);if(null!==a){var o=parseInt(a[1]),s=parseInt(a[2]);0!==o&&0!==s?i=o/s:U(t,"Illegal aspectRatio values (ignoring)")}else U(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,t);var o=N(e,n.ns_ttp,"timeBase");null!==o&&"media"!==o&&B(t,"Unsupported time base");var s=function(e,t){var r=N(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return F(t,"Malformed extent (ignoring)"),null;var o=i.parseLength(a[0]),s=i.parseLength(a[1]);if(!s||!o)return F(t,"Malformed extent values (ignoring)"),null;return{h:s,w:o}}(e,t);null===s?this.pxLength={h:null,w:null}:("px"===s.h.unit&&"px"===s.w.unit||B(t,"Extent on TT must be in px or absent"),this.pxLength={h:new i.ComputedLength(0,1/s.h.value),w:new i.ComputedLength(1/s.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)}},s.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=G(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=G(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},s.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},s.prototype.getMediaTimeEvents=function(){return this.events},c.prototype.initFromNode=function(e,t){this.id=C(e),this.styleAttrs=L(e,t),this.styleRefs=M(e)},d.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+" "+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},h.prototype.initFromNode=function(e,t,n,r){this.src="src"in n.attributes?n.attributes.src.value:null,this.src||U(r,"Invalid image@src attribute"),this.type="type"in n.attributes?n.attributes.type.value:null,this.type||U(r,"Invalid image@type attribute"),m.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r)},g.prototype.initFromNode=function(e,t,n,r){this.id=C(n)},v.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},m.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=L(n,r),null!==e.head&&null!==e.head.styling&&P(e.head.styling,M(n),this.styleAttrs,r)},y.prototype.initFromNode=function(e,t,n,r){this.sets=[]},E.prototype.initFromNode=function(e,t,n,r){this.contents=[]},T.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=O(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&F(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=O(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&F(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var o=null;n&&"end"in n.attributes&&null===(o=O(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&F(r,"Malformed end value (ignoring)");return{explicit_begin:i,explicit_end:o,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(U(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},_.prototype.initFromNode=function(e,t,n){m.prototype.initFromNode.call(this,e,null,t,n),T.prototype.initFromNode.call(this,e,null,t,n),y.prototype.initFromNode.call(this,e,null,t,n),v.prototype.initFromNode.call(this,e,null,t,n),E.prototype.initFromNode.call(this,e,null,t,n)},b.prototype.initFromNode=function(e,t,n,r){m.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),E.prototype.initFromNode.call(this,e,t,n,r)},S.prototype.initFromNode=function(e,t,n,r){m.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),E.prototype.initFromNode.call(this,e,t,n,r)},A.prototype.initFromNode=function(e,t,n,r,i){m.prototype.initFromNode.call(this,e,t,n,i),T.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),this.space=r},I.prototype.initFromText=function(e,t,n,r,i){T.prototype.initFromNode.call(this,e,t,null,i),this.text=n,this.space=r},w.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r)},R.prototype.createDefaultRegion=function(){var e=new R;return g.call(e,""),m.call(e,{}),y.call(e,[]),T.call(e,0,Number.POSITIVE_INFINITY,null),e},R.prototype.initFromNode=function(e,t,n){g.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),T.prototype.initFromNode.call(this,e,null,t,n),y.prototype.initFromNode.call(this,e,null,t,n),null!==e.head&&null!==e.head.styling&&P(e.head.styling,M(t),this.styleAttrs,n)},D.prototype.initFromNode=function(e,t,n,r){T.prototype.initFromNode.call(this,e,t,n,r);var i=L(n,r);for(var a in this.qname=null,this.value=null,i){if(this.qname){U(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n(114):sax,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscStyles?n(45):imscStyles,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){(function(e){!function(t){t.parser=function(e,t){return new a(e,t)},t.SAXParser=a,t.SAXStream=s,t.createStream=function(e,t){return new s(e,t)},t.MAX_BUFFER_LENGTH=65536;var r,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function a(e,n){if(!(this instanceof a))return new a(e,n);!function(e){for(var t=0,n=i.length;t<n;t++)e[i[t]]=""}(this),this.q=this.c="",this.bufferCheckPosition=t.MAX_BUFFER_LENGTH,this.opt=n||{},this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!e,this.noscript=!(!e&&!this.opt.noscript),this.state=I.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(p)),this.trackPosition=!1!==this.opt.position,this.trackPosition&&(this.position=this.line=this.column=0),R(this,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),a.prototype={end:function(){N(this)},write:function(e){if(this.error)throw this.error;if(this.closed)return L(this,"Cannot write after close. Assign an onready handler.");if(null===e)return N(this);"object"==typeof e&&(e=e.toString());var n=0,r="";for(;r=j(e,n++),this.c=r,r;)switch(this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++),this.state){case I.BEGIN:if(this.state=I.BEGIN_WHITESPACE,"\ufeff"===r)continue;G(this,r);continue;case I.BEGIN_WHITESPACE:G(this,r);continue;case I.TEXT:if(this.sawRoot&&!this.closedRoot){for(var a=n-1;r&&"<"!==r&&"&"!==r;)(r=j(e,n++))&&this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++);this.textNode+=e.substring(a,n-1)}"<"!==r||this.sawRoot&&this.closedRoot&&!this.strict?(!_(u,r)||this.sawRoot&&!this.closedRoot||O(this,"Text data outside of root node."),"&"===r?this.state=I.TEXT_ENTITY:this.textNode+=r):(this.state=I.OPEN_WAKA,this.startTagPosition=this.position);continue;case I.SCRIPT:"<"===r?this.state=I.SCRIPT_ENDING:this.script+=r;continue;case I.SCRIPT_ENDING:"/"===r?this.state=I.CLOSE_TAG:(this.script+="<"+r,this.state=I.SCRIPT);continue;case I.OPEN_WAKA:if("!"===r)this.state=I.SGML_DECL,this.sgmlDecl="";else if(T(u,r));else if(T(g,r))this.state=I.OPEN_TAG,this.tagName=r;else if("/"===r)this.state=I.CLOSE_TAG,this.tagName="";else if("?"===r)this.state=I.PROC_INST,this.procInstName=this.procInstBody="";else{if(O(this,"Unencoded <"),this.startTagPosition+1<this.position){var o=this.position-this.startTagPosition;r=new Array(o).join(" ")+r}this.textNode+="<"+r,this.state=I.TEXT}continue;case I.SGML_DECL:"[CDATA["===(this.sgmlDecl+r).toUpperCase()?(D(this,"onopencdata"),this.state=I.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+r==="--"?(this.state=I.COMMENT,this.comment="",this.sgmlDecl=""):"DOCTYPE"===(this.sgmlDecl+r).toUpperCase()?(this.state=I.DOCTYPE,(this.doctype||this.sawRoot)&&O(this,"Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):">"===r?(D(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=I.TEXT):T(d,r)?(this.state=I.SGML_DECL_QUOTED,this.sgmlDecl+=r):this.sgmlDecl+=r;continue;case I.SGML_DECL_QUOTED:r===this.q&&(this.state=I.SGML_DECL,this.q=""),this.sgmlDecl+=r;continue;case I.DOCTYPE:">"===r?(this.state=I.TEXT,D(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=r,"["===r?this.state=I.DOCTYPE_DTD:T(d,r)&&(this.state=I.DOCTYPE_QUOTED,this.q=r));continue;case I.DOCTYPE_QUOTED:this.doctype+=r,r===this.q&&(this.q="",this.state=I.DOCTYPE);continue;case I.DOCTYPE_DTD:this.doctype+=r,"]"===r?this.state=I.DOCTYPE:T(d,r)&&(this.state=I.DOCTYPE_DTD_QUOTED,this.q=r);continue;case I.DOCTYPE_DTD_QUOTED:this.doctype+=r,r===this.q&&(this.state=I.DOCTYPE_DTD,this.q="");continue;case I.COMMENT:"-"===r?this.state=I.COMMENT_ENDING:this.comment+=r;continue;case I.COMMENT_ENDING:"-"===r?(this.state=I.COMMENT_ENDED,this.comment=M(this.opt,this.comment),this.comment&&D(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+r,this.state=I.COMMENT);continue;case I.COMMENT_ENDED:">"!==r?(O(this,"Malformed comment"),this.comment+="--"+r,this.state=I.COMMENT):this.state=I.TEXT;continue;case I.CDATA:"]"===r?this.state=I.CDATA_ENDING:this.cdata+=r;continue;case I.CDATA_ENDING:"]"===r?this.state=I.CDATA_ENDING_2:(this.cdata+="]"+r,this.state=I.CDATA);continue;case I.CDATA_ENDING_2:">"===r?(this.cdata&&D(this,"oncdata",this.cdata),D(this,"onclosecdata"),this.cdata="",this.state=I.TEXT):"]"===r?this.cdata+="]":(this.cdata+="]]"+r,this.state=I.CDATA);continue;case I.PROC_INST:"?"===r?this.state=I.PROC_INST_ENDING:T(u,r)?this.state=I.PROC_INST_BODY:this.procInstName+=r;continue;case I.PROC_INST_BODY:if(!this.procInstBody&&T(u,r))continue;"?"===r?this.state=I.PROC_INST_ENDING:this.procInstBody+=r;continue;case I.PROC_INST_ENDING:">"===r?(D(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=I.TEXT):(this.procInstBody+="?"+r,this.state=I.PROC_INST_BODY);continue;case I.OPEN_TAG:T(v,r)?this.tagName+=r:(x(this),">"===r?F(this):"/"===r?this.state=I.OPEN_TAG_SLASH:(_(u,r)&&O(this,"Invalid character in tag name"),this.state=I.ATTRIB));continue;case I.OPEN_TAG_SLASH:">"===r?(F(this,!0),U(this)):(O(this,"Forward-slash in opening tag not followed by >"),this.state=I.ATTRIB);continue;case I.ATTRIB:if(T(u,r))continue;">"===r?F(this):"/"===r?this.state=I.OPEN_TAG_SLASH:T(g,r)?(this.attribName=r,this.attribValue="",this.state=I.ATTRIB_NAME):O(this,"Invalid attribute name");continue;case I.ATTRIB_NAME:"="===r?this.state=I.ATTRIB_VALUE:">"===r?(O(this,"Attribute without value"),this.attribValue=this.attribName,k(this),F(this)):T(u,r)?this.state=I.ATTRIB_NAME_SAW_WHITE:T(v,r)?this.attribName+=r:O(this,"Invalid attribute name");continue;case I.ATTRIB_NAME_SAW_WHITE:if("="===r)this.state=I.ATTRIB_VALUE;else{if(T(u,r))continue;O(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",D(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===r?F(this):T(g,r)?(this.attribName=r,this.state=I.ATTRIB_NAME):(O(this,"Invalid attribute name"),this.state=I.ATTRIB)}continue;case I.ATTRIB_VALUE:if(T(u,r))continue;T(d,r)?(this.q=r,this.state=I.ATTRIB_VALUE_QUOTED):(O(this,"Unquoted attribute value"),this.state=I.ATTRIB_VALUE_UNQUOTED,this.attribValue=r);continue;case I.ATTRIB_VALUE_QUOTED:if(r!==this.q){"&"===r?this.state=I.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=r;continue}k(this),this.q="",this.state=I.ATTRIB_VALUE_CLOSED;continue;case I.ATTRIB_VALUE_CLOSED:T(u,r)?this.state=I.ATTRIB:">"===r?F(this):"/"===r?this.state=I.OPEN_TAG_SLASH:T(g,r)?(O(this,"No whitespace between attributes"),this.attribName=r,this.attribValue="",this.state=I.ATTRIB_NAME):O(this,"Invalid attribute name");continue;case I.ATTRIB_VALUE_UNQUOTED:if(_(f,r)){"&"===r?this.state=I.ATTRIB_VALUE_ENTITY_U:this.attribValue+=r;continue}k(this),">"===r?F(this):this.state=I.ATTRIB;continue;case I.CLOSE_TAG:if(this.tagName)">"===r?U(this):T(v,r)?this.tagName+=r:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=I.SCRIPT):(_(u,r)&&O(this,"Invalid tagname in closing tag"),this.state=I.CLOSE_TAG_SAW_WHITE);else{if(T(u,r))continue;_(g,r)?this.script?(this.script+="</"+r,this.state=I.SCRIPT):O(this,"Invalid tagname in closing tag."):this.tagName=r}continue;case I.CLOSE_TAG_SAW_WHITE:if(T(u,r))continue;">"===r?U(this):O(this,"Invalid characters in closing tag");continue;case I.TEXT_ENTITY:case I.ATTRIB_VALUE_ENTITY_Q:case I.ATTRIB_VALUE_ENTITY_U:var s,l;switch(this.state){case I.TEXT_ENTITY:s=I.TEXT,l="textNode";break;case I.ATTRIB_VALUE_ENTITY_Q:s=I.ATTRIB_VALUE_QUOTED,l="attribValue";break;case I.ATTRIB_VALUE_ENTITY_U:s=I.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===r?(this[l]+=B(this),this.entity="",this.state=s):T(this.entity.length?y:m,r)?this.entity+=r:(O(this,"Invalid character in entity name"),this[l]+="&"+this.entity+r,this.entity="",this.state=s);continue;default:throw new Error(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),r=0,a=0,o=i.length;a<o;a++){var s=e[i[a]].length;if(s>n)switch(i[a]){case"textNode":C(e);break;case"cdata":D(e,"oncdata",e.cdata),e.cdata="";break;case"script":D(e,"onscript",e.script),e.script="";break;default:L(e,"Max buffer length exceeded: "+i[a])}r=Math.max(r,s)}var u=t.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=u+e.position}(this);return this}
|
|
412
|
-
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;C(e=this),""!==e.cdata&&(D(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(D(e,"onscript",e.script),e.script="")}};try{r=n(117).Stream}catch(e){r=function(){}}var o=t.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function s(e,t){if(!(this instanceof s))return new s(e,t);r.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})}))}s.prototype=Object.create(r.prototype,{constructor:{value:s}}),s.prototype.write=function(t){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(t)){if(!this._decoder){var r=n(50).StringDecoder;this._decoder=new r("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===o.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="\r\n\t ",l="0124356789",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",d="'\"",f=u+">",h="http://www.w3.org/XML/1998/namespace",p={xml:h,xmlns:"http://www.w3.org/2000/xmlns/"};u=E(u),l=E(l),c=E(c);var g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function E(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function T(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function _(e,t){return!T(e,t)}d=E(d),f=E(f);var b,S,A,I=0;for(var w in t.STATE={BEGIN:I++,BEGIN_WHITESPACE:I++,TEXT:I++,TEXT_ENTITY:I++,OPEN_WAKA:I++,SGML_DECL:I++,SGML_DECL_QUOTED:I++,DOCTYPE:I++,DOCTYPE_QUOTED:I++,DOCTYPE_DTD:I++,DOCTYPE_DTD_QUOTED:I++,COMMENT_STARTING:I++,COMMENT:I++,COMMENT_ENDING:I++,COMMENT_ENDED:I++,CDATA:I++,CDATA_ENDING:I++,CDATA_ENDING_2:I++,PROC_INST:I++,PROC_INST_BODY:I++,PROC_INST_ENDING:I++,OPEN_TAG:I++,OPEN_TAG_SLASH:I++,ATTRIB:I++,ATTRIB_NAME:I++,ATTRIB_NAME_SAW_WHITE:I++,ATTRIB_VALUE:I++,ATTRIB_VALUE_QUOTED:I++,ATTRIB_VALUE_CLOSED:I++,ATTRIB_VALUE_UNQUOTED:I++,ATTRIB_VALUE_ENTITY_Q:I++,ATTRIB_VALUE_ENTITY_U:I++,CLOSE_TAG:I++,CLOSE_TAG_SAW_WHITE:I++,SCRIPT:I++,SCRIPT_ENDING:I++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[w]]=w;function R(e,t,n){e[t]&&e[t](n)}function D(e,t,n){e.textNode&&C(e),R(e,t,n)}function C(e){e.textNode=M(e.opt,e.textNode),e.textNode&&R(e,"ontext",e.textNode),e.textNode=""}function M(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function L(e,t){return C(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,R(e,"onerror",t),e}function N(e){return e.sawRoot&&!e.closedRoot&&O(e,"Unclosed root tag"),e.state!==I.BEGIN&&e.state!==I.BEGIN_WHITESPACE&&e.state!==I.TEXT&&L(e,"Unexpected end"),C(e),e.c="",e.closed=!0,R(e,"onend"),a.call(e,e.strict,e.opt),e}function O(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&L(e,t)}function x(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,D(e,"onopentagstart",n)}function P(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function k(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=P(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==h)O(e,"xml: prefix must be bound to "+h+"\nActual: "+e.attribValue);else if("xmlns"===r&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)O(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,D(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function F(e,t){if(e.opt.xmlns){var n=e.tag,r=P(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(O(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){D(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],u=s[0],l=s[1],c=P(u,!0),d=c.prefix,f=c.local,h=""===d?"":n.ns[d]||"",p={name:u,value:l,prefix:d,local:f,uri:h};d&&"xmlns"!==d&&!h&&(O(e,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),e.tag.attributes[u]=p,D(e,"onattribute",p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),D(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=I.TEXT:e.state=I.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function U(e){if(!e.tagName)return O(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=I.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=I.SCRIPT);D(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){if(e.tags[t].name===r)break;O(e,"Unexpected close tag")}if(t<0)return O(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=I.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,D(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];D(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=I.TEXT}function B(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(O(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function G(e,t){"<"===t?(e.state=I.OPEN_WAKA,e.startTagPosition=e.position):_(u,t)&&(O(e,"Non-whitespace before first tag."),e.textNode=t,e.state=I.TEXT)}function j(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}I=t.STATE,String.fromCodePoint||(b=String.fromCharCode,S=Math.floor,A=function(){var e,t,n=16384,r=[],i=-1,a=arguments.length;if(!a)return"";for(var o="";++i<a;){var s=Number(arguments[i]);if(!isFinite(s)||s<0||s>1114111||S(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===a||r.length>n)&&(o+=b.apply(null,r),r.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(t)}).call(this,n(46).Buffer)},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=l(e),o=r[0],s=r[1],u=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),c=0,d=s>0?o-4:o;for(n=0;n<d;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o<s;o+=16383)a.push(c(e,o,o+16383>s?s:o+16383));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+d],d+=f,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=p,o/=256,l-=8);e[n+h-p]|=128*g}},function(e,t,n){e.exports=i;var r=n(47).EventEmitter;function i(){r.call(this)}n(21)(i,r),i.Readable=n(48),i.Writable=n(125),i.Duplex=n(126),i.Transform=n(127),i.PassThrough=n(128),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(38).Buffer,i=n(120);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,a=r.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,n=a,i=s,t.copy(n,i),s+=o.data.length,o=o.next;return a},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(122),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(14))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,u=1,l={},c=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){a.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},f.clearImmediate=h}function h(e){delete l[e]}function p(e){if(c)setTimeout(p,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(14),n(36))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(14))},function(e,t,n){"use strict";e.exports=a;var r=n(74),i=Object.create(n(28));function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}i.inherits=n(21),i.inherits(a,r),a.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(49)},function(e,t,n){e.exports=n(17)},function(e,t,n){e.exports=n(48).Transform},function(e,t,n){e.exports=n(48).PassThrough},function(e,t,n){!function(e,t,n){function r(e,t,s){var l;if("region"===s.kind)(l=document.createElement("div")).style.position="absolute";else if("body"===s.kind)l=document.createElement("div");else if("div"===s.kind)l=document.createElement("div");else if("image"===s.kind){if(l=document.createElement("img"),null!==e.imgResolver&&null!==s.src){var c=e.imgResolver(s.src,l);c&&(l.src=c),l.height=e.regionH,l.width=e.regionW}}else if("p"===s.kind)l=document.createElement("p");else if("span"===s.kind){if("container"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("ruby"),e.ruby=!0;else if("base"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rb");else if("text"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rt");else if("baseContainer"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rbc");else if("textContainer"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rtc");else{if("delimiter"===s.styleAttrs[n.byName.ruby.qname])return;l=document.createElement("span")}var d=s.styleAttrs[n.byName.textEmphasis.qname];d&&"none"!==d.style&&(e.textEmphasis=!0)}else"br"===s.kind&&(l=document.createElement("br"));if(l){for(var f in t.appendChild(l),l.style.margin="0",u){var h=u[f],p=s.styleAttrs[h.qname];void 0!==p&&null!==h.map&&h.map(e,l,s,p)}var g=l;if("region"===s.kind){var v=s.styleAttrs[n.byName.writingMode.qname];"lrtb"===v||"lr"===v?(e.ipd="lr",e.bpd="tb"):"rltb"===v||"rl"===v?(e.ipd="rl",e.bpd="tb"):"tblr"===v?(e.ipd="tb",e.bpd="lr"):"tbrl"!==v&&"tb"!==v||(e.ipd="tb",e.bpd="rl")}var m=s.styleAttrs[n.byName.linePadding.qname];if(m&&!m.isZero()){var y=m.toUsedLength(e.w,e.h);if(y>0){var E=Math.ceil(y)+"px";"tb"===e.bpd?(g.style.paddingLeft=E,g.style.paddingRight=E):(g.style.paddingTop=E,g.style.paddingBottom=E),e.lp=m}}var T=s.styleAttrs[n.byName.multiRowAlign.qname];if(T&&"auto"!==T){var _=document.createElement("span");_.style.display="inline-block",_.style.textAlign=T,l.appendChild(_),g=_,e.mra=T}var b=s.styleAttrs[n.byName.rubyReserve.qname];if(b&&"none"!==b[0]&&(e.rubyReserve=b),s.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===s.kind&&s.text)if(n.byName.textCombine.qname in s.styleAttrs&&"all"===s.styleAttrs[n.byName.textCombine.qname][0])l.textContent=s.text;else for(var S="",A=0;A<s.text.length;A++){S+=s.text.charAt(A);var I=s.text.charCodeAt(A);if(I<55296||I>56319||A===s.text.length){var w=document.createElement("span");w.textContent=S,l.appendChild(w),S=""}}for(var R in s.contents)r(e,g,s.contents[R]);var D=[];if((e.lp||e.mra||e.flg||e.ruby||e.textEmphasis||e.rubyReserve)&&"p"===s.kind&&(o(e,g,D,null),e.rubyReserve&&(!function(e,t){for(var n=0;n<e.length;n++){var r,i,a=document.createElement("ruby"),o=document.createElement("rb");o.textContent="",a.appendChild(o);var s=t.rubyReserve[1].toUsedLength(t.w,t.h)+"px";"both"===t.rubyReserve[0]?((r=document.createElement("rtc")).style.rubyPosition="under",r.textContent="",r.style.fontSize=s,(i=document.createElement("rtc")).style.rubyPosition="over",i.textContent="",i.style.fontSize=s,a.appendChild(r),a.appendChild(i)):((r=document.createElement("rtc")).textContent="",r.style.fontSize=s,"after"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&n>0?r.style.rubyPosition="tb"===t.bpd||"rl"===t.bpd?"under":"over":r.style.rubyPosition="tb"===t.bpd||"rl"===t.bpd?"over":"under",a.appendChild(r));e[n].elements[0].node.parentElement.insertBefore(a,e[n].elements[0].node)}}(D,e),e.rubyReserve=null),(e.ruby||e.rubyReserve)&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;if(!e[n].rbc[r].style.rubyPosition)i="tb"===t.bpd||"rl"===t.bpd?0===n?"over":"under":0===n?"under":"over",e[n].rbc[r].style.rubyPosition=i}}(D,e),e.ruby=null),e.textEmphasis&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;if(!e[n].te[r].style.textEmphasisPosition||"none"===e[n].te[r].style.textEmphasisPosition)i="tb"===t.bpd?0===n?"left over":"left under":"rl"===t.bpd?0===n?"right under":"left under":0===n?"left under":"right under",e[n].te[r].style.textEmphasisPosition=i}}(D,e),e.textEmphasis=null),e.mra&&(!function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(D),e.mra=null),e.lp&&(!function(e,t,n){for(var r in e){var i=e[r].elements.length,a=e[r].elements[e[r].start_elem],o=e[r].elements[e[r].end_elem],s=Math.ceil(t)+"px",u="-"+Math.ceil(t)+"px";0!==i&&("lr"===n.ipd?(a.node.style.borderLeftColor=a.bgcolor||"#00000000",a.node.style.borderLeftStyle="solid",a.node.style.borderLeftWidth=s,a.node.style.marginLeft=u):"rl"===n.ipd?(a.node.style.borderRightColor=a.bgcolor||"#00000000",a.node.style.borderRightStyle="solid",a.node.style.borderRightWidth=s,a.node.style.marginRight=u):"tb"===n.ipd&&(a.node.style.borderTopColor=a.bgcolor||"#00000000",a.node.style.borderTopStyle="solid",a.node.style.borderTopWidth=s,a.node.style.marginTop=u),"lr"===n.ipd?(o.node.style.borderRightColor=o.bgcolor||"#00000000",o.node.style.borderRightStyle="solid",o.node.style.borderRightWidth=s,o.node.style.marginRight=u):"rl"===n.ipd?(o.node.style.borderLeftColor=o.bgcolor||"#00000000",o.node.style.borderLeftStyle="solid",o.node.style.borderLeftWidth=s,o.node.style.marginLeft=u):"tb"===n.ipd&&(o.node.style.borderBottomColor=o.bgcolor||"#00000000",o.node.style.borderBottomStyle="solid",o.node.style.borderBottomWidth=s,o.node.style.marginBottom=u))}}(D,e.lp.toUsedLength(e.w,e.h),e),e.lp=null),e.flg)){var C=a(g.getBoundingClientRect(),e);!function(e,t,n,r){for(var i=Math.sign(n-t),a=0;a<=e.length;a++){var o,s,u;if(o=0===a?t:a===e.length?n:(e[a].before+e[a-1].after)/2,a>0)for(var l=0;l<e[a-1].elements.length;l++)null!==e[a-1].elements[l].bgcolor&&(u=e[a-1].elements[l],i*(u.after-o)<0&&(s=Math.ceil(Math.abs(o-u.after))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingRight=s:"rl"===r.bpd?u.node.style.paddingLeft=s:"tb"===r.bpd&&(u.node.style.paddingBottom=s)));if(a<e.length)for(var c=0;c<e[a].elements.length;c++)null!==(u=e[a].elements[c]).bgcolor&&i*(u.before-o)>0&&(s=Math.ceil(Math.abs(u.before-o))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingLeft=s:"rl"===r.bpd?u.node.style.paddingRight=s:"tb"===r.bpd&&(u.node.style.paddingTop=s))}}(D,C.before,C.after,e),e.flg=null}if("region"===s.kind&&(o(e,g,D),"tb"===e.bpd&&e.enableRollUp&&s.contents.length>0&&"after"===s.styleAttrs[n.byName.displayAlign.qname])){var M=new i(""===s.id?"_":s.id,D);if(e.currentISDState[M.id]=M,e.previousISDState&&M.id in e.previousISDState&&e.previousISDState[M.id].plist.length>0&&M.plist.length>1&&M.plist[M.plist.length-2].text===e.previousISDState[M.id].plist[e.previousISDState[M.id].plist.length-1].text){var L=l.firstElementChild,N=M.plist[M.plist.length-1].after-M.plist[M.plist.length-1].before;L.style.bottom="-"+N+"px",L.style.transition="transform 0.4s",L.style.position="relative",L.style.transform="translateY(-"+N+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+s.kind)}function i(e,t){this.id=e,this.plist=t}function a(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function o(e,t,n,r){if("rt"!==t.localName&&"rtc"!==t.localName){var i,s,u,l,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName||"rb"===t.localName){var d=t.getBoundingClientRect();if(0===d.height||0===d.width)return;var f=a(d,e);if(0!==n.length&&(i=f.before,s=f.after,u=n[n.length-1].before,l=n[n.length-1].after,s<l&&i>u||l<=s&&u>=i)){var h=Math.sign(f.after-f.before),p=Math.sign(f.end-f.start);h*(f.before-n[n.length-1].before)<0&&(n[n.length-1].before=f.before),h*(f.after-n[n.length-1].after)>0&&(n[n.length-1].after=f.after),p*(f.start-n[n.length-1].start)<0&&(n[n.length-1].start=f.start,n[n.length-1].start_elem=n[n.length-1].elements.length),p*(f.end-n[n.length-1].end)>0&&(n[n.length-1].end=f.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:f.before,after:f.after,start:f.start,end:f.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:f.before,after:f.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&(o(e,g,n,c),"ruby"===g.localName||"rtc"===g.localName?n.length>0&&n[n.length-1].rbc.push(g):"span"===g.localName&&g.style.textEmphasisStyle&&"none"!==g.style.textEmphasisStyle&&n.length>0&&n[n.length-1].te.push(g)),g=g.nextSibling}}function s(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,i,a,o,s,u,l){var c=i||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var f=c*e.aspectRatio;f>d?c=Math.round(d/e.aspectRatio):d=f}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var p={h:c,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:o||!1,isd:e,errorHandler:s,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};for(var g in t.appendChild(h),e.contents)r(p,h,e.contents[g]);return p.currentISDState};var u=[new s("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new s("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new s("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new s("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new s("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new s("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,a=0,o=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];o&&(i=o[0].toUsedLength(e.w,e.h)+o[2].toUsedLength(e.w,e.h),a=o[1].toUsedLength(e.w,e.h)+o[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new s("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){var i=[];for(var a in r)"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);t.style.fontFamily=i.join(",")})),new s("http://www.w3.org/ns/ttml#styling shear",(function(e,t,n,r){if(0!==r){var i=-.9*r;"tb"===e.bpd?t.style.transform="skewX("+i+"deg)":t.style.transform="skewY("+i+"deg)"}})),new s("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new s("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new s("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new s("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new s("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0].toUsedLength(e.w,e.h)+"px",i[1]=r[3].toUsedLength(e.w,e.h)+"px",i[2]=r[2].toUsedLength(e.w,e.h)+"px",i[3]=r[1].toUsedLength(e.w,e.h)+"px",t.style.padding=i.join(" ")})),new s("http://www.w3.org/ns/ttml#styling position",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling rubyAlign",(function(e,t,n,r){t.style.rubyAlign=r})),new s("http://www.w3.org/ns/ttml#styling rubyPosition",(function(e,t,n,r){var i;"before"!==r&&"after"!==r||(i="tb"===e.bpd||"rl"===e.bpd?"before"===r?"over":"under":"before"===r?"under":"over",t.parentElement.style.rubyPosition=i)})),new s("http://www.w3.org/ns/ttml#styling showBackground",null),new s("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,r,i){var a,o=r.styleAttrs[n.byName.direction.qname];a="start"===i?"rtl"===o?"right":"left":"end"===i?"rtl"===o?"left":"right":i,t.style.textAlign=a})),new s("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new s("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){})),new s("http://www.w3.org/ns/ttml#styling textShadow",(function(e,t,r,i){var a=r.styleAttrs[n.byName.textOutline.qname];if("none"===i&&"none"===a)t.style.textShadow="";else{var o=[];if("none"!==a&&o.push("rgba("+a.color[0].toString()+","+a.color[1].toString()+","+a.color[2].toString()+","+(a.color[3]/255).toString()+") 0px 0px "+a.thickness.toUsedLength(e.w,e.h)+"px"),"none"!==i)for(var s in i)o.push(i[s].x_off.toUsedLength(e.w,e.h)+"px "+i[s].y_off.toUsedLength(e.w,e.h)+"px "+i[s].b_radius.toUsedLength(e.w,e.h)+"px rgba("+i[s].color[0].toString()+","+i[s].color[1].toString()+","+i[s].color[2].toString()+","+(i[s].color[3]/255).toString()+")");t.style.textShadow=o.join(",")}})),new s("http://www.w3.org/ns/ttml#styling textCombine",(function(e,t,n,r){t.style.textCombineUpright=r.join(" ")})),new s("http://www.w3.org/ns/ttml#styling textEmphasis",(function(e,t,n,r){var i;"none"!==r.style?("auto"===r.style?t.style.textEmphasisStyle="filled":t.style.textEmphasisStyle=r.style+" "+r.symbol,("before"===r.position||"after"===r.position)&&(i="tb"===e.bpd?"before"===r.position?"left over":"left under":"rl"===e.bpd?"before"===r.position?"right under":"left under":"before"===r.position?"left under":"right under",t.style.textEmphasisPosition=i)):t.style.textEmphasisStyle="none"})),new s("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new s("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new s("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new s("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?e.writingMode="horizontal-tb":"tblr"===r?e.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(e.writingMode="vertical-rl"),t.style.writingMode=e.writingMode})),new s("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new s("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],l={};for(var c in u)l[u[c].qname]=u[c]}(t,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscStyles?n(45):imscStyles,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n){t+=e[n].uchar}return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function o(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,s,u,l){var c=null,d=!1,f=-1,h={start:s,end:u,spans:[]},p="style_cea608_white_black",g={},v={},m=[],y=void 0,E=void 0;for(y=0;y<15;++y){var T=l.rows[y],_="",b=null;if(!1===T.isEmpty()){var S=t(T.chars);null===c&&(c={x:S,y1:y,y2:y+1,p:[]}),S!==f&&d&&(c.p.push(h),h={start:s,end:u,spans:[]},c.y2=y,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===g.hasOwnProperty(c.name)?(m.push(c),g[c.name]=c):g[c.name].p.contat(c.p),c={x:S,y1:y,y2:y+1,p:[]});for(var A=0;A<T.chars.length;++A){var I=T.chars[A],w=I.penState;if(null===b||!w.equals(b)){_.trim().length>0&&(h.spans.push({name:p,line:_,row:y}),_="");var R="style_cea608_"+w.foreground+"_"+w.background;w.underline&&(R+="_underline"),w.italics&&(R+="_italics"),v.hasOwnProperty(R)||(v[R]=JSON.parse(JSON.stringify(w))),b=w,p=R}_+=I.uchar}_.trim().length>0&&h.spans.push({name:p,line:_,row:y}),d=!0,f=S}else d=!1,f=-1,c&&(c.p.push(h),h={start:s,end:u,spans:[]},c.y2=y,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===g.hasOwnProperty(c.name)?(m.push(c),g[c.name]=c):g[c.name].p.contat(c.p),c=null)}c&&(c.p.push(h),c.y2=y+1,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===g.hasOwnProperty(c.name)?(m.push(c),g[c.name]=c):g[c.name].p.contat(c.p),c=null);var D=[];for(y=0;y<m.length;++y){var C=m[y],M="sub_cea608_"+e++,L=document.createElement("div");L.id=M;var N=n(C);L.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+N;var O=document.createElement("div");O.className="paragraph bodyStyle",O.style.cssText=i(r);var x=document.createElement("div");x.className="cueUniWrapper",x.style.cssText="unicode-bidi: normal; direction: ltr;";for(var P=0;P<C.p.length;++P){var k=C.p[P],F=0;for(E=0;E<k.spans.length;++E){var U=k.spans[E];if(U.line.length>0){if(0!==E&&F!=U.row){var B=document.createElement("br");B.className="lineBreak",x.appendChild(B)}var G=!1;F===U.row&&(G=!0),F=U.row;var j=v[U.name],H=document.createElement("span");H.className="spanPadding "+U.name+" customSpanColor",H.style.cssText=i(r,j),0!==E&&G?E===k.spans.length-1?H.textContent=o(U.line):H.textContent=U.line:k.spans.length>1&&E<k.spans.length-1&&U.row===k.spans[E+1].row?H.textContent=a(U.line):H.textContent=U.line.trim(),x.appendChild(H)}}}O.appendChild(x),L.appendChild(O);var K={bodyStyle:["%",90]};for(var V in v)v.hasOwnProperty(V)&&(K[V]=["%",90]);D.push({type:"html",start:s,end:u,cueHTMLElement:L,cueID:M,cellResolution:[32,15],isFromCEA608:!0,fontSize:K,lineHeight:{},linePadding:{}})}return D}}}o.__dashjs_factory_name="EmbeddedTextHtmlRender",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=this.context,t=void 0,n=void 0,r=void 0,a=void 0,o=void 0,s=void 0;function u(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function l(e){var t=e.split(a),n=t[1].split(s);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:c(n)}}function c(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function d(e,t){for(var n,r=t,i="",o="";""!==e[r]&&r<e.length;)r++;if((n=r-t)>1)for(var s=0;s<n;s++){if((o=e[t+s]).match(a)){i="";break}i+=o,s!==n-1&&(i+="\n")}else(o=e[t]).match(a)||(i=o);return i}return t={parse:function(e){var t,i=[],s=void 0;if(!e)return i;t=(e=e.split(r)).length,s=-1;for(var c=0;c<t;c++){var f=e[c];if(f.length>0&&"WEBVTT"!==f&&f.match(a)){var h=l(f),p=h.cuePoints,g=h.styles,v=d(e,c+1),m=u(p[0].replace(o,"")),y=u(p[1].replace(o,""));!isNaN(m)&&!isNaN(y)&&m>=s&&y>m?""!==v?(s=m,i.push({start:m,end:y,data:v,styles:g})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return i}},n=(0,i.default)(e).getInstance().getLogger(t),r=/(?:\r\n|\r|\n)/gm,a=/-->/,o=/(^[\s]+|[\s]+$)/g,s=/\s\b/g,t}o.__dashjs_factory_name="VTTParser",t.default=r.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(0)),i=c(n(2)),a=c(n(3)),o=c(n(4)),s=n(69),u=c(n(20)),l=c(n(76));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=(0,a.default)(e).getInstance(),n=void 0,r=void 0,c=0;return n={parse:function(e,n,i,a,d){var f="",h=[],p=void 0,g=void 0,v=void 0,m={},y={},E="",T="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(t.trigger(u.default.CONFORMANCE_VIOLATION,{level:l.default.LEVELS.ERROR,event:l.default.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void r.warn("smpte-tt imageType != PNG. Discarded");E=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){E&&(y[E]=T.trim()),T="",E=""},onText:function(e){E&&(T+=e)}};if(!e)throw f="no ttml data to parse",new Error(f);m.data=e,t.trigger(o.default.TTML_TO_PARSE,m);var b=(0,s.fromXML)(m.data,(function(e){f=e}),_);t.trigger(o.default.TTML_PARSED,{ttmlString:m.data,ttmlDoc:b});var S,A=b.getMediaTimeEvents();for(v=0;v<A.length;v++){var I=(0,s.generateISD)(b,A[v],(function(e){f=e}));I.contents.some((function(e){return e.contents.length}))&&(p=A[v]+n<i?i:A[v]+n)<(g=A[v+1]+n>a?a:A[v+1]+n)&&h.push({start:p,end:g,type:"html",cueID:(S=void 0,S="cue_TTML_"+c,c++,S),isd:I,images:d,embeddedImages:y})}if(""!==f)throw r.error(f),new Error(f);return h}},r=(0,i.default)(e).getInstance().getLogger(n),n}d.__dashjs_factory_name="TTMLParser",t.default=r.default.getSingletonFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(2)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=this.context,n=void 0,i=void 0,a=void 0,o=[],s=e;function u(e,t){o=o.filter((function(n){return!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))}))}return n={getAllBufferRanges:function(){for(var e=[],t=0;t<o.length;t++){var n=o[t];0===e.length||n.start>e[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}var r={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(r,"length",{get:function(){return e.length}}),r},append:function(e){"InitializationSegment"!==e.segmentType?(o.push(e),o.sort((function(e,t){return e.start-t.start})),a=null):a=e,i.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),s&&s({chunk:e})},remove:u,abort:function(){},discharge:function(e,t){var n=function(e,t){return o.filter((function(n){return(isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)}))}(e,t);return a&&(n.push(a),a=null),u(e,t),n},reset:function(){o=[],a=null,s=null},updateTimestampOffset:function(){},hasDiscontinuitiesAfter:function(){return!1},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},i=(0,r.default)(t).getInstance().getLogger(n),n}o.__dashjs_factory_name="PreBufferSink";var s=i.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(0)),i=u(n(2)),a=u(n(12)),o=u(n(1)),s=u(n(10));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t=this.context,n=e.dashMetrics,r=void 0,u=void 0;return r={getMaxIndex:function(e){var r=(0,a.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(o.default.MISSING_CONFIG_ERROR)}();var i=e.getMediaInfo(),l=e.getMediaType(),c=n.getCurrentBufferState(l),d=e.getScheduleController(),f=e.getAbrController(),h=e.getStreamInfo(),p=h&&h.manifestInfo?h.manifestInfo.isDynamic:null,g=f.getThroughputHistory(),v=g.getSafeAverageThroughput(l,p),m=g.getAverageLatency(l),y=e.useBufferOccupancyABR();return isNaN(v)||!c||y||f.getAbandonmentStateFor(l)!==s.default.ABANDON_LOAD&&(c.state===s.default.BUFFER_LOADED||p)&&(r.quality=f.getQualityForBitrate(i,v,m),d.setTimeToLoadDelay(0),u.debug("["+l+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(v),"kbps"),r.reason={throughput:v,latency:m}),r},reset:function(){}},u=(0,i.default)(t).getInstance().getLogger(r),r}l.__dashjs_factory_name="ThroughputRule",t.default=r.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(3)),i=c(n(4)),a=c(n(0)),o=c(n(2)),s=c(n(12)),u=c(n(1)),l=c(n(10));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=(0,r.default)(t).getInstance(),a=e.dashMetrics,c=void 0,d=void 0,f=void 0;function h(){(f={})[u.default.VIDEO]={ignoreCount:2},f[u.default.AUDIO]={ignoreCount:2}}function p(){h()}function g(e){isNaN(e.startTime)||e.mediaType!==u.default.AUDIO&&e.mediaType!==u.default.VIDEO||f[e.mediaType].ignoreCount>0&&f[e.mediaType].ignoreCount--}return c={getMaxIndex:function(e){var n=(0,s.default)(t).create();if(!e||!e.hasOwnProperty("getMediaType"))return n;!function(){if(!a||!a.hasOwnProperty("getCurrentBufferLevel")||!a.hasOwnProperty("getCurrentBufferState"))throw new Error(u.default.MISSING_CONFIG_ERROR)}();var r=e.getMediaType(),i=a.getCurrentBufferState(r),o=e.getRepresentationInfo().fragmentDuration;if(function(e){return f[e].ignoreCount>0}(r)||!o)return n;if(i&&i.state===l.default.BUFFER_EMPTY)d.debug("["+r+"] Switch to index 0; buffer is empty."),n.quality=0,n.reason="InsufficientBufferRule: Buffer is empty";else{var c=e.getMediaInfo(),h=e.getAbrController(),p=h.getThroughputHistory(),g=a.getCurrentBufferLevel(r),v=p.getAverageThroughput(r),m=p.getAverageLatency(r),y=v*(g/o)*.5;n.quality=h.getQualityForBitrate(c,y,m),n.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return n},reset:function(){h(),n.off(i.default.PLAYBACK_SEEKING,p,c),n.off(i.default.BYTES_APPENDED_END_FRAGMENT,g,c)}},d=(0,o.default)(t).getInstance().getLogger(c),h(),n.on(i.default.PLAYBACK_SEEKING,p,c),n.on(i.default.BYTES_APPENDED_END_FRAGMENT,g,c),c}d.__dashjs_factory_name="InsufficientBufferRule",t.default=a.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(12)),i=o(n(0)),a=o(n(2));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,i=e.dashMetrics,o=e.settings,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0;function h(){c={},d={},f=[]}return u={shouldAbandon:function(e){var a=(0,r.default)(t).create(r.default.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return a;var u,h,p=e.getMediaInfo(),g=e.getMediaType(),v=e.getCurrentRequest();if(!isNaN(v.index)){u=g,h=v.index,c[u]=c[u]||{},c[u][h]=c[u][h]||{};var m=n.getStableBufferTime();if(i.getCurrentBufferLevel(g)>m)return a;var y=c[g][v.index];if(null===y||null===v.firstByteDate||d.hasOwnProperty(y.id))return a;if(void 0===y.firstByteTime&&(f[g]=[],y.firstByteTime=v.firstByteDate.getTime(),y.segmentDuration=v.duration,y.bytesTotal=v.bytesTotal,y.id=v.index),y.bytesLoaded=v.bytesLoaded,y.elapsedTime=(new Date).getTime()-y.firstByteTime,y.bytesLoaded>0&&y.elapsedTime>0&&function(e,t){f[e]=f[e]||[],f[e].push(t)}(g,Math.round(8*y.bytesLoaded/y.elapsedTime)),f[g].length>=5&&y.elapsedTime>500&&y.bytesLoaded<y.bytesTotal){var E=f[g].reduce((function(e,t){return e+t}),0);if(y.measuredBandwidthInKbps=Math.round(E/f[g].length),y.estimatedTimeOfDownload=+(8*y.bytesTotal/y.measuredBandwidthInKbps/1e3).toFixed(2),y.estimatedTimeOfDownload<1.8*y.segmentDuration||0===e.getRepresentationInfo().quality)return a;if(!d.hasOwnProperty(y.id)){var T=e.getAbrController(),_=y.bytesTotal-y.bytesLoaded,b=T.getBitrateList(p),S=T.getQualityForBitrate(p,y.measuredBandwidthInKbps*o.get().streaming.abr.bandwidthSafetyFactor),A=T.getMinAllowedIndexFor(g),I=void 0!==A?Math.max(A,S):S;_>y.bytesTotal*b[I].bitrate/b[T.getQualityFor(g)].bitrate&&(a.quality=I,a.reason.throughput=y.measuredBandwidthInKbps,a.reason.fragmentID=y.id,d[y.id]=y,l.debug("["+g+"] frag id",y.id," is asking to abandon and switch to quality to ",I," measured bandwidth was",y.measuredBandwidthInKbps),delete c[g][y.id])}}else y.bytesLoaded===y.bytesTotal&&delete c[g][y.id]}return a},reset:h},l=(0,a.default)(t).getInstance().getLogger(u),h(),u}s.__dashjs_factory_name="AbandonRequestsRule",t.default=i.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(12)),a=o(n(2));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){var r=(0,i.default)(e).create();if(!t||!t.hasOwnProperty("getDroppedFramesHistory"))return r;var a=t.getDroppedFramesHistory();if(a){for(var o=a.getFrameHistory(),s=0,u=0,l=i.default.NO_CHANGE,c=1;c<o.length;c++)if(o[c]&&(s=o[c].droppedVideoFrames,(u=o[c].totalVideoFrames)>375&&s/u>.15)){l=c-1,n.debug("index: "+l+" Dropped Frames: "+s+" Total Frames: "+u);break}return(0,i.default)(e).create(l,{droppedFrames:s})}return r}},n=(0,a.default)(e).getInstance().getLogger(t),t}s.__dashjs_factory_name="DroppedFramesRule",t.default=r.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(2)),a=o(n(12));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){for(var r=t?t.getSwitchHistory():null,i=r?r.getSwitchRequests():[],o=0,s=0,u=0,l=(0,a.default)(e).create(),c=0;c<i.length;c++)if(void 0!==i[c]&&(o+=i[c].drops,s+=i[c].noDrops,u+=i[c].dropSize,o+s>=6&&o/s>.075)){l.quality=c>0&&i[c].drops>0?c-1:c,l.reason={index:l.quality,drops:o,noDrops:s,dropSize:u},n.debug("Switch history rule index: "+l.quality+" samples: "+(o+s)+" drops: "+o);break}return l}},n=(0,i.default)(e).getInstance().getLogger(t),t}s.__dashjs_factory_name="SwitchHistoryRule",t.default=r.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(10)),i=c(n(12)),a=c(n(0)),o=n(8),s=c(n(3)),u=c(n(4)),l=c(n(2));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.dashMetrics,a=e.mediaPlayerModel,c=(0,s.default)(t).getInstance(),d=void 0,f=void 0,h=void 0;function p(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,10+2*t.length),a=(n[r]-1)/(i/10-1);return{gp:a,Vp:10/a}}function g(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=a.getStableBufferTime(),o=p(i,n,r);return o?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=o.Vp,t.gp=o.gp,t.lastQuality=0,v(t)):t.state=0,t}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(e,t){var r=a.getStableBufferTime();if(e.stableBufferTime!==r){var i=p(r,e.bitrates,e.utilities);if(i.Vp!==e.Vp||i.gp!==e.gp){var o=n.getCurrentBufferLevel(t),s=o+e.placeholderBuffer;s-=10,s*=i.Vp/e.Vp,s+=10,e.stableBufferTime=r,e.Vp=i.Vp,e.gp=i.gp,e.placeholderBuffer=Math.max(0,s-o)}}}function y(e,t){return e.Vp*(e.utilities[t]+e.gp)}function E(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var o=e.bitrates[a],s=e.utilities[a],u=e.Vp*(e.gp+(n*s-o*r)/(n-o));i=Math.max(i,u)}return i}function T(){for(var e in h)h.hasOwnProperty(e)&&2===h[e].state&&(h[e].placeholderBuffer=0)}function _(){for(var e in h)if(h.hasOwnProperty(e)){var t=h[e];0!==t.state&&(t.state=1,v(t))}}function b(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=h[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,A(t,e.chunk.mediaInfo.type)}}}function S(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===o.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=h[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),A(t,e.mediaType))}}function A(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var r=n.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=y(e,e.lastQuality),a=Math.max(0,i-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function I(e){if(e){var t=h[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function w(e){if(e){var t=h[e.mediaType];if(t&&0!==t.state){var r=n.getCurrentBufferLevel(e.mediaType),i=void 0;i=t.abrQuality>0?E(t,t.abrQuality):10;var a=Math.max(0,i-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function R(){h={}}return d={getMaxIndex:function(e){var r=(0,i.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return r;var a=e.getMediaInfo(),o=e.getMediaType(),s=e.getScheduleController(),u=e.getStreamInfo(),l=e.getAbrController(),c=l.getThroughputHistory(),d=u?u.id:null,p=u&&u.manifestInfo&&u.manifestInfo.isDynamic,T=e.useBufferOccupancyABR();if(r.reason=r.reason||{},!T)return r;s.setTimeToLoadDelay(0);var _=function(e){var t=e.getMediaType(),n=h[t];return n?0!==n.state&&m(n,t):(n=g(e),h[t]=n),n}(e);if(0===_.state)return r;var b=n.getCurrentBufferLevel(o),S=c.getAverageThroughput(o,p),A=c.getSafeAverageThroughput(o,p),I=c.getAverageLatency(o),w=void 0;if(r.reason.state=_.state,r.reason.throughput=S,r.reason.latency=I,isNaN(S))return r;switch(_.state){case 1:w=l.getQualityForBitrate(a,A,I),r.quality=w,r.reason.throughput=A,_.placeholderBuffer=Math.max(0,E(_,w)-b),_.lastQuality=w,!isNaN(_.lastSegmentDurationS)&&b>=_.lastSegmentDurationS&&(_.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,m(e,t)}(_,o),w=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var o=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||o>=i)&&(i=o,r=a)}return r}(_,b+_.placeholderBuffer);var R=l.getQualityForBitrate(a,A,I);w>_.lastQuality&&w>R&&(w=Math.max(R,_.lastQuality));var D=Math.max(0,b+_.placeholderBuffer-y(_,w));D<=_.placeholderBuffer?(_.placeholderBuffer-=D,D=0):(D-=_.placeholderBuffer,_.placeholderBuffer=0,w<l.getTopQualityIndexFor(o,d)?s.setTimeToLoadDelay(1e3*D):D=0),r.quality=w,r.reason.throughput=S,r.reason.latency=I,r.reason.bufferLevel=b,r.reason.placeholderBuffer=_.placeholderBuffer,r.reason.delay=D,_.lastQuality=w;break;default:f.debug("BOLA ABR rule invoked in bad state."),r.quality=l.getQualityForBitrate(a,A,I),r.reason.state=_.state,r.reason.throughput=A,r.reason.latency=I,_.state=1,v(_)}return r},reset:function(){R(),c.off(u.default.BUFFER_EMPTY,T,d),c.off(u.default.PLAYBACK_SEEKING,_,d),c.off(u.default.MEDIA_FRAGMENT_LOADED,b,d),c.off(u.default.METRIC_ADDED,S,d),c.off(u.default.QUALITY_CHANGE_REQUESTED,I,d),c.off(u.default.FRAGMENT_LOADING_ABANDONED,w,d)}},f=(0,l.default)(t).getInstance().getLogger(d),R(),c.on(u.default.BUFFER_EMPTY,T,d),c.on(u.default.PLAYBACK_SEEKING,_,d),c.on(u.default.MEDIA_FRAGMENT_LOADED,b,d),c.on(u.default.METRIC_ADDED,S,d),c.on(u.default.QUALITY_CHANGE_REQUESTED,I,d),c.on(u.default.FRAGMENT_LOADING_ABANDONED,w,d),d}d.__dashjs_factory_name="BolaRule",t.default=a.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(10)),i=d(n(12)),a=d(n(0)),o=n(8),s=d(n(3)),u=d(n(4)),l=d(n(2)),c=d(n(1));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t=this.context,n=e.dashMetrics,a=(0,s.default)(t).getInstance(),d=void 0,f=void 0,h=void 0,p=void 0;function g(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){if(!e||!e.type)return;h[e.type]={},h[e.type].w=[],h[e.type].prev_w=[],h[e.type].Q=0,h[e.type].segment_request_start_s=0,h[e.type].segment_download_finish_s=0,h[e.type].B_target=1.5}(n),v(t),t}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(){for(var e in f)if(f.hasOwnProperty(e)){var t=f[e];0!==t.state&&(t.state=1,v(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=f[e.chunk.mediaInfo.type],n=h[e.chunk.mediaInfo.type];if(t&&0!==t.state){var r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,T(t,n)}}}function E(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===o.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=f[e.mediaType],n=h[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),T(t,n))}}function T(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function _(e){if(e&&e.mediaType){var t=f[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function b(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function S(){f={},h={}}return d={getMaxIndex:function(e){var r=(0,i.default)(t).create(),a=Math.pow(4,.99),o=Math.max(Math.pow(4,1),a*Math.sqrt(4)),s=e.getMediaInfo(),u=e.getMediaType(),l=s.bitrateList.map((function(e){return e.bandwidth})),d=l.length,m=e.getScheduleController(),y=e.getStreamInfo(),E=e.getAbrController(),T=E.getThroughputHistory(),_=y&&y.manifestInfo&&y.manifestInfo.isDynamic,S=e.useL2AABR(),A=n.getCurrentBufferLevel(u,!0),I=T.getSafeAverageThroughput(u,_),w=T.getAverageThroughput(u,_),R=T.getAverageLatency(u),D=void 0,C=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!S||u===c.default.AUDIO)return r;m.setTimeToLoadDelay(0);var M=function(e){var t=e.getMediaType(),n=f[t];return n||(n=g(e),f[t]=n),n}(e);if(0===M.state)return r;var L=h[u];if(!L)return r;if(r.reason.state=M.state,r.reason.throughput=w,r.reason.latency=R,isNaN(w))return r;switch(M.state){case 1:if(D=E.getQualityForBitrate(s,I,R),r.quality=D,r.reason.throughput=I,M.lastQuality=D,!isNaN(M.lastSegmentDurationS)&&A>=L.B_target){M.state=2,L.Q=a;for(var N=0;N<d;++N)N===M.lastQuality?L.prev_w[N]=1:L.prev_w[N]=0}break;case 2:var O=[],x=n.getCurrentHttpRequest(u).trace.reduce((function(e,t){return e+t.d}),0),P=n.getCurrentHttpRequest(u).trace.reduce((function(e,t){return e+t.b[0]}),0),k=Math.round(8*P/x);k<1&&(k=1);for(var F=M.lastSegmentDurationS,U=1,B=0;B<d;++B)l[B]=l[B]/1e3,C*l[B]>k&&(U=-1),L.w[B]=L.prev_w[B]+U*(F/(2*o))*((L.Q+a)*(C*l[B]/k));L.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),o=0,s=0,u=[],l=0;l<t-1;++l)if((s=((o+=a[l])-1)/(l+1))>=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var c=0;c<t;++c)u[c]=Math.max(r[c]-s,0);return u}(L.w);for(var G=0;G<d;++G)O[G]=L.w[G]-L.prev_w[G],L.prev_w[G]=L.w[G];L.Q=Math.max(0,L.Q-F+F*C*((b(l,L.prev_w)+b(l,O))/k));for(var j=[],H=0;H<d;++H)j[H]=Math.abs(l[H]-b(L.w,l));(D=j.indexOf(Math.min.apply(Math,j)))>M.lastQuality&&l[M.lastQuality+1]<=k&&(D=M.lastQuality+1),l[D]>=k&&(L.Q=2*Math.max(a,L.Q)),r.quality=D,r.reason.throughput=w,r.reason.latency=R,r.reason.bufferLevel=A,M.lastQuality=r.quality;break;default:p.debug("L2A ABR rule invoked in bad state."),r.quality=E.getQualityForBitrate(s,I,R),r.reason.state=M.state,r.reason.throughput=I,r.reason.latency=R,M.state=1,v(M)}return r},reset:function(){S(),a.off(u.default.PLAYBACK_SEEKING,m,d),a.off(u.default.MEDIA_FRAGMENT_LOADED,y,d),a.off(u.default.METRIC_ADDED,E,d),a.off(u.default.QUALITY_CHANGE_REQUESTED,_,d)}},p=(0,l.default)(t).getInstance().getLogger(d),S(),a.on(u.default.PLAYBACK_SEEKING,m,d),a.on(u.default.MEDIA_FRAGMENT_LOADED,y,d),a.on(u.default.METRIC_ADDED,E,d),a.on(u.default.QUALITY_CHANGE_REQUESTED,_,d),d}f.__dashjs_factory_name="L2ARule",t.default=a.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(2)),i=d(n(0)),a=d(n(142)),o=d(n(143)),s=d(n(12)),u=d(n(10)),l=d(n(145)),c=d(n(1));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=(e=e||{}).dashMetrics,n=this.context,i=void 0,d=void 0,f=void 0,h=void 0;return d={getMaxIndex:function(e){try{var r=(0,s.default)(n).create(),a=e.getMediaInfo().type,o=e.getAbrController(),d=e.getStreamInfo(),p=o.getQualityFor(a,d),g=e.getMediaInfo(),v=t.getCurrentBufferState(a),m=e.getScheduleController(),y=t.getCurrentBufferLevel(a,!0),E=d&&d.manifestInfo?d.manifestInfo.isDynamic:null,T=m.getPlaybackController(),_=T.getCurrentLiveLatency();if(!e.useLoLPABR()||a===c.default.AUDIO)return r;_||(_=0);var b=T.getPlaybackRate(),S=o.getThroughputHistory().getSafeAverageThroughput(a,E);if(i.debug("Throughput "+Math.round(S)+" kbps"),isNaN(S)||!v)return r;if(o.getAbandonmentStateFor(a)===u.default.ABANDON_LOAD)return r;for(var A=g.bitrateList,I=e.getRepresentationInfo().fragmentDuration,w=A[0].bandwidth/1e3,R=A[A.length-1].bandwidth/1e3,D=0;D<A.length;D++){var C=A[D].bandwidth/1e3;C>R?R=C:C<w&&(w=C)}var M=A[p].bandwidth/1e3,L=t.getCurrentHttpRequest(a,!0),N=(L.tresponse.getTime()-L.trequest.getTime())/1e3,O=N>I?N-I:0;h.setupPerSegmentQoe(I,R,w),h.logSegmentMetrics(M,O,_,b);var x=(0,l.default)(n).create({targetLatency:1.5,bufferMin:.3,segmentDuration:I,qoeEvaluator:h});return r.quality=f.getNextQuality(g,1e3*S,_,y,b,p,x),r.reason={throughput:S,latency:_},r.priority=s.default.PRIORITY.STRONG,m.setTimeToLoadDelay(0),r.quality!==p&&console.log("[TgcLearningRule]["+a+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(S),"kbps"),r}catch(e){throw e}},reset:function(){f.reset(),h.reset()}},i=(0,r.default)(n).getInstance().getLogger(d),f=(0,a.default)(n).create(),h=(0,o.default)(n).create(),d}f.__dashjs_factory_name="LoLPRule",t.default=i.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}var o="manual_weight_selection",s="random_weight_selection",u="dynamic_weight_selection";function l(){var e=this.context,t=void 0,n=void 0,r=void 0,a=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0;function p(){r=null,a=1,l=100,c=0,null,d=null,f=null,h=u}function g(){var e=0;if(r)for(var t=0;t<r.length;t++){var n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function v(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function m(e,t){return v([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function y(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=m(i,e);E(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function E(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}function T(e,t,n,r,i,a,o){d||(d=f[f.length-1]);var s=e.findWeightVector(t,n,r,i,a,o);null!==s&&-1!==s&&(d=s)}return t={getNextQuality:function(e,t,i,p,m,E,_){var b=i,S=p,A=t,I=function(e){if(!r){r=[];var t=e.bitrateList,n=[];c=t[0].bandwidth,t.forEach((function(e){n.push(e.bandwidth),e.bandwidth<c&&(c=e.bandwidth)})),s=n.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),a=Math.sqrt(s);for(var i=0;i<t.length;i++){var o={qualityIndex:i,bitrate:t[i].bandwidth,state:{throughput:t[i].bandwidth/a,latency:0,rebuffer:0,switch:0}};r.push(o),o.bitrate===c&&o}f=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*g(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,o=null,s=0;s<n.length;s++){for(var u=n[s],l=null,c=0;c<t.length;c++){var d=v(u,t[c],r);(null===l||d<l)&&(l=d)}(null===o||l>o)&&(a=u,o=l)}t.push(a)}for(var f=null,h=null,p=0;p<t.length;p++){for(var m=0,y=0;y<t.length;y++)p!==y&&(m+=v(t[p],t[y],r));(null===f||m>f)&&(f=m,h=p)}var E=[];E.push(t[h]),t.splice(h,1);for(;t.length>0;){for(var T=null,_=null,b=0;b<t.length;b++){var S=v(E[0],t[b],r);(null===T||S<T)&&(T=S,_=b)}E.push(t[_]),t.splice(_,1)}return E}(r)}var s;return r}(e),w=t/a;w>1&&(w=g()),i/=l,n.debug("getNextQuality called throughput:"+w+" latency:"+i+" bufferSize:"+p+" currentQualityIndex:"+E+" playbackRate:"+m);var R=I[E],D=R.bitrate*_.getSegmentDuration()/A,C=Math.max(0,D-S);if(S-D<_.getMinBuffer())return n.debug("Buffer is low for bitrate= "+R.bitrate+" downloadTime="+D+" currentBuffer="+S+" rebuffer="+C),function(e,t){var n=0,i=e;if(r)for(var a=0;a<r.length;a++){var o=r[a];o.bitrate<e.bitrate&&o.bitrate>n&&t>o.bitrate&&(n=o.bitrate,i=o)}return i}(R,A).qualityIndex;switch(h){case o:d=[.4,.4,.4,.4];break;case s:!function(e){d=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<t;i++)n.push(Math.random()*r);return d=n}(e.length,4)}(I);break;case u:T(_,I,b,S,C,A,m);break;default:T(_,I,b,S,C,A,m)}for(var M=null,L=null,N=null,O=0;O<I.length;O++){var x=I[O],P=x.state,k=[P.throughput,P.latency,P.rebuffer,P.switch],F=d.slice(),U=_.getNextBufferWithBitrate(x.bitrate,S,A),B=U<_.getMinBuffer();B&&n.debug("Buffer is low for bitrate="+x.bitrate+" downloadTime="+D+" currentBuffer="+S+" nextBuffer="+U),(x.bitrate>t-1e4||B)&&x.bitrate!==c&&(F[0]=100);var G=v(k,[w,0,0,0],F);(null===M||G<M)&&(M=G,L=x.qualityIndex,N=x,F)}var j=Math.abs(R.bitrate-N.bitrate)/a;return y(R,I,[w,i,C,j]),y(N,I,[w,0,0,j]),L},reset:function(){p()}},n=(0,i.default)(e).getInstance().getLogger(t),p(),t}l.__dashjs_factory_name="LearningAbrController",t.default=r.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(144));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e,t=void 0,n=void 0,r=void 0,a=void 0;function o(){t=null,n=null,r=null,a=null}function s(e,t,n,r){var a=new i.default;return a.type=e,a.weights.bitrateReward=t||1,a.weights.bitrateSwitchPenalty=1,a.weights.rebufferPenalty=n||1e3,a.weights.latencyPenalty=[],a.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),a.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),a.weights.playbackSpeedPenalty=r||200,a}function u(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a<i.weights.latencyPenalty.length;a++){var o=i.weights.latencyPenalty[a];if(n<=o.threshold){i.latencyWSum+=o.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,i,o){t=s("segment",e,i,o),n=e,r=i,a=o},logSegmentMetrics:function(e,n,r,i){t&&u(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,i,o){var l=null;return n&&r&&a&&(l=s("segment",n,r,a)),l?(u(e,t,i,o,l),l.totalQoe):0},reset:function(){o()}},o(),e}o.__dashjs_factory_name="LoLpQoeEvaluator",t.default=r.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t,n,r,i=e.targetLatency,a=e.bufferMin,o=e.segmentDuration,s=e.qoeEvaluator,u=void 0,l=void 0;function c(){return o}function d(e,t){var n=c();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return a},getSegmentDuration:c,getNextBufferWithBitrate:function(e,t,n){return d(t,e*o/n)},getNextBuffer:d,findWeightVector:function(e,t,n,r,c,f){var h=null,p=null,g=null,v=Math.abs(t-l);return e.forEach((function(e){u.forEach((function(r){r[0];var u=r[1],l=r[2],m=(r[3],e.bitrate*o/c),y=d(n,m),E=(0===l?10:1/l)*Math.max(1e-5,m-y),T=(0===u?10:1/u)*e.state.latency,_=s.calculateSingleUseQoe(e.bitrate,E,T,f);(null===h||_>h)&&function(e,t,n){if(e>i+n)return!1;return t>=a}(t,y,v)&&(h=_,p=r,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),l=t,p}},n=[.2,.4,.6,.8,1],r=4,u=function e(t,r,i){if(i===r)return t;for(var a=t.length,o=0;o<a;o++)for(var s=t.shift(),u=0;u<n.length;u++)t.push(s.concat(n[u]));return e(t,r,i+1)}(n.map((function(e){return[e]})),r,1),l=0,t}o.__dashjs_factory_name="LoLpWeightSelector",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,o=e.useL2AABR,s=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function d(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return o},useLoLPABR:function(){return s},getVideoModel:function(){return c}}}o.__dashjs_factory_name="RulesContext",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(12));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=[],t=[];return{push:function(n){n.newValue===i.default.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,a=r<0?1:0,o=a?-r:0,s=a?0:1;if(e[n.oldValue].drops+=a,e[n.oldValue].dropSize+=o,e[n.oldValue].noDrops+=s,t.push({idx:n.oldValue,noDrop:s,drop:a,dropSize:o}),t.length>8){var u=t.shift();e[u.idx].drops-=u.drop,e[u.idx].dropSize-=u.dropSize,e[u.idx].noDrops-=u.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}o.__dashjs_factory_name="SwitchRequestHistory";var s=r.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e=[],t=0,n=0;return{push:function(r,i){var a=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,o=i&&i.totalVideoFrames?i.totalVideoFrames:0,s=a-t;t=a;var u=o-n;n=o,isNaN(r)||(e[r]?(e[r].droppedVideoFrames+=s,e[r].totalVideoFrames+=u):e[r]={droppedVideoFrames:s,totalVideoFrames:u})},getFrameHistory:function(){return e},reset:function(r){e=[],t=r.droppedVideoFrames,n=r.totalVideoFrames}}}o.__dashjs_factory_name="DroppedFramesHistory";var s=a.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(1)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).settings,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0;function u(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function l(e,u,l){return t.get().streaming.abr.movingAverageMethod!==r.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?s.throughputHalfLife:s.latencyHalfLife,r=e?a[t]:o[t];if(!r||r.totalWeight<=0)return NaN;var i=r.fastEstimate/(1-Math.pow(.5,r.totalWeight/n.fast)),u=r.slowEstimate/(1-Math.pow(.5,r.totalWeight/n.slow));return e?Math.min(i,u):Math.max(i,u)}(e,u):function(e,t,r){var a=function(e,t,r){var a=void 0,o=void 0;if(e?(a=n[t],o=r?3:4):(a=i[t],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s<o;++s){var u=a[a.length-s]/a[a.length-s-1];if((u>=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,t,r),o=(e?n:i)[t];if(0===a||!o||0===o.length)return NaN;return(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length}(e,u,l)}function c(e,t){return l(!0,e,t)}function d(e){n[e]=n[e]||[],i[e]=i[e]||[],a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},o[e]=o[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function f(){n={},i={},a={},o={}}var h={push:function(e,l,c){if(l.trace&&l.trace.length){var f=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,p=l.trace.reduce((function(e,t){return e+t.b[0]}),0),g=void 0;g=t.get().streaming.lowLatencyEnabled?l.trace.reduce((function(e,t){return e+t.d}),0):c?h:f+h;var v=Math.round(8*p/g);if(d(e),function(e,n,i){return e===r.default.VIDEO?i<t.get().streaming.cacheLoadThresholds[r.default.VIDEO]:e===r.default.AUDIO?i<t.get().streaming.cacheLoadThresholds[r.default.AUDIO]:void 0}(e,0,h)){if(n[e].length>0&&!n[e].hasCachedEntries)return;n[e].hasCachedEntries=!0}else n[e]&&n[e].hasCachedEntries&&function(e){delete n[e],delete i[e],delete a[e],delete o[e],d(e)}(e);n[e].push(v),n[e].length>20&&n[e].shift(),i[e].push(f),i[e].length>20&&i[e].shift(),u(a[e],v,.001*h,s.throughputHalfLife),u(o[e],f,1,s.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,n){var r=c(e,n);return isNaN(r)||(r*=t.get().streaming.abr.bandwidthSafetyFactor),r},getAverageLatency:function(e){return l(!1,e)},reset:f};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},f(),h}o.__dashjs_factory_name="ThroughputHistory",t.default=i.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(1)),i=s(n(0)),a=s(n(66)),o=s(n(151));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){e=e||{};var t,n=this.context,i=void 0;function s(){return i.getBuffer()}return t={getBufferControllerType:function(){return i.getBufferControllerType()},initialize:function(e,t){return i.initialize(e,t)},createBuffer:function(e,t){return i.createBuffer(e,t)},getType:function(){return i.getType()},getBuffer:s,setBuffer:function(e){i.setBuffer(e)},getBufferLevel:function(){return i.getBufferLevel()},setMediaSource:function(e){i.setMediaSource(e)},getMediaSource:function(){return i.getMediaSource()},getIsBufferingCompleted:function(){return i.getIsBufferingCompleted()},getIsPruningInProgress:function(){return i.getIsPruningInProgress()},dischargePreBuffer:function(){return i.dischargePreBuffer()},appendInitSegment:function(e){i.appendInitSegment(e)},getRangeAt:function(e){return i.getRangeAt(e)},reset:function(e){i.reset(e)},updateTimestampOffset:function(e){var t=s();t.timestampOffset===e||isNaN(e)||(t.timestampOffset=e)},updateAppendWindow:function(){i.updateAppendWindow()},getRepresentationInfo:function(e){return i.getRepresentationInfo(e)}},i=e.type===r.default.FRAGMENTED_TEXT?(0,a.default)(n).create({streamInfo:e.streamInfo,type:e.type,mediaPlayerModel:e.mediaPlayerModel,manifestModel:e.manifestModel,fragmentModel:e.fragmentModel,errHandler:e.errHandler,mediaController:e.mediaController,representationController:e.representationController,adapter:e.adapter,textController:e.textController,abrController:e.abrController,playbackController:e.playbackController,settings:e.settings}):(0,o.default)(n).create({streamInfo:e.streamInfo,type:e.type,mimeType:e.mimeType,fragmentModel:e.fragmentModel,errHandler:e.errHandler}),t}u.__dashjs_factory_name="TextBufferController",t.default=i.default.getClassFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(1)),i=f(n(3)),a=f(n(4)),o=f(n(0)),s=f(n(51)),u=f(n(67)),l=f(n(42)),c=f(n(6)),d=f(n(11));function f(e){return e&&e.__esModule?e:{default:e}}function h(e){e=e||{};var t=this.context,n=(0,i.default)(t).getInstance(),o=(0,l.default)(t).getInstance(),f=e.errHandler,h=e.streamInfo,p=e.type,g=e.mimeType,v=e.fragmentModel,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0;function S(e){T=e}function A(e){null===b.extract(h.id,e.currentRepresentation.id)&&(y=!1,n.trigger(a.default.INIT_FRAGMENT_NEEDED,{representationId:e.currentRepresentation.id,sender:m},{streamId:h.id,mediaType:p}))}function I(e){e.chunk.bytes&&(b.save(e.chunk),_.append(e.chunk),y=!0,n.trigger(a.default.STREAM_COMPLETED,{request:e.request},{streamId:h.id,mediaType:p}))}return m={getBufferControllerType:function(){return"NotFragmentedTextBufferController"},initialize:function(e){S(e),b=(0,s.default)(t).getInstance()},createBuffer:function(e){var n=e[0];try{if(_=(0,u.default)(t).create(T,n),!E){var i=_.getBuffer();i.hasOwnProperty(r.default.INITIALIZE)&&i.initialize(g,h,e,v),E=!0}return _}catch(e){if(n&&(n.isText||-1!==n.codec.indexOf('codecs="stpp')||-1!==n.codec.indexOf('codecs="wvtt')))try{_=o.getTextSourceBuffer()}catch(e){f.error(new c.default(d.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,d.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p+" : "+e.message))}else f.error(new c.default(d.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,d.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p))}},getStreamId:function(){return h.id},getType:function(){return p},getBuffer:function(){return _},getBufferLevel:function(){return 0},setMediaSource:S,getMediaSource:function(){return T},getIsBufferingCompleted:function(){return y},getIsPruningInProgress:function(){return!1},dischargePreBuffer:function(){},appendInitSegment:function(e){return null!==b.extract(h.id,e)},getRangeAt:function(){return null},reset:function(e){n.off(a.default.DATA_UPDATE_COMPLETED,A,m),n.off(a.default.INIT_FRAGMENT_LOADED,I,m),!e&&_&&(_.abort(),_.reset(),_=null)},updateTimestampOffset:function(e){_.timestampOffset===e||isNaN(e)||(_.timestampOffset=e)}},E=!1,T=null,y=!1,n.on(a.default.DATA_UPDATE_COMPLETED,A,m),n.on(a.default.INIT_FRAGMENT_LOADED,I,m),m}h.__dashjs_factory_name="NotFragmentedTextBufferController",t.default=o.default.getClassFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(1)),i=d(n(10)),a=d(n(153)),o=d(n(26)),s=d(n(3)),u=d(n(4)),l=d(n(0)),c=d(n(2));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t=this.context,n=(0,s.default)(t).getInstance(),l=e.adapter,d=e.dashMetrics,f=e.mediaPlayerModel,h=e.fragmentModel,p=e.abrController,g=e.playbackController,v=e.textController,m=e.type,y=e.mimeType,E=e.mediaController,T=e.bufferController,_=e.settings,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0;function K(){return!1===R}function V(){S&&(K()||I&&!T.getIsBufferingCompleted()&&(A.debug("Schedule Controller starts"),R=!1,d.createPlaylistTraceMetrics(I.id,1e3*g.getTime(),g.getPlaybackRate()),w&&(w=!1),W(0)))}function q(){R||(A.debug("Schedule Controller stops"),A.debug(m+" Schedule Controller stops"),R=!0,clearTimeout(M))}function Y(){if(S)if(R||D||g.isPaused()&&!_.get().streaming.scheduleWhilePaused||(m===r.default.FRAGMENTED_TEXT||m===r.default.TEXT)&&!v.isTextEnabled()||T.getIsBufferingCompleted())q();else{!function(){if(!isNaN(L))return;if(!k)return;var e=g.getTime(),t=1.5;if(isNaN(k.fragmentDuration)){var n=d.getCurrentSchedulingInfo(I.mediaInfo.type);t=n?1.5*n.duration:1.5}var a=h.getRequests({state:o.default.FRAGMENT_MODEL_EXECUTED,time:e+t,threshold:0})[0];if(a&&-1===F.indexOf(a)&&!l.getIsTextTrack(y)){var s=_.get().streaming.fastSwitchEnabled,u=T.getBufferLevel(),c=p.getAbandonmentStateFor(m),f=!E.isCurrentTrack(a.mediaInfo)&&E.getSwitchMode(a.mediaInfo.type)===r.default.TRACK_SWITCH_MODE_NEVER_REPLACE,v=a.quality<k.quality;s&&(f||v)&&u>=t&&c!==i.default.ABANDON_LOAD?(X(a),H=!0,A.debug("Reloading outdated fragment at index: ",a.index)):a.quality>k.quality&&!B&&ce(g.getTime()+u)}}();var e=F.length>0,t=k?k.quality:NaN;if(B||isNaN(t)||U||e||function(e,t){P[t]=P[t]||{};var n=p.getTopQualityIndexFor(e,t);return P[t][e]!=n&&(A.info("Top quality "+e+" index has changed from "+P[t][e]+" to "+n),P[t][e]=n,!0)}(m,S.id)||O.execute(m,I,N)){z(!0),!e&&j&&p.checkPlaybackQuality(m),function(){if(I.quality===t&&!U||B){var e=F.shift();e&&e.isInitializationRequest()?(n.trigger(u.default.INIT_FRAGMENT_NEEDED,{representationId:e.representationId,sender:b},{streamId:S.id,mediaType:m}),j=!1):(n.trigger(u.default.MEDIA_FRAGMENT_NEEDED,{seekTarget:L,replacement:e},{streamId:S.id,mediaType:m}),j=!0)}else U?(A.debug("Switch track for "+m+", representation id = "+I.id),(B=E.getSwitchMode(m)===r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE)&&T.replaceBuffer&&T.replaceBuffer(),U=!1):A.debug("Quality has changed, get init request for representationid = "+I.id),n.trigger(u.default.INIT_FRAGMENT_NEEDED,{representationId:I.id,sender:b},{streamId:S.id,mediaType:m}),j=!1}()}else W(500)}}function W(e){clearTimeout(M),M=setTimeout(Y,e)}function z(e){D!==e?D=e:A.debug("isFragmentProcessingInProgress is already equal to",e)}function X(e){F.push(e)}function Q(e){if(g&&h){var t=h.getRequests({state:o.default.FRAGMENT_MODEL_EXECUTED,time:g.getTime(),threshold:0})[0];t&&g.getTime()>=t.startTime&&((!x.mediaInfo||t.mediaInfo.type===x.mediaInfo.type&&t.mediaInfo.id!==x.mediaInfo.id)&&e&&n.trigger(u.default.TRACK_CHANGE_RENDERED,{mediaType:m,oldMediaInfo:x.mediaInfo,newMediaInfo:t.mediaInfo}),t.quality===x.quality&&t.adaptationIndex===x.adaptationIndex||!e||n.trigger(u.default.QUALITY_CHANGE_RENDERED,{mediaType:m,oldQuality:x.quality,newQuality:t.quality}),x={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function J(){q(),z(!1),A.info("Stream "+S.id+" is complete")}function Z(e){e.request.mediaInfo.streamInfo.id===S.id&&e.request.mediaType===m&&(A.info("OnFragmentLoadingCompleted - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),l.getIsTextTrack(y)&&z(!1),e.error&&e.request.serviceLocation&&!R&&(X(e.request),z(!1),W(0)),B&&(G=e.request))}function $(){Q(!0)}function ee(e){if(B&&!isNaN(e.startTime)&&(B=!1,h.addExecutedRequest(G)),z(!1),isNaN(e.index)&&(k=T.getRepresentationInfo(e.quality),A.info("["+m+"] lastInitializedRepresentationInfo changed to "+e.quality)),H&&!isNaN(e.startTime)){var t=g.getTime(),n=e.startTime+I.fragmentDuration,r=1.5*I.fragmentDuration;W(t+r>=n?0:1e3*(n-(t+r))),H=!1}else W(0)}function te(e){A.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),g.isSeeking()||U||(A.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),X(e.request)),z(!1),W(0)}function ne(){}function re(){q()}function ie(e){B&&_.get().streaming.flushBufferAtTrackSwitch&&g.seek(g.getTime()+.001,!1,!0),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&V()}function ae(){q(),z(!1)}function oe(){h.abortRequests(),q()}function se(){!R&&_.get().streaming.scheduleWhilePaused||V()}function ue(e){if(S){ce(e.seekTime),de(0),R&&V();var t=I&&I.DVRWindow&&g?I.DVRWindow.end-g.getTime():NaN;d.updateManifestUpdateInfo({latency:t}),D?h.abortRequests():W(0)}}function le(e){d.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function ce(e){L=e}function de(e){C=e}function fe(){j=!0,D=!1,C=0,L=NaN,w=!0,k=void 0,x={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},P={},F=[],R=!0,U=!1,B=!1,G=null,H=!1}return b={initialize:function(e){N=e,O=(0,a.default)(t).create({abrController:p,dashMetrics:d,mediaPlayerModel:f,textController:v,settings:_}),n.on(u.default.DATA_UPDATE_STARTED,ne,this),n.on(u.default.FRAGMENT_LOADING_COMPLETED,Z,this),n.on(u.default.STREAM_COMPLETED,J,this),n.on(u.default.BUFFER_CLEARED,ie,this),n.on(u.default.BYTES_APPENDED_END_FRAGMENT,ee,this),n.on(u.default.QUOTA_EXCEEDED,ae,this),n.on(u.default.PLAYBACK_SEEKING,ue,this),n.on(u.default.PLAYBACK_STARTED,se,this),n.on(u.default.PLAYBACK_RATE_CHANGED,le,this),n.on(u.default.PLAYBACK_TIME_UPDATED,$,this),n.on(u.default.URL_RESOLUTION_FAILED,oe,this),n.on(u.default.FRAGMENT_LOADING_ABANDONED,te,this),n.on(u.default.BUFFERING_COMPLETED,re,this)},getType:function(){return m},getStreamId:function(){return S.id},setCurrentRepresentation:function(e){I=e},setSeekTarget:ce,setTimeToLoadDelay:de,getTimeToLoadDelay:function(){return C},switchTrackAsked:function(){U=!0},isStarted:K,start:V,stop:q,reset:function(){n.off(u.default.DATA_UPDATE_STARTED,ne,this),n.off(u.default.FRAGMENT_LOADING_COMPLETED,Z,this),n.off(u.default.STREAM_COMPLETED,J,this),n.off(u.default.BUFFER_CLEARED,ie,this),n.off(u.default.BYTES_APPENDED_END_FRAGMENT,ee,this),n.off(u.default.QUOTA_EXCEEDED,ae,this),n.off(u.default.PLAYBACK_SEEKING,ue,this),n.off(u.default.PLAYBACK_STARTED,se,this),n.off(u.default.PLAYBACK_RATE_CHANGED,le,this),n.off(u.default.PLAYBACK_TIME_UPDATED,$,this),n.off(u.default.URL_RESOLUTION_FAILED,oe,this),n.off(u.default.FRAGMENT_LOADING_ABANDONED,te,this),n.off(u.default.BUFFERING_COMPLETED,re,this),q(),Q(!1),fe(),S=null},getBufferTarget:function(){return O.getBufferTarget(m,I,N)},processInitRequest:function(e){e&&(z(!0),h.executeRequest(e))},processMediaRequest:function(e){e?(A.debug("Next fragment request url is "+e.url),h.executeRequest(e)):(g.getIsDynamic()&&A.debug("Next fragment seems to be at the bleeding live edge and is not available yet. Rescheduling."),z(!1),W(_.get().streaming.lowLatencyEnabled?100:500))},getPlaybackController:function(){return g}},A=(0,c.default)(t).getInstance().getLogger(b),fe(),S=e.streamInfo,b}f.__dashjs_factory_name="ScheduleController",t.default=l.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(1)),i=o(n(0)),a=o(n(10));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=(e=e||{}).dashMetrics,n=e.mediaPlayerModel,i=e.textController,o=e.abrController,s=e.settings;function u(e,u,l){var c=NaN;if(!e||!u)return c;if(e===r.default.FRAGMENTED_TEXT)if(i.isTextEnabled())if(isNaN(u.fragmentDuration)){var d=t.getCurrentSchedulingInfo(a.default.SCHEDULING_INFO);c=d?d.duration:0}else c=u.fragmentDuration;else c=0;else if(e===r.default.AUDIO&&l){var f=t.getCurrentBufferLevel(r.default.VIDEO);c=isNaN(u.fragmentDuration)?f:Math.max(f,u.fragmentDuration)}else{var h=u.mediaInfo.streamInfo;if(o.isPlayingAtTopQuality(h))c=h.manifestInfo.duration>=s.get().streaming.longFormContentDurationThreshold?s.get().streaming.bufferTimeAtTopQualityLongForm:s.get().streaming.bufferTimeAtTopQuality;else c=n.getStableBufferTime()}return c}return{execute:function(e,n,r){return!e||!n||t.getCurrentBufferLevel(e)<u(e,n,r)},getBufferTarget:u}}s.__dashjs_factory_name="BufferLevelRule",t.default=i.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(1)),i=o(n(6)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=(e=e||{}).eventBus,n=e.events,a=e.errors,o=e.abrController,s=e.dashMetrics,u=e.playbackController,l=e.timelineConverter,c=e.type,d=e.streamInfo,f=e.dashConstants,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0;function y(){return c}function E(){if(!(o&&s&&u&&l))throw new Error(r.default.MISSING_CONFIG_ERROR)}function T(){return g}function _(){return m}function b(){p=null,g=!0,v=[]}function S(){E();var e=new Date,t=_(),n=1e3*u.getTime();t&&s.addRepresentationSwitch(t.adaptation.type,e,n,t.id)}function A(e){return null==e||e>=v.length?null:v[e]}function I(e,t){var n;(e.segmentAvailabilityRange=l.calcSegmentAvailabilityRange(e,t),e.segmentAvailabilityRange.end<e.segmentAvailabilityRange.start)?D(new i.default(a.SEGMENTS_UNAVAILABLE_ERROR_CODE,a.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE,{availabilityDelay:e.segmentAvailabilityRange.start-e.segmentAvailabilityRange.end})):t&&(n=e.segmentAvailabilityRange.end,l.setExpectedLiveEdge(n),s.updateManifestUpdateInfo({presentationStartTime:n}))}function w(e,r){E();for(var i=0,a=v.length;i<a;i++)I(v[i],e),r&&t.trigger(n.REPRESENTATION_UPDATE_STARTED,{representation:v[i]},{streamId:d.id,mediaType:c})}function R(){g=!0,t.trigger(n.DATA_UPDATE_STARTED,{},{streamId:d.id,mediaType:c})}function D(e){g=!1,t.trigger(n.DATA_UPDATE_COMPLETED,{data:p,currentRepresentation:m,error:e},{streamId:d.id,mediaType:c})}function C(e){var r=e;t.trigger(n.AST_IN_FUTURE,{delay:r}),setTimeout((function(){T()||(R(),v.forEach((function(e){e.segmentAvailabilityRange=null})),w(u.getIsDynamic(),!0))}),r)}function M(e){if(T())if(e.error)D(e.error);else{var t,n=e.representation,r=s.getCurrentManifestUpdate(),l=!1,c=0,h=void 0;if(n.adaptation.period.mpd.manifest.type===f.DYNAMIC&&!n.adaptation.period.mpd.manifest.ignorePostponeTimePeriod&&u.getStreamController().getStreams().length<=1&&(c=function(e){try{var t=u.getStreamController().getActiveStreamInfo(),n=e.segmentAvailabilityRange.start;t&&t.id&&t.id!==d.id&&(n=Math.min(u.getTime(),n));var r=e.segmentAvailabilityRange.end-n;return 1e3*(u.getLiveDelay()-r)}catch(e){return 0}}(n)),c>0)return C(c),void D(new i.default(a.SEGMENTS_UPDATE_FAILED_ERROR_CODE,a.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE));if(r){for(var p=0;p<r.representationInfo.length;p++)if((h=r.representationInfo[p]).index===n.index&&h.mediaType===y()){l=!0;break}l||s.addManifestUpdateRepresentationInfo(n,y())}(function(){for(var e=0,t=v.length;e<t;e++){var n=v[e].segmentInfoType;if(null===v[e].segmentAvailabilityRange||!v[e].hasInitialization()||(n===f.SEGMENT_BASE||n===f.BASE_URL)&&!v[e].segments)return!1}return!0})()&&(o.setPlaybackQuality(y(),d,(t=m,v.indexOf(t))),s.updateManifestUpdateInfo({latency:m.segmentAvailabilityRange.end-u.getTime()}),s.getCurrentRepresentationSwitch(_().adaptation.type)||S(),D())}}function L(e){e.isDynamic&&w(e.isDynamic)}function N(e){m=A(e.newQuality),S()}function O(e){if(e.newDuration){var t=_();if(t&&t.adaptation.period)t.adaptation.period.duration=e.newDuration}}return h={getStreamId:function(){return d.id},getType:y,getData:function(){return p},isUpdating:T,updateData:function(e,t,n,i){E(),R(),v=t,m=A(i),p=e,n===r.default.VIDEO||n===r.default.AUDIO||n===r.default.FRAGMENTED_TEXT?w(u.getIsDynamic(),!0):D()},updateRepresentation:I,getCurrentRepresentation:_,getRepresentationForQuality:A,reset:function(){t.off(n.QUALITY_CHANGE_REQUESTED,N,h),t.off(n.REPRESENTATION_UPDATE_COMPLETED,M,h),t.off(n.WALLCLOCK_TIME_UPDATED,L,h),t.off(n.MANIFEST_VALIDITY_CHANGED,O,h),b()}},b(),t.on(n.QUALITY_CHANGE_REQUESTED,N,h),t.on(n.REPRESENTATION_UPDATE_COMPLETED,M,h),t.on(n.WALLCLOCK_TIME_UPDATED,L,h),t.on(n.MANIFEST_VALIDITY_CHANGED,O,h),h}s.__dashjs_factory_name="RepresentationController",t.default=a.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).timelineConverter;return{getLiveEdge:function(e){return function(){if(!t||!t.hasOwnProperty("getExpectedLiveEdge"))throw new Error(i.default.MISSING_CONFIG_ERROR)}(),e.DVRWindow?e.DVRWindow.end:0},reset:function(){t=null}}}o.__dashjs_factory_name="LiveEdgeFinder",t.default=r.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(0)),i=u(n(157)),a=u(n(158)),o=u(n(159)),s=u(n(160));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t,n=this.context,r=e.events,u=e.eventBus,l=e.dashConstants,c=e.streamInfo,d=e.type,f=void 0;function h(e){return e?e.segments?f[l.SEGMENT_BASE]:f[e.segmentInfoType]:null}return t={initialize:function(t){f[l.SEGMENT_TIMELINE]=(0,i.default)(n).create(e,t),f[l.SEGMENT_TEMPLATE]=(0,a.default)(n).create(e,t),f[l.SEGMENT_LIST]=(0,o.default)(n).create(e,t),f[l.SEGMENT_BASE]=(0,s.default)(n).create(e,t)},update:function(e,t,n,i){n||u.trigger(r.SEGMENTBASE_INIT_REQUEST_NEEDED,{streamId:c.id,mediaType:d,mimeType:t,representation:e}),i||u.trigger(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:c.id,mediaType:d,mimeType:t,representation:e})},getSegmentByIndex:function(e,t,n){var r=h(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=h(e);return n?n.getSegmentByTime(e,t):null}},f={},t}l.__dashjs_factory_name="SegmentsController";var c=r.default.getClassFactory(l);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1)),a=n(22);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcMediaTimeFromPresentationTime")||!n.hasOwnProperty("calcSegmentAvailabilityRange"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,r){var i,a,o,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,u=s.SegmentTimeline,l=s.SegmentURL_asArray,c=0,d=0,f=-1,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0;o=e.timescale;var E=!1;for(p=0,a=(i=u.S_asArray).length;p<a&&!E;p++){if(v=0,(h=i[p]).hasOwnProperty("r")&&(v=h.r),h.hasOwnProperty("t")&&(d=(c=h.t)/o),v<0){if((y=i[p+1])&&y.hasOwnProperty("t"))m=y.t/o;else{var T=e.segmentAvailabilityRange?e.segmentAvailabilityRange.end:n.calcSegmentAvailabilityRange(e,t).end;m=n.calcMediaTimeFromPresentationTime(T,e),e.segmentDuration=h.d/o}v=Math.ceil((m-d)/(h.d/o))-1}for(g=0;g<=v&&!E;g++)(E=r(c,d,s,l,h,o,++f,p))&&(e.segmentDuration=h.d/o,(g<v-1||p<a-1)&&f++),d=(c+=h.d)/o}e.availableSegmentsNumber=f}return{getSegmentByIndex:function(e,i,s){if(r(),!e)return null;var u=null,l=!1;return o(e,(function(r,i,o,c,d,f,h,p){if(l||s<0){var g=o.media,v=d.mediaRange;return c&&(g=c[p].media||"",v=c[p].mediaRange),u=(0,a.getTimeBasedSegment)(n,t,e,r,d.d,f,g,v,h,d.tManifest),!0}return i>=s-.5*d.d/f&&(l=!0),!1})),u},getSegmentByTime:function(e,i){if(r(),!e)return null;void 0===i&&(i=null);var s=null,u=n.calcMediaTimeFromPresentationTime(i,e);return o(e,(function(r,i,o,l,c,d,f,h){if(u<i+c.d/d){var p=o.media,g=c.mediaRange;return l&&(p=l[h].media||"",g=l[h].mediaRange),s=(0,a.getTimeBasedSegment)(n,t,e,r,c.d,d,p,g,f,c.tManifest),!0}return!1})),s}}}s.__dashjs_factory_name="TimelineSegmentsGetter";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1)),a=n(22);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;i=Math.max(i,0);var s=(0,a.getIndexBasedSegment)(n,t,e,i);if(s){s.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var u=o.media;u=(0,a.replaceTokenForTemplate)(u,"Number",s.replacementNumber),u=(0,a.replaceTokenForTemplate)(u,"Time",s.replacementTime),s.media=u}var l=e.segmentDuration,c=e.segmentAvailabilityRange;return isNaN(l)?e.availableSegmentsNumber=1:e.availableSegmentsNumber=Math.ceil((c.end-c.start)/l),s}return{getSegmentByIndex:o,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(a/i))}}}s.__dashjs_factory_name="TemplateSegmentsGetter";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1)),a=n(22);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,s=o.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(i-l,0),d=null;if(c<s){var f=o.SegmentURL_asArray[c];(d=(0,a.getIndexBasedSegment)(n,t,e,i))&&(d.replacementTime=(u+i-1)*e.segmentDuration,d.media=f.media?f.media:"",d.mediaRange=f.mediaRange,d.index=i,d.indexRange=f.indexRange)}return e.availableSegmentsNumber=s,d}return{getSegmentByIndex:o,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(a/i))}}}s.__dashjs_factory_name="ListSegmentsGetter";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r=e.segments?e.segments.length:-1,i=void 0;if(t<r&&(i=e.segments[t])&&i.availabilityIdx===t)return i;for(var a=0;a<r;a++)if((i=e.segments[a])&&i.availabilityIdx===t)return i;return null}return{getSegmentByIndex:r,getSegmentByTime:function(e,t){return n(),r(e,function(e,t){if(!e)return-1;var n=e.segments,r=n?n.length:null,i=-1,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;if(n&&r>0)for(l=0;l<r;l++)if(o=n[l],s=o.presentationStartTime,u=o.duration,t+(a=u/2)>=s&&t-a<s+u){i=o.availabilityIdx;break}return i}(e,t))}}}o.__dashjs_factory_name="SegmentBaseGetter";var s=r.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e=void 0,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},o=function(e,t){var n=s;if(!t)return e;if(!c(e))return e;d(e)&&(n=u),f(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function s(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y");e=a}catch(e){}finally{e=e||o}}(),{parseBaseUrl:s,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}o.__dashjs_factory_name="DefaultURLUtils",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(1)),i=h(n(163)),a=h(n(26)),o=h(n(164)),s=h(n(53)),u=h(n(3)),l=h(n(4)),c=h(n(11)),d=h(n(0)),f=h(n(2));function h(e){return e&&e.__esModule?e:{default:e}}function p(e){e=e||{};var t=this.context,n=(0,u.default)(t).getInstance(),d=e.errHandler,h=e.mediaPlayerModel,p=e.dashMetrics,g=(0,f.default)(t).getInstance(),v=e.streamInfo,m=void 0,y=void 0,E=void 0;function T(){for(var e in E)E[e].reset();E={}}function _(e){if(e.sender){var t=e.request,a=e.response,o=t.isInitializationRequest(),s=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType!==r.default.AUDIO&&t.mediaType!==r.default.VIDEO&&t.mediaType!==r.default.FRAGMENTED_TEXT||n.trigger(l.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation})),a&&s){var u=function(e,t,n,r){var a=new i.default;return a.streamId=n,a.mediaInfo=t.mediaInfo,a.segmentType=t.type,a.start=t.startTime,a.duration=t.duration,a.end=a.start+a.duration,a.bytes=e,a.index=t.index,a.quality=t.quality,a.representationId=t.representationId,a.endFragment=r,a}(a,t,v.id,e.type!==l.default.FRAGMENT_LOADING_PROGRESS);n.trigger(o?l.default.INIT_FRAGMENT_LOADED:l.default.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:s.id,mediaType:t.mediaType})}else y.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return m={getStreamId:function(){return v.id},getModel:function(r){var i=E[r];return i||(i=(0,a.default)(t).create({streamInfo:v,type:r,dashMetrics:p,fragmentLoader:(0,o.default)(t).create({dashMetrics:p,mediaPlayerModel:h,errHandler:d,requestModifier:(0,s.default)(t).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:n,events:l.default,errors:c.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils}),debug:g,eventBus:n,events:l.default}),E[r]=i),i},reset:function(){n.off(l.default.FRAGMENT_LOADING_COMPLETED,_,this),n.off(l.default.FRAGMENT_LOADING_PROGRESS,_,this),T()}},y=g.getLogger(m),T(),n.on(l.default.FRAGMENT_LOADING_COMPLETED,_,m),n.on(l.default.FRAGMENT_LOADING_PROGRESS,_,m),m}p.__dashjs_factory_name="FragmentController",t.default=d.default.getClassFactory(p)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(1)),i=u(n(29)),a=u(n(174)),o=u(n(6)),s=u(n(0));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t=this.context,n=e.eventBus,s=e.events,u=e.urlUtils,l=e.errors,c=void 0,d=void 0;return c={checkForExistence:function(e){var t=function(t){n.trigger(s.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new a.default(e.url);d.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var t=function(t,r){n.trigger(s.LOADING_COMPLETED,{request:e,response:t||null,error:r||null,sender:c})};e?d.load({request:e,progress:function(t){n.trigger(s.LOADING_PROGRESS,{request:e,stream:t.stream}),t.data&&n.trigger(s.LOADING_DATA_PROGRESS,{request:e,response:t.data||null,error:null,sender:c})},success:function(e){t(e)},error:function(e,n,r){t(void 0,new o.default(l.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,n))},abort:function(e){e&&n.trigger(s.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:c})}}):t(void 0,new o.default(l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){d&&d.abort()},reset:function(){d&&(d.abort(),d=null)}},d=(0,i.default)(t).create({errHandler:e.errHandler,errors:l,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:u,constants:r.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),c}l.__dashjs_factory_name="FragmentLoader",t.default=s.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=g(n(55)),i=g(n(166)),a=n(8),o=g(n(0)),s=g(n(6)),u=g(n(82)),l=g(n(30)),c=g(n(2)),d=g(n(3)),f=g(n(4)),h=g(n(23)),p=g(n(1));function g(e){return e&&e.__esModule?e:{default:e}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){e=e||{};var t,n=this.context,o=e.errHandler,g=e.dashMetrics,m=e.mediaPlayerModel,y=e.requestModifier,E=e.boxParser,T=e.useFetch||!1,_=e.errors,b=e.requestTimeout||0,S=(0,d.default)(n).getInstance(),A=(0,h.default)(n).getInstance(),I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0;function N(e,t){var u=e.request,c=[],d=!0,h=!0,v=new Date,_=v,I=0,O=void 0;if(!y||!g||!o)throw new Error("config object is not correct or missing");var x=function(e){h=!1,u.requestStartDate=v,u.requestEndDate=new Date,u.firstByteDate=u.firstByteDate||v,u.checkExistenceOnly||(g.addHttpRequest(u,O.response?O.response.responseURL:null,O.response?O.response.status:null,O.response&&O.response.getAllResponseHeaders?O.response.getAllResponseHeaders():O.response?O.response.responseHeaders:[],e?c:null),u.type===a.HTTPRequest.MPD_TYPE&&g.addManifestUpdate(u))},P=function(){if(-1!==w.indexOf(O)&&(w.splice(w.indexOf(O),1),h))if(x(!1),t>0){try{if(A.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&u.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE)m.getRetryAttemptsForType(a.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&S.trigger(f.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var n={config:e};D.push(n),n.timeout=setTimeout((function(){-1!==D.indexOf(n)&&(D.splice(D.indexOf(n),1),N(e,t))}),m.getRetryIntervalsForType(u.type))}else{if(u.type===a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;o.error(new s.default(C[u.type],u.url+" is not available",{request:u,response:O.response})),e.error&&e.error(u,"error",O.response.statusText),e.complete&&e.complete(u,O.response.statusText)}},k=void 0;k=T&&window.fetch&&"arraybuffer"===u.responseType&&u.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE?(0,i.default)(n).create({requestModifier:y,boxParser:E}):(0,r.default)(n).create({requestModifier:y});var F=null,U=y.modifyRequestURL(u.url);if(A.get().streaming.cmcd&&A.get().streaming.cmcd.enabled){var B=A.get().streaming.cmcd.mode;if(B===p.default.CMCD_MODE_QUERY){var G=function(e){try{var t=[],n=M.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(u);U=l.default.addAditionalQueryParameterToUrl(U,G)}else B===p.default.CMCD_MODE_HEADER&&(F=M.getHeaderParameters(u))}var j=u.checkExistenceOnly?a.HTTPRequest.HEAD:a.HTTPRequest.GET,H=m.getXHRWithCredentialsForType(u.type);O={url:U,method:j,withCredentials:H,request:u,onload:function(){O.response.status>=200&&O.response.status<=299&&(x(!0),e.success&&e.success(O.response.response,O.response.statusText,O.response.responseURL),e.complete&&e.complete(u,O.response.statusText))},onend:P,onerror:P,progress:function(t){var n=new Date;d&&(d=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(u.firstByteDate=n)),t.lengthComputable&&(u.bytesLoaded=t.loaded,u.bytesTotal=t.total),t.noTrace||(c.push({s:_,d:t.time?t.time:n.getTime()-_.getTime(),b:[t.loaded?t.loaded-I:0]}),_=n,I=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(u)},ontimeout:function(e){var t=void 0;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";L.warn(t)},loader:k,timeout:b,headers:F};var K=(new Date).getTime();if(isNaN(u.delayLoadingTime)||K>=u.delayLoadingTime)w.push(O),k.load(O);else{var V={httpRequest:O};R.push(V),V.delayTimeout=setTimeout((function(){if(-1!==R.indexOf(V)){R.splice(R.indexOf(V),1);try{v=new Date,_=v,w.push(V.httpRequest),k.load(V.httpRequest)}catch(e){V.httpRequest.onerror()}}}),u.delayLoadingTime-K)}}return I={load:function(e){e.request?N(e,m.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){D.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),D=[],R.forEach((function(e){return clearTimeout(e.delayTimeout)})),R=[],w.forEach((function(e){e.request.type!==a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),w=[]}},L=(0,c.default)(n).getInstance().getLogger(I),w=[],R=[],D=[],M=(0,u.default)(n).getInstance(),v(t={},a.HTTPRequest.MPD_TYPE,_.DOWNLOAD_ERROR_ID_MANIFEST_CODE),v(t,a.HTTPRequest.XLINK_EXPANSION_TYPE,_.DOWNLOAD_ERROR_ID_XLINK_CODE),v(t,a.HTTPRequest.INIT_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),v(t,a.HTTPRequest.MEDIA_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),v(t,a.HTTPRequest.INDEX_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),v(t,a.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),v(t,a.HTTPRequest.OTHER_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),C=t,I}m.__dashjs_factory_name="HTTPLoader";var y=o.default.getClassFactory(m);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(23)),a=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=this.context,n=e.requestModifier,r=e.boxParser,o=(0,i.default)(t).getInstance();function s(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function u(e,t,n,r,i){switch(e){case a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING:return function(e,t){try{var n,r;n=e.filter((function(t,n){return n>0&&n<e.length-1})),r=t.filter((function(e,n){return n>0&&n<t.length-1}));var i=0;if(n.length>1){for(var a=0;a<n.length;a++)if(n[a]&&r[a]){var o=r[a].ts-n[a].ts;i+=o}return i}return null}catch(e){return null}}(t,n);case a.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA:default:return l(r,i)}}function l(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var o=a.ts-t.ts;n+=o<r?o:0}})),n}return null}catch(e){return null}}return{load:function(e){var t=new Date,i=e.request,l=new Headers;if(i.range&&l.append("Range","bytes="+i.range),e.headers)for(var c in e.headers){var d=e.headers[c];d&&l.append(c,d)}i.requestStartDate||(i.requestStartDate=t),n&&n.modifyRequestHeader({setRequestHeader:function(e,t){l.append(e,t)}});var f=void 0;"function"==typeof window.AbortController&&(f=new AbortController,e.abortController=f,f.signal.onabort=e.onabort);var h={method:e.method,headers:l,credentials:e.withCredentials?"include":void 0,signal:f?f.signal:void 0};fetch(e.url,h).then((function(t){e.response||(e.response={}),e.response.status=t.status,e.response.statusText=t.statusText,e.response.responseURL=t.url,t.ok||e.onerror();var n="",i=!0,l=!1,c=void 0;try{for(var d,f=t.headers.keys()[Symbol.iterator]();!(i=(d=f.next()).done);i=!0){var h=d.value;n+=h+": "+t.headers.get(h)+"\r\n"}}catch(e){l=!0,c=e}finally{try{!i&&f.return&&f.return()}finally{if(l)throw c}}if(e.response.responseHeaders=n,!t.body)return t.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var p=parseInt(t.headers.get("Content-Length"),10),g=0,v=!1,m=new Uint8Array,y=0;e.reader=t.body.getReader();var E=[],T=[],_=[],b=!0,S=o.get().streaming.abr.fetchThroughputCalculationMode;s(e,(function t(n){var i=n.value;if(n.done)return m&&(e.progress({loaded:g,total:isNaN(p)?g:p,lengthComputable:!0,time:u(S,T,_,E,g),stream:!0}),e.response.response=m.buffer),e.onload(),void e.onend();if(i&&i.length>0){if(m=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(m,i),g+=i.length,E.push({ts:Date.now(),bytes:i.length}),S===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&b)r.findLastTopIsoBoxCompleted(["moof"],m,y).found&&(b=!1,T.push({ts:performance.now(),bytes:i.length}));var o=r.findLastTopIsoBoxCompleted(["moov","mdat"],m,y);if(o.found){var l=o.lastCompletedOffset+o.size;S===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(b=!0,_.push({ts:performance.now(),bytes:m.length}));var c=void 0;l===m.length?(c=m,m=new Uint8Array):(c=new Uint8Array(m.subarray(0,l)),m=m.subarray(l)),e.progress({data:c.buffer,lengthComputable:!1,noTrace:!0}),y=0}else y=o.lastCompletedOffset,v||(e.progress({lengthComputable:!1,noTrace:!0}),v=!0)}s(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:u}}s.__dashjs_factory_name="FetchLoader";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(9),o=(r=a)&&r.__esModule?r:{default:r};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}return i(e,[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==o.default.BASE_URL&&this.segmentInfoType!==o.default.SEGMENT_BASE&&!this.indexRange}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null};r.DEFAULT_ID="defaultId",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}},function(e,t,n){"use strict";var r=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var o,s,u,l=r(t),c=r(n);if(l&&c){if((s=t.length)!=n.length)return!1;for(o=s;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(l!=c)return!1;var d=t instanceof Date,f=n instanceof Date;if(d!=f)return!1;if(d&&f)return t.getTime()==n.getTime();var h=t instanceof RegExp,p=n instanceof RegExp;if(h!=p)return!1;if(h&&p)return t.toString()==n.toString();var g=i(t);if((s=g.length)!==i(n).length)return!1;for(o=s;0!=o--;)if(!a.call(n,g[o]))return!1;for(o=s;0!=o--;)if(!e(t[u=g[o]],n[u]))return!1;return!0}return t!=t&&n!=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(16);var a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);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.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.checkForExistenceOnly=!0,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)}(t,e),t}(((r=i)&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(0)),i=l(n(1)),a=l(n(176)),o=l(n(57)),s=l(n(79)),u=n(22);function l(e){return e&&e.__esModule?e:{default:e}}function c(e){var t,n=this.context,r=e.streamInfo,l=void 0;function c(){l&&l.reset()}return t={getStreamId:function(){return r.id},provide:function(e,t){if("function"==typeof t){var n,r=l.getCurrentTrack(),i=void 0;if(!r||r.segmentDuration<=0||null==e)t(null);else{isNaN(r.segmentDuration)&&(i=l.getThumbnailRequestForTime(e))&&(r.segmentDuration=i.duration),n=e%r.segmentDuration;var o=Math.floor(n*r.tilesHor*r.tilesVert/r.segmentDuration),s=new a.default;if(s.width=Math.floor(r.widthPerTile),s.height=Math.floor(r.heightPerTile),s.x=Math.floor(o%r.tilesHor)*r.widthPerTile,s.y=Math.floor(o/r.tilesHor)*r.heightPerTile,"readThumbnail"in r)return r.readThumbnail(e,(function(e){s.url=e,t(s)}));if(i)s.url=i.url,r.segmentDuration=NaN;else{var c=Math.floor(e/r.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=(0,u.replaceTokenForTemplate)(e.templateUrl,"Number",n);return r=(0,u.replaceTokenForTemplate)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,u.replaceTokenForTemplate)(r,"Bandwidth",e.bandwidth),(0,u.unescapeDollarsInTemplate)(r)}(r,c)}t(s)}}},setTrackByIndex:function(e){l.setTrackByIndex(e)},getCurrentTrackIndex:function(){return l.getCurrentTrackIndex()},getBitrateList:function(){var e=l.getTracks(),t=0;return e.map((function(e){var n=new s.default;return n.mediaType=i.default.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:c},c(),l=(0,o.default)(n).create({streamInfo:r,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants}),t}c.__dashjs_factory_name="ThumbnailController",t.default=r.default.getClassFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(6)),i=n(8),a=d(n(3)),o=d(n(4)),s=d(n(11)),u=d(n(0)),l=d(n(2)),c=d(n(13));function d(e){return e&&e.__esModule?e:{default:e}}function f(){var e=this.context,t=(0,a.default)(e).getInstance(),n=(0,c.default)(e).getInstance(),u=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0;function I(){m=[],y=[],E=null,T=null,b=null,_=NaN,f=!1,h=!1,S=p.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function w(){f||h||!b||!b.value||!b.schemeIdUri||isNaN(_)||isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)||(T&&(Date.now()-T)/1e3<30||(m=[],h=!0,function e(t){try{if(t<=0)return void U();var n=Date.now();g[b.schemeIdUri](b.value,(function(r){var i=Date.now(),a=R(n,i,r);m.push(a),e(t-1)}),(function(){U()}))}catch(e){U()}}(isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)?2:p.get().streaming.utcSynchronization.backgroundAttempts)))}function R(e,t,n){return n-(t-(t-e)/2)}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&p.get().streaming.useManifestDateHeaderTimeSource?k():F(t,e)}function C(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t=void 0,n=void 0,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function M(e){return Date.parse(e)}function L(e){return Date.parse(e)}function N(e,t,n){n()}function O(e,t,n){var r=C(e);isNaN(r)?n():t(r)}function x(e,t,r,a,o){var s,u,l=!1,c=new XMLHttpRequest,d=o?i.HTTPRequest.HEAD:i.HTTPRequest.GET,f=t.match(/\S+/g);if(t=f.shift(),s=function(){l||(l=!0,f.length?x(e,f.join(" "),r,a,o):a())},u=function(){var t=void 0,n=void 0;200===c.status&&(t=o?c.getResponseHeader("Date"):c.response,n=e(t),isNaN(n)||(r(n),l=!0))},n.isRelative(t)){var h=A.resolve();h&&(t=n.resolve(t,h.url))}c.open(d,t),c.timeout=5e3,c.onload=u,c.onloadend=s,c.send()}function P(e,t,n){x(L,e,t,n,!0)}function k(){var e=v.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?F(!0):F(!1,t-Date.now())}function F(e,n){if(isNaN(_)||isNaN(n)||e||function(e){try{var t=B(e),n=isNaN(S)?30:S,r=isNaN(p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,i=isNaN(p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,a=isNaN(p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts,o=void 0;t?(o=Math.min(n*r,i),d.debug("Increasing timeBetweenSyncAttempts to "+o)):(o=Math.max(n/r,a),d.debug("Decreasing timeBetweenSyncAttempts to "+o)),S=o}catch(e){}}(n),!e&&!isNaN(n)){E=Date.now(),f=!1;var i=isNaN(_);_=n,i&&w(),d.debug("Completed UTC sync. Setting client - server offset to "+n)}e&&(b=null),t.trigger(o.default.UPDATE_TIME_SYNC_OFFSET,{offset:n,error:e?new r.default(s.default.TIME_SYNC_FAILED_ERROR_CODE,s.default.TIME_SYNC_FAILED_ERROR_MESSAGE):null}),t.trigger(o.default.TIME_SYNCHRONIZATION_COMPLETED)}function U(){if(m&&0!==m.length){var e=m.reduce((function(e,t){return e+t}),0)/m.length;B(e)?d.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(d.debug("Completed background UTC sync. Setting client - server offset to "+e),_=e,t.trigger(o.default.UPDATE_TIME_SYNC_OFFSET,{offset:_})),h=!1,T=Date.now()}}function B(e){try{if(isNaN(_))return!0;var t=p.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(p.get().streaming.utcSynchronization.maximumAllowedDrift)?p.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=_-t&&e<=_+t}catch(e){return!0}}return u={initialize:function(){I(),g={"urn:mpeg:dash:utc:http-head:2014":P,"urn:mpeg:dash:utc:http-xsdate:2014":x.bind(null,C),"urn:mpeg:dash:utc:http-iso:2014":x.bind(null,M),"urn:mpeg:dash:utc:direct:2014":O,"urn:mpeg:dash:utc:http-head:2012":P,"urn:mpeg:dash:utc:http-xsdate:2012":x.bind(null,C),"urn:mpeg:dash:utc:http-iso:2012":x.bind(null,M),"urn:mpeg:dash:utc:direct:2012":O,"urn:mpeg:dash:utc:http-ntp:2014":N,"urn:mpeg:dash:utc:ntp:2014":N,"urn:mpeg:dash:utc:sntp:2014":N}},attemptSync:function(e){y=e,f||(!function(){try{var e=isNaN(S)?30:S;return!(E&&e&&!isNaN(e))||(Date.now()-E)/1e3>=e}catch(e){return!0}}()?t.trigger(o.default.TIME_SYNCHRONIZATION_COMPLETED):(f=!0,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||0;if(!y||0===y.length||n>=y.length)return void D();var r=y[n];if(r)if(g.hasOwnProperty(r.schemeIdUri)){var i=(new Date).getTime();g[r.schemeIdUri](r.value,(function(e){var t=(new Date).getTime(),n=R(i,t,e);b=r,D(n)}),(function(){e(n+1)}))}else e(n+1);else D()}()))},setConfig:function(e){e&&(e.dashMetrics&&(v=e.dashMetrics),e.baseURLController&&(A=e.baseURLController),e.settings&&(p=e.settings))},reset:function(){I(),t.off(o.default.ATTEMPT_BACKGROUND_SYNC,w,u)}},d=(0,l.default)(e).getInstance().getLogger(u),t.on(o.default.ATTEMPT_BACKGROUND_SYNC,w,u),u}f.__dashjs_factory_name="TimeSyncController";var h=u.default.getSingletonFactory(f);h.HTTP_TIMEOUT_MS=5e3,u.default.updateSingletonFactory(f.__dashjs_factory_name,h),t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0,t=void 0,n=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?new MediaSource:e?new WebKitMediaSource:null},attachMediaSource:function(e,t){var n=window.URL.createObjectURL(e);return t.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(n,r){n&&"open"===n.readyState&&(null===r&&isNaN(r)||n.duration!==r&&(!function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(n)?(t.info("Set MediaSource duration:"+r),n.duration=r):setTimeout(e.bind(null,n,r),50)))},setSeekable:function(e,t,n){e&&"function"==typeof e.setLiveSeekableRange&&"function"==typeof e.clearLiveSeekableRange&&"open"===e.readyState&&t>=0&&t<n&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(t,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var n=e.sourceBuffers,r=0;r<n.length;r++){if(n[r].updating)return;if(0===n[r].buffered.length)return}t.info("call to mediaSource endOfStream"),e.endOfStream()}}},t=(0,i.default)(n).getInstance().getLogger(e),e}o.__dashjs_factory_name="MediaSourceController",t.default=r.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(0)),i=u(n(2)),a=u(n(3)),o=u(n(20)),s=u(n(55));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e="discarded",t="updated",n="added",r=this.context,u=(0,a.default)(r).getInstance(),l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0;function T(){if(!g||!v)throw new Error("setConfig function has to be called previously")}function _(){E=!1,d={},f={},h=null,y=!1,p=Date.now()/1e3}function b(){try{null!==h&&E&&(clearInterval(h),h=null,E=!1,function(){try{R(f),R(d)}catch(e){}}())}catch(e){throw e}}function S(r,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.eventStream.schemeIdUri,s=r.eventStream.value,u=r.id,l=e;i[o]||(i[o]=[]);var c=i[o].findIndex((function(e){return(!s||e.eventStream.value&&e.eventStream.value===s)&&e.id===u}));return-1===c?(i[o].push(r),l=n):a&&(i[o][c]=r,l=t),l}function A(e){try{if(1==e.eventStream.value){var t=e.calculatedPresentationTime,n=void 0;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,u.trigger(o.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:t,newDuration:n,newManifestValidAfter:NaN},{mode:o.default.EVENT_MODE_ON_START})}}catch(e){}}function I(){try{if(!y){y=!0;var e=v.getTime(),t=e-p;t=p>0?Math.max(0,t):0,w(f,t,e),w(d,t,e),p=e,y=!1}}catch(e){y=!1}}function w(e,t,n){try{D(e,(function(r){if(void 0!==r){var i=isNaN(r.duration)?0:r.duration;r.calculatedPresentationTime<=n&&r.calculatedPresentationTime+t+i>=n?C(r,e,o.default.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(n,i+t,r.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(r))&&(c.debug("Deleting event "+r.id+" as it is expired or invalid"),M(e,r))}}))}catch(e){}}function R(e){try{var t=v.getTime();D(e,function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<300&&C(n,e,o.default.EVENT_MODE_ON_START)}}())}catch(e){}}function D(e,t){try{if(e)for(var n=Object.keys(e),r=0;r<n.length;r++){e[n[r]].forEach((function(e){void 0!==e&&t(e)}))}}catch(e){}}function C(e,t,n){try{var i=v.getTime(),a=e.id;if(n===o.default.EVENT_MODE_ON_RECEIVE)return c.debug("Received event "+a),void u.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});"urn:mpeg:dash:event:2012"===e.eventStream.schemeIdUri&&1===e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(c.debug("Starting manifest refresh event "+a+" at "+i),M(t,e),function(){try{T(),g.refreshManifest()}catch(e){}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1===e.eventStream.value?(c.debug("Starting callback event "+a+" at "+i),M(t,e),function(e){try{(0,s.default)(r).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(c.debug("Starting event "+a+" at "+i),M(t,e),u.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n}))}catch(e){}}function M(e,t){var n=t.eventStream.schemeIdUri,r=t.eventStream.value,i=t.id;e[n]=e[n].filter((function(e){return r&&e.eventStream.value&&e.eventStream.value!==r||e.id!==i})),0===e[n].length&&delete e[n]}return l={addInlineEvents:function(e){try{if(T(),e)for(var r=0;r<e.length;r++){var i=e[r],a=S(i,d,!0);a===n?(c.debug("Added inline event with id "+i.id),C(i,e,o.default.EVENT_MODE_ON_RECEIVE)):a===t&&c.debug("Updated inline event with id "+i.id)}c.debug("Added "+e.length+" inline events")}catch(e){throw e}},addInbandEvents:function(e){try{T();for(var t=0;t<e.length;t++){var r=e[t];S(r,f,!1)===n?("urn:mpeg:dash:event:2012"===r.eventStream.schemeIdUri&&void 0===f[r.id]&&A(r),c.debug("Added inband event with id "+r.id),C(r,e,o.default.EVENT_MODE_ON_RECEIVE)):c.debug("Inband event with scheme_id_uri "+r.eventStream.schemeIdUri+", value "+r.eventStream.value+" and id "+r.id+" was ignored because it has been added before.")}I()}catch(e){throw e}},getInbandEvents:function(){return f},getInlineEvents:function(){return d},start:function(){try{T(),c.debug("Start Event Controller");var e=m.get().streaming.eventControllerRefreshDelay;E||isNaN(e)||(E=!0,h=setInterval(I,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(g=e.manifestUpdater),e.playbackController&&(v=e.playbackController),e.settings&&(m=e.settings)}catch(e){throw e}},reset:function(){b(),_()}},c=(0,i.default)(r).getInstance().getLogger(l),_(),l}l.__dashjs_factory_name="EventController",t.default=r.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(0)),i=s(n(2)),a=s(n(4)),o=s(n(3));function s(e){return e&&e.__esModule?e:{default:e}}function u(){var e=this.context,t=(0,o.default)(e).getInstance(),n=void 0,r=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0;function v(){g.debug("Stopping the gap controller"),l&&(clearInterval(l),l=null),function(){t.off(a.default.WALLCLOCK_TIME_UPDATED,E,this),t.off(a.default.PLAYBACK_SEEKING,y,this),t.off(a.default.BYTES_APPENDED_END_FRAGMENT,m,n)}(),l=null,c=NaN,u=0,p=null}function m(){l||function(){try{l||(g.debug("Starting the gap controller"),l=setInterval((function(){T()&&b(d.getTime())}),100))}catch(e){}}()}function y(){p&&(clearTimeout(p),p=null)}function E(){if(T()&&++u>=30){var e=d.getTime();r===e?b(e,!0):(r=e,c=NaN),u=0}}function T(){return s.get().streaming.jumpGaps&&f.getActiveStreamProcessors().length>0&&(!d.isSeeking()||f.hasStreamFinishedBuffering(f.getActiveStream()))&&!d.isPaused()&&!f.getIsStreamSwitchInProgress()&&!f.getHasMediaOrIntialisationError()}function _(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var n=NaN,r=0;isNaN(n)&&r<e.length;){var i=r>0?e.end(r-1):0;t<e.start(r)&&i-t<.1&&(n=r),r+=1}return n}catch(e){return null}}function b(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=s.get().streaming.smallGapLimit,i=s.get().streaming.jumpLargeGaps,o=h.getBufferRange(),u=void 0,l=NaN,f=!1;if(u=_(o,e),!isNaN(u)){var v=o.start(u),m=v-e;m>0&&(m<=r||i)&&(l=v)}var y=d.getTimeToStreamEnd();if(isNaN(l)&&n&&isFinite(y)&&!isNaN(y)&&y<r&&(l=parseFloat(d.getStreamEndTime().toFixed(5)),f=!0),l>0&&c!==l&&l>e&&!p){var E=l-e;if(f)g.warn("Jumping to end of stream because of gap from "+e+" to "+l+". Gap duration: "+E),t.trigger(a.default.GAP_CAUSED_SEEK_TO_PERIOD_END,{seekTime:l,duration:E});else{var T=d.getIsDynamic(),b=u>0?o.end(u-1):e,S=T?1e3*E:0;p=window.setTimeout((function(){d.seek(l,!0,!0),g.warn("Jumping gap starting at "+b+" and ending at "+l+". Jumping by: "+E),t.trigger(a.default.GAP_CAUSED_INTERNAL_SEEK,{seekTime:l,duration:E}),p=null}),S)}c=l}}return n={reset:v,setConfig:function(e){e&&(e.settings&&(s=e.settings),e.playbackController&&(d=e.playbackController),e.streamController&&(f=e.streamController),e.videoModel&&(h=e.videoModel),e.timelineConverter&&e.timelineConverter,e.adapter&&e.adapter)},initialize:function(){!function(){t.on(a.default.WALLCLOCK_TIME_UPDATED,E,this),t.on(a.default.PLAYBACK_SEEKING,y,this),t.on(a.default.BYTES_APPENDED_END_FRAGMENT,m,n)}()}},g=(0,i.default)(e).getInstance().getLogger(n),v(),n}u.__dashjs_factory_name="GapController",t.default=r.default.getSingletonFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(1)),i=u(n(4)),a=u(n(3)),o=u(n(0)),s=u(n(2));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=this.context,t=(0,a.default)(e).getInstance(),n=void 0,o=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=[r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,r.default.TRACK_SWITCH_MODE_NEVER_REPLACE],h=[r.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,r.default.TRACK_SELECTION_MODE_FIRST_TRACK,r.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY,r.default.TRACK_SELECTION_MODE_WIDEST_RANGE];function p(e,t){if(!e||!t)return[];var n=t.id;return u[n]&&u[n][e]?u[n][e].list:[]}function g(e,t){return!e||!t||t&&!u[t.id]?null:u[t.id][e].current}function v(e,n){if(e&&e.streamInfo){var a=e.type,o=e.streamInfo,s=o.id,l=g(a,o);if(u[s]&&u[s][a]&&!b(e,l)&&(u[s][a].current=e,!u[s][a].current||n&&a===r.default.FRAGMENTED_TEXT||t.trigger(i.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:l,newMediaInfo:e,switchMode:E(a)}),!n)){var c=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!c||!u[s][a].storeLastSettings)return;c.roles&&(c.role=c.roles[0],delete c.roles),c.accessibility&&(c.accessibility=c.accessibility[0]),c.audioChannelConfiguration&&(c.audioChannelConfiguration=c.audioChannelConfiguration[0]),d.setSavedMediaSettings(a,c)}}}function m(e,t){e&&t&&(c[e]=t)}function y(e){return e?c[e]:null}function E(e){return l.get().streaming.trackSwitchMode[e]}function T(){return l.get().streaming.selectionModeForInitialTrack}function _(e){return e===r.default.AUDIO||e===r.default.VIDEO||e===r.default.TEXT||e===r.default.FRAGMENTED_TEXT||e===r.default.IMAGE}function b(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function S(){u={},c={audio:null,video:null,fragmentedText:null}}function A(e,t){var n=!e.lang||t.lang.match(e.lang),r=void 0===e.index||null===e.index||t.index===e.index,i=!e.viewpoint||e.viewpoint===t.viewpoint,a=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],o=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],s=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return n&&r&&i&&a&&o&&s}function I(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>t?(t=r,n=[e]):r===t&&n.push(e)})),n}function w(e){var t=1/0,n=[],r=void 0;return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(r=i/e.bitrateList.length)<t?(t=r,n=[e]):r===t&&n.push(e)})),n}function R(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=e.representationCount)>t?(t=r,n=[e]):r===t&&n.push(e)})),n}return n={checkInitialMediaSettingsForType:function(e,t){var n=y(e),r=p(e,t),i=[];n||m(e,n=d.getSavedMediaSettings(e)),r&&0!==r.length&&(n&&r.forEach((function(e){A(n,e)&&i.push(e)})),0===i.length?v(this.selectInitialTrack(e,r),!0):i.length>1?v(this.selectInitialTrack(e,i)):v(i[0]))},addTrack:function(e){if(e){var t=e.type;if(_(t)){var n=e.streamInfo.id;u[n]||(u[n]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var r=u[n][t].list,i=0,a=r.length;i<a;++i)if(b(r[i],e))return;r.push(e);var o=y(t);o&&A(o,e)&&!g(t,e.streamInfo)&&v(e)}}},getTracksFor:p,getCurrentTrackFor:g,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,n=e.streamInfo.id;return u[n]&&u[n][t]&&b(u[n][t].current,e)},setTrack:v,setInitialSettings:m,getInitialSettings:y,setSwitchMode:function(e,t){if(o.warn("deprecated: Please use updateSettings({streaming: { trackSwitchMode: mode } }) instead"),-1!==f.indexOf(t)){var n={};n[e]=t,l.update({streaming:{trackSwitchMode:n}})}else o.warn("Track switch mode is not supported: "+t)},getSwitchMode:E,selectInitialTrack:function(e,t){if(e===r.default.FRAGMENTED_TEXT)return t[0];var n=T(),i=[];switch(n){case r.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:(i=I(t)).length>1&&(i=R(i));break;case r.default.TRACK_SELECTION_MODE_FIRST_TRACK:i.push(t[0]);break;case r.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:(i=w(t)).length>1&&(i=I(i));break;case r.default.TRACK_SELECTION_MODE_WIDEST_RANGE:(i=R(t)).length>1&&(i=I(t));break;default:o.warn("Track selection mode is not supported: "+n)}return i[0]},getTracksWithHighestBitrate:I,getTracksWithHighestEfficiency:w,getTracksWithWidestRange:R,setSelectionModeForInitialTrack:function(e){o.warn("deprecated: Please use updateSettings({streaming: { selectionModeForInitialTrack: mode } }) instead"),-1!==h.indexOf(e)?l.update({streaming:{selectionModeForInitialTrack:e}}):o.warn("Track selection mode is not supported: "+e)},getSelectionModeForInitialTrack:T,isMultiTrackSupportedByType:_,isTracksEqual:b,matchSettings:A,saveTextSettingsDisabled:function(){d.setSavedMediaSettings(r.default.FRAGMENTED_TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(d=e.domStorage),e.settings&&(l=e.settings))},reset:S},o=(0,s.default)(e).getInstance().getLogger(n),S(),n}l.__dashjs_factory_name="MediaController";var c=o.default.getSingletonFactory(l);o.default.updateSingletonFactory(l.__dashjs_factory_name,c),t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(183)),i=c(n(184)),a=c(n(13)),o=c(n(85)),s=c(n(0)),u=c(n(3)),l=c(n(4));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=void 0,t=void 0,n=this.context,s=(0,u.default)(n).getInstance(),c=(0,a.default)(n).getInstance(),d=void 0,f=void 0;function h(e){d.invalidateSelectedIndexes(e.entry)}return e={reset:function(){d.reset(),f.reset()},initialize:function(e){var n;d.setConfig({adapter:t}),n=e,d.update(n),f.chooseSelector(t.getIsDVB(n))},resolve:function(e){var t=d.getForPath(e).reduce((function(e,t){var n=f.select(t);return n?(c.isRelative(n.url)?e.url=c.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new o.default}),new o.default);if(!c.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(d=e.baseURLTreeModel),e.baseURLSelector&&(f=e.baseURLSelector),e.adapter&&(t=e.adapter)}},d=(0,r.default)(n).create(),f=(0,i.default)(n).create(),s.on(l.default.SERVICE_LOCATION_BLACKLIST_CHANGED,h,e),e}d.__dashjs_factory_name="BaseURLController",t.default=s.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(86)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}var o=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||NaN},this.children=[]};function s(){var e,t=void 0,n=void 0,i=this.context,a=(0,r.default)(i).getInstance();function s(e,t,r){var i=n.getBaseURLsFromElement(r);e[t]?a.areEqual(i,e[t].data.baseUrls)||(e[t].data.baseUrls=i,e[t].data.selectedIdx=NaN):e[t]=new o(i)}function u(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=n.getBaseURLsFromElement(e);a.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=NaN),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){s(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){s(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){s(t.children[r].children[i].children,n,e)}))}))}))}function l(){t=new o}return e={reset:l,update:function(e){u(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){!function e(n,r){var i=r||t;n(i.data),i.children&&i.children.forEach((function(t){return e(n,t)}))}((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=NaN)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},l(),e}s.__dashjs_factory_name="BaseURLTreeModel",t.default=i.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(11)),i=f(n(3)),a=f(n(4)),o=f(n(185)),s=f(n(186)),u=f(n(187)),l=f(n(0)),c=f(n(6)),d=n(15);function f(e){return e&&e.__esModule?e:{default:e}}function h(){var e,t=this.context,n=(0,i.default)(t).getInstance(),l=void 0,f=void 0,h=void 0,p=void 0;function g(){l.reset()}return e={chooseSelector:function(e){(0,d.checkParameterType)(e,"boolean"),p=e?h:f},select:function(e){if(e){var t=e.baseUrls,i=e.selectedIdx;if(!isNaN(i))return t[i];var o=p.select(t);return o?(e.selectedIdx=t.indexOf(o),o):(n.trigger(a.default.URL_RESOLUTION_FAILED,{error:new c.default(r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(p===f&&g()))}},reset:g,setConfig:function(e){e.selector&&(p=e.selector)}},l=(0,o.default)(t).create({updateEventName:a.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:a.default.SERVICE_LOCATION_BLACKLIST_ADD}),f=(0,u.default)(t).create({blacklistController:l}),h=(0,s.default)(t).create({blacklistController:l}),p=f,e}h.__dashjs_factory_name="BaseURLSelector",t.default=l.default.getClassFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){e=e||{};var t=void 0,n=[],r=(0,i.default)(this.context).getInstance(),a=e.updateEventName,o=e.addBlacklistEventName;function s(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(a,{entry:e}))}function u(e){s(e.entry)}return t={add:s,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},o&&r.on(o,u,t),t}o.__dashjs_factory_name="BlackListController",t.default=r.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t=0,n=[],r=0,i=void 0,a=void 0;if((a=e.sort((function(e,t){var n=e.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return a.length>1&&(a.forEach((function(e){t+=e.dvb_weight,n.push(t)})),i=Math.floor(Math.random()*(t-1)),n.every((function(e,t){return r=t,!(i<e)}))),a[r]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}o.__dashjs_factory_name="DVBSelector",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n=0,r=void 0;return e&&e.some((function(e,r){return n=r,!t.contains(e.serviceLocation)}))&&(r=e[n]),r}}}o.__dashjs_factory_name="BasicSelector",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(1)),i=v(n(9)),a=v(n(189)),o=v(n(29)),s=v(n(13)),u=v(n(88)),l=v(n(6)),c=n(8),d=v(n(3)),f=v(n(4)),h=v(n(11)),p=v(n(0)),g=v(n(191));function v(e){return e&&e.__esModule?e:{default:e}}function m(e){e=e||{};var t=this.context,n=e.debug,p=(0,d.default)(t).getInstance(),v=(0,s.default)(t).getInstance(),m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=e.mssHandler,S=e.errHandler;function A(e){p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return m={load:function(e){var i=new u.default(e,c.HTTPRequest.MPD_TYPE);E.load({request:i,success:function(i,a,o){if(T){var s=void 0,u=void 0,c=void 0;if(o&&o!==e?(u=v.parseBaseUrl(o),s=o):(v.isRelative(e)&&(e=v.resolve(e,window.location.href)),u=v.parseBaseUrl(e)),"No Content"!=a)if(null===_&&(_=function(e){var r=null;return e.indexOf("SmoothStreamingMedia")>-1?(b&&(r=b.createMssParser(),b.registerEvents()),r):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?(0,g.default)(t).create({debug:n}):r}(i)),null!==_){T.setMatchers(_.getMatchers()),T.setIron(_.getIron());try{c=_.parse(i)}catch(t){return void p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}c?(c.url=s||e,c.originalUrl||(c.originalUrl=c.url),c.hasOwnProperty(r.default.LOCATION)&&(u=v.parseBaseUrl(c.Location_asArray[0]),y.debug("BaseURI set by Location to: "+u)),c.baseUri=u,c.loadedTime=new Date,T.resolveManifestOnLoad(c),p.trigger(f.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:i})):p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}else p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)});else p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null})}},error:function(t,n,r){p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+(e+", ")+r)})}})},reset:function(){p.off(f.default.XLINK_READY,A,m),b&&b.reset(),T&&(T.reset(),T=null),E&&(E.abort(),E=null)}},y=n.getLogger(m),p.on(f.default.XLINK_READY,A,m),E=(0,o.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:v,constants:r.default,dashConstants:i.default,errors:h.default}),T=(0,a.default)(t).create({errHandler:S,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),_=null,m}m.__dashjs_factory_name="ManifestLoader";var y=p.default.getClassFactory(m);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(190)),i=c(n(3)),a=c(n(4)),o=c(n(0)),s=c(n(89)),u=c(n(13)),l=c(n(9));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=(0,i.default)(t).getInstance(),o=(0,u.default)(t).getInstance(),c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0;function v(e,t,n){var r={},i=void 0,a=void 0;r.elements=e,r.type=t,r.resolveType=n,0===r.elements.length&&y(r);for(var s=0;s<r.elements.length;s++)i=r.elements[s],a=o.isHTTPURL(i.url)?i.url:i.originalContent.BaseURL+i.url,g.load(a,i,r)}function m(e){var t,n=void 0,r="";if(n=e.element,t=e.resolveObject,n.resolvedContent){var i=0;0===n.resolvedContent.indexOf("<?xml")&&(i=n.resolvedContent.indexOf("?>")+2),r=n.resolvedContent.substr(0,i)+"<response>"+n.resolvedContent.substr(i)+"</response>",n.resolvedContent=p.xml_str2json(r)}(function(e){var t=void 0;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(t)&&y(t)}function y(e){var t=[],r=void 0,i=void 0;if(function(e){var t=[],n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;for(a=e.elements.length-1;a>=0;a--){if(n=e.elements[a],r=n.type+"_asArray",n.resolvedContent){if(n.resolvedContent)for(o=0;o<n.resolvedContent[r].length;o++)i=n.resolvedContent[r][o],t.push(i)}else delete n.originalContent["xlink:actuate"],delete n.originalContent["xlink:href"],t.push(n.originalContent);for(n.parentElement[r].splice(n.index,1),s=0;s<t.length;s++)n.parentElement[r].splice(n.index+s,0,t[s]);t=[]}e.elements.length>0&&f.run(h)}(e),"onActuate"===e.resolveType&&n.trigger(a.default.XLINK_READY,{manifest:h}),"onLoad"===e.resolveType)switch(e.type){case l.default.PERIOD:for(r=0;r<h[l.default.PERIOD+"_asArray"].length;r++)(i=h[l.default.PERIOD+"_asArray"][r]).hasOwnProperty(l.default.ADAPTATION_SET+"_asArray")&&(t=t.concat(E(i[l.default.ADAPTATION_SET+"_asArray"],i,l.default.ADAPTATION_SET,"onLoad"))),i.hasOwnProperty(l.default.EVENT_STREAM+"_asArray")&&(t=t.concat(E(i[l.default.EVENT_STREAM+"_asArray"],i,l.default.EVENT_STREAM,"onLoad")));v(t,l.default.ADAPTATION_SET,"onLoad");break;case l.default.ADAPTATION_SET:n.trigger(a.default.XLINK_READY,{manifest:h})}}function E(e,t,n,r){var i=[],a=void 0,o=void 0,s=void 0;for(o=e.length-1;o>=0;o--)(a=e[o]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===a["xlink:href"]&&e.splice(o,1);for(o=0;o<e.length;o++)(a=e[o]).hasOwnProperty("xlink:href")&&a.hasOwnProperty("xlink:actuate")&&a["xlink:actuate"]===r&&(s=T(a["xlink:href"],t,n,o,r,a),i.push(s));return i}function T(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return c={resolveManifestOnLoad:function(e){p=new s.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:d}),(h=e).Period_asArray?v(E(h.Period_asArray,h,l.default.PERIOD,"onLoad"),l.default.PERIOD,"onLoad"):n.trigger(a.default.XLINK_READY,{manifest:h})},setMatchers:function(e){e&&(d=e)},setIron:function(e){e&&(f=e)},reset:function(){n.off(a.default.XLINK_ELEMENT_LOADED,m,c),g&&(g.reset(),g=null)}},n.on(a.default.XLINK_ELEMENT_LOADED,m,c),g=(0,r.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),c}d.__dashjs_factory_name="XlinkController",t.default=o.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(6)),i=d(n(29)),a=n(8),o=d(n(88)),s=d(n(3)),u=d(n(4)),l=d(n(0)),c=d(n(11));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t=this.context,n=(0,s.default)(t).getInstance(),l=(0,i.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings?e.settings.get().streaming.lowLatencyEnabled:null,errors:c.default});return{load:function(e,t,i){var s=function(a,o){t.resolved=!0,t.resolvedContent=a||null,n.trigger(u.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:a||o?null:new r.default(c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)s(null,!0);else{var d=new o.default(e,a.HTTPRequest.XLINK_EXPANSION_TYPE);l.load({request:d,success:function(e){s(e)},error:function(){s(null)}})}},reset:function(){l&&(l.abort(),l=null)}}}f.__dashjs_factory_name="XlinkLoader",t.default=l.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(0)),i=f(n(192)),a=f(n(89)),o=f(n(193)),s=f(n(194)),u=f(n(195)),l=f(n(196)),c=f(n(197)),d=f(n(199));function f(e){return e&&e.__esModule?e:{default:e}}function h(e){e=e||{};var t=this.context,n=e.debug,r=void 0,f=void 0,h=void 0,p=void 0,g=void 0;return r={parse:function(e){var t=void 0,n=window.performance.now();if(!(t=p.xml_str2json(e)))throw new Error("parsing the manifest failed");var r=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return g.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return g.run(e)}))):(t=t.MPD,g.run(t));var i=window.performance.now();return f.info("Parsing complete: ( xml2json: "+(r-n).toPrecision(3)+"ms, objectiron: "+(i-r).toPrecision(3)+"ms, total: "+((i-n)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return h},getIron:function(){return g}},f=n.getLogger(r),h=[new s.default,new u.default,new l.default,new o.default],p=new a.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:h}),g=(0,i.default)(t).create({adaptationset:new c.default,period:new d.default}),r}h.__dashjs_factory_name="DashParser",t.default=r.default.getClassFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=n(0),o=(r=a)&&r.__esModule?r:{default:r};function s(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var a=0,o=e.length;a<o;++a){var s=e[a];if(n[s.name])if(r[s.name]){if(s.merge){var u=n[s.name],l=r[s.name];"object"===(void 0===u?"undefined":i(u))&&"object"===(void 0===l?"undefined":i(l))?t(u,l):r[s.name]=u+l}}else r[s.name]=n[s.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var o=e.children[i],s=t[o.name+"_asArray"];if(s)for(var u=0,l=s.length;u<l;++u){var c=s[u];n(e.properties,t,c),r(o,c)}}}return{run:function(t){if(null===t||"object"!==(void 0===t?"undefined":i(t)))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,a=t.Period_asArray,o=0,s=a.length;o<s;++o){var u=a[o];if(r(n,u),"adaptationset"in e){var l=u.AdaptationSet_asArray;if(l)for(var c=e.adaptationset,d=0,f=l.length;d<f;++d)r(c,l[d])}}return t}}}s.__dashjs_factory_name="ObjectIron";var u=o.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(39)),i=a(n(9));function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e,t){var n,r=(o(n={},i.default.MPD,[i.default.ID,i.default.PROFILES]),o(n,i.default.PERIOD,[i.default.ID]),o(n,i.default.BASE_URL,[i.default.SERVICE_LOCATION,i.default.BYTE_RANGE]),o(n,i.default.SEGMENT_BASE,[i.default.INDEX_RANGE]),o(n,i.default.INITIALIZATION,[i.default.RANGE]),o(n,i.default.REPRESENTATION_INDEX,[i.default.RANGE]),o(n,i.default.SEGMENT_LIST,[i.default.INDEX_RANGE]),o(n,i.default.BITSTREAM_SWITCHING,[i.default.RANGE]),o(n,i.default.SEGMENT_URL,[i.default.MEDIA_RANGE,i.default.INDEX_RANGE]),o(n,i.default.SEGMENT_TEMPLATE,[i.default.INDEX_RANGE,i.default.MEDIA,i.default.INDEX,i.default.INITIALIZATION_MINUS,i.default.BITSTREAM_SWITCHING_MINUS]),o(n,i.default.ASSET_IDENTIFIER,[i.default.VALUE,i.default.ID]),o(n,i.default.EVENT_STREAM,[i.default.VALUE]),o(n,i.default.ADAPTATION_SET,[i.default.PROFILES,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.CONTENT_TYPE]),o(n,i.default.FRAME_PACKING,[i.default.VALUE,i.default.ID]),o(n,i.default.AUDIO_CHANNEL_CONFIGURATION,[i.default.VALUE,i.default.ID]),o(n,i.default.CONTENT_PROTECTION,[i.default.VALUE,i.default.ID]),o(n,i.default.ESSENTIAL_PROPERTY,[i.default.VALUE,i.default.ID]),o(n,i.default.SUPPLEMENTAL_PROPERTY,[i.default.VALUE,i.default.ID]),o(n,i.default.INBAND_EVENT_STREAM,[i.default.VALUE,i.default.ID]),o(n,i.default.ACCESSIBILITY,[i.default.VALUE,i.default.ID]),o(n,i.default.ROLE,[i.default.VALUE,i.default.ID]),o(n,i.default.RATING,[i.default.VALUE,i.default.ID]),o(n,i.default.VIEWPOINT,[i.default.VALUE,i.default.ID]),o(n,i.default.CONTENT_COMPONENT,[i.default.CONTENT_TYPE]),o(n,i.default.REPRESENTATION,[i.default.ID,i.default.DEPENDENCY_ID,i.default.MEDIA_STREAM_STRUCTURE_ID]),o(n,i.default.SUBSET,[i.default.ID]),o(n,i.default.METRICS,[i.default.METRICS_MINUS]),o(n,i.default.REPORTING,[i.default.VALUE,i.default.ID]),n);if(r.hasOwnProperty(t)){var a=r[t];return void 0!==a&&a.indexOf(e.name)>=0}return!1}),(function(e){return String(e)})))}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}(r.default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(39)),i=o(n(1)),a=o(n(9));function o(e){return e&&e.__esModule?e:{default:e}}var s=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){for(var t=[a.default.MIN_BUFFER_TIME,a.default.MEDIA_PRESENTATION_DURATION,a.default.MINIMUM_UPDATE_PERIOD,a.default.TIMESHIFT_BUFFER_DEPTH,a.default.MAX_SEGMENT_DURATION,a.default.MAX_SUBSEGMENT_DURATION,a.default.SUGGESTED_PRESENTATION_DELAY,a.default.START,i.default.START_TIME,a.default.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return s.test(e.value);return!1}),(function(e){var t=s.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),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)}(t,e),t}(r.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(39),a=(r=i)&&r.__esModule?r:{default:r};var o=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return o.test(e.value)}),(function(e){var t=o.exec(e),n=void 0;if(n=Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[4],10),parseInt(t[5],10),t[6]&&parseInt(t[6],10)||0,t[7]&&1e3*parseFloat(t[7])||0),t[9]&&t[10]){var r=60*parseInt(t[9],10)+parseInt(t[10],10);n+=("+"===t[8]?-1:1)*r*60*1e3}return new Date(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)}(t,e),t}(a.default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(39),a=(r=i)&&r.__esModule?r:{default:r};var o=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return o.test(e.value)}),(function(e){return parseFloat(e)})))}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}(a.default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(90)),i=a(n(9));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[i.default.PROFILES,i.default.WIDTH,i.default.HEIGHT,i.default.SAR,i.default.FRAMERATE,i.default.AUDIO_SAMPLING_RATE,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.MAXIMUM_SAP_PERIOD,i.default.START_WITH_SAP,i.default.MAX_PLAYOUT_RATE,i.default.CODING_DEPENDENCY,i.default.SCAN_TYPE,i.default.FRAME_PACKING,i.default.AUDIO_CHANNEL_CONFIGURATION,i.default.CONTENT_PROTECTION,i.default.ESSENTIAL_PROPERTY,i.default.SUPPLEMENTAL_PROPERTY,i.default.INBAND_EVENT_STREAM];return 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.__proto__||Object.getPrototypeOf(t)).call(this,i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e,[new r.default(i.default.SUB_REPRESENTATION,e)])]))}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}(r.default);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n;this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}return r(e,[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(90)),i=a(n(9));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[i.default.SEGMENT_BASE,i.default.SEGMENT_TEMPLATE,i.default.SEGMENT_LIST];return 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.__proto__||Object.getPrototypeOf(t)).call(this,i.default.PERIOD,e,[new r.default(i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e)])]))}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}(r.default);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(4)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=(0,r.default)(e).getInstance();return{error:function(e){t.trigger(i.default.ERROR,{error:e})}}}s.__dashjs_factory_name="ErrorHandler",t.default=a.default.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(2)),a=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=void 0,n=void 0,r=void 0,o=void 0,s=void 0,u=void 0;function l(e,t){var i=n.getRealPeriodByIndex(t?t.index:null);i&&i.AdaptationSet_asArray&&0!==i.AdaptationSet_asArray.length&&(i.AdaptationSet_asArray=i.AdaptationSet_asArray.filter((function(t){return!t.Representation_asArray||0===t.Representation_asArray.length||!n.getIsTypeOf(t,e)||(t.Representation_asArray=t.Representation_asArray.filter((function(e,i){var a=n.getCodec(t,i,!0);return!!r.supportsCodec(a)||(s.error("[Stream] codec not supported: "+a),!1)})),t.Representation_asArray&&t.Representation_asArray.length>0)})))}return t={setConfig:function(e){e&&(e.adapter&&(n=e.adapter),e.capabilities&&(r=e.capabilities),e.settings&&(o=e.settings))},filterUnsupportedFeaturesOfPeriod:function(e){l(a.default.VIDEO,e),l(a.default.AUDIO,e),o.get().streaming.filterUnsupportedEssentialProperties&&function(e){var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var t=n.getEssentialPropertiesForRepresentation(e);if(t&&t.length>0)for(var i=0;i<t.length;){if(!r.supportsEssentialProperty(t[i]))return s.debug("[Stream] EssentialProperty not supported: "+t[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e),function(e){if(!u||0===u.length)return;var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!u.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e)},setCustomCapabilitiesFilters:function(e){u=e}},s=(0,i.default)(e).getInstance().getLogger(t),t}s.__dashjs_factory_name="CapabilitiesFilter",t.default=r.default.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(203)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0;return{initialize:function(t){if(e=new r.default,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var i=t.substr(n+1).split("&"),a=0,o=i.length;a<o;++a){var s=i[a],u=s.indexOf("=");if(-1!==u){var l=s.substring(0,u);e.hasOwnProperty(l)&&(e[l]=s.substr(u+1))}}},getURIFragmentData:function(){return e}}}o.__dashjs_factory_name="URIFragmentModel",t.default=i.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(4)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=(0,r.default)(e).getInstance(),n=void 0;return{getValue:function(){return n},setValue:function(e){n=e,e&&t.trigger(i.default.MANIFEST_LOADED,{data:e})}}}s.__dashjs_factory_name="ManifestModel",t.default=a.default.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(83)),i=l(n(0)),a=l(n(1)),o=l(n(78)),s=l(n(23)),u=n(15);function l(e){return e&&e.__esModule?e:{default:e}}function c(){var e,t=void 0,n=void 0,i=void 0,l=this.context,c=(0,s.default)(l).getInstance();function d(e){var t=void 0;for(t=0;t<i.length;t++)if(i[t].rulename===e)return t;return-1}function f(){return c.get().streaming.lowLatencyEnabled?c.get().streaming.liveDelay||3:c.get().streaming.liveDelay}function h(e,n){p(e,n);var i=new r.default;i.schemeIdUri=e,i.value=n,t.push(i)}function p(e,n){(0,u.checkParameterType)(e,"string"),(0,u.checkParameterType)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return i},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==o.default.ABANDON_FRAGMENT_RULES&&e!==o.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw a.default.BAD_ARGUMENT_ERROR;var r=d(t);-1===r?i.push({type:e,rulename:t,rule:n}):(i[r].type=e,i[r].rule=n)},removeABRCustomRule:function(e){if(e){var t=d(e);-1!==t&&i.splice(t,1)}else i=[]},getStableBufferTime:function(){if(c.get().streaming.lowLatencyEnabled)return.6*f();var e=c.get().streaming.stableBufferTime;return e>-1?e:c.get().streaming.fastSwitchEnabled?20:12},getRetryAttemptsForType:function(e){var t=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryAttempts[e]*t:c.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryIntervals[e]/t:c.get().streaming.retryIntervals[e]},getLiveDelay:f,getLiveCatchupLatencyThreshold:function(){try{var e=c.get().streaming.liveCatchup.latencyThreshold,t=f();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=c.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?f():c.get().streaming.liveCatchup.minDrift+f():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:h,removeUTCTimingSource:p,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=c.get().streaming.utcSynchronization.defaultTimingSource;h(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return c.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},i=[],e}c.__dashjs_factory_name="MediaPlayerModel",t.default=i.default.getSingletonFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(0)),i=s(n(3)),a=s(n(4)),o=s(n(2));function s(e){return e&&e.__esModule?e:{default:e}}function u(){var e=void 0,t=void 0,n=void 0,r=void 0,s=void 0,u=this.context,l=(0,i.default)(u).getInstance(),c=[];function d(){n&&(n.playbackRate=s||1,n.removeEventListener("canplay",d))}function f(e){n&&(n.readyState<=2&&e>0?n.addEventListener("canplay",d):n.playbackRate=e)}function h(){return c.length>0}function p(e){var t=c.indexOf(e),r=void 0;null!==e&&(-1!==t&&c.splice(t,1),n&&!1===h()&&0===n.playbackRate&&(f(s||1),n.paused||((r=document.createEvent("Event")).initEvent("playing",!0,!1),n.dispatchEvent(r))))}function g(){if(n&&h()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function v(){return n?n.buffered:null}function m(e,t,r,i,a){if(n)for(var o=0;o<n.textTracks.length;o++)if(n.textTracks[o].kind===e&&(!t||n.textTracks[o].label==t)&&n.textTracks[o].language===r&&n.textTracks[o].isTTML===i&&n.textTracks[o].isEmbedded===a)return n.textTracks[o];return null}return e={initialize:function(){l.on(a.default.PLAYBACK_PLAYING,g,this)},setCurrentTime:function(e,t){if(n){if(n.currentTime==e)return;try{e=t?function(e){var t=v(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),o=t.end(i),s=Math.abs(a-e),u=Math.abs(o-e);if(e>=a&&e<=o)return e;s<r&&(r=s,n=a),u<r&&(r=u,n=o)}return n}(e):e,n.currentTime=e}catch(t){0===n.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout((function(){n.currentTime=e}),400)}}},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&l.trigger(a.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing ("+e+")")}))}},isPaused:function(){return n?n.paused:null},pause:function(){n&&(n.pause(),n.autoplay=!1)},isStalled:h,isSeeking:function(){return n?n.seeking:null},getTime:function(){return n?n.currentTime:null},getPlaybackRate:function(){return n?n.playbackRate:null},setPlaybackRate:f,getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){var t=void 0;if(null===e||!n||n.seeking||-1!==c.indexOf(e))return;c.push(e),n&&1===c.length&&((t=document.createEvent("Event")).initEvent("waiting",!0,!1),s=n.playbackRate,f(0),n.dispatchEvent(t))}(e):p(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:function(e,t){n&&n.addEventListener(e,t)},removeEventListener:function(e,t){n&&n.removeEventListener(e,t)},getReadyState:function(){return n?n.readyState:NaN},getBufferRange:v,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:m,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=m(e,t,r,i,a);return o||((o=n.addTextTrack(e,t,r)).isEmbedded=a,o.isTTML=i),o},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){l.off(a.default.PLAYBACK_PLAYING,g,this)}},t=(0,o.default)(u).getInstance().getLogger(e),e}u.__dashjs_factory_name="VideoModel",t.default=r.default.getSingletonFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(2)),a=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var s=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}];function u(e){e=e||{};var t=this.context,n=e.settings,r=void 0,o=void 0,u=void 0;function l(e){if(void 0!==u)return u;u=!1;var t=void 0;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return o.warn("DOMStorage access denied: "+e.message),u}if(!t||"localStorage"!==e&&"sessionStorage"!==e)return u;try{t.setItem("1","1"),t.removeItem("1"),u=!0}catch(e){o.warn("DOMStorage is supported, but cannot be used: "+e.message)}return u}function c(){return 6e5*Math.round((new Date).getTime()/6e5)}function d(e,t){return l(e)&&n.get().streaming[t+"CachingInfo"].enabled}function f(){if(!n)throw new Error(a.default.MISSING_CONFIG_ERROR)}return r={getSavedBitrateSettings:function(e){var t=NaN;if(f(),d("localStorage","lastBitrate")){var r="dashjs_?_bitrate".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,o.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(d("localStorage","lastBitrate")&&t){var n="dashjs_?_bitrate".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:c()}))}catch(e){o.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(f(),d("localStorage","lastMediaSettings")){var r="dashjs_?_settings".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=i.settings,a&&(localStorage.removeItem(r),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(d("localStorage","lastMediaSettings")){var n="dashjs_?_settings".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:c()}))}catch(e){o.error(e.message)}}}},o=(0,i.default)(t).getInstance().getLogger(r),l("localStorage")&&s.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){o.error(e.message)}}})),r}u.__dashjs_factory_name="DOMStorage";var l=r.default.getSingletonFactory(u);t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(209)),a=o(n(210));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,o=e.dashMetrics,s=e.mediaPlayerModel,u=e.errHandler,l=e.baseURLController,c=e.debug,d=e.boxParser,f=e.requestModifier,h=e.errors,p=void 0,g=void 0,v=void 0;function m(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}function y(e){m(e.mimeType)?v.loadInitialization(e.streamId,e.mediaType,e.representation):g.loadInitialization(e.streamId,e.mediaType,e.representation)}function E(e){m(e.mimeType)?v.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback):g.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback)}return p={initialize:function(){n.on(r.SEGMENTBASE_INIT_REQUEST_NEEDED,y,p),n.on(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,E,p),g.initialize(),v.initialize()},reset:function(){n.off(r.SEGMENTBASE_INIT_REQUEST_NEEDED,y,p),n.off(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,E,p)}},g=(0,i.default)(t).getInstance(),v=(0,a.default)(t).getInstance(),g.setConfig({baseURLController:l,dashMetrics:o,mediaPlayerModel:s,errHandler:u,eventBus:n,events:r,errors:h,debug:c,boxParser:d,requestModifier:f}),v.setConfig({baseURLController:l,dashMetrics:o,mediaPlayerModel:s,errHandler:u,eventBus:n,events:r,errors:h,debug:c,requestModifier:f}),p}s.__dashjs_factory_name="SegmentBaseController";var u=r.default.getSingletonFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(52)),i=u(n(6)),a=u(n(0)),o=u(n(16)),s=u(n(29));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=this.context,t=void 0,n=void 0,a=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0;function _(){if(!T||!T.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function b(e){if(e.url){var t=new o.default;return t.setInfo(e),t}}function S(e,t,n,r){g.trigger(p.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new i.default(v.SEGMENT_BASE_LOADER_ERROR_CODE,v.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}return t={setConfig:function(e){e.baseURLController&&(T=e.baseURLController),e.dashMetrics&&(c=e.dashMetrics),e.mediaPlayerModel&&(f=e.mediaPlayerModel),e.errHandler&&(a=e.errHandler),e.settings&&(d=e.settings),e.boxParser&&(u=e.boxParser),e.events&&(p=e.events),e.eventBus&&(g=e.eventBus),e.debug&&(n=e.debug.getLogger(t)),e.requestModifier&&(l=e.requestModifier),e.errors&&(v=e.errors),e.urlUtils&&(E=e.urlUtils),e.constants&&(m=e.constants),e.dashConstants&&(y=e.dashConstants)},initialize:function(){h=(0,s.default)(e).create({errHandler:a,dashMetrics:c,mediaPlayerModel:f,requestModifier:l,useFetch:d?d.get().streaming.lowLatencyEnabled:null,boxParser:u,errors:v,urlUtils:E,constants:m,dashConstants:y})},loadInitialization:function e(t,r,i,a){_();var o=null,s=i?T.resolve(i.path):null,l=a||{init:!0,url:s?s.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:r};n.debug("Start searching for initialization.");var c=b(l);h.load({request:c,success:function(n){l.bytesLoaded=l.range.end,(o=u.findInitRange(n))?(i.range=o,g.trigger(p.INITIALIZATION_LOADED,{representation:i},{streamId:t,mediaType:r})):(l.range.end=l.bytesLoaded+l.bytesToLoad,e(t,r,i,l))},error:function(){g.trigger(p.INITIALIZATION_LOADED,{representation:i},{streamId:t,mediaType:r})}}),n.debug("Perform init search: "+l.url)},loadSegments:function e(t,i,a,o,s,l){if(_(),o&&(void 0===o.start||void 0===o.end)){var c=o?o.toString().split("-"):null;o=c?{start:parseFloat(c[0]),end:parseFloat(c[1])}:null}s=s||S;var d=null,f=null,p=!!o,g=a?T.resolve(a.path):null,v={init:!1,url:g?g.url:void 0,range:p?o:{start:0,end:1500},searching:!p,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:i},m=b(v);h.load({request:m,success:function(o){var l=v.bytesToLoad,c=o.byteLength;if(v.bytesLoaded=v.range.end-v.range.start,d=u.parse(o),(f=d.getBox("sidx"))&&f.isComplete){var h=f.references,p=void 0,g=void 0;if(null!=h&&h.length>0&&(p=1===h[0].reference_type),p){n.debug("Initiate multiple SIDX load."),v.range.end=v.range.start+f.size;var m=void 0,y=void 0,E=void 0,T=void 0,_=[],b=0,S=(f.offset||v.range.start)+f.size,A=function(e,t,n){n?(_=_.concat(n),++b>=y&&(_.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),s(e,t,_,a))):s(e,t,null,a)};for(m=0,y=h.length;m<y;m++)E=S,T=S+h[m].referenced_size-1,S+=h[m].referenced_size,e(t,i,a,{start:E,end:T},A,v)}else n.debug("Parsing segments from SIDX. representation "+i+" - id: "+a.id+" for range : "+v.range.start+" - "+v.range.end),g=function(e,t){for(var n=e.references,i=n.length,a=e.timescale,o=e.earliest_presentation_time,s=t.range.start+e.offset+e.first_offset+e.size,u=[],l=void 0,c=void 0,d=void 0,f=void 0,h=0;h<i;h++)d=n[h].subsegment_duration,f=n[h].referenced_size,(l=new r.default).duration=d,l.startTime=o,l.timescale=a,c=s+f-1,l.mediaRange=s+"-"+c,u.push(l),o+=d,s+=f;return u}(f,v),s(t,i,g,a)}else{if(f)v.range.start=f.offset||v.range.start,v.range.end=v.range.start+(f.size||l);else{if(c<v.bytesLoaded)return void s(t,i,null,a);var I=d.getLastBox();I&&I.size?(v.range.start=I.offset+I.size,v.range.end=v.range.start+l):v.range.end+=l}e(t,i,a,v.range,s,v)}},error:function(){s(t,i,null,a)}}),n.debug("Perform SIDX load: "+v.url+" with range : "+v.range.start+" - "+v.range.end)},reset:function(){h.abort(),h=null,a=null,u=null,l=null}}}l.__dashjs_factory_name="SegmentBaseLoader",t.default=a.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(211)),i=c(n(1)),a=c(n(0)),o=c(n(52)),s=c(n(16)),u=c(n(29)),l=c(n(6));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=void 0,n=void 0,a=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0;function T(t,i,s,u){var l,c,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0;for(f=[],p=0,c=(l=function(t){var n=[],i=(0,r.default)(e).create({data:t}),o=void 0,s=void 0;for(i.consumeTagAndSize(a.Segment.Cues);i.moreData()&&i.consumeTagAndSize(a.Segment.Cues.CuePoint,!0);){for((o={}).CueTime=i.parseTag(a.Segment.Cues.CuePoint.CueTime),o.CueTracks=[];i.moreData()&&i.consumeTag(a.Segment.Cues.CuePoint.CueTrackPositions,!0);){var u=i.getMatroskaCodedNum(),l=i.getPos();if((s={}).Track=i.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===s.Track)throw new Error("Cue track cannot be 0");s.ClusterPosition=i.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),o.CueTracks.push(s),i.setPos(l+u)}if(0===o.CueTracks.length)throw new Error("Mandatory cuetrack not found");n.push(o)}if(0===n.length)throw new Error("mandatory cuepoint not found");return n}(t)).length;p<c;p+=1)h=new o.default,d=0,d=p<l.length-1?l[p+1].CueTime-l[p].CueTime:u-l[p].CueTime,h.duration=d,h.startTime=l[p].CueTime,h.timescale=1e3,g=l[p].CueTracks[0].ClusterPosition+i,v=p<l.length-1?l[p+1].CueTracks[0].ClusterPosition+i-1:s-1,h.mediaRange=g+"-"+v,f.push(h);return n.debug("Parsed cues: "+f.length+" cues."),f}function _(){if(!E||!E.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function b(e,t,n,r){v.trigger(m.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new l.default(y.SEGMENT_BASE_LOADER_ERROR_CODE,y.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}function S(e){var t=new s.default;return t.setInfo(e),t}return t={setConfig:function(e){if(!(e.baseURLController&&e.dashMetrics&&e.mediaPlayerModel&&e.errHandler))throw new Error(i.default.MISSING_CONFIG_ERROR);E=e.baseURLController,f=e.dashMetrics,h=e.mediaPlayerModel,c=e.errHandler,g=e.settings,m=e.events,v=e.eventBus,y=e.errors,n=e.debug.getLogger(t),d=e.requestModifier},initialize:function(){p=(0,u.default)(e).create({errHandler:c,dashMetrics:f,mediaPlayerModel:h,requestModifier:d,useFetch:g?g.get().streaming.lowLatencyEnabled:null,errors:y})},loadInitialization:function(e,t,r,i){_();var a=null,o=r?E.resolve(r.path):null,s=r?r.range.split("-"):null,u=i||{range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:a,url:o?o.url:void 0,init:!0,mediaType:t};n.info("Start loading initialization."),a=S(u),p.load({request:a,success:function(){v.trigger(m.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})},error:function(){v.trigger(m.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})}}),n.debug("Perform init load: "+u.url)},loadSegments:function(t,i,o,s,u){_();var l=null,c=o?E.resolve(o.path):null,d=c?c.url:void 0;u=u||b,l=S({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:l,url:d,init:!1,mediaType:i}),n.debug("Parsing ebml header"),p.load({request:l,success:function(l){!function(t,i,o,s){if(t&&0!==t.byteLength){var u,l=(0,r.default)(e).create({data:t}),c=void 0,d=void 0,f=void 0,h=o?o.split("-"):null,g=null,v={url:i,range:{start:h?parseFloat(h[0]):null,end:h?parseFloat(h[1]):null},request:g};for(n.debug("Parse EBML header: "+v.url),l.skipOverElement(a.EBML),l.consumeTag(a.Segment),f=l.getMatroskaCodedNum(),f+=l.getPos(),u=l.getPos();l.moreData()&&!l.consumeTagAndSize(a.Segment.Info,!0);)if(!(l.skipOverElement(a.Segment.SeekHead,!0)||l.skipOverElement(a.Segment.Tracks,!0)||l.skipOverElement(a.Segment.Cues,!0)||l.skipOverElement(a.Void,!0)))throw new Error("no valid top level element found");for(;void 0===c;){var m=l.getMatroskaCodedNum(!0),y=l.getMatroskaCodedNum();switch(m){case a.Segment.Info.Duration.tag:c=l[a.Segment.Info.Duration.parse](y);break;default:l.setPos(l.getPos()+y)}}g=S(v);p.load({request:g,success:function(e){d=T(e,u,f,c),s(d)},error:function(){n.error("Download Error: Cues "+v.url),s(null)}}),n.debug("Perform cues load: "+v.url+" bytes="+v.range.start+"-"+v.range.end)}else s(null)}(l,d,s,(function(e){u(t,i,e,o)}))},error:function(){u(t,i,null,o)}})},reset:function(){c=null,d=null}},a={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},t}d.__dashjs_factory_name="WebmSegmentBaseLoader",t.default=a.default.getSingletonFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=void 0,n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,o=0,s=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((s&i)===i){o=void 0===e?s&~i:s,a=u;break}i>>=1}for(u=0;u<a;u+=1,t+=1)o=o<<8|255&n.getUint8(r+t);return r+=t,o}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n=i(e,t),o=void 0;return n&&(o=a(),r+=o),n},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t=void 0;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t},moreData:function(){return r<n.byteLength}}}o.__dashjs_factory_name="EBMLParser",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(9)),i=f(n(213)),a=f(n(214)),o=f(n(215)),s=f(n(216)),u=f(n(84)),l=f(n(0)),c=f(n(56)),d=f(n(217));function f(e){return e&&e.__esModule?e:{default:e}}function h(){var e,t=void 0,n=void 0,l=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=this.context;function m(e,n,i){var a,o=t.getAdaptationsForType(l[0].mpd.manifest,e,n);if(!o||0===o.length)return null;if(o.length>1&&i){var s=E(i,n);if(h[i.id]&&h[i.id][n])for(var u=0,c=o.length;u<c;u++)if(y(h[i.id][n],s[u]))return o[u];for(var d=0,f=o.length;d<f;d++)if(a=o[d],t.getRolesForAdaptation(a).filter((function(e){return e.value===r.default.MAIN}))[0])return o[d]}return o[0]}function y(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function E(e,n,r){var i,a=l,o=r,s=[],u=void 0,c=void 0,d=void 0,h=void 0,g=void 0,v=void 0;if(o)C(),a=T(o);else{if(!(l.length>0))return s;o=l[0].mpd.manifest}var m=I(e,a);m&&(v=m.id);var y=t.getAdaptationsForType(o,e?e.index:null,n!==p.EMBEDDED_TEXT?n:p.VIDEO);if(!y||0===y.length)return s;for(f[v]=f[v]||t.getAdaptationsForPeriod(m),h=0,i=y.length;h<i;h++)if(u=y[h],d=t.getIndexForAdaptation(u,o,e.index),c=w(f[v][d]),n===p.EMBEDDED_TEXT){var E=c.accessibility.length;for(g=0;g<E;g++)if(c){var _=c.accessibility[g];if(0===_.indexOf("cea-608:")){var b=_.substring(8).split(";");if("CC"===b[0].substring(0,2))for(g=0;g<b.length;g++)c||(c=w.call(this,f[v][d])),R(c,b[g].substring(0,3),b[g].substring(4)),s.push(c),c=null;else for(g=0;g<b.length;g++)c||(c=w.call(this,f[v][d])),R(c,"CC"+(g+1),b[g]),s.push(c),c=null}else 0===_.indexOf("cea-608")&&(R(c,p.CC1,"eng"),s.push(c),c=null)}}else n===p.IMAGE?(c.type=p.IMAGE,s.push(c),c=null):c&&s.push(c);return s}function T(e){var n=_(e);return t.getRegularPeriods(n)}function _(e){var n=S(e);return t.getMpd(n)}function b(){l=[],f={},h={}}function S(e){return e||(l.length>0?l[0].mpd.manifest:null)}function A(e){return e&&e.streamInfo&&void 0!==e.streamInfo.id&&f[e.streamInfo.id]?f[e.streamInfo.id][e.index]:null}function I(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function w(e){if(!e)return null;var n,r=new a.default,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];return r.id=e.id,r.index=e.index,r.type=e.type,r.streamInfo=D(e.period),r.representationCount=t.getRepresentationCount(i),r.labels=t.getLabelsForAdaptation(i),r.lang=t.getLanguageForAdaptation(i),n=t.getViewpointForAdaptation(i),r.viewpoint=n?n.value:void 0,r.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==g&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.contentProtection&&r.contentProtection.forEach((function(e){e.KID=t.getKID(e)})),r.isText=t.getIsTextTrack(r.mimeType),r.supplementalProperties=t.getSupplementalPropperties(i),r}function R(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=p.EMBEDDED_TEXT,e.codec="cea-608-in-SEI",e.isText=!0,e.isEmbedded=!0,e.lang=n,e.roles=["caption"]}function D(e){var n,r,i=new o.default;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new s.default).DVRWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function C(){if(!p)throw new Error("setConfig function has to be called previously")}function M(e){return l.length>0?l[0].mpd.manifest.Period_asArray[e]:null}function L(e,t,n){var r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e)for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)for(a=r[o].Representation_asArray,s=0;s<a.length;s+=1)if(t===(i=a[s]).id)return n?s:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=L(M(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=L(e,t,!0);return null!==n?n:-1}(M(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i=void 0,a=void 0,o=void 0;if(!e||!n)return-1;for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)if(i=r[o],a=i.Representation_asArray,t.getIsTypeOf(i,n))return a.length;return-1}(M(n),e)},convertDataToRepresentationInfo:function(e){if(e){var n=new i.default,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],a=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(a),n.DVRWindow=e.segmentAvailabilityRange,n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=w(e.adaptation),n}return null},getDataForMedia:A,getStreamsInfo:function(e,t){var n=[],r=l;if(e&&(C(),r=T(e)),r.length>0){(!t||t>r.length)&&(t=r.length);for(var i=0;i<t;i++)n.push(D(r[i]))}return n},getMediaInfoForType:function(e,n){if(0===l.length||!e)return null;var r=I(e,l);if(!r)return null;var i=r.id;f[i]=f[i]||t.getAdaptationsForPeriod(r);var a=m(e.index,n,e);if(!a)return null;var o=t.getIndexForAdaptation(a,l[0].mpd.manifest,e.index);return w(f[i][o])},getAllMediaInfoForType:E,getAdaptationForType:m,getRealAdaptation:function(e,n){var r,i=void 0,a=I(e,l);return r=n?n.id:null,l.length>0&&a&&(i=r?t.getAdaptationForId(r,l[0].mpd.manifest,a.index):t.getAdaptationForIndex(n?n.index:null,l[0].mpd.manifest,a.index)),i},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,l[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=A(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var r=[];if(l.length>0){var s=l[0].mpd.manifest;e instanceof o.default?r=t.getEventsForPeriod(I(e,l)):e instanceof a.default?r=t.getEventStreamForAdaptationSet(s,A(e)):e instanceof i.default&&(r=t.getEventStreamForRepresentation(s,n))}return r},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var o=new u.default,s=e.timescale||1,l=r.adaptation.period.start,c=t[i+"/"+a],d=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,f=e.presentation_time_delta/s,h=void 0;h=0===e.version?l+n-d+f:l-d+f;var p=e.event_duration,g=e.id,v=e.message_data;return o.eventStream=c,o.eventStream.value=a,o.eventStream.timescale=s,o.duration=p,o.id=g,o.calculatedPresentationTime=h,o.messageData=v,o.presentationTimeDelta=f,o}catch(e){return null}},getMpd:_,setConfig:function(e){e&&(e.constants&&(p=e.constants),e.cea608parser&&(g=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;C(),l=T(e),f={}},getIsTextTrack:function(e){return t.getIsTextTrack(e)},getUTCTimingSources:function(){var e=S();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=l.length>0?l[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=_(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=S(e);return t.getIsDynamic(n)},getDuration:function(e){var n=S(e);return t.getDuration(n)},getRegularPeriods:T,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getVoAdaptations:function(){return f},getVoPeriods:function(){return l},getPeriodById:function(e){if(!e||0===l.length)return null;var t=l.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){h[e]=h[e]||{},h[e][t]=h[e][t]||{},h[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),o=t.getPublishTime(e),s=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&o&&u&&o.getTime()==u.getTime()&&s&&o.getTime()<s.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var o=(i[r+"_asArray"]||[]).indexOf(a),s="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=o)){var u=i[r+"_asArray"];u.splice(o,1),u.length>1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=o?o+(s?0:1)+("replace"==t.action?-1:0):s?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},reset:b},t=(0,c.default)(v).getInstance(),n=(0,d.default)(v).getInstance(),b(),e}h.__dashjs_factory_name="DashAdapter",t.default=l.default.getSingletonFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(9)),i=u(n(0)),a=u(n(2)),o=u(n(218)),s=u(n(219));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=void 0,t=void 0,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(r.default.PUBLISH_TIME)?new Date(e[r.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_PUBLISH_TIME)?new Date(e[r.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[r.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: "+n),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: "+r.type+"="+r.__text),null;i=i+"/"+r.type}var a=new o.default(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: "+n+" - "+i),null;var u=null;a.findsAttribute()?u=r.__text||"":"remove"!==n&&(u=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var l=new s.default(n,a,u);return"add"===n&&(l.position=r.pos),l})).filter((function(e){return!!e})):[]}},t=(0,a.default)(n).getInstance().getLogger(e),e}l.__dashjs_factory_name="PatchManifestModel",t.default=i.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}return r(e,[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var o=this.path[i];if(a=o.name,i!==this.path.length-1||!a.startsWith("@")){var s=n[a+"_asArray"]||[];0===s.length&&n[a]&&s.push(n[a]),o.position?r=s[o.position]||null:o.attribute?function(){var e=o.attribute;r=s.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=s[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=n,this.value=r,this.position=null}return r(e,[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(1)),i=n(8),a=d(n(0)),o=d(n(10)),s=d(n(221)),u=d(n(222)),l=d(n(30)),c=n(54);function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t,n=this.context,a=void 0,d=void 0,f=void 0,h=e.metricsModel;function p(e){var t=h.getMetricsFor(e,!0);if(!t)return null;var n=t.HttpList,r=null,i=void 0;if(!n||n.length<=0)return null;for(i=n.length-1;i>=0;){if(n[i].responsecode){r=n[i];break}i--}return r}function g(e){var t=h.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function v(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return v(h.getMetricsFor(e,!0),o.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return v(h.getMetricsFor(e,!0),o.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=v(h.getMetricsFor(e,!0),o.default.BUFFER_LEVEL);return t?s.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:p,getHttpRequests:g,getCurrentDroppedFrames:function(){return v(h.getMetricsFor(r.default.VIDEO,!0),o.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return v(h.getMetricsFor(e,!0),o.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return v(e?h.getMetricsFor(e,!0):h.getMetricsFor(r.default.VIDEO,!0)||h.getMetricsFor(r.default.AUDIO,!0),o.default.DVR_INFO)},getCurrentManifestUpdate:function(){return v(h.getMetricsFor(r.default.STREAM),o.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){var n={},r=p(e);return r&&(n=l.default.parseHttpHeaders(r._responseHeaders)),void 0===n[t]?null:n[t]},getLatestMPDRequestHeaderValueByID:function(e){var t,n={},a=void 0,o=void 0;for(o=(t=g(r.default.STREAM)).length-1;o>=0;o--)if((a=t[o]).type===i.HTTPRequest.MPD_TYPE){n=l.default.parseHttpHeaders(a._responseHeaders);break}return void 0===n[e]?null:n[e]},addRepresentationSwitch:function(e,t,n,r,i){h.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){h.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();h.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();h.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();h.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){h.addManifestUpdate(r.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){h.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i)},addSchedulingInfo:function(e,t){h.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){h.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){h.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){h.addBufferState(e,t,n)},addDroppedFrames:function(e){h.addDroppedFrames(r.default.VIDEO,e)},addPlayList:function(){f&&(h.addPlayList(f),f=null)},addDVBErrors:function(e){h.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(f=new c.PlayList).start=new Date,f.mstart=e,f.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===a&&(a=!1,(d=new c.PlayListTrace).representationid=e,d.start=new Date,d.mstart=t,d.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(e){if(d)for(var t in d)d[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===a&&f&&d&&d.start){var n=d.start,r=e.getTime()-n.getTime();d.duration=r,d.stopreason=t,f.trace.push(d),a=!0}},clearAllCurrentMetrics:function(){h.clearAllCurrentMetrics()}},h=h||(0,u.default)(n).getInstance({settings:e.settings}),a=!0,d=null,f=null,t}f.__dashjs_factory_name="DashMetrics",t.default=a.default.getSingletonFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"round10",value:function(e,t){return function(e,t,n){if(void 0===n||0==+n)return Math[e](t);if(n=+n,null===(t=+t)||isNaN(t)||!("number"==typeof n&&n%1==0))return NaN;return t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))}("round",e,t)}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=y(n(1)),i=y(n(10)),a=y(n(223)),o=n(8),s=y(n(224)),u=y(n(225)),l=y(n(226)),c=y(n(227)),d=y(n(228)),f=n(229),h=y(n(230)),p=y(n(3)),g=y(n(231)),v=y(n(4)),m=y(n(0));function y(e){return e&&e.__esModule?e:{default:e}}function E(e){var t,n=(e=e||{}).settings,m=this.context,y=(0,p.default)(m).getInstance(),E=void 0;function T(){y.trigger(v.default.METRICS_CHANGED)}function _(e){y.trigger(v.default.METRIC_CHANGED,{mediaType:e}),T()}function b(e,t,n){y.trigger(v.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),_(e)}function S(e,t,n){y.trigger(v.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),_(e)}function A(e,t){var n=null;return e?(E.hasOwnProperty(e)?n=E[e]:t||(n=new a.default,E[e]=n),n):n}function I(e,t,r){var i=A(e);null!==i&&(i[t].push(r),i[t].length>n.get().streaming.metricsMaxListDepth&&i[t].shift())}function w(e,t,n){I(e,t,n),S(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete E[e],_(e)},clearAllCurrentMetrics:function(){E={},T()},getMetricsFor:A,addHttpRequest:function e(t,n,r,a,s,u,l,c,d,f,h,p,g,v,m){var y=new o.HTTPRequest;u&&u!==a&&(e(t,null,r,a,s,null,null,c,d,null,null,null,g,null,null),y.actualurl=u),y.tcpid=n,y.type=r,y.url=a,y.range=c,y.trequest=d,y.tresponse=f,y.responsecode=p,y._tfinish=h,y._stream=t,y._mediaduration=g,y._quality=s,y._responseHeaders=v,y._serviceLocation=l,m?m.forEach((function(e){!function(e,t,n,r){var i=new o.HTTPRequestTrace;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||(e.interval=0),e.interval+=n}(y,e.s,e.d,e.b)})):(delete y.interval,delete y.trace),w(t,i.default.HTTP_REQUEST,y)},addRepresentationSwitch:function(e,t,n,r,a){var o=new s.default;o.t=t,o.mt=n,o.to=r,a?o.lto=a:delete o.lto,w(e,i.default.TRACK_SWITCH,o)},addBufferLevel:function(e,t,n){var r=new u.default;r.t=t,r.level=n,w(e,i.default.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new l.default;r.target=n,r.state=t,w(e,i.default.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var a=new c.default;a.time=t,a.range=r,a.manifestInfo=n,w(e,i.default.DVR_INFO,a)},addDroppedFrames:function(e,t){var n=new d.default,r=A(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||w(e,i.default.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,a,o,s,u,l){var c=new h.default;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=a,c.duration=o,c.quality=s,c.range=u,c.state=l,w(e,i.default.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new g.default;r.loadingRequests=t,r.executedRequests=n,A(e).RequestsQueue=r,S(e,i.default.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,a,o,s,u,l,c,d){var h=new f.ManifestUpdate;h.mediaType=e,h.type=t,h.requestTime=n,h.fetchTime=a,h.availabilityStartTime=o,h.presentationStartTime=s,h.clientTimeOffset=u,h.currentTime=l,h.buffered=c,h.latency=d,I(r.default.STREAM,i.default.MANIFEST_UPDATE,h),S(e,i.default.MANIFEST_UPDATE,h)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];b(e.mediaType,i.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,a){if(e){var o=new f.ManifestUpdateStreamInfo;o.id=t,o.index=n,o.start=r,o.duration=a,e.streamInfo.push(o),b(e.mediaType,i.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,a,o,s,u){if(e&&e.representationInfo){var l=new f.ManifestUpdateRepresentationInfo;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=a,l.startNumber=s,l.fragmentInfoType=u,l.presentationTimeOffset=o,e.representationInfo.push(l),b(e.mediaType,i.default.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,w(r.default.STREAM,i.default.PLAY_LIST,e)},addDVBErrors:function(e){w(r.default.STREAM,i.default.DVB_ERRORS,e)}},E={},t}E.__dashjs_factory_name="MetricsModel",t.default=m.default.getSingletonFactory(E)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(10),a=(r=i)&&r.__esModule?r:{default:r};t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=a.default.BUFFER_EMPTY}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});t.ManifestUpdate=function e(){r(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},t.ManifestUpdateStreamInfo=function e(){r(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},t.ManifestUpdateRepresentationInfo=function e(){r(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(3)),i=l(n(4)),a=l(n(0)),o=l(n(9)),s=l(n(56)),u=l(n(23));function l(e){return e&&e.__esModule?e:{default:e}}function c(){var e,t=this.context,n=(0,r.default)(t).getInstance(),a=(0,u.default)(t).getInstance(),l=void 0,c=void 0,d=void 0,f=void 0;function h(e){c=e}function p(e,t,n,r){return r?n&&t.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(t.availabilityStartTime.getTime()+1e3*(e+t.timeShiftBufferDepth)):t.availabilityEndTime:n?new Date(t.availabilityStartTime.getTime()+1e3*(e-c)):t.availabilityStartTime}function g(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*c)/1e3}function v(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){void 0!==e.offset&&(h(e.offset/1e3),d=!0)}function y(){c=0,d=!1,f=NaN}function E(){n.off(i.default.UPDATE_TIME_SYNC_OFFSET,m,this),y()}return e={initialize:function(){y(),n.on(i.default.UPDATE_TIME_SYNC_OFFSET,m,this)},getClientTimeOffset:function(){return c},setClientTimeOffset:h,getExpectedLiveEdge:function(){return f},setExpectedLiveEdge:function(e){f=e},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return p.call(this,e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return p.call(this,e,t,n,!0)},calcPresentationTimeFromWallTime:g,calcPresentationTimeFromMediaTime:v,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcSegmentAvailabilityRange:function(e,t){var n=e.adaptation.period,r={start:n.start,end:n.start+n.duration};if(!t)return r;if(!d&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var i=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0);if(e.segmentInfoType===o.default.SEGMENT_TIMELINE&&a.get().streaming.calcSegmentAvailabilityRangeFromTimeline)return function(e){var t,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],r=l.getRepresentationFor(e.index,n),i=r.SegmentTemplate.SegmentTimeline,a=r.SegmentTemplate.timescale,o=i.S_asArray,s={start:0,end:0},u=0,c=void 0,d=void 0,f=void 0;for(s.start=v(o[0].t/a,e),f=0,t=o.length;f<t;f++)c=o[f],d=0,c.hasOwnProperty("r")&&(d=c.r),u+=c.d/a*(1+d);return s.end=s.start+u,s}(e);var s=g(new Date,n),u=n.start+n.duration;r.start=Math.max(s-n.mpd.timeShiftBufferDepth,n.start);var c=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<i?i-e.availabilityTimeOffset:i;return r.end=s>=u&&s-c<u?u:s-c,r},getPeriodEnd:function(e,t){var n=e.adaptation.period;if(!t)return n.start+n.duration;if(!d&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var r=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0),i=g(new Date,n),a=n.start+n.duration,o=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<r?r-e.availabilityTimeOffset:r;return Math.min(i-o,a)},calcWallTimeForSegment:function(e,t){var n=void 0,r=void 0,i=void 0;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},reset:E},l=(0,s.default)(t).getInstance(),E(),e}c.__dashjs_factory_name="TimelineConverter",t.default=a.default.getSingletonFactory(c)},function(e,t,n){"use strict";var r,i,o,u,l,c={encode:function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},decode:function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}},d={};r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t=0,n=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push(r.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push("=")):1==e.length-t&&(a=e[t]<<16,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push("==")),n.join("")},o=function(){for(var e=[],t=0;t<r.length;++t)e[r.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),u=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var i=(o[e.charCodeAt(t)]<<18)+(o[e.charCodeAt(t+1)]<<12)+(o[e.charCodeAt(t+2)]<<6)+o[e.charCodeAt(t+3)];n.push(255&i>>16),n.push(255&i>>8),n.push(255&i),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},l={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},d.decodeArray=function(e){var t=u(e);return new Uint8Array(t)},d.encodeASCII=function(e){var t=l.encode(e);return i(t)},d.decodeASCII=function(e){var t=u(e);return l.decode(t)},d.encode=function(e){var t=c.encode(e);return i(t)},d.decode=function(e){var t=u(e);return c.decode(t)},t.decode=d.decode,t.decodeArray=d.decodeArray,t.encode=d.encode,t.encodeASCII=d.encodeASCII},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(235)),i=u(n(31)),a=u(n(237)),o=u(n(94)),s=u(n(93));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=this.context;return{createMetricsReporting:function(t){return(0,r.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}),(0,a.default)(e).create(t)},getReportingFactory:function(){return(0,s.default)(e).getInstance()},getMetricsHandlerFactory:function(){return(0,o.default)(e).getInstance()}}}l.__dashjs_factory_name="MetricsReporting";var c=dashjs.FactoryMaker.getClassFactory(l);c.events=i.default,dashjs.FactoryMaker.updateClassFactory(l.__dashjs_factory_name,c),t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(236)),i=a(n(31));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=void 0,n=void 0,a=(e=e||{}).eventBus,o=e.dashMetrics,s=e.metricsConstants,u=e.events;function l(e){var t=new r.default;if(n){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),o.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function d(e){l({errorcode:r.default.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){l({errorcode:r.default.BECAME_REPORTER})}function h(e){switch(e.metric){case s.HTTP_REQUEST:(0===(t=e.value).responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||r.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}var t}function p(e){var t=void 0;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=r.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=r.default.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}function g(){a.on(u.MANIFEST_UPDATED,c,t),a.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.on(u.METRIC_ADDED,h,t),a.on(u.METRIC_UPDATED,h,t),a.on(u.PLAYBACK_ERROR,p,t),a.on(i.default.BECAME_REPORTING_PLAYER,f,t)}return t={initialise:g,reset:function(){a.off(u.MANIFEST_UPDATED,c,t),a.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.off(u.METRIC_ADDED,h,t),a.off(u.METRIC_UPDATED,h,t),a.off(u.PLAYBACK_ERROR,p,t),a.off(i.default.BECAME_REPORTING_PLAYER,f,t)}},g(),t}o.__dashjs_factory_name="DVBErrorsTranslator",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(238)),i=o(n(249)),a=o(n(31));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=void 0,n={},o=this.context,s=e.eventBus,u=e.events;function l(t){if(!t.error){var u=Object.keys(n);(0,i.default)(o).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))u.splice(i,1);else try{var a=(0,r.default)(o).create(e);a.initialize(t),n[i]=a}catch(e){}})),u.forEach((function(e){n[e].reset(),delete n[e]})),s.trigger(a.default.METRICS_INITIALISATION_COMPLETE)}}function c(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){s.off(u.MANIFEST_UPDATED,l,t),s.off(u.STREAM_TEARDOWN_COMPLETE,c,t)}},s.on(u.MANIFEST_UPDATED,l,t),s.on(u.STREAM_TEARDOWN_COMPLETE,c,t),t}s.__dashjs_factory_name="MetricsCollectionController",t.default=dashjs.FactoryMaker.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(239)),i=o(n(240)),a=o(n(244));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=void 0,n=void 0,o=void 0,s=this.context;function u(){t&&t.reset(),n&&n.reset(),o&&o.reset()}return{initialize:function(l){try{(o=(0,r.default)(s).create({mediaElement:e.mediaElement})).initialize(l.Range),(n=(0,i.default)(s).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(l.Reporting,o),(t=(0,a.default)(s).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(l.metrics,n)}catch(e){throw u(),e}},reset:u}}s.__dashjs_factory_name="MetricsController",t.default=dashjs.FactoryMaker.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(68),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t,n=!1,r=this.context,i=void 0,o=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,n=t+e.duration;i.add(t,n)})),n=!!e[0]._useWallClockTime)},reset:function(){i.clear()},isEnabled:function(){var e,t=i.length;if(!t)return!0;e=n?(new Date).getTime()/1e3:o.currentTime;for(var r=0;r<t;r+=1){var a=i.start(r),s=i.end(r);if(a<=e&&e<s)return!0}return!1}},i=(0,a.default)(r).create(),t}o.__dashjs_factory_name="RangeController",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(93),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=[],n=(0,a.default)(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}o.__dashjs_factory_name="ReportingController",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(242)),i=a(n(243));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){e=e||{};var t,n=this.context,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=[],f=e.metricsConstants;function h(){s=!1,u=!1,l=null,c=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),u&&c.isEnabled()&&t.forEach((function(t){var n=a.serialise(t);e!==f.DVB_ERRORS&&(n="metricname="+e+"&"+n),function(e,t,n){var r=new XMLHttpRequest,i=function(){var e=d.indexOf(r);-1!==e&&(d.splice(e,1),r.status>=200&&r.status<300?t&&t():n&&n())};d.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(n=l+"?"+n,null,(function(){u=!1}))}))},initialize:function(e,t){var n=void 0;if(c=t,!(l=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");s||((n=e.dvb_probability)&&(1e3===n||n/1e3>=o.random())&&(u=!0),s=!0)},reset:function(){h()}},a=(0,r.default)(n).getInstance(),o=(0,i.default)(n).getInstance(),h(),t}o.__dashjs_factory_name="DVBReporting",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";function r(){return{serialise:function e(t){var n=[],r=[],i=void 0,a=void 0;for(i in t)if(t.hasOwnProperty(i)&&0!==i.indexOf("_")){if(null==(a=t[i])&&(a=""),Array.isArray(a)){if(!a.length)continue;r=[],a.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);r.push(n?t:e(t))})),a=r.map(encodeURIComponent).join(",")}else"string"==typeof a?a=encodeURIComponent(a):a instanceof Date?a=a.toISOString():"number"==typeof a&&(a=Math.round(a));n.push(i+"="+a)}return n.join("&")}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="MetricSerialiser",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";function r(){var e,t=window.crypto||window.msCrypto,n=Uint32Array,r=Math.pow(2,8*n.BYTES_PER_ELEMENT)-1,i=void 0,a=void 0;function o(){t&&(i||(i=new n(10)),t.getRandomValues(i),a=0)}return e={random:function(e,n){var s=void 0;return e||(e=0),n||(n=1),t?(a===i.length&&o(),s=i[a]/r,a+=1):s=Math.random(),s*(n-e)+e}},o(),e}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="RNG",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(94),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=[],n=void 0,r=this.context,i=e.eventBus,o=e.events,s=(0,a.default)(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function u(e){t.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return n={initialize:function(e,r){e.split(",").forEach((function(e,n,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var o=i[n+1];o&&-1===o.indexOf("(")&&-1!==o.indexOf(")")&&(e+=","+o,delete i[n+1])}(a=s.create(e,r))&&t.push(a)})),i.on(o.METRIC_ADDED,u,n),i.on(o.METRIC_UPDATED,u,n)},reset:function(){i.off(o.METRIC_ADDED,u,n),i.off(o.METRIC_UPDATED,u,n),t.forEach((function(e){return e.reset()})),t=[]}}}o.__dashjs_factory_name="MetricsHandlersController",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(95),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,s=this.context,u=(0,a.default)(s).getInstance(),l=[],c=e.metricsConstants;function d(){var e=function(){try{return Object.keys(l).map((function(e){return l[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&o!==e.t&&(o=e.t,t.report(r,e))}return{initialize:function(e,a,o){a&&(n=u.validateN(o),t=a,r=u.reconstructFullMetricName(e,o),i=setInterval(d,n))},reset:function(){clearInterval(i),i=null,n=0,t=null,o=null},handleNewMetric:function(e,t,n){e===c.BUFFER_LEVEL&&(l[n]=t)}}}o.__dashjs_factory_name="BufferLevelHandler",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(31),a=(r=i)&&r.__esModule?r:{default:r};t.default=dashjs.FactoryMaker.getClassFactory((function(e){var t=void 0,n=(e=e||{}).eventBus,r=e.metricsConstants;function i(){n.off(a.default.METRICS_INITIALISATION_COMPLETE,i,this),n.trigger(a.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,r){r&&(t=r,n.on(a.default.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===r.DVB_ERRORS&&t&&t.report(e,n)}}}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(95),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,s=[],u=(0,a.default)(this.context).getInstance(),l=e.metricsConstants;function c(){var e=s;e.length&&t&&t.report(i,e),s=[]}return{initialize:function(e,a,s,l){a&&(n=u.validateN(s),t=a,l&&l.length&&(r=l),i=u.reconstructFullMetricName(e,s,l),o=setInterval(c,n))},reset:function(){clearInterval(o),o=null,n=null,r=null,s=[],t=null},handleNewMetric:function(e,t){e===l.HTTP_REQUEST&&(r&&r!==t.type||s.push(t))}}}o.__dashjs_factory_name="HttpListHandler",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";function r(){var e=void 0,t=void 0;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="GenericMetricHandler",t.default=dashjs.FactoryMaker.getClassFactory(r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(250)),i=o(n(251)),a=o(n(252));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var o=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(s){var u=new r.default,l=t.getIsDynamic(e);s.hasOwnProperty("metrics")&&(u.metrics=s.metrics,s.Range_asArray&&s.Range_asArray.forEach((function(r){var a=new i.default;a.starttime=function(e,r,i){var a=void 0,o=void 0,s=0;return r?s=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(s=a[0].start),o=s,i&&i.hasOwnProperty(n.START_TIME)&&(o+=i.starttime),o}(e,l,r),r.hasOwnProperty("duration")?a.duration=r.duration:a.duration=t.getDuration(e),a._useWallClockTime=l,u.Range.push(a)})),s.Reporting_asArray&&(s.Reporting_asArray.forEach((function(e){var t=new a.default;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),u.Reporting.push(t))})),o.push(u)))})),o}}}s.__dashjs_factory_name="ManifestParsing",t.default=dashjs.FactoryMaker.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(254)),i=c(n(40)),a=c(n(266)),o=c(n(32)),s=c(n(267)),u=c(n(268)),l=c(n(269));function c(e){return e&&e.__esModule?e:{default:e}}var d=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],f=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function h(){var e=void 0,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(a){var o=null,c=(0,i.default)(t).getInstance();c.setConfig({debug:a.debug,BASE64:a.BASE64}),c.initialize();var h=function(r){var i=r.debug,a=i.getLogger(e),o=r.eventBus,c=r.errHandler,h=r.videoModel?r.videoModel.getElement():null;return h&&void 0===h.onencrypted||h&&void 0===h.mediaKeys?n(h,f)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),(0,u.default)(t).create({debug:i,eventBus:o,events:r.events,api:n(h,f)})):n(h,d)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),(0,l.default)(t).create({debug:i,eventBus:o,errHandler:c,events:r.events,api:n(h,d)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),(0,s.default)(t).create({debug:i,eventBus:o,events:r.events}))}(a);return!o&&h&&(o=(0,r.default)(t).create({protectionModel:h,protectionKeyController:c,eventBus:a.eventBus,debug:a.debug,events:a.events,BASE64:a.BASE64,constants:a.constants,cmcdModel:a.cmcdModel,settings:a.settings}),a.capabilities.setEncryptedMediaSupported(!0)),o}}}h.__dashjs_factory_name="Protection";var p=dashjs.FactoryMaker.getClassFactory(h);p.events=a.default,p.errors=o.default,dashjs.FactoryMaker.updateClassFactory(h.__dashjs_factory_name,p),t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=p(n(24)),a=p(n(255)),o=p(n(58)),s=p(n(32)),u=p(n(6)),l=p(n(256)),c=p(n(257)),d=n(8),f=p(n(30)),h=p(n(1));function p(e){return e&&e.__esModule?e:{default:e}}function g(e){var t=(e=e||{}).protectionKeyController,n=e.protectionModel,p=e.eventBus,g=e.events,v=e.debug,m=e.BASE64,y=e.constants,E=[],T=e.cmcdModel,_=e.settings,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0;function N(){if(!(p&&p.hasOwnProperty("on")&&t&&t.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function O(e,t){var r=i.default.getPSSHForKeySystem(C,e),a=F(C);if(r){if(x(r))return;try{n.createKeySession(r,a,B(C),t)}catch(e){p.trigger(g.KEY_SESSION_CREATED,{data:null,error:new u.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e?n.createKeySession(e,a,B(C),t):p.trigger(g.KEY_SESSION_CREATED,{data:null,error:new u.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(C?C.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function x(e){if(!e)return!1;try{for(var r=n.getAllInitData(),i=0;i<r.length;i++)if(t.initDataEquals(e,r[i]))return S.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function P(e,t){N(),n.loadKeySession(e,t,B(C))}function k(e){N(),e?(n.setMediaElement(e),p.on(g.NEED_KEY,V,this)):null===e&&(n.setMediaElement(e),p.off(g.NEED_KEY,V,this))}function F(e){var t=null;if(e){var n=e.systemString;w&&(t=n in w?w[n]:null)}return t}function U(e){var t=F(e),n=[],r=[],i=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:D,s=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:D,u=B(e),l=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",c=t&&t.persistentState?t.persistentState:"temporary"===u?"optional":"required";return I.forEach((function(e){e.type===y.AUDIO?n.push(new a.default(e.codec,i)):e.type===y.VIDEO&&r.push(new a.default(e.codec,s))})),new o.default(n,r,l,c,[u])}function B(e){var t=F(e);return t&&t.sessionType?t.sessionType:R}function G(e,r){e=e.sort((function(t,n){return(w&&w[t.ks.systemString]&&w[t.ks.systemString].priority>=0?w[t.ks.systemString].priority:e.length)-(w&&w[n.ks.systemString]&&w[n.ks.systemString].priority>=0?w[n.ks.systemString].priority:e.length)})),void 0===C?function(e,r){var i=this,a=[],o=void 0;C=null,A.push(e);for(var l=0;l<e.length;l++)a.push({ks:e[l].ks,configs:[U(e[l].ks)]});var c=void 0,d=function e(t){p.off(g.KEY_SYSTEM_ACCESS_COMPLETE,e,i),t.error?(C=void 0,p.off(g.INTERNAL_KEY_SYSTEM_SELECTED,f,i),r||p.trigger(g.KEY_SYSTEM_SELECTED,{data:null,error:new u.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+t.error)})):(c=t.data,S.info("DRM: KeySystem Access Granted ("+c.keySystem.systemString+")! Selecting key system..."),n.selectKeySystem(c))},f=function e(a){if(p.off(g.INTERNAL_KEY_SYSTEM_SELECTED,e,i),p.off(g.KEY_SYSTEM_ACCESS_COMPLETE,d,i),a.error)C=void 0,r||p.trigger(g.KEY_SYSTEM_SELECTED,{data:null,error:new u.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+a.error)});else{if(!n)return;C=n.getKeySystem(),p.trigger(g.KEY_SYSTEM_SELECTED,{data:c});var l=F(C);l&&l.serverCertificate&&l.serverCertificate.length>0&&n.setServerCertificate(m.decodeArray(l.serverCertificate).buffer);for(var f=0;f<A.length;f++)for(o=0;o<A[f].length;o++)if(C===A[f][o].ks){if(t.isClearKey(C)&&l&&l.hasOwnProperty("clearkeys")){var h={kids:Object.keys(l.clearkeys)};A[f][o].initData=(new TextEncoder).encode(JSON.stringify(h))}A[f][o].sessionId?P(A[f][o].sessionId,A[f][o].initData):null!==A[f][o].initData&&O(A[f][o].initData,A[f][o].cdmData);break}}};p.on(g.INTERNAL_KEY_SYSTEM_SELECTED,f,i),p.on(g.KEY_SYSTEM_ACCESS_COMPLETE,d,i),n.requestKeySystemAccess(a)}(e,r):C?function(e,r){var a=this,o=[],l=e.findIndex((function(e){return e.ks===C}));if(-1===l||!e[l].initData)return;if(x(i.default.getPSSHForKeySystem(C,e[l].initData)))return;o.push({ks:e[l].ks,configs:[U(C)]});p.on(g.KEY_SYSTEM_ACCESS_COMPLETE,(function n(i){if(p.off(g.KEY_SYSTEM_ACCESS_COMPLETE,n,a),i.error)r||p.trigger(g.KEY_SYSTEM_SELECTED,{error:new u.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+i.error)});else{S.info("DRM: KeySystem Access Granted"),p.trigger(g.KEY_SYSTEM_SELECTED,{data:i.data});var o=F(C);if(t.isClearKey(C)&&o&&o.hasOwnProperty("clearkeys")){var c={kids:Object.keys(o.clearkeys)};e[l].initData=(new TextEncoder).encode(JSON.stringify(c))}e[l].sessionId?P(e[l].sessionId,e[l].initData):e[l].initData&&O(e[l].initData,e[l].cdmData)}}),a),n.requestKeySystemAccess(o)}(e,r):A.push(e)}function j(e,t){p.trigger(g.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function H(e){e.error?p.trigger(g.KEY_STATUSES_CHANGED,{data:null,error:e.error}):S.debug("DRM: key status = "+e.status)}function K(e){S.debug("DRM: onKeyMessage");var a=e.data;p.trigger(g.KEY_MESSAGE,{data:a});var o=a.messageType?a.messageType:"license-request",v=a.message,m=a.sessionToken,y=F(C),E=C?C.systemString:null,b=t.getLicenseServer(C,y,o),A={sessionToken:m,messageType:o};if(v&&0!==v.byteLength){if(!b)return S.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+m.getSessionID()),void j(A);if(t.isClearKey(C)){var w=t.processClearKeyLicenseRequest(C,y,v);if(w)return S.debug("DRM: ClearKey license request handled by application!"),j(A),void n.updateKeySession(m,w)}var R=null;if(y&&y.serverURL){var D=y.serverURL;"string"==typeof D&&""!==D?R=D:"object"===(void 0===D?"undefined":r(D))&&D.hasOwnProperty(o)&&(R=D[o])}else if(y&&y.laURL&&""!==y.laURL)R=y.laURL;else if(t.isClearKey(C))R=C.getLicenseServerUrlFromMediaInfo(I);else{var N=i.default.getPSSHData(m.initData);(R=C.getLicenseServerURLFromInitData(N))||(R=e.data.laURL)}if(R=b.getServerURLFromMessage(R,v,o)){var O={},x=!1,P=function(e){if(e)for(var t in e)"authorization"===t.toLowerCase()&&(x=!0),O[t]=e[t]};y&&P(y.httpRequestHeaders),P(C.getRequestHeadersFromMessage(v)),y&&"boolean"==typeof y.withCredentials&&(x=y.withCredentials);var k=function(e,t,n,r){var i=e.response?b.getErrorResponse(e.response,n,r):"NONE";j(t,new u.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+i))},U=function(e){if(n)if(200===e.status){var t=new c.default(e.responseURL,f.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),e.response);q(L,t).then((function(){var r=b.getLicenseMessage(t.data,E,o);null!==r?(j(A),n.updateKeySession(m,r)):k(e,A,E,o)}))}else k(e,A,E,o)},B=function(e){j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+E+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},G=function(e){j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+E+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},H=C.getLicenseRequestFromMessage(v),K=b.getHTTPMethod(o),V=b.getResponseType(E,o),Y=y&&!isNaN(y.httpTimeout)?y.httpTimeout:8e3,W=m.getSessionID()||null,z=new l.default(R,K,V,O,x,o,W,H);q(M,z).then((function(){!function e(t,n,r,i,a,o){var s=new XMLHttpRequest;if(_.get().streaming.cmcd&&_.get().streaming.cmcd.enabled){if(_.get().streaming.cmcd.mode===h.default.CMCD_MODE_QUERY){var u=T.getQueryParameter({url:t.url,type:d.HTTPRequest.LICENSE});u&&(t.url=f.default.addAditionalQueryParameterToUrl(t.url,[u]))}}s.open(t.method,t.url,!0),s.responseType=t.responseType,s.withCredentials=t.withCredentials,r>0&&(s.timeout=r);for(var l in t.headers)s.setRequestHeader(l,t.headers[l]);if(_.get().streaming.cmcd&&_.get().streaming.cmcd.enabled){if(_.get().streaming.cmcd.mode===h.default.CMCD_MODE_HEADER){var c=T.getHeaderParameters({url:t.url,type:d.HTTPRequest.LICENSE});if(c)for(var v in c){var m=c[v];m&&s.setRequestHeader(v,m)}}}var y=function(){n--,setTimeout((function(){e(t,n,r,i,a,o)}),1e3)};s.onload=function(){200===this.status||n<=0?i(this):(S.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+n),y())},s.ontimeout=s.onerror=function(){n<=0?o(this):(S.warn("License request network request failed . Retrying it... Pending retries: "+n),y())},s.onabort=function(){a(this)},p.trigger(g.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),s.send(t.data)}(z,3,Y,U,B,G)}))}else j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}else j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function V(e,n){if(S.debug("DRM: onNeedKey"),"cenc"===e.key.initDataType)if(0===I.length&&(S.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(n=void 0===n?1:n+1)<5))E.push(setTimeout((function(){V(e,n)}),500));else{var r=e.key.initData;if(ArrayBuffer.isView(r)&&(r=r.buffer),C){var a=i.default.getPSSHForKeySystem(C,r);if(a&&x(a))return}S.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(r)));var o=t.getSupportedKeySystems(r,w);0!==o.length?G(o,!1):S.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}else S.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType)}function q(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}return b={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");N(),p.on(g.INTERNAL_KEY_MESSAGE,K,this),p.on(g.INTERNAL_KEY_STATUS_CHANGED,H,this),I.push(e);var n=t.getSupportedKeySystemsFromContentProtection(e.contentProtection);n&&n.length>0&&G(n,!0)},clearMediaInfoArrayByStreamId:function(e){I=I.filter((function(t){return t.streamInfo.id!==e}))},createKeySession:O,loadKeySession:P,removeKeySession:function(e){N(),n.removeKeySession(e)},closeKeySession:function(e){N(),n.closeKeySession(e)},setServerCertificate:function(e){N(),n.setServerCertificate(e)},setMediaElement:k,setSessionType:function(e){R=e},setRobustnessLevel:function(e){D=e},setProtectionData:function(e){w=e,t.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return N(),t.getSupportedKeySystemsFromContentProtection(e)},getKeySystems:function(){return t?t.getKeySystems():[]},setKeySystems:function(e){t&&t.setKeySystems(e)},setLicenseRequestFilters:function(e){M=e},setLicenseResponseFilters:function(e){L=e},stop:function(){n&&n.stop()},reset:function(){N(),M=[],L=[],p.off(g.INTERNAL_KEY_MESSAGE,K,this),p.off(g.INTERNAL_KEY_STATUS_CHANGED,H,this),k(null),C=void 0,n&&(n.reset(),n=null),E.forEach((function(e){return clearTimeout(e)})),E=[],I=[]}},S=v.getLogger(b),A=[],I=[],R="temporary",D="",M=[],L=[],b}g.__dashjs_factory_name="ProtectionController",t.default=dashjs.FactoryMaker.getClassFactory(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r,i,a,o,s,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=o,this.sessionId=s,this.data=u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(59)),i=s(n(60)),a=s(n(24)),o=s(n(18));function s(e){return e&&e.__esModule?e:{default:e}}var u="e2719d58-a985-b3c9-781a-b030af78d30e",l=o.default.CLEARKEY_KEYSTEM_STRING,c="urn:uuid:"+u;function d(e){var t=(e=e||{}).BASE64,n={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]};return{uuid:u,schemeIdURI:c,systemString:l,getInitData:function(e,n){try{var r=a.default.parseInitDataFromContentProtection(e,t);if(!r&&n){var i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(i))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getLicenseServerUrlFromMediaInfo:function(e){try{if(!e||0===e.length)return null;for(var t=0,r=null;t<e.length&&!r;){var i=e[t];if(i&&i.contentProtection&&i.contentProtection.length>0){var a=i.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===c}));if(a&&a.length>0)for(var o=0;o<a.length&&!r;){for(var s=a[o],u=0;u<n.attributes.length&&!r;){for(var l=0,d=n.attributes[u];l<n.prefixes.length&&!r;){var f=n.prefixes[l];s[d]&&s[d].__prefix&&s[d].__prefix===f&&s[d].__text&&(r=s[d].__text),l+=1}u+=1}o+=1}}t+=1}return r}catch(e){return null}},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),o=[],s=0;s<a.kids.length;s++){var u=a.kids[s],l=e.clearkeys&&e.clearkeys.hasOwnProperty(u)?e.clearkeys[u]:null;if(!l)throw new Error("DRM: ClearKey keyID ("+u+") is not known!");o.push(new r.default(u,l))}n=new i.default(o)}return n}}}d.__dashjs_factory_name="KeySystemClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(59)),i=s(n(60)),a=s(n(24)),o=s(n(18));function s(e){return e&&e.__esModule?e:{default:e}}var u="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",l=o.default.CLEARKEY_KEYSTEM_STRING;function c(e){var t=void 0,n=e.BASE64,o=e.debug.getLogger(t);return t={uuid:u,schemeIdURI:"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",systemString:l,getInitData:function(e){return a.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],u=0;u<a.kids.length;u++){var l=a.kids[u],c=e.clearkeys&&e.clearkeys.hasOwnProperty(l)?e.clearkeys[l]:null;if(!c)throw new Error("DRM: ClearKey keyID ("+l+") is not known!");s.push(new r.default(l,c))}n=new i.default(s),o.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}}}c.__dashjs_factory_name="KeySystemW3CClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(24)),i=a(n(18));function a(e){return e&&e.__esModule?e:{default:e}}var o="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",s=i.default.WIDEVINE_KEYSTEM_STRING;function u(e){var t=null,n=(e=e||{}).BASE64;return{uuid:o,schemeIdURI:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",systemString:s,init:function(e){e&&(t=e)},getInitData:function(e){return r.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(e){return t&&t.sessionId?t.sessionId:e&&e.sessionId?e.sessionId:null}}}u.__dashjs_factory_name="KeySystemWidevine",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(24)),i=a(n(18));function a(e){return e&&e.__esModule?e:{default:e}}var o="9a04f079-9840-4286-ab92-e65be0885f95",s=i.default.PLAYREADY_KEYSTEM_STRING,u=void 0;function l(e){var t="utf-16",n=(e=e||{}).BASE64;function i(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:o,schemeIdURI:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",systemString:s,getInitData:function(e){var t,a,o,s=new Uint8Array([112,115,115,104,0,0,0,0]),u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),l=0,c=null,d=void 0,f=void 0;if(i(),!e)return null;if("pssh"in e)return r.default.parseInitDataFromContentProtection(e,n);if("pro"in e)c=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;c=n.decodeArray(e.prheader.__text)}return t=c.length,a=4+s.length+u.length+4+t,o=new ArrayBuffer(a),d=new Uint8Array(o),(f=new DataView(o)).setUint32(l,a),l+=4,d.set(s,l),l+=s.length,d.set(u,l),l+=u.length,f.setUint32(l,t),l+=4,d.set(c,l),l+=t,d.buffer},getRequestHeadersFromMessage:function(e){var n,r=void 0,i={},a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,o);for(var s=(r=a.parseFromString(n,"application/xml")).getElementsByTagName("name"),u=r.getElementsByTagName("value"),l=0;l<s.length;l++)i[s[l].childNodes[0].nodeValue]=u[l].childNodes[0].nodeValue;return i.hasOwnProperty("Content")&&(i["Content-Type"]=i.Content,delete i.Content),i.hasOwnProperty("Content-Type")||(i["Content-Type"]="text/xml; charset=utf-8"),i},getLicenseRequestFromMessage:function(e){var r=null,a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);i();var s=String.fromCharCode.apply(null,o),u=a.parseFromString(s,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(r=n.decode(l)),r},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var o=t.getUint16(r,!0);r+=2;var s=t.getUint16(r,!0);if(r+=2,1===o){var u=e.slice(r,r+s),l=String.fromCharCode.apply(null,new Uint16Array(u)),c=i.parseFromString(l,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var d=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(c.getElementsByTagName("LUI_URL")[0]){var f=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else r+=s}return null},getCDMData:function(){var e=void 0,t=void 0,r=void 0,a=void 0;if(i(),u&&u.cdmData){for(e=[],a=0;a<u.cdmData.length;++a)e.push(u.cdmData.charCodeAt(a)),e.push(0);for(e=String.fromCharCode.apply(null,e),e=n.encode(e),t='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",e),r=[],a=0;a<t.length;++a)r.push(t.charCodeAt(a)),r.push(0);return new Uint8Array(r).buffer}return null},getSessionId:function(e){return u&&u.sessionId?u.sessionId:e&&e.sessionId?e.sessionId:null},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e},init:function(e){e&&(u=e)}}}l.__dashjs_factory_name="KeySystemPlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(18),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).BASE64,n={};n[a.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[a.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}};return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}o.__dashjs_factory_name="DRMToday",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";function r(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,o=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(o?o.getElementsByTagNameNS(e,"Fault")[0]:null)return null}return n}function r(n){var r="",i="",a="",o=-1,s=-1;if(window.DOMParser){var u=t(n),l=(new window.DOMParser).parseFromString(u,"text/xml"),c=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,d=c?c.getElementsByTagNameNS(e,"Body")[0]:null,f=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=f?f.getElementsByTagName("detail")[0]:null,p=h?h.getElementsByTagName("Exception")[0]:null,g=null;if(null===f)return u;r=(g=f.getElementsByTagName("faultstring")[0].firstChild)?g.nodeValue:null,null!==p&&(i=(g=p.getElementsByTagName("StatusCode")[0])?g.firstChild.nodeValue:null,o=(a=(g=p.getElementsByTagName("Message")[0])?g.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,s=a?a.indexOf("]"):-1,a=a?a.substring(o,s):"")}var v="code: "+i+", name: "+r;return a&&(v+=", message: "+a),v}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="PlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";function r(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="Widevine",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(59)),i=a(n(60));function a(e){return e&&e.__esModule?e:{default:e}}function o(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var a=e.keys[n],o=a.kid.replace(/=/g,""),s=a.k.replace(/=/g,"");t.push(new r.default(o,s))}return new i.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}o.__dashjs_factory_name="ClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_SYSTEM_SELECTED="internalKeySystemSelected",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(40)),i=c(n(61)),a=c(n(32)),o=c(n(6)),s=c(n(62)),u=c(n(63)),l=c(n(18));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.eventBus,c=e.events,d=e.debug,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0;function T(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function _(e){for(var t=0;t<m.length;t++)if(m[t]===e){m.splice(t,1);break}}function b(e){var t=void 0,n=void 0;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function S(e,t,r,i){var u={session:e,initData:t,sessionId:i,handleEvent:function(e){switch(e.type){case"keystatuseschange":n.trigger(c.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=b(arguments);switch(e.status){case"expired":n.trigger(c.INTERNAL_KEY_STATUS_CHANGED,{error:new o.default(a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:n.trigger(c.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(c.INTERNAL_KEY_MESSAGE,{data:new s.default(this,t,void 0,e.messageType)})}},getSessionID:function(){return e.sessionId},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=b(arguments);"usable"===e.status&&(t=!0)})),t},getSessionType:function(){return r}};return e.addEventListener("keystatuseschange",u),e.addEventListener("message",u),e.closed.then((function(){_(u),h.debug("DRM: Session closed. SessionID = "+u.getSessionID()),n.trigger(c.KEY_SESSION_CLOSED,{data:u.getSessionID()})})),m.push(u),u}return f={getAllInitData:function(){for(var e=[],t=0;t<m.length;t++)m[t].initData&&e.push(m[t].initData);return e},requestKeySystemAccess:function(e){!function e(t,r){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess)return void n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Insecure origins are not allowed"});!function(r){var i=t[r].ks,a=t[r].configs,o=i.systemString;o===l.default.PLAYREADY_KEYSTEM_STRING&&"required"===a[0].persistentState&&(o+=".recommendation"),navigator.requestMediaKeySystemAccess(o,a).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,r=new u.default(i,t);r.mksa=e,n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{data:r})})).catch((function(i){++r<t.length?e(t,r):n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! "+i.message})}))}(r)}(e,0)},getKeySystem:function(){return p},selectKeySystem:function(e){e.mksa.createMediaKeys().then((function(t){p=e.keySystem,v=t,g?g.setMediaKeys(v).then((function(){n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)})):n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)})).catch((function(){n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))},setMediaElement:function(e){g!==e&&(g&&(g.removeEventListener("encrypted",y),g.setMediaKeys&&g.setMediaKeys(null)),(g=e)&&(g.addEventListener("encrypted",y),g.setMediaKeys&&v&&g.setMediaKeys(v)))},setServerCertificate:function(e){if(!p||!v)throw new Error("Can not set server certificate until you have selected a key system");v.setServerCertificate(e).then((function(){h.info("DRM: License server certificate successfully updated."),n.trigger(c.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){n.trigger(c.SERVER_CERTIFICATE_UPDATED,{error:new o.default(a.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,a.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e,t,r){if(!p||!v)throw new Error("Can not create sessions until you have selected a key system");var i=v.createSession(r),s=S(i,e,r),u=this.getKeySystem().systemString===l.default.CLEARKEY_KEYSTEM_STRING&&(e||t&&t.clearkeys)?"keyids":"cenc";i.generateRequest(u,e).then((function(){h.debug("DRM: Session created. SessionID = "+s.getSessionID()),n.trigger(c.KEY_SESSION_CREATED,{data:s})})).catch((function(e){_(s),n.trigger(c.KEY_SESSION_CREATED,{data:null,error:new o.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var r=e.session;E.isClearKey(p)&&(t=t.toJWK()),r.update(t).catch((function(t){n.trigger(c.KEY_ERROR,{data:new o.default(a.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e,t,r){if(!p||!v)throw new Error("Can not load sessions until you have selected a key system");for(var i=0;i<m.length;i++)if(e===m[i].sessionId)return void h.warn("DRM: Ignoring session ID because we have already seen it!");var s=v.createSession(r),u=S(s,t,r,e);s.load(e).then((function(t){t?(h.debug("DRM: Session loaded. SessionID = "+u.getSessionID()),n.trigger(c.KEY_SESSION_CREATED,{data:u})):(_(u),n.trigger(c.KEY_SESSION_CREATED,{data:null,error:new o.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+e+")")}))})).catch((function(t){_(u),n.trigger(c.KEY_SESSION_CREATED,{data:null,error:new o.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+e+")! "+t.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){h.debug("DRM: Session removed. SessionID = "+e.getSessionID()),n.trigger(c.KEY_SESSION_REMOVED,{data:e.getSessionID()})}),(function(t){n.trigger(c.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionID()+"). "+t.name})}))},closeKeySession:function(e){T(e).catch((function(t){_(e),n.trigger(c.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionID()+") "+t.name})}))},stop:function(){for(var e=void 0,t=0;t<m.length;t++)(e=m[t]).getUsable()||T(e).catch((function(){_(e)}))},reset:function(){var e=m.length,t=void 0;0!==e?function(){for(var r=function(e){_(e),0===m.length&&(g?(g.removeEventListener("encrypted",y),g.setMediaKeys(null).then((function(){n.trigger(c.TEARDOWN_COMPLETE)}))):n.trigger(c.TEARDOWN_COMPLETE))},i=0;i<e;i++)!function(e){t.session.closed.then((function(){r(e)})),T(t).catch((function(){r(e)}))}(t=m[i])}():n.trigger(c.TEARDOWN_COMPLETE)}},h=d.getLogger(f),p=null,g=null,v=null,m=[],E=(0,r.default)(t).getInstance(),y={handleEvent:function(e){switch(e.type){case"encrypted":if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(c.NEED_KEY,{key:new i.default(t,e.initDataType)})}}}},f}d.__dashjs_factory_name="ProtectionModel_21Jan2015",t.default=dashjs.FactoryMaker.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(40)),i=c(n(61)),a=c(n(6)),o=c(n(32)),s=c(n(62)),u=c(n(58)),l=c(n(63));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.eventBus,c=e.events,d=e.debug,f=e.api,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0;function b(){try{for(var e=0;e<E.length;e++)S(E[e]);g&&g.removeEventListener(f.needkey,T),n.trigger(c.TEARDOWN_COMPLETE)}catch(e){n.trigger(c.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function S(e){var t=e.session;t.removeEventListener(f.error,e),t.removeEventListener(f.message,e),t.removeEventListener(f.ready,e),t.removeEventListener(f.close,e);for(var n=0;n<E.length;n++)if(E[n]===e){E.splice(n,1);break}t[f.release]()}function A(){var e=null,t=function(){g.removeEventListener("loadedmetadata",e),g[f.setMediaKeys](m),n.trigger(c.VIDEO_ELEMENT_SELECTED)};g.readyState>=1?t():(e=t.bind(this),g.addEventListener("loadedmetadata",e))}return h={getAllInitData:function(){for(var e=[],t=0;t<E.length;t++)e.push(E[t].initData);return e},requestKeySystemAccess:function(e){for(var t=!1,r=0;r<e.length;r++)for(var i=e[r].ks.systemString,a=e[r].configs,o=null,s=null,d=0;d<a.length;d++){var h=a[d].audioCapabilities,p=a[d].videoCapabilities;if(h&&0!==h.length){o=[];for(var g=0;g<h.length;g++)window[f.MediaKeys].isTypeSupported(i,h[g].contentType)&&o.push(h[g])}if(p&&0!==p.length){s=[];for(var v=0;v<p.length;v++)window[f.MediaKeys].isTypeSupported(i,p[v].contentType)&&s.push(p[v])}if(!(!o&&!s||o&&0===o.length||s&&0===s.length)){t=!0;var m=new u.default(o,s),y=_.getKeySystemBySystemString(i);n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{data:new l.default(y,m)});break}}t||n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return v},selectKeySystem:function(e){try{m=e.mediaKeys=new window[f.MediaKeys](e.keySystem.systemString),v=e.keySystem,y=e,g&&A(),n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)}catch(e){n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+v.systemString+")! Could not create MediaKeys -- TODO"})}},setMediaElement:function(e){g!==e&&(g&&g.removeEventListener(f.needkey,T),(g=e)&&(g.addEventListener(f.needkey,T),m&&A()))},createKeySession:function(e,t,r,i){if(!v||!m||!y)throw new Error("Can not create sessions until you have selected a key system");var u=null;if(y.ksConfiguration.videoCapabilities&&y.ksConfiguration.videoCapabilities.length>0&&(u=y.ksConfiguration.videoCapabilities[0]),null===u&&y.ksConfiguration.audioCapabilities&&y.ksConfiguration.audioCapabilities.length>0&&(u=y.ksConfiguration.audioCapabilities[0]),null===u)throw new Error("Can not create sessions for unknown content types.");var l=u.contentType,d=m.createSession(l,new Uint8Array(e),i?new Uint8Array(i):null),h=function(e,t){return{session:e,initData:t,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case f.error:n.trigger(c.KEY_ERROR,{data:new a.default(o.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case f.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(c.INTERNAL_KEY_MESSAGE,{data:new s.default(this,t,e.destinationURL)});break;case f.ready:p.debug("DRM: Key added."),n.trigger(c.KEY_ADDED);break;case f.close:p.debug("DRM: Session closed. SessionID = "+this.getSessionID()),n.trigger(c.KEY_SESSION_CLOSED,{data:this.getSessionID()})}}}}(d,e);d.addEventListener(f.error,h),d.addEventListener(f.message,h),d.addEventListener(f.ready,h),d.addEventListener(f.close,h),E.push(h),p.debug("DRM: Session created. SessionID = "+h.getSessionID()),n.trigger(c.KEY_SESSION_CREATED,{data:h})},updateKeySession:function(e,t){var n=e.session;_.isClearKey(v)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t))},closeKeySession:S,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:b,reset:b},p=d.getLogger(h),g=null,v=null,m=null,y=null,E=[],_=(0,r.default)(t).getInstance(),T={handleEvent:function(e){switch(e.type){case f.needkey:if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(c.NEED_KEY,{key:new i.default(t,"cenc")})}}}},h}d.__dashjs_factory_name="ProtectionModel_3Feb2014",t.default=dashjs.FactoryMaker.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(40)),i=c(n(61)),a=c(n(6)),o=c(n(62)),s=c(n(58)),u=c(n(63)),l=c(n(32));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.eventBus,c=e.events,d=e.debug,f=e.api,h=e.errHandler,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0;function S(){v&&w();for(var e=0;e<T.length;e++)A(T[e]);n.trigger(c.TEARDOWN_COMPLETE)}function A(e){try{v[f.cancelKeyRequest](m.systemString,e.sessionID)}catch(t){n.trigger(c.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionID+") "+t.message})}}function I(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionID==t)return e[r];return null}return null}function w(){v.removeEventListener(f.keyerror,b),v.removeEventListener(f.needkey,b),v.removeEventListener(f.keymessage,b),v.removeEventListener(f.keyadded,b)}return p={getAllInitData:function(){for(var e=[],t=0;t<E.length;t++)e.push(E[t].initData);for(var n=0;n<T.length;n++)e.push(T[n].initData);return e},requestKeySystemAccess:function(e){var t=v;t||(t=document.createElement("video"));for(var r=!1,i=0;i<e.length;i++)for(var a=e[i].ks.systemString,o=e[i].configs,l=null,d=0;d<o.length;d++){var f=o[d].videoCapabilities;if(f&&0!==f.length){l=[];for(var h=0;h<f.length;h++)""!==t.canPlayType(f[h].contentType,a)&&l.push(f[h])}if(l&&(!l||0!==l.length)){r=!0;var p=new s.default(null,l),g=y.getKeySystemBySystemString(a);n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{data:new u.default(g,p)});break}}r||n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return m},selectKeySystem:function(e){m=e.keySystem,n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)},setMediaElement:function(e){if(v!==e){if(v){w();for(var t=0;t<T.length;t++)A(T[t]);T=[]}(v=e)&&(v.addEventListener(f.keyerror,b),v.addEventListener(f.needkey,b),v.addEventListener(f.keymessage,b),v.addEventListener(f.keyadded,b),n.trigger(c.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!m)throw new Error("Can not create sessions until you have selected a key system");if(_||0===T.length){var t={sessionID:null,initData:e,getSessionID:function(){return this.sessionID},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return E.push(t),v[f.generateKeyRequest](m.systemString,new Uint8Array(e)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionID;if(y.isClearKey(m))for(var r=0;r<t.keyPairs.length;r++)v[f.addKey](m.systemString,t.keyPairs[r].key,t.keyPairs[r].keyID,n);else v[f.addKey](m.systemString,new Uint8Array(t),new Uint8Array(e.initData),n)},closeKeySession:A,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},g=d.getLogger(p),v=null,m=null,E=[],T=[],y=(0,r.default)(t).getInstance(),b={handleEvent:function(e){var t=null;switch(e.type){case f.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(c.NEED_KEY,{key:new i.default(r,"cenc")});break;case f.keyerror:if((t=I(T,e.sessionId))||(t=I(E,e.sessionId)),t){var s=l.default.MEDIA_KEYERR_CODE,u="";switch(e.errorCode.code){case 1:s=l.default.MEDIA_KEYERR_UNKNOWN_CODE,u+="MEDIA_KEYERR_UNKNOWN - "+l.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:s=l.default.MEDIA_KEYERR_CLIENT_CODE,u+="MEDIA_KEYERR_CLIENT - "+l.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:s=l.default.MEDIA_KEYERR_SERVICE_CODE,u+="MEDIA_KEYERR_SERVICE - "+l.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:s=l.default.MEDIA_KEYERR_OUTPUT_CODE,u+="MEDIA_KEYERR_OUTPUT - "+l.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:s=l.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,u+="MEDIA_KEYERR_HARDWARECHANGE - "+l.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:s=l.default.MEDIA_KEYERR_DOMAIN_CODE,u+="MEDIA_KEYERR_DOMAIN - "+l.default.MEDIA_KEYERR_DOMAIN_MESSAGE}u+=" System Code = "+e.systemCode,n.trigger(c.KEY_ERROR,{data:new a.default(s,u,t)})}else g.error("No session token found for key error");break;case f.keyadded:(t=I(T,e.sessionId))||(t=I(E,e.sessionId)),t?(g.debug("DRM: Key added."),n.trigger(c.KEY_ADDED,{data:t})):g.debug("No session token found for key added");break;case f.keymessage:if((_=null!==e.sessionId&&void 0!==e.sessionId)?!(t=I(T,e.sessionId))&&E.length>0&&(t=E.shift(),T.push(t),t.sessionID=e.sessionId,n.trigger(c.KEY_SESSION_CREATED,{data:t})):E.length>0&&(t=E.shift(),T.push(t),0!==E.length&&h.error(new a.default(l.default.MEDIA_KEY_MESSAGE_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var d=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=d,n.trigger(c.INTERNAL_KEY_MESSAGE,{data:new o.default(t,d,e.defaultURL)})}else g.warn("No session token found for key message")}}},p}d.__dashjs_factory_name="ProtectionModel_01b",t.default=dashjs.FactoryMaker.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(64),a=(r=i)&&r.__esModule?r:{default:r};var o=function(){var e=void 0;function t(t,n,r){if(!t||!/^VIDEO$/i.test(t.nodeName))return null;if(t._dashjs_player)return t._dashjs_player;var i=void 0,o=t.id||t.name||"video element";if(!(n=n||[].slice.call(t.querySelectorAll("source")).filter((function(e){return"application/dash+xml"==e.type}))[0])&&t.src)(n=document.createElement("source")).src=t.src;else if(!n&&!t.src)return null;return r=r||{},(i=(0,a.default)(r).create()).initialize(t,n.src,t.autoplay),e||(e=i.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+n.src),t._dashjs_player=i,i}function n(e){return/^VIDEO$/i.test(e.nodeName)?e:n(e.parentNode)}return{create:t,createAll:function(e,r){var i=[];e=e||"[data-dashjs-player]";for(var a=(r=r||document).querySelectorAll(e),o=0;o<a.length;o++){var s=t(a[o],null);i.push(s)}for(var u=r.querySelectorAll('source[type="application/dash+xml"]'),l=0;l<u.length;l++){var c=t(n(u[l]),null);i.push(c)}return i}}}(),s=void 0;!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?o.createAll():s=window.setInterval((function(){window.dashjs&&(window.clearInterval(s),o.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),o.createAll()}))),t.default=o},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return Fe}));var r,i,a,o,s,u=n(5),l=(n(25),{}),c=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,n){var r,i,a,o=arguments,s={};for(a in t)"key"==a?r=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>3)for(n=[n],a=3;a<arguments.length;a++)n.push(o[a]);if(null!=n&&(s.children=n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return g(e,s,r,i,null)}function g(e,t,n,i,a){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:a};return null==a&&(o.__v=o),null!=r.vnode&&r.vnode(o),o}function v(e){return e.children}function m(e,t){this.props=e,this.context=t}function y(e,t){if(null==t)return e.__?y(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?y(e):null}function E(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return E(e)}}function T(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!_.__r++||o!==r.debounceRendering)&&((o=r.debounceRendering)||a)(_)}function _(){for(var e;_.__r=i.length;)e=i.sort((function(e,t){return e.__v.__b-t.__v.__b})),i=[],e.some((function(e){var t,n,r,i,a,o,s;e.__d&&(o=(a=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=f({},a)).__v=r,i=R(s,a,r,t.__n,void 0!==s.ownerSVGElement,null,n,null==o?y(a):o),D(n,a),i!=o&&E(a)))}))}function b(e,t,n,r,i,a,o,s,u,d){var f,p,m,E,T,_,b,A=r&&r.__k||c,I=A.length;for(u==l&&(u=null!=o?o[0]:I?y(r,0):null),n.__k=[],f=0;f<t.length;f++)if(null!=(E=n.__k[f]=null==(E=t[f])||"boolean"==typeof E?null:"string"==typeof E||"number"==typeof E?g(null,E,null,null,E):Array.isArray(E)?g(v,{children:E},null,null,null):null!=E.__e||null!=E.__c?g(E.type,E.props,E.key,null,E.__v):E)){if(E.__=n,E.__b=n.__b+1,null===(m=A[f])||m&&E.key==m.key&&E.type===m.type)A[f]=void 0;else for(p=0;p<I;p++){if((m=A[p])&&E.key==m.key&&E.type===m.type){A[p]=void 0;break}m=null}T=R(e,E,m=m||l,i,a,o,s,u,d),(p=E.ref)&&m.ref!=p&&(b||(b=[]),m.ref&&b.push(m.ref,null,E),b.push(p,E.__c||T,E)),null!=T?(null==_&&(_=T),u=S(e,E,m,A,o,T,u),d||"option"!=n.type?"function"==typeof n.type&&(n.__d=u):e.value=""):u&&m.__e==u&&u.parentNode!=e&&(u=y(m))}if(n.__e=_,null!=o&&"function"!=typeof n.type)for(f=o.length;f--;)null!=o[f]&&h(o[f]);for(f=I;f--;)null!=A[f]&&M(A[f],A[f]);if(b)for(f=0;f<b.length;f++)C(b[f],b[++f],b[++f])}function S(e,t,n,r,i,a,o){var s,u,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(i==n||a!=o||null==a.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(a),s=null;else{for(u=o,l=0;(u=u.nextSibling)&&l<r.length;l+=2)if(u==a)break e;e.insertBefore(a,o),s=o}return void 0!==s?s:a.nextSibling}function A(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||d.test(t)?n:n+"px"}function I(e,t,n,r,i){var a,o;if(i&&"className"==t&&(t="class"),"style"===t)if("string"==typeof n)e.style=n;else{if("string"==typeof r&&(e.style=r=""),r)for(t in r)n&&t in n||A(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||A(e.style,t,n[t])}else"o"===t[0]&&"n"===t[1]?(a=t!==(t=t.replace(/Capture$/,"")),(o=t.toLowerCase())in e&&(t=o),t=t.slice(2),e.l||(e.l={}),e.l[t]=n,n?r||e.addEventListener(t,w,a):e.removeEventListener(t,w,a)):"list"!==t&&"tagName"!==t&&"form"!==t&&"type"!==t&&"size"!==t&&"download"!==t&&"href"!==t&&!i&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n&&!/^ar/.test(t)?e.removeAttribute(t):e.setAttribute(t,n))}function w(e){this.l[e.type](r.event?r.event(e):e)}function R(e,t,n,i,a,o,s,u,d){var h,p,g,y,E,T,_,A,w,R,D,C=t.type;if(void 0!==t.constructor)return null;(h=r.__b)&&h(t);try{e:if("function"==typeof C){if(A=t.props,w=(h=C.contextType)&&i[h.__c],R=h?w?w.props.value:h.__:i,n.__c?_=(p=t.__c=n.__c).__=p.__E:("prototype"in C&&C.prototype.render?t.__c=p=new C(A,R):(t.__c=p=new m(A,R),p.constructor=C,p.render=L),w&&w.sub(p),p.props=A,p.state||(p.state={}),p.context=R,p.__n=i,g=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=C.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=f({},p.__s)),f(p.__s,C.getDerivedStateFromProps(A,p.__s))),y=p.props,E=p.state,g)null==C.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==C.getDerivedStateFromProps&&A!==y&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(A,R),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(A,p.__s,R)||t.__v===n.__v){p.props=A,p.state=p.__s,t.__v!==n.__v&&(p.__d=!1),p.__v=t,t.__e=n.__e,t.__k=n.__k,p.__h.length&&s.push(p),function e(t,n,r){var i,a;for(i=0;i<t.__k.length;i++)(a=t.__k[i])&&(a.__=t,a.__e&&("function"==typeof a.type&&a.__k.length>1&&e(a,n,r),n=S(r,a,a,t.__k,null,a.__e,n),"function"==typeof t.type&&(t.__d=n)))}(t,u,e);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(A,p.__s,R),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(y,E,T)}))}p.context=R,p.props=A,p.state=p.__s,(h=r.__r)&&h(t),p.__d=!1,p.__v=t,p.__P=e,h=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(i=f(f({},i),p.getChildContext())),g||null==p.getSnapshotBeforeUpdate||(T=p.getSnapshotBeforeUpdate(y,E)),D=null!=h&&h.type==v&&null==h.key?h.props.children:h,b(e,Array.isArray(D)?D:[D],t,n,i,a,o,s,u,d),p.base=t.__e,p.__h.length&&s.push(p),_&&(p.__E=p.__=null),p.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,a,o,s){var u,d,f,h,p,g=n.props,v=t.props;if(i="svg"===t.type||i,null!=a)for(u=0;u<a.length;u++)if(null!=(d=a[u])&&((null===t.type?3===d.nodeType:d.localName===t.type)||e==d)){e=d,a[u]=null;break}if(null==e){if(null===t.type)return document.createTextNode(v);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,v.is&&{is:v.is}),a=null,s=!1}if(null===t.type)g!==v&&e.data!==v&&(e.data=v);else{if(null!=a&&(a=c.slice.call(e.childNodes)),f=(g=n.props||l).dangerouslySetInnerHTML,h=v.dangerouslySetInnerHTML,!s){if(null!=a)for(g={},p=0;p<e.attributes.length;p++)g[e.attributes[p].name]=e.attributes[p].value;(h||f)&&(h&&f&&h.__html==f.__html||(e.innerHTML=h&&h.__html||""))}(function(e,t,n,r,i){var a;for(a in n)"children"===a||"key"===a||a in t||I(e,a,null,n[a],r);for(a in t)i&&"function"!=typeof t[a]||"children"===a||"key"===a||"value"===a||"checked"===a||n[a]===t[a]||I(e,a,t[a],n[a],r)})(e,v,g,i,s),h?t.__k=[]:(u=t.props.children,b(e,Array.isArray(u)?u:[u],t,n,r,"foreignObject"!==t.type&&i,a,o,l,s)),s||("value"in v&&void 0!==(u=v.value)&&u!==e.value&&I(e,"value",u,g.value,!1),"checked"in v&&void 0!==(u=v.checked)&&u!==e.checked&&I(e,"checked",u,g.checked,!1))}return e}(n.__e,t,n,i,a,o,s,d);(h=r.diffed)&&h(t)}catch(e){t.__v=null,r.__e(e,t,n)}return t.__e}function D(e,t){r.__c&&r.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){r.__e(e,t.__v)}}))}function C(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function M(e,t,n){var i,a,o;if(r.unmount&&r.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||C(i,null,t)),n||"function"==typeof e.type||(n=null!=(a=e.__e)),e.__e=e.__d=void 0,null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){r.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&M(i[o],t,n);null!=a&&h(a)}function L(e,t,n){return this.constructor(e,n)}function N(e,t,n){var i,a,o;r.__&&r.__(e,t),a=(i=n===s)?null:n&&n.__k||t.__k,e=p(v,null,[e]),o=[],R(t,(i?t:n||t).__k=e,a||l,l,void 0!==t.ownerSVGElement,n&&!i?[n]:a?null:t.childNodes.length?c.slice.call(t.childNodes):null,o,n||l,i),D(o,e)}r={__e:function(e,t){for(var n,r;t=t.__;)if((n=t.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(e))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(e)),r)return T(n.__E=n)}catch(t){e=t}throw e}},m.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),T(this))},m.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},m.prototype.render=v,i=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,s=l;var O,x,P,k=0,F=[],U=r.__r,B=r.diffed,G=r.__c,j=r.unmount;function H(e,t){r.__h&&r.__h(x,e,k||t),k=0;var n=x.__H||(x.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return k=1,function(e,t,n){var r=H(O++,2);return r.t=e,r.__c||(r.__c=x,r.__=[n?n(t):$(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}]),r.__}($,e)}function V(e,t){var n=H(O++,3);!r.__s&&Z(n.__H,t)&&(n.__=e,n.__H=t,x.__H.__h.push(n))}function q(e){return k=5,Y((function(){return{current:e}}),[])}function Y(e,t){var n=H(O++,7);return Z(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function W(e,t){return k=8,Y((function(){return e}),t)}function z(){F.some((function(e){if(e.__P)try{e.__H.__h.forEach(Q),e.__H.__h.forEach(J),e.__H.__h=[]}catch(t){return e.__H.__h=[],r.__e(t,e.__v),!0}})),F=[]}r.__r=function(e){U&&U(e),O=0;var t=(x=e.__c).__H;t&&(t.__h.forEach(Q),t.__h.forEach(J),t.__h=[])},r.diffed=function(e){B&&B(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==F.push(t)&&P===r.requestAnimationFrame||((P=r.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),X&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);X&&(t=requestAnimationFrame(n))})(z))},r.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Q),e.__h=e.__h.filter((function(e){return!e.__||J(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],r.__e(n,e.__v)}})),G&&G(e,t)},r.unmount=function(e){j&&j(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(Q)}catch(e){r.__e(e,t.__v)}};var X="function"==typeof requestAnimationFrame;function Q(e){"function"==typeof e.u&&e.u()}function J(e){e.u=e.__()}function Z(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function $(e,t){return"function"==typeof t?t(e):t}var ee=n(19),te=n.n(ee);function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var re,ie,ae=function(){function e(){var e;this.emitter={all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map((function(e){e(n)})),(e.get("*")||[]).slice().map((function(e){e(t,n)}))}}}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();(ie=re||(re={})).AVAILABILITY_CHANGED="airplay:availability_changed",ie.TARGET_CHANGED="airplay:target_changed";var oe,se,ue=function(e){var t,n;function r(t){var n;return(n=e.call(this)||this).video=t,window.WebKitPlaybackTargetAvailabilityEvent?(t.addEventListener("webkitplaybacktargetavailabilitychanged",n.onAvailabilityChanged=n.onAvailabilityChanged.bind(ne(n))),t.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",n.onTargetChanged=n.onTargetChanged.bind(ne(n)))):n.emit(re.AVAILABILITY_CHANGED,{available:!1}),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.onAvailabilityChanged=function(e){this.emit(re.AVAILABILITY_CHANGED,{available:"available"===e.availability})},i.onTargetChanged=function(e){this.emit(re.TARGET_CHANGED,{wireless:!0})},i.toggleAirPlay=function(){this.video.webkitShowPlaybackTargetPicker()},i.destroy=function(){this.video.removeEventListener("webkitplaybacktargetavailabilitychanged",this.onAvailabilityChanged)},r}(ae),le=function(){function e(){var e;this.emitter={all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map((function(e){e(n)})),(e.get("*")||[]).slice().map((function(e){e(t,n)}))}}}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();(se=oe||(oe={})).CONNECTED="cast:connected",se.DISCONNECTED="cast:disconnected",se.STATE_CHANGE="cast:state_change";var ce=function(e){var t,n;function r(t,n){var r;return(r=e.call(this)||this).state={playbackState:u.b.IDLE,currentTime:0,duration:0,isLive:!1,isAtLiveEdge:!1,isSeekable:!0,isMuted:!1,audioTracks:[],textTracks:[]},function(e,t){return new Promise((function(n,r){window.__onGCastApiAvailable=function(i){i?(cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:e||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:t||chrome.cast.AutoJoinPolicy.PAGE_SCOPED}),n()):r(new Error("[Cast] not available"))};var i=document.createElement("script");i.src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",document.body.appendChild(i)}))}(t,n).then((function(){r.player=new cast.framework.RemotePlayer,r.playerController=new cast.framework.RemotePlayerController(r.player),r.setupListeners()}),(function(e){return console.error(e)})),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.setState=function(e){this.state=Object.assign({},this.state,e),this.emit(oe.STATE_CHANGE,{state:this.state})},i.getPlaybackStateFromPlayerState=function(e){switch(e){case chrome.cast.media.PlayerState.BUFFERING:return u.b.BUFFERING;case chrome.cast.media.PlayerState.PAUSED:return u.b.PAUSED;case chrome.cast.media.PlayerState.PLAYING:return u.b.PLAYING;case chrome.cast.media.PlayerState.IDLE:return u.b.IDLE}},i.getDuration=function(){return this.player.liveSeekableRange?this.player.liveSeekableRange.end:this.player.duration},i.setupListeners=function(){var e=this;cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,(function(t){switch(t.sessionState){case cast.framework.SessionState.SESSION_STARTED:case cast.framework.SessionState.SESSION_RESUMED:e.emit(oe.CONNECTED),e.setState({playbackState:u.b.READY,isMuted:e.player.isMuted});break;case cast.framework.SessionState.SESSION_ENDED:e.emit(oe.DISCONNECTED),e.setState({playbackState:u.b.IDLE})}})),this.playerController.addEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,(function(t){var n=t.value;switch(t.field){case"currentTime":e.setState({currentTime:n,isAtLiveEdge:n>=e.state.duration-20});break;case"duration":e.setState({duration:n});break;case"playerState":var r=e.getPlaybackStateFromPlayerState(n);e.setState({playbackState:r}),r===u.b.IDLE&&e.stop();break;case"liveSeekableRange":e.setState(n?{isLive:!n.isLiveDone,duration:n.end-n.start,isSeekable:n.end-n.start>300}:{isLive:!1})}}))},i.load=function(e,t){void 0===t&&(t=null);var n=cast.framework.CastContext.getInstance().getCurrentSession(),r=new chrome.cast.media.MediaInfo(e,"video/mp4"),i=new chrome.cast.media.LoadRequest(r);return t&&(i.currentTime=t),n.loadMedia(i)},i.play=function(){this.playerController.playOrPause()},i.pause=function(){this.playerController.playOrPause()},i.stop=function(){this.playerController.stop()},i.mute=function(){this.playerController.muteOrUnmute()},i.unmute=function(){this.playerController.muteOrUnmute()},i.setAudioTrack=function(){},i.setTextTrack=function(){},i.seekTo=function(e){var t=e.position,n=e.change,r=e.percentage;r?t=Math.min(r,99.9)/100*this.getDuration():n&&(t=this.player.currentTime+n),this.player.currentTime=t,this.playerController.seek()},r}(le);function de(e){var t,n=e.onClick;return p("div",{class:te()("_1gDwG",(t={},t._22_VN=!e.isAtLiveEdge&&e.isSeekable,t)),onClick:n},"LIVE")}function fe(e){var t;return p("div",{class:"_-LGHu"},(void 0===(t=e.time)&&(t=0),[Math.floor(t/3600)%24,Math.floor(t/60)%60,Math.floor(t%60)].map((function(e){return e<10?"0"+e:e})).filter((function(e,t){return"00"!==e||t>0})).join(":")))}function he(e){var t,n=e.currentTime,r=void 0===n?0:n,i=e.duration,a=void 0===i?0:i,o=e.handleSeek,s=e.handleSeekToLive,u=e.isLive,l=e.isAtLiveEdge,c=e.isSeekable,d=W((function(e){c&&o(e.offsetX/e.currentTarget.offsetWidth*100)}),[o,c]),f=!u||!l&&c?r/a*100||0:100;return p("div",{class:te()("_2aAzG",(t={},t._3K51E=!c,t))},p(fe,{time:r}),p("div",{class:"_t3a1b",onClick:d},p("div",{class:"_K1UW_"},p("div",{class:"_1Xt9z",style:{width:f+"%"}}))),u?p(de,{onClick:s,isAtLiveEdge:l,isSeekable:c}):p(fe,{time:a}))}function pe(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M8 5v14l11-7z"}))}function ge(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}))}function ve(e){return p("div",{class:"_3njg6",onClick:e.onClick},p(e.playbackState!==u.b.PLAYING?pe:ge,null))}function me(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"}))}function ye(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"}))}function Ee(e){return p("div",{class:"_28pC9",onClick:e.onClick},p(e.muted?ye:me,null))}function Te(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}))}function _e(e){var t,n=e.audioTracks,r=void 0===n?[]:n,i=e.onChange,a=K(!1),o=a[0],s=a[1],u=W((function(e){i(e.target.value)}),[i]);return p("div",{class:"_13aPK",onClick:W((function(){return s(!o)}),[o])},p(Te,null),p("ul",{class:te()("_16WrP",(t={},t._Ib345=o,t))},r.map((function(e){return p("li",null,p("label",null,p("input",{type:"radio",name:"audioTrack",value:e.id,checked:e.enabled,onClick:u}),p("span",null,e.label)))}))))}function be(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))}function Se(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))}function Ae(e){return p("div",{class:"_34Jhj",onClick:e.onClick},p(e.isFullscreen?be:Se,null))}function Ie(){return p("div",{class:"_2eFId"},p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"38",height:"38",viewBox:"0 0 38 38"},p("defs",null,p("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:"a"},p("stop",{"stop-color":"#fff","stop-opacity":"0",offset:"0%"}),p("stop",{"stop-color":"#fff","stop-opacity":".631",offset:"63.146%"}),p("stop",{"stop-color":"#fff",offset:"100%"}))),p("g",{fill:"none","fill-rule":"evenodd"},p("g",{transform:"translate(1 1)"},p("path",{d:"M36 18c0-9.94-8.06-18-18-18",id:"Oval-2",stroke:"url(#a)","stroke-width":"2"},p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"})),p("circle",{fill:"#fff",cx:"36",cy:"18",r:"1"},p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"}))))))}function we(){return!(!document.fullscreenElement&&!document.webkitFullscreenElement)}function Re(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z"}))}function De(e){var t,n=e.textTracks,r=void 0===n?[]:n,i=e.onChange,a=K(!1),o=a[0],s=a[1],u=W((function(e){i(e.target.value),e.stopPropagation()}),[i]);return p("div",{class:"_4r-db",onClick:W((function(){return s(!o)}),[o])},p(Re,null),p("ul",{class:te()("_1b4Xq",(t={},t._8qwvr=o,t))},r.map((function(e){return p("li",null,p("label",null,p("input",{type:"radio",name:"audioTrack",value:e.id,checked:e.enabled,onClick:u}),p("span",null,e.label)))}))))}function Ce(){return p("svg",{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",height:"24",viewBox:"0 0 24 24",width:"24"},p("rect",{fill:"none",height:"24",width:"24"}),p("g",null,p("polygon",{points:"6,22 18,22 12,16"}),p("path",{d:"M21,3H3C1.9,3,1,3.9,1,5v12c0,1.1,0.9,2,2,2h4v-2H3V5h18v12h-4v2h4c1.1,0,2-0.9,2-2V5C23,3.9,22.1,3,21,3z"})))}function Me(e){return p("div",{class:"_2XaiH",onClick:e.onClick},p(Ce,null))}function Le(){return p("div",{class:"_mM3Gy"},p("google-cast-launcher",null))}function Ne(){return(Ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Oe(e){return p("img",{class:e.className,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAA5CAYAAABzlmQiAAAACXBIWXMAABcRAAAXEQHKJvM/AAAAB3RJTUUH4gQUEh4aiyLHmgAAFqJJREFUeNrtXQt4VcW1zhsChgBJIMEA8iwBlAJikIdQBBEQKOYiFeStIJSrovhCi22hqDwEFdEW1ArISyAEFBCrcMGqgFJFFDQIBVEUeQhBCI+c0zX0H7/VYWb2OSf7nCS3e3/f+pIze2b2zN7rn1lrzZo1UVFhuJptPhlNVImoHdFwoj8SPU80n2gh0V+JniZ6iKgfUVOieKIo74r85ff7b/L/+yoiSvXeSHhAEUfUnmgK0Xai80T+IOgk0Vqiu4lqC5B5b9UDSFkHhaAaRI8R7WPM/hNAsoRoJtFEzCLTiRYQvU90gshnAMsForeJbiFK8N502AHyK6LdRLuIqnhvxB1wCGDMAhgEU39D9BRRB6KKAZRPILoG4PqMgUX8/SdRIX7nEw0VIpj31r2rLACjHNH9mAH8mCn6E5UvRp0xANYqzB5niZYSPUt0jD2nvaeneFdpBkcToq1gWCFS3Sp0D5dFNgGCD/GMHUSdMDMVQq+ZQZQYYREkmqgN0VSi5UR5RIuIZhLdSVRbI9NPIXpYlHUQbUS+PxDFKfdqo7x4ziqi14heIHqAqDWvl/6vh3oEpVmel8ry1WPpWUh7kqiiplwCUTui8UQLiN4ELUQbazm8vyS8k8nox1tEa4leIhpJVOn/g67RH4q0ZNKkMM9SQmc5R/QjUQ+iXxJtAXAEgOpECByxRLOgwMrL5//P6zhRI1bmNqSfJ6pmqXsx8m1T0vsSnbQ8T7TlDpa/GlEh7t1ieV5f5DnHgWRS0gVoicYS7fXbr2NE7TXPq0o0g+ioQ/nPiWqUVXAI8WcCRJ/viLpGQswBKLtDxCqEwi6AM5WoiOgQUXYEADIKH7GAaBBRA6J0ooZEQ4iO4P48VuYKgENcfQz1CuY7iDwzWHojolNIFzPWVUQZYpQmupHofdz7lqg8m+G2If05S19mIc9HgVixBIhYP/4mQImZtDFRS6KhrA97iBIN9YrrRaLfoFxj1CNmnzO4v4SoTIJjOhTnT4jqlkAbrib6HiC5EcAZQHQGelDHMIIjnmgfPuDvDHkexv3DQhRhDLsL6U8bymUx5unD0v+MtPeIYjTlrmTl2rP0J5C2U1cOeT5DnidDAEhPQ52d2QzX1wKQFE1ZQb/H/bNOolppA4dY7JsMcAizbEoJtqUVRK3jRFlI60xUAJC0DhNAWrGP38CQpyPuX+BiAhutd+j0EEobg/uFUgwDIL9G+j0Wke9H5BnO0jsxsa6WplwN1pfOLgJEtOcLOUsEAxDkqQWRT1xDyxJARgEcQt6vGgRTJYKxhkMpE4rYUqJlQgwhmg7mEIxVOYj29IKY97GwmGEm6YyZ5FA4ZjcmXv0gmNcBIIK5Mll6LwacTM3IuVLqH1K0gGIudZ12AQCE6yEVoQuJa5Cm3CDcO2kRhYIGCPL9FXk+DAEgYrbNV0XN0g6OdmA8Yam6PABGSoY8uprohEER82nShPy5meheossD0EmehJI+Cb+l8aAIQK7gMkCmop0fm+RjSh+MPKLfFVh6FaKfcG+wUqYcY/LJLL0DezeZFkuUvG5U7uUh/VVNuVdxb7XmXnEB8ijyfCMAHAxAkG8d8iwvC+CoTLSX6LRYyHNgoNoQJU6w6f19mAtvIWpOVB2zSnlYNbLw4h6FqfA0k0GFVae5pW2JWFQU+kh9BpwpAM5MlwHyEtr2tuF+OSiX4tqgggjmTHEt0ph35XUdS89hVqZkw2g7nA0uqcr9Ebh3SOpDzCBwGPdGhgEgdzJrXmIIAFlge8+lzZz7ApjtXpO1StitiaYx06JQ/u6CdYfniyFqRnQ78s8DCOZCObuZqC7Mov/HRJL5JrMfrGhC9FuomIW3wgTd3kWALGaK731EE4lmE+USbWfWJsFYN2nKj8X9IwrDTmOiWzmNefgs1jsmYK1lEWbaw2wmnm0YsKQ834alt2XtrBkGgAxhlr7LQgDIi8izqbQDJBty/ru6BUDIzjcQHWAKaG9uNUGemkSPM4VTilhFIC5uCUBsJBogRlOid5htfaCq4ALEmwCGeiy9GWaW7W65pTCA+DX9OA37/SIwgq58Q/RPXB3ZLCCV2gVK/oGG5/nAqPuxwDaWA05591s1opu0cH1oaGdxATKomACZW+oBApPuBjBeS4Ny+Ht88FP4SOrq72VYkZW2bQGkZzBTNMTMk4gXfzWm5pUs/5dQbvsRfYe0v/BRFm3tiVluipI+A+lDXQLIy2jDB1iPaIpV66omU6qGYXdwcy/9bcKYJkfJz0WsNnhmQ8zM8QG2eTyb1WMAyN1Ie8RQxgNIAAD5FZhrvqYDCRB75KyRpWGE5mxkFHn+J4iPKhjgT3jBPrwwwYhvo763uDsCtTGW6GtQLEuvDlPwF254AbORd5fNZcShDmnn388GGWlNSlLytmcM1SDE52VhEPMB0L9kM3YjDyCh6x6vY/Zoolksk4roGlV5BDi6QFEXsvMjuuk/wI9bl4lYmwAc+fI28pcPN3qfugbCFPYcFwAyhOkElUOsoykz3V7HBpHFmrwZTIe4JcTnRUM/8kNneiIAS5wHEAeA1IHusUbzsp9F41dK1wYlT1uIXMJseYMLTClmq+cw6m2Co5tcdMuVYh219QYA4RFNX4Q38PriusQAsJJBBhSDYT+WLh6MYXo55F0UqusFlbsfdexlriAPWvJ7AHEAyHgw281Kw4eDUTcbvDzT4RMk7P0dXLQexQAk4pqjzGLC81W0OQkz3mrNbLgGIKlZzHYIeh3PzddZ1gDoK7i5VpNnnKJ4f6/qVZrFSTGTdNWYjmPBuF0sddTGrOdn5veaHkBCA0c0FtmO84U2KIcnMALVMDDPcgBomNvtAuO9g4/WEwaAT/DB2qLdn4vFTE2fBgPwo1xoRx3oD37Mkhvgfr6e6B/M9LrBUkcGM4lbV4wxGOQxkGzDAuwarDEdQPpZ2+4/uvcGe94a22zkAcQOkOpYiV6mjOBv4oX1MHSqExhjVagKbADMWQ/K7G4syjWDxUusS4gdiW9gxT9R6VM6TL55LrUjA2LefqYjFKFtBwCaux3qeI2ZbZs65BV9vQcDwmlW7jSse9tg3Ut0YPojoJ4Oz+uKfGJdpipLT8VsJ+51tZTvhzz7uaSBJQHZBhuYZyLP6tIIkByMtqNZg3vhg7xqYn64P583WUZcBMnjYJD++D0Zv8dQm1+E7lRDI2ZthxdwgottESvSKXD8q4ZZLRBzbzRAJI0NwegvyQCoEGcrq6Z1h7LlQNEBiLSX5FXqiLGUj2X5HOs1vNdygVo9Iw2QxwGQlqyz26BX1DF0qCFG0BXhbp/w0cLIuQEfrBJGtYNt3yuYA0tWPU2/ZqNfDUr6HcOhUZpab47yrrJzCTEECm1FfEzpJ/TnAKwkfSLEYK9DtKmO3xcXwybvOfOtBSCjAJDeJQyOaMwaUtGP9biubAHkU6L97IPOx0JTMweGPR+pvcRs70QfJhsX7iy4IPepZ2j61QUAuaeEAdKLzR53eBxX9gByWOz1xsesAI/M7Q4y4364MkSKyVqDwR5jactJxvN133bqhC6iCgJMCIA8UYLgSGRuHntNZtkg67wOXrvdywqPYa/KrXBozSxrABHi1Tp0pLPKiAYzpDBZrongC87ErDaXpV30fJ31z8LPDP3KhPj1QgkyxgRm5hzoUp3S0+DlMgSQeuw9tC1rABGj7Crxf5Hv4iKc37boh5VtoQ8sieALTgEoF7G0uhf9xc/6Vhj6lQ7x66USZowmcDqM8QBSNgHys4vJ8kPnlqETtzqIDWKRamUEX3A1gJJHDuluc6FA5EexvjPHpTaUFmbzABJhgIhgCJvFynTOR6c+lesfNkbBos6WCOogTdCuaSxtFtJaGPpVH7PjjGI++0Fs5nrGA8h/J0C+lO7hzTefPJr/U9FZKOrJlg7/HavIcRF6wf24FQh60CEovjGGfrUBQMYX89lL8ezXPYD8dwLkbwhALc7zuDBjX6EMNDDC0mG5ZTQ7Qi/4eTzvSvyWG4v+aOlXfwDkNg8gHkCKA5DnYO1pLhiqy5aCt+CU97lpXwdbTJwWgZdbHtEy9mCVPxo7/KyBxhD5RACklUsA+QpRTiQN0OQVOw1/S/QKHA6XwRv5UXjfxhqeURVevC+jXC4CGTyNnZtZOoDAy2A49smvwJYEMZj0cHANiUNopvsRsmctfO/EFuPfOW3WgovNQDwrF06rM+BUGh8sQOCS0hHBPl5DP+Zix2mKQ1vSkG8OyuXCT028t2uUWAC/xrd7yMF5swvyTRKMdDsYaRhi4eayTTZ3WF7wXji3JYUZIAOkmzt+34zfcx2A/6acGV0CiHotVPJlA8jqXnJ+PaVxX9eVK1LKTdIA5IjiIazuY5+urmVhcBmBwc92ndIFoUAdLR1i9X6giQNmBAhch/IMYaFkYItuhrb0YqFfTdd+uegtvM5NEWGUepfL6JaCkRoDIMLx7yjRRubFecgUfFl4r6KSCWEERyK2uxbAQbASPk6BbX+DcNtHXz5wYdPUUhbwQKy9jEa40X4sTzILZLEUI1cmgld0wOh+yb4Mpdxq7EOvCefE+kTX4z331gDkNNzYx8Frtjmelcu8jTspfYll+0TeQ1/aI1ZuCwxG+WzPShWlfCoD82ZEfBc7Jq/FTJbP6o53AggAu5gBvi9Cq7bAaL+KAbaRxnBzig0GLfDOf4GyS9gzu6JMXQbEHpbB/3vkmSKDNRxAkLhdiIkVhUBwPnzwGIPokw+nxiZhAEcUtoxe1DXw+y/4Pc42RbL99ZNcaIejDoIVYhmPKklzPxmg/o+4VMyF5ttA3XYYQF4x3K/I4gkvswBkqGWGkHtARiv3JrH4V+maso3ZrJYTAEBasdnyVk198RiYdBFgZCC8dYbQrhms7q6s//k29QBbKiSIbpIMNRt6yEHso0hBZbnIfK8hXEwnrHDv5PsIXAJIL6x97MBHH4oOb3SynjG9KjvcAAFwZXCJOZZ6tkgxi5Vbj7RZbirpbEuAGo8rEIBEsQjyecpoL5nrBcuz16p77i0AmYK0ry367ggWuVJGs6/AwqwONJS7BCBIl4PsdgNPj70keB8OreFnBHZmU+oXyNzX8DJl2Ml33QIJRIaTiI3VFBt6zmB3Y6YDOCpiH8huNw73CQAgCZCTtVELWb4PkGcmm8plaKPbXAYI38l3RTAAQb6pzH8sBmnVWJ19LWUf1ZQ1AeRdnT6n1NeUlZVbMpqztF8ECZAcFogjQ1NuDRMTf2aqWGxf9asOfggj8x0YtK9GyYyBtUVcnxZH3EJdo/GsE5Cpu0E8EZa1qwOwyg1BHx52CaxOAEljU3JXQ55oiF/iuo8pp75gTZ8BAoQfrdAuBICMZMpsOaS1YXVeaSnbn43AFUwAwQDxje1oCTZb+HikF4SUknpY5SABksrisPXXiKcnuFGIM9ZoBpBdPN4UFKDvIZvep7GOxGDkkEHlJgRj3cJMdBXkSR8sD9fgQxUCHO0DAEc83PfFSVjVIwSQRuzjtzL0rQ37WNlIr8XKNXIZIDWYHtEjBIDksLZVQlpv3TEPmrI3srLpFoBUZKdo3enAG3Lb8Sikjcbvo5ao+yaARLEwt/M0kou8rtWJJgfZSbPtNIwgYzotV8/Cw4OvZ3LqYSwoZpt0Btj/+2F/iQx2tgiWiHn4fcDkTqIBiAzWMN1FXcgJIHy6n4zNXFOxFvI22l/EtttGo1wDZpKt6zJA0hgQeocAkB6sT6lI68cscTYTKY9QX8cCkCSm0A916LM8wm0sft/HLG3RwQAE9x5gxhEeG/kZpH+n5VlirJFsFlmimkjB0LnMPj1SE340EabJfeylnETMWLl4th5hRi8wk+RaLBYNZlPvep21xACOZERaPOrW7BEgQFpYbPA+vOyNsMhVYeXqs3z1ShlAurO2pSGtb4DnLnZkZWs5AOSMehCQoc5jyHc3ft9fTIA0ZmJbGyYF7bG+W4go8oRZsWh4lUGeHsxsxflYBU5WNuzHYsV9GpSxH/Byz+PF7MH6wF2waQ9nR4QdQ50xAYKD70G/22VrWjAi1m9gJszCKnc5S70ZrFyzMgCQbmwwqxOggaCKBSDlGePfY6kvmrV5mCJiHbNYv2wAiWW8No0NdD5TUD/ObFfD1OtHADbTeXdVIFL8yGIiLUGMpDpQwnR27UT8zcQus/lKHU/ZRihDm3vCtf3vbkV2Z21eYjp4BvdT2If4dZAuNIW6g3BKKUCasbRsS9lRLIZYggUg3Gz8hKW+dPXAICwESktUarAAwf0/sQE+jv0+rguSqDLcQ0wXGeTwwQRQ/heRUC6wzhyG7T8PfkULIJ69zyw6Uun7BIt/acEysIhaQnQEge8ahmHB8hWHGYSfVvuHIOrlUdfHlQGAJLKyt1vKyrM+trCj5UxmXnkM3RsBzEg/n20C8VSO9q1DBEhz5g7UjoF1fiBMF0e0EiARxzA3CuDDySiEw+A4tgUg+Qkv9iysET9gdfRl6DANQ91XQu2qBovbeTeCVRv6JT2Xt1qCPy9ki0+xQdQ9V1XeSzFA+IlZqw2LbElsbWdiAAuFo9kioOkMwwXsECM+KH1pMxEHAJBYLEvImMkScN0CZT6h9G4DSHaGcsotRsnLYHtOwwt0ZesptSeN6CPMcg9EheliZxAWwromxaN6imIqDwb6rcFJMBkjVRpLb8ecEwcazOcpiv9WiQBEY+q9TTmPMJbFUz6lLFCaAJLCjoabp0RllNa087rtF9jI5sfsnaa8s1rw2HVanxqvGFUOBhVYA/u6PwVIxKlTlaNKwUXtqEW0A+AQR1VHhxEgqUyZPAnnSeHCsU8BwDTG7Dswyq6GU99XzGKTrZSbzUSIXVgLykOgvD0A5qRSApBo5qrhw2r5BrjK72RWrtuV+mzevH3YuzmKFex12JQn27pCnZmxgLiNrdovQL5dDFTyut7Qz9qKR/SUUJgxHef/+fE3o4TB0Q7rNUIpnxBOcCjrAtwl/bR64CRGrv74wAVs9CoEoHZgjaemRocZA6sK/1hnoegKUWKwIreL+p51APW3yNdNaeMhpPe3lO/MYuqmaESTYWDOUwwsPwIonTTGmTqsvmzN87IxKBxlYtFpvLO7LIuBqRDVj7PB6TB03THsG1xrUQvyGLCzQmVKIW6tAEiE12/b4rqRh9CGBBzTUIgTeIdGsg0Qq+qDKlvs71IWz8CKdlX4awUijlaFeTgD4kcFgyUwweawiboSQOr5kZeka8rHsHy2flZCH9N1bTW0J9rhHVdHnZWD0MsqsHZI15hr2GBT19LPTWzNLbo4DBoH61Yh1kieJqoaAWBEAZBSHxL751tFGqDeVbYuLCHImSjOMlP6nI53CJZhWzJmFV6zD4ZDNwEwWohjGRCa6ByOXUvyPr93BQCQGWB80xn3sdAPpYUs3k3mjYdbyjfMFPwsRvaYYtZdCQEX3gEwhCK+DnvmvS/vXVysamrYA5/EjiA37RfJYbPHkHCJP8LBcQzWIuTC4lfYsNQPsaniHGYJod+0FkGmxXFqRAXM1WU5xKtojyW8S2MZ82EN5R9weF0MpXsvOx051gAuuTC4242YyU5AEftJOog4uMwj2A9L0ylsXtoE15XVOGBzK2agcyy/mDHeIxqH2LoeJ3iXCSCXY5bwGQI9TJH7UTRlJ3L/uUhbm8Qe96ZEI4ieJ9pAtIfoBADjR8Bsob98DOvYRKJeYjHSA4V3BQgQaR2riIXBJvAXqw39wlauPsSzK508H/4FoQjRzOaDDxUAAAAASUVORK5CYII="})}function xe(e){return p("div",{class:"_2lVG2",style:{top:e.y+"px",left:e.x+"px"}},p("a",{href:"https://www.eyevinntechnology.se/",target:"_blank"},p("span",null,"Powered by the Eyevinn WebPlayer"),p(Oe,{className:"_yCzmM"})))}function Pe(){return p("div",{class:"_xDOFW"},p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48"},p("path",{d:"M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"})))}function ke(e){var t,n=e.player,r=e.castAppId,i=e.rootElement,a=q(),o=function(e,t){var n,r,i,a=K(null),o=a[0],s=a[1],l=K(null),c=l[0],d=l[1],f=function(e,t){var n=K(null),r=n[0],i=n[1],a=Y((function(){return null!==t&&new ce(t)}),[]),o=q(null);return o.current=r,V((function(){a&&(a.on(oe.CONNECTED,(function(){e.currentSrc&&a.load(e.currentSrc,e.currentTime)})),a.on(oe.DISCONNECTED,(function(){var t;i((function(e){return Ne({},e,{isCasting:!1})})),e.seekTo({position:null==(t=o.current)?void 0:t.currentTime})})),a.on(oe.STATE_CHANGE,(function(e){var t=e.state;i(Ne({isCasting:t.playbackState!==u.b.IDLE},t))})))}),[]),[a,r]}(e,t),h=f[0],p=f[1],g=q(!1);return g.current=null!=(n=null==p?void 0:p.isCasting)&&n,V((function(){e.on(u.e.UNREADY,(function(){s(null),d(null)})),e.on(u.e.READYING,(function(){s(!1)})),e.on(u.e.READY,(function(){s(!0)})),e.on(u.e.STATE_CHANGE,(function(t){var n=t.state;g.current&&e.isPlaying&&e.pause(),d(Ne({isCasting:!1},n))}))}),[]),p&&p.playbackState!==u.b.IDLE?(i=h,r=p):(i=e,r=c),[o,r,W((function(){return i.isPlaying?i.pause():i.play()}),[i]),W((function(){return i.isMuted?i.unmute():i.mute()}),[i]),W((function(e){return i.setAudioTrack(e)}),[i]),W((function(e){return i.setTextTrack(e)}),[i]),W((function(e){return i.seekTo({percentage:e})}),[i]),W((function(e){return i.seekTo({change:e})}),[i]),W((function(){return i.seekToLive()}),[i])]}(n,r),s=o[0],l=o[1],c=o[2],d=o[3],f=o[4],h=o[5],g=o[6],v=o[7],m=o[8],y=function(e){var t=K(!1),n=t[0],r=t[1],i=Y((function(){return new ue(e.video)}),[]),a=W((function(){return i.toggleAirPlay()}),[]);return V((function(){i.on(re.AVAILABILITY_CHANGED,(function(e){return r(e.available)}))}),[]),[n,a]}(n),E=y[0],T=y[1],_=W((function(){return we()?void(null==(e=document.exitFullscreen||document.webkitExitFullscreen)||e.call(document)):function(e,t){var n,r=e.requestFullscreen||e.webkitRequestFullscreen?e:t;null==(n=r.requestFullscreen||r.webkitRequestFullscreen||r.webkitEnterFullscreen)||n.call(r)}(i,n.video);var e}),[]),b=K({visible:!1,x:0,y:0}),S=b[0],A=b[1],I=W((function(e){e.stopPropagation(),e.preventDefault(),A(e.target===e.currentTarget?{visible:!0,x:e.offsetX,y:e.offsetY}:{visible:!1,x:0,y:0})}),[]);V((function(){document.addEventListener("click",(function(){A({visible:!1,x:0,y:0})}))}),[]),V((function(){var e=a.current;if(e){var t=function(e){switch(e.code){case"Space":c();break;case"ArrowRight":v(5);break;case"ArrowLeft":v(-5)}};return e.addEventListener("keydown",t),function(){return e.removeEventListener("keydown",t)}}}),[a.current]);var w=q(null),R=K(!1),D=R[0],C=R[1],M=W((function(){clearTimeout(w.current),C(!0),w.current=setTimeout((function(){return C(!1)}),2500)}),[]),L=!D&&(null==l?void 0:l.playbackState)!==u.b.READY&&(null==l?void 0:l.playbackState)!==u.b.PAUSED,N=(null==l?void 0:l.playbackState)===u.b.LOADING||(null==l?void 0:l.playbackState)===u.b.BUFFERING||(null==l?void 0:l.playbackState)===u.b.SEEKING;return null===s?null:p("div",{ref:a,tabIndex:0,class:te()("_2jAm9"),onMouseMove:M,onContextMenu:I,onPointerUp:W((function(e){L||e.currentTarget!==e.target?C(!0):c()}),[L])},S.visible&&p(xe,{x:S.x,y:S.y}),(N||!s)&&p(Ie,null),(null==l?void 0:l.isCasting)&&p(Pe,null),p("div",{class:te()("_SS6y-",(t={},t._1Wfm6=L,t))},p("div",{class:"_1pnfN"},p(ve,{playbackState:null==l?void 0:l.playbackState,onClick:c}),(null==l?void 0:l.isLive)&&!(null!=l&&l.isSeekable)&&p(de,{onClick:m,isAtLiveEdge:null==l?void 0:l.isAtLiveEdge,isSeekable:null==l?void 0:l.isSeekable}),p("div",{class:"_3ju96"}),p(Le,null),E&&p(Me,{onClick:T}),!1===(null==l?void 0:l.isCasting)&&(null==l?void 0:l.textTracks.length)>1&&p(De,{textTracks:null==l?void 0:l.textTracks,onChange:h}),!1===(null==l?void 0:l.isCasting)&&(null==l?void 0:l.audioTracks.length)>1&&p(_e,{audioTracks:null==l?void 0:l.audioTracks,onChange:f}),p(Ee,{muted:null==l?void 0:l.isMuted,onClick:d}),p(Ae,{isFullscreen:we(),onClick:_})),(!(null!=l&&l.isLive)||(null==l?void 0:l.isSeekable))&&p(he,{isLive:null==l?void 0:l.isLive,isAtLiveEdge:null==l?void 0:l.isAtLiveEdge,isSeekable:null==l?void 0:l.isSeekable,handleSeek:g,handleSeekToLive:m,currentTime:null==l?void 0:l.currentTime,duration:null==l?void 0:l.duration})))}n(97);function Fe(e,{castAppId:t}={}){const n=document.createElement("video");e.appendChild(n);const r=new u.c({video:n});return function(e){var t=e.root,n=e.player,r=e.castAppId;t.classList.add("_1Xl8W"),N(p(ke,{player:n,rootElement:t,castAppId:r}),t)}({root:e,player:r,castAppId:t}),r}}]).default}));
|
|
411
|
+
function og(){}function sg(){eg?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(eg=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=ug):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function ug(e,t){var n,r=this;return O((function(i){return 1==i.a?(console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),T(i,eg.call(r,e,t),2)):mg(n=i.b)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=eg,i.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=lg,i.return(lg.call(r,e,t)))}))}function lg(e,t){var n,r,i,a,o,s,u,c,d,f,h=this;return O((function(p){if(1==p.a){for(console.assert(h==navigator,'bad "this" for requestMediaKeySystemAccess'),n=vg(e),r=[],i=l(t),a=i.next();!a.done;a=i.next())o=a.value,s=cg(o.videoCapabilities,n),u=cg(o.audioCapabilities,n),o.videoCapabilities&&o.videoCapabilities.length&&!s.length||o.audioCapabilities&&o.audioCapabilities.length&&!u.length||((c=Object.assign({},o)).videoCapabilities=s,c.audioCapabilities=u,r.push(c));if(!r.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return T(p,eg.call(h,e,r),2)}return f=p.b,p.return(new gg(f,n))}))}function cg(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function dg(){}function fg(){tg?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(tg=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=hg):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function hg(e){var t,n,r=this;return O((function(i){return 1==i.a?(console.assert(r==navigator.mediaCapabilities,'bad "this" for decodingInfo'),T(i,tg.call(r,e),2)):(t=i.b,e.keySystemConfiguration?(n=t.keySystemAccess)&&mg(n)?(console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=tg,i.return(t)):(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=pg,i.return(pg.call(r,e))):i.return(t))}))}function pg(e){var t,n,r,i,a,o,s,u,l,c=this;return O((function(d){switch(d.a){case 1:return console.assert(c==navigator.mediaCapabilities,'bad "this" for decodingInfo'),t=null,e.keySystemConfiguration&&(n=e.keySystemConfiguration,r=n.keySystem,i=n.audio&&n.audio.encryptionScheme,a=n.video&&n.video.encryptionScheme,t=vg(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},i&&i!=t||a&&a!=t)?d.return(o):T(d,tg.call(c,e),2);case 2:if((s=d.b).keySystemAccess){s.keySystemAccess=new gg(s.keySystemAccess,t),d.m(3);break}if(!e.keySystemConfiguration){d.m(3);break}var f=e.keySystemConfiguration,h=[],p=[];return f.audio&&h.push({robustness:f.audio.robustness||"",contentType:e.audio.contentType}),f.video&&p.push({robustness:f.video.robustness||"",contentType:e.video.contentType}),f={initDataTypes:f.initDataType?[f.initDataType]:[],distinctiveIdentifier:f.distinctiveIdentifier,persistentState:f.persistentState,sessionTypes:f.sessionTypes},h.length&&(f.audioCapabilities=h),p.length&&(f.videoCapabilities=p),u=f,l=s,T(d,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[u]),5);case 5:l.keySystemAccess=d.b;case 3:return d.return(s)}}))}function gg(e,t){this.b=e,this.a=t,this.keySystem=e.keySystem}function vg(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function mg(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function yg(){}function Eg(){sg(),fg()}Dr["text/x-ssa"]=function(){return new Qp},G("EmeEncryptionSchemePolyfill",og),og.install=sg,G("McEncryptionSchemePolyfill",dg),dg.install=fg,gg.prototype.getConfiguration=function(){var e=this.b.getConfiguration();if(e.videoCapabilities)for(var t=l(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.a;if(e.audioCapabilities)for(n=(t=l(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.a;return e},gg.prototype.createMediaKeys=function(){return this.b.createMediaKeys()},G("EncryptionSchemePolyfills",yg),yg.install=Eg,void 0!==n&&n.exports&&(n.exports=yg)}.call(r,n,n,void 0),r.shaka)t[i]=r.shaka[i]}()}).call(this,n(14))},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(4),i=(n(25),n(7)),a=n.n(i),o={capLevelOnFPSDrop:!0,capLevelToPlayerSize:!0},s=function(e){function t(t){var n;return(n=e.call(this,t)||this).name="HlsJsTech",n.playlistDuration=0,n.hls=new a.a(o),n.hls.attachMedia(n.video),n.hls.on(a.a.Events.AUDIO_TRACK_SWITCHED,n.onAudioTrackChange.bind(Object(r.g)(n))),n.hls.on(a.a.Events.SUBTITLE_TRACK_SWITCH,n.onTextTrackChange.bind(Object(r.g)(n))),n.hls.on(a.a.Events.LEVEL_LOADED,n.onLevelLoaded.bind(Object(r.g)(n))),n.hls.on(a.a.Events.LEVEL_SWITCHED,n.onBitrateChange.bind(Object(r.g)(n))),n.hls.on(a.a.Events.ERROR,n.onErrorEvent.bind(Object(r.g)(n))),n}Object(r.d)(t,e),t.isSupported=function(){return a.a.isSupported()};var n=t.prototype;return n.load=function(t){var n=this;return this.state.playbackState!==r.b.IDLE&&this.stop(),e.prototype.setDefaultState.call(this),new Promise((function(e){n.hls.loadSource(t),n.hls.once(a.a.Events.MANIFEST_PARSED,(function(){n.removeUnsupportedLevels(),e()}))}))},n.removeUnsupportedLevels=function(){var e=this.hls.levels.findIndex((function(e){return!MediaSource.isTypeSupported('video/mp4; codecs="'+e.attrs.CODECS+'"')}));-1!==e&&(this.hls.removeLevel(e),this.removeUnsupportedLevels())},n.onTimeUpdate=function(){this.updateState({currentTime:this.currentTime,duration:this.duration,isAtLiveEdge:this.currentTime>=this.hls.liveSyncPosition-5,isSeekable:!this.isLive||this.playlistDuration>=300}),this.emit(r.e.TIME_UPDATE,{currentTime:this.currentTime,duration:this.duration})},n.onLevelLoaded=function(e,t){var n,i,a=null==t||null==(n=t.details)?void 0:n.live;this.isLiveFlag!==a&&(this.isLiveFlag=a,this.updateState({isLive:a})),this.playlistDuration=null==t||null==(i=t.details)?void 0:i.totalduration,this.emit(r.e.LOADED_METADATA,this.state)},n.getVideoLevels=function(){if(this.hls)return this.hls.levels.map((function(e,t){return{id:t,width:e.width,height:e.height,bitrate:e.bitrate}}))},n.onBitrateChange=function(){this.emit(r.e.BITRATE_CHANGE,this.currentLevel)},n.onErrorEvent=function(e,t){var n=null==t?void 0:t.fatal,i=this.errorFormat(t);this.emit(r.e.ERROR,{errorData:i,fatal:n})},n.seekToLive=function(){this.currentTime=this.hls.liveSyncPosition},n.errorFormat=function(e){var t={category:null==e?void 0:e.type,code:"-1",message:"",data:e};switch(null==e?void 0:e.details){case a.a.ErrorDetails.MANIFEST_LOAD_ERROR:case a.a.ErrorDetails.LEVEL_LOAD_ERROR:case a.a.ErrorDetails.FRAG_LOAD_ERROR:t.code=""+e.response.code,t.message=e.response.text;break;case a.a.ErrorDetails.MANIFEST_PARSING_ERROR:t.message=e.reason;break;case a.a.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case a.a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.a.ErrorDetails.KEY_LOAD_TIMEOUT:break;case a.a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.a.ErrorDetails.KEY_LOAD_ERROR:t.code=""+e.response.code,t.message=e.response.text}return t},n.destroy=function(){this.hls&&(this.hls.destroy(),this.hls=null),e.prototype.destroy.call(this)},Object(r.f)(t,[{key:"currentLevel",get:function(){var e=this;if(this.hls)return this.getVideoLevels().find((function(t){return t.id===e.hls.currentLevel}))},set:function(e){this.hls&&(e?this.hls.currentLevel=e.id:this.hls.nextLevel=-1)}},{key:"currentTime",get:function(){return this.video.currentTime},set:function(e){var t;this.state.isSeekable&&(this.video.currentTime=this.isLive?Math.min(e,null!=(t=this.hls.liveSyncPosition)?t:e):e)}},{key:"isLive",get:function(){return this.hls?this.isLiveFlag:isNaN(this.video.duration)}},{key:"audioTrack",get:function(){var e,t;return null==(e=this.hls)||null==(t=e.audioTrack)?void 0:t.toString()},set:function(e){this.hls&&(this.hls.audioTrack=parseInt(e))}},{key:"audioTracks",get:function(){var e,t=this;return(null==(e=this.hls)?void 0:e.audioTracks.map((function(e){return{id:e.id.toString(),label:e.name,language:e.lang,enabled:t.audioTrack===e.id.toString()}})))||[]}},{key:"textTrack",get:function(){var e,t;return null==(e=this.hls)||null==(t=e.subtitleTrack)?void 0:t.toString()},set:function(e){this.hls&&(this.hls.subtitleTrack=e?parseInt(e):-1)}},{key:"textTracks",get:function(){var e,t=this;return(null==(e=this.hls)?void 0:e.subtitleTracks.map((function(e){return{id:e.id.toString(),label:e.name,language:e.lang,enabled:t.textTrack===e.id.toString()}})))||[]}}]),t}(r.a);t.default=s},function(e,t,n){"use strict";n.r(t);var r=n(4),i=(n(25),n(96)),a=function(e){function t(t){var n;return(n=e.call(this,t)||this).name="ShakaTech",n.shakaPlayer=new i.Player(n.video),n.shakaPlayer.addEventListener("variantchanged",n.onAudioTrackChange=n.onAudioTrackChange.bind(Object(r.g)(n))),n.shakaPlayer.addEventListener("adaptation",(function(){n.onBitrateChange()})),n.shakaPlayer.addEventListener("error",n.onError=n.onError.bind(Object(r.g)(n))),n}Object(r.d)(t,e);var n=t.prototype;return n.load=function(t){return e.prototype.setDefaultState.call(this),this.shakaPlayer.load(t).catch((function(){}))},n.onBitrateChange=function(){var e=this.shakaPlayer.getVariantTracks().filter((function(e){return e.active})),t=e.reduce((function(e,t){return e+t.bandwidth}),0),n=e.find((function(e){return"variant"===e.type}));this.emit(r.e.BITRATE_CHANGE,{bitrate:t,width:n.width,height:n.height})},n.onError=function(e){var t=null==e?void 0:e.detail;console.log(t);var n=t.severity>1,i={category:t.category.toString(),code:t.code.toString(),message:t.data[1].toString(),data:t.data};this.emit(r.e.ERROR,{errorData:i,fatal:n})},n.getVideoLevels=function(){if(this.shakaPlayer)return this.shakaPlayer.getVariantTracks().map((function(e){return{id:e.id,width:e.width,height:e.height,bitrate:e.bandwidth}}))},n.destroy=function(){this.shakaPlayer&&this.shakaPlayer.destroy(),e.prototype.destroy.call(this)},Object(r.f)(t,[{key:"isLive",get:function(){return this.shakaPlayer.isLive()}},{key:"duration",get:function(){var e=this.shakaPlayer.seekRange();return e.end-e.start||0}},{key:"audioTrack",get:function(){var e,t,n;return null==(e=this.shakaPlayer)||null==(t=e.getVariantTracks())||null==(n=t.find((function(e){return e.active})))?void 0:n.language},set:function(e){this.shakaPlayer&&this.shakaPlayer.selectAudioLanguage(e)}},{key:"audioTracks",get:function(){var e,t=this;return null==(e=this.shakaPlayer)?void 0:e.getAudioLanguages().map((function(e){return{id:e,language:e,label:e,enabled:t.audioTrack===e}}))}},{key:"textTrack",get:function(){var e=this.shakaPlayer.getTextTracks().find((function(e){return e.active}));return e&&this.shakaPlayer.isTextTrackVisible()?Object(r.h)(e):null},set:function(e){if(e){this.shakaPlayer.setTextTrackVisibility(!0);var t=this.shakaPlayer.getTextTracks().find((function(t){return Object(r.h)(t)===e}));this.shakaPlayer.selectTextTrack(t)}else this.shakaPlayer.setTextTrackVisibility(!1)}},{key:"textTracks",get:function(){var e=this;return this.shakaPlayer.getTextTracks().map((function(t){return{id:t.id,label:t.label,language:t.language,enabled:e.textTrack===Object(r.h)(t)}})).filter((function(e,t,n){return n.findIndex((function(t){return e.language===t.language&&e.label===t.label}))===t}))}},{key:"currentLevel",set:function(e){if(this.shakaPlayer)if(e){this.shakaPlayer.configure({abr:{enabled:!1}});var t=this.shakaPlayer.getVariantTracks().find((function(t){return t.id==e.id}));this.shakaPlayer.selectVariantTrack(t,!0)}else this.shakaPlayer.configure({abr:{enabled:!0}})},get:function(){if(this.shakaPlayer){var e=this.shakaPlayer.getVariantTracks().find((function(e){return 1==e.active}));return{id:e.id,width:e.width,height:e.height,bitrate:e.bandwidth}}}}]),t}(r.a);t.default=a},function(e,t,n){"use strict";n.r(t);var r=n(4),i=(n(25),n(41)),a=function(e){function t(t){var n;return(n=e.call(this,t)||this).mediaPlayer=Object(i.MediaPlayer)().create(),n.mediaPlayer.initialize(),n.mediaPlayer.attachView(n.video),n}Object(r.d)(t,e);var n=t.prototype;return n.load=function(t){var n=this;return e.prototype.setDefaultState.call(this),new Promise((function(e,r){n.mediaPlayer.attachSource(t),n.mediaPlayer.on(i.MediaPlayer.events.MANIFEST_LOADED,(function(){e()})),n.mediaPlayer.on(i.MediaPlayer.events.ERROR,(function(e){r("Failed to load Mss Player")}))}))},n.destroy=function(){this.mediaPlayer&&(this.mediaPlayer.reset(),this.mediaPlayer=null),e.prototype.destroy.call(this)},Object(r.f)(t,[{key:"isLive",get:function(){return this.mediaPlayer.isDynamic()}}]),t}(r.a);t.default=a},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Debug=t.FactoryMaker=t.MediaPlayer=void 0;var r=s(n(64)),i=s(n(0)),a=s(n(2)),o=n(92);function s(e){return e&&e.__esModule?e:{default:e}}var u="undefined"!=typeof window&&window||e,l=u.dashjs;l||(l=u.dashjs={}),l.MediaPlayer=r.default,l.FactoryMaker=i.default,l.Debug=a.default,l.Version=(0,o.getVersionString)(),t.default=l,t.MediaPlayer=r.default,t.FactoryMaker=i.default,t.Debug=a.default}).call(this,n(14))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(1)),i=l(n(10)),a=l(n(3)),o=l(n(5)),s=l(n(0)),u=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}function c(){var e=this.context,t=(0,a.default)(e).getInstance(),n=void 0,s=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0;function L(e){if(!p||!isNaN(g)){var n=g;if(isNaN(n))if(E){n=e.liveStartTime;var r=c.getCurrentDVRInfo(),i=r?r.range:null;if(i){var a=Y(!0);isNaN(a)||(s.info("Start time from URI parameters: "+a),n=Math.max(Math.min(n,a),i.start))}}else{n=y.start;var u=Y(!1);!isNaN(u)&&u<n+y.duration&&(s.info("Start time from URI parameters: "+u),n=Math.max(n,u))}isNaN(n)||n===f.getTime()||(t.trigger(o.default.PLAYBACK_SEEKING,{seekTime:n}),U(n,!1,!0))}}function N(){return parseFloat((O()-B()).toFixed(5))}function O(){return y.start+y.duration}function x(){y&&f&&f.getElement()?f.play():_=!0}function P(){return y&&f?f.isPaused():null}function k(){y&&f&&f.pause()}function F(){return y&&f?f.isSeeking():null}function U(e,n,r){y&&f&&(e!==(isNaN(A)?f.getTime():A)&&((I=!0===r)||(A=e,t.trigger(o.default.PLAYBACK_SEEK_ASKED)),s.info("Requesting seek to time: "+e+(I?" (internal)":"")),f.setCurrentTime(e,n)))}function B(){return y&&f?f.getTime():null}function G(){var e=B();if(E&&!isNaN(S)){var t=S/1e3;e>t&&(e-=t)}return e}function j(){return y&&f?f.getPlaybackRate():null}function H(){return y&&f?f.getEnded():null}function K(){return E}function V(){if(!E||isNaN(S))return NaN;var e=G();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*h.getClientTimeOffset();return Math.max(((t-S-1e3*e)/1e3).toFixed(3),0)}function q(){_=!1,p=!1,g=NaN,m=0,S=0,A=NaN,f&&(t.off(o.default.STREAM_INITIALIZED,L,this),t.off(o.default.DATA_UPDATE_COMPLETED,Q,this),t.off(o.default.BUFFER_LEVEL_STATE_CHANGED,me,this),t.off(o.default.LOADING_PROGRESS,ve,this),t.off(o.default.PLAYBACK_PROGRESS,de,this),t.off(o.default.PLAYBACK_TIME_UPDATED,de,this),t.off(o.default.PLAYBACK_ENDED,le,this),t.off(o.default.STREAM_INITIALIZING,Ee,this),z(),f.removeEventListener("canplay",J),f.removeEventListener("play",Z),f.removeEventListener("waiting",$),f.removeEventListener("playing",ee),f.removeEventListener("pause",te),f.removeEventListener("error",ce),f.removeEventListener("seeking",ne),f.removeEventListener("seeked",re),f.removeEventListener("timeupdate",ie),f.removeEventListener("progress",ae),f.removeEventListener("ratechange",oe),f.removeEventListener("loadedmetadata",se),f.removeEventListener("stalled",ye),f.removeEventListener("ended",ue)),v=null,f=null,y=null,E=null}function Y(e){var t=C.getURIFragmentData();if(!t||!t.t)return NaN;var n=l.getStreams()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-S/1e3:parseInt(t.t)+n}function W(){if(null===v){v=setInterval((function(){var e;t.trigger(o.default.WALLCLOCK_TIME_UPDATED,{isDynamic:E,time:new Date}),K()&&P()&&(e=Date.now(),(!b||e>b+500)&&(b=e,ie()))}),M.get().streaming.wallclockTimeUpdateInterval)}}function z(){clearInterval(v),v=null}function X(e){if(!P()&&E&&0!==f.getReadyState()){var t=G(),n=function(e,t){var n=c.getCurrentDVRInfo(t),r=n?n.range:null;return r?(s.debug("Checking DVR window for at "+e+" with DVR window range "+r.start+" - "+r.end),e>r.end?Math.max(r.end-m,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?r.start:e):NaN}(t,e);!isNaN(n)&&n!==t&&!F()&&(s.debug("UpdateCurrentTime: Seek to actual time: "+n+" from currentTime: "+t),U(n))}}function Q(e){if(!e.error){var t=d.convertDataToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&y.id===n.id&&(y=n,X())}}function J(){t.trigger(o.default.CAN_PLAY)}function Z(){s.info("Native video element event: play"),X(),W(),t.trigger(o.default.PLAYBACK_STARTED,{startTime:B()})}function $(){s.info("Native video element event: waiting"),t.trigger(o.default.PLAYBACK_WAITING,{playingTime:B()})}function ee(){s.info("Native video element event: playing"),t.trigger(o.default.PLAYBACK_PLAYING,{playingTime:B()})}function te(){s.info("Native video element event: pause"),t.trigger(o.default.PLAYBACK_PAUSED,{ended:H()})}function ne(){if(I)I=!1;else{var e=B();isNaN(A)||A===e||(e=A),A=NaN,s.info("Seeking to: "+e),W(),t.trigger(o.default.PLAYBACK_SEEKING,{seekTime:e})}}function re(){s.info("Native video element event: seeked"),t.trigger(o.default.PLAYBACK_SEEKED)}function ie(){y&&t.trigger(o.default.PLAYBACK_TIME_UPDATED,{timeToEnd:N(),time:B()})}function ae(){t.trigger(o.default.PLAYBACK_PROGRESS)}function oe(){var e=j();s.info("Native video element event: ratechange: ",e),t.trigger(o.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function se(){s.info("Native video element event: loadedmetadata"),t.trigger(o.default.PLAYBACK_METADATA_LOADED),W()}function ue(){s.info("Native video element event: ended"),k(),z();var e=l?l.getActiveStreamInfo():null;e&&t.trigger(o.default.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(v&&e.isLast){s.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var t=e.seekTime?e.seekTime:O();f.setCurrentTime(t),k(),z()}}function ce(e){var n=e.target||e.srcElement;t.trigger(o.default.PLAYBACK_ERROR,{error:n.error})}function de(){E&&fe()&&M.get().streaming.liveCatchup.playbackRate>0&&!P()&&!F()&&(function(){try{if(fe()&&M.get().streaming.liveCatchup.playbackRate>0&&B()>0){var e=pe(),t=V(),n=T.getLiveDelay(),i=T.getLiveCatchupLatencyThreshold(),a=M.get().streaming.liveCatchup.minDrift;if(e===r.default.LIVE_CATCHUP_MODE_LOLP){var o=he(),s=M.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(o>n||r<i)}catch(e){return!1}}(t,n,a,o,s,i)}return function(e,t,n,r){try{return Math.abs(e-t)>r&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,i,a)}}catch(e){return!1}}()?function(){if(f){var e=void 0,t=f.getPlaybackRate(),n=M.get().streaming.liveCatchup.playbackRate,i=V(),a=T.getLiveDelay(),o=he();if(pe()===r.default.LIVE_CATCHUP_MODE_LOLP){M.get().streaming.liveCatchup.minDrift;var u=M.get().streaming.liveCatchup.playbackBufferMin;e=function(e,t,n,r,i,a,o){var u=e,l=void 0;if(a<i){var c=5*(a-i),d=2*u/(1+Math.pow(Math.E,-c));l=1-u+d,s.debug("[LoL+ playback control_buffer-based] bufferLevel: "+a+", newRate: "+l)}else{if(Math.abs(t-n)<=.02*n)l=1;else{var f=5*(t-n),h=2*u/(1+Math.pow(Math.E,-f));l=1-u+h}s.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+l)}R&&a>n/2&&(R=!1);Math.abs(o-l)<=D&&(l=null);return{newRate:l}}(n,i,a,0,u,o,t)}else e=function(e,t,n,r,i){var a=e,o=t-n,s=5*o,u=2*a/(1+Math.pow(Math.E,-s)),l=1-a+u;R&&(r>n/2?R=!1:o>0&&(l=1));Math.abs(i-l)<=D&&(l=null);return{newRate:l}}(n,i,a,o,t);var l=e.newRate;l&&f.setPlaybackRate(l);var d=i-a;M.get().streaming.liveCatchup.maxDrift>0&&!w&&d>M.get().streaming.liveCatchup.maxDrift?(s.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),w=!0,U(((h=c.getCurrentDVRInfo())?h.range:null).end-T.getLiveDelay(),!0,!1)):w=!1}var h}():ge())}function fe(){return M.get().streaming.liveCatchup.enabled||M.get().streaming.lowLatencyEnabled}function he(){var e=null;return l.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function pe(){var e=M.get().streaming.liveCatchup.playbackBufferMin;return M.get().streaming.liveCatchup.mode!==r.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?r.default.LIVE_CATCHUP_MODE_DEFAULT:r.default.LIVE_CATCHUP_MODE_LOLP}function ge(){f&&f.setPlaybackRate(1)}function ve(e){if(!1===e.stream&&M.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var t=1.2*e.request.duration;if(t>T.getLiveDelay()){s.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",t.toFixed(2));var n={streaming:{liveDelay:t}};M.update(n)}}}function me(e){e.streamId===y.id&&(fe()?e.state!==i.default.BUFFER_EMPTY||F()||R||(R=!0,ge()):f.setStallState(e.mediaType,e.state===i.default.BUFFER_EMPTY))}function ye(e){t.trigger(o.default.PLAYBACK_STALLED,{e:e})}function Ee(e){!function(e,t){if(e&&e.manifestInfo&&e.manifestInfo.serviceDescriptions){for(var n=void 0,i=0;i<e.manifestInfo.serviceDescriptions.length;i++){var a=e.manifestInfo.serviceDescriptions[i];if(a.schemeIdUri===r.default.SERVICE_DESCRIPTION_LL_SCHEME){n=a;break}}n&&t&&t.supplementalProperties&&"true"===t.supplementalProperties[r.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(n.latency&&n.latency.target>0&&(s.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),M.update({streaming:{lowLatencyEnabled:!0,liveDelay:n.latency.target/1e3,liveCatchup:{minDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(s.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),M.update({streaming:{lowLatencyEnabled:!0,liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(e.streamInfo,e.mediaInfo)}return n={initialize:function(e,n,r){y=e,f.addEventListener("canplay",J),f.addEventListener("play",Z),f.addEventListener("waiting",$),f.addEventListener("playing",ee),f.addEventListener("pause",te),f.addEventListener("error",ce),f.addEventListener("seeking",ne),f.addEventListener("seeked",re),f.addEventListener("timeupdate",ie),f.addEventListener("progress",ae),f.addEventListener("ratechange",oe),f.addEventListener("loadedmetadata",se),f.addEventListener("stalled",ye),f.addEventListener("ended",ue),E=y.manifestInfo.isDynamic,w=!1,R=!1,p=!0===n,g=r,I=!1;var i="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",s=/safari/.test(i)&&!/chrome/.test(i);D=s?.25:.02,t.on(o.default.STREAM_INITIALIZED,L,this),t.on(o.default.DATA_UPDATE_COMPLETED,Q,this),t.on(o.default.LOADING_PROGRESS,ve,this),t.on(o.default.BUFFER_LEVEL_STATE_CHANGED,me,this),t.on(o.default.PLAYBACK_PROGRESS,de,this),t.on(o.default.PLAYBACK_TIME_UPDATED,de,this),t.on(o.default.PLAYBACK_ENDED,le,this,{priority:a.default.EVENT_PRIORITY_HIGH}),t.on(o.default.STREAM_INITIALIZING,Ee,this),_&&(_=!1,x())},setConfig:function(e){e&&(e.streamController&&(l=e.streamController),e.dashMetrics&&(c=e.dashMetrics),e.mediaPlayerModel&&(T=e.mediaPlayerModel),e.adapter&&(d=e.adapter),e.videoModel&&(f=e.videoModel),e.timelineConverter&&(h=e.timelineConverter),e.uriFragmentModel&&(C=e.uriFragmentModel),e.settings&&(M=e.settings))},getStartTimeFromUriParameters:Y,getTimeToStreamEnd:N,getTime:B,getNormalizedTime:G,getPlaybackRate:j,getPlayedRanges:function(){return y&&f?f.getPlayedRanges():null},getEnded:H,getIsDynamic:K,getStreamController:function(){return l},computeAndSetLiveDelay:function(e,t,n){var r,i=void 0,a=void 0,o=!isNaN(e)&&isFinite(e)?e:NaN,s=d.getSuggestedPresentationDelay();if(i=M.get().streaming.lowLatencyEnabled?0:T.getLiveDelay()?T.getLiveDelay():null===M.get().streaming.liveDelayFragmentCount||isNaN(M.get().streaming.liveDelayFragmentCount)||isNaN(o)?!0===M.get().streaming.useSuggestedPresentationDelay&&null!==s&&!isNaN(s)&&s>0?s:isNaN(o)?isNaN(n)?4*y.manifestInfo.minBufferTime:4*n:4*o:o*M.get().streaming.liveDelayFragmentCount,null!==(r=d.getAvailabilityStartTime())&&(S=r),t>0){var u=Math.max(t-10,t/2);a=Math.min(i,u)}else a=i;return m=a,a},getLiveDelay:function(){return m},setLiveDelay:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&e<m||(m=e)},getCurrentLiveLatency:V,play:x,isPaused:P,pause:k,isSeeking:F,getStreamEndTime:O,seek:U,updateCurrentTime:X,reset:q},s=(0,u.default)(e).getInstance().getLogger(n),q(),n}c.__dashjs_factory_name="PlaybackController",t.default=s.default.getSingletonFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.BYTES_APPENDED="bytesAppended",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.DATA_UPDATE_STARTED="dataUpdateStarted",e.INBAND_EVENTS="inbandEvents",e.INITIALIZATION_LOADED="initializationLoaded",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.REPRESENTATION_UPDATE_STARTED="representationUpdateStarted",e.REPRESENTATION_UPDATE_COMPLETED="representationUpdateCompleted",e.SEGMENTS_LOADED="segmentsLoaded",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_COMPLETED="streamCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEGMENTBASE_INIT_REQUEST_NEEDED="segmentBaseInitRequestNeeded",e.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED="segmentBaseSegmentsListRequestNeeded",e.SEEK_TARGET="seekTarget",e}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}(((r=i)&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=_(n(1)),i=_(n(10)),a=_(n(105)),o=_(n(87)),s=_(n(3)),u=_(n(5)),l=_(n(0)),c=n(54),d=_(n(2)),f=_(n(51)),h=_(n(13)),p=_(n(20)),g=_(n(177)),v=_(n(178)),m=_(n(6)),y=_(n(11)),E=_(n(179)),T=_(n(76));function _(e){return e&&e.__esModule?e:{default:e}}function b(){var e=this.context,t=(0,s.default)(e).getInstance(),n=void 0,l=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0,Q=void 0,J=void 0,Z=void 0,$=void 0,ee=void 0,te=void 0,ne=void 0,re=void 0,ie=void 0;function ae(){if(Re()){var e=z.getPlaybackQuality();e&&R.addDroppedFrames(e)}}function oe(e){var t=ge(e.seekTime);t===G&&ne&&ne.length>0&&ne.forEach((function(e){e.deactivate(!0)})),t&&t!==G?(Ce(c.PlayListTrace.END_OF_PERIOD_STOP_REASON),Ee(t,G,e.seekTime)):Ce(c.PlayListTrace.USER_REQUEST_STOP_REASON),Me(c.PlayList.SEEK_START_REASON)}function se(e){var t=ye();Ce(c.PlayListTrace.END_OF_PERIOD_STOP_REASON),Ee(t,G,e.seekTime),Me(c.PlayList.SEEK_START_REASON)}function ue(){l.debug("[onPlaybackStarted]"),Z?(Z=!1,Me(c.PlayList.INITIAL_PLAYOUT_START_REASON)):J&&(J=!1,Me(c.PlayList.RESUME_FROM_PAUSE_START_REASON))}function le(e){l.debug("[onPlaybackPaused]"),e.ended||(J=!0,Ce(c.PlayListTrace.USER_REQUEST_STOP_REASON))}function ce(){$&&(clearInterval($),$=null)}function de(){ee||(ee=setInterval((function(){!function(){if(!G||!fe(G))return;var e=function(e){try{var t=e||(G||null);if(t){var n=t.getStreamInfo().start;return B.filter((function(e){return e.getStreamInfo().start>n}))}}catch(e){return[]}}(G),t=0,n=function(){var n=e[t],i=0===t?G:e[t-1];if(!n.getPreloadingScheduled()&&fe(i)&&W){var a=[r.default.VIDEO,r.default.AUDIO],o=!0;a.forEach((function(e){var t=w.getMediaInfoForType(n.getStreamInfo(),e);w.getVoRepresentations(t).forEach((function(e){var t=w.getIsDynamic(),n=U.calcSegmentAvailabilityRange(e,t);n.end<n.start&&(o=!1)}))})),o&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(W&&!e.getPreloaded()){var n=pe(e,t);n&&(e.setPreloadingScheduled(!0),l.info("[onStreamCanLoadNext] Preloading next stream with id "+e.getId()),!0,e.preload(W,te),ne.push(e),e.getProcessors().forEach((function(t){t.setBufferingTime(e.getStartTime())})))}}(n,i)}t+=1};for(;t<e.length;)n()}()}),500))}function fe(e){try{if(!e)return!1;var t=e.getProcessors().filter((function(e){return e.getType()===r.default.AUDIO||e.getType()===r.default.VIDEO}));if(!t||0===t.length)return!1;var n=t.filter((function(e){return!e.isBufferingCompleted()}));return n&&0===n.length}catch(e){return!1}}function he(){var e=Ne().isLast;W&&e&&(l.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),D.signalEndOfStream(W))}function pe(e,t){try{return ie.get().streaming.reuseExistingSourceBuffers&&t.isProtectionCompatible(e,t)&&(re||t.isMediaCodecCompatible(e,t))&&!function(e){try{var t=e.getStreamInfo(),n=w.getAdaptationForType(t.index,r.default.FRAGMENTED_TEXT,t);return!!n&&(-1!==n.codecs.indexOf("stpp")||-1!==n.codecs.indexOf("wvtt"))}catch(e){return!1}}(e)}catch(e){return!1}}function ge(e){if(isNaN(e))return null;var t=0,n=null,r=B.length;r>0&&(t+=B[0].getStartTime());for(var i=0;i<r;i++)if(n=B[i],e<(t=parseFloat((t+n.getDuration()).toFixed(5))))return n;return null}function ve(){return G?G.getProcessors():[]}function me(e){if(!G.getIsEndedEventSignaled()){G.setIsEndedEventSignaled(!0);var t=ye();t?(l.debug("StreamController onEnded, found next stream with id "+t.getStreamInfo().id),Ee(t,G,NaN)):(l.debug("StreamController no next stream found"),G.setIsEndedEventSignaled(!1)),Ce(t?c.PlayListTrace.END_OF_PERIOD_STOP_REASON:c.PlayListTrace.END_OF_CONTENT_STOP_REASON),!1}e&&e.isLast&&ce()}function ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||(G||null);if(t){for(var n=t.getStreamInfo().start,r=t.getStreamInfo().duration,i=parseFloat((n+r).toFixed(5)),a=0,o=-1,s=NaN;a<B.length;){var u=B[a],l=u.getStreamInfo().start-i;l>=0&&(isNaN(s)||l<s)&&(s=l,o=a),a+=1}return o>=0?B[o]:null}return null}function Ee(e,n,r){if(!(V||!e||n===e&&e.isActive())){V=!0,t.trigger(u.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;n&&(i=pe(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,l.info("Switch to stream "+e.getId()+". Seektime is "+r+", current playback time is "+X.getTime()),l.info("Seamless period switch is set to "+i),G=e,ne=ne.filter((function(e){return e.getId()!==G.getId()})),X.initialize(Ne(),!!n,r),z.getElement()?Te(r,null===n,!1,i):_e(r,i),!1}}function Te(e,n,r,i){var a=void 0;function o(){W&&"open"===W.readyState&&(l.debug("MediaSource is open!"),window.URL.revokeObjectURL(a),W.removeEventListener("sourceopen",o),W.removeEventListener("webkitsourceopen",o),be(),n||t.trigger(u.default.SOURCE_INITIALIZED),r?G.setMediaSource(W):_e(e,i))}W?i?(_e(e,i),n||t.trigger(u.default.SOURCE_INITIALIZED)):(D.detachMediaSource(z),W.addEventListener("sourceopen",o,!1),W.addEventListener("webkitsourceopen",o,!1),a=D.attachMediaSource(W,z),l.debug("MediaSource attached to element. Waiting on open...")):((W=D.createMediaSource()).addEventListener("sourceopen",o,!1),W.addEventListener("webkitsourceopen",o,!1),a=D.attachMediaSource(W,z),l.debug("MediaSource attached to element. Waiting on open..."))}function _e(e,n){if(te=G.activate(W,n?te:void 0)){var r=Object.keys(te);r.length>0&&te[r[0]].changeType&&(re=!0)}Z||isNaN(e)||(e===X.getTime()?t.trigger(u.default.SEEK_TARGET,{time:e},{streamId:G.getId()}):X.seek(e)),!K&&Z||X.play(),V=!1,t.trigger(u.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ne()})}function be(e){var t=e||Ne().manifestInfo.duration;D.setDuration(W,t)}function Se(e){for(var t=0,n=B.length;t<n;t++)if(B[t].getId()===e.id)return B[t];return null}function Ae(){try{var n=w.getStreamsInfo();if(0===n.length)throw new Error("There are no streams");R.updateManifestUpdateInfo({currentTime:X.getTime(),buffered:z.getBufferRange(),presentationStartTime:n[0].start,clientTimeOffset:U.getClientTimeOffset()}),B.length>0&&(B=B.filter((function(e){var t=n.filter((function(t){return t.id===e.getId()})).length>0||e.getId()===G.getId();return t||l.debug("Removing stream "+e.getId()),t})));for(var i=0,o=n.length;i<o;i++){var s=n[i],c=Se(s);c?c.updateData(s):(c=(0,a.default)(e).create({manifestModel:I,mediaPlayerModel:Q,dashMetrics:R,manifestUpdater:S,adapter:w,timelineConverter:U,capabilities:_,capabilitiesFilter:b,errHandler:F,baseURLController:M,abrController:L,playbackController:X,eventController:O,mediaController:N,textController:x,protectionController:j,videoModel:z,streamInfo:s,settings:ie}),B.push(c),c.initialize()),R.addManifestUpdateStreamInfo(s)}if(!G){if(w.getIsDynamic()&&B.length){var d=n[0].manifestInfo,f=function(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var i=e[0],a=[r.default.VIDEO,r.default.AUDIO,r.default.FRAGMENTED_TEXT].reduce((function(e,t){var n=w.getMediaInfoForType(i,t);return n&&e.push(n),e}),[]).reduce((function(e,t){var n=w.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=w.convertDataToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(a))}return isFinite(n)?n:NaN}catch(e){return NaN}}(n,d);X.computeAndSetLiveDelay(f,d.DVRWindowSize,d.minBufferTime)}var h=null;!(h=ge(X.getStartTimeFromUriParameters(w.getIsDynamic())))&&w.getIsDynamic()&&B.length&&(l.debug("Dynamic stream: Trying to find the correct starting period"),h=function(){try{var e=U.calcPresentationTimeFromWallTime(new Date,w.getRegularPeriods()[0]),t=X.getLiveDelay();return ge(e-t)}catch(e){return null}}()),Ee(null!==h?h:B[0],null,NaN),$||($=setInterval((function(){!V&&X.getTimeToStreamEnd()<=0&&t.trigger(u.default.PLAYBACK_ENDED,{isLast:Ne().isLast})}),200)),de()}t.trigger(u.default.STREAMS_COMPOSED)}catch(e){F.error(new m.default(y.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",I.getValue())),Y=!0,ke()}}function Ie(){var e=I.getValue();j&&(t.trigger(u.default.PROTECTION_CREATED,{controller:j,manifest:e}),j.setMediaElement(z.getElement()),H&&j.setProtectionData(H)),Ae()}function we(e){if(e.error)Y=!0,ke();else{var n=e.manifest;w.updatePeriods(n);var r=w.getUTCTimingSources();!w.getIsDynamic()||r&&0!==r.length||t.trigger(p.default.CONFORMANCE_VIOLATION,{level:T.default.LEVELS.WARNING,event:T.default.EVENTS.NO_UTC_TIMING_ELEMENT});var i=w.getIsDynamic()?r.concat(Q.getUTCTimingSources()):r,a=k.isHTTPS(e.manifest.url);i.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===Q.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(a?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),a?"https://":"http://"),l.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),M.initialize(n),C.attemptSync(i)}}function Re(){return!!G&&G.getHasVideoTrack()}function De(){return!!G&&G.getHasAudioTrack()}function Ce(e,t){t=t||new Date,ve().forEach((function(n){n.finalisePlayList(t,e)})),R.addPlayList()}function Me(e){R.createPlaylistMetrics(1e3*X.getTime(),e)}function Le(e){if(e.error){var t="";switch(e.error.code){case 1:t="MEDIA_ERR_ABORTED";break;case 2:t="MEDIA_ERR_NETWORK";break;case 3:t="MEDIA_ERR_DECODE";break;case 4:t="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:t="MEDIA_ERR_ENCRYPTED";break;default:t="UNKNOWN"}q=!0,e.error.message&&(t+=" ("+e.error.message+")"),e.error.msExtendedCode&&(t+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),l.fatal("Video Element Error: "+t),e.error&&l.fatal(e.error),F.error(new m.default(e.error.code,t)),ke()}}function Ne(){return G?G.getStreamInfo():null}function Oe(){if(!(A&&A.hasOwnProperty("load")&&U&&U.hasOwnProperty("initialize")&&U.hasOwnProperty("reset")&&U.hasOwnProperty("getClientTimeOffset")&&I&&F&&R&&X))throw new Error(r.default.MISSING_CONFIG_ERROR)}function xe(e){isNaN(e.newDuration)||be(e.newDuration)}function Pe(){B=[],j=null,V=!1,G=null,q=!1,Y=!1,Z=!0,J=!1,K=!0,$=null,!1,ee=null,!1,ne=[]}function ke(){Oe(),C.reset(),Ce(q||Y?c.PlayListTrace.FAILURE_STOP_REASON:c.PlayListTrace.USER_REQUEST_STOP_REASON);for(var e=0,r=B?B.length:0;e<r;e++){B[e].reset(q)}t.off(u.default.PLAYBACK_TIME_UPDATED,ae,n),t.off(u.default.PLAYBACK_SEEKING,oe,n),t.off(u.default.GAP_CAUSED_SEEK_TO_PERIOD_END,se,n),t.off(u.default.PLAYBACK_ERROR,Le,n),t.off(u.default.PLAYBACK_STARTED,ue,n),t.off(u.default.PLAYBACK_PAUSED,le,n),t.off(u.default.PLAYBACK_ENDED,me,n),t.off(u.default.MANIFEST_UPDATED,we,n),t.off(u.default.STREAM_BUFFERING_COMPLETED,he,n),t.off(u.default.MANIFEST_VALIDITY_CHANGED,xe,n),t.off(u.default.TIME_SYNCHRONIZATION_COMPLETED,Ie,n),t.off(p.default.METRIC_ADDED,Fe,n),M.reset(),S.reset(),O.reset(),R.clearAllCurrentMetrics(),I.setValue(null),A.reset(),U.reset(),P.reset(),W&&(D.detachMediaSource(z),W=null),z=null,j&&(j.setMediaElement(null),j=null,H=null,I.getValue()&&t.trigger(u.default.PROTECTION_DESTROYED,{data:I.getValue().url})),ce(),clearInterval(ee),ee=null,t.trigger(u.default.STREAM_TEARDOWN_COMPLETE),Pe()}function Fe(e){if(e.metric===i.default.DVR_INFO){var t=De()?r.default.AUDIO:r.default.VIDEO;e.mediaType===t&&D.setSeekable(W,e.value.range.start,e.value.range.end)}}return n={initialize:function(r,i){Oe(),K=r,H=i,U.initialize(),(S=(0,o.default)(e).create()).setConfig({manifestModel:I,adapter:w,manifestLoader:A,errHandler:F,settings:ie}),S.initialize(),(O=(0,E.default)(e).getInstance()).setConfig({manifestUpdater:S,playbackController:X,settings:ie}),O.start(),C.setConfig({dashMetrics:R,baseURLController:M,settings:ie}),C.initialize(),t.on(u.default.PLAYBACK_TIME_UPDATED,ae,n),t.on(u.default.PLAYBACK_SEEKING,oe,n),t.on(u.default.GAP_CAUSED_SEEK_TO_PERIOD_END,se,n),t.on(u.default.PLAYBACK_ERROR,Le,n),t.on(u.default.PLAYBACK_STARTED,ue,n),t.on(u.default.PLAYBACK_PAUSED,le,n),t.on(u.default.PLAYBACK_ENDED,me,n,{priority:s.default.EVENT_PRIORITY_HIGH}),t.on(u.default.MANIFEST_UPDATED,we,n),t.on(u.default.STREAM_BUFFERING_COMPLETED,he,n),t.on(u.default.MANIFEST_VALIDITY_CHANGED,xe,n),t.on(u.default.TIME_SYNCHRONIZATION_COMPLETED,Ie,n),t.on(p.default.METRIC_ADDED,Fe,n)},getActiveStreamInfo:Ne,hasVideoTrack:Re,hasAudioTrack:De,switchToVideoElement:function(e){G&&(X.initialize(Ne()),Te(e,!1,!0,!1))},getStreamById:function(e){return B.filter((function(t){return t.getId()===e}))[0]},getStreamForTime:ge,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,o=0;o<B.length;o++){if(i=(n=B[o]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){Oe(),A.load(e)},loadWithManifest:function(e){!function(){if(!S||!S.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),S.setManifest(e)},getActiveStreamProcessors:ve,setConfig:function(e){e&&(e.capabilities&&(_=e.capabilities),e.capabilitiesFilter&&(b=e.capabilitiesFilter),e.manifestLoader&&(A=e.manifestLoader),e.manifestModel&&(I=e.manifestModel),e.mediaPlayerModel&&(Q=e.mediaPlayerModel),e.protectionController&&(j=e.protectionController),e.adapter&&(w=e.adapter),e.dashMetrics&&(R=e.dashMetrics),e.errHandler&&(F=e.errHandler),e.timelineConverter&&(U=e.timelineConverter),e.videoModel&&(z=e.videoModel),e.playbackController&&(X=e.playbackController),e.abrController&&(L=e.abrController),e.mediaController&&(N=e.mediaController),e.textController&&(x=e.textController),e.settings&&(ie=e.settings),e.baseURLController&&(M=e.baseURLController))},setProtectionData:function(e){H=e},getIsStreamSwitchInProgress:function(){return V},getHasMediaOrIntialisationError:function(){return q||Y},hasStreamFinishedBuffering:fe,getStreams:function(){return B},getActiveStream:function(){return G},reset:ke},l=(0,d.default)(e).getInstance().getLogger(n),C=(0,g.default)(e).getInstance(),D=(0,v.default)(e).getInstance(),P=(0,f.default)(e).getInstance(),k=(0,h.default)(e).getInstance(),Pe(),n}b.__dashjs_factory_name="StreamController",t.default=l.default.getSingletonFactory(b)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(1)),i=v(n(9)),a=v(n(106)),o=v(n(162)),s=v(n(175)),u=v(n(3)),l=v(n(5)),c=v(n(2)),d=v(n(11)),f=v(n(0)),h=v(n(6)),p=v(n(27)),g=v(n(13));function v(e){return e&&e.__esModule?e:{default:e}}function m(e){e=e||{};var t=this.context,n=(0,u.default)(t).getInstance(),f=(0,g.default)(t).getInstance(),v=e.manifestModel,m=e.mediaPlayerModel,y=e.manifestUpdater,E=e.adapter,T=e.capabilities,_=e.capabilitiesFilter,b=e.errHandler,S=e.timelineConverter,A=e.dashMetrics,I=e.abrController,w=e.playbackController,R=e.eventController,D=e.mediaController,C=e.textController,M=e.protectionController,L=e.videoModel,N=e.settings,O=e.streamInfo,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0,Q=void 0,J=void 0;function Z(e){for(var t=k?k.length:0,r=0;r<t;r++){k[r].getFragmentModel().removeExecutedRequestsBeforeTime(ne()+te()),k[r].reset(!1,e)}k=[],U=!1,B=!1,be(!1),n.off(l.default.CURRENT_TRACK_CHANGED,le,x)}function $(){Z(),F=!1,G=!1,j=!1,H={},K=!1,z=!1,Q=!1}function ee(){w&&w.pause(),V&&(V.reset(),V=null),O=null,$(),n.off(l.default.DATA_UPDATE_COMPLETED,ge,x),n.off(l.default.BUFFERING_COMPLETED,pe,x),n.off(l.default.INBAND_EVENTS,ve,x),M&&(n.off(l.default.KEY_ERROR,se,x),n.off(l.default.SERVER_CERTIFICATE_UPDATED,se,x),n.off(l.default.LICENSE_REQUEST_COMPLETE,se,x),n.off(l.default.KEY_SYSTEM_SELECTED,se,x),n.off(l.default.KEY_SESSION_CREATED,se,x),n.off(l.default.KEY_STATUSES_CHANGED,se,x)),be(!1)}function te(){return O?O.duration:NaN}function ne(){return O?O.start:NaN}function re(){if(!O.manifestInfo.isDynamic)return NaN;for(var e=0;e<k.length;e++)if(k[e].getType()===r.default.AUDIO||k[e].getType()===r.default.VIDEO)return k[e].getLiveStartTime();return NaN}function ie(){return O?O.id:null}function ae(){return O}function oe(){if(!(L&&I&&I.hasOwnProperty("getBitrateList")&&E&&E.hasOwnProperty("getAllMediaInfoForType")&&E.hasOwnProperty("getEventsFor")))throw new Error(r.default.MISSING_CONFIG_ERROR)}function se(e){e.error&&(b.error(e.error),P.fatal(e.error.message),ee())}function ue(e){var t,n=e?e.type:null,i=void 0;if(n===r.default.MUXED)return i="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",P.fatal(i),b.error(new h.default(d.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,i,v.getValue())),!1;if(n===r.default.TEXT||n===r.default.FRAGMENTED_TEXT||n===r.default.EMBEDDED_TEXT||n===r.default.IMAGE)return!0;if(t=e.codec,P.debug(n+" codec: "+t),e.contentProtection&&!T.supportsEncryptedMedia())b.error(new h.default(d.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,d.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE));else if(!T.supportsCodec(t))return i=n+"Codec ("+t+") is not supported.",P.error(i),!1;return!0}function le(e){if(O&&e.newMediaInfo.streamInfo.id===O.id){var t=e.newMediaInfo,n=v.getValue();E.setCurrentMediaInfo(O.id,t.type,t);var i=me(t);if(i){var a=w.getTime();P.info("Stream - Process track changed at current time "+a),P.debug("Stream - Update stream controller"),n.refreshManifestOnSwitchTrack?(P.debug("Stream - Refreshing manifest for switch track"),J=e,y.refreshManifest()):(i.selectMediaInfo(t),t.type!==r.default.FRAGMENTED_TEXT?(I.updateTopQualityIndex(t),i.switchTrackAsked(),i.getFragmentModel().abortRequests()):(i.getScheduleController().setSeekTarget(a),i.setBufferingTime(a),i.resetIndexHandler()))}}}function ce(o,u){var c,d=E.getAllMediaInfoForType(O,o),f=null;if(d&&0!==d.length){o===r.default.VIDEO&&(G=!0),o===r.default.AUDIO&&(j=!0);for(var h=0,p=d.length;h<p;h++)if(f=d[h],o===r.default.EMBEDDED_TEXT)C.addEmbeddedTrack(f);else{if(!ue(f))continue;D.addTrack(f)}o!==r.default.EMBEDDED_TEXT&&0!==D.getTracksFor(o,O).length&&(o!==r.default.IMAGE?(D.checkInitialMediaSettingsForType(o,O),c=D.getCurrentTrackFor(o,O),n.trigger(l.default.STREAM_INITIALIZING,{streamInfo:O,mediaInfo:f}),function(n,i,o,s){var u=V.getModel(n?n.type:null),l=(0,a.default)(t).create({streamInfo:O,type:n?n.type:null,mimeType:n?n.mimeType:null,timelineConverter:S,adapter:E,manifestModel:v,mediaPlayerModel:m,fragmentModel:u,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,abrController:I,playbackController:w,mediaController:D,textController:C,errHandler:b,settings:N,boxParser:W});if(l.initialize(o,G),I.updateTopQualityIndex(n),s?(l.setBuffer(s.buffer),l.setBufferingTime(s.currentTime),k[s.replaceIdx]=l):k.push(l),!s||!s.ignoreMediaInfo)if(!n||n.type!==r.default.TEXT&&n.type!==r.default.FRAGMENTED_TEXT)l.addMediaInfo(n,!0);else{for(var c=void 0,d=0;d<i.length;d++)i[d].index===n.index&&(c=d),l.addMediaInfo(i[d]);l.selectMediaInfo(i[c])}}(c,d,u)):q=(0,s.default)(t).create({streamInfo:O,adapter:E,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:X,eventBus:n,events:l.default,dashConstants:i.default}))}else P.info("No "+o+" data.")}function de(){if(R){var e=E.getEventsFor(O);R.addInlineEvents(e)}}function fe(){for(var e=k.length,t=!!H.audio||!!H.video?new h.default(d.default.DATA_UPDATE_FAILED_ERROR_CODE,d.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,i=0;i<e;i++)if(k[i].isUpdating()||K)return;if(B){if(M){M.clearMediaInfoArrayByStreamId(ie());for(var a=0;a<e&&k[a];a++){var o=k[a].getType();if(o===r.default.AUDIO||o===r.default.VIDEO||o===r.default.FRAGMENTED_TEXT){var s=k[a].getMediaInfo();s&&M.initializeForMedia(s)}}}t?b.error(t):F||(F=!0,n.trigger(l.default.STREAM_INITIALIZED,{streamInfo:O,liveStartTime:Y?NaN:re()}));for(var u=0;u<e&&k[u];u++)k[u].getScheduleController().start()}}function he(e){for(var t={},n=0,r=k.length;n<r;n++){var i=k[n].createBuffer(e);i&&(t[k[n].getType()]=i.getBuffer())}return t}function pe(){var e=ye(),t=e.length;if(0!==t){for(var i=0;i<t;i++)if(!e[i].isBufferingCompleted()&&(e[i].getType()===r.default.AUDIO||e[i].getType()===r.default.VIDEO))return void P.warn("onBufferingCompleted - One streamProcessor has finished but",e[i].getType(),"one is not buffering completed");P.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),n.trigger(l.default.STREAM_BUFFERING_COMPLETED,{streamInfo:O})}else P.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function ge(e){H[e.mediaType]=e.error,fe()}function ve(e){var t;t=e.events,R&&R.addInbandEvents(t)}function me(e){return e?ye().filter((function(t){return t.getType()===e.type}))[0]:null}function ye(){for(var e=[],t=void 0,n=void 0,i=0;i<k.length;i++)(t=(n=k[i]).getType())!==r.default.AUDIO&&t!==r.default.VIDEO&&t!==r.default.FRAGMENTED_TEXT&&t!==r.default.TEXT||e.push(n);return e}function Ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():ae();if(!r||!i)return!1;var a=E.getAdaptationForType(r.index,t,r),o=E.getAdaptationForType(i.index,t,i);return a&&o?!(!Te(o)&&Te(a)):!a&&!o}function Te(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():ae();if(!r||!i)return!1;var a=E.getAdaptationForType(r.index,t,r),o=E.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var s=a&&o&&a.mimeType===o.mimeType,u=o.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),d=l.some((function(e){return u.some((function(t){return T.codecRootCompatibleWithCodec(t,e)}))}));return c||d&&s}function be(e){Y=e}function Se(){return Y}return x={initialize:function(){n.on(l.default.BUFFERING_COMPLETED,pe,x),n.on(l.default.DATA_UPDATE_COMPLETED,ge,x),n.on(l.default.INBAND_EVENTS,ve,x),M&&(n.on(l.default.KEY_ERROR,se,x),n.on(l.default.SERVER_CERTIFICATE_UPDATED,se,x),n.on(l.default.LICENSE_REQUEST_COMPLETE,se,x),n.on(l.default.KEY_SYSTEM_SELECTED,se,x),n.on(l.default.KEY_SESSION_CREATED,se,x),n.on(l.default.KEY_STATUSES_CHANGED,se,x)),n.trigger(l.default.STREAM_UPDATED,{streamInfo:O})},getStreamId:function(){return O?O.id:null},activate:function(e,t){if(!U){var i=void 0;return n.on(l.default.CURRENT_TRACK_CHANGED,le,x),Se()?(!function(){if(K=!0,oe(),_.filterUnsupportedFeaturesOfPeriod(O),B=!0,K=!1,0===k.length){var e="No streams to play.";b.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e,v.getValue())),P.debug(e)}else fe()}(),i=t):i=function(e,t){oe();var n=L.getElement();de(),K=!0,_.filterUnsupportedFeaturesOfPeriod(O),(!n||n&&/^VIDEO$/i.test(n.nodeName))&&ce(r.default.VIDEO,e);ce(r.default.AUDIO,e),ce(r.default.TEXT,e),ce(r.default.FRAGMENTED_TEXT,e),ce(r.default.EMBEDDED_TEXT,e),ce(r.default.MUXED,e),ce(r.default.IMAGE,e);var i=he(t);if(B=!0,K=!1,0===k.length){var a="No streams to play.";b.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,v.getValue())),P.fatal(a)}else fe();return i}(e,t),U=!0,i}return t},deactivate:Z,isActive:function(){return U},getDuration:te,getStartTime:ne,getId:ie,getStreamInfo:ae,getHasAudioTrack:function(){return j},getHasVideoTrack:function(){return G},preload:function(e,t){if(!Se()){de(),ce(r.default.VIDEO,e),ce(r.default.AUDIO,e),ce(r.default.TEXT,e),ce(r.default.FRAGMENTED_TEXT,e),ce(r.default.EMBEDDED_TEXT,e),ce(r.default.MUXED,e),ce(r.default.IMAGE,e),he(t),n.on(l.default.CURRENT_TRACK_CHANGED,le,x);for(var i=0;i<k.length&&k[i];i++)k[i].getScheduleController().start();be(!0)}},getThumbnailController:function(){return q},getBitrateListFor:function(e){if(oe(),e===r.default.IMAGE)return q?q.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<k.length;n++)if((t=k[n]).getType()===e)return t.getMediaInfo();return null}(e);return I.getBitrateList(t)},updateData:function(e){P.info("Manifest updated... updating data system wide."),U=!1,K=!0,O=e,n.trigger(l.default.STREAM_UPDATED,{streamInfo:O}),R&&de(),_.filterUnsupportedFeaturesOfPeriod(O);for(var t=0,i=k.length;t<i;t++){var a=k[t];a.updateStreamInfo(O);var o=E.getMediaInfoForType(O,a.getType());o&&(I.updateTopQualityIndex(o),a.addMediaInfo(o,!0))}if(J&&J.newMediaInfo.type!==r.default.FRAGMENTED_TEXT){var s=me(J.oldMediaInfo);if(!s)return;s.switchTrackAsked(),J=void 0}K=!1,fe()},reset:ee,getProcessors:ye,setMediaSource:function(e){for(var t=0;t<k.length;)ue(k[t].getMediaInfo())?(k[t].setMediaSource(e),t++):(k[t].reset(),k.splice(t,1));for(var n=0;n<k.length;n++)k[n].dischargePreBuffer();if(0===k.length){var r="No streams to play.";b.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,r+"nostreams",v.getValue())),P.fatal(r)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,r.default.VIDEO,t)&&_e(e,r.default.AUDIO,t)},isProtectionCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Ee(e,r.default.VIDEO,t)&&Ee(e,r.default.AUDIO,t)},getPreloaded:Se,getPreloadingScheduled:function(){return z},setPreloadingScheduled:function(e){z=e},getIsEndedEventSignaled:function(){return Q},setIsEndedEventSignaled:function(e){Q=e}},X=(0,c.default)(t).getInstance(),P=X.getLogger(x),$(),W=(0,p.default)(t).getInstance(),V=(0,o.default)(t).create({streamInfo:O,mediaPlayerModel:m,dashMetrics:A,errHandler:b,settings:N,boxParser:W,dashConstants:i.default,urlUtils:f}),x}m.__dashjs_factory_name="Stream",t.default=f.default.getClassFactory(m)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=I(n(1)),i=I(n(9)),a=I(n(10)),o=I(n(26)),s=I(n(66)),u=I(n(150)),l=I(n(152)),c=I(n(154)),d=I(n(155)),f=I(n(0)),h=n(15),p=I(n(3)),g=I(n(5)),v=I(n(80)),m=I(n(11)),y=I(n(6)),E=I(n(2)),T=I(n(53)),_=I(n(13)),b=I(n(27)),S=I(n(16)),A=n(54);function I(e){return e&&e.__esModule?e:{default:e}}function w(e){e=e||{};var t=this.context,n=(0,p.default)(t).getInstance(),f=e.streamInfo,I=e.type,w=e.errHandler,R=e.mimeType,D=e.timelineConverter,C=e.adapter,M=e.manifestModel,L=e.mediaPlayerModel,N=e.fragmentModel,O=e.abrController,x=e.playbackController,P=e.mediaController,k=e.textController,F=e.dashMetrics,U=e.settings,B=e.boxParser,G=void 0,j=void 0,H=void 0,K=void 0,V=void 0,q=void 0,Y=void 0,W=void 0,z=void 0,X=void 0,Q=void 0,J=void 0;function Z(){return I}function $(){V=[],K=null,Q=0}function ee(e){(e.error||Y.setCurrentRepresentation(C.convertDataToRepresentationInfo(e.currentRepresentation)),e.error&&e.error.code!==m.default.SEGMENTS_UPDATE_FAILED_ERROR_CODE)||x.getStreamController().getActiveStreamInfo().id===f.id&&oe()}function te(e){var t=ce(e.newQuality);Y.setCurrentRepresentation(t),F.pushPlayListTraceMetrics(new Date,A.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),F.createPlaylistTraceMetrics(t.id,1e3*x.getTime(),x.getPlaybackRate())}function ne(e){F.addBufferLevel(I,new Date,1e3*e.bufferLevel);var t=x.getStreamController().getActiveStreamInfo().id;M.getValue().doNotUpdateDVRWindowOnBufferUpdated||f.id!==t||oe()}function re(e){F.addBufferState(I,e.state,Y.getBufferTarget()),e.state!==a.default.BUFFER_EMPTY||x.isSeeking()||F.pushPlayListTraceMetrics(new Date,A.PlayListTrace.REBUFFERING_REASON)}function ie(e){N.syncExecutedRequestsWithBufferedRange(q.getBuffer().getAllBufferRanges(),f.duration),e.from>x.getTime()&&(Q=e.from,J=!0)}function ae(e){Q=e.quotaExceededTime,J=!0}function oe(){var e=f.manifestInfo,t=e.isDynamic,n=D.calcSegmentAvailabilityRange(W.getCurrentRepresentation(),t);F.addDVRInfo(Z(),x.getTime(),e,n)}function se(){return q?q.getBuffer():null}function ue(){return V}function le(){return K}function ce(e){var t=void 0;return void 0!==e?((0,h.checkInteger)(e),t=W?W.getRepresentationForQuality(e):null):t=W?W.getCurrentRepresentation():null,C.convertDataToRepresentationInfo(t)}function de(e){if(e.sender&&(!C.getIsTextTrack(R)||k.isTextEnabled())&&q&&e.representationId&&!q.appendInitSegment(e.representationId)){var t=X?X.getInitRequest(le(),W.getCurrentRepresentation()):null;Y.processInitRequest(t)}}function fe(e){var t=void 0;q.getIsPruningInProgress()||(t=function(e,t){var n=ce(),i=!isNaN(e),a=x.getNormalizedTime(),o=i?e:Q,s=!1,u=void 0;if(isNaN(o)||Z()===r.default.FRAGMENTED_TEXT&&!k.isTextEnabled())return null;if(q){var l=q.getRangeAt(o),c=q.getRangeAt(a);if((null!==l||null!==c)&&!i)if(!l||c&&c.start!=l.start&&c.end!=l.end)q.getBuffer().hasDiscontinuitiesAfter(a)&&Z()!==r.default.FRAGMENTED_TEXT&&(N.removeExecutedRequestsAfterTime(c.end),s=!0)}if(t)o=t.startTime+t.duration/2,u=ge(n,o,{timeThreshold:0,ignoreIsFinished:!0});else{var d=i||J||s;for(u=ge(n,d?o:void 0,{keepIdx:!d}),J=!1;u&&u.action!==S.default.ACTION_COMPLETE&&N.isFragmentLoaded(u);)u=ge(n)}return u}(e.seekTarget,e.replacement))&&(Y.setSeekTarget(NaN),e.replacement||(isNaN(t.startTime+t.duration)||(Q=t.startTime+t.duration),t.delayLoadingTime=(new Date).getTime()+Y.getTimeToLoadDelay(),Y.setTimeToLoadDelay(0))),Y.processMediaRequest(t)}function he(e){var r=e.chunk,i=r.bytes,a=r.quality,s=ce(a),u=W&&s?W.getRepresentationForQuality(s.quality):null,l=C.getEventsFor(s.mediaInfo),c=C.getEventsFor(s,u);if(l&&l.length>0||c&&c.length>0){var d=function(e,n,r,i){try{for(var a={},o=[],s=r.concat(i),u=0,l=s.length;u<l;u++)a[s[u].schemeIdUri+"/"+s[u].value]=s[u];var c=(0,b.default)(t).getInstance().parse(e),d=c.getBoxes("emsg");if(!d||0===d.length)return o;for(var f=c.getBox("sidx"),h=!f||isNaN(f.earliest_presentation_time)||isNaN(f.timescale)?n&&!isNaN(n.mediaStartTime)?n.mediaStartTime:0:f.earliest_presentation_time/f.timescale,p=Math.max(h,0),g=W.getCurrentRepresentation(),v=0,m=d.length;v<m;v++){var y=C.getEvent(d[v],a,p,g);y&&o.push(y)}return o}catch(e){return[]}}(i,N.getRequests({state:o.default.FRAGMENT_MODEL_EXECUTED,quality:a,index:r.index})[0],l,c);n.trigger(g.default.INBAND_EVENTS,{events:d},{streamId:f.id})}}function pe(e){Q=e.time,Y.setSeekTarget(e.time)}function ge(e,t,n){var r=null;if(X){var i=W&&e?W.getRepresentationForQuality(e.quality):null;r=void 0!==t&&void 0!==n?X.getSegmentRequestForTime(le(),i,t,n):X.getNextSegmentRequest(le(),i)}return r}return G={initialize:function(a,o){X=(0,v.default)(t).create({streamInfo:f,type:I,timelineConverter:D,dashMetrics:F,mediaPlayerModel:L,baseURLController:e.baseURLController,errHandler:w,settings:U,boxParser:B,events:g.default,eventBus:n,errors:m.default,debug:(0,E.default)(t).getInstance(),requestModifier:(0,T.default)(t).getInstance(),dashConstants:i.default,constants:r.default,urlUtils:(0,_.default)(t).getInstance()}),(H=f.manifestInfo.isDynamic)&&(z=(0,d.default)(t).create({timelineConverter:D})),X.initialize(H),O.registerStreamType(I,G),W=(0,c.default)(t).create({streamInfo:f,type:I,abrController:O,dashMetrics:F,playbackController:x,timelineConverter:D,dashConstants:i.default,events:g.default,eventBus:n,errors:m.default}),(q=function(e){var n=null;if(!e)return w.error(new y.default(m.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,m.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null;n=e===r.default.VIDEO||e===r.default.AUDIO?(0,s.default)(t).create({streamInfo:f,type:e,mediaPlayerModel:L,manifestModel:M,fragmentModel:N,errHandler:w,mediaController:P,representationController:W,adapter:C,textController:k,abrController:O,playbackController:x,settings:U}):(0,u.default)(t).create({streamInfo:f,type:e,mimeType:R,mediaPlayerModel:L,manifestModel:M,fragmentModel:N,errHandler:w,mediaController:P,representationController:W,adapter:C,textController:k,abrController:O,playbackController:x,settings:U});return n}(I))&&q.initialize(a),(Y=(0,l.default)(t).create({streamInfo:f,type:I,mimeType:R,adapter:C,dashMetrics:F,mediaPlayerModel:L,fragmentModel:N,abrController:O,playbackController:x,textController:k,mediaController:P,bufferController:q,settings:U})).initialize(o),Q=0,J=!1},getStreamId:function(){return f.id},getType:Z,isUpdating:function(){return!!W&&W.isUpdating()},getBufferController:function(){return q},getFragmentModel:function(){return N},getScheduleController:function(){return Y},getRepresentationController:function(){return W},getRepresentationInfo:ce,getBufferLevel:function(){return q?q.getBufferLevel():0},isBufferingCompleted:function(){return!!q&&q.getIsBufferingCompleted()},createBuffer:function(e){return se()||q?q.createBuffer(V,e):null},updateStreamInfo:function(e){f=e,U.get().streaming.useAppendWindow&&q.updateAppendWindow()},getStreamInfo:function(){return f},selectMediaInfo:function(e){e===K||e&&K&&e.type!==K.type||(K=e);var t=C.getRealAdaptation(f,K),n=C.getVoRepresentations(K);if(W){var i=W.getData(),a=O.getTopQualityIndexFor(I,f.id),o=O.getMinAllowedIndexFor(I),s=void 0,u=null;null!==i&&i.id==t.id||I===r.default.FRAGMENTED_TEXT?s=O.getQualityFor(I):(u=O.getThroughputHistory().getAverageThroughput(I)||O.getInitialBitrateFor(I),s=O.getQualityForBitrate(K,u)),void 0!==o&&s<o&&(s=o),s>a&&(s=a),X.setMimeType(K?K.mimeType:null),W.updateData(t,n,I,s)}},addMediaInfo:function(e,t){-1===V.indexOf(e)&&V.push(e),t&&this.selectMediaInfo(e)},getLiveStartTime:function(){if(!H)return NaN;if(!z)return NaN;var e=NaN,t=ce(),n=z.getLiveEdge(t);if(isNaN(n))return NaN;var r=function(e,t){try{var n=null,r=x.getLiveDelay(),i=isNaN(f.manifestInfo.DVRWindowSize)?r:f.manifestInfo.DVRWindowSize,a=.1*i,o=void 0;if(!isFinite(i)||ge(t,e-i+a,{ignoreIsFinished:!0}))for(;!n&&r<=i;)(n=ge(t,o=e-r,{ignoreIsFinished:!0}))||(r+=1);return n&&x.setLiveDelay(r,!0),j.debug("live edge: "+e+", live delay: "+r+", live target: "+o),n}catch(e){return null}}(n,t);return r&&(e=U.get().streaming.lowLatencyEnabled?r.duration<L.getLiveDelay()?r.startTime:r.startTime+r.duration-L.getLiveDelay():r.startTime),e},switchTrackAsked:function(){Y.switchTrackAsked()},getMediaInfoArr:ue,getMediaInfo:le,getMediaSource:function(){return q.getMediaSource()},setMediaSource:function(e){q.setMediaSource(e,ue())},dischargePreBuffer:function(){q.dischargePreBuffer()},getBuffer:se,setBuffer:function(e){q.setBuffer(e)},setBufferingTime:function(e){Q=e},resetIndexHandler:function(){X&&X.resetIndex()},getInitRequest:function(e){(0,h.checkInteger)(e);var t=W?W.getRepresentationForQuality(e):null;return X?X.getInitRequest(le(),t):null},getFragmentRequest:ge,finalisePlayList:function(e,t){F.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=ce(),t=W&&e?W.getRepresentationForQuality(e.quality):null;return X.getNextSegmentRequestIdempotent(le(),t)},reset:function(e,t){X&&X.reset(),q&&(q.reset(e,t),q=null),Y&&(Y.reset(),Y=null),W&&(W.reset(),W=null),z&&(z.reset(),z=null),O&&!t&&O.unRegisterStreamType(I),n.off(g.default.DATA_UPDATE_COMPLETED,ee,G),n.off(g.default.QUALITY_CHANGE_REQUESTED,te,G),n.off(g.default.INIT_FRAGMENT_NEEDED,de,G),n.off(g.default.MEDIA_FRAGMENT_NEEDED,fe,G),n.off(g.default.MEDIA_FRAGMENT_LOADED,he,G),n.off(g.default.BUFFER_LEVEL_UPDATED,ne,G),n.off(g.default.BUFFER_LEVEL_STATE_CHANGED,re,G),n.off(g.default.BUFFER_CLEARED,ie,G),n.off(g.default.SEEK_TARGET,pe,G),$(),I=null,f=null}},j=(0,E.default)(t).getInstance().getLogger(G),$(),n.on(g.default.DATA_UPDATE_COMPLETED,ee,G,{priority:p.default.EVENT_PRIORITY_HIGH}),n.on(g.default.QUALITY_CHANGE_REQUESTED,te,G),n.on(g.default.INIT_FRAGMENT_NEEDED,de,G),n.on(g.default.MEDIA_FRAGMENT_NEEDED,fe,G),n.on(g.default.MEDIA_FRAGMENT_LOADED,he,G),n.on(g.default.BUFFER_LEVEL_UPDATED,ne,G),n.on(g.default.BUFFER_LEVEL_STATE_CHANGED,re,G),n.on(g.default.BUFFER_CLEARED,ie,G),n.on(g.default.QUOTA_EXCEEDED,ae,G),n.on(g.default.SEEK_TARGET,pe,G),G}w.__dashjs_factory_name="StreamProcessor",t.default=f.default.getClassFactory(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=y(n(1)),i=n(8),a=y(n(108)),o=y(n(27)),s=y(n(68)),u=y(n(0)),l=y(n(2)),c=y(n(44)),d=y(n(130)),f=y(n(43)),h=y(n(65)),p=y(n(3)),g=y(n(5)),v=y(n(6)),m=y(n(11));function y(e){return e&&e.__esModule?e:{default:e}}function E(){var e=this.context,t=(0,p.default)(e).getInstance(),n=!1,u=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0;function K(){C=null,L=NaN,N=[],P=null,M=!1}function V(){K(),R=[],A=null}function q(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&X(t.bytes,t)}function Y(){F=[],(D=(0,c.default)(e).getInstance()).setConfig({videoModel:O}),D.initialize(),E=(0,o.default)(e).getInstance(),k=null,U=0,G=[],B=null,n=!0,j=(0,d.default)(e).getInstance();var r=x.getActiveStreamProcessors();for(var i in r)if("video"===r[i].getType()){H=r[i].getRepresentationInfo().MSETimeOffset;break}t.on(g.default.VIDEO_CHUNK_RECEIVED,q,this),t.on(g.default.BUFFER_CLEARED,J,this)}function W(e){k=e}function z(e,t){var n,i,o=new a.default,s={subtitle:"subtitles",caption:"captions"};o.captionData=e,o.lang=t.lang,o.labels=t.labels,o.id=t.id?t.id:t.index,o.index=t.index,o.isTTML=(n=!1,t.codec&&t.codec.search(r.default.STPP)>=0&&(n=!0),t.mimeType&&t.mimeType.search(r.default.TTML)>=0&&(n=!0),n),o.defaultTrack=function(e){var t=!1;F.length>1&&e.isEmbedded?t=e.id&&e.id===r.default.CC1:1===F.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===F.length&&(t=e.index===R[0].index);return t}(t),o.isFragmented=!_.getIsTextTrack(t.mimeType),o.isEmbedded=!!t.isEmbedded,o.kind=i=(i=t.roles.length>0?s[t.roles[0]]:s.caption)===s.caption||i===s.subtitle?i:s.caption,o.roles=t.roles,o.accessibility=t.accessibility;var u=(R?R.length:0)+F.length;D.addTextTrack(o,u)}function X(e,t){var n=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=t.mediaInfo,p=d.type,g=d.mimeType,_=d.codec||g;if(_){if(p===r.default.FRAGMENTED_TEXT)if(M||"InitializationSegment"!==t.segmentType){if(!M)return;if(a=(l=E.getSamplesInfo(e)).sampleList,null===P&&a.length>0&&(P=a[0].cts-t.start*L),_.search(r.default.STPP)>=0)for(A=null!==A?A:Q(_),o=0;o<a.length;o++){var S=a[o],I=S.cts,w=I-P;this.buffered.add(w/L,(w+S.duration)/L);var R=new DataView(e,S.offset,S.subSizes[0]);c=f.default.Utils.dataViewToString(R,r.default.UTF8);var N=[],x=S.offset+S.subSizes[0];for(s=1;s<S.subSizes.length;s++){var K=new Uint8Array(e,x,S.subSizes[s]),V=String.fromCharCode.apply(null,K);N.push(V),x+=S.subSizes[s]}try{var q=b.getValue().ttmlTimeIsRelative?I/L:0;n=A.parse(c,q,I/L,(I+S.duration)/L,N),D.addCaptions(k,P/L,n)}catch(e){C.removeExecutedRequestsBeforeTime(),this.remove(),y.error("TTML parser error: "+e.message)}}else{var Y=[];for(o=0;o<a.length;o++){var W=a[o];W.cts-=P,this.buffered.add(W.cts/L,(W.cts+W.duration)/L);var X=e.slice(W.offset,W.offset+W.size),J=f.default.parseBuffer(X);for(s=0;s<J.boxes.length;s++){var Z=J.boxes[s];if(y.debug("VTT box1: "+Z.type),"vtte"!==Z.type&&"vttc"===Z.type)for(y.debug("VTT vttc boxes.length = "+Z.boxes.length),u=0;u<Z.boxes.length;u++){var $=Z.boxes[u];if(y.debug("VTT box2: "+$.type),"payl"===$.type){var ee=$.cue_text;y.debug("VTT cue_text = "+ee);var te=W.cts/L,ne=(W.cts+W.duration)/L;Y.push({start:te,end:ne,data:ee,styles:{}}),y.debug("VTT "+te+"-"+ne+" : "+ee)}}}}Y.length>0&&D.addCaptions(k,0,Y)}}else M=!0,L=E.getMediaTimescaleFromMoov(e);else if(p===r.default.TEXT){var re=new DataView(e,0,e.byteLength);c=f.default.Utils.dataViewToString(re,r.default.UTF8);try{n=Q(_).parse(c,0),D.addCaptions(D.getCurrentTrackIdx(),0,n)}catch(e){T.error(new v.default(m.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,m.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,c))}}else if(p===r.default.VIDEO)if(t.segmentType===i.HTTPRequest.INIT_SEGMENT_TYPE){if(0===U)for(U=E.getMediaTimescaleFromMoov(e),o=0;o<F.length;o++)z(null,F[o])}else{if(0===U)return void y.warn("CEA-608: No timescale for embeddedTextTrack yet");var ie=function(e,t){return function(e,n,r){var i=null;i=O.getTTMLRenderingDiv()?j.createHTMLCaptionsFromScreen(O.getElement(),e,n,r):[{start:e,end:n,data:r.getDisplayText(),styles:{}}],i&&D.addCaptions(t,0,i)}},ae=(l=E.getSamplesInfo(e)).lastSequenceNumber;if(!G[0]&&!G[1]){var oe=void 0,se=void 0;for(o=0;o<F.length;o++){if(F[o].id===r.default.CC1?(0,se=D.getTrackIdxForId(r.default.CC1)):F[o].id===r.default.CC3&&(1,se=D.getTrackIdxForId(r.default.CC3)),-1===se)return void y.warn("CEA-608: data before track is ready.");oe=ie(0,se),G[o]=new h.default.Cea608Parser(o+1,{newCue:oe},null)}}if(U){if(null!==B&&ae!==B+l.numSequences)for(o=0;o<G.length;o++)G[o]&&G[o].reset();for(var ue=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),i=0;i<t.length;i++)for(var a=t[i],o=h.default.findCea608Nalus(r,a.offset,a.size),s=null,u=0,l=0;l<o.length;l++)for(var c=h.default.extractCea608DataFromRange(r,o[l]),d=0;d<2;d++)c[d].length>0&&(a.cts!==s?u=0:u+=1,n.fields[d].push([a.cts+H*U,c[d],u]),s=a.cts);return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,l.sampleList),le=0;le<G.length;le++){var ce=ue.fields[le],de=G[le];if(de)for(o=0;o<ce.length;o++)de.addData(ce[o][0]/U,ce[o][1])}B=ae}}}else y.error("No text type defined")}function Q(e){var t=void 0;return e.search(r.default.VTT)>=0?t=I:(e.search(r.default.TTML)>=0||e.search(r.default.STPP)>=0)&&(t=w),t}function J(e){F.forEach((function(t){var n=D.getTrackIdxForId(t.id);n>=0&&D.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return u={initialize:function(t,i,a,l){n||Y(),D.setConfig({videoModel:O}),D.initialize(),E||(E=(0,o.default)(e).getInstance()),function(t,n,i,a){var o=!_.getIsTextTrack(t);if(R=R.concat(i),o){C=a,u.buffered=(0,s.default)(e).create(),N=S.getTracksFor(r.default.FRAGMENTED_TEXT,n);for(var l=S.getCurrentTrackFor(r.default.FRAGMENTED_TEXT,n),c=0;c<N.length;c++)if(N[c]===l){W(c);break}}for(var d=0;d<R.length;d++)z(null,R[d])}(t,i,a,l)},append:X,abort:function(){D.deleteAllTextTracks(),K(),E=null,R=[]},addEmbeddedTrack:function(e){if(n||Y(),e)if(e.id===r.default.CC1||e.id===r.default.CC3){for(var t=0;t<F.length;t++)if(F[t].id===e.id)return;F.push(e)}else y.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){t.off(g.default.VIDEO_CHUNK_RECEIVED,q,this),t.off(g.default.BUFFER_CLEARED,J,this),D&&D.deleteAllTextTracks(),n=!1,F=[],G=[null,null],B=null},setConfig:function(e){e&&(e.errHandler&&(T=e.errHandler),e.adapter&&(_=e.adapter),e.manifestModel&&(b=e.manifestModel),e.mediaController&&(S=e.mediaController),e.videoModel&&(O=e.videoModel),e.streamController&&(x=e.streamController),e.textTracks&&(D=e.textTracks),e.vttParser&&(I=e.vttParser),e.ttmlParser&&(w=e.ttmlParser))},getConfig:function(){return{fragmentModel:C,fragmentedTracks:N,videoModel:O}},setCurrentFragmentedTrackIdx:W,remove:function(e,t){void 0===e&&e===t&&(e=this.buffered.start(0),t=this.buffered.end(this.buffered.length-1)),this.buffered.remove(e,t)},reset:function(){V(),x=null,O=null,D=null}},y=(0,l.default)(e).getInstance().getLogger(u),V(),u}E.__dashjs_factory_name="TextSourceBuffer",t.default=u.default.getSingletonFactory(E)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.captionData=null,this.label=null,this.lang=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(110)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i=e.fetchAll(t),a=void 0,o=0,s=i.length;o<s;o++)(a=n(i[o]))&&r.push(a);return r}function n(e){if(!e)return null;var t=new r.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}o.__dashjs_factory_name="IsoFile",t.default=i.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,o=t.samples.length;a<o;a++){var s={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(s)}}}}return r(e,[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r}},function(e,t,n){!function(e,t,n,r){e.generateISD=function(e,t,n){var r=new o(e),i={};for(var s in e.head.layout.regions){var u=a(e,t,e.head.layout.regions[s],e.body,null,"",e.head.layout.regions[s],n,i);null!==u&&r.contents.push(u.element)}return r};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function a(e,t,o,l,c,d,f,h,p){if(t<f.begin||t>=f.end)return null;var g="regionID"in f&&""!==f.regionID?f.regionID:d;if(null!==c&&g!==o.id&&(!("contents"in f)||"contents"in f&&0===f.contents.length||""!==g))return null;var v=new s(f);for(var m in f.sets)t<f.sets[m].begin||t>=f.sets[m].end||(v.styleAttrs[f.sets[m].qname]=f.sets[m].value);var y,E={};for(var T in v.styleAttrs)if(E[T]=!0,T===n.byName.writingMode.qname&&!(n.byName.direction.qname in v.styleAttrs)){var _=v.styleAttrs[T];"lrtb"===_||"lr"===_?v.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==_&&"rl"!==_||(v.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==c)for(var b in n.all){var S=n.all[b];if(S.qname===n.byName.textDecoration.qname){var A=c.styleAttrs[S.qname],I=v.styleAttrs[S.qname],w=[];void 0===I?w=A:-1===I.indexOf("none")?((-1===I.indexOf("noUnderline")&&-1!==A.indexOf("underline")||-1!==I.indexOf("underline"))&&w.push("underline"),(-1===I.indexOf("noLineThrough")&&-1!==A.indexOf("lineThrough")||-1!==I.indexOf("lineThrough"))&&w.push("lineThrough"),(-1===I.indexOf("noOverline")&&-1!==A.indexOf("overline")||-1!==I.indexOf("overline"))&&w.push("overline")):w.push("none"),v.styleAttrs[S.qname]=w}else if(S.qname!==n.byName.fontSize.qname||S.qname in v.styleAttrs||"span"!==v.kind||"textContainer"!==v.styleAttrs[n.byName.ruby.qname])if(S.qname!==n.byName.fontSize.qname||S.qname in v.styleAttrs||"span"!==v.kind||"text"!==v.styleAttrs[n.byName.ruby.qname])S.inherit&&S.qname in c.styleAttrs&&!(S.qname in v.styleAttrs)&&(v.styleAttrs[S.qname]=c.styleAttrs[S.qname]);else{var R=c.styleAttrs[n.byName.fontSize.qname];"textContainer"===c.styleAttrs[n.byName.ruby.qname]?v.styleAttrs[S.qname]=R:v.styleAttrs[S.qname]=new r.ComputedLength(.5*R.rw,.5*R.rh)}else{var D=c.styleAttrs[n.byName.fontSize.qname];v.styleAttrs[S.qname]=new r.ComputedLength(.5*D.rw,.5*D.rh)}}for(var C in n.all){var M=n.all[C];if(!(M.qname in v.styleAttrs)&&!(M.qname===n.byName.position.qname&&n.byName.origin.qname in v.styleAttrs||M.qname===n.byName.origin.qname&&n.byName.position.qname in v.styleAttrs)){var L=e.head.styling.initials[M.qname]||M.initial;("region"===v.kind||!1===M.inherit&&null!==L)&&(v.styleAttrs[M.qname]=M.parse(L),E[M.qname]=!0)}}for(var N in n.all){var O=n.all[N];if(O.qname in E&&null!==O.compute){var x=O.compute(e,c,v,v.styleAttrs[O.qname],p);null!==x?v.styleAttrs[O.qname]=x:(v.styleAttrs[O.qname]=O.compute(e,c,v,O.parse(O.initial),p),u(h,"Style '"+O.qname+"' on element '"+v.kind+"' cannot be computed"))}}if("none"===v.styleAttrs[n.byName.display.qname])return null;for(var P in null===c?y=null===l?[]:[l]:"contents"in f&&(y=f.contents),y){var k=a(e,t,o,l,v,g,y[P],h,p);null!==k&&v.contents.push(k.element)}for(var F in v.styleAttrs){var U=!1;if("span"===v.kind){var B=v.styleAttrs[n.byName.ruby.qname];(U=("container"===B||"textContainer"===B||"baseContainer"===B)&&-1!==i.indexOf(F))||(U="container"!==B&&F===n.byName.rubyAlign.qname),U||(U=!("textContainer"===B||"text"===B)&&F===n.byName.rubyPosition.qname)}if(!U)U=-1===n.byQName[F].applies.indexOf(v.kind);U&&delete v.styleAttrs[F]}if("span"===v.kind&&v.text&&"default"===v.space){var G=v.text.replace(/[\t\r\n ]+/g," ");v.text=G}if("p"===v.kind){var j=[];!function e(t,n){if("contents"in t)for(var r in t.contents)e(t.contents[r],n);else"span"!==t.kind&&"br"!==t.kind||n.push(t)}(v,j);for(var H=0,K="after_br",V=0;;)if("after_br"===K)H>=j.length||"br"===j[H].kind?(K="before_br",V=H,H--):("preserve"!==j[H].space&&(j[H].text=j[H].text.replace(/^[\t\r\n ]+/g,"")),j[H].text.length>0?(K="looking_br",H++):j.splice(H,1));else if("before_br"===K)if(H<0||"br"===j[H].kind){if(K="after_br",(H=V+1)>=j.length)break}else if("preserve"!==j[H].space&&(j[H].text=j[H].text.replace(/[\t\r\n ]+$/g,"")),j[H].text.length>0){if(K="after_br",(H=V+1)>=j.length)break}else j.splice(H,1),H--;else H>=j.length||"br"===j[H].kind?(K="before_br",V=H,H--):H++;!function e(t){if("br"===t.kind)return!1;if("text"in t)return 0===t.text.length;if("contents"in t){for(var n=t.contents.length;n--;)e(t.contents[n])&&t.contents.splice(n,1);return 0===t.contents.length}}(v)}return"div"===v.kind&&n.byName.backgroundImage.qname in v.styleAttrs||"br"===v.kind||"image"===v.kind||"contents"in v&&v.contents.length>0||"span"===v.kind&&null!==v.text||"region"===v.kind&&"always"===v.styleAttrs[n.byName.showBackground.qname]?{region_id:g,element:v}:null}function o(e){this.contents=[],this.aspectRatio=e.aspectRatio}function s(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"src"in e&&(this.src=e.src),"type"in e&&(this.type=e.type),"text"in e?this.text=e.text:("region"===this.kind||"contents"in e)&&(this.contents=[]),"space"in e&&(this.space=e.space)}function u(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscStyles?n(45):imscStyles,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,o=0;r&&(o=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var s=t.begin,u=null;for(var l in t.sets)a(e,t.sets[l],u,t),s="seq"===t.timeContainer?t.sets[l].end:Math.max(s,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],u,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),u=t.contents[c];else s=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=o+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function s(){this.events=[],this.head=new u,this.body=null}function u(){this.styling=new l,this.layout=new f}function l(){this.styles={},this.initials={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function d(){this.styleAttrs=null}function f(){this.regions={}}function h(e,t){p.call(this,"image"),this.src=e,this.type=t}function p(e){this.kind=e}function g(e){this.id=e}function v(e){this.regionID=e}function m(e){this.styleAttrs=e}function y(e){this.sets=e}function E(e){this.contents=e}function T(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function _(){p.call(this,"body")}function b(){p.call(this,"div")}function S(){p.call(this,"p")}function A(){p.call(this,"span")}function I(){p.call(this,"span")}function w(){p.call(this,"br")}function R(){}function D(){}function C(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function M(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function L(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,o=r.byQName[a];if(void 0!==o){var s=o.parse(e.attributes[i].value);null!==s?(n[a]=s,o===r.byName.zIndex&&F(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):U(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function N(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function O(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function x(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(x(e,e.styles[r],n),k(e.styles[r].styleAttrs,t.styleAttrs)):U(n,"Non-existant style id referenced")}}function P(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?k(e.styles[a].styleAttrs,n):U(r,"Non-existant style id referenced")}}function k(e,t){for(var n in e)n in t||(t[n]=e[n])}function F(e,t){if(e&&e.warn&&e.warn(t))throw t}function U(e,t){if(e&&e.error&&e.error(t))throw t}function B(e,t){throw e&&e.fatal&&e.fatal(t),t}function G(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,p){var g=t.parser(!0,{xmlns:!0}),v=[],m=[],y=[],E=0,T=null;g.onclosetag=function(e){if(v[0]instanceof l)for(var t in v[0].styles)x(v[0],v[0].styles[t],i);else if(v[0]instanceof S||v[0]instanceof A){if(v[0].contents.length>1){var r,a=[v[0].contents[0]];for(r=1;r<v[0].contents.length;r++)v[0].contents[r]instanceof I&&a[a.length-1]instanceof I?a[a.length-1].text+=v[0].contents[r].text:a.push(v[0].contents[r]);v[0].contents=a}v[0]instanceof A&&1===v[0].contents.length&&v[0].contents[0]instanceof I&&(v[0].text=v[0].contents[0].text,delete v[0].contents)}else v[0]instanceof o&&(v[0].node.uri===n.ns_tt&&"metadata"===v[0].node.local?E--:E>0&&p&&"onCloseTag"in p&&p.onCloseTag());y.shift(),m.shift(),v.shift()},g.ontext=function(e){if(void 0===v[0]);else if(v[0]instanceof A||v[0]instanceof S){if(v[0]instanceof A){var t=v[0].styleAttrs[r.byName.ruby.qname];if("container"===t||"textContainer"===t||"baseContainer"===t)return}var n=new I;n.initFromText(T,v[0],e,y[0],i),v[0].contents.push(n)}else v[0]instanceof o&&E>0&&p&&"onText"in p&&p.onText(e)},g.onopentag=function(e){var t=e.attributes["xml:space"];t?y.unshift(t.value):0===y.length?y.unshift("default"):y.unshift(y[0]);var a=e.attributes["xml:lang"];if(a?m.unshift(a.value):0===m.length?m.unshift(""):m.unshift(m[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==T&&B(i,"Two <tt> elements at ("+this.line+","+this.column+")"),(T=new s).initFromNode(e,i),v.unshift(T);else if("head"===e.local)v[0]instanceof s||B(i,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),v.unshift(T.head);else if("styling"===e.local)v[0]instanceof u||B(i,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),v.unshift(T.head.styling);else if("style"===e.local){var g;v[0]instanceof l?((g=new c).initFromNode(e,i),g.id?T.head.styling.styles[g.id]=g:U(i,"<style> element missing @id attribute"),v.unshift(g)):v[0]instanceof R?((g=new c).initFromNode(e,i),k(g.styleAttrs,v[0].styleAttrs),v.unshift(g)):B(i,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("initial"===e.local){var I;if(v[0]instanceof l){for(var C in(I=new d).initFromNode(e,i),I.styleAttrs)T.head.styling.initials[C]=I.styleAttrs[C];v.unshift(I)}else B(i,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if("layout"===e.local)v[0]instanceof u||B(i,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),v.unshift(T.head.layout);else if("region"===e.local){v[0]instanceof f||B(i,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var M=new R;M.initFromNode(T,e,i),!M.id||M.id in T.head.layout.regions?U(i,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):T.head.layout.regions[M.id]=M,v.unshift(M)}else if("body"===e.local){v[0]instanceof s||B(i,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==T.body&&B(i,"Second <body> element at "+this.line+","+this.column+")");var L=new _;L.initFromNode(T,e,i),T.body=L,v.unshift(L)}else if("div"===e.local){v[0]instanceof b||v[0]instanceof _||B(i,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var N=new b;N.initFromNode(T,v[0],e,i);var O=N.styleAttrs[r.byName.backgroundImage.qname];O&&(N.contents.push(new h(O)),delete N.styleAttrs[r.byName.backgroundImage.qname]),v[0].contents.push(N),v.unshift(N)}else if("image"===e.local){v[0]instanceof b||B(i,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var x=new h;x.initFromNode(T,v[0],e,i),v[0].contents.push(x),v.unshift(x)}else if("p"===e.local){v[0]instanceof b||B(i,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var P=new S;P.initFromNode(T,v[0],e,i),v[0].contents.push(P),v.unshift(P)}else if("span"===e.local){v[0]instanceof A||v[0]instanceof S||B(i,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var F=new A;F.initFromNode(T,v[0],e,y[0],i),v[0].contents.push(F),v.unshift(F)}else if("br"===e.local){v[0]instanceof A||v[0]instanceof S||B(i,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var G=new w;G.initFromNode(T,v[0],e,i),v[0].contents.push(G),v.unshift(G)}else if("set"===e.local){v[0]instanceof A||v[0]instanceof S||v[0]instanceof b||v[0]instanceof _||v[0]instanceof R||v[0]instanceof w||B(i,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var j=new D;j.initFromNode(T,v[0],e,i),v[0].sets.push(j),v.unshift(j)}else v.unshift(new o(e));else v.unshift(new o(e));if(v[0]instanceof o)if(e.uri===n.ns_tt&&"metadata"===e.local)E++;else if(E>0&&p&&"onOpenTag"in p){var H=[];for(var K in e.attributes)H[e.attributes[K].uri+" "+e.attributes[K].local]={uri:e.attributes[K].uri,local:e.attributes[K].local,value:e.attributes[K].value};p.onOpenTag(e.uri,e.local,H)}},g.write(e).close(),delete T.head.styling.styles;var C=!1;for(var M in T.head.layout.regions){C=!0;break}if(!C){var L=R.prototype.createDefaultRegion();T.head.layout.regions[L.id]=L}for(var N in T.head.layout.regions)a(T,T.head.layout.regions[N],null,null);return T.body&&a(T,T.body,null,null),T.body&&function e(t){if(!("contents"in t))return;for(var n=("styleAttrs"in t?t.styleAttrs[r.byName.ruby.qname]:null),i="span"===t.kind&&("container"===n||"textContainer"===n||"baseContainer"===n),a=t.contents.length-1;a>=0;a--)!i||"styleAttrs"in t.contents[a]&&r.byName.ruby.qname in t.contents[a].styleAttrs?e(t.contents[a]):delete t.contents[a]}(T.body),T},s.prototype.initFromNode=function(e,t){var r=function(e,t){var r=N(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var o=/(\d+) (\d+)/.exec(r);null!==o?(a=parseInt(o[1]),i=parseInt(o[2])):F(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,t);this.cellLength={h:new i.ComputedLength(0,1/r.h),w:new i.ComputedLength(1/r.w,0)};var a=function(e,t){var r,i=N(e,n.ns_ttp,"frameRate"),a=30;if(null!==i){null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):F(t,"Malformed frame rate attribute (using initial value instead)")}var o=N(e,n.ns_ttp,"frameRateMultiplier"),s=1;if(null!==o){null!==(r=/(\d+) (\d+)/.exec(o))?s=parseInt(r[1])/parseInt(r[2]):F(t,"Malformed frame rate multiplier attribute (using initial value instead)")}var u=s*a,l=1,c=N(e,n.ns_ttp,"tickRate");if(null===c)null!==i&&(l=u);else{null!==(r=/(\d+)/.exec(c))?l=parseInt(r[1]):F(t,"Malformed tick rate attribute (using initial value instead)")}return{effectiveFrameRate:u,tickRate:l}}(e,t);this.effectiveFrameRate=a.effectiveFrameRate,this.tickRate=a.tickRate,this.aspectRatio=function(e,t){var r=N(e,n.ns_ittp,"aspectRatio");null===r&&(r=N(e,n.ns_ttp,"displayAspectRatio"));var i=null;if(null!==r){var a=/(\d+)\s+(\d+)/.exec(r);if(null!==a){var o=parseInt(a[1]),s=parseInt(a[2]);0!==o&&0!==s?i=o/s:U(t,"Illegal aspectRatio values (ignoring)")}else U(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,t);var o=N(e,n.ns_ttp,"timeBase");null!==o&&"media"!==o&&B(t,"Unsupported time base");var s=function(e,t){var r=N(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return F(t,"Malformed extent (ignoring)"),null;var o=i.parseLength(a[0]),s=i.parseLength(a[1]);if(!s||!o)return F(t,"Malformed extent values (ignoring)"),null;return{h:s,w:o}}(e,t);null===s?this.pxLength={h:null,w:null}:("px"===s.h.unit&&"px"===s.w.unit||B(t,"Extent on TT must be in px or absent"),this.pxLength={h:new i.ComputedLength(0,1/s.h.value),w:new i.ComputedLength(1/s.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)}},s.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=G(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=G(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},s.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},s.prototype.getMediaTimeEvents=function(){return this.events},c.prototype.initFromNode=function(e,t){this.id=C(e),this.styleAttrs=L(e,t),this.styleRefs=M(e)},d.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+" "+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},h.prototype.initFromNode=function(e,t,n,r){this.src="src"in n.attributes?n.attributes.src.value:null,this.src||U(r,"Invalid image@src attribute"),this.type="type"in n.attributes?n.attributes.type.value:null,this.type||U(r,"Invalid image@type attribute"),m.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r)},g.prototype.initFromNode=function(e,t,n,r){this.id=C(n)},v.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},m.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=L(n,r),null!==e.head&&null!==e.head.styling&&P(e.head.styling,M(n),this.styleAttrs,r)},y.prototype.initFromNode=function(e,t,n,r){this.sets=[]},E.prototype.initFromNode=function(e,t,n,r){this.contents=[]},T.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=O(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&F(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=O(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&F(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var o=null;n&&"end"in n.attributes&&null===(o=O(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&F(r,"Malformed end value (ignoring)");return{explicit_begin:i,explicit_end:o,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(U(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},_.prototype.initFromNode=function(e,t,n){m.prototype.initFromNode.call(this,e,null,t,n),T.prototype.initFromNode.call(this,e,null,t,n),y.prototype.initFromNode.call(this,e,null,t,n),v.prototype.initFromNode.call(this,e,null,t,n),E.prototype.initFromNode.call(this,e,null,t,n)},b.prototype.initFromNode=function(e,t,n,r){m.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),E.prototype.initFromNode.call(this,e,t,n,r)},S.prototype.initFromNode=function(e,t,n,r){m.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),E.prototype.initFromNode.call(this,e,t,n,r)},A.prototype.initFromNode=function(e,t,n,r,i){m.prototype.initFromNode.call(this,e,t,n,i),T.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),this.space=r},I.prototype.initFromText=function(e,t,n,r,i){T.prototype.initFromNode.call(this,e,t,null,i),this.text=n,this.space=r},w.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,t,n,r),T.prototype.initFromNode.call(this,e,t,n,r)},R.prototype.createDefaultRegion=function(){var e=new R;return g.call(e,""),m.call(e,{}),y.call(e,[]),T.call(e,0,Number.POSITIVE_INFINITY,null),e},R.prototype.initFromNode=function(e,t,n){g.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),T.prototype.initFromNode.call(this,e,null,t,n),y.prototype.initFromNode.call(this,e,null,t,n),null!==e.head&&null!==e.head.styling&&P(e.head.styling,M(t),this.styleAttrs,n)},D.prototype.initFromNode=function(e,t,n,r){T.prototype.initFromNode.call(this,e,t,n,r);var i=L(n,r);for(var a in this.qname=null,this.value=null,i){if(this.qname){U(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n(114):sax,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscStyles?n(45):imscStyles,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){(function(e){!function(t){t.parser=function(e,t){return new a(e,t)},t.SAXParser=a,t.SAXStream=s,t.createStream=function(e,t){return new s(e,t)},t.MAX_BUFFER_LENGTH=65536;var r,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function a(e,n){if(!(this instanceof a))return new a(e,n);!function(e){for(var t=0,n=i.length;t<n;t++)e[i[t]]=""}(this),this.q=this.c="",this.bufferCheckPosition=t.MAX_BUFFER_LENGTH,this.opt=n||{},this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!e,this.noscript=!(!e&&!this.opt.noscript),this.state=I.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(p)),this.trackPosition=!1!==this.opt.position,this.trackPosition&&(this.position=this.line=this.column=0),R(this,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),a.prototype={end:function(){N(this)},write:function(e){if(this.error)throw this.error;if(this.closed)return L(this,"Cannot write after close. Assign an onready handler.");if(null===e)return N(this);"object"==typeof e&&(e=e.toString());var n=0,r="";for(;r=j(e,n++),this.c=r,r;)switch(this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++),this.state){case I.BEGIN:if(this.state=I.BEGIN_WHITESPACE,"\ufeff"===r)continue;G(this,r);continue;case I.BEGIN_WHITESPACE:G(this,r);continue;case I.TEXT:if(this.sawRoot&&!this.closedRoot){for(var a=n-1;r&&"<"!==r&&"&"!==r;)(r=j(e,n++))&&this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++);this.textNode+=e.substring(a,n-1)}"<"!==r||this.sawRoot&&this.closedRoot&&!this.strict?(!_(u,r)||this.sawRoot&&!this.closedRoot||O(this,"Text data outside of root node."),"&"===r?this.state=I.TEXT_ENTITY:this.textNode+=r):(this.state=I.OPEN_WAKA,this.startTagPosition=this.position);continue;case I.SCRIPT:"<"===r?this.state=I.SCRIPT_ENDING:this.script+=r;continue;case I.SCRIPT_ENDING:"/"===r?this.state=I.CLOSE_TAG:(this.script+="<"+r,this.state=I.SCRIPT);continue;case I.OPEN_WAKA:if("!"===r)this.state=I.SGML_DECL,this.sgmlDecl="";else if(T(u,r));else if(T(g,r))this.state=I.OPEN_TAG,this.tagName=r;else if("/"===r)this.state=I.CLOSE_TAG,this.tagName="";else if("?"===r)this.state=I.PROC_INST,this.procInstName=this.procInstBody="";else{if(O(this,"Unencoded <"),this.startTagPosition+1<this.position){var o=this.position-this.startTagPosition;r=new Array(o).join(" ")+r}this.textNode+="<"+r,this.state=I.TEXT}continue;case I.SGML_DECL:"[CDATA["===(this.sgmlDecl+r).toUpperCase()?(D(this,"onopencdata"),this.state=I.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+r==="--"?(this.state=I.COMMENT,this.comment="",this.sgmlDecl=""):"DOCTYPE"===(this.sgmlDecl+r).toUpperCase()?(this.state=I.DOCTYPE,(this.doctype||this.sawRoot)&&O(this,"Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):">"===r?(D(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=I.TEXT):T(d,r)?(this.state=I.SGML_DECL_QUOTED,this.sgmlDecl+=r):this.sgmlDecl+=r;continue;case I.SGML_DECL_QUOTED:r===this.q&&(this.state=I.SGML_DECL,this.q=""),this.sgmlDecl+=r;continue;case I.DOCTYPE:">"===r?(this.state=I.TEXT,D(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=r,"["===r?this.state=I.DOCTYPE_DTD:T(d,r)&&(this.state=I.DOCTYPE_QUOTED,this.q=r));continue;case I.DOCTYPE_QUOTED:this.doctype+=r,r===this.q&&(this.q="",this.state=I.DOCTYPE);continue;case I.DOCTYPE_DTD:this.doctype+=r,"]"===r?this.state=I.DOCTYPE:T(d,r)&&(this.state=I.DOCTYPE_DTD_QUOTED,this.q=r);continue;case I.DOCTYPE_DTD_QUOTED:this.doctype+=r,r===this.q&&(this.state=I.DOCTYPE_DTD,this.q="");continue;case I.COMMENT:"-"===r?this.state=I.COMMENT_ENDING:this.comment+=r;continue;case I.COMMENT_ENDING:"-"===r?(this.state=I.COMMENT_ENDED,this.comment=M(this.opt,this.comment),this.comment&&D(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+r,this.state=I.COMMENT);continue;case I.COMMENT_ENDED:">"!==r?(O(this,"Malformed comment"),this.comment+="--"+r,this.state=I.COMMENT):this.state=I.TEXT;continue;case I.CDATA:"]"===r?this.state=I.CDATA_ENDING:this.cdata+=r;continue;case I.CDATA_ENDING:"]"===r?this.state=I.CDATA_ENDING_2:(this.cdata+="]"+r,this.state=I.CDATA);continue;case I.CDATA_ENDING_2:">"===r?(this.cdata&&D(this,"oncdata",this.cdata),D(this,"onclosecdata"),this.cdata="",this.state=I.TEXT):"]"===r?this.cdata+="]":(this.cdata+="]]"+r,this.state=I.CDATA);continue;case I.PROC_INST:"?"===r?this.state=I.PROC_INST_ENDING:T(u,r)?this.state=I.PROC_INST_BODY:this.procInstName+=r;continue;case I.PROC_INST_BODY:if(!this.procInstBody&&T(u,r))continue;"?"===r?this.state=I.PROC_INST_ENDING:this.procInstBody+=r;continue;case I.PROC_INST_ENDING:">"===r?(D(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=I.TEXT):(this.procInstBody+="?"+r,this.state=I.PROC_INST_BODY);continue;case I.OPEN_TAG:T(v,r)?this.tagName+=r:(x(this),">"===r?F(this):"/"===r?this.state=I.OPEN_TAG_SLASH:(_(u,r)&&O(this,"Invalid character in tag name"),this.state=I.ATTRIB));continue;case I.OPEN_TAG_SLASH:">"===r?(F(this,!0),U(this)):(O(this,"Forward-slash in opening tag not followed by >"),this.state=I.ATTRIB);continue;case I.ATTRIB:if(T(u,r))continue;">"===r?F(this):"/"===r?this.state=I.OPEN_TAG_SLASH:T(g,r)?(this.attribName=r,this.attribValue="",this.state=I.ATTRIB_NAME):O(this,"Invalid attribute name");continue;case I.ATTRIB_NAME:"="===r?this.state=I.ATTRIB_VALUE:">"===r?(O(this,"Attribute without value"),this.attribValue=this.attribName,k(this),F(this)):T(u,r)?this.state=I.ATTRIB_NAME_SAW_WHITE:T(v,r)?this.attribName+=r:O(this,"Invalid attribute name");continue;case I.ATTRIB_NAME_SAW_WHITE:if("="===r)this.state=I.ATTRIB_VALUE;else{if(T(u,r))continue;O(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",D(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===r?F(this):T(g,r)?(this.attribName=r,this.state=I.ATTRIB_NAME):(O(this,"Invalid attribute name"),this.state=I.ATTRIB)}continue;case I.ATTRIB_VALUE:if(T(u,r))continue;T(d,r)?(this.q=r,this.state=I.ATTRIB_VALUE_QUOTED):(O(this,"Unquoted attribute value"),this.state=I.ATTRIB_VALUE_UNQUOTED,this.attribValue=r);continue;case I.ATTRIB_VALUE_QUOTED:if(r!==this.q){"&"===r?this.state=I.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=r;continue}k(this),this.q="",this.state=I.ATTRIB_VALUE_CLOSED;continue;case I.ATTRIB_VALUE_CLOSED:T(u,r)?this.state=I.ATTRIB:">"===r?F(this):"/"===r?this.state=I.OPEN_TAG_SLASH:T(g,r)?(O(this,"No whitespace between attributes"),this.attribName=r,this.attribValue="",this.state=I.ATTRIB_NAME):O(this,"Invalid attribute name");continue;case I.ATTRIB_VALUE_UNQUOTED:if(_(f,r)){"&"===r?this.state=I.ATTRIB_VALUE_ENTITY_U:this.attribValue+=r;continue}k(this),">"===r?F(this):this.state=I.ATTRIB;continue;case I.CLOSE_TAG:if(this.tagName)">"===r?U(this):T(v,r)?this.tagName+=r:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=I.SCRIPT):(_(u,r)&&O(this,"Invalid tagname in closing tag"),this.state=I.CLOSE_TAG_SAW_WHITE);else{if(T(u,r))continue;_(g,r)?this.script?(this.script+="</"+r,this.state=I.SCRIPT):O(this,"Invalid tagname in closing tag."):this.tagName=r}continue;case I.CLOSE_TAG_SAW_WHITE:if(T(u,r))continue;">"===r?U(this):O(this,"Invalid characters in closing tag");continue;case I.TEXT_ENTITY:case I.ATTRIB_VALUE_ENTITY_Q:case I.ATTRIB_VALUE_ENTITY_U:var s,l;switch(this.state){case I.TEXT_ENTITY:s=I.TEXT,l="textNode";break;case I.ATTRIB_VALUE_ENTITY_Q:s=I.ATTRIB_VALUE_QUOTED,l="attribValue";break;case I.ATTRIB_VALUE_ENTITY_U:s=I.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===r?(this[l]+=B(this),this.entity="",this.state=s):T(this.entity.length?y:m,r)?this.entity+=r:(O(this,"Invalid character in entity name"),this[l]+="&"+this.entity+r,this.entity="",this.state=s);continue;default:throw new Error(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),r=0,a=0,o=i.length;a<o;a++){var s=e[i[a]].length;if(s>n)switch(i[a]){case"textNode":C(e);break;case"cdata":D(e,"oncdata",e.cdata),e.cdata="";break;case"script":D(e,"onscript",e.script),e.script="";break;default:L(e,"Max buffer length exceeded: "+i[a])}r=Math.max(r,s)}var u=t.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=u+e.position}(this);return this}
|
|
412
|
+
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;C(e=this),""!==e.cdata&&(D(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(D(e,"onscript",e.script),e.script="")}};try{r=n(117).Stream}catch(e){r=function(){}}var o=t.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function s(e,t){if(!(this instanceof s))return new s(e,t);r.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})}))}s.prototype=Object.create(r.prototype,{constructor:{value:s}}),s.prototype.write=function(t){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(t)){if(!this._decoder){var r=n(50).StringDecoder;this._decoder=new r("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===o.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="\r\n\t ",l="0124356789",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",d="'\"",f=u+">",h="http://www.w3.org/XML/1998/namespace",p={xml:h,xmlns:"http://www.w3.org/2000/xmlns/"};u=E(u),l=E(l),c=E(c);var g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function E(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function T(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function _(e,t){return!T(e,t)}d=E(d),f=E(f);var b,S,A,I=0;for(var w in t.STATE={BEGIN:I++,BEGIN_WHITESPACE:I++,TEXT:I++,TEXT_ENTITY:I++,OPEN_WAKA:I++,SGML_DECL:I++,SGML_DECL_QUOTED:I++,DOCTYPE:I++,DOCTYPE_QUOTED:I++,DOCTYPE_DTD:I++,DOCTYPE_DTD_QUOTED:I++,COMMENT_STARTING:I++,COMMENT:I++,COMMENT_ENDING:I++,COMMENT_ENDED:I++,CDATA:I++,CDATA_ENDING:I++,CDATA_ENDING_2:I++,PROC_INST:I++,PROC_INST_BODY:I++,PROC_INST_ENDING:I++,OPEN_TAG:I++,OPEN_TAG_SLASH:I++,ATTRIB:I++,ATTRIB_NAME:I++,ATTRIB_NAME_SAW_WHITE:I++,ATTRIB_VALUE:I++,ATTRIB_VALUE_QUOTED:I++,ATTRIB_VALUE_CLOSED:I++,ATTRIB_VALUE_UNQUOTED:I++,ATTRIB_VALUE_ENTITY_Q:I++,ATTRIB_VALUE_ENTITY_U:I++,CLOSE_TAG:I++,CLOSE_TAG_SAW_WHITE:I++,SCRIPT:I++,SCRIPT_ENDING:I++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[w]]=w;function R(e,t,n){e[t]&&e[t](n)}function D(e,t,n){e.textNode&&C(e),R(e,t,n)}function C(e){e.textNode=M(e.opt,e.textNode),e.textNode&&R(e,"ontext",e.textNode),e.textNode=""}function M(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function L(e,t){return C(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,R(e,"onerror",t),e}function N(e){return e.sawRoot&&!e.closedRoot&&O(e,"Unclosed root tag"),e.state!==I.BEGIN&&e.state!==I.BEGIN_WHITESPACE&&e.state!==I.TEXT&&L(e,"Unexpected end"),C(e),e.c="",e.closed=!0,R(e,"onend"),a.call(e,e.strict,e.opt),e}function O(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&L(e,t)}function x(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,D(e,"onopentagstart",n)}function P(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function k(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=P(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==h)O(e,"xml: prefix must be bound to "+h+"\nActual: "+e.attribValue);else if("xmlns"===r&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)O(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,D(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function F(e,t){if(e.opt.xmlns){var n=e.tag,r=P(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(O(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){D(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],u=s[0],l=s[1],c=P(u,!0),d=c.prefix,f=c.local,h=""===d?"":n.ns[d]||"",p={name:u,value:l,prefix:d,local:f,uri:h};d&&"xmlns"!==d&&!h&&(O(e,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),e.tag.attributes[u]=p,D(e,"onattribute",p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),D(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=I.TEXT:e.state=I.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function U(e){if(!e.tagName)return O(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=I.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=I.SCRIPT);D(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){if(e.tags[t].name===r)break;O(e,"Unexpected close tag")}if(t<0)return O(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=I.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,D(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];D(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=I.TEXT}function B(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(O(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function G(e,t){"<"===t?(e.state=I.OPEN_WAKA,e.startTagPosition=e.position):_(u,t)&&(O(e,"Non-whitespace before first tag."),e.textNode=t,e.state=I.TEXT)}function j(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}I=t.STATE,String.fromCodePoint||(b=String.fromCharCode,S=Math.floor,A=function(){var e,t,n=16384,r=[],i=-1,a=arguments.length;if(!a)return"";for(var o="";++i<a;){var s=Number(arguments[i]);if(!isFinite(s)||s<0||s>1114111||S(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===a||r.length>n)&&(o+=b.apply(null,r),r.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(t)}).call(this,n(46).Buffer)},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=l(e),o=r[0],s=r[1],u=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),c=0,d=s>0?o-4:o;for(n=0;n<d;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o<s;o+=16383)a.push(c(e,o,o+16383>s?s:o+16383));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+d],d+=f,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=p,o/=256,l-=8);e[n+h-p]|=128*g}},function(e,t,n){e.exports=i;var r=n(47).EventEmitter;function i(){r.call(this)}n(21)(i,r),i.Readable=n(48),i.Writable=n(125),i.Duplex=n(126),i.Transform=n(127),i.PassThrough=n(128),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(38).Buffer,i=n(120);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,a=r.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,n=a,i=s,t.copy(n,i),s+=o.data.length,o=o.next;return a},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(122),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(14))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,u=1,l={},c=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){a.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},f.clearImmediate=h}function h(e){delete l[e]}function p(e){if(c)setTimeout(p,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(14),n(36))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(14))},function(e,t,n){"use strict";e.exports=a;var r=n(74),i=Object.create(n(28));function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}i.inherits=n(21),i.inherits(a,r),a.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(49)},function(e,t,n){e.exports=n(17)},function(e,t,n){e.exports=n(48).Transform},function(e,t,n){e.exports=n(48).PassThrough},function(e,t,n){!function(e,t,n){function r(e,t,s){var l;if("region"===s.kind)(l=document.createElement("div")).style.position="absolute";else if("body"===s.kind)l=document.createElement("div");else if("div"===s.kind)l=document.createElement("div");else if("image"===s.kind){if(l=document.createElement("img"),null!==e.imgResolver&&null!==s.src){var c=e.imgResolver(s.src,l);c&&(l.src=c),l.height=e.regionH,l.width=e.regionW}}else if("p"===s.kind)l=document.createElement("p");else if("span"===s.kind){if("container"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("ruby"),e.ruby=!0;else if("base"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rb");else if("text"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rt");else if("baseContainer"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rbc");else if("textContainer"===s.styleAttrs[n.byName.ruby.qname])l=document.createElement("rtc");else{if("delimiter"===s.styleAttrs[n.byName.ruby.qname])return;l=document.createElement("span")}var d=s.styleAttrs[n.byName.textEmphasis.qname];d&&"none"!==d.style&&(e.textEmphasis=!0)}else"br"===s.kind&&(l=document.createElement("br"));if(l){for(var f in t.appendChild(l),l.style.margin="0",u){var h=u[f],p=s.styleAttrs[h.qname];void 0!==p&&null!==h.map&&h.map(e,l,s,p)}var g=l;if("region"===s.kind){var v=s.styleAttrs[n.byName.writingMode.qname];"lrtb"===v||"lr"===v?(e.ipd="lr",e.bpd="tb"):"rltb"===v||"rl"===v?(e.ipd="rl",e.bpd="tb"):"tblr"===v?(e.ipd="tb",e.bpd="lr"):"tbrl"!==v&&"tb"!==v||(e.ipd="tb",e.bpd="rl")}var m=s.styleAttrs[n.byName.linePadding.qname];if(m&&!m.isZero()){var y=m.toUsedLength(e.w,e.h);if(y>0){var E=Math.ceil(y)+"px";"tb"===e.bpd?(g.style.paddingLeft=E,g.style.paddingRight=E):(g.style.paddingTop=E,g.style.paddingBottom=E),e.lp=m}}var T=s.styleAttrs[n.byName.multiRowAlign.qname];if(T&&"auto"!==T){var _=document.createElement("span");_.style.display="inline-block",_.style.textAlign=T,l.appendChild(_),g=_,e.mra=T}var b=s.styleAttrs[n.byName.rubyReserve.qname];if(b&&"none"!==b[0]&&(e.rubyReserve=b),s.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===s.kind&&s.text)if(n.byName.textCombine.qname in s.styleAttrs&&"all"===s.styleAttrs[n.byName.textCombine.qname][0])l.textContent=s.text;else for(var S="",A=0;A<s.text.length;A++){S+=s.text.charAt(A);var I=s.text.charCodeAt(A);if(I<55296||I>56319||A===s.text.length){var w=document.createElement("span");w.textContent=S,l.appendChild(w),S=""}}for(var R in s.contents)r(e,g,s.contents[R]);var D=[];if((e.lp||e.mra||e.flg||e.ruby||e.textEmphasis||e.rubyReserve)&&"p"===s.kind&&(o(e,g,D,null),e.rubyReserve&&(!function(e,t){for(var n=0;n<e.length;n++){var r,i,a=document.createElement("ruby"),o=document.createElement("rb");o.textContent="",a.appendChild(o);var s=t.rubyReserve[1].toUsedLength(t.w,t.h)+"px";"both"===t.rubyReserve[0]?((r=document.createElement("rtc")).style.rubyPosition="under",r.textContent="",r.style.fontSize=s,(i=document.createElement("rtc")).style.rubyPosition="over",i.textContent="",i.style.fontSize=s,a.appendChild(r),a.appendChild(i)):((r=document.createElement("rtc")).textContent="",r.style.fontSize=s,"after"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&n>0?r.style.rubyPosition="tb"===t.bpd||"rl"===t.bpd?"under":"over":r.style.rubyPosition="tb"===t.bpd||"rl"===t.bpd?"over":"under",a.appendChild(r));e[n].elements[0].node.parentElement.insertBefore(a,e[n].elements[0].node)}}(D,e),e.rubyReserve=null),(e.ruby||e.rubyReserve)&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;if(!e[n].rbc[r].style.rubyPosition)i="tb"===t.bpd||"rl"===t.bpd?0===n?"over":"under":0===n?"under":"over",e[n].rbc[r].style.rubyPosition=i}}(D,e),e.ruby=null),e.textEmphasis&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;if(!e[n].te[r].style.textEmphasisPosition||"none"===e[n].te[r].style.textEmphasisPosition)i="tb"===t.bpd?0===n?"left over":"left under":"rl"===t.bpd?0===n?"right under":"left under":0===n?"left under":"right under",e[n].te[r].style.textEmphasisPosition=i}}(D,e),e.textEmphasis=null),e.mra&&(!function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(D),e.mra=null),e.lp&&(!function(e,t,n){for(var r in e){var i=e[r].elements.length,a=e[r].elements[e[r].start_elem],o=e[r].elements[e[r].end_elem],s=Math.ceil(t)+"px",u="-"+Math.ceil(t)+"px";0!==i&&("lr"===n.ipd?(a.node.style.borderLeftColor=a.bgcolor||"#00000000",a.node.style.borderLeftStyle="solid",a.node.style.borderLeftWidth=s,a.node.style.marginLeft=u):"rl"===n.ipd?(a.node.style.borderRightColor=a.bgcolor||"#00000000",a.node.style.borderRightStyle="solid",a.node.style.borderRightWidth=s,a.node.style.marginRight=u):"tb"===n.ipd&&(a.node.style.borderTopColor=a.bgcolor||"#00000000",a.node.style.borderTopStyle="solid",a.node.style.borderTopWidth=s,a.node.style.marginTop=u),"lr"===n.ipd?(o.node.style.borderRightColor=o.bgcolor||"#00000000",o.node.style.borderRightStyle="solid",o.node.style.borderRightWidth=s,o.node.style.marginRight=u):"rl"===n.ipd?(o.node.style.borderLeftColor=o.bgcolor||"#00000000",o.node.style.borderLeftStyle="solid",o.node.style.borderLeftWidth=s,o.node.style.marginLeft=u):"tb"===n.ipd&&(o.node.style.borderBottomColor=o.bgcolor||"#00000000",o.node.style.borderBottomStyle="solid",o.node.style.borderBottomWidth=s,o.node.style.marginBottom=u))}}(D,e.lp.toUsedLength(e.w,e.h),e),e.lp=null),e.flg)){var C=a(g.getBoundingClientRect(),e);!function(e,t,n,r){for(var i=Math.sign(n-t),a=0;a<=e.length;a++){var o,s,u;if(o=0===a?t:a===e.length?n:(e[a].before+e[a-1].after)/2,a>0)for(var l=0;l<e[a-1].elements.length;l++)null!==e[a-1].elements[l].bgcolor&&(u=e[a-1].elements[l],i*(u.after-o)<0&&(s=Math.ceil(Math.abs(o-u.after))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingRight=s:"rl"===r.bpd?u.node.style.paddingLeft=s:"tb"===r.bpd&&(u.node.style.paddingBottom=s)));if(a<e.length)for(var c=0;c<e[a].elements.length;c++)null!==(u=e[a].elements[c]).bgcolor&&i*(u.before-o)>0&&(s=Math.ceil(Math.abs(u.before-o))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingLeft=s:"rl"===r.bpd?u.node.style.paddingRight=s:"tb"===r.bpd&&(u.node.style.paddingTop=s))}}(D,C.before,C.after,e),e.flg=null}if("region"===s.kind&&(o(e,g,D),"tb"===e.bpd&&e.enableRollUp&&s.contents.length>0&&"after"===s.styleAttrs[n.byName.displayAlign.qname])){var M=new i(""===s.id?"_":s.id,D);if(e.currentISDState[M.id]=M,e.previousISDState&&M.id in e.previousISDState&&e.previousISDState[M.id].plist.length>0&&M.plist.length>1&&M.plist[M.plist.length-2].text===e.previousISDState[M.id].plist[e.previousISDState[M.id].plist.length-1].text){var L=l.firstElementChild,N=M.plist[M.plist.length-1].after-M.plist[M.plist.length-1].before;L.style.bottom="-"+N+"px",L.style.transition="transform 0.4s",L.style.position="relative",L.style.transform="translateY(-"+N+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+s.kind)}function i(e,t){this.id=e,this.plist=t}function a(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function o(e,t,n,r){if("rt"!==t.localName&&"rtc"!==t.localName){var i,s,u,l,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName||"rb"===t.localName){var d=t.getBoundingClientRect();if(0===d.height||0===d.width)return;var f=a(d,e);if(0!==n.length&&(i=f.before,s=f.after,u=n[n.length-1].before,l=n[n.length-1].after,s<l&&i>u||l<=s&&u>=i)){var h=Math.sign(f.after-f.before),p=Math.sign(f.end-f.start);h*(f.before-n[n.length-1].before)<0&&(n[n.length-1].before=f.before),h*(f.after-n[n.length-1].after)>0&&(n[n.length-1].after=f.after),p*(f.start-n[n.length-1].start)<0&&(n[n.length-1].start=f.start,n[n.length-1].start_elem=n[n.length-1].elements.length),p*(f.end-n[n.length-1].end)>0&&(n[n.length-1].end=f.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:f.before,after:f.after,start:f.start,end:f.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:f.before,after:f.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&(o(e,g,n,c),"ruby"===g.localName||"rtc"===g.localName?n.length>0&&n[n.length-1].rbc.push(g):"span"===g.localName&&g.style.textEmphasisStyle&&"none"!==g.style.textEmphasisStyle&&n.length>0&&n[n.length-1].te.push(g)),g=g.nextSibling}}function s(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,i,a,o,s,u,l){var c=i||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var f=c*e.aspectRatio;f>d?c=Math.round(d/e.aspectRatio):d=f}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var p={h:c,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:o||!1,isd:e,errorHandler:s,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};for(var g in t.appendChild(h),e.contents)r(p,h,e.contents[g]);return p.currentISDState};var u=[new s("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new s("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new s("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new s("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new s("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new s("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,a=0,o=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];o&&(i=o[0].toUsedLength(e.w,e.h)+o[2].toUsedLength(e.w,e.h),a=o[1].toUsedLength(e.w,e.h)+o[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new s("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){var i=[];for(var a in r)"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);t.style.fontFamily=i.join(",")})),new s("http://www.w3.org/ns/ttml#styling shear",(function(e,t,n,r){if(0!==r){var i=-.9*r;"tb"===e.bpd?t.style.transform="skewX("+i+"deg)":t.style.transform="skewY("+i+"deg)"}})),new s("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new s("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new s("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new s("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new s("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0].toUsedLength(e.w,e.h)+"px",i[1]=r[3].toUsedLength(e.w,e.h)+"px",i[2]=r[2].toUsedLength(e.w,e.h)+"px",i[3]=r[1].toUsedLength(e.w,e.h)+"px",t.style.padding=i.join(" ")})),new s("http://www.w3.org/ns/ttml#styling position",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new s("http://www.w3.org/ns/ttml#styling rubyAlign",(function(e,t,n,r){t.style.rubyAlign=r})),new s("http://www.w3.org/ns/ttml#styling rubyPosition",(function(e,t,n,r){var i;"before"!==r&&"after"!==r||(i="tb"===e.bpd||"rl"===e.bpd?"before"===r?"over":"under":"before"===r?"under":"over",t.parentElement.style.rubyPosition=i)})),new s("http://www.w3.org/ns/ttml#styling showBackground",null),new s("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,r,i){var a,o=r.styleAttrs[n.byName.direction.qname];a="start"===i?"rtl"===o?"right":"left":"end"===i?"rtl"===o?"left":"right":i,t.style.textAlign=a})),new s("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new s("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){})),new s("http://www.w3.org/ns/ttml#styling textShadow",(function(e,t,r,i){var a=r.styleAttrs[n.byName.textOutline.qname];if("none"===i&&"none"===a)t.style.textShadow="";else{var o=[];if("none"!==a&&o.push("rgba("+a.color[0].toString()+","+a.color[1].toString()+","+a.color[2].toString()+","+(a.color[3]/255).toString()+") 0px 0px "+a.thickness.toUsedLength(e.w,e.h)+"px"),"none"!==i)for(var s in i)o.push(i[s].x_off.toUsedLength(e.w,e.h)+"px "+i[s].y_off.toUsedLength(e.w,e.h)+"px "+i[s].b_radius.toUsedLength(e.w,e.h)+"px rgba("+i[s].color[0].toString()+","+i[s].color[1].toString()+","+i[s].color[2].toString()+","+(i[s].color[3]/255).toString()+")");t.style.textShadow=o.join(",")}})),new s("http://www.w3.org/ns/ttml#styling textCombine",(function(e,t,n,r){t.style.textCombineUpright=r.join(" ")})),new s("http://www.w3.org/ns/ttml#styling textEmphasis",(function(e,t,n,r){var i;"none"!==r.style?("auto"===r.style?t.style.textEmphasisStyle="filled":t.style.textEmphasisStyle=r.style+" "+r.symbol,("before"===r.position||"after"===r.position)&&(i="tb"===e.bpd?"before"===r.position?"left over":"left under":"rl"===e.bpd?"before"===r.position?"right under":"left under":"before"===r.position?"left under":"right under",t.style.textEmphasisPosition=i)):t.style.textEmphasisStyle="none"})),new s("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new s("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new s("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new s("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?e.writingMode="horizontal-tb":"tblr"===r?e.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(e.writingMode="vertical-rl"),t.style.writingMode=e.writingMode})),new s("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new s("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],l={};for(var c in u)l[u[c].qname]=u[c]}(t,"undefined"==typeof imscNames?n(34):imscNames,"undefined"==typeof imscStyles?n(45):imscStyles,"undefined"==typeof imscUtils?n(35):imscUtils)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n){t+=e[n].uchar}return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function o(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,s,u,l){var c=null,d=!1,f=-1,h={start:s,end:u,spans:[]},p="style_cea608_white_black",g={},v={},m=[],y=void 0,E=void 0;for(y=0;y<15;++y){var T=l.rows[y],_="",b=null;if(!1===T.isEmpty()){var S=t(T.chars);null===c&&(c={x:S,y1:y,y2:y+1,p:[]}),S!==f&&d&&(c.p.push(h),h={start:s,end:u,spans:[]},c.y2=y,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===g.hasOwnProperty(c.name)?(m.push(c),g[c.name]=c):g[c.name].p.contat(c.p),c={x:S,y1:y,y2:y+1,p:[]});for(var A=0;A<T.chars.length;++A){var I=T.chars[A],w=I.penState;if(null===b||!w.equals(b)){_.trim().length>0&&(h.spans.push({name:p,line:_,row:y}),_="");var R="style_cea608_"+w.foreground+"_"+w.background;w.underline&&(R+="_underline"),w.italics&&(R+="_italics"),v.hasOwnProperty(R)||(v[R]=JSON.parse(JSON.stringify(w))),b=w,p=R}_+=I.uchar}_.trim().length>0&&h.spans.push({name:p,line:_,row:y}),d=!0,f=S}else d=!1,f=-1,c&&(c.p.push(h),h={start:s,end:u,spans:[]},c.y2=y,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===g.hasOwnProperty(c.name)?(m.push(c),g[c.name]=c):g[c.name].p.contat(c.p),c=null)}c&&(c.p.push(h),c.y2=y+1,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===g.hasOwnProperty(c.name)?(m.push(c),g[c.name]=c):g[c.name].p.contat(c.p),c=null);var D=[];for(y=0;y<m.length;++y){var C=m[y],M="sub_cea608_"+e++,L=document.createElement("div");L.id=M;var N=n(C);L.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+N;var O=document.createElement("div");O.className="paragraph bodyStyle",O.style.cssText=i(r);var x=document.createElement("div");x.className="cueUniWrapper",x.style.cssText="unicode-bidi: normal; direction: ltr;";for(var P=0;P<C.p.length;++P){var k=C.p[P],F=0;for(E=0;E<k.spans.length;++E){var U=k.spans[E];if(U.line.length>0){if(0!==E&&F!=U.row){var B=document.createElement("br");B.className="lineBreak",x.appendChild(B)}var G=!1;F===U.row&&(G=!0),F=U.row;var j=v[U.name],H=document.createElement("span");H.className="spanPadding "+U.name+" customSpanColor",H.style.cssText=i(r,j),0!==E&&G?E===k.spans.length-1?H.textContent=o(U.line):H.textContent=U.line:k.spans.length>1&&E<k.spans.length-1&&U.row===k.spans[E+1].row?H.textContent=a(U.line):H.textContent=U.line.trim(),x.appendChild(H)}}}O.appendChild(x),L.appendChild(O);var K={bodyStyle:["%",90]};for(var V in v)v.hasOwnProperty(V)&&(K[V]=["%",90]);D.push({type:"html",start:s,end:u,cueHTMLElement:L,cueID:M,cellResolution:[32,15],isFromCEA608:!0,fontSize:K,lineHeight:{},linePadding:{}})}return D}}}o.__dashjs_factory_name="EmbeddedTextHtmlRender",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=this.context,t=void 0,n=void 0,r=void 0,a=void 0,o=void 0,s=void 0;function u(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function l(e){var t=e.split(a),n=t[1].split(s);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:c(n)}}function c(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function d(e,t){for(var n,r=t,i="",o="";""!==e[r]&&r<e.length;)r++;if((n=r-t)>1)for(var s=0;s<n;s++){if((o=e[t+s]).match(a)){i="";break}i+=o,s!==n-1&&(i+="\n")}else(o=e[t]).match(a)||(i=o);return i}return t={parse:function(e){var t,i=[],s=void 0;if(!e)return i;t=(e=e.split(r)).length,s=-1;for(var c=0;c<t;c++){var f=e[c];if(f.length>0&&"WEBVTT"!==f&&f.match(a)){var h=l(f),p=h.cuePoints,g=h.styles,v=d(e,c+1),m=u(p[0].replace(o,"")),y=u(p[1].replace(o,""));!isNaN(m)&&!isNaN(y)&&m>=s&&y>m?""!==v?(s=m,i.push({start:m,end:y,data:v,styles:g})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return i}},n=(0,i.default)(e).getInstance().getLogger(t),r=/(?:\r\n|\r|\n)/gm,a=/-->/,o=/(^[\s]+|[\s]+$)/g,s=/\s\b/g,t}o.__dashjs_factory_name="VTTParser",t.default=r.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(0)),i=c(n(2)),a=c(n(3)),o=c(n(5)),s=n(69),u=c(n(20)),l=c(n(76));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=(0,a.default)(e).getInstance(),n=void 0,r=void 0,c=0;return n={parse:function(e,n,i,a,d){var f="",h=[],p=void 0,g=void 0,v=void 0,m={},y={},E="",T="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(t.trigger(u.default.CONFORMANCE_VIOLATION,{level:l.default.LEVELS.ERROR,event:l.default.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void r.warn("smpte-tt imageType != PNG. Discarded");E=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){E&&(y[E]=T.trim()),T="",E=""},onText:function(e){E&&(T+=e)}};if(!e)throw f="no ttml data to parse",new Error(f);m.data=e,t.trigger(o.default.TTML_TO_PARSE,m);var b=(0,s.fromXML)(m.data,(function(e){f=e}),_);t.trigger(o.default.TTML_PARSED,{ttmlString:m.data,ttmlDoc:b});var S,A=b.getMediaTimeEvents();for(v=0;v<A.length;v++){var I=(0,s.generateISD)(b,A[v],(function(e){f=e}));I.contents.some((function(e){return e.contents.length}))&&(p=A[v]+n<i?i:A[v]+n)<(g=A[v+1]+n>a?a:A[v+1]+n)&&h.push({start:p,end:g,type:"html",cueID:(S=void 0,S="cue_TTML_"+c,c++,S),isd:I,images:d,embeddedImages:y})}if(""!==f)throw r.error(f),new Error(f);return h}},r=(0,i.default)(e).getInstance().getLogger(n),n}d.__dashjs_factory_name="TTMLParser",t.default=r.default.getSingletonFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(2)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=this.context,n=void 0,i=void 0,a=void 0,o=[],s=e;function u(e,t){o=o.filter((function(n){return!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))}))}return n={getAllBufferRanges:function(){for(var e=[],t=0;t<o.length;t++){var n=o[t];0===e.length||n.start>e[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}var r={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(r,"length",{get:function(){return e.length}}),r},append:function(e){"InitializationSegment"!==e.segmentType?(o.push(e),o.sort((function(e,t){return e.start-t.start})),a=null):a=e,i.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),s&&s({chunk:e})},remove:u,abort:function(){},discharge:function(e,t){var n=function(e,t){return o.filter((function(n){return(isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)}))}(e,t);return a&&(n.push(a),a=null),u(e,t),n},reset:function(){o=[],a=null,s=null},updateTimestampOffset:function(){},hasDiscontinuitiesAfter:function(){return!1},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},i=(0,r.default)(t).getInstance().getLogger(n),n}o.__dashjs_factory_name="PreBufferSink";var s=i.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(0)),i=u(n(2)),a=u(n(12)),o=u(n(1)),s=u(n(10));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t=this.context,n=e.dashMetrics,r=void 0,u=void 0;return r={getMaxIndex:function(e){var r=(0,a.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(o.default.MISSING_CONFIG_ERROR)}();var i=e.getMediaInfo(),l=e.getMediaType(),c=n.getCurrentBufferState(l),d=e.getScheduleController(),f=e.getAbrController(),h=e.getStreamInfo(),p=h&&h.manifestInfo?h.manifestInfo.isDynamic:null,g=f.getThroughputHistory(),v=g.getSafeAverageThroughput(l,p),m=g.getAverageLatency(l),y=e.useBufferOccupancyABR();return isNaN(v)||!c||y||f.getAbandonmentStateFor(l)!==s.default.ABANDON_LOAD&&(c.state===s.default.BUFFER_LOADED||p)&&(r.quality=f.getQualityForBitrate(i,v,m),d.setTimeToLoadDelay(0),u.debug("["+l+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(v),"kbps"),r.reason={throughput:v,latency:m}),r},reset:function(){}},u=(0,i.default)(t).getInstance().getLogger(r),r}l.__dashjs_factory_name="ThroughputRule",t.default=r.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(3)),i=c(n(5)),a=c(n(0)),o=c(n(2)),s=c(n(12)),u=c(n(1)),l=c(n(10));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=(0,r.default)(t).getInstance(),a=e.dashMetrics,c=void 0,d=void 0,f=void 0;function h(){(f={})[u.default.VIDEO]={ignoreCount:2},f[u.default.AUDIO]={ignoreCount:2}}function p(){h()}function g(e){isNaN(e.startTime)||e.mediaType!==u.default.AUDIO&&e.mediaType!==u.default.VIDEO||f[e.mediaType].ignoreCount>0&&f[e.mediaType].ignoreCount--}return c={getMaxIndex:function(e){var n=(0,s.default)(t).create();if(!e||!e.hasOwnProperty("getMediaType"))return n;!function(){if(!a||!a.hasOwnProperty("getCurrentBufferLevel")||!a.hasOwnProperty("getCurrentBufferState"))throw new Error(u.default.MISSING_CONFIG_ERROR)}();var r=e.getMediaType(),i=a.getCurrentBufferState(r),o=e.getRepresentationInfo().fragmentDuration;if(function(e){return f[e].ignoreCount>0}(r)||!o)return n;if(i&&i.state===l.default.BUFFER_EMPTY)d.debug("["+r+"] Switch to index 0; buffer is empty."),n.quality=0,n.reason="InsufficientBufferRule: Buffer is empty";else{var c=e.getMediaInfo(),h=e.getAbrController(),p=h.getThroughputHistory(),g=a.getCurrentBufferLevel(r),v=p.getAverageThroughput(r),m=p.getAverageLatency(r),y=v*(g/o)*.5;n.quality=h.getQualityForBitrate(c,y,m),n.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return n},reset:function(){h(),n.off(i.default.PLAYBACK_SEEKING,p,c),n.off(i.default.BYTES_APPENDED_END_FRAGMENT,g,c)}},d=(0,o.default)(t).getInstance().getLogger(c),h(),n.on(i.default.PLAYBACK_SEEKING,p,c),n.on(i.default.BYTES_APPENDED_END_FRAGMENT,g,c),c}d.__dashjs_factory_name="InsufficientBufferRule",t.default=a.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(12)),i=o(n(0)),a=o(n(2));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,i=e.dashMetrics,o=e.settings,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0;function h(){c={},d={},f=[]}return u={shouldAbandon:function(e){var a=(0,r.default)(t).create(r.default.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return a;var u,h,p=e.getMediaInfo(),g=e.getMediaType(),v=e.getCurrentRequest();if(!isNaN(v.index)){u=g,h=v.index,c[u]=c[u]||{},c[u][h]=c[u][h]||{};var m=n.getStableBufferTime();if(i.getCurrentBufferLevel(g)>m)return a;var y=c[g][v.index];if(null===y||null===v.firstByteDate||d.hasOwnProperty(y.id))return a;if(void 0===y.firstByteTime&&(f[g]=[],y.firstByteTime=v.firstByteDate.getTime(),y.segmentDuration=v.duration,y.bytesTotal=v.bytesTotal,y.id=v.index),y.bytesLoaded=v.bytesLoaded,y.elapsedTime=(new Date).getTime()-y.firstByteTime,y.bytesLoaded>0&&y.elapsedTime>0&&function(e,t){f[e]=f[e]||[],f[e].push(t)}(g,Math.round(8*y.bytesLoaded/y.elapsedTime)),f[g].length>=5&&y.elapsedTime>500&&y.bytesLoaded<y.bytesTotal){var E=f[g].reduce((function(e,t){return e+t}),0);if(y.measuredBandwidthInKbps=Math.round(E/f[g].length),y.estimatedTimeOfDownload=+(8*y.bytesTotal/y.measuredBandwidthInKbps/1e3).toFixed(2),y.estimatedTimeOfDownload<1.8*y.segmentDuration||0===e.getRepresentationInfo().quality)return a;if(!d.hasOwnProperty(y.id)){var T=e.getAbrController(),_=y.bytesTotal-y.bytesLoaded,b=T.getBitrateList(p),S=T.getQualityForBitrate(p,y.measuredBandwidthInKbps*o.get().streaming.abr.bandwidthSafetyFactor),A=T.getMinAllowedIndexFor(g),I=void 0!==A?Math.max(A,S):S;_>y.bytesTotal*b[I].bitrate/b[T.getQualityFor(g)].bitrate&&(a.quality=I,a.reason.throughput=y.measuredBandwidthInKbps,a.reason.fragmentID=y.id,d[y.id]=y,l.debug("["+g+"] frag id",y.id," is asking to abandon and switch to quality to ",I," measured bandwidth was",y.measuredBandwidthInKbps),delete c[g][y.id])}}else y.bytesLoaded===y.bytesTotal&&delete c[g][y.id]}return a},reset:h},l=(0,a.default)(t).getInstance().getLogger(u),h(),u}s.__dashjs_factory_name="AbandonRequestsRule",t.default=i.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(12)),a=o(n(2));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){var r=(0,i.default)(e).create();if(!t||!t.hasOwnProperty("getDroppedFramesHistory"))return r;var a=t.getDroppedFramesHistory();if(a){for(var o=a.getFrameHistory(),s=0,u=0,l=i.default.NO_CHANGE,c=1;c<o.length;c++)if(o[c]&&(s=o[c].droppedVideoFrames,(u=o[c].totalVideoFrames)>375&&s/u>.15)){l=c-1,n.debug("index: "+l+" Dropped Frames: "+s+" Total Frames: "+u);break}return(0,i.default)(e).create(l,{droppedFrames:s})}return r}},n=(0,a.default)(e).getInstance().getLogger(t),t}s.__dashjs_factory_name="DroppedFramesRule",t.default=r.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(2)),a=o(n(12));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){for(var r=t?t.getSwitchHistory():null,i=r?r.getSwitchRequests():[],o=0,s=0,u=0,l=(0,a.default)(e).create(),c=0;c<i.length;c++)if(void 0!==i[c]&&(o+=i[c].drops,s+=i[c].noDrops,u+=i[c].dropSize,o+s>=6&&o/s>.075)){l.quality=c>0&&i[c].drops>0?c-1:c,l.reason={index:l.quality,drops:o,noDrops:s,dropSize:u},n.debug("Switch history rule index: "+l.quality+" samples: "+(o+s)+" drops: "+o);break}return l}},n=(0,i.default)(e).getInstance().getLogger(t),t}s.__dashjs_factory_name="SwitchHistoryRule",t.default=r.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(10)),i=c(n(12)),a=c(n(0)),o=n(8),s=c(n(3)),u=c(n(5)),l=c(n(2));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.dashMetrics,a=e.mediaPlayerModel,c=(0,s.default)(t).getInstance(),d=void 0,f=void 0,h=void 0;function p(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,10+2*t.length),a=(n[r]-1)/(i/10-1);return{gp:a,Vp:10/a}}function g(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=a.getStableBufferTime(),o=p(i,n,r);return o?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=o.Vp,t.gp=o.gp,t.lastQuality=0,v(t)):t.state=0,t}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(e,t){var r=a.getStableBufferTime();if(e.stableBufferTime!==r){var i=p(r,e.bitrates,e.utilities);if(i.Vp!==e.Vp||i.gp!==e.gp){var o=n.getCurrentBufferLevel(t),s=o+e.placeholderBuffer;s-=10,s*=i.Vp/e.Vp,s+=10,e.stableBufferTime=r,e.Vp=i.Vp,e.gp=i.gp,e.placeholderBuffer=Math.max(0,s-o)}}}function y(e,t){return e.Vp*(e.utilities[t]+e.gp)}function E(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var o=e.bitrates[a],s=e.utilities[a],u=e.Vp*(e.gp+(n*s-o*r)/(n-o));i=Math.max(i,u)}return i}function T(){for(var e in h)h.hasOwnProperty(e)&&2===h[e].state&&(h[e].placeholderBuffer=0)}function _(){for(var e in h)if(h.hasOwnProperty(e)){var t=h[e];0!==t.state&&(t.state=1,v(t))}}function b(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=h[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,A(t,e.chunk.mediaInfo.type)}}}function S(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===o.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=h[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),A(t,e.mediaType))}}function A(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var r=n.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=y(e,e.lastQuality),a=Math.max(0,i-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function I(e){if(e){var t=h[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function w(e){if(e){var t=h[e.mediaType];if(t&&0!==t.state){var r=n.getCurrentBufferLevel(e.mediaType),i=void 0;i=t.abrQuality>0?E(t,t.abrQuality):10;var a=Math.max(0,i-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function R(){h={}}return d={getMaxIndex:function(e){var r=(0,i.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return r;var a=e.getMediaInfo(),o=e.getMediaType(),s=e.getScheduleController(),u=e.getStreamInfo(),l=e.getAbrController(),c=l.getThroughputHistory(),d=u?u.id:null,p=u&&u.manifestInfo&&u.manifestInfo.isDynamic,T=e.useBufferOccupancyABR();if(r.reason=r.reason||{},!T)return r;s.setTimeToLoadDelay(0);var _=function(e){var t=e.getMediaType(),n=h[t];return n?0!==n.state&&m(n,t):(n=g(e),h[t]=n),n}(e);if(0===_.state)return r;var b=n.getCurrentBufferLevel(o),S=c.getAverageThroughput(o,p),A=c.getSafeAverageThroughput(o,p),I=c.getAverageLatency(o),w=void 0;if(r.reason.state=_.state,r.reason.throughput=S,r.reason.latency=I,isNaN(S))return r;switch(_.state){case 1:w=l.getQualityForBitrate(a,A,I),r.quality=w,r.reason.throughput=A,_.placeholderBuffer=Math.max(0,E(_,w)-b),_.lastQuality=w,!isNaN(_.lastSegmentDurationS)&&b>=_.lastSegmentDurationS&&(_.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,m(e,t)}(_,o),w=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var o=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||o>=i)&&(i=o,r=a)}return r}(_,b+_.placeholderBuffer);var R=l.getQualityForBitrate(a,A,I);w>_.lastQuality&&w>R&&(w=Math.max(R,_.lastQuality));var D=Math.max(0,b+_.placeholderBuffer-y(_,w));D<=_.placeholderBuffer?(_.placeholderBuffer-=D,D=0):(D-=_.placeholderBuffer,_.placeholderBuffer=0,w<l.getTopQualityIndexFor(o,d)?s.setTimeToLoadDelay(1e3*D):D=0),r.quality=w,r.reason.throughput=S,r.reason.latency=I,r.reason.bufferLevel=b,r.reason.placeholderBuffer=_.placeholderBuffer,r.reason.delay=D,_.lastQuality=w;break;default:f.debug("BOLA ABR rule invoked in bad state."),r.quality=l.getQualityForBitrate(a,A,I),r.reason.state=_.state,r.reason.throughput=A,r.reason.latency=I,_.state=1,v(_)}return r},reset:function(){R(),c.off(u.default.BUFFER_EMPTY,T,d),c.off(u.default.PLAYBACK_SEEKING,_,d),c.off(u.default.MEDIA_FRAGMENT_LOADED,b,d),c.off(u.default.METRIC_ADDED,S,d),c.off(u.default.QUALITY_CHANGE_REQUESTED,I,d),c.off(u.default.FRAGMENT_LOADING_ABANDONED,w,d)}},f=(0,l.default)(t).getInstance().getLogger(d),R(),c.on(u.default.BUFFER_EMPTY,T,d),c.on(u.default.PLAYBACK_SEEKING,_,d),c.on(u.default.MEDIA_FRAGMENT_LOADED,b,d),c.on(u.default.METRIC_ADDED,S,d),c.on(u.default.QUALITY_CHANGE_REQUESTED,I,d),c.on(u.default.FRAGMENT_LOADING_ABANDONED,w,d),d}d.__dashjs_factory_name="BolaRule",t.default=a.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(10)),i=d(n(12)),a=d(n(0)),o=n(8),s=d(n(3)),u=d(n(5)),l=d(n(2)),c=d(n(1));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t=this.context,n=e.dashMetrics,a=(0,s.default)(t).getInstance(),d=void 0,f=void 0,h=void 0,p=void 0;function g(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){if(!e||!e.type)return;h[e.type]={},h[e.type].w=[],h[e.type].prev_w=[],h[e.type].Q=0,h[e.type].segment_request_start_s=0,h[e.type].segment_download_finish_s=0,h[e.type].B_target=1.5}(n),v(t),t}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(){for(var e in f)if(f.hasOwnProperty(e)){var t=f[e];0!==t.state&&(t.state=1,v(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=f[e.chunk.mediaInfo.type],n=h[e.chunk.mediaInfo.type];if(t&&0!==t.state){var r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,T(t,n)}}}function E(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===o.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=f[e.mediaType],n=h[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),T(t,n))}}function T(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function _(e){if(e&&e.mediaType){var t=f[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function b(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function S(){f={},h={}}return d={getMaxIndex:function(e){var r=(0,i.default)(t).create(),a=Math.pow(4,.99),o=Math.max(Math.pow(4,1),a*Math.sqrt(4)),s=e.getMediaInfo(),u=e.getMediaType(),l=s.bitrateList.map((function(e){return e.bandwidth})),d=l.length,m=e.getScheduleController(),y=e.getStreamInfo(),E=e.getAbrController(),T=E.getThroughputHistory(),_=y&&y.manifestInfo&&y.manifestInfo.isDynamic,S=e.useL2AABR(),A=n.getCurrentBufferLevel(u,!0),I=T.getSafeAverageThroughput(u,_),w=T.getAverageThroughput(u,_),R=T.getAverageLatency(u),D=void 0,C=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!S||u===c.default.AUDIO)return r;m.setTimeToLoadDelay(0);var M=function(e){var t=e.getMediaType(),n=f[t];return n||(n=g(e),f[t]=n),n}(e);if(0===M.state)return r;var L=h[u];if(!L)return r;if(r.reason.state=M.state,r.reason.throughput=w,r.reason.latency=R,isNaN(w))return r;switch(M.state){case 1:if(D=E.getQualityForBitrate(s,I,R),r.quality=D,r.reason.throughput=I,M.lastQuality=D,!isNaN(M.lastSegmentDurationS)&&A>=L.B_target){M.state=2,L.Q=a;for(var N=0;N<d;++N)N===M.lastQuality?L.prev_w[N]=1:L.prev_w[N]=0}break;case 2:var O=[],x=n.getCurrentHttpRequest(u).trace.reduce((function(e,t){return e+t.d}),0),P=n.getCurrentHttpRequest(u).trace.reduce((function(e,t){return e+t.b[0]}),0),k=Math.round(8*P/x);k<1&&(k=1);for(var F=M.lastSegmentDurationS,U=1,B=0;B<d;++B)l[B]=l[B]/1e3,C*l[B]>k&&(U=-1),L.w[B]=L.prev_w[B]+U*(F/(2*o))*((L.Q+a)*(C*l[B]/k));L.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),o=0,s=0,u=[],l=0;l<t-1;++l)if((s=((o+=a[l])-1)/(l+1))>=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var c=0;c<t;++c)u[c]=Math.max(r[c]-s,0);return u}(L.w);for(var G=0;G<d;++G)O[G]=L.w[G]-L.prev_w[G],L.prev_w[G]=L.w[G];L.Q=Math.max(0,L.Q-F+F*C*((b(l,L.prev_w)+b(l,O))/k));for(var j=[],H=0;H<d;++H)j[H]=Math.abs(l[H]-b(L.w,l));(D=j.indexOf(Math.min.apply(Math,j)))>M.lastQuality&&l[M.lastQuality+1]<=k&&(D=M.lastQuality+1),l[D]>=k&&(L.Q=2*Math.max(a,L.Q)),r.quality=D,r.reason.throughput=w,r.reason.latency=R,r.reason.bufferLevel=A,M.lastQuality=r.quality;break;default:p.debug("L2A ABR rule invoked in bad state."),r.quality=E.getQualityForBitrate(s,I,R),r.reason.state=M.state,r.reason.throughput=I,r.reason.latency=R,M.state=1,v(M)}return r},reset:function(){S(),a.off(u.default.PLAYBACK_SEEKING,m,d),a.off(u.default.MEDIA_FRAGMENT_LOADED,y,d),a.off(u.default.METRIC_ADDED,E,d),a.off(u.default.QUALITY_CHANGE_REQUESTED,_,d)}},p=(0,l.default)(t).getInstance().getLogger(d),S(),a.on(u.default.PLAYBACK_SEEKING,m,d),a.on(u.default.MEDIA_FRAGMENT_LOADED,y,d),a.on(u.default.METRIC_ADDED,E,d),a.on(u.default.QUALITY_CHANGE_REQUESTED,_,d),d}f.__dashjs_factory_name="L2ARule",t.default=a.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(2)),i=d(n(0)),a=d(n(142)),o=d(n(143)),s=d(n(12)),u=d(n(10)),l=d(n(145)),c=d(n(1));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=(e=e||{}).dashMetrics,n=this.context,i=void 0,d=void 0,f=void 0,h=void 0;return d={getMaxIndex:function(e){try{var r=(0,s.default)(n).create(),a=e.getMediaInfo().type,o=e.getAbrController(),d=e.getStreamInfo(),p=o.getQualityFor(a,d),g=e.getMediaInfo(),v=t.getCurrentBufferState(a),m=e.getScheduleController(),y=t.getCurrentBufferLevel(a,!0),E=d&&d.manifestInfo?d.manifestInfo.isDynamic:null,T=m.getPlaybackController(),_=T.getCurrentLiveLatency();if(!e.useLoLPABR()||a===c.default.AUDIO)return r;_||(_=0);var b=T.getPlaybackRate(),S=o.getThroughputHistory().getSafeAverageThroughput(a,E);if(i.debug("Throughput "+Math.round(S)+" kbps"),isNaN(S)||!v)return r;if(o.getAbandonmentStateFor(a)===u.default.ABANDON_LOAD)return r;for(var A=g.bitrateList,I=e.getRepresentationInfo().fragmentDuration,w=A[0].bandwidth/1e3,R=A[A.length-1].bandwidth/1e3,D=0;D<A.length;D++){var C=A[D].bandwidth/1e3;C>R?R=C:C<w&&(w=C)}var M=A[p].bandwidth/1e3,L=t.getCurrentHttpRequest(a,!0),N=(L.tresponse.getTime()-L.trequest.getTime())/1e3,O=N>I?N-I:0;h.setupPerSegmentQoe(I,R,w),h.logSegmentMetrics(M,O,_,b);var x=(0,l.default)(n).create({targetLatency:1.5,bufferMin:.3,segmentDuration:I,qoeEvaluator:h});return r.quality=f.getNextQuality(g,1e3*S,_,y,b,p,x),r.reason={throughput:S,latency:_},r.priority=s.default.PRIORITY.STRONG,m.setTimeToLoadDelay(0),r.quality!==p&&console.log("[TgcLearningRule]["+a+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(S),"kbps"),r}catch(e){throw e}},reset:function(){f.reset(),h.reset()}},i=(0,r.default)(n).getInstance().getLogger(d),f=(0,a.default)(n).create(),h=(0,o.default)(n).create(),d}f.__dashjs_factory_name="LoLPRule",t.default=i.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}var o="manual_weight_selection",s="random_weight_selection",u="dynamic_weight_selection";function l(){var e=this.context,t=void 0,n=void 0,r=void 0,a=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0;function p(){r=null,a=1,l=100,c=0,null,d=null,f=null,h=u}function g(){var e=0;if(r)for(var t=0;t<r.length;t++){var n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function v(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function m(e,t){return v([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function y(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=m(i,e);E(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function E(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}function T(e,t,n,r,i,a,o){d||(d=f[f.length-1]);var s=e.findWeightVector(t,n,r,i,a,o);null!==s&&-1!==s&&(d=s)}return t={getNextQuality:function(e,t,i,p,m,E,_){var b=i,S=p,A=t,I=function(e){if(!r){r=[];var t=e.bitrateList,n=[];c=t[0].bandwidth,t.forEach((function(e){n.push(e.bandwidth),e.bandwidth<c&&(c=e.bandwidth)})),s=n.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),a=Math.sqrt(s);for(var i=0;i<t.length;i++){var o={qualityIndex:i,bitrate:t[i].bandwidth,state:{throughput:t[i].bandwidth/a,latency:0,rebuffer:0,switch:0}};r.push(o),o.bitrate===c&&o}f=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*g(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,o=null,s=0;s<n.length;s++){for(var u=n[s],l=null,c=0;c<t.length;c++){var d=v(u,t[c],r);(null===l||d<l)&&(l=d)}(null===o||l>o)&&(a=u,o=l)}t.push(a)}for(var f=null,h=null,p=0;p<t.length;p++){for(var m=0,y=0;y<t.length;y++)p!==y&&(m+=v(t[p],t[y],r));(null===f||m>f)&&(f=m,h=p)}var E=[];E.push(t[h]),t.splice(h,1);for(;t.length>0;){for(var T=null,_=null,b=0;b<t.length;b++){var S=v(E[0],t[b],r);(null===T||S<T)&&(T=S,_=b)}E.push(t[_]),t.splice(_,1)}return E}(r)}var s;return r}(e),w=t/a;w>1&&(w=g()),i/=l,n.debug("getNextQuality called throughput:"+w+" latency:"+i+" bufferSize:"+p+" currentQualityIndex:"+E+" playbackRate:"+m);var R=I[E],D=R.bitrate*_.getSegmentDuration()/A,C=Math.max(0,D-S);if(S-D<_.getMinBuffer())return n.debug("Buffer is low for bitrate= "+R.bitrate+" downloadTime="+D+" currentBuffer="+S+" rebuffer="+C),function(e,t){var n=0,i=e;if(r)for(var a=0;a<r.length;a++){var o=r[a];o.bitrate<e.bitrate&&o.bitrate>n&&t>o.bitrate&&(n=o.bitrate,i=o)}return i}(R,A).qualityIndex;switch(h){case o:d=[.4,.4,.4,.4];break;case s:!function(e){d=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<t;i++)n.push(Math.random()*r);return d=n}(e.length,4)}(I);break;case u:T(_,I,b,S,C,A,m);break;default:T(_,I,b,S,C,A,m)}for(var M=null,L=null,N=null,O=0;O<I.length;O++){var x=I[O],P=x.state,k=[P.throughput,P.latency,P.rebuffer,P.switch],F=d.slice(),U=_.getNextBufferWithBitrate(x.bitrate,S,A),B=U<_.getMinBuffer();B&&n.debug("Buffer is low for bitrate="+x.bitrate+" downloadTime="+D+" currentBuffer="+S+" nextBuffer="+U),(x.bitrate>t-1e4||B)&&x.bitrate!==c&&(F[0]=100);var G=v(k,[w,0,0,0],F);(null===M||G<M)&&(M=G,L=x.qualityIndex,N=x,F)}var j=Math.abs(R.bitrate-N.bitrate)/a;return y(R,I,[w,i,C,j]),y(N,I,[w,0,0,j]),L},reset:function(){p()}},n=(0,i.default)(e).getInstance().getLogger(t),p(),t}l.__dashjs_factory_name="LearningAbrController",t.default=r.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(144));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e,t=void 0,n=void 0,r=void 0,a=void 0;function o(){t=null,n=null,r=null,a=null}function s(e,t,n,r){var a=new i.default;return a.type=e,a.weights.bitrateReward=t||1,a.weights.bitrateSwitchPenalty=1,a.weights.rebufferPenalty=n||1e3,a.weights.latencyPenalty=[],a.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),a.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),a.weights.playbackSpeedPenalty=r||200,a}function u(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a<i.weights.latencyPenalty.length;a++){var o=i.weights.latencyPenalty[a];if(n<=o.threshold){i.latencyWSum+=o.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,i,o){t=s("segment",e,i,o),n=e,r=i,a=o},logSegmentMetrics:function(e,n,r,i){t&&u(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,i,o){var l=null;return n&&r&&a&&(l=s("segment",n,r,a)),l?(u(e,t,i,o,l),l.totalQoe):0},reset:function(){o()}},o(),e}o.__dashjs_factory_name="LoLpQoeEvaluator",t.default=r.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t,n,r,i=e.targetLatency,a=e.bufferMin,o=e.segmentDuration,s=e.qoeEvaluator,u=void 0,l=void 0;function c(){return o}function d(e,t){var n=c();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return a},getSegmentDuration:c,getNextBufferWithBitrate:function(e,t,n){return d(t,e*o/n)},getNextBuffer:d,findWeightVector:function(e,t,n,r,c,f){var h=null,p=null,g=null,v=Math.abs(t-l);return e.forEach((function(e){u.forEach((function(r){r[0];var u=r[1],l=r[2],m=(r[3],e.bitrate*o/c),y=d(n,m),E=(0===l?10:1/l)*Math.max(1e-5,m-y),T=(0===u?10:1/u)*e.state.latency,_=s.calculateSingleUseQoe(e.bitrate,E,T,f);(null===h||_>h)&&function(e,t,n){if(e>i+n)return!1;return t>=a}(t,y,v)&&(h=_,p=r,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),l=t,p}},n=[.2,.4,.6,.8,1],r=4,u=function e(t,r,i){if(i===r)return t;for(var a=t.length,o=0;o<a;o++)for(var s=t.shift(),u=0;u<n.length;u++)t.push(s.concat(n[u]));return e(t,r,i+1)}(n.map((function(e){return[e]})),r,1),l=0,t}o.__dashjs_factory_name="LoLpWeightSelector",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,o=e.useL2AABR,s=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function d(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return o},useLoLPABR:function(){return s},getVideoModel:function(){return c}}}o.__dashjs_factory_name="RulesContext",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(12));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=[],t=[];return{push:function(n){n.newValue===i.default.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,a=r<0?1:0,o=a?-r:0,s=a?0:1;if(e[n.oldValue].drops+=a,e[n.oldValue].dropSize+=o,e[n.oldValue].noDrops+=s,t.push({idx:n.oldValue,noDrop:s,drop:a,dropSize:o}),t.length>8){var u=t.shift();e[u.idx].drops-=u.drop,e[u.idx].dropSize-=u.dropSize,e[u.idx].noDrops-=u.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}o.__dashjs_factory_name="SwitchRequestHistory";var s=r.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e=[],t=0,n=0;return{push:function(r,i){var a=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,o=i&&i.totalVideoFrames?i.totalVideoFrames:0,s=a-t;t=a;var u=o-n;n=o,isNaN(r)||(e[r]?(e[r].droppedVideoFrames+=s,e[r].totalVideoFrames+=u):e[r]={droppedVideoFrames:s,totalVideoFrames:u})},getFrameHistory:function(){return e},reset:function(r){e=[],t=r.droppedVideoFrames,n=r.totalVideoFrames}}}o.__dashjs_factory_name="DroppedFramesHistory";var s=a.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(1)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).settings,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0;function u(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function l(e,u,l){return t.get().streaming.abr.movingAverageMethod!==r.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?s.throughputHalfLife:s.latencyHalfLife,r=e?a[t]:o[t];if(!r||r.totalWeight<=0)return NaN;var i=r.fastEstimate/(1-Math.pow(.5,r.totalWeight/n.fast)),u=r.slowEstimate/(1-Math.pow(.5,r.totalWeight/n.slow));return e?Math.min(i,u):Math.max(i,u)}(e,u):function(e,t,r){var a=function(e,t,r){var a=void 0,o=void 0;if(e?(a=n[t],o=r?3:4):(a=i[t],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s<o;++s){var u=a[a.length-s]/a[a.length-s-1];if((u>=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,t,r),o=(e?n:i)[t];if(0===a||!o||0===o.length)return NaN;return(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length}(e,u,l)}function c(e,t){return l(!0,e,t)}function d(e){n[e]=n[e]||[],i[e]=i[e]||[],a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},o[e]=o[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function f(){n={},i={},a={},o={}}var h={push:function(e,l,c){if(l.trace&&l.trace.length){var f=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,p=l.trace.reduce((function(e,t){return e+t.b[0]}),0),g=void 0;g=t.get().streaming.lowLatencyEnabled?l.trace.reduce((function(e,t){return e+t.d}),0):c?h:f+h;var v=Math.round(8*p/g);if(d(e),function(e,n,i){return e===r.default.VIDEO?i<t.get().streaming.cacheLoadThresholds[r.default.VIDEO]:e===r.default.AUDIO?i<t.get().streaming.cacheLoadThresholds[r.default.AUDIO]:void 0}(e,0,h)){if(n[e].length>0&&!n[e].hasCachedEntries)return;n[e].hasCachedEntries=!0}else n[e]&&n[e].hasCachedEntries&&function(e){delete n[e],delete i[e],delete a[e],delete o[e],d(e)}(e);n[e].push(v),n[e].length>20&&n[e].shift(),i[e].push(f),i[e].length>20&&i[e].shift(),u(a[e],v,.001*h,s.throughputHalfLife),u(o[e],f,1,s.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,n){var r=c(e,n);return isNaN(r)||(r*=t.get().streaming.abr.bandwidthSafetyFactor),r},getAverageLatency:function(e){return l(!1,e)},reset:f};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},f(),h}o.__dashjs_factory_name="ThroughputHistory",t.default=i.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(1)),i=s(n(0)),a=s(n(66)),o=s(n(151));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){e=e||{};var t,n=this.context,i=void 0;function s(){return i.getBuffer()}return t={getBufferControllerType:function(){return i.getBufferControllerType()},initialize:function(e,t){return i.initialize(e,t)},createBuffer:function(e,t){return i.createBuffer(e,t)},getType:function(){return i.getType()},getBuffer:s,setBuffer:function(e){i.setBuffer(e)},getBufferLevel:function(){return i.getBufferLevel()},setMediaSource:function(e){i.setMediaSource(e)},getMediaSource:function(){return i.getMediaSource()},getIsBufferingCompleted:function(){return i.getIsBufferingCompleted()},getIsPruningInProgress:function(){return i.getIsPruningInProgress()},dischargePreBuffer:function(){return i.dischargePreBuffer()},appendInitSegment:function(e){i.appendInitSegment(e)},getRangeAt:function(e){return i.getRangeAt(e)},reset:function(e){i.reset(e)},updateTimestampOffset:function(e){var t=s();t.timestampOffset===e||isNaN(e)||(t.timestampOffset=e)},updateAppendWindow:function(){i.updateAppendWindow()},getRepresentationInfo:function(e){return i.getRepresentationInfo(e)}},i=e.type===r.default.FRAGMENTED_TEXT?(0,a.default)(n).create({streamInfo:e.streamInfo,type:e.type,mediaPlayerModel:e.mediaPlayerModel,manifestModel:e.manifestModel,fragmentModel:e.fragmentModel,errHandler:e.errHandler,mediaController:e.mediaController,representationController:e.representationController,adapter:e.adapter,textController:e.textController,abrController:e.abrController,playbackController:e.playbackController,settings:e.settings}):(0,o.default)(n).create({streamInfo:e.streamInfo,type:e.type,mimeType:e.mimeType,fragmentModel:e.fragmentModel,errHandler:e.errHandler}),t}u.__dashjs_factory_name="TextBufferController",t.default=i.default.getClassFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(1)),i=f(n(3)),a=f(n(5)),o=f(n(0)),s=f(n(51)),u=f(n(67)),l=f(n(42)),c=f(n(6)),d=f(n(11));function f(e){return e&&e.__esModule?e:{default:e}}function h(e){e=e||{};var t=this.context,n=(0,i.default)(t).getInstance(),o=(0,l.default)(t).getInstance(),f=e.errHandler,h=e.streamInfo,p=e.type,g=e.mimeType,v=e.fragmentModel,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0;function S(e){T=e}function A(e){null===b.extract(h.id,e.currentRepresentation.id)&&(y=!1,n.trigger(a.default.INIT_FRAGMENT_NEEDED,{representationId:e.currentRepresentation.id,sender:m},{streamId:h.id,mediaType:p}))}function I(e){e.chunk.bytes&&(b.save(e.chunk),_.append(e.chunk),y=!0,n.trigger(a.default.STREAM_COMPLETED,{request:e.request},{streamId:h.id,mediaType:p}))}return m={getBufferControllerType:function(){return"NotFragmentedTextBufferController"},initialize:function(e){S(e),b=(0,s.default)(t).getInstance()},createBuffer:function(e){var n=e[0];try{if(_=(0,u.default)(t).create(T,n),!E){var i=_.getBuffer();i.hasOwnProperty(r.default.INITIALIZE)&&i.initialize(g,h,e,v),E=!0}return _}catch(e){if(n&&(n.isText||-1!==n.codec.indexOf('codecs="stpp')||-1!==n.codec.indexOf('codecs="wvtt')))try{_=o.getTextSourceBuffer()}catch(e){f.error(new c.default(d.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,d.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p+" : "+e.message))}else f.error(new c.default(d.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,d.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p))}},getStreamId:function(){return h.id},getType:function(){return p},getBuffer:function(){return _},getBufferLevel:function(){return 0},setMediaSource:S,getMediaSource:function(){return T},getIsBufferingCompleted:function(){return y},getIsPruningInProgress:function(){return!1},dischargePreBuffer:function(){},appendInitSegment:function(e){return null!==b.extract(h.id,e)},getRangeAt:function(){return null},reset:function(e){n.off(a.default.DATA_UPDATE_COMPLETED,A,m),n.off(a.default.INIT_FRAGMENT_LOADED,I,m),!e&&_&&(_.abort(),_.reset(),_=null)},updateTimestampOffset:function(e){_.timestampOffset===e||isNaN(e)||(_.timestampOffset=e)}},E=!1,T=null,y=!1,n.on(a.default.DATA_UPDATE_COMPLETED,A,m),n.on(a.default.INIT_FRAGMENT_LOADED,I,m),m}h.__dashjs_factory_name="NotFragmentedTextBufferController",t.default=o.default.getClassFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(1)),i=d(n(10)),a=d(n(153)),o=d(n(26)),s=d(n(3)),u=d(n(5)),l=d(n(0)),c=d(n(2));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t=this.context,n=(0,s.default)(t).getInstance(),l=e.adapter,d=e.dashMetrics,f=e.mediaPlayerModel,h=e.fragmentModel,p=e.abrController,g=e.playbackController,v=e.textController,m=e.type,y=e.mimeType,E=e.mediaController,T=e.bufferController,_=e.settings,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0,N=void 0,O=void 0,x=void 0,P=void 0,k=void 0,F=void 0,U=void 0,B=void 0,G=void 0,j=void 0,H=void 0;function K(){return!1===R}function V(){S&&(K()||I&&!T.getIsBufferingCompleted()&&(A.debug("Schedule Controller starts"),R=!1,d.createPlaylistTraceMetrics(I.id,1e3*g.getTime(),g.getPlaybackRate()),w&&(w=!1),W(0)))}function q(){R||(A.debug("Schedule Controller stops"),A.debug(m+" Schedule Controller stops"),R=!0,clearTimeout(M))}function Y(){if(S)if(R||D||g.isPaused()&&!_.get().streaming.scheduleWhilePaused||(m===r.default.FRAGMENTED_TEXT||m===r.default.TEXT)&&!v.isTextEnabled()||T.getIsBufferingCompleted())q();else{!function(){if(!isNaN(L))return;if(!k)return;var e=g.getTime(),t=1.5;if(isNaN(k.fragmentDuration)){var n=d.getCurrentSchedulingInfo(I.mediaInfo.type);t=n?1.5*n.duration:1.5}var a=h.getRequests({state:o.default.FRAGMENT_MODEL_EXECUTED,time:e+t,threshold:0})[0];if(a&&-1===F.indexOf(a)&&!l.getIsTextTrack(y)){var s=_.get().streaming.fastSwitchEnabled,u=T.getBufferLevel(),c=p.getAbandonmentStateFor(m),f=!E.isCurrentTrack(a.mediaInfo)&&E.getSwitchMode(a.mediaInfo.type)===r.default.TRACK_SWITCH_MODE_NEVER_REPLACE,v=a.quality<k.quality;s&&(f||v)&&u>=t&&c!==i.default.ABANDON_LOAD?(X(a),H=!0,A.debug("Reloading outdated fragment at index: ",a.index)):a.quality>k.quality&&!B&&ce(g.getTime()+u)}}();var e=F.length>0,t=k?k.quality:NaN;if(B||isNaN(t)||U||e||function(e,t){P[t]=P[t]||{};var n=p.getTopQualityIndexFor(e,t);return P[t][e]!=n&&(A.info("Top quality "+e+" index has changed from "+P[t][e]+" to "+n),P[t][e]=n,!0)}(m,S.id)||O.execute(m,I,N)){z(!0),!e&&j&&p.checkPlaybackQuality(m),function(){if(I.quality===t&&!U||B){var e=F.shift();e&&e.isInitializationRequest()?(n.trigger(u.default.INIT_FRAGMENT_NEEDED,{representationId:e.representationId,sender:b},{streamId:S.id,mediaType:m}),j=!1):(n.trigger(u.default.MEDIA_FRAGMENT_NEEDED,{seekTarget:L,replacement:e},{streamId:S.id,mediaType:m}),j=!0)}else U?(A.debug("Switch track for "+m+", representation id = "+I.id),(B=E.getSwitchMode(m)===r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE)&&T.replaceBuffer&&T.replaceBuffer(),U=!1):A.debug("Quality has changed, get init request for representationid = "+I.id),n.trigger(u.default.INIT_FRAGMENT_NEEDED,{representationId:I.id,sender:b},{streamId:S.id,mediaType:m}),j=!1}()}else W(500)}}function W(e){clearTimeout(M),M=setTimeout(Y,e)}function z(e){D!==e?D=e:A.debug("isFragmentProcessingInProgress is already equal to",e)}function X(e){F.push(e)}function Q(e){if(g&&h){var t=h.getRequests({state:o.default.FRAGMENT_MODEL_EXECUTED,time:g.getTime(),threshold:0})[0];t&&g.getTime()>=t.startTime&&((!x.mediaInfo||t.mediaInfo.type===x.mediaInfo.type&&t.mediaInfo.id!==x.mediaInfo.id)&&e&&n.trigger(u.default.TRACK_CHANGE_RENDERED,{mediaType:m,oldMediaInfo:x.mediaInfo,newMediaInfo:t.mediaInfo}),t.quality===x.quality&&t.adaptationIndex===x.adaptationIndex||!e||n.trigger(u.default.QUALITY_CHANGE_RENDERED,{mediaType:m,oldQuality:x.quality,newQuality:t.quality}),x={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function J(){q(),z(!1),A.info("Stream "+S.id+" is complete")}function Z(e){e.request.mediaInfo.streamInfo.id===S.id&&e.request.mediaType===m&&(A.info("OnFragmentLoadingCompleted - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),l.getIsTextTrack(y)&&z(!1),e.error&&e.request.serviceLocation&&!R&&(X(e.request),z(!1),W(0)),B&&(G=e.request))}function $(){Q(!0)}function ee(e){if(B&&!isNaN(e.startTime)&&(B=!1,h.addExecutedRequest(G)),z(!1),isNaN(e.index)&&(k=T.getRepresentationInfo(e.quality),A.info("["+m+"] lastInitializedRepresentationInfo changed to "+e.quality)),H&&!isNaN(e.startTime)){var t=g.getTime(),n=e.startTime+I.fragmentDuration,r=1.5*I.fragmentDuration;W(t+r>=n?0:1e3*(n-(t+r))),H=!1}else W(0)}function te(e){A.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),g.isSeeking()||U||(A.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),X(e.request)),z(!1),W(0)}function ne(){}function re(){q()}function ie(e){B&&_.get().streaming.flushBufferAtTrackSwitch&&g.seek(g.getTime()+.001,!1,!0),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&V()}function ae(){q(),z(!1)}function oe(){h.abortRequests(),q()}function se(){!R&&_.get().streaming.scheduleWhilePaused||V()}function ue(e){if(S){ce(e.seekTime),de(0),R&&V();var t=I&&I.DVRWindow&&g?I.DVRWindow.end-g.getTime():NaN;d.updateManifestUpdateInfo({latency:t}),D?h.abortRequests():W(0)}}function le(e){d.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function ce(e){L=e}function de(e){C=e}function fe(){j=!0,D=!1,C=0,L=NaN,w=!0,k=void 0,x={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},P={},F=[],R=!0,U=!1,B=!1,G=null,H=!1}return b={initialize:function(e){N=e,O=(0,a.default)(t).create({abrController:p,dashMetrics:d,mediaPlayerModel:f,textController:v,settings:_}),n.on(u.default.DATA_UPDATE_STARTED,ne,this),n.on(u.default.FRAGMENT_LOADING_COMPLETED,Z,this),n.on(u.default.STREAM_COMPLETED,J,this),n.on(u.default.BUFFER_CLEARED,ie,this),n.on(u.default.BYTES_APPENDED_END_FRAGMENT,ee,this),n.on(u.default.QUOTA_EXCEEDED,ae,this),n.on(u.default.PLAYBACK_SEEKING,ue,this),n.on(u.default.PLAYBACK_STARTED,se,this),n.on(u.default.PLAYBACK_RATE_CHANGED,le,this),n.on(u.default.PLAYBACK_TIME_UPDATED,$,this),n.on(u.default.URL_RESOLUTION_FAILED,oe,this),n.on(u.default.FRAGMENT_LOADING_ABANDONED,te,this),n.on(u.default.BUFFERING_COMPLETED,re,this)},getType:function(){return m},getStreamId:function(){return S.id},setCurrentRepresentation:function(e){I=e},setSeekTarget:ce,setTimeToLoadDelay:de,getTimeToLoadDelay:function(){return C},switchTrackAsked:function(){U=!0},isStarted:K,start:V,stop:q,reset:function(){n.off(u.default.DATA_UPDATE_STARTED,ne,this),n.off(u.default.FRAGMENT_LOADING_COMPLETED,Z,this),n.off(u.default.STREAM_COMPLETED,J,this),n.off(u.default.BUFFER_CLEARED,ie,this),n.off(u.default.BYTES_APPENDED_END_FRAGMENT,ee,this),n.off(u.default.QUOTA_EXCEEDED,ae,this),n.off(u.default.PLAYBACK_SEEKING,ue,this),n.off(u.default.PLAYBACK_STARTED,se,this),n.off(u.default.PLAYBACK_RATE_CHANGED,le,this),n.off(u.default.PLAYBACK_TIME_UPDATED,$,this),n.off(u.default.URL_RESOLUTION_FAILED,oe,this),n.off(u.default.FRAGMENT_LOADING_ABANDONED,te,this),n.off(u.default.BUFFERING_COMPLETED,re,this),q(),Q(!1),fe(),S=null},getBufferTarget:function(){return O.getBufferTarget(m,I,N)},processInitRequest:function(e){e&&(z(!0),h.executeRequest(e))},processMediaRequest:function(e){e?(A.debug("Next fragment request url is "+e.url),h.executeRequest(e)):(g.getIsDynamic()&&A.debug("Next fragment seems to be at the bleeding live edge and is not available yet. Rescheduling."),z(!1),W(_.get().streaming.lowLatencyEnabled?100:500))},getPlaybackController:function(){return g}},A=(0,c.default)(t).getInstance().getLogger(b),fe(),S=e.streamInfo,b}f.__dashjs_factory_name="ScheduleController",t.default=l.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(1)),i=o(n(0)),a=o(n(10));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=(e=e||{}).dashMetrics,n=e.mediaPlayerModel,i=e.textController,o=e.abrController,s=e.settings;function u(e,u,l){var c=NaN;if(!e||!u)return c;if(e===r.default.FRAGMENTED_TEXT)if(i.isTextEnabled())if(isNaN(u.fragmentDuration)){var d=t.getCurrentSchedulingInfo(a.default.SCHEDULING_INFO);c=d?d.duration:0}else c=u.fragmentDuration;else c=0;else if(e===r.default.AUDIO&&l){var f=t.getCurrentBufferLevel(r.default.VIDEO);c=isNaN(u.fragmentDuration)?f:Math.max(f,u.fragmentDuration)}else{var h=u.mediaInfo.streamInfo;if(o.isPlayingAtTopQuality(h))c=h.manifestInfo.duration>=s.get().streaming.longFormContentDurationThreshold?s.get().streaming.bufferTimeAtTopQualityLongForm:s.get().streaming.bufferTimeAtTopQuality;else c=n.getStableBufferTime()}return c}return{execute:function(e,n,r){return!e||!n||t.getCurrentBufferLevel(e)<u(e,n,r)},getBufferTarget:u}}s.__dashjs_factory_name="BufferLevelRule",t.default=i.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(1)),i=o(n(6)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=(e=e||{}).eventBus,n=e.events,a=e.errors,o=e.abrController,s=e.dashMetrics,u=e.playbackController,l=e.timelineConverter,c=e.type,d=e.streamInfo,f=e.dashConstants,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0;function y(){return c}function E(){if(!(o&&s&&u&&l))throw new Error(r.default.MISSING_CONFIG_ERROR)}function T(){return g}function _(){return m}function b(){p=null,g=!0,v=[]}function S(){E();var e=new Date,t=_(),n=1e3*u.getTime();t&&s.addRepresentationSwitch(t.adaptation.type,e,n,t.id)}function A(e){return null==e||e>=v.length?null:v[e]}function I(e,t){var n;(e.segmentAvailabilityRange=l.calcSegmentAvailabilityRange(e,t),e.segmentAvailabilityRange.end<e.segmentAvailabilityRange.start)?D(new i.default(a.SEGMENTS_UNAVAILABLE_ERROR_CODE,a.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE,{availabilityDelay:e.segmentAvailabilityRange.start-e.segmentAvailabilityRange.end})):t&&(n=e.segmentAvailabilityRange.end,l.setExpectedLiveEdge(n),s.updateManifestUpdateInfo({presentationStartTime:n}))}function w(e,r){E();for(var i=0,a=v.length;i<a;i++)I(v[i],e),r&&t.trigger(n.REPRESENTATION_UPDATE_STARTED,{representation:v[i]},{streamId:d.id,mediaType:c})}function R(){g=!0,t.trigger(n.DATA_UPDATE_STARTED,{},{streamId:d.id,mediaType:c})}function D(e){g=!1,t.trigger(n.DATA_UPDATE_COMPLETED,{data:p,currentRepresentation:m,error:e},{streamId:d.id,mediaType:c})}function C(e){var r=e;t.trigger(n.AST_IN_FUTURE,{delay:r}),setTimeout((function(){T()||(R(),v.forEach((function(e){e.segmentAvailabilityRange=null})),w(u.getIsDynamic(),!0))}),r)}function M(e){if(T())if(e.error)D(e.error);else{var t,n=e.representation,r=s.getCurrentManifestUpdate(),l=!1,c=0,h=void 0;if(n.adaptation.period.mpd.manifest.type===f.DYNAMIC&&!n.adaptation.period.mpd.manifest.ignorePostponeTimePeriod&&u.getStreamController().getStreams().length<=1&&(c=function(e){try{var t=u.getStreamController().getActiveStreamInfo(),n=e.segmentAvailabilityRange.start;t&&t.id&&t.id!==d.id&&(n=Math.min(u.getTime(),n));var r=e.segmentAvailabilityRange.end-n;return 1e3*(u.getLiveDelay()-r)}catch(e){return 0}}(n)),c>0)return C(c),void D(new i.default(a.SEGMENTS_UPDATE_FAILED_ERROR_CODE,a.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE));if(r){for(var p=0;p<r.representationInfo.length;p++)if((h=r.representationInfo[p]).index===n.index&&h.mediaType===y()){l=!0;break}l||s.addManifestUpdateRepresentationInfo(n,y())}(function(){for(var e=0,t=v.length;e<t;e++){var n=v[e].segmentInfoType;if(null===v[e].segmentAvailabilityRange||!v[e].hasInitialization()||(n===f.SEGMENT_BASE||n===f.BASE_URL)&&!v[e].segments)return!1}return!0})()&&(o.setPlaybackQuality(y(),d,(t=m,v.indexOf(t))),s.updateManifestUpdateInfo({latency:m.segmentAvailabilityRange.end-u.getTime()}),s.getCurrentRepresentationSwitch(_().adaptation.type)||S(),D())}}function L(e){e.isDynamic&&w(e.isDynamic)}function N(e){m=A(e.newQuality),S()}function O(e){if(e.newDuration){var t=_();if(t&&t.adaptation.period)t.adaptation.period.duration=e.newDuration}}return h={getStreamId:function(){return d.id},getType:y,getData:function(){return p},isUpdating:T,updateData:function(e,t,n,i){E(),R(),v=t,m=A(i),p=e,n===r.default.VIDEO||n===r.default.AUDIO||n===r.default.FRAGMENTED_TEXT?w(u.getIsDynamic(),!0):D()},updateRepresentation:I,getCurrentRepresentation:_,getRepresentationForQuality:A,reset:function(){t.off(n.QUALITY_CHANGE_REQUESTED,N,h),t.off(n.REPRESENTATION_UPDATE_COMPLETED,M,h),t.off(n.WALLCLOCK_TIME_UPDATED,L,h),t.off(n.MANIFEST_VALIDITY_CHANGED,O,h),b()}},b(),t.on(n.QUALITY_CHANGE_REQUESTED,N,h),t.on(n.REPRESENTATION_UPDATE_COMPLETED,M,h),t.on(n.WALLCLOCK_TIME_UPDATED,L,h),t.on(n.MANIFEST_VALIDITY_CHANGED,O,h),h}s.__dashjs_factory_name="RepresentationController",t.default=a.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).timelineConverter;return{getLiveEdge:function(e){return function(){if(!t||!t.hasOwnProperty("getExpectedLiveEdge"))throw new Error(i.default.MISSING_CONFIG_ERROR)}(),e.DVRWindow?e.DVRWindow.end:0},reset:function(){t=null}}}o.__dashjs_factory_name="LiveEdgeFinder",t.default=r.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(0)),i=u(n(157)),a=u(n(158)),o=u(n(159)),s=u(n(160));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t,n=this.context,r=e.events,u=e.eventBus,l=e.dashConstants,c=e.streamInfo,d=e.type,f=void 0;function h(e){return e?e.segments?f[l.SEGMENT_BASE]:f[e.segmentInfoType]:null}return t={initialize:function(t){f[l.SEGMENT_TIMELINE]=(0,i.default)(n).create(e,t),f[l.SEGMENT_TEMPLATE]=(0,a.default)(n).create(e,t),f[l.SEGMENT_LIST]=(0,o.default)(n).create(e,t),f[l.SEGMENT_BASE]=(0,s.default)(n).create(e,t)},update:function(e,t,n,i){n||u.trigger(r.SEGMENTBASE_INIT_REQUEST_NEEDED,{streamId:c.id,mediaType:d,mimeType:t,representation:e}),i||u.trigger(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:c.id,mediaType:d,mimeType:t,representation:e})},getSegmentByIndex:function(e,t,n){var r=h(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=h(e);return n?n.getSegmentByTime(e,t):null}},f={},t}l.__dashjs_factory_name="SegmentsController";var c=r.default.getClassFactory(l);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1)),a=n(22);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcMediaTimeFromPresentationTime")||!n.hasOwnProperty("calcSegmentAvailabilityRange"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,r){var i,a,o,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,u=s.SegmentTimeline,l=s.SegmentURL_asArray,c=0,d=0,f=-1,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0;o=e.timescale;var E=!1;for(p=0,a=(i=u.S_asArray).length;p<a&&!E;p++){if(v=0,(h=i[p]).hasOwnProperty("r")&&(v=h.r),h.hasOwnProperty("t")&&(d=(c=h.t)/o),v<0){if((y=i[p+1])&&y.hasOwnProperty("t"))m=y.t/o;else{var T=e.segmentAvailabilityRange?e.segmentAvailabilityRange.end:n.calcSegmentAvailabilityRange(e,t).end;m=n.calcMediaTimeFromPresentationTime(T,e),e.segmentDuration=h.d/o}v=Math.ceil((m-d)/(h.d/o))-1}for(g=0;g<=v&&!E;g++)(E=r(c,d,s,l,h,o,++f,p))&&(e.segmentDuration=h.d/o,(g<v-1||p<a-1)&&f++),d=(c+=h.d)/o}e.availableSegmentsNumber=f}return{getSegmentByIndex:function(e,i,s){if(r(),!e)return null;var u=null,l=!1;return o(e,(function(r,i,o,c,d,f,h,p){if(l||s<0){var g=o.media,v=d.mediaRange;return c&&(g=c[p].media||"",v=c[p].mediaRange),u=(0,a.getTimeBasedSegment)(n,t,e,r,d.d,f,g,v,h,d.tManifest),!0}return i>=s-.5*d.d/f&&(l=!0),!1})),u},getSegmentByTime:function(e,i){if(r(),!e)return null;void 0===i&&(i=null);var s=null,u=n.calcMediaTimeFromPresentationTime(i,e);return o(e,(function(r,i,o,l,c,d,f,h){if(u<i+c.d/d){var p=o.media,g=c.mediaRange;return l&&(p=l[h].media||"",g=l[h].mediaRange),s=(0,a.getTimeBasedSegment)(n,t,e,r,c.d,d,p,g,f,c.tManifest),!0}return!1})),s}}}s.__dashjs_factory_name="TimelineSegmentsGetter";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1)),a=n(22);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;i=Math.max(i,0);var s=(0,a.getIndexBasedSegment)(n,t,e,i);if(s){s.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var u=o.media;u=(0,a.replaceTokenForTemplate)(u,"Number",s.replacementNumber),u=(0,a.replaceTokenForTemplate)(u,"Time",s.replacementTime),s.media=u}var l=e.segmentDuration,c=e.segmentAvailabilityRange;return isNaN(l)?e.availableSegmentsNumber=1:e.availableSegmentsNumber=Math.ceil((c.end-c.start)/l),s}return{getSegmentByIndex:o,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(a/i))}}}s.__dashjs_factory_name="TemplateSegmentsGetter";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1)),a=n(22);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,s=o.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(i-l,0),d=null;if(c<s){var f=o.SegmentURL_asArray[c];(d=(0,a.getIndexBasedSegment)(n,t,e,i))&&(d.replacementTime=(u+i-1)*e.segmentDuration,d.media=f.media?f.media:"",d.mediaRange=f.mediaRange,d.index=i,d.indexRange=f.indexRange)}return e.availableSegmentsNumber=s,d}return{getSegmentByIndex:o,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(a/i))}}}s.__dashjs_factory_name="ListSegmentsGetter";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r=e.segments?e.segments.length:-1,i=void 0;if(t<r&&(i=e.segments[t])&&i.availabilityIdx===t)return i;for(var a=0;a<r;a++)if((i=e.segments[a])&&i.availabilityIdx===t)return i;return null}return{getSegmentByIndex:r,getSegmentByTime:function(e,t){return n(),r(e,function(e,t){if(!e)return-1;var n=e.segments,r=n?n.length:null,i=-1,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;if(n&&r>0)for(l=0;l<r;l++)if(o=n[l],s=o.presentationStartTime,u=o.duration,t+(a=u/2)>=s&&t-a<s+u){i=o.availabilityIdx;break}return i}(e,t))}}}o.__dashjs_factory_name="SegmentBaseGetter";var s=r.default.getClassFactory(o);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(){var e=void 0,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},o=function(e,t){var n=s;if(!t)return e;if(!c(e))return e;d(e)&&(n=u),f(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function s(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y");e=a}catch(e){}finally{e=e||o}}(),{parseBaseUrl:s,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}o.__dashjs_factory_name="DefaultURLUtils",t.default=a.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(1)),i=h(n(163)),a=h(n(26)),o=h(n(164)),s=h(n(53)),u=h(n(3)),l=h(n(5)),c=h(n(11)),d=h(n(0)),f=h(n(2));function h(e){return e&&e.__esModule?e:{default:e}}function p(e){e=e||{};var t=this.context,n=(0,u.default)(t).getInstance(),d=e.errHandler,h=e.mediaPlayerModel,p=e.dashMetrics,g=(0,f.default)(t).getInstance(),v=e.streamInfo,m=void 0,y=void 0,E=void 0;function T(){for(var e in E)E[e].reset();E={}}function _(e){if(e.sender){var t=e.request,a=e.response,o=t.isInitializationRequest(),s=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType!==r.default.AUDIO&&t.mediaType!==r.default.VIDEO&&t.mediaType!==r.default.FRAGMENTED_TEXT||n.trigger(l.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation})),a&&s){var u=function(e,t,n,r){var a=new i.default;return a.streamId=n,a.mediaInfo=t.mediaInfo,a.segmentType=t.type,a.start=t.startTime,a.duration=t.duration,a.end=a.start+a.duration,a.bytes=e,a.index=t.index,a.quality=t.quality,a.representationId=t.representationId,a.endFragment=r,a}(a,t,v.id,e.type!==l.default.FRAGMENT_LOADING_PROGRESS);n.trigger(o?l.default.INIT_FRAGMENT_LOADED:l.default.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:s.id,mediaType:t.mediaType})}else y.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return m={getStreamId:function(){return v.id},getModel:function(r){var i=E[r];return i||(i=(0,a.default)(t).create({streamInfo:v,type:r,dashMetrics:p,fragmentLoader:(0,o.default)(t).create({dashMetrics:p,mediaPlayerModel:h,errHandler:d,requestModifier:(0,s.default)(t).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:n,events:l.default,errors:c.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils}),debug:g,eventBus:n,events:l.default}),E[r]=i),i},reset:function(){n.off(l.default.FRAGMENT_LOADING_COMPLETED,_,this),n.off(l.default.FRAGMENT_LOADING_PROGRESS,_,this),T()}},y=g.getLogger(m),T(),n.on(l.default.FRAGMENT_LOADING_COMPLETED,_,m),n.on(l.default.FRAGMENT_LOADING_PROGRESS,_,m),m}p.__dashjs_factory_name="FragmentController",t.default=d.default.getClassFactory(p)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(1)),i=u(n(29)),a=u(n(174)),o=u(n(6)),s=u(n(0));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){e=e||{};var t=this.context,n=e.eventBus,s=e.events,u=e.urlUtils,l=e.errors,c=void 0,d=void 0;return c={checkForExistence:function(e){var t=function(t){n.trigger(s.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new a.default(e.url);d.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var t=function(t,r){n.trigger(s.LOADING_COMPLETED,{request:e,response:t||null,error:r||null,sender:c})};e?d.load({request:e,progress:function(t){n.trigger(s.LOADING_PROGRESS,{request:e,stream:t.stream}),t.data&&n.trigger(s.LOADING_DATA_PROGRESS,{request:e,response:t.data||null,error:null,sender:c})},success:function(e){t(e)},error:function(e,n,r){t(void 0,new o.default(l.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,n))},abort:function(e){e&&n.trigger(s.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:c})}}):t(void 0,new o.default(l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){d&&d.abort()},reset:function(){d&&(d.abort(),d=null)}},d=(0,i.default)(t).create({errHandler:e.errHandler,errors:l,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:u,constants:r.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),c}l.__dashjs_factory_name="FragmentLoader",t.default=s.default.getClassFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=g(n(55)),i=g(n(166)),a=n(8),o=g(n(0)),s=g(n(6)),u=g(n(82)),l=g(n(30)),c=g(n(2)),d=g(n(3)),f=g(n(5)),h=g(n(23)),p=g(n(1));function g(e){return e&&e.__esModule?e:{default:e}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){e=e||{};var t,n=this.context,o=e.errHandler,g=e.dashMetrics,m=e.mediaPlayerModel,y=e.requestModifier,E=e.boxParser,T=e.useFetch||!1,_=e.errors,b=e.requestTimeout||0,S=(0,d.default)(n).getInstance(),A=(0,h.default)(n).getInstance(),I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0;function N(e,t){var u=e.request,c=[],d=!0,h=!0,v=new Date,_=v,I=0,O=void 0;if(!y||!g||!o)throw new Error("config object is not correct or missing");var x=function(e){h=!1,u.requestStartDate=v,u.requestEndDate=new Date,u.firstByteDate=u.firstByteDate||v,u.checkExistenceOnly||(g.addHttpRequest(u,O.response?O.response.responseURL:null,O.response?O.response.status:null,O.response&&O.response.getAllResponseHeaders?O.response.getAllResponseHeaders():O.response?O.response.responseHeaders:[],e?c:null),u.type===a.HTTPRequest.MPD_TYPE&&g.addManifestUpdate(u))},P=function(){if(-1!==w.indexOf(O)&&(w.splice(w.indexOf(O),1),h))if(x(!1),t>0){try{if(A.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&u.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE)m.getRetryAttemptsForType(a.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&S.trigger(f.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var n={config:e};D.push(n),n.timeout=setTimeout((function(){-1!==D.indexOf(n)&&(D.splice(D.indexOf(n),1),N(e,t))}),m.getRetryIntervalsForType(u.type))}else{if(u.type===a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;o.error(new s.default(C[u.type],u.url+" is not available",{request:u,response:O.response})),e.error&&e.error(u,"error",O.response.statusText),e.complete&&e.complete(u,O.response.statusText)}},k=void 0;k=T&&window.fetch&&"arraybuffer"===u.responseType&&u.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE?(0,i.default)(n).create({requestModifier:y,boxParser:E}):(0,r.default)(n).create({requestModifier:y});var F=null,U=y.modifyRequestURL(u.url);if(A.get().streaming.cmcd&&A.get().streaming.cmcd.enabled){var B=A.get().streaming.cmcd.mode;if(B===p.default.CMCD_MODE_QUERY){var G=function(e){try{var t=[],n=M.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(u);U=l.default.addAditionalQueryParameterToUrl(U,G)}else B===p.default.CMCD_MODE_HEADER&&(F=M.getHeaderParameters(u))}var j=u.checkExistenceOnly?a.HTTPRequest.HEAD:a.HTTPRequest.GET,H=m.getXHRWithCredentialsForType(u.type);O={url:U,method:j,withCredentials:H,request:u,onload:function(){O.response.status>=200&&O.response.status<=299&&(x(!0),e.success&&e.success(O.response.response,O.response.statusText,O.response.responseURL),e.complete&&e.complete(u,O.response.statusText))},onend:P,onerror:P,progress:function(t){var n=new Date;d&&(d=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(u.firstByteDate=n)),t.lengthComputable&&(u.bytesLoaded=t.loaded,u.bytesTotal=t.total),t.noTrace||(c.push({s:_,d:t.time?t.time:n.getTime()-_.getTime(),b:[t.loaded?t.loaded-I:0]}),_=n,I=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(u)},ontimeout:function(e){var t=void 0;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";L.warn(t)},loader:k,timeout:b,headers:F};var K=(new Date).getTime();if(isNaN(u.delayLoadingTime)||K>=u.delayLoadingTime)w.push(O),k.load(O);else{var V={httpRequest:O};R.push(V),V.delayTimeout=setTimeout((function(){if(-1!==R.indexOf(V)){R.splice(R.indexOf(V),1);try{v=new Date,_=v,w.push(V.httpRequest),k.load(V.httpRequest)}catch(e){V.httpRequest.onerror()}}}),u.delayLoadingTime-K)}}return I={load:function(e){e.request?N(e,m.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){D.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),D=[],R.forEach((function(e){return clearTimeout(e.delayTimeout)})),R=[],w.forEach((function(e){e.request.type!==a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),w=[]}},L=(0,c.default)(n).getInstance().getLogger(I),w=[],R=[],D=[],M=(0,u.default)(n).getInstance(),v(t={},a.HTTPRequest.MPD_TYPE,_.DOWNLOAD_ERROR_ID_MANIFEST_CODE),v(t,a.HTTPRequest.XLINK_EXPANSION_TYPE,_.DOWNLOAD_ERROR_ID_XLINK_CODE),v(t,a.HTTPRequest.INIT_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),v(t,a.HTTPRequest.MEDIA_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),v(t,a.HTTPRequest.INDEX_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),v(t,a.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),v(t,a.HTTPRequest.OTHER_TYPE,_.DOWNLOAD_ERROR_ID_CONTENT_CODE),C=t,I}m.__dashjs_factory_name="HTTPLoader";var y=o.default.getClassFactory(m);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(23)),a=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=this.context,n=e.requestModifier,r=e.boxParser,o=(0,i.default)(t).getInstance();function s(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function u(e,t,n,r,i){switch(e){case a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING:return function(e,t){try{var n,r;n=e.filter((function(t,n){return n>0&&n<e.length-1})),r=t.filter((function(e,n){return n>0&&n<t.length-1}));var i=0;if(n.length>1){for(var a=0;a<n.length;a++)if(n[a]&&r[a]){var o=r[a].ts-n[a].ts;i+=o}return i}return null}catch(e){return null}}(t,n);case a.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA:default:return l(r,i)}}function l(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var o=a.ts-t.ts;n+=o<r?o:0}})),n}return null}catch(e){return null}}return{load:function(e){var t=new Date,i=e.request,l=new Headers;if(i.range&&l.append("Range","bytes="+i.range),e.headers)for(var c in e.headers){var d=e.headers[c];d&&l.append(c,d)}i.requestStartDate||(i.requestStartDate=t),n&&n.modifyRequestHeader({setRequestHeader:function(e,t){l.append(e,t)}});var f=void 0;"function"==typeof window.AbortController&&(f=new AbortController,e.abortController=f,f.signal.onabort=e.onabort);var h={method:e.method,headers:l,credentials:e.withCredentials?"include":void 0,signal:f?f.signal:void 0};fetch(e.url,h).then((function(t){e.response||(e.response={}),e.response.status=t.status,e.response.statusText=t.statusText,e.response.responseURL=t.url,t.ok||e.onerror();var n="",i=!0,l=!1,c=void 0;try{for(var d,f=t.headers.keys()[Symbol.iterator]();!(i=(d=f.next()).done);i=!0){var h=d.value;n+=h+": "+t.headers.get(h)+"\r\n"}}catch(e){l=!0,c=e}finally{try{!i&&f.return&&f.return()}finally{if(l)throw c}}if(e.response.responseHeaders=n,!t.body)return t.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var p=parseInt(t.headers.get("Content-Length"),10),g=0,v=!1,m=new Uint8Array,y=0;e.reader=t.body.getReader();var E=[],T=[],_=[],b=!0,S=o.get().streaming.abr.fetchThroughputCalculationMode;s(e,(function t(n){var i=n.value;if(n.done)return m&&(e.progress({loaded:g,total:isNaN(p)?g:p,lengthComputable:!0,time:u(S,T,_,E,g),stream:!0}),e.response.response=m.buffer),e.onload(),void e.onend();if(i&&i.length>0){if(m=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(m,i),g+=i.length,E.push({ts:Date.now(),bytes:i.length}),S===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&b)r.findLastTopIsoBoxCompleted(["moof"],m,y).found&&(b=!1,T.push({ts:performance.now(),bytes:i.length}));var o=r.findLastTopIsoBoxCompleted(["moov","mdat"],m,y);if(o.found){var l=o.lastCompletedOffset+o.size;S===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(b=!0,_.push({ts:performance.now(),bytes:m.length}));var c=void 0;l===m.length?(c=m,m=new Uint8Array):(c=new Uint8Array(m.subarray(0,l)),m=m.subarray(l)),e.progress({data:c.buffer,lengthComputable:!1,noTrace:!0}),y=0}else y=o.lastCompletedOffset,v||(e.progress({lengthComputable:!1,noTrace:!0}),v=!0)}s(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:u}}s.__dashjs_factory_name="FetchLoader";var u=r.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(9),o=(r=a)&&r.__esModule?r:{default:r};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}return i(e,[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==o.default.BASE_URL&&this.segmentInfoType!==o.default.SEGMENT_BASE&&!this.indexRange}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null};r.DEFAULT_ID="defaultId",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}},function(e,t,n){"use strict";var r=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var o,s,u,l=r(t),c=r(n);if(l&&c){if((s=t.length)!=n.length)return!1;for(o=s;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(l!=c)return!1;var d=t instanceof Date,f=n instanceof Date;if(d!=f)return!1;if(d&&f)return t.getTime()==n.getTime();var h=t instanceof RegExp,p=n instanceof RegExp;if(h!=p)return!1;if(h&&p)return t.toString()==n.toString();var g=i(t);if((s=g.length)!==i(n).length)return!1;for(o=s;0!=o--;)if(!a.call(n,g[o]))return!1;for(o=s;0!=o--;)if(!e(t[u=g[o]],n[u]))return!1;return!0}return t!=t&&n!=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(16);var a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);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.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.checkForExistenceOnly=!0,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)}(t,e),t}(((r=i)&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(0)),i=l(n(1)),a=l(n(176)),o=l(n(57)),s=l(n(79)),u=n(22);function l(e){return e&&e.__esModule?e:{default:e}}function c(e){var t,n=this.context,r=e.streamInfo,l=void 0;function c(){l&&l.reset()}return t={getStreamId:function(){return r.id},provide:function(e,t){if("function"==typeof t){var n,r=l.getCurrentTrack(),i=void 0;if(!r||r.segmentDuration<=0||null==e)t(null);else{isNaN(r.segmentDuration)&&(i=l.getThumbnailRequestForTime(e))&&(r.segmentDuration=i.duration),n=e%r.segmentDuration;var o=Math.floor(n*r.tilesHor*r.tilesVert/r.segmentDuration),s=new a.default;if(s.width=Math.floor(r.widthPerTile),s.height=Math.floor(r.heightPerTile),s.x=Math.floor(o%r.tilesHor)*r.widthPerTile,s.y=Math.floor(o/r.tilesHor)*r.heightPerTile,"readThumbnail"in r)return r.readThumbnail(e,(function(e){s.url=e,t(s)}));if(i)s.url=i.url,r.segmentDuration=NaN;else{var c=Math.floor(e/r.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=(0,u.replaceTokenForTemplate)(e.templateUrl,"Number",n);return r=(0,u.replaceTokenForTemplate)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,u.replaceTokenForTemplate)(r,"Bandwidth",e.bandwidth),(0,u.unescapeDollarsInTemplate)(r)}(r,c)}t(s)}}},setTrackByIndex:function(e){l.setTrackByIndex(e)},getCurrentTrackIndex:function(){return l.getCurrentTrackIndex()},getBitrateList:function(){var e=l.getTracks(),t=0;return e.map((function(e){var n=new s.default;return n.mediaType=i.default.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:c},c(),l=(0,o.default)(n).create({streamInfo:r,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants}),t}c.__dashjs_factory_name="ThumbnailController",t.default=r.default.getClassFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(6)),i=n(8),a=d(n(3)),o=d(n(5)),s=d(n(11)),u=d(n(0)),l=d(n(2)),c=d(n(13));function d(e){return e&&e.__esModule?e:{default:e}}function f(){var e=this.context,t=(0,a.default)(e).getInstance(),n=(0,c.default)(e).getInstance(),u=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0,S=void 0,A=void 0;function I(){m=[],y=[],E=null,T=null,b=null,_=NaN,f=!1,h=!1,S=p.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function w(){f||h||!b||!b.value||!b.schemeIdUri||isNaN(_)||isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)||(T&&(Date.now()-T)/1e3<30||(m=[],h=!0,function e(t){try{if(t<=0)return void U();var n=Date.now();g[b.schemeIdUri](b.value,(function(r){var i=Date.now(),a=R(n,i,r);m.push(a),e(t-1)}),(function(){U()}))}catch(e){U()}}(isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)?2:p.get().streaming.utcSynchronization.backgroundAttempts)))}function R(e,t,n){return n-(t-(t-e)/2)}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&p.get().streaming.useManifestDateHeaderTimeSource?k():F(t,e)}function C(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t=void 0,n=void 0,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function M(e){return Date.parse(e)}function L(e){return Date.parse(e)}function N(e,t,n){n()}function O(e,t,n){var r=C(e);isNaN(r)?n():t(r)}function x(e,t,r,a,o){var s,u,l=!1,c=new XMLHttpRequest,d=o?i.HTTPRequest.HEAD:i.HTTPRequest.GET,f=t.match(/\S+/g);if(t=f.shift(),s=function(){l||(l=!0,f.length?x(e,f.join(" "),r,a,o):a())},u=function(){var t=void 0,n=void 0;200===c.status&&(t=o?c.getResponseHeader("Date"):c.response,n=e(t),isNaN(n)||(r(n),l=!0))},n.isRelative(t)){var h=A.resolve();h&&(t=n.resolve(t,h.url))}c.open(d,t),c.timeout=5e3,c.onload=u,c.onloadend=s,c.send()}function P(e,t,n){x(L,e,t,n,!0)}function k(){var e=v.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?F(!0):F(!1,t-Date.now())}function F(e,n){if(isNaN(_)||isNaN(n)||e||function(e){try{var t=B(e),n=isNaN(S)?30:S,r=isNaN(p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,i=isNaN(p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,a=isNaN(p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts,o=void 0;t?(o=Math.min(n*r,i),d.debug("Increasing timeBetweenSyncAttempts to "+o)):(o=Math.max(n/r,a),d.debug("Decreasing timeBetweenSyncAttempts to "+o)),S=o}catch(e){}}(n),!e&&!isNaN(n)){E=Date.now(),f=!1;var i=isNaN(_);_=n,i&&w(),d.debug("Completed UTC sync. Setting client - server offset to "+n)}e&&(b=null),t.trigger(o.default.UPDATE_TIME_SYNC_OFFSET,{offset:n,error:e?new r.default(s.default.TIME_SYNC_FAILED_ERROR_CODE,s.default.TIME_SYNC_FAILED_ERROR_MESSAGE):null}),t.trigger(o.default.TIME_SYNCHRONIZATION_COMPLETED)}function U(){if(m&&0!==m.length){var e=m.reduce((function(e,t){return e+t}),0)/m.length;B(e)?d.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(d.debug("Completed background UTC sync. Setting client - server offset to "+e),_=e,t.trigger(o.default.UPDATE_TIME_SYNC_OFFSET,{offset:_})),h=!1,T=Date.now()}}function B(e){try{if(isNaN(_))return!0;var t=p.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(p.get().streaming.utcSynchronization.maximumAllowedDrift)?p.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=_-t&&e<=_+t}catch(e){return!0}}return u={initialize:function(){I(),g={"urn:mpeg:dash:utc:http-head:2014":P,"urn:mpeg:dash:utc:http-xsdate:2014":x.bind(null,C),"urn:mpeg:dash:utc:http-iso:2014":x.bind(null,M),"urn:mpeg:dash:utc:direct:2014":O,"urn:mpeg:dash:utc:http-head:2012":P,"urn:mpeg:dash:utc:http-xsdate:2012":x.bind(null,C),"urn:mpeg:dash:utc:http-iso:2012":x.bind(null,M),"urn:mpeg:dash:utc:direct:2012":O,"urn:mpeg:dash:utc:http-ntp:2014":N,"urn:mpeg:dash:utc:ntp:2014":N,"urn:mpeg:dash:utc:sntp:2014":N}},attemptSync:function(e){y=e,f||(!function(){try{var e=isNaN(S)?30:S;return!(E&&e&&!isNaN(e))||(Date.now()-E)/1e3>=e}catch(e){return!0}}()?t.trigger(o.default.TIME_SYNCHRONIZATION_COMPLETED):(f=!0,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||0;if(!y||0===y.length||n>=y.length)return void D();var r=y[n];if(r)if(g.hasOwnProperty(r.schemeIdUri)){var i=(new Date).getTime();g[r.schemeIdUri](r.value,(function(e){var t=(new Date).getTime(),n=R(i,t,e);b=r,D(n)}),(function(){e(n+1)}))}else e(n+1);else D()}()))},setConfig:function(e){e&&(e.dashMetrics&&(v=e.dashMetrics),e.baseURLController&&(A=e.baseURLController),e.settings&&(p=e.settings))},reset:function(){I(),t.off(o.default.ATTEMPT_BACKGROUND_SYNC,w,u)}},d=(0,l.default)(e).getInstance().getLogger(u),t.on(o.default.ATTEMPT_BACKGROUND_SYNC,w,u),u}f.__dashjs_factory_name="TimeSyncController";var h=u.default.getSingletonFactory(f);h.HTTP_TIMEOUT_MS=5e3,u.default.updateSingletonFactory(f.__dashjs_factory_name,h),t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0,t=void 0,n=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?new MediaSource:e?new WebKitMediaSource:null},attachMediaSource:function(e,t){var n=window.URL.createObjectURL(e);return t.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(n,r){n&&"open"===n.readyState&&(null===r&&isNaN(r)||n.duration!==r&&(!function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(n)?(t.info("Set MediaSource duration:"+r),n.duration=r):setTimeout(e.bind(null,n,r),50)))},setSeekable:function(e,t,n){e&&"function"==typeof e.setLiveSeekableRange&&"function"==typeof e.clearLiveSeekableRange&&"open"===e.readyState&&t>=0&&t<n&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(t,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var n=e.sourceBuffers,r=0;r<n.length;r++){if(n[r].updating)return;if(0===n[r].buffered.length)return}t.info("call to mediaSource endOfStream"),e.endOfStream()}}},t=(0,i.default)(n).getInstance().getLogger(e),e}o.__dashjs_factory_name="MediaSourceController",t.default=r.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(0)),i=u(n(2)),a=u(n(3)),o=u(n(20)),s=u(n(55));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e="discarded",t="updated",n="added",r=this.context,u=(0,a.default)(r).getInstance(),l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0;function T(){if(!g||!v)throw new Error("setConfig function has to be called previously")}function _(){E=!1,d={},f={},h=null,y=!1,p=Date.now()/1e3}function b(){try{null!==h&&E&&(clearInterval(h),h=null,E=!1,function(){try{R(f),R(d)}catch(e){}}())}catch(e){throw e}}function S(r,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.eventStream.schemeIdUri,s=r.eventStream.value,u=r.id,l=e;i[o]||(i[o]=[]);var c=i[o].findIndex((function(e){return(!s||e.eventStream.value&&e.eventStream.value===s)&&e.id===u}));return-1===c?(i[o].push(r),l=n):a&&(i[o][c]=r,l=t),l}function A(e){try{if(1==e.eventStream.value){var t=e.calculatedPresentationTime,n=void 0;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,u.trigger(o.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:t,newDuration:n,newManifestValidAfter:NaN},{mode:o.default.EVENT_MODE_ON_START})}}catch(e){}}function I(){try{if(!y){y=!0;var e=v.getTime(),t=e-p;t=p>0?Math.max(0,t):0,w(f,t,e),w(d,t,e),p=e,y=!1}}catch(e){y=!1}}function w(e,t,n){try{D(e,(function(r){if(void 0!==r){var i=isNaN(r.duration)?0:r.duration;r.calculatedPresentationTime<=n&&r.calculatedPresentationTime+t+i>=n?C(r,e,o.default.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(n,i+t,r.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(r))&&(c.debug("Deleting event "+r.id+" as it is expired or invalid"),M(e,r))}}))}catch(e){}}function R(e){try{var t=v.getTime();D(e,function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<300&&C(n,e,o.default.EVENT_MODE_ON_START)}}())}catch(e){}}function D(e,t){try{if(e)for(var n=Object.keys(e),r=0;r<n.length;r++){e[n[r]].forEach((function(e){void 0!==e&&t(e)}))}}catch(e){}}function C(e,t,n){try{var i=v.getTime(),a=e.id;if(n===o.default.EVENT_MODE_ON_RECEIVE)return c.debug("Received event "+a),void u.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});"urn:mpeg:dash:event:2012"===e.eventStream.schemeIdUri&&1===e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(c.debug("Starting manifest refresh event "+a+" at "+i),M(t,e),function(){try{T(),g.refreshManifest()}catch(e){}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1===e.eventStream.value?(c.debug("Starting callback event "+a+" at "+i),M(t,e),function(e){try{(0,s.default)(r).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(c.debug("Starting event "+a+" at "+i),M(t,e),u.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n}))}catch(e){}}function M(e,t){var n=t.eventStream.schemeIdUri,r=t.eventStream.value,i=t.id;e[n]=e[n].filter((function(e){return r&&e.eventStream.value&&e.eventStream.value!==r||e.id!==i})),0===e[n].length&&delete e[n]}return l={addInlineEvents:function(e){try{if(T(),e)for(var r=0;r<e.length;r++){var i=e[r],a=S(i,d,!0);a===n?(c.debug("Added inline event with id "+i.id),C(i,e,o.default.EVENT_MODE_ON_RECEIVE)):a===t&&c.debug("Updated inline event with id "+i.id)}c.debug("Added "+e.length+" inline events")}catch(e){throw e}},addInbandEvents:function(e){try{T();for(var t=0;t<e.length;t++){var r=e[t];S(r,f,!1)===n?("urn:mpeg:dash:event:2012"===r.eventStream.schemeIdUri&&void 0===f[r.id]&&A(r),c.debug("Added inband event with id "+r.id),C(r,e,o.default.EVENT_MODE_ON_RECEIVE)):c.debug("Inband event with scheme_id_uri "+r.eventStream.schemeIdUri+", value "+r.eventStream.value+" and id "+r.id+" was ignored because it has been added before.")}I()}catch(e){throw e}},getInbandEvents:function(){return f},getInlineEvents:function(){return d},start:function(){try{T(),c.debug("Start Event Controller");var e=m.get().streaming.eventControllerRefreshDelay;E||isNaN(e)||(E=!0,h=setInterval(I,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(g=e.manifestUpdater),e.playbackController&&(v=e.playbackController),e.settings&&(m=e.settings)}catch(e){throw e}},reset:function(){b(),_()}},c=(0,i.default)(r).getInstance().getLogger(l),_(),l}l.__dashjs_factory_name="EventController",t.default=r.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(0)),i=s(n(2)),a=s(n(5)),o=s(n(3));function s(e){return e&&e.__esModule?e:{default:e}}function u(){var e=this.context,t=(0,o.default)(e).getInstance(),n=void 0,r=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0;function v(){g.debug("Stopping the gap controller"),l&&(clearInterval(l),l=null),function(){t.off(a.default.WALLCLOCK_TIME_UPDATED,E,this),t.off(a.default.PLAYBACK_SEEKING,y,this),t.off(a.default.BYTES_APPENDED_END_FRAGMENT,m,n)}(),l=null,c=NaN,u=0,p=null}function m(){l||function(){try{l||(g.debug("Starting the gap controller"),l=setInterval((function(){T()&&b(d.getTime())}),100))}catch(e){}}()}function y(){p&&(clearTimeout(p),p=null)}function E(){if(T()&&++u>=30){var e=d.getTime();r===e?b(e,!0):(r=e,c=NaN),u=0}}function T(){return s.get().streaming.jumpGaps&&f.getActiveStreamProcessors().length>0&&(!d.isSeeking()||f.hasStreamFinishedBuffering(f.getActiveStream()))&&!d.isPaused()&&!f.getIsStreamSwitchInProgress()&&!f.getHasMediaOrIntialisationError()}function _(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var n=NaN,r=0;isNaN(n)&&r<e.length;){var i=r>0?e.end(r-1):0;t<e.start(r)&&i-t<.1&&(n=r),r+=1}return n}catch(e){return null}}function b(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=s.get().streaming.smallGapLimit,i=s.get().streaming.jumpLargeGaps,o=h.getBufferRange(),u=void 0,l=NaN,f=!1;if(u=_(o,e),!isNaN(u)){var v=o.start(u),m=v-e;m>0&&(m<=r||i)&&(l=v)}var y=d.getTimeToStreamEnd();if(isNaN(l)&&n&&isFinite(y)&&!isNaN(y)&&y<r&&(l=parseFloat(d.getStreamEndTime().toFixed(5)),f=!0),l>0&&c!==l&&l>e&&!p){var E=l-e;if(f)g.warn("Jumping to end of stream because of gap from "+e+" to "+l+". Gap duration: "+E),t.trigger(a.default.GAP_CAUSED_SEEK_TO_PERIOD_END,{seekTime:l,duration:E});else{var T=d.getIsDynamic(),b=u>0?o.end(u-1):e,S=T?1e3*E:0;p=window.setTimeout((function(){d.seek(l,!0,!0),g.warn("Jumping gap starting at "+b+" and ending at "+l+". Jumping by: "+E),t.trigger(a.default.GAP_CAUSED_INTERNAL_SEEK,{seekTime:l,duration:E}),p=null}),S)}c=l}}return n={reset:v,setConfig:function(e){e&&(e.settings&&(s=e.settings),e.playbackController&&(d=e.playbackController),e.streamController&&(f=e.streamController),e.videoModel&&(h=e.videoModel),e.timelineConverter&&e.timelineConverter,e.adapter&&e.adapter)},initialize:function(){!function(){t.on(a.default.WALLCLOCK_TIME_UPDATED,E,this),t.on(a.default.PLAYBACK_SEEKING,y,this),t.on(a.default.BYTES_APPENDED_END_FRAGMENT,m,n)}()}},g=(0,i.default)(e).getInstance().getLogger(n),v(),n}u.__dashjs_factory_name="GapController",t.default=r.default.getSingletonFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(1)),i=u(n(5)),a=u(n(3)),o=u(n(0)),s=u(n(2));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=this.context,t=(0,a.default)(e).getInstance(),n=void 0,o=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=[r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,r.default.TRACK_SWITCH_MODE_NEVER_REPLACE],h=[r.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,r.default.TRACK_SELECTION_MODE_FIRST_TRACK,r.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY,r.default.TRACK_SELECTION_MODE_WIDEST_RANGE];function p(e,t){if(!e||!t)return[];var n=t.id;return u[n]&&u[n][e]?u[n][e].list:[]}function g(e,t){return!e||!t||t&&!u[t.id]?null:u[t.id][e].current}function v(e,n){if(e&&e.streamInfo){var a=e.type,o=e.streamInfo,s=o.id,l=g(a,o);if(u[s]&&u[s][a]&&!b(e,l)&&(u[s][a].current=e,!u[s][a].current||n&&a===r.default.FRAGMENTED_TEXT||t.trigger(i.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:l,newMediaInfo:e,switchMode:E(a)}),!n)){var c=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!c||!u[s][a].storeLastSettings)return;c.roles&&(c.role=c.roles[0],delete c.roles),c.accessibility&&(c.accessibility=c.accessibility[0]),c.audioChannelConfiguration&&(c.audioChannelConfiguration=c.audioChannelConfiguration[0]),d.setSavedMediaSettings(a,c)}}}function m(e,t){e&&t&&(c[e]=t)}function y(e){return e?c[e]:null}function E(e){return l.get().streaming.trackSwitchMode[e]}function T(){return l.get().streaming.selectionModeForInitialTrack}function _(e){return e===r.default.AUDIO||e===r.default.VIDEO||e===r.default.TEXT||e===r.default.FRAGMENTED_TEXT||e===r.default.IMAGE}function b(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function S(){u={},c={audio:null,video:null,fragmentedText:null}}function A(e,t){var n=!e.lang||t.lang.match(e.lang),r=void 0===e.index||null===e.index||t.index===e.index,i=!e.viewpoint||e.viewpoint===t.viewpoint,a=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],o=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],s=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return n&&r&&i&&a&&o&&s}function I(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>t?(t=r,n=[e]):r===t&&n.push(e)})),n}function w(e){var t=1/0,n=[],r=void 0;return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(r=i/e.bitrateList.length)<t?(t=r,n=[e]):r===t&&n.push(e)})),n}function R(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=e.representationCount)>t?(t=r,n=[e]):r===t&&n.push(e)})),n}return n={checkInitialMediaSettingsForType:function(e,t){var n=y(e),r=p(e,t),i=[];n||m(e,n=d.getSavedMediaSettings(e)),r&&0!==r.length&&(n&&r.forEach((function(e){A(n,e)&&i.push(e)})),0===i.length?v(this.selectInitialTrack(e,r),!0):i.length>1?v(this.selectInitialTrack(e,i)):v(i[0]))},addTrack:function(e){if(e){var t=e.type;if(_(t)){var n=e.streamInfo.id;u[n]||(u[n]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var r=u[n][t].list,i=0,a=r.length;i<a;++i)if(b(r[i],e))return;r.push(e);var o=y(t);o&&A(o,e)&&!g(t,e.streamInfo)&&v(e)}}},getTracksFor:p,getCurrentTrackFor:g,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,n=e.streamInfo.id;return u[n]&&u[n][t]&&b(u[n][t].current,e)},setTrack:v,setInitialSettings:m,getInitialSettings:y,setSwitchMode:function(e,t){if(o.warn("deprecated: Please use updateSettings({streaming: { trackSwitchMode: mode } }) instead"),-1!==f.indexOf(t)){var n={};n[e]=t,l.update({streaming:{trackSwitchMode:n}})}else o.warn("Track switch mode is not supported: "+t)},getSwitchMode:E,selectInitialTrack:function(e,t){if(e===r.default.FRAGMENTED_TEXT)return t[0];var n=T(),i=[];switch(n){case r.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:(i=I(t)).length>1&&(i=R(i));break;case r.default.TRACK_SELECTION_MODE_FIRST_TRACK:i.push(t[0]);break;case r.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:(i=w(t)).length>1&&(i=I(i));break;case r.default.TRACK_SELECTION_MODE_WIDEST_RANGE:(i=R(t)).length>1&&(i=I(t));break;default:o.warn("Track selection mode is not supported: "+n)}return i[0]},getTracksWithHighestBitrate:I,getTracksWithHighestEfficiency:w,getTracksWithWidestRange:R,setSelectionModeForInitialTrack:function(e){o.warn("deprecated: Please use updateSettings({streaming: { selectionModeForInitialTrack: mode } }) instead"),-1!==h.indexOf(e)?l.update({streaming:{selectionModeForInitialTrack:e}}):o.warn("Track selection mode is not supported: "+e)},getSelectionModeForInitialTrack:T,isMultiTrackSupportedByType:_,isTracksEqual:b,matchSettings:A,saveTextSettingsDisabled:function(){d.setSavedMediaSettings(r.default.FRAGMENTED_TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(d=e.domStorage),e.settings&&(l=e.settings))},reset:S},o=(0,s.default)(e).getInstance().getLogger(n),S(),n}l.__dashjs_factory_name="MediaController";var c=o.default.getSingletonFactory(l);o.default.updateSingletonFactory(l.__dashjs_factory_name,c),t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(183)),i=c(n(184)),a=c(n(13)),o=c(n(85)),s=c(n(0)),u=c(n(3)),l=c(n(5));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=void 0,t=void 0,n=this.context,s=(0,u.default)(n).getInstance(),c=(0,a.default)(n).getInstance(),d=void 0,f=void 0;function h(e){d.invalidateSelectedIndexes(e.entry)}return e={reset:function(){d.reset(),f.reset()},initialize:function(e){var n;d.setConfig({adapter:t}),n=e,d.update(n),f.chooseSelector(t.getIsDVB(n))},resolve:function(e){var t=d.getForPath(e).reduce((function(e,t){var n=f.select(t);return n?(c.isRelative(n.url)?e.url=c.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new o.default}),new o.default);if(!c.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(d=e.baseURLTreeModel),e.baseURLSelector&&(f=e.baseURLSelector),e.adapter&&(t=e.adapter)}},d=(0,r.default)(n).create(),f=(0,i.default)(n).create(),s.on(l.default.SERVICE_LOCATION_BLACKLIST_CHANGED,h,e),e}d.__dashjs_factory_name="BaseURLController",t.default=s.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(86)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}var o=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||NaN},this.children=[]};function s(){var e,t=void 0,n=void 0,i=this.context,a=(0,r.default)(i).getInstance();function s(e,t,r){var i=n.getBaseURLsFromElement(r);e[t]?a.areEqual(i,e[t].data.baseUrls)||(e[t].data.baseUrls=i,e[t].data.selectedIdx=NaN):e[t]=new o(i)}function u(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=n.getBaseURLsFromElement(e);a.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=NaN),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){s(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){s(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){s(t.children[r].children[i].children,n,e)}))}))}))}function l(){t=new o}return e={reset:l,update:function(e){u(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){!function e(n,r){var i=r||t;n(i.data),i.children&&i.children.forEach((function(t){return e(n,t)}))}((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=NaN)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},l(),e}s.__dashjs_factory_name="BaseURLTreeModel",t.default=i.default.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(11)),i=f(n(3)),a=f(n(5)),o=f(n(185)),s=f(n(186)),u=f(n(187)),l=f(n(0)),c=f(n(6)),d=n(15);function f(e){return e&&e.__esModule?e:{default:e}}function h(){var e,t=this.context,n=(0,i.default)(t).getInstance(),l=void 0,f=void 0,h=void 0,p=void 0;function g(){l.reset()}return e={chooseSelector:function(e){(0,d.checkParameterType)(e,"boolean"),p=e?h:f},select:function(e){if(e){var t=e.baseUrls,i=e.selectedIdx;if(!isNaN(i))return t[i];var o=p.select(t);return o?(e.selectedIdx=t.indexOf(o),o):(n.trigger(a.default.URL_RESOLUTION_FAILED,{error:new c.default(r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(p===f&&g()))}},reset:g,setConfig:function(e){e.selector&&(p=e.selector)}},l=(0,o.default)(t).create({updateEventName:a.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:a.default.SERVICE_LOCATION_BLACKLIST_ADD}),f=(0,u.default)(t).create({blacklistController:l}),h=(0,s.default)(t).create({blacklistController:l}),p=f,e}h.__dashjs_factory_name="BaseURLSelector",t.default=l.default.getClassFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){e=e||{};var t=void 0,n=[],r=(0,i.default)(this.context).getInstance(),a=e.updateEventName,o=e.addBlacklistEventName;function s(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(a,{entry:e}))}function u(e){s(e.entry)}return t={add:s,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},o&&r.on(o,u,t),t}o.__dashjs_factory_name="BlackListController",t.default=r.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t=0,n=[],r=0,i=void 0,a=void 0;if((a=e.sort((function(e,t){var n=e.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return a.length>1&&(a.forEach((function(e){t+=e.dvb_weight,n.push(t)})),i=Math.floor(Math.random()*(t-1)),n.every((function(e,t){return r=t,!(i<e)}))),a[r]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}o.__dashjs_factory_name="DVBSelector",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n=0,r=void 0;return e&&e.some((function(e,r){return n=r,!t.contains(e.serviceLocation)}))&&(r=e[n]),r}}}o.__dashjs_factory_name="BasicSelector",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(1)),i=v(n(9)),a=v(n(189)),o=v(n(29)),s=v(n(13)),u=v(n(88)),l=v(n(6)),c=n(8),d=v(n(3)),f=v(n(5)),h=v(n(11)),p=v(n(0)),g=v(n(191));function v(e){return e&&e.__esModule?e:{default:e}}function m(e){e=e||{};var t=this.context,n=e.debug,p=(0,d.default)(t).getInstance(),v=(0,s.default)(t).getInstance(),m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=e.mssHandler,S=e.errHandler;function A(e){p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return m={load:function(e){var i=new u.default(e,c.HTTPRequest.MPD_TYPE);E.load({request:i,success:function(i,a,o){if(T){var s=void 0,u=void 0,c=void 0;if(o&&o!==e?(u=v.parseBaseUrl(o),s=o):(v.isRelative(e)&&(e=v.resolve(e,window.location.href)),u=v.parseBaseUrl(e)),"No Content"!=a)if(null===_&&(_=function(e){var r=null;return e.indexOf("SmoothStreamingMedia")>-1?(b&&(r=b.createMssParser(),b.registerEvents()),r):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?(0,g.default)(t).create({debug:n}):r}(i)),null!==_){T.setMatchers(_.getMatchers()),T.setIron(_.getIron());try{c=_.parse(i)}catch(t){return void p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}c?(c.url=s||e,c.originalUrl||(c.originalUrl=c.url),c.hasOwnProperty(r.default.LOCATION)&&(u=v.parseBaseUrl(c.Location_asArray[0]),y.debug("BaseURI set by Location to: "+u)),c.baseUri=u,c.loadedTime=new Date,T.resolveManifestOnLoad(c),p.trigger(f.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:i})):p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}else p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)});else p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null})}},error:function(t,n,r){p.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+(e+", ")+r)})}})},reset:function(){p.off(f.default.XLINK_READY,A,m),b&&b.reset(),T&&(T.reset(),T=null),E&&(E.abort(),E=null)}},y=n.getLogger(m),p.on(f.default.XLINK_READY,A,m),E=(0,o.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:v,constants:r.default,dashConstants:i.default,errors:h.default}),T=(0,a.default)(t).create({errHandler:S,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),_=null,m}m.__dashjs_factory_name="ManifestLoader";var y=p.default.getClassFactory(m);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(190)),i=c(n(3)),a=c(n(5)),o=c(n(0)),s=c(n(89)),u=c(n(13)),l=c(n(9));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=(0,i.default)(t).getInstance(),o=(0,u.default)(t).getInstance(),c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0;function v(e,t,n){var r={},i=void 0,a=void 0;r.elements=e,r.type=t,r.resolveType=n,0===r.elements.length&&y(r);for(var s=0;s<r.elements.length;s++)i=r.elements[s],a=o.isHTTPURL(i.url)?i.url:i.originalContent.BaseURL+i.url,g.load(a,i,r)}function m(e){var t,n=void 0,r="";if(n=e.element,t=e.resolveObject,n.resolvedContent){var i=0;0===n.resolvedContent.indexOf("<?xml")&&(i=n.resolvedContent.indexOf("?>")+2),r=n.resolvedContent.substr(0,i)+"<response>"+n.resolvedContent.substr(i)+"</response>",n.resolvedContent=p.xml_str2json(r)}(function(e){var t=void 0;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(t)&&y(t)}function y(e){var t=[],r=void 0,i=void 0;if(function(e){var t=[],n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;for(a=e.elements.length-1;a>=0;a--){if(n=e.elements[a],r=n.type+"_asArray",n.resolvedContent){if(n.resolvedContent)for(o=0;o<n.resolvedContent[r].length;o++)i=n.resolvedContent[r][o],t.push(i)}else delete n.originalContent["xlink:actuate"],delete n.originalContent["xlink:href"],t.push(n.originalContent);for(n.parentElement[r].splice(n.index,1),s=0;s<t.length;s++)n.parentElement[r].splice(n.index+s,0,t[s]);t=[]}e.elements.length>0&&f.run(h)}(e),"onActuate"===e.resolveType&&n.trigger(a.default.XLINK_READY,{manifest:h}),"onLoad"===e.resolveType)switch(e.type){case l.default.PERIOD:for(r=0;r<h[l.default.PERIOD+"_asArray"].length;r++)(i=h[l.default.PERIOD+"_asArray"][r]).hasOwnProperty(l.default.ADAPTATION_SET+"_asArray")&&(t=t.concat(E(i[l.default.ADAPTATION_SET+"_asArray"],i,l.default.ADAPTATION_SET,"onLoad"))),i.hasOwnProperty(l.default.EVENT_STREAM+"_asArray")&&(t=t.concat(E(i[l.default.EVENT_STREAM+"_asArray"],i,l.default.EVENT_STREAM,"onLoad")));v(t,l.default.ADAPTATION_SET,"onLoad");break;case l.default.ADAPTATION_SET:n.trigger(a.default.XLINK_READY,{manifest:h})}}function E(e,t,n,r){var i=[],a=void 0,o=void 0,s=void 0;for(o=e.length-1;o>=0;o--)(a=e[o]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===a["xlink:href"]&&e.splice(o,1);for(o=0;o<e.length;o++)(a=e[o]).hasOwnProperty("xlink:href")&&a.hasOwnProperty("xlink:actuate")&&a["xlink:actuate"]===r&&(s=T(a["xlink:href"],t,n,o,r,a),i.push(s));return i}function T(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return c={resolveManifestOnLoad:function(e){p=new s.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:d}),(h=e).Period_asArray?v(E(h.Period_asArray,h,l.default.PERIOD,"onLoad"),l.default.PERIOD,"onLoad"):n.trigger(a.default.XLINK_READY,{manifest:h})},setMatchers:function(e){e&&(d=e)},setIron:function(e){e&&(f=e)},reset:function(){n.off(a.default.XLINK_ELEMENT_LOADED,m,c),g&&(g.reset(),g=null)}},n.on(a.default.XLINK_ELEMENT_LOADED,m,c),g=(0,r.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),c}d.__dashjs_factory_name="XlinkController",t.default=o.default.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(6)),i=d(n(29)),a=n(8),o=d(n(88)),s=d(n(3)),u=d(n(5)),l=d(n(0)),c=d(n(11));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t=this.context,n=(0,s.default)(t).getInstance(),l=(0,i.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings?e.settings.get().streaming.lowLatencyEnabled:null,errors:c.default});return{load:function(e,t,i){var s=function(a,o){t.resolved=!0,t.resolvedContent=a||null,n.trigger(u.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:a||o?null:new r.default(c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)s(null,!0);else{var d=new o.default(e,a.HTTPRequest.XLINK_EXPANSION_TYPE);l.load({request:d,success:function(e){s(e)},error:function(){s(null)}})}},reset:function(){l&&(l.abort(),l=null)}}}f.__dashjs_factory_name="XlinkLoader",t.default=l.default.getClassFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(0)),i=f(n(192)),a=f(n(89)),o=f(n(193)),s=f(n(194)),u=f(n(195)),l=f(n(196)),c=f(n(197)),d=f(n(199));function f(e){return e&&e.__esModule?e:{default:e}}function h(e){e=e||{};var t=this.context,n=e.debug,r=void 0,f=void 0,h=void 0,p=void 0,g=void 0;return r={parse:function(e){var t=void 0,n=window.performance.now();if(!(t=p.xml_str2json(e)))throw new Error("parsing the manifest failed");var r=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return g.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return g.run(e)}))):(t=t.MPD,g.run(t));var i=window.performance.now();return f.info("Parsing complete: ( xml2json: "+(r-n).toPrecision(3)+"ms, objectiron: "+(i-r).toPrecision(3)+"ms, total: "+((i-n)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return h},getIron:function(){return g}},f=n.getLogger(r),h=[new s.default,new u.default,new l.default,new o.default],p=new a.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:h}),g=(0,i.default)(t).create({adaptationset:new c.default,period:new d.default}),r}h.__dashjs_factory_name="DashParser",t.default=r.default.getClassFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=n(0),o=(r=a)&&r.__esModule?r:{default:r};function s(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var a=0,o=e.length;a<o;++a){var s=e[a];if(n[s.name])if(r[s.name]){if(s.merge){var u=n[s.name],l=r[s.name];"object"===(void 0===u?"undefined":i(u))&&"object"===(void 0===l?"undefined":i(l))?t(u,l):r[s.name]=u+l}}else r[s.name]=n[s.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var o=e.children[i],s=t[o.name+"_asArray"];if(s)for(var u=0,l=s.length;u<l;++u){var c=s[u];n(e.properties,t,c),r(o,c)}}}return{run:function(t){if(null===t||"object"!==(void 0===t?"undefined":i(t)))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,a=t.Period_asArray,o=0,s=a.length;o<s;++o){var u=a[o];if(r(n,u),"adaptationset"in e){var l=u.AdaptationSet_asArray;if(l)for(var c=e.adaptationset,d=0,f=l.length;d<f;++d)r(c,l[d])}}return t}}}s.__dashjs_factory_name="ObjectIron";var u=o.default.getClassFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(39)),i=a(n(9));function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e,t){var n,r=(o(n={},i.default.MPD,[i.default.ID,i.default.PROFILES]),o(n,i.default.PERIOD,[i.default.ID]),o(n,i.default.BASE_URL,[i.default.SERVICE_LOCATION,i.default.BYTE_RANGE]),o(n,i.default.SEGMENT_BASE,[i.default.INDEX_RANGE]),o(n,i.default.INITIALIZATION,[i.default.RANGE]),o(n,i.default.REPRESENTATION_INDEX,[i.default.RANGE]),o(n,i.default.SEGMENT_LIST,[i.default.INDEX_RANGE]),o(n,i.default.BITSTREAM_SWITCHING,[i.default.RANGE]),o(n,i.default.SEGMENT_URL,[i.default.MEDIA_RANGE,i.default.INDEX_RANGE]),o(n,i.default.SEGMENT_TEMPLATE,[i.default.INDEX_RANGE,i.default.MEDIA,i.default.INDEX,i.default.INITIALIZATION_MINUS,i.default.BITSTREAM_SWITCHING_MINUS]),o(n,i.default.ASSET_IDENTIFIER,[i.default.VALUE,i.default.ID]),o(n,i.default.EVENT_STREAM,[i.default.VALUE]),o(n,i.default.ADAPTATION_SET,[i.default.PROFILES,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.CONTENT_TYPE]),o(n,i.default.FRAME_PACKING,[i.default.VALUE,i.default.ID]),o(n,i.default.AUDIO_CHANNEL_CONFIGURATION,[i.default.VALUE,i.default.ID]),o(n,i.default.CONTENT_PROTECTION,[i.default.VALUE,i.default.ID]),o(n,i.default.ESSENTIAL_PROPERTY,[i.default.VALUE,i.default.ID]),o(n,i.default.SUPPLEMENTAL_PROPERTY,[i.default.VALUE,i.default.ID]),o(n,i.default.INBAND_EVENT_STREAM,[i.default.VALUE,i.default.ID]),o(n,i.default.ACCESSIBILITY,[i.default.VALUE,i.default.ID]),o(n,i.default.ROLE,[i.default.VALUE,i.default.ID]),o(n,i.default.RATING,[i.default.VALUE,i.default.ID]),o(n,i.default.VIEWPOINT,[i.default.VALUE,i.default.ID]),o(n,i.default.CONTENT_COMPONENT,[i.default.CONTENT_TYPE]),o(n,i.default.REPRESENTATION,[i.default.ID,i.default.DEPENDENCY_ID,i.default.MEDIA_STREAM_STRUCTURE_ID]),o(n,i.default.SUBSET,[i.default.ID]),o(n,i.default.METRICS,[i.default.METRICS_MINUS]),o(n,i.default.REPORTING,[i.default.VALUE,i.default.ID]),n);if(r.hasOwnProperty(t)){var a=r[t];return void 0!==a&&a.indexOf(e.name)>=0}return!1}),(function(e){return String(e)})))}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}(r.default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(39)),i=o(n(1)),a=o(n(9));function o(e){return e&&e.__esModule?e:{default:e}}var s=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){for(var t=[a.default.MIN_BUFFER_TIME,a.default.MEDIA_PRESENTATION_DURATION,a.default.MINIMUM_UPDATE_PERIOD,a.default.TIMESHIFT_BUFFER_DEPTH,a.default.MAX_SEGMENT_DURATION,a.default.MAX_SUBSEGMENT_DURATION,a.default.SUGGESTED_PRESENTATION_DELAY,a.default.START,i.default.START_TIME,a.default.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return s.test(e.value);return!1}),(function(e){var t=s.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),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)}(t,e),t}(r.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(39),a=(r=i)&&r.__esModule?r:{default:r};var o=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return o.test(e.value)}),(function(e){var t=o.exec(e),n=void 0;if(n=Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[4],10),parseInt(t[5],10),t[6]&&parseInt(t[6],10)||0,t[7]&&1e3*parseFloat(t[7])||0),t[9]&&t[10]){var r=60*parseInt(t[9],10)+parseInt(t[10],10);n+=("+"===t[8]?-1:1)*r*60*1e3}return new Date(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)}(t,e),t}(a.default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(39),a=(r=i)&&r.__esModule?r:{default:r};var o=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),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.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return o.test(e.value)}),(function(e){return parseFloat(e)})))}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}(a.default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(90)),i=a(n(9));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[i.default.PROFILES,i.default.WIDTH,i.default.HEIGHT,i.default.SAR,i.default.FRAMERATE,i.default.AUDIO_SAMPLING_RATE,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.MAXIMUM_SAP_PERIOD,i.default.START_WITH_SAP,i.default.MAX_PLAYOUT_RATE,i.default.CODING_DEPENDENCY,i.default.SCAN_TYPE,i.default.FRAME_PACKING,i.default.AUDIO_CHANNEL_CONFIGURATION,i.default.CONTENT_PROTECTION,i.default.ESSENTIAL_PROPERTY,i.default.SUPPLEMENTAL_PROPERTY,i.default.INBAND_EVENT_STREAM];return 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.__proto__||Object.getPrototypeOf(t)).call(this,i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e,[new r.default(i.default.SUB_REPRESENTATION,e)])]))}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}(r.default);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n;this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}return r(e,[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(90)),i=a(n(9));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[i.default.SEGMENT_BASE,i.default.SEGMENT_TEMPLATE,i.default.SEGMENT_LIST];return 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.__proto__||Object.getPrototypeOf(t)).call(this,i.default.PERIOD,e,[new r.default(i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e)])]))}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}(r.default);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(5)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=(0,r.default)(e).getInstance();return{error:function(e){t.trigger(i.default.ERROR,{error:e})}}}s.__dashjs_factory_name="ErrorHandler",t.default=a.default.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(2)),a=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=void 0,n=void 0,r=void 0,o=void 0,s=void 0,u=void 0;function l(e,t){var i=n.getRealPeriodByIndex(t?t.index:null);i&&i.AdaptationSet_asArray&&0!==i.AdaptationSet_asArray.length&&(i.AdaptationSet_asArray=i.AdaptationSet_asArray.filter((function(t){return!t.Representation_asArray||0===t.Representation_asArray.length||!n.getIsTypeOf(t,e)||(t.Representation_asArray=t.Representation_asArray.filter((function(e,i){var a=n.getCodec(t,i,!0);return!!r.supportsCodec(a)||(s.error("[Stream] codec not supported: "+a),!1)})),t.Representation_asArray&&t.Representation_asArray.length>0)})))}return t={setConfig:function(e){e&&(e.adapter&&(n=e.adapter),e.capabilities&&(r=e.capabilities),e.settings&&(o=e.settings))},filterUnsupportedFeaturesOfPeriod:function(e){l(a.default.VIDEO,e),l(a.default.AUDIO,e),o.get().streaming.filterUnsupportedEssentialProperties&&function(e){var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var t=n.getEssentialPropertiesForRepresentation(e);if(t&&t.length>0)for(var i=0;i<t.length;){if(!r.supportsEssentialProperty(t[i]))return s.debug("[Stream] EssentialProperty not supported: "+t[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e),function(e){if(!u||0===u.length)return;var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!u.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e)},setCustomCapabilitiesFilters:function(e){u=e}},s=(0,i.default)(e).getInstance().getLogger(t),t}s.__dashjs_factory_name="CapabilitiesFilter",t.default=r.default.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(203)),i=a(n(0));function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=void 0;return{initialize:function(t){if(e=new r.default,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var i=t.substr(n+1).split("&"),a=0,o=i.length;a<o;++a){var s=i[a],u=s.indexOf("=");if(-1!==u){var l=s.substring(0,u);e.hasOwnProperty(l)&&(e[l]=s.substr(u+1))}}},getURIFragmentData:function(){return e}}}o.__dashjs_factory_name="URIFragmentModel",t.default=i.default.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(5)),a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(){var e=this.context,t=(0,r.default)(e).getInstance(),n=void 0;return{getValue:function(){return n},setValue:function(e){n=e,e&&t.trigger(i.default.MANIFEST_LOADED,{data:e})}}}s.__dashjs_factory_name="ManifestModel",t.default=a.default.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(83)),i=l(n(0)),a=l(n(1)),o=l(n(78)),s=l(n(23)),u=n(15);function l(e){return e&&e.__esModule?e:{default:e}}function c(){var e,t=void 0,n=void 0,i=void 0,l=this.context,c=(0,s.default)(l).getInstance();function d(e){var t=void 0;for(t=0;t<i.length;t++)if(i[t].rulename===e)return t;return-1}function f(){return c.get().streaming.lowLatencyEnabled?c.get().streaming.liveDelay||3:c.get().streaming.liveDelay}function h(e,n){p(e,n);var i=new r.default;i.schemeIdUri=e,i.value=n,t.push(i)}function p(e,n){(0,u.checkParameterType)(e,"string"),(0,u.checkParameterType)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return i},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==o.default.ABANDON_FRAGMENT_RULES&&e!==o.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw a.default.BAD_ARGUMENT_ERROR;var r=d(t);-1===r?i.push({type:e,rulename:t,rule:n}):(i[r].type=e,i[r].rule=n)},removeABRCustomRule:function(e){if(e){var t=d(e);-1!==t&&i.splice(t,1)}else i=[]},getStableBufferTime:function(){if(c.get().streaming.lowLatencyEnabled)return.6*f();var e=c.get().streaming.stableBufferTime;return e>-1?e:c.get().streaming.fastSwitchEnabled?20:12},getRetryAttemptsForType:function(e){var t=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryAttempts[e]*t:c.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryIntervals[e]/t:c.get().streaming.retryIntervals[e]},getLiveDelay:f,getLiveCatchupLatencyThreshold:function(){try{var e=c.get().streaming.liveCatchup.latencyThreshold,t=f();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=c.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?f():c.get().streaming.liveCatchup.minDrift+f():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:h,removeUTCTimingSource:p,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=c.get().streaming.utcSynchronization.defaultTimingSource;h(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return c.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},i=[],e}c.__dashjs_factory_name="MediaPlayerModel",t.default=i.default.getSingletonFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(0)),i=s(n(3)),a=s(n(5)),o=s(n(2));function s(e){return e&&e.__esModule?e:{default:e}}function u(){var e=void 0,t=void 0,n=void 0,r=void 0,s=void 0,u=this.context,l=(0,i.default)(u).getInstance(),c=[];function d(){n&&(n.playbackRate=s||1,n.removeEventListener("canplay",d))}function f(e){n&&(n.readyState<=2&&e>0?n.addEventListener("canplay",d):n.playbackRate=e)}function h(){return c.length>0}function p(e){var t=c.indexOf(e),r=void 0;null!==e&&(-1!==t&&c.splice(t,1),n&&!1===h()&&0===n.playbackRate&&(f(s||1),n.paused||((r=document.createEvent("Event")).initEvent("playing",!0,!1),n.dispatchEvent(r))))}function g(){if(n&&h()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function v(){return n?n.buffered:null}function m(e,t,r,i,a){if(n)for(var o=0;o<n.textTracks.length;o++)if(n.textTracks[o].kind===e&&(!t||n.textTracks[o].label==t)&&n.textTracks[o].language===r&&n.textTracks[o].isTTML===i&&n.textTracks[o].isEmbedded===a)return n.textTracks[o];return null}return e={initialize:function(){l.on(a.default.PLAYBACK_PLAYING,g,this)},setCurrentTime:function(e,t){if(n){if(n.currentTime==e)return;try{e=t?function(e){var t=v(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),o=t.end(i),s=Math.abs(a-e),u=Math.abs(o-e);if(e>=a&&e<=o)return e;s<r&&(r=s,n=a),u<r&&(r=u,n=o)}return n}(e):e,n.currentTime=e}catch(t){0===n.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout((function(){n.currentTime=e}),400)}}},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&l.trigger(a.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing ("+e+")")}))}},isPaused:function(){return n?n.paused:null},pause:function(){n&&(n.pause(),n.autoplay=!1)},isStalled:h,isSeeking:function(){return n?n.seeking:null},getTime:function(){return n?n.currentTime:null},getPlaybackRate:function(){return n?n.playbackRate:null},setPlaybackRate:f,getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){var t=void 0;if(null===e||!n||n.seeking||-1!==c.indexOf(e))return;c.push(e),n&&1===c.length&&((t=document.createEvent("Event")).initEvent("waiting",!0,!1),s=n.playbackRate,f(0),n.dispatchEvent(t))}(e):p(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:function(e,t){n&&n.addEventListener(e,t)},removeEventListener:function(e,t){n&&n.removeEventListener(e,t)},getReadyState:function(){return n?n.readyState:NaN},getBufferRange:v,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:m,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=m(e,t,r,i,a);return o||((o=n.addTextTrack(e,t,r)).isEmbedded=a,o.isTTML=i),o},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){l.off(a.default.PLAYBACK_PLAYING,g,this)}},t=(0,o.default)(u).getInstance().getLogger(e),e}u.__dashjs_factory_name="VideoModel",t.default=r.default.getSingletonFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(2)),a=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var s=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}];function u(e){e=e||{};var t=this.context,n=e.settings,r=void 0,o=void 0,u=void 0;function l(e){if(void 0!==u)return u;u=!1;var t=void 0;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return o.warn("DOMStorage access denied: "+e.message),u}if(!t||"localStorage"!==e&&"sessionStorage"!==e)return u;try{t.setItem("1","1"),t.removeItem("1"),u=!0}catch(e){o.warn("DOMStorage is supported, but cannot be used: "+e.message)}return u}function c(){return 6e5*Math.round((new Date).getTime()/6e5)}function d(e,t){return l(e)&&n.get().streaming[t+"CachingInfo"].enabled}function f(){if(!n)throw new Error(a.default.MISSING_CONFIG_ERROR)}return r={getSavedBitrateSettings:function(e){var t=NaN;if(f(),d("localStorage","lastBitrate")){var r="dashjs_?_bitrate".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,o.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(d("localStorage","lastBitrate")&&t){var n="dashjs_?_bitrate".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:c()}))}catch(e){o.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(f(),d("localStorage","lastMediaSettings")){var r="dashjs_?_settings".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=i.settings,a&&(localStorage.removeItem(r),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(d("localStorage","lastMediaSettings")){var n="dashjs_?_settings".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:c()}))}catch(e){o.error(e.message)}}}},o=(0,i.default)(t).getInstance().getLogger(r),l("localStorage")&&s.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){o.error(e.message)}}})),r}u.__dashjs_factory_name="DOMStorage";var l=r.default.getSingletonFactory(u);t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(209)),a=o(n(210));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,o=e.dashMetrics,s=e.mediaPlayerModel,u=e.errHandler,l=e.baseURLController,c=e.debug,d=e.boxParser,f=e.requestModifier,h=e.errors,p=void 0,g=void 0,v=void 0;function m(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}function y(e){m(e.mimeType)?v.loadInitialization(e.streamId,e.mediaType,e.representation):g.loadInitialization(e.streamId,e.mediaType,e.representation)}function E(e){m(e.mimeType)?v.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback):g.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback)}return p={initialize:function(){n.on(r.SEGMENTBASE_INIT_REQUEST_NEEDED,y,p),n.on(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,E,p),g.initialize(),v.initialize()},reset:function(){n.off(r.SEGMENTBASE_INIT_REQUEST_NEEDED,y,p),n.off(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,E,p)}},g=(0,i.default)(t).getInstance(),v=(0,a.default)(t).getInstance(),g.setConfig({baseURLController:l,dashMetrics:o,mediaPlayerModel:s,errHandler:u,eventBus:n,events:r,errors:h,debug:c,boxParser:d,requestModifier:f}),v.setConfig({baseURLController:l,dashMetrics:o,mediaPlayerModel:s,errHandler:u,eventBus:n,events:r,errors:h,debug:c,requestModifier:f}),p}s.__dashjs_factory_name="SegmentBaseController";var u=r.default.getSingletonFactory(s);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(52)),i=u(n(6)),a=u(n(0)),o=u(n(16)),s=u(n(29));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=this.context,t=void 0,n=void 0,a=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0;function _(){if(!T||!T.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function b(e){if(e.url){var t=new o.default;return t.setInfo(e),t}}function S(e,t,n,r){g.trigger(p.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new i.default(v.SEGMENT_BASE_LOADER_ERROR_CODE,v.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}return t={setConfig:function(e){e.baseURLController&&(T=e.baseURLController),e.dashMetrics&&(c=e.dashMetrics),e.mediaPlayerModel&&(f=e.mediaPlayerModel),e.errHandler&&(a=e.errHandler),e.settings&&(d=e.settings),e.boxParser&&(u=e.boxParser),e.events&&(p=e.events),e.eventBus&&(g=e.eventBus),e.debug&&(n=e.debug.getLogger(t)),e.requestModifier&&(l=e.requestModifier),e.errors&&(v=e.errors),e.urlUtils&&(E=e.urlUtils),e.constants&&(m=e.constants),e.dashConstants&&(y=e.dashConstants)},initialize:function(){h=(0,s.default)(e).create({errHandler:a,dashMetrics:c,mediaPlayerModel:f,requestModifier:l,useFetch:d?d.get().streaming.lowLatencyEnabled:null,boxParser:u,errors:v,urlUtils:E,constants:m,dashConstants:y})},loadInitialization:function e(t,r,i,a){_();var o=null,s=i?T.resolve(i.path):null,l=a||{init:!0,url:s?s.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:r};n.debug("Start searching for initialization.");var c=b(l);h.load({request:c,success:function(n){l.bytesLoaded=l.range.end,(o=u.findInitRange(n))?(i.range=o,g.trigger(p.INITIALIZATION_LOADED,{representation:i},{streamId:t,mediaType:r})):(l.range.end=l.bytesLoaded+l.bytesToLoad,e(t,r,i,l))},error:function(){g.trigger(p.INITIALIZATION_LOADED,{representation:i},{streamId:t,mediaType:r})}}),n.debug("Perform init search: "+l.url)},loadSegments:function e(t,i,a,o,s,l){if(_(),o&&(void 0===o.start||void 0===o.end)){var c=o?o.toString().split("-"):null;o=c?{start:parseFloat(c[0]),end:parseFloat(c[1])}:null}s=s||S;var d=null,f=null,p=!!o,g=a?T.resolve(a.path):null,v={init:!1,url:g?g.url:void 0,range:p?o:{start:0,end:1500},searching:!p,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:i},m=b(v);h.load({request:m,success:function(o){var l=v.bytesToLoad,c=o.byteLength;if(v.bytesLoaded=v.range.end-v.range.start,d=u.parse(o),(f=d.getBox("sidx"))&&f.isComplete){var h=f.references,p=void 0,g=void 0;if(null!=h&&h.length>0&&(p=1===h[0].reference_type),p){n.debug("Initiate multiple SIDX load."),v.range.end=v.range.start+f.size;var m=void 0,y=void 0,E=void 0,T=void 0,_=[],b=0,S=(f.offset||v.range.start)+f.size,A=function(e,t,n){n?(_=_.concat(n),++b>=y&&(_.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),s(e,t,_,a))):s(e,t,null,a)};for(m=0,y=h.length;m<y;m++)E=S,T=S+h[m].referenced_size-1,S+=h[m].referenced_size,e(t,i,a,{start:E,end:T},A,v)}else n.debug("Parsing segments from SIDX. representation "+i+" - id: "+a.id+" for range : "+v.range.start+" - "+v.range.end),g=function(e,t){for(var n=e.references,i=n.length,a=e.timescale,o=e.earliest_presentation_time,s=t.range.start+e.offset+e.first_offset+e.size,u=[],l=void 0,c=void 0,d=void 0,f=void 0,h=0;h<i;h++)d=n[h].subsegment_duration,f=n[h].referenced_size,(l=new r.default).duration=d,l.startTime=o,l.timescale=a,c=s+f-1,l.mediaRange=s+"-"+c,u.push(l),o+=d,s+=f;return u}(f,v),s(t,i,g,a)}else{if(f)v.range.start=f.offset||v.range.start,v.range.end=v.range.start+(f.size||l);else{if(c<v.bytesLoaded)return void s(t,i,null,a);var I=d.getLastBox();I&&I.size?(v.range.start=I.offset+I.size,v.range.end=v.range.start+l):v.range.end+=l}e(t,i,a,v.range,s,v)}},error:function(){s(t,i,null,a)}}),n.debug("Perform SIDX load: "+v.url+" with range : "+v.range.start+" - "+v.range.end)},reset:function(){h.abort(),h=null,a=null,u=null,l=null}}}l.__dashjs_factory_name="SegmentBaseLoader",t.default=a.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(211)),i=c(n(1)),a=c(n(0)),o=c(n(52)),s=c(n(16)),u=c(n(29)),l=c(n(6));function c(e){return e&&e.__esModule?e:{default:e}}function d(){var e=this.context,t=void 0,n=void 0,a=void 0,c=void 0,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0;function T(t,i,s,u){var l,c,d=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0;for(f=[],p=0,c=(l=function(t){var n=[],i=(0,r.default)(e).create({data:t}),o=void 0,s=void 0;for(i.consumeTagAndSize(a.Segment.Cues);i.moreData()&&i.consumeTagAndSize(a.Segment.Cues.CuePoint,!0);){for((o={}).CueTime=i.parseTag(a.Segment.Cues.CuePoint.CueTime),o.CueTracks=[];i.moreData()&&i.consumeTag(a.Segment.Cues.CuePoint.CueTrackPositions,!0);){var u=i.getMatroskaCodedNum(),l=i.getPos();if((s={}).Track=i.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===s.Track)throw new Error("Cue track cannot be 0");s.ClusterPosition=i.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),o.CueTracks.push(s),i.setPos(l+u)}if(0===o.CueTracks.length)throw new Error("Mandatory cuetrack not found");n.push(o)}if(0===n.length)throw new Error("mandatory cuepoint not found");return n}(t)).length;p<c;p+=1)h=new o.default,d=0,d=p<l.length-1?l[p+1].CueTime-l[p].CueTime:u-l[p].CueTime,h.duration=d,h.startTime=l[p].CueTime,h.timescale=1e3,g=l[p].CueTracks[0].ClusterPosition+i,v=p<l.length-1?l[p+1].CueTracks[0].ClusterPosition+i-1:s-1,h.mediaRange=g+"-"+v,f.push(h);return n.debug("Parsed cues: "+f.length+" cues."),f}function _(){if(!E||!E.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function b(e,t,n,r){v.trigger(m.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new l.default(y.SEGMENT_BASE_LOADER_ERROR_CODE,y.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}function S(e){var t=new s.default;return t.setInfo(e),t}return t={setConfig:function(e){if(!(e.baseURLController&&e.dashMetrics&&e.mediaPlayerModel&&e.errHandler))throw new Error(i.default.MISSING_CONFIG_ERROR);E=e.baseURLController,f=e.dashMetrics,h=e.mediaPlayerModel,c=e.errHandler,g=e.settings,m=e.events,v=e.eventBus,y=e.errors,n=e.debug.getLogger(t),d=e.requestModifier},initialize:function(){p=(0,u.default)(e).create({errHandler:c,dashMetrics:f,mediaPlayerModel:h,requestModifier:d,useFetch:g?g.get().streaming.lowLatencyEnabled:null,errors:y})},loadInitialization:function(e,t,r,i){_();var a=null,o=r?E.resolve(r.path):null,s=r?r.range.split("-"):null,u=i||{range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:a,url:o?o.url:void 0,init:!0,mediaType:t};n.info("Start loading initialization."),a=S(u),p.load({request:a,success:function(){v.trigger(m.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})},error:function(){v.trigger(m.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})}}),n.debug("Perform init load: "+u.url)},loadSegments:function(t,i,o,s,u){_();var l=null,c=o?E.resolve(o.path):null,d=c?c.url:void 0;u=u||b,l=S({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:l,url:d,init:!1,mediaType:i}),n.debug("Parsing ebml header"),p.load({request:l,success:function(l){!function(t,i,o,s){if(t&&0!==t.byteLength){var u,l=(0,r.default)(e).create({data:t}),c=void 0,d=void 0,f=void 0,h=o?o.split("-"):null,g=null,v={url:i,range:{start:h?parseFloat(h[0]):null,end:h?parseFloat(h[1]):null},request:g};for(n.debug("Parse EBML header: "+v.url),l.skipOverElement(a.EBML),l.consumeTag(a.Segment),f=l.getMatroskaCodedNum(),f+=l.getPos(),u=l.getPos();l.moreData()&&!l.consumeTagAndSize(a.Segment.Info,!0);)if(!(l.skipOverElement(a.Segment.SeekHead,!0)||l.skipOverElement(a.Segment.Tracks,!0)||l.skipOverElement(a.Segment.Cues,!0)||l.skipOverElement(a.Void,!0)))throw new Error("no valid top level element found");for(;void 0===c;){var m=l.getMatroskaCodedNum(!0),y=l.getMatroskaCodedNum();switch(m){case a.Segment.Info.Duration.tag:c=l[a.Segment.Info.Duration.parse](y);break;default:l.setPos(l.getPos()+y)}}g=S(v);p.load({request:g,success:function(e){d=T(e,u,f,c),s(d)},error:function(){n.error("Download Error: Cues "+v.url),s(null)}}),n.debug("Perform cues load: "+v.url+" bytes="+v.range.start+"-"+v.range.end)}else s(null)}(l,d,s,(function(e){u(t,i,e,o)}))},error:function(){u(t,i,null,o)}})},reset:function(){c=null,d=null}},a={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},t}d.__dashjs_factory_name="WebmSegmentBaseLoader",t.default=a.default.getSingletonFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=void 0,n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,o=0,s=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((s&i)===i){o=void 0===e?s&~i:s,a=u;break}i>>=1}for(u=0;u<a;u+=1,t+=1)o=o<<8|255&n.getUint8(r+t);return r+=t,o}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n=i(e,t),o=void 0;return n&&(o=a(),r+=o),n},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t=void 0;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t},moreData:function(){return r<n.byteLength}}}o.__dashjs_factory_name="EBMLParser",t.default=a.default.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(9)),i=f(n(213)),a=f(n(214)),o=f(n(215)),s=f(n(216)),u=f(n(84)),l=f(n(0)),c=f(n(56)),d=f(n(217));function f(e){return e&&e.__esModule?e:{default:e}}function h(){var e,t=void 0,n=void 0,l=void 0,f=void 0,h=void 0,p=void 0,g=void 0,v=this.context;function m(e,n,i){var a,o=t.getAdaptationsForType(l[0].mpd.manifest,e,n);if(!o||0===o.length)return null;if(o.length>1&&i){var s=E(i,n);if(h[i.id]&&h[i.id][n])for(var u=0,c=o.length;u<c;u++)if(y(h[i.id][n],s[u]))return o[u];for(var d=0,f=o.length;d<f;d++)if(a=o[d],t.getRolesForAdaptation(a).filter((function(e){return e.value===r.default.MAIN}))[0])return o[d]}return o[0]}function y(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function E(e,n,r){var i,a=l,o=r,s=[],u=void 0,c=void 0,d=void 0,h=void 0,g=void 0,v=void 0;if(o)C(),a=T(o);else{if(!(l.length>0))return s;o=l[0].mpd.manifest}var m=I(e,a);m&&(v=m.id);var y=t.getAdaptationsForType(o,e?e.index:null,n!==p.EMBEDDED_TEXT?n:p.VIDEO);if(!y||0===y.length)return s;for(f[v]=f[v]||t.getAdaptationsForPeriod(m),h=0,i=y.length;h<i;h++)if(u=y[h],d=t.getIndexForAdaptation(u,o,e.index),c=w(f[v][d]),n===p.EMBEDDED_TEXT){var E=c.accessibility.length;for(g=0;g<E;g++)if(c){var _=c.accessibility[g];if(0===_.indexOf("cea-608:")){var b=_.substring(8).split(";");if("CC"===b[0].substring(0,2))for(g=0;g<b.length;g++)c||(c=w.call(this,f[v][d])),R(c,b[g].substring(0,3),b[g].substring(4)),s.push(c),c=null;else for(g=0;g<b.length;g++)c||(c=w.call(this,f[v][d])),R(c,"CC"+(g+1),b[g]),s.push(c),c=null}else 0===_.indexOf("cea-608")&&(R(c,p.CC1,"eng"),s.push(c),c=null)}}else n===p.IMAGE?(c.type=p.IMAGE,s.push(c),c=null):c&&s.push(c);return s}function T(e){var n=_(e);return t.getRegularPeriods(n)}function _(e){var n=S(e);return t.getMpd(n)}function b(){l=[],f={},h={}}function S(e){return e||(l.length>0?l[0].mpd.manifest:null)}function A(e){return e&&e.streamInfo&&void 0!==e.streamInfo.id&&f[e.streamInfo.id]?f[e.streamInfo.id][e.index]:null}function I(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function w(e){if(!e)return null;var n,r=new a.default,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];return r.id=e.id,r.index=e.index,r.type=e.type,r.streamInfo=D(e.period),r.representationCount=t.getRepresentationCount(i),r.labels=t.getLabelsForAdaptation(i),r.lang=t.getLanguageForAdaptation(i),n=t.getViewpointForAdaptation(i),r.viewpoint=n?n.value:void 0,r.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==g&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.contentProtection&&r.contentProtection.forEach((function(e){e.KID=t.getKID(e)})),r.isText=t.getIsTextTrack(r.mimeType),r.supplementalProperties=t.getSupplementalPropperties(i),r}function R(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=p.EMBEDDED_TEXT,e.codec="cea-608-in-SEI",e.isText=!0,e.isEmbedded=!0,e.lang=n,e.roles=["caption"]}function D(e){var n,r,i=new o.default;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new s.default).DVRWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function C(){if(!p)throw new Error("setConfig function has to be called previously")}function M(e){return l.length>0?l[0].mpd.manifest.Period_asArray[e]:null}function L(e,t,n){var r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e)for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)for(a=r[o].Representation_asArray,s=0;s<a.length;s+=1)if(t===(i=a[s]).id)return n?s:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=L(M(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=L(e,t,!0);return null!==n?n:-1}(M(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i=void 0,a=void 0,o=void 0;if(!e||!n)return-1;for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)if(i=r[o],a=i.Representation_asArray,t.getIsTypeOf(i,n))return a.length;return-1}(M(n),e)},convertDataToRepresentationInfo:function(e){if(e){var n=new i.default,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],a=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(a),n.DVRWindow=e.segmentAvailabilityRange,n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=w(e.adaptation),n}return null},getDataForMedia:A,getStreamsInfo:function(e,t){var n=[],r=l;if(e&&(C(),r=T(e)),r.length>0){(!t||t>r.length)&&(t=r.length);for(var i=0;i<t;i++)n.push(D(r[i]))}return n},getMediaInfoForType:function(e,n){if(0===l.length||!e)return null;var r=I(e,l);if(!r)return null;var i=r.id;f[i]=f[i]||t.getAdaptationsForPeriod(r);var a=m(e.index,n,e);if(!a)return null;var o=t.getIndexForAdaptation(a,l[0].mpd.manifest,e.index);return w(f[i][o])},getAllMediaInfoForType:E,getAdaptationForType:m,getRealAdaptation:function(e,n){var r,i=void 0,a=I(e,l);return r=n?n.id:null,l.length>0&&a&&(i=r?t.getAdaptationForId(r,l[0].mpd.manifest,a.index):t.getAdaptationForIndex(n?n.index:null,l[0].mpd.manifest,a.index)),i},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,l[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=A(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var r=[];if(l.length>0){var s=l[0].mpd.manifest;e instanceof o.default?r=t.getEventsForPeriod(I(e,l)):e instanceof a.default?r=t.getEventStreamForAdaptationSet(s,A(e)):e instanceof i.default&&(r=t.getEventStreamForRepresentation(s,n))}return r},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var o=new u.default,s=e.timescale||1,l=r.adaptation.period.start,c=t[i+"/"+a],d=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,f=e.presentation_time_delta/s,h=void 0;h=0===e.version?l+n-d+f:l-d+f;var p=e.event_duration,g=e.id,v=e.message_data;return o.eventStream=c,o.eventStream.value=a,o.eventStream.timescale=s,o.duration=p,o.id=g,o.calculatedPresentationTime=h,o.messageData=v,o.presentationTimeDelta=f,o}catch(e){return null}},getMpd:_,setConfig:function(e){e&&(e.constants&&(p=e.constants),e.cea608parser&&(g=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;C(),l=T(e),f={}},getIsTextTrack:function(e){return t.getIsTextTrack(e)},getUTCTimingSources:function(){var e=S();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=l.length>0?l[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=_(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=S(e);return t.getIsDynamic(n)},getDuration:function(e){var n=S(e);return t.getDuration(n)},getRegularPeriods:T,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getVoAdaptations:function(){return f},getVoPeriods:function(){return l},getPeriodById:function(e){if(!e||0===l.length)return null;var t=l.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){h[e]=h[e]||{},h[e][t]=h[e][t]||{},h[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),o=t.getPublishTime(e),s=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&o&&u&&o.getTime()==u.getTime()&&s&&o.getTime()<s.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var o=(i[r+"_asArray"]||[]).indexOf(a),s="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=o)){var u=i[r+"_asArray"];u.splice(o,1),u.length>1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=o?o+(s?0:1)+("replace"==t.action?-1:0):s?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},reset:b},t=(0,c.default)(v).getInstance(),n=(0,d.default)(v).getInstance(),b(),e}h.__dashjs_factory_name="DashAdapter",t.default=l.default.getSingletonFactory(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(9)),i=u(n(0)),a=u(n(2)),o=u(n(218)),s=u(n(219));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=void 0,t=void 0,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(r.default.PUBLISH_TIME)?new Date(e[r.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_PUBLISH_TIME)?new Date(e[r.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[r.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: "+n),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: "+r.type+"="+r.__text),null;i=i+"/"+r.type}var a=new o.default(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: "+n+" - "+i),null;var u=null;a.findsAttribute()?u=r.__text||"":"remove"!==n&&(u=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var l=new s.default(n,a,u);return"add"===n&&(l.position=r.pos),l})).filter((function(e){return!!e})):[]}},t=(0,a.default)(n).getInstance().getLogger(e),e}l.__dashjs_factory_name="PatchManifestModel",t.default=i.default.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}return r(e,[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var o=this.path[i];if(a=o.name,i!==this.path.length-1||!a.startsWith("@")){var s=n[a+"_asArray"]||[];0===s.length&&n[a]&&s.push(n[a]),o.position?r=s[o.position]||null:o.attribute?function(){var e=o.attribute;r=s.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=s[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=n,this.value=r,this.position=null}return r(e,[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(1)),i=n(8),a=d(n(0)),o=d(n(10)),s=d(n(221)),u=d(n(222)),l=d(n(30)),c=n(54);function d(e){return e&&e.__esModule?e:{default:e}}function f(e){e=e||{};var t,n=this.context,a=void 0,d=void 0,f=void 0,h=e.metricsModel;function p(e){var t=h.getMetricsFor(e,!0);if(!t)return null;var n=t.HttpList,r=null,i=void 0;if(!n||n.length<=0)return null;for(i=n.length-1;i>=0;){if(n[i].responsecode){r=n[i];break}i--}return r}function g(e){var t=h.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function v(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return v(h.getMetricsFor(e,!0),o.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return v(h.getMetricsFor(e,!0),o.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=v(h.getMetricsFor(e,!0),o.default.BUFFER_LEVEL);return t?s.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:p,getHttpRequests:g,getCurrentDroppedFrames:function(){return v(h.getMetricsFor(r.default.VIDEO,!0),o.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return v(h.getMetricsFor(e,!0),o.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return v(e?h.getMetricsFor(e,!0):h.getMetricsFor(r.default.VIDEO,!0)||h.getMetricsFor(r.default.AUDIO,!0),o.default.DVR_INFO)},getCurrentManifestUpdate:function(){return v(h.getMetricsFor(r.default.STREAM),o.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){var n={},r=p(e);return r&&(n=l.default.parseHttpHeaders(r._responseHeaders)),void 0===n[t]?null:n[t]},getLatestMPDRequestHeaderValueByID:function(e){var t,n={},a=void 0,o=void 0;for(o=(t=g(r.default.STREAM)).length-1;o>=0;o--)if((a=t[o]).type===i.HTTPRequest.MPD_TYPE){n=l.default.parseHttpHeaders(a._responseHeaders);break}return void 0===n[e]?null:n[e]},addRepresentationSwitch:function(e,t,n,r,i){h.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){h.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();h.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();h.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();h.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){h.addManifestUpdate(r.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){h.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i)},addSchedulingInfo:function(e,t){h.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){h.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){h.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){h.addBufferState(e,t,n)},addDroppedFrames:function(e){h.addDroppedFrames(r.default.VIDEO,e)},addPlayList:function(){f&&(h.addPlayList(f),f=null)},addDVBErrors:function(e){h.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(f=new c.PlayList).start=new Date,f.mstart=e,f.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===a&&(a=!1,(d=new c.PlayListTrace).representationid=e,d.start=new Date,d.mstart=t,d.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(e){if(d)for(var t in d)d[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===a&&f&&d&&d.start){var n=d.start,r=e.getTime()-n.getTime();d.duration=r,d.stopreason=t,f.trace.push(d),a=!0}},clearAllCurrentMetrics:function(){h.clearAllCurrentMetrics()}},h=h||(0,u.default)(n).getInstance({settings:e.settings}),a=!0,d=null,f=null,t}f.__dashjs_factory_name="DashMetrics",t.default=a.default.getSingletonFactory(f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"round10",value:function(e,t){return function(e,t,n){if(void 0===n||0==+n)return Math[e](t);if(n=+n,null===(t=+t)||isNaN(t)||!("number"==typeof n&&n%1==0))return NaN;return t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))}("round",e,t)}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=y(n(1)),i=y(n(10)),a=y(n(223)),o=n(8),s=y(n(224)),u=y(n(225)),l=y(n(226)),c=y(n(227)),d=y(n(228)),f=n(229),h=y(n(230)),p=y(n(3)),g=y(n(231)),v=y(n(5)),m=y(n(0));function y(e){return e&&e.__esModule?e:{default:e}}function E(e){var t,n=(e=e||{}).settings,m=this.context,y=(0,p.default)(m).getInstance(),E=void 0;function T(){y.trigger(v.default.METRICS_CHANGED)}function _(e){y.trigger(v.default.METRIC_CHANGED,{mediaType:e}),T()}function b(e,t,n){y.trigger(v.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),_(e)}function S(e,t,n){y.trigger(v.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),_(e)}function A(e,t){var n=null;return e?(E.hasOwnProperty(e)?n=E[e]:t||(n=new a.default,E[e]=n),n):n}function I(e,t,r){var i=A(e);null!==i&&(i[t].push(r),i[t].length>n.get().streaming.metricsMaxListDepth&&i[t].shift())}function w(e,t,n){I(e,t,n),S(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete E[e],_(e)},clearAllCurrentMetrics:function(){E={},T()},getMetricsFor:A,addHttpRequest:function e(t,n,r,a,s,u,l,c,d,f,h,p,g,v,m){var y=new o.HTTPRequest;u&&u!==a&&(e(t,null,r,a,s,null,null,c,d,null,null,null,g,null,null),y.actualurl=u),y.tcpid=n,y.type=r,y.url=a,y.range=c,y.trequest=d,y.tresponse=f,y.responsecode=p,y._tfinish=h,y._stream=t,y._mediaduration=g,y._quality=s,y._responseHeaders=v,y._serviceLocation=l,m?m.forEach((function(e){!function(e,t,n,r){var i=new o.HTTPRequestTrace;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||(e.interval=0),e.interval+=n}(y,e.s,e.d,e.b)})):(delete y.interval,delete y.trace),w(t,i.default.HTTP_REQUEST,y)},addRepresentationSwitch:function(e,t,n,r,a){var o=new s.default;o.t=t,o.mt=n,o.to=r,a?o.lto=a:delete o.lto,w(e,i.default.TRACK_SWITCH,o)},addBufferLevel:function(e,t,n){var r=new u.default;r.t=t,r.level=n,w(e,i.default.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new l.default;r.target=n,r.state=t,w(e,i.default.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var a=new c.default;a.time=t,a.range=r,a.manifestInfo=n,w(e,i.default.DVR_INFO,a)},addDroppedFrames:function(e,t){var n=new d.default,r=A(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||w(e,i.default.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,a,o,s,u,l){var c=new h.default;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=a,c.duration=o,c.quality=s,c.range=u,c.state=l,w(e,i.default.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new g.default;r.loadingRequests=t,r.executedRequests=n,A(e).RequestsQueue=r,S(e,i.default.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,a,o,s,u,l,c,d){var h=new f.ManifestUpdate;h.mediaType=e,h.type=t,h.requestTime=n,h.fetchTime=a,h.availabilityStartTime=o,h.presentationStartTime=s,h.clientTimeOffset=u,h.currentTime=l,h.buffered=c,h.latency=d,I(r.default.STREAM,i.default.MANIFEST_UPDATE,h),S(e,i.default.MANIFEST_UPDATE,h)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];b(e.mediaType,i.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,a){if(e){var o=new f.ManifestUpdateStreamInfo;o.id=t,o.index=n,o.start=r,o.duration=a,e.streamInfo.push(o),b(e.mediaType,i.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,a,o,s,u){if(e&&e.representationInfo){var l=new f.ManifestUpdateRepresentationInfo;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=a,l.startNumber=s,l.fragmentInfoType=u,l.presentationTimeOffset=o,e.representationInfo.push(l),b(e.mediaType,i.default.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,w(r.default.STREAM,i.default.PLAY_LIST,e)},addDVBErrors:function(e){w(r.default.STREAM,i.default.DVB_ERRORS,e)}},E={},t}E.__dashjs_factory_name="MetricsModel",t.default=m.default.getSingletonFactory(E)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(10),a=(r=i)&&r.__esModule?r:{default:r};t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=a.default.BUFFER_EMPTY}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});t.ManifestUpdate=function e(){r(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},t.ManifestUpdateStreamInfo=function e(){r(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},t.ManifestUpdateRepresentationInfo=function e(){r(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(3)),i=l(n(5)),a=l(n(0)),o=l(n(9)),s=l(n(56)),u=l(n(23));function l(e){return e&&e.__esModule?e:{default:e}}function c(){var e,t=this.context,n=(0,r.default)(t).getInstance(),a=(0,u.default)(t).getInstance(),l=void 0,c=void 0,d=void 0,f=void 0;function h(e){c=e}function p(e,t,n,r){return r?n&&t.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(t.availabilityStartTime.getTime()+1e3*(e+t.timeShiftBufferDepth)):t.availabilityEndTime:n?new Date(t.availabilityStartTime.getTime()+1e3*(e-c)):t.availabilityStartTime}function g(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*c)/1e3}function v(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){void 0!==e.offset&&(h(e.offset/1e3),d=!0)}function y(){c=0,d=!1,f=NaN}function E(){n.off(i.default.UPDATE_TIME_SYNC_OFFSET,m,this),y()}return e={initialize:function(){y(),n.on(i.default.UPDATE_TIME_SYNC_OFFSET,m,this)},getClientTimeOffset:function(){return c},setClientTimeOffset:h,getExpectedLiveEdge:function(){return f},setExpectedLiveEdge:function(e){f=e},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return p.call(this,e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return p.call(this,e,t,n,!0)},calcPresentationTimeFromWallTime:g,calcPresentationTimeFromMediaTime:v,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcSegmentAvailabilityRange:function(e,t){var n=e.adaptation.period,r={start:n.start,end:n.start+n.duration};if(!t)return r;if(!d&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var i=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0);if(e.segmentInfoType===o.default.SEGMENT_TIMELINE&&a.get().streaming.calcSegmentAvailabilityRangeFromTimeline)return function(e){var t,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],r=l.getRepresentationFor(e.index,n),i=r.SegmentTemplate.SegmentTimeline,a=r.SegmentTemplate.timescale,o=i.S_asArray,s={start:0,end:0},u=0,c=void 0,d=void 0,f=void 0;for(s.start=v(o[0].t/a,e),f=0,t=o.length;f<t;f++)c=o[f],d=0,c.hasOwnProperty("r")&&(d=c.r),u+=c.d/a*(1+d);return s.end=s.start+u,s}(e);var s=g(new Date,n),u=n.start+n.duration;r.start=Math.max(s-n.mpd.timeShiftBufferDepth,n.start);var c=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<i?i-e.availabilityTimeOffset:i;return r.end=s>=u&&s-c<u?u:s-c,r},getPeriodEnd:function(e,t){var n=e.adaptation.period;if(!t)return n.start+n.duration;if(!d&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var r=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0),i=g(new Date,n),a=n.start+n.duration,o=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<r?r-e.availabilityTimeOffset:r;return Math.min(i-o,a)},calcWallTimeForSegment:function(e,t){var n=void 0,r=void 0,i=void 0;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},reset:E},l=(0,s.default)(t).getInstance(),E(),e}c.__dashjs_factory_name="TimelineConverter",t.default=a.default.getSingletonFactory(c)},function(e,t,n){"use strict";var r,i,o,u,l,c={encode:function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},decode:function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}},d={};r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t=0,n=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push(r.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push("=")):1==e.length-t&&(a=e[t]<<16,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push("==")),n.join("")},o=function(){for(var e=[],t=0;t<r.length;++t)e[r.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),u=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var i=(o[e.charCodeAt(t)]<<18)+(o[e.charCodeAt(t+1)]<<12)+(o[e.charCodeAt(t+2)]<<6)+o[e.charCodeAt(t+3)];n.push(255&i>>16),n.push(255&i>>8),n.push(255&i),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},l={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},d.decodeArray=function(e){var t=u(e);return new Uint8Array(t)},d.encodeASCII=function(e){var t=l.encode(e);return i(t)},d.decodeASCII=function(e){var t=u(e);return l.decode(t)},d.encode=function(e){var t=c.encode(e);return i(t)},d.decode=function(e){var t=u(e);return c.decode(t)},t.decode=d.decode,t.decodeArray=d.decodeArray,t.encode=d.encode,t.encodeASCII=d.encodeASCII},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(235)),i=u(n(31)),a=u(n(237)),o=u(n(94)),s=u(n(93));function u(e){return e&&e.__esModule?e:{default:e}}function l(){var e=this.context;return{createMetricsReporting:function(t){return(0,r.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}),(0,a.default)(e).create(t)},getReportingFactory:function(){return(0,s.default)(e).getInstance()},getMetricsHandlerFactory:function(){return(0,o.default)(e).getInstance()}}}l.__dashjs_factory_name="MetricsReporting";var c=dashjs.FactoryMaker.getClassFactory(l);c.events=i.default,dashjs.FactoryMaker.updateClassFactory(l.__dashjs_factory_name,c),t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(236)),i=a(n(31));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=void 0,n=void 0,a=(e=e||{}).eventBus,o=e.dashMetrics,s=e.metricsConstants,u=e.events;function l(e){var t=new r.default;if(n){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),o.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function d(e){l({errorcode:r.default.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){l({errorcode:r.default.BECAME_REPORTER})}function h(e){switch(e.metric){case s.HTTP_REQUEST:(0===(t=e.value).responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||r.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}var t}function p(e){var t=void 0;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=r.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=r.default.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}function g(){a.on(u.MANIFEST_UPDATED,c,t),a.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.on(u.METRIC_ADDED,h,t),a.on(u.METRIC_UPDATED,h,t),a.on(u.PLAYBACK_ERROR,p,t),a.on(i.default.BECAME_REPORTING_PLAYER,f,t)}return t={initialise:g,reset:function(){a.off(u.MANIFEST_UPDATED,c,t),a.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.off(u.METRIC_ADDED,h,t),a.off(u.METRIC_UPDATED,h,t),a.off(u.PLAYBACK_ERROR,p,t),a.off(i.default.BECAME_REPORTING_PLAYER,f,t)}},g(),t}o.__dashjs_factory_name="DVBErrorsTranslator",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(238)),i=o(n(249)),a=o(n(31));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=void 0,n={},o=this.context,s=e.eventBus,u=e.events;function l(t){if(!t.error){var u=Object.keys(n);(0,i.default)(o).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))u.splice(i,1);else try{var a=(0,r.default)(o).create(e);a.initialize(t),n[i]=a}catch(e){}})),u.forEach((function(e){n[e].reset(),delete n[e]})),s.trigger(a.default.METRICS_INITIALISATION_COMPLETE)}}function c(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){s.off(u.MANIFEST_UPDATED,l,t),s.off(u.STREAM_TEARDOWN_COMPLETE,c,t)}},s.on(u.MANIFEST_UPDATED,l,t),s.on(u.STREAM_TEARDOWN_COMPLETE,c,t),t}s.__dashjs_factory_name="MetricsCollectionController",t.default=dashjs.FactoryMaker.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(239)),i=o(n(240)),a=o(n(244));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){e=e||{};var t=void 0,n=void 0,o=void 0,s=this.context;function u(){t&&t.reset(),n&&n.reset(),o&&o.reset()}return{initialize:function(l){try{(o=(0,r.default)(s).create({mediaElement:e.mediaElement})).initialize(l.Range),(n=(0,i.default)(s).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(l.Reporting,o),(t=(0,a.default)(s).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(l.metrics,n)}catch(e){throw u(),e}},reset:u}}s.__dashjs_factory_name="MetricsController",t.default=dashjs.FactoryMaker.getClassFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(68),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t,n=!1,r=this.context,i=void 0,o=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,n=t+e.duration;i.add(t,n)})),n=!!e[0]._useWallClockTime)},reset:function(){i.clear()},isEnabled:function(){var e,t=i.length;if(!t)return!0;e=n?(new Date).getTime()/1e3:o.currentTime;for(var r=0;r<t;r+=1){var a=i.start(r),s=i.end(r);if(a<=e&&e<s)return!0}return!1}},i=(0,a.default)(r).create(),t}o.__dashjs_factory_name="RangeController",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(93),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=[],n=(0,a.default)(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}o.__dashjs_factory_name="ReportingController",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(242)),i=a(n(243));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){e=e||{};var t,n=this.context,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=[],f=e.metricsConstants;function h(){s=!1,u=!1,l=null,c=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),u&&c.isEnabled()&&t.forEach((function(t){var n=a.serialise(t);e!==f.DVB_ERRORS&&(n="metricname="+e+"&"+n),function(e,t,n){var r=new XMLHttpRequest,i=function(){var e=d.indexOf(r);-1!==e&&(d.splice(e,1),r.status>=200&&r.status<300?t&&t():n&&n())};d.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(n=l+"?"+n,null,(function(){u=!1}))}))},initialize:function(e,t){var n=void 0;if(c=t,!(l=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");s||((n=e.dvb_probability)&&(1e3===n||n/1e3>=o.random())&&(u=!0),s=!0)},reset:function(){h()}},a=(0,r.default)(n).getInstance(),o=(0,i.default)(n).getInstance(),h(),t}o.__dashjs_factory_name="DVBReporting",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";function r(){return{serialise:function e(t){var n=[],r=[],i=void 0,a=void 0;for(i in t)if(t.hasOwnProperty(i)&&0!==i.indexOf("_")){if(null==(a=t[i])&&(a=""),Array.isArray(a)){if(!a.length)continue;r=[],a.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);r.push(n?t:e(t))})),a=r.map(encodeURIComponent).join(",")}else"string"==typeof a?a=encodeURIComponent(a):a instanceof Date?a=a.toISOString():"number"==typeof a&&(a=Math.round(a));n.push(i+"="+a)}return n.join("&")}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="MetricSerialiser",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";function r(){var e,t=window.crypto||window.msCrypto,n=Uint32Array,r=Math.pow(2,8*n.BYTES_PER_ELEMENT)-1,i=void 0,a=void 0;function o(){t&&(i||(i=new n(10)),t.getRandomValues(i),a=0)}return e={random:function(e,n){var s=void 0;return e||(e=0),n||(n=1),t?(a===i.length&&o(),s=i[a]/r,a+=1):s=Math.random(),s*(n-e)+e}},o(),e}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="RNG",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(94),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=[],n=void 0,r=this.context,i=e.eventBus,o=e.events,s=(0,a.default)(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function u(e){t.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return n={initialize:function(e,r){e.split(",").forEach((function(e,n,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var o=i[n+1];o&&-1===o.indexOf("(")&&-1!==o.indexOf(")")&&(e+=","+o,delete i[n+1])}(a=s.create(e,r))&&t.push(a)})),i.on(o.METRIC_ADDED,u,n),i.on(o.METRIC_UPDATED,u,n)},reset:function(){i.off(o.METRIC_ADDED,u,n),i.off(o.METRIC_UPDATED,u,n),t.forEach((function(e){return e.reset()})),t=[]}}}o.__dashjs_factory_name="MetricsHandlersController",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(95),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,s=this.context,u=(0,a.default)(s).getInstance(),l=[],c=e.metricsConstants;function d(){var e=function(){try{return Object.keys(l).map((function(e){return l[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&o!==e.t&&(o=e.t,t.report(r,e))}return{initialize:function(e,a,o){a&&(n=u.validateN(o),t=a,r=u.reconstructFullMetricName(e,o),i=setInterval(d,n))},reset:function(){clearInterval(i),i=null,n=0,t=null,o=null},handleNewMetric:function(e,t,n){e===c.BUFFER_LEVEL&&(l[n]=t)}}}o.__dashjs_factory_name="BufferLevelHandler",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(31),a=(r=i)&&r.__esModule?r:{default:r};t.default=dashjs.FactoryMaker.getClassFactory((function(e){var t=void 0,n=(e=e||{}).eventBus,r=e.metricsConstants;function i(){n.off(a.default.METRICS_INITIALISATION_COMPLETE,i,this),n.trigger(a.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,r){r&&(t=r,n.on(a.default.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===r.DVB_ERRORS&&t&&t.report(e,n)}}}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(95),a=(r=i)&&r.__esModule?r:{default:r};function o(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,s=[],u=(0,a.default)(this.context).getInstance(),l=e.metricsConstants;function c(){var e=s;e.length&&t&&t.report(i,e),s=[]}return{initialize:function(e,a,s,l){a&&(n=u.validateN(s),t=a,l&&l.length&&(r=l),i=u.reconstructFullMetricName(e,s,l),o=setInterval(c,n))},reset:function(){clearInterval(o),o=null,n=null,r=null,s=[],t=null},handleNewMetric:function(e,t){e===l.HTTP_REQUEST&&(r&&r!==t.type||s.push(t))}}}o.__dashjs_factory_name="HttpListHandler",t.default=dashjs.FactoryMaker.getClassFactory(o)},function(e,t,n){"use strict";function r(){var e=void 0,t=void 0;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="GenericMetricHandler",t.default=dashjs.FactoryMaker.getClassFactory(r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(250)),i=o(n(251)),a=o(n(252));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var o=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(s){var u=new r.default,l=t.getIsDynamic(e);s.hasOwnProperty("metrics")&&(u.metrics=s.metrics,s.Range_asArray&&s.Range_asArray.forEach((function(r){var a=new i.default;a.starttime=function(e,r,i){var a=void 0,o=void 0,s=0;return r?s=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(s=a[0].start),o=s,i&&i.hasOwnProperty(n.START_TIME)&&(o+=i.starttime),o}(e,l,r),r.hasOwnProperty("duration")?a.duration=r.duration:a.duration=t.getDuration(e),a._useWallClockTime=l,u.Range.push(a)})),s.Reporting_asArray&&(s.Reporting_asArray.forEach((function(e){var t=new a.default;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),u.Reporting.push(t))})),o.push(u)))})),o}}}s.__dashjs_factory_name="ManifestParsing",t.default=dashjs.FactoryMaker.getSingletonFactory(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(254)),i=c(n(40)),a=c(n(266)),o=c(n(32)),s=c(n(267)),u=c(n(268)),l=c(n(269));function c(e){return e&&e.__esModule?e:{default:e}}var d=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],f=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function h(){var e=void 0,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(a){var o=null,c=(0,i.default)(t).getInstance();c.setConfig({debug:a.debug,BASE64:a.BASE64}),c.initialize();var h=function(r){var i=r.debug,a=i.getLogger(e),o=r.eventBus,c=r.errHandler,h=r.videoModel?r.videoModel.getElement():null;return h&&void 0===h.onencrypted||h&&void 0===h.mediaKeys?n(h,f)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),(0,u.default)(t).create({debug:i,eventBus:o,events:r.events,api:n(h,f)})):n(h,d)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),(0,l.default)(t).create({debug:i,eventBus:o,errHandler:c,events:r.events,api:n(h,d)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),(0,s.default)(t).create({debug:i,eventBus:o,events:r.events}))}(a);return!o&&h&&(o=(0,r.default)(t).create({protectionModel:h,protectionKeyController:c,eventBus:a.eventBus,debug:a.debug,events:a.events,BASE64:a.BASE64,constants:a.constants,cmcdModel:a.cmcdModel,settings:a.settings}),a.capabilities.setEncryptedMediaSupported(!0)),o}}}h.__dashjs_factory_name="Protection";var p=dashjs.FactoryMaker.getClassFactory(h);p.events=a.default,p.errors=o.default,dashjs.FactoryMaker.updateClassFactory(h.__dashjs_factory_name,p),t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=p(n(24)),a=p(n(255)),o=p(n(58)),s=p(n(32)),u=p(n(6)),l=p(n(256)),c=p(n(257)),d=n(8),f=p(n(30)),h=p(n(1));function p(e){return e&&e.__esModule?e:{default:e}}function g(e){var t=(e=e||{}).protectionKeyController,n=e.protectionModel,p=e.eventBus,g=e.events,v=e.debug,m=e.BASE64,y=e.constants,E=[],T=e.cmcdModel,_=e.settings,b=void 0,S=void 0,A=void 0,I=void 0,w=void 0,R=void 0,D=void 0,C=void 0,M=void 0,L=void 0;function N(){if(!(p&&p.hasOwnProperty("on")&&t&&t.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function O(e,t){var r=i.default.getPSSHForKeySystem(C,e),a=F(C);if(r){if(x(r))return;try{n.createKeySession(r,a,B(C),t)}catch(e){p.trigger(g.KEY_SESSION_CREATED,{data:null,error:new u.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e?n.createKeySession(e,a,B(C),t):p.trigger(g.KEY_SESSION_CREATED,{data:null,error:new u.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(C?C.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function x(e){if(!e)return!1;try{for(var r=n.getAllInitData(),i=0;i<r.length;i++)if(t.initDataEquals(e,r[i]))return S.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function P(e,t){N(),n.loadKeySession(e,t,B(C))}function k(e){N(),e?(n.setMediaElement(e),p.on(g.NEED_KEY,V,this)):null===e&&(n.setMediaElement(e),p.off(g.NEED_KEY,V,this))}function F(e){var t=null;if(e){var n=e.systemString;w&&(t=n in w?w[n]:null)}return t}function U(e){var t=F(e),n=[],r=[],i=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:D,s=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:D,u=B(e),l=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",c=t&&t.persistentState?t.persistentState:"temporary"===u?"optional":"required";return I.forEach((function(e){e.type===y.AUDIO?n.push(new a.default(e.codec,i)):e.type===y.VIDEO&&r.push(new a.default(e.codec,s))})),new o.default(n,r,l,c,[u])}function B(e){var t=F(e);return t&&t.sessionType?t.sessionType:R}function G(e,r){e=e.sort((function(t,n){return(w&&w[t.ks.systemString]&&w[t.ks.systemString].priority>=0?w[t.ks.systemString].priority:e.length)-(w&&w[n.ks.systemString]&&w[n.ks.systemString].priority>=0?w[n.ks.systemString].priority:e.length)})),void 0===C?function(e,r){var i=this,a=[],o=void 0;C=null,A.push(e);for(var l=0;l<e.length;l++)a.push({ks:e[l].ks,configs:[U(e[l].ks)]});var c=void 0,d=function e(t){p.off(g.KEY_SYSTEM_ACCESS_COMPLETE,e,i),t.error?(C=void 0,p.off(g.INTERNAL_KEY_SYSTEM_SELECTED,f,i),r||p.trigger(g.KEY_SYSTEM_SELECTED,{data:null,error:new u.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+t.error)})):(c=t.data,S.info("DRM: KeySystem Access Granted ("+c.keySystem.systemString+")! Selecting key system..."),n.selectKeySystem(c))},f=function e(a){if(p.off(g.INTERNAL_KEY_SYSTEM_SELECTED,e,i),p.off(g.KEY_SYSTEM_ACCESS_COMPLETE,d,i),a.error)C=void 0,r||p.trigger(g.KEY_SYSTEM_SELECTED,{data:null,error:new u.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+a.error)});else{if(!n)return;C=n.getKeySystem(),p.trigger(g.KEY_SYSTEM_SELECTED,{data:c});var l=F(C);l&&l.serverCertificate&&l.serverCertificate.length>0&&n.setServerCertificate(m.decodeArray(l.serverCertificate).buffer);for(var f=0;f<A.length;f++)for(o=0;o<A[f].length;o++)if(C===A[f][o].ks){if(t.isClearKey(C)&&l&&l.hasOwnProperty("clearkeys")){var h={kids:Object.keys(l.clearkeys)};A[f][o].initData=(new TextEncoder).encode(JSON.stringify(h))}A[f][o].sessionId?P(A[f][o].sessionId,A[f][o].initData):null!==A[f][o].initData&&O(A[f][o].initData,A[f][o].cdmData);break}}};p.on(g.INTERNAL_KEY_SYSTEM_SELECTED,f,i),p.on(g.KEY_SYSTEM_ACCESS_COMPLETE,d,i),n.requestKeySystemAccess(a)}(e,r):C?function(e,r){var a=this,o=[],l=e.findIndex((function(e){return e.ks===C}));if(-1===l||!e[l].initData)return;if(x(i.default.getPSSHForKeySystem(C,e[l].initData)))return;o.push({ks:e[l].ks,configs:[U(C)]});p.on(g.KEY_SYSTEM_ACCESS_COMPLETE,(function n(i){if(p.off(g.KEY_SYSTEM_ACCESS_COMPLETE,n,a),i.error)r||p.trigger(g.KEY_SYSTEM_SELECTED,{error:new u.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+i.error)});else{S.info("DRM: KeySystem Access Granted"),p.trigger(g.KEY_SYSTEM_SELECTED,{data:i.data});var o=F(C);if(t.isClearKey(C)&&o&&o.hasOwnProperty("clearkeys")){var c={kids:Object.keys(o.clearkeys)};e[l].initData=(new TextEncoder).encode(JSON.stringify(c))}e[l].sessionId?P(e[l].sessionId,e[l].initData):e[l].initData&&O(e[l].initData,e[l].cdmData)}}),a),n.requestKeySystemAccess(o)}(e,r):A.push(e)}function j(e,t){p.trigger(g.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function H(e){e.error?p.trigger(g.KEY_STATUSES_CHANGED,{data:null,error:e.error}):S.debug("DRM: key status = "+e.status)}function K(e){S.debug("DRM: onKeyMessage");var a=e.data;p.trigger(g.KEY_MESSAGE,{data:a});var o=a.messageType?a.messageType:"license-request",v=a.message,m=a.sessionToken,y=F(C),E=C?C.systemString:null,b=t.getLicenseServer(C,y,o),A={sessionToken:m,messageType:o};if(v&&0!==v.byteLength){if(!b)return S.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+m.getSessionID()),void j(A);if(t.isClearKey(C)){var w=t.processClearKeyLicenseRequest(C,y,v);if(w)return S.debug("DRM: ClearKey license request handled by application!"),j(A),void n.updateKeySession(m,w)}var R=null;if(y&&y.serverURL){var D=y.serverURL;"string"==typeof D&&""!==D?R=D:"object"===(void 0===D?"undefined":r(D))&&D.hasOwnProperty(o)&&(R=D[o])}else if(y&&y.laURL&&""!==y.laURL)R=y.laURL;else if(t.isClearKey(C))R=C.getLicenseServerUrlFromMediaInfo(I);else{var N=i.default.getPSSHData(m.initData);(R=C.getLicenseServerURLFromInitData(N))||(R=e.data.laURL)}if(R=b.getServerURLFromMessage(R,v,o)){var O={},x=!1,P=function(e){if(e)for(var t in e)"authorization"===t.toLowerCase()&&(x=!0),O[t]=e[t]};y&&P(y.httpRequestHeaders),P(C.getRequestHeadersFromMessage(v)),y&&"boolean"==typeof y.withCredentials&&(x=y.withCredentials);var k=function(e,t,n,r){var i=e.response?b.getErrorResponse(e.response,n,r):"NONE";j(t,new u.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+i))},U=function(e){if(n)if(200===e.status){var t=new c.default(e.responseURL,f.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),e.response);q(L,t).then((function(){var r=b.getLicenseMessage(t.data,E,o);null!==r?(j(A),n.updateKeySession(m,r)):k(e,A,E,o)}))}else k(e,A,E,o)},B=function(e){j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+E+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},G=function(e){j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+E+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},H=C.getLicenseRequestFromMessage(v),K=b.getHTTPMethod(o),V=b.getResponseType(E,o),Y=y&&!isNaN(y.httpTimeout)?y.httpTimeout:8e3,W=m.getSessionID()||null,z=new l.default(R,K,V,O,x,o,W,H);q(M,z).then((function(){!function e(t,n,r,i,a,o){var s=new XMLHttpRequest;if(_.get().streaming.cmcd&&_.get().streaming.cmcd.enabled){if(_.get().streaming.cmcd.mode===h.default.CMCD_MODE_QUERY){var u=T.getQueryParameter({url:t.url,type:d.HTTPRequest.LICENSE});u&&(t.url=f.default.addAditionalQueryParameterToUrl(t.url,[u]))}}s.open(t.method,t.url,!0),s.responseType=t.responseType,s.withCredentials=t.withCredentials,r>0&&(s.timeout=r);for(var l in t.headers)s.setRequestHeader(l,t.headers[l]);if(_.get().streaming.cmcd&&_.get().streaming.cmcd.enabled){if(_.get().streaming.cmcd.mode===h.default.CMCD_MODE_HEADER){var c=T.getHeaderParameters({url:t.url,type:d.HTTPRequest.LICENSE});if(c)for(var v in c){var m=c[v];m&&s.setRequestHeader(v,m)}}}var y=function(){n--,setTimeout((function(){e(t,n,r,i,a,o)}),1e3)};s.onload=function(){200===this.status||n<=0?i(this):(S.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+n),y())},s.ontimeout=s.onerror=function(){n<=0?o(this):(S.warn("License request network request failed . Retrying it... Pending retries: "+n),y())},s.onabort=function(){a(this)},p.trigger(g.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),s.send(t.data)}(z,3,Y,U,B,G)}))}else j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}else j(A,new u.default(s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function V(e,n){if(S.debug("DRM: onNeedKey"),"cenc"===e.key.initDataType)if(0===I.length&&(S.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(n=void 0===n?1:n+1)<5))E.push(setTimeout((function(){V(e,n)}),500));else{var r=e.key.initData;if(ArrayBuffer.isView(r)&&(r=r.buffer),C){var a=i.default.getPSSHForKeySystem(C,r);if(a&&x(a))return}S.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(r)));var o=t.getSupportedKeySystems(r,w);0!==o.length?G(o,!1):S.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}else S.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType)}function q(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}return b={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");N(),p.on(g.INTERNAL_KEY_MESSAGE,K,this),p.on(g.INTERNAL_KEY_STATUS_CHANGED,H,this),I.push(e);var n=t.getSupportedKeySystemsFromContentProtection(e.contentProtection);n&&n.length>0&&G(n,!0)},clearMediaInfoArrayByStreamId:function(e){I=I.filter((function(t){return t.streamInfo.id!==e}))},createKeySession:O,loadKeySession:P,removeKeySession:function(e){N(),n.removeKeySession(e)},closeKeySession:function(e){N(),n.closeKeySession(e)},setServerCertificate:function(e){N(),n.setServerCertificate(e)},setMediaElement:k,setSessionType:function(e){R=e},setRobustnessLevel:function(e){D=e},setProtectionData:function(e){w=e,t.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return N(),t.getSupportedKeySystemsFromContentProtection(e)},getKeySystems:function(){return t?t.getKeySystems():[]},setKeySystems:function(e){t&&t.setKeySystems(e)},setLicenseRequestFilters:function(e){M=e},setLicenseResponseFilters:function(e){L=e},stop:function(){n&&n.stop()},reset:function(){N(),M=[],L=[],p.off(g.INTERNAL_KEY_MESSAGE,K,this),p.off(g.INTERNAL_KEY_STATUS_CHANGED,H,this),k(null),C=void 0,n&&(n.reset(),n=null),E.forEach((function(e){return clearTimeout(e)})),E=[],I=[]}},S=v.getLogger(b),A=[],I=[],R="temporary",D="",M=[],L=[],b}g.__dashjs_factory_name="ProtectionController",t.default=dashjs.FactoryMaker.getClassFactory(g)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r,i,a,o,s,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=o,this.sessionId=s,this.data=u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(59)),i=s(n(60)),a=s(n(24)),o=s(n(18));function s(e){return e&&e.__esModule?e:{default:e}}var u="e2719d58-a985-b3c9-781a-b030af78d30e",l=o.default.CLEARKEY_KEYSTEM_STRING,c="urn:uuid:"+u;function d(e){var t=(e=e||{}).BASE64,n={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]};return{uuid:u,schemeIdURI:c,systemString:l,getInitData:function(e,n){try{var r=a.default.parseInitDataFromContentProtection(e,t);if(!r&&n){var i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(i))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getLicenseServerUrlFromMediaInfo:function(e){try{if(!e||0===e.length)return null;for(var t=0,r=null;t<e.length&&!r;){var i=e[t];if(i&&i.contentProtection&&i.contentProtection.length>0){var a=i.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===c}));if(a&&a.length>0)for(var o=0;o<a.length&&!r;){for(var s=a[o],u=0;u<n.attributes.length&&!r;){for(var l=0,d=n.attributes[u];l<n.prefixes.length&&!r;){var f=n.prefixes[l];s[d]&&s[d].__prefix&&s[d].__prefix===f&&s[d].__text&&(r=s[d].__text),l+=1}u+=1}o+=1}}t+=1}return r}catch(e){return null}},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),o=[],s=0;s<a.kids.length;s++){var u=a.kids[s],l=e.clearkeys&&e.clearkeys.hasOwnProperty(u)?e.clearkeys[u]:null;if(!l)throw new Error("DRM: ClearKey keyID ("+u+") is not known!");o.push(new r.default(u,l))}n=new i.default(o)}return n}}}d.__dashjs_factory_name="KeySystemClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(59)),i=s(n(60)),a=s(n(24)),o=s(n(18));function s(e){return e&&e.__esModule?e:{default:e}}var u="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",l=o.default.CLEARKEY_KEYSTEM_STRING;function c(e){var t=void 0,n=e.BASE64,o=e.debug.getLogger(t);return t={uuid:u,schemeIdURI:"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",systemString:l,getInitData:function(e){return a.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],u=0;u<a.kids.length;u++){var l=a.kids[u],c=e.clearkeys&&e.clearkeys.hasOwnProperty(l)?e.clearkeys[l]:null;if(!c)throw new Error("DRM: ClearKey keyID ("+l+") is not known!");s.push(new r.default(l,c))}n=new i.default(s),o.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}}}c.__dashjs_factory_name="KeySystemW3CClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(24)),i=a(n(18));function a(e){return e&&e.__esModule?e:{default:e}}var o="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",s=i.default.WIDEVINE_KEYSTEM_STRING;function u(e){var t=null,n=(e=e||{}).BASE64;return{uuid:o,schemeIdURI:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",systemString:s,init:function(e){e&&(t=e)},getInitData:function(e){return r.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(e){return t&&t.sessionId?t.sessionId:e&&e.sessionId?e.sessionId:null}}}u.__dashjs_factory_name="KeySystemWidevine",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(24)),i=a(n(18));function a(e){return e&&e.__esModule?e:{default:e}}var o="9a04f079-9840-4286-ab92-e65be0885f95",s=i.default.PLAYREADY_KEYSTEM_STRING,u=void 0;function l(e){var t="utf-16",n=(e=e||{}).BASE64;function i(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:o,schemeIdURI:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",systemString:s,getInitData:function(e){var t,a,o,s=new Uint8Array([112,115,115,104,0,0,0,0]),u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),l=0,c=null,d=void 0,f=void 0;if(i(),!e)return null;if("pssh"in e)return r.default.parseInitDataFromContentProtection(e,n);if("pro"in e)c=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;c=n.decodeArray(e.prheader.__text)}return t=c.length,a=4+s.length+u.length+4+t,o=new ArrayBuffer(a),d=new Uint8Array(o),(f=new DataView(o)).setUint32(l,a),l+=4,d.set(s,l),l+=s.length,d.set(u,l),l+=u.length,f.setUint32(l,t),l+=4,d.set(c,l),l+=t,d.buffer},getRequestHeadersFromMessage:function(e){var n,r=void 0,i={},a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,o);for(var s=(r=a.parseFromString(n,"application/xml")).getElementsByTagName("name"),u=r.getElementsByTagName("value"),l=0;l<s.length;l++)i[s[l].childNodes[0].nodeValue]=u[l].childNodes[0].nodeValue;return i.hasOwnProperty("Content")&&(i["Content-Type"]=i.Content,delete i.Content),i.hasOwnProperty("Content-Type")||(i["Content-Type"]="text/xml; charset=utf-8"),i},getLicenseRequestFromMessage:function(e){var r=null,a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);i();var s=String.fromCharCode.apply(null,o),u=a.parseFromString(s,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(r=n.decode(l)),r},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var o=t.getUint16(r,!0);r+=2;var s=t.getUint16(r,!0);if(r+=2,1===o){var u=e.slice(r,r+s),l=String.fromCharCode.apply(null,new Uint16Array(u)),c=i.parseFromString(l,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var d=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(c.getElementsByTagName("LUI_URL")[0]){var f=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else r+=s}return null},getCDMData:function(){var e=void 0,t=void 0,r=void 0,a=void 0;if(i(),u&&u.cdmData){for(e=[],a=0;a<u.cdmData.length;++a)e.push(u.cdmData.charCodeAt(a)),e.push(0);for(e=String.fromCharCode.apply(null,e),e=n.encode(e),t='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",e),r=[],a=0;a<t.length;++a)r.push(t.charCodeAt(a)),r.push(0);return new Uint8Array(r).buffer}return null},getSessionId:function(e){return u&&u.sessionId?u.sessionId:e&&e.sessionId?e.sessionId:null},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e},init:function(e){e&&(u=e)}}}l.__dashjs_factory_name="KeySystemPlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(l)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(18),a=(r=i)&&r.__esModule?r:{default:r};function o(e){var t=(e=e||{}).BASE64,n={};n[a.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[a.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}};return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}o.__dashjs_factory_name="DRMToday",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";function r(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,o=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(o?o.getElementsByTagNameNS(e,"Fault")[0]:null)return null}return n}function r(n){var r="",i="",a="",o=-1,s=-1;if(window.DOMParser){var u=t(n),l=(new window.DOMParser).parseFromString(u,"text/xml"),c=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,d=c?c.getElementsByTagNameNS(e,"Body")[0]:null,f=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=f?f.getElementsByTagName("detail")[0]:null,p=h?h.getElementsByTagName("Exception")[0]:null,g=null;if(null===f)return u;r=(g=f.getElementsByTagName("faultstring")[0].firstChild)?g.nodeValue:null,null!==p&&(i=(g=p.getElementsByTagName("StatusCode")[0])?g.firstChild.nodeValue:null,o=(a=(g=p.getElementsByTagName("Message")[0])?g.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,s=a?a.indexOf("]"):-1,a=a?a.substring(o,s):"")}var v="code: "+i+", name: "+r;return a&&(v+=", message: "+a),v}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="PlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";function r(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}Object.defineProperty(t,"__esModule",{value:!0}),r.__dashjs_factory_name="Widevine",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(59)),i=a(n(60));function a(e){return e&&e.__esModule?e:{default:e}}function o(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var a=e.keys[n],o=a.kid.replace(/=/g,""),s=a.k.replace(/=/g,"");t.push(new r.default(o,s))}return new i.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}o.__dashjs_factory_name="ClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(33);var a=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=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.__proto__||Object.getPrototypeOf(t)).call(this));return e.INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_SYSTEM_SELECTED="internalKeySystemSelected",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e}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}(((r=i)&&r.__esModule?r:{default:r}).default));t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(40)),i=c(n(61)),a=c(n(32)),o=c(n(6)),s=c(n(62)),u=c(n(63)),l=c(n(18));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.eventBus,c=e.events,d=e.debug,f=void 0,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0;function T(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function _(e){for(var t=0;t<m.length;t++)if(m[t]===e){m.splice(t,1);break}}function b(e){var t=void 0,n=void 0;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function S(e,t,r,i){var u={session:e,initData:t,sessionId:i,handleEvent:function(e){switch(e.type){case"keystatuseschange":n.trigger(c.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=b(arguments);switch(e.status){case"expired":n.trigger(c.INTERNAL_KEY_STATUS_CHANGED,{error:new o.default(a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:n.trigger(c.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(c.INTERNAL_KEY_MESSAGE,{data:new s.default(this,t,void 0,e.messageType)})}},getSessionID:function(){return e.sessionId},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=b(arguments);"usable"===e.status&&(t=!0)})),t},getSessionType:function(){return r}};return e.addEventListener("keystatuseschange",u),e.addEventListener("message",u),e.closed.then((function(){_(u),h.debug("DRM: Session closed. SessionID = "+u.getSessionID()),n.trigger(c.KEY_SESSION_CLOSED,{data:u.getSessionID()})})),m.push(u),u}return f={getAllInitData:function(){for(var e=[],t=0;t<m.length;t++)m[t].initData&&e.push(m[t].initData);return e},requestKeySystemAccess:function(e){!function e(t,r){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess)return void n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Insecure origins are not allowed"});!function(r){var i=t[r].ks,a=t[r].configs,o=i.systemString;o===l.default.PLAYREADY_KEYSTEM_STRING&&"required"===a[0].persistentState&&(o+=".recommendation"),navigator.requestMediaKeySystemAccess(o,a).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,r=new u.default(i,t);r.mksa=e,n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{data:r})})).catch((function(i){++r<t.length?e(t,r):n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! "+i.message})}))}(r)}(e,0)},getKeySystem:function(){return p},selectKeySystem:function(e){e.mksa.createMediaKeys().then((function(t){p=e.keySystem,v=t,g?g.setMediaKeys(v).then((function(){n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)})):n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)})).catch((function(){n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))},setMediaElement:function(e){g!==e&&(g&&(g.removeEventListener("encrypted",y),g.setMediaKeys&&g.setMediaKeys(null)),(g=e)&&(g.addEventListener("encrypted",y),g.setMediaKeys&&v&&g.setMediaKeys(v)))},setServerCertificate:function(e){if(!p||!v)throw new Error("Can not set server certificate until you have selected a key system");v.setServerCertificate(e).then((function(){h.info("DRM: License server certificate successfully updated."),n.trigger(c.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){n.trigger(c.SERVER_CERTIFICATE_UPDATED,{error:new o.default(a.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,a.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e,t,r){if(!p||!v)throw new Error("Can not create sessions until you have selected a key system");var i=v.createSession(r),s=S(i,e,r),u=this.getKeySystem().systemString===l.default.CLEARKEY_KEYSTEM_STRING&&(e||t&&t.clearkeys)?"keyids":"cenc";i.generateRequest(u,e).then((function(){h.debug("DRM: Session created. SessionID = "+s.getSessionID()),n.trigger(c.KEY_SESSION_CREATED,{data:s})})).catch((function(e){_(s),n.trigger(c.KEY_SESSION_CREATED,{data:null,error:new o.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var r=e.session;E.isClearKey(p)&&(t=t.toJWK()),r.update(t).catch((function(t){n.trigger(c.KEY_ERROR,{data:new o.default(a.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e,t,r){if(!p||!v)throw new Error("Can not load sessions until you have selected a key system");for(var i=0;i<m.length;i++)if(e===m[i].sessionId)return void h.warn("DRM: Ignoring session ID because we have already seen it!");var s=v.createSession(r),u=S(s,t,r,e);s.load(e).then((function(t){t?(h.debug("DRM: Session loaded. SessionID = "+u.getSessionID()),n.trigger(c.KEY_SESSION_CREATED,{data:u})):(_(u),n.trigger(c.KEY_SESSION_CREATED,{data:null,error:new o.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+e+")")}))})).catch((function(t){_(u),n.trigger(c.KEY_SESSION_CREATED,{data:null,error:new o.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+e+")! "+t.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){h.debug("DRM: Session removed. SessionID = "+e.getSessionID()),n.trigger(c.KEY_SESSION_REMOVED,{data:e.getSessionID()})}),(function(t){n.trigger(c.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionID()+"). "+t.name})}))},closeKeySession:function(e){T(e).catch((function(t){_(e),n.trigger(c.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionID()+") "+t.name})}))},stop:function(){for(var e=void 0,t=0;t<m.length;t++)(e=m[t]).getUsable()||T(e).catch((function(){_(e)}))},reset:function(){var e=m.length,t=void 0;0!==e?function(){for(var r=function(e){_(e),0===m.length&&(g?(g.removeEventListener("encrypted",y),g.setMediaKeys(null).then((function(){n.trigger(c.TEARDOWN_COMPLETE)}))):n.trigger(c.TEARDOWN_COMPLETE))},i=0;i<e;i++)!function(e){t.session.closed.then((function(){r(e)})),T(t).catch((function(){r(e)}))}(t=m[i])}():n.trigger(c.TEARDOWN_COMPLETE)}},h=d.getLogger(f),p=null,g=null,v=null,m=[],E=(0,r.default)(t).getInstance(),y={handleEvent:function(e){switch(e.type){case"encrypted":if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(c.NEED_KEY,{key:new i.default(t,e.initDataType)})}}}},f}d.__dashjs_factory_name="ProtectionModel_21Jan2015",t.default=dashjs.FactoryMaker.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(40)),i=c(n(61)),a=c(n(6)),o=c(n(32)),s=c(n(62)),u=c(n(58)),l=c(n(63));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.eventBus,c=e.events,d=e.debug,f=e.api,h=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0;function b(){try{for(var e=0;e<E.length;e++)S(E[e]);g&&g.removeEventListener(f.needkey,T),n.trigger(c.TEARDOWN_COMPLETE)}catch(e){n.trigger(c.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function S(e){var t=e.session;t.removeEventListener(f.error,e),t.removeEventListener(f.message,e),t.removeEventListener(f.ready,e),t.removeEventListener(f.close,e);for(var n=0;n<E.length;n++)if(E[n]===e){E.splice(n,1);break}t[f.release]()}function A(){var e=null,t=function(){g.removeEventListener("loadedmetadata",e),g[f.setMediaKeys](m),n.trigger(c.VIDEO_ELEMENT_SELECTED)};g.readyState>=1?t():(e=t.bind(this),g.addEventListener("loadedmetadata",e))}return h={getAllInitData:function(){for(var e=[],t=0;t<E.length;t++)e.push(E[t].initData);return e},requestKeySystemAccess:function(e){for(var t=!1,r=0;r<e.length;r++)for(var i=e[r].ks.systemString,a=e[r].configs,o=null,s=null,d=0;d<a.length;d++){var h=a[d].audioCapabilities,p=a[d].videoCapabilities;if(h&&0!==h.length){o=[];for(var g=0;g<h.length;g++)window[f.MediaKeys].isTypeSupported(i,h[g].contentType)&&o.push(h[g])}if(p&&0!==p.length){s=[];for(var v=0;v<p.length;v++)window[f.MediaKeys].isTypeSupported(i,p[v].contentType)&&s.push(p[v])}if(!(!o&&!s||o&&0===o.length||s&&0===s.length)){t=!0;var m=new u.default(o,s),y=_.getKeySystemBySystemString(i);n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{data:new l.default(y,m)});break}}t||n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return v},selectKeySystem:function(e){try{m=e.mediaKeys=new window[f.MediaKeys](e.keySystem.systemString),v=e.keySystem,y=e,g&&A(),n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)}catch(e){n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+v.systemString+")! Could not create MediaKeys -- TODO"})}},setMediaElement:function(e){g!==e&&(g&&g.removeEventListener(f.needkey,T),(g=e)&&(g.addEventListener(f.needkey,T),m&&A()))},createKeySession:function(e,t,r,i){if(!v||!m||!y)throw new Error("Can not create sessions until you have selected a key system");var u=null;if(y.ksConfiguration.videoCapabilities&&y.ksConfiguration.videoCapabilities.length>0&&(u=y.ksConfiguration.videoCapabilities[0]),null===u&&y.ksConfiguration.audioCapabilities&&y.ksConfiguration.audioCapabilities.length>0&&(u=y.ksConfiguration.audioCapabilities[0]),null===u)throw new Error("Can not create sessions for unknown content types.");var l=u.contentType,d=m.createSession(l,new Uint8Array(e),i?new Uint8Array(i):null),h=function(e,t){return{session:e,initData:t,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case f.error:n.trigger(c.KEY_ERROR,{data:new a.default(o.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case f.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(c.INTERNAL_KEY_MESSAGE,{data:new s.default(this,t,e.destinationURL)});break;case f.ready:p.debug("DRM: Key added."),n.trigger(c.KEY_ADDED);break;case f.close:p.debug("DRM: Session closed. SessionID = "+this.getSessionID()),n.trigger(c.KEY_SESSION_CLOSED,{data:this.getSessionID()})}}}}(d,e);d.addEventListener(f.error,h),d.addEventListener(f.message,h),d.addEventListener(f.ready,h),d.addEventListener(f.close,h),E.push(h),p.debug("DRM: Session created. SessionID = "+h.getSessionID()),n.trigger(c.KEY_SESSION_CREATED,{data:h})},updateKeySession:function(e,t){var n=e.session;_.isClearKey(v)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t))},closeKeySession:S,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:b,reset:b},p=d.getLogger(h),g=null,v=null,m=null,y=null,E=[],_=(0,r.default)(t).getInstance(),T={handleEvent:function(e){switch(e.type){case f.needkey:if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(c.NEED_KEY,{key:new i.default(t,"cenc")})}}}},h}d.__dashjs_factory_name="ProtectionModel_3Feb2014",t.default=dashjs.FactoryMaker.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(40)),i=c(n(61)),a=c(n(6)),o=c(n(62)),s=c(n(58)),u=c(n(63)),l=c(n(32));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){e=e||{};var t=this.context,n=e.eventBus,c=e.events,d=e.debug,f=e.api,h=e.errHandler,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,E=void 0,T=void 0,_=void 0,b=void 0;function S(){v&&w();for(var e=0;e<T.length;e++)A(T[e]);n.trigger(c.TEARDOWN_COMPLETE)}function A(e){try{v[f.cancelKeyRequest](m.systemString,e.sessionID)}catch(t){n.trigger(c.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionID+") "+t.message})}}function I(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionID==t)return e[r];return null}return null}function w(){v.removeEventListener(f.keyerror,b),v.removeEventListener(f.needkey,b),v.removeEventListener(f.keymessage,b),v.removeEventListener(f.keyadded,b)}return p={getAllInitData:function(){for(var e=[],t=0;t<E.length;t++)e.push(E[t].initData);for(var n=0;n<T.length;n++)e.push(T[n].initData);return e},requestKeySystemAccess:function(e){var t=v;t||(t=document.createElement("video"));for(var r=!1,i=0;i<e.length;i++)for(var a=e[i].ks.systemString,o=e[i].configs,l=null,d=0;d<o.length;d++){var f=o[d].videoCapabilities;if(f&&0!==f.length){l=[];for(var h=0;h<f.length;h++)""!==t.canPlayType(f[h].contentType,a)&&l.push(f[h])}if(l&&(!l||0!==l.length)){r=!0;var p=new s.default(null,l),g=y.getKeySystemBySystemString(a);n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{data:new u.default(g,p)});break}}r||n.trigger(c.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return m},selectKeySystem:function(e){m=e.keySystem,n.trigger(c.INTERNAL_KEY_SYSTEM_SELECTED)},setMediaElement:function(e){if(v!==e){if(v){w();for(var t=0;t<T.length;t++)A(T[t]);T=[]}(v=e)&&(v.addEventListener(f.keyerror,b),v.addEventListener(f.needkey,b),v.addEventListener(f.keymessage,b),v.addEventListener(f.keyadded,b),n.trigger(c.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!m)throw new Error("Can not create sessions until you have selected a key system");if(_||0===T.length){var t={sessionID:null,initData:e,getSessionID:function(){return this.sessionID},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return E.push(t),v[f.generateKeyRequest](m.systemString,new Uint8Array(e)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionID;if(y.isClearKey(m))for(var r=0;r<t.keyPairs.length;r++)v[f.addKey](m.systemString,t.keyPairs[r].key,t.keyPairs[r].keyID,n);else v[f.addKey](m.systemString,new Uint8Array(t),new Uint8Array(e.initData),n)},closeKeySession:A,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},g=d.getLogger(p),v=null,m=null,E=[],T=[],y=(0,r.default)(t).getInstance(),b={handleEvent:function(e){var t=null;switch(e.type){case f.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(c.NEED_KEY,{key:new i.default(r,"cenc")});break;case f.keyerror:if((t=I(T,e.sessionId))||(t=I(E,e.sessionId)),t){var s=l.default.MEDIA_KEYERR_CODE,u="";switch(e.errorCode.code){case 1:s=l.default.MEDIA_KEYERR_UNKNOWN_CODE,u+="MEDIA_KEYERR_UNKNOWN - "+l.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:s=l.default.MEDIA_KEYERR_CLIENT_CODE,u+="MEDIA_KEYERR_CLIENT - "+l.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:s=l.default.MEDIA_KEYERR_SERVICE_CODE,u+="MEDIA_KEYERR_SERVICE - "+l.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:s=l.default.MEDIA_KEYERR_OUTPUT_CODE,u+="MEDIA_KEYERR_OUTPUT - "+l.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:s=l.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,u+="MEDIA_KEYERR_HARDWARECHANGE - "+l.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:s=l.default.MEDIA_KEYERR_DOMAIN_CODE,u+="MEDIA_KEYERR_DOMAIN - "+l.default.MEDIA_KEYERR_DOMAIN_MESSAGE}u+=" System Code = "+e.systemCode,n.trigger(c.KEY_ERROR,{data:new a.default(s,u,t)})}else g.error("No session token found for key error");break;case f.keyadded:(t=I(T,e.sessionId))||(t=I(E,e.sessionId)),t?(g.debug("DRM: Key added."),n.trigger(c.KEY_ADDED,{data:t})):g.debug("No session token found for key added");break;case f.keymessage:if((_=null!==e.sessionId&&void 0!==e.sessionId)?!(t=I(T,e.sessionId))&&E.length>0&&(t=E.shift(),T.push(t),t.sessionID=e.sessionId,n.trigger(c.KEY_SESSION_CREATED,{data:t})):E.length>0&&(t=E.shift(),T.push(t),0!==E.length&&h.error(new a.default(l.default.MEDIA_KEY_MESSAGE_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var d=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=d,n.trigger(c.INTERNAL_KEY_MESSAGE,{data:new o.default(t,d,e.defaultURL)})}else g.warn("No session token found for key message")}}},p}d.__dashjs_factory_name="ProtectionModel_01b",t.default=dashjs.FactoryMaker.getClassFactory(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(64),a=(r=i)&&r.__esModule?r:{default:r};var o=function(){var e=void 0;function t(t,n,r){if(!t||!/^VIDEO$/i.test(t.nodeName))return null;if(t._dashjs_player)return t._dashjs_player;var i=void 0,o=t.id||t.name||"video element";if(!(n=n||[].slice.call(t.querySelectorAll("source")).filter((function(e){return"application/dash+xml"==e.type}))[0])&&t.src)(n=document.createElement("source")).src=t.src;else if(!n&&!t.src)return null;return r=r||{},(i=(0,a.default)(r).create()).initialize(t,n.src,t.autoplay),e||(e=i.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+n.src),t._dashjs_player=i,i}function n(e){return/^VIDEO$/i.test(e.nodeName)?e:n(e.parentNode)}return{create:t,createAll:function(e,r){var i=[];e=e||"[data-dashjs-player]";for(var a=(r=r||document).querySelectorAll(e),o=0;o<a.length;o++){var s=t(a[o],null);i.push(s)}for(var u=r.querySelectorAll('source[type="application/dash+xml"]'),l=0;l<u.length;l++){var c=t(n(u[l]),null);i.push(c)}return i}}}(),s=void 0;!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?o.createAll():s=window.setInterval((function(){window.dashjs&&(window.clearInterval(s),o.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),o.createAll()}))),t.default=o},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return Be}));var r,i,a,o,s,u=n(4),l=(n(25),{}),c=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,n){var r,i,a,o=arguments,s={};for(a in t)"key"==a?r=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>3)for(n=[n],a=3;a<arguments.length;a++)n.push(o[a]);if(null!=n&&(s.children=n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return g(e,s,r,i,null)}function g(e,t,n,i,a){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:a};return null==a&&(o.__v=o),null!=r.vnode&&r.vnode(o),o}function v(e){return e.children}function m(e,t){this.props=e,this.context=t}function y(e,t){if(null==t)return e.__?y(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?y(e):null}function E(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return E(e)}}function T(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!_.__r++||o!==r.debounceRendering)&&((o=r.debounceRendering)||a)(_)}function _(){for(var e;_.__r=i.length;)e=i.sort((function(e,t){return e.__v.__b-t.__v.__b})),i=[],e.some((function(e){var t,n,r,i,a,o,s;e.__d&&(o=(a=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=f({},a)).__v=r,i=R(s,a,r,t.__n,void 0!==s.ownerSVGElement,null,n,null==o?y(a):o),D(n,a),i!=o&&E(a)))}))}function b(e,t,n,r,i,a,o,s,u,d){var f,p,m,E,T,_,b,A=r&&r.__k||c,I=A.length;for(u==l&&(u=null!=o?o[0]:I?y(r,0):null),n.__k=[],f=0;f<t.length;f++)if(null!=(E=n.__k[f]=null==(E=t[f])||"boolean"==typeof E?null:"string"==typeof E||"number"==typeof E?g(null,E,null,null,E):Array.isArray(E)?g(v,{children:E},null,null,null):null!=E.__e||null!=E.__c?g(E.type,E.props,E.key,null,E.__v):E)){if(E.__=n,E.__b=n.__b+1,null===(m=A[f])||m&&E.key==m.key&&E.type===m.type)A[f]=void 0;else for(p=0;p<I;p++){if((m=A[p])&&E.key==m.key&&E.type===m.type){A[p]=void 0;break}m=null}T=R(e,E,m=m||l,i,a,o,s,u,d),(p=E.ref)&&m.ref!=p&&(b||(b=[]),m.ref&&b.push(m.ref,null,E),b.push(p,E.__c||T,E)),null!=T?(null==_&&(_=T),u=S(e,E,m,A,o,T,u),d||"option"!=n.type?"function"==typeof n.type&&(n.__d=u):e.value=""):u&&m.__e==u&&u.parentNode!=e&&(u=y(m))}if(n.__e=_,null!=o&&"function"!=typeof n.type)for(f=o.length;f--;)null!=o[f]&&h(o[f]);for(f=I;f--;)null!=A[f]&&M(A[f],A[f]);if(b)for(f=0;f<b.length;f++)C(b[f],b[++f],b[++f])}function S(e,t,n,r,i,a,o){var s,u,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(i==n||a!=o||null==a.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(a),s=null;else{for(u=o,l=0;(u=u.nextSibling)&&l<r.length;l+=2)if(u==a)break e;e.insertBefore(a,o),s=o}return void 0!==s?s:a.nextSibling}function A(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||d.test(t)?n:n+"px"}function I(e,t,n,r,i){var a,o;if(i&&"className"==t&&(t="class"),"style"===t)if("string"==typeof n)e.style=n;else{if("string"==typeof r&&(e.style=r=""),r)for(t in r)n&&t in n||A(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||A(e.style,t,n[t])}else"o"===t[0]&&"n"===t[1]?(a=t!==(t=t.replace(/Capture$/,"")),(o=t.toLowerCase())in e&&(t=o),t=t.slice(2),e.l||(e.l={}),e.l[t]=n,n?r||e.addEventListener(t,w,a):e.removeEventListener(t,w,a)):"list"!==t&&"tagName"!==t&&"form"!==t&&"type"!==t&&"size"!==t&&"download"!==t&&"href"!==t&&!i&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n&&!/^ar/.test(t)?e.removeAttribute(t):e.setAttribute(t,n))}function w(e){this.l[e.type](r.event?r.event(e):e)}function R(e,t,n,i,a,o,s,u,d){var h,p,g,y,E,T,_,A,w,R,D,C=t.type;if(void 0!==t.constructor)return null;(h=r.__b)&&h(t);try{e:if("function"==typeof C){if(A=t.props,w=(h=C.contextType)&&i[h.__c],R=h?w?w.props.value:h.__:i,n.__c?_=(p=t.__c=n.__c).__=p.__E:("prototype"in C&&C.prototype.render?t.__c=p=new C(A,R):(t.__c=p=new m(A,R),p.constructor=C,p.render=L),w&&w.sub(p),p.props=A,p.state||(p.state={}),p.context=R,p.__n=i,g=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=C.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=f({},p.__s)),f(p.__s,C.getDerivedStateFromProps(A,p.__s))),y=p.props,E=p.state,g)null==C.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==C.getDerivedStateFromProps&&A!==y&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(A,R),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(A,p.__s,R)||t.__v===n.__v){p.props=A,p.state=p.__s,t.__v!==n.__v&&(p.__d=!1),p.__v=t,t.__e=n.__e,t.__k=n.__k,p.__h.length&&s.push(p),function e(t,n,r){var i,a;for(i=0;i<t.__k.length;i++)(a=t.__k[i])&&(a.__=t,a.__e&&("function"==typeof a.type&&a.__k.length>1&&e(a,n,r),n=S(r,a,a,t.__k,null,a.__e,n),"function"==typeof t.type&&(t.__d=n)))}(t,u,e);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(A,p.__s,R),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(y,E,T)}))}p.context=R,p.props=A,p.state=p.__s,(h=r.__r)&&h(t),p.__d=!1,p.__v=t,p.__P=e,h=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(i=f(f({},i),p.getChildContext())),g||null==p.getSnapshotBeforeUpdate||(T=p.getSnapshotBeforeUpdate(y,E)),D=null!=h&&h.type==v&&null==h.key?h.props.children:h,b(e,Array.isArray(D)?D:[D],t,n,i,a,o,s,u,d),p.base=t.__e,p.__h.length&&s.push(p),_&&(p.__E=p.__=null),p.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,a,o,s){var u,d,f,h,p,g=n.props,v=t.props;if(i="svg"===t.type||i,null!=a)for(u=0;u<a.length;u++)if(null!=(d=a[u])&&((null===t.type?3===d.nodeType:d.localName===t.type)||e==d)){e=d,a[u]=null;break}if(null==e){if(null===t.type)return document.createTextNode(v);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,v.is&&{is:v.is}),a=null,s=!1}if(null===t.type)g!==v&&e.data!==v&&(e.data=v);else{if(null!=a&&(a=c.slice.call(e.childNodes)),f=(g=n.props||l).dangerouslySetInnerHTML,h=v.dangerouslySetInnerHTML,!s){if(null!=a)for(g={},p=0;p<e.attributes.length;p++)g[e.attributes[p].name]=e.attributes[p].value;(h||f)&&(h&&f&&h.__html==f.__html||(e.innerHTML=h&&h.__html||""))}(function(e,t,n,r,i){var a;for(a in n)"children"===a||"key"===a||a in t||I(e,a,null,n[a],r);for(a in t)i&&"function"!=typeof t[a]||"children"===a||"key"===a||"value"===a||"checked"===a||n[a]===t[a]||I(e,a,t[a],n[a],r)})(e,v,g,i,s),h?t.__k=[]:(u=t.props.children,b(e,Array.isArray(u)?u:[u],t,n,r,"foreignObject"!==t.type&&i,a,o,l,s)),s||("value"in v&&void 0!==(u=v.value)&&u!==e.value&&I(e,"value",u,g.value,!1),"checked"in v&&void 0!==(u=v.checked)&&u!==e.checked&&I(e,"checked",u,g.checked,!1))}return e}(n.__e,t,n,i,a,o,s,d);(h=r.diffed)&&h(t)}catch(e){t.__v=null,r.__e(e,t,n)}return t.__e}function D(e,t){r.__c&&r.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){r.__e(e,t.__v)}}))}function C(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function M(e,t,n){var i,a,o;if(r.unmount&&r.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||C(i,null,t)),n||"function"==typeof e.type||(n=null!=(a=e.__e)),e.__e=e.__d=void 0,null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){r.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&M(i[o],t,n);null!=a&&h(a)}function L(e,t,n){return this.constructor(e,n)}function N(e,t,n){var i,a,o;r.__&&r.__(e,t),a=(i=n===s)?null:n&&n.__k||t.__k,e=p(v,null,[e]),o=[],R(t,(i?t:n||t).__k=e,a||l,l,void 0!==t.ownerSVGElement,n&&!i?[n]:a?null:t.childNodes.length?c.slice.call(t.childNodes):null,o,n||l,i),D(o,e)}r={__e:function(e,t){for(var n,r;t=t.__;)if((n=t.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(e))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(e)),r)return T(n.__E=n)}catch(t){e=t}throw e}},m.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),T(this))},m.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},m.prototype.render=v,i=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,s=l;var O,x,P,k=0,F=[],U=r.__r,B=r.diffed,G=r.__c,j=r.unmount;function H(e,t){r.__h&&r.__h(x,e,k||t),k=0;var n=x.__H||(x.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return k=1,function(e,t,n){var r=H(O++,2);return r.t=e,r.__c||(r.__c=x,r.__=[n?n(t):$(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}]),r.__}($,e)}function V(e,t){var n=H(O++,3);!r.__s&&Z(n.__H,t)&&(n.__=e,n.__H=t,x.__H.__h.push(n))}function q(e){return k=5,Y((function(){return{current:e}}),[])}function Y(e,t){var n=H(O++,7);return Z(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function W(e,t){return k=8,Y((function(){return e}),t)}function z(){F.some((function(e){if(e.__P)try{e.__H.__h.forEach(Q),e.__H.__h.forEach(J),e.__H.__h=[]}catch(t){return e.__H.__h=[],r.__e(t,e.__v),!0}})),F=[]}r.__r=function(e){U&&U(e),O=0;var t=(x=e.__c).__H;t&&(t.__h.forEach(Q),t.__h.forEach(J),t.__h=[])},r.diffed=function(e){B&&B(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==F.push(t)&&P===r.requestAnimationFrame||((P=r.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),X&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);X&&(t=requestAnimationFrame(n))})(z))},r.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Q),e.__h=e.__h.filter((function(e){return!e.__||J(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],r.__e(n,e.__v)}})),G&&G(e,t)},r.unmount=function(e){j&&j(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(Q)}catch(e){r.__e(e,t.__v)}};var X="function"==typeof requestAnimationFrame;function Q(e){"function"==typeof e.u&&e.u()}function J(e){e.u=e.__()}function Z(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function $(e,t){return"function"==typeof t?t(e):t}var ee=n(19),te=n.n(ee);function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var ie,ae,oe=function(){function e(){var e;this.emitter={all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map((function(e){e(n)})),(e.get("*")||[]).slice().map((function(e){e(t,n)}))}}}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();(ae=ie||(ie={})).AVAILABILITY_CHANGED="airplay:availability_changed",ae.TARGET_CHANGED="airplay:target_changed";var se=function(e){var t,n;function r(t){var n;return(n=e.call(this)||this).video=t,window.WebKitPlaybackTargetAvailabilityEvent?(t.addEventListener("webkitplaybacktargetavailabilitychanged",n.onAvailabilityChanged=n.onAvailabilityChanged.bind(re(n))),t.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",n.onTargetChanged=n.onTargetChanged.bind(re(n)))):n.emit(ie.AVAILABILITY_CHANGED,{available:!1}),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ne(t,n);var i=r.prototype;return i.onAvailabilityChanged=function(e){this.emit(ie.AVAILABILITY_CHANGED,{available:"available"===e.availability})},i.onTargetChanged=function(e){this.emit(ie.TARGET_CHANGED,{wireless:!0})},i.toggleAirPlay=function(){this.video.webkitShowPlaybackTargetPicker()},i.destroy=function(){this.video.removeEventListener("webkitplaybacktargetavailabilitychanged",this.onAvailabilityChanged)},r}(oe);function ue(e,t){return(ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var le,ce,de=function(){function e(){var e;this.emitter={all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map((function(e){e(n)})),(e.get("*")||[]).slice().map((function(e){e(t,n)}))}}}var t=e.prototype;return t.on=function(e,t){this.emitter.on.apply(this,arguments)},t.off=function(e,t){this.emitter.on.apply(this,arguments)},t.emit=function(e,t){this.emitter.emit.apply(this,arguments)},t.destroy=function(){this.emitter.all.clear()},e}();(ce=le||(le={})).CONNECTED="cast:connected",ce.DISCONNECTED="cast:disconnected",ce.STATE_CHANGE="cast:state_change";var fe=function(e){var t,n;function r(t,n){var r;return(r=e.call(this)||this).state={playbackState:u.b.IDLE,currentTime:0,duration:0,isLive:!1,isAtLiveEdge:!1,isSeekable:!0,isMuted:!1,audioTracks:[],textTracks:[],volume:1},function(e,t){return new Promise((function(n,r){window.__onGCastApiAvailable=function(i){i?(cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:e||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:t||chrome.cast.AutoJoinPolicy.PAGE_SCOPED}),n()):r(new Error("[Cast] not available"))};var i=document.createElement("script");i.src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",document.body.appendChild(i)}))}(t,n).then((function(){r.player=new cast.framework.RemotePlayer,r.playerController=new cast.framework.RemotePlayerController(r.player),r.setupListeners()}),(function(e){return console.error(e)})),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ue(t,n);var i=r.prototype;return i.setState=function(e){this.state=Object.assign({},this.state,e),this.emit(le.STATE_CHANGE,{state:this.state})},i.getPlaybackStateFromPlayerState=function(e){switch(e){case chrome.cast.media.PlayerState.BUFFERING:return u.b.BUFFERING;case chrome.cast.media.PlayerState.PAUSED:return u.b.PAUSED;case chrome.cast.media.PlayerState.PLAYING:return u.b.PLAYING;case chrome.cast.media.PlayerState.IDLE:return u.b.IDLE}},i.getDuration=function(){return this.player.liveSeekableRange?this.player.liveSeekableRange.end:this.player.duration},i.setupListeners=function(){var e=this;cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,(function(t){switch(t.sessionState){case cast.framework.SessionState.SESSION_STARTED:case cast.framework.SessionState.SESSION_RESUMED:e.emit(le.CONNECTED),e.setState({playbackState:u.b.READY,isMuted:e.player.isMuted});break;case cast.framework.SessionState.SESSION_ENDED:e.emit(le.DISCONNECTED),e.setState({playbackState:u.b.IDLE})}})),this.playerController.addEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,(function(t){var n=t.value;switch(t.field){case"currentTime":e.setState({currentTime:n,isAtLiveEdge:n>=e.state.duration-20});break;case"duration":e.setState({duration:n});break;case"playerState":var r=e.getPlaybackStateFromPlayerState(n);e.setState({playbackState:r}),r===u.b.IDLE&&e.stop();break;case"liveSeekableRange":e.setState(n?{isLive:!n.isLiveDone,duration:n.end-n.start,isSeekable:n.end-n.start>300}:{isLive:!1})}}))},i.load=function(e,t){void 0===t&&(t=null);var n=cast.framework.CastContext.getInstance().getCurrentSession(),r=new chrome.cast.media.MediaInfo(e,"video/mp4"),i=new chrome.cast.media.LoadRequest(r);return t&&(i.currentTime=t),n.loadMedia(i)},i.play=function(){this.playerController.playOrPause()},i.pause=function(){this.playerController.playOrPause()},i.stop=function(){this.playerController.stop()},i.mute=function(){this.playerController.muteOrUnmute()},i.unmute=function(){this.playerController.muteOrUnmute()},i.setAudioTrack=function(){},i.setTextTrack=function(){},i.seekTo=function(e){var t=e.position,n=e.change,r=e.percentage;r?t=Math.min(r,99.9)/100*this.getDuration():n&&(t=this.player.currentTime+n),this.player.currentTime=t,this.playerController.seek()},r}(de);function he(e){var t,n=e.onClick;return p("div",{class:te()("_1gDwG",(t={},t._22_VN=!e.isAtLiveEdge&&e.isSeekable,t)),onClick:n},"LIVE")}function pe(e){var t;return p("div",{class:"_-LGHu"},(void 0===(t=e.time)&&(t=0),[Math.floor(t/3600)%24,Math.floor(t/60)%60,Math.floor(t%60)].map((function(e){return e<10?"0"+e:e})).filter((function(e,t){return"00"!==e||t>0})).join(":")))}function ge(e){var t,n=e.currentTime,r=void 0===n?0:n,i=e.duration,a=void 0===i?0:i,o=e.handleSeek,s=e.handleSeekToLive,u=e.isLive,l=e.isAtLiveEdge,c=e.isSeekable,d=W((function(e){c&&o(e.offsetX/e.currentTarget.offsetWidth*100)}),[o,c]),f=!u||!l&&c?r/a*100||0:100;return p("div",{class:te()("_2aAzG",(t={},t._3K51E=!c,t))},p(pe,{time:r}),p("div",{class:"_t3a1b",onClick:d},p("div",{class:"_K1UW_"},p("div",{class:"_1Xt9z",style:{width:f+"%"}}))),u?p(he,{onClick:s,isAtLiveEdge:l,isSeekable:c}):p(pe,{time:a}))}function ve(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M8 5v14l11-7z"}))}function me(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}))}function ye(e){return p("div",{class:"_3njg6",onClick:e.onClick},p(e.playbackState!==u.b.PLAYING?ve:me,null))}function Ee(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"}))}function Te(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"}))}function _e(e){return p("div",{class:"_28pC9",onClick:e.onClick},p(e.muted?Te:Ee,null))}function be(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}))}function Se(e){var t,n=e.audioTracks,r=void 0===n?[]:n,i=e.onChange,a=K(!1),o=a[0],s=a[1],u=W((function(e){i(e.target.value)}),[i]);return p("div",{class:"_13aPK",onClick:W((function(){return s(!o)}),[o])},p(be,null),p("ul",{class:te()("_16WrP",(t={},t._Ib345=o,t))},r.map((function(e){return p("li",null,p("label",null,p("input",{type:"radio",name:"audioTrack",value:e.id,checked:e.enabled,onClick:u}),p("span",null,e.label)))}))))}function Ae(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))}function Ie(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))}function we(e){return p("div",{class:"_34Jhj",onClick:e.onClick},p(e.isFullscreen?Ae:Ie,null))}function Re(){return p("div",{class:"_2eFId"},p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"38",height:"38",viewBox:"0 0 38 38"},p("defs",null,p("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:"a"},p("stop",{"stop-color":"#fff","stop-opacity":"0",offset:"0%"}),p("stop",{"stop-color":"#fff","stop-opacity":".631",offset:"63.146%"}),p("stop",{"stop-color":"#fff",offset:"100%"}))),p("g",{fill:"none","fill-rule":"evenodd"},p("g",{transform:"translate(1 1)"},p("path",{d:"M36 18c0-9.94-8.06-18-18-18",id:"Oval-2",stroke:"url(#a)","stroke-width":"2"},p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"})),p("circle",{fill:"#fff",cx:"36",cy:"18",r:"1"},p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"}))))))}function De(){return!(!document.fullscreenElement&&!document.webkitFullscreenElement)}function Ce(){return p("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z"}))}function Me(e){var t,n=e.textTracks,r=void 0===n?[]:n,i=e.onChange,a=K(!1),o=a[0],s=a[1],u=W((function(e){i(e.target.value),e.stopPropagation()}),[i]);return p("div",{class:"_4r-db",onClick:W((function(){return s(!o)}),[o])},p(Ce,null),p("ul",{class:te()("_1b4Xq",(t={},t._8qwvr=o,t))},r.map((function(e){return p("li",null,p("label",null,p("input",{type:"radio",name:"audioTrack",value:e.id,checked:e.enabled,onClick:u}),p("span",null,e.label||e.language)))}))))}function Le(){return p("svg",{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",height:"24",viewBox:"0 0 24 24",width:"24"},p("rect",{fill:"none",height:"24",width:"24"}),p("g",null,p("polygon",{points:"6,22 18,22 12,16"}),p("path",{d:"M21,3H3C1.9,3,1,3.9,1,5v12c0,1.1,0.9,2,2,2h4v-2H3V5h18v12h-4v2h4c1.1,0,2-0.9,2-2V5C23,3.9,22.1,3,21,3z"})))}function Ne(e){return p("div",{class:"_2XaiH",onClick:e.onClick},p(Le,null))}function Oe(){return p("div",{class:"_mM3Gy"},p("google-cast-launcher",null))}function xe(){return(xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Pe(e){return p("img",{class:e.className,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAA5CAYAAABzlmQiAAAACXBIWXMAABcRAAAXEQHKJvM/AAAAB3RJTUUH4gQUEh4aiyLHmgAAFqJJREFUeNrtXQt4VcW1zhsChgBJIMEA8iwBlAJikIdQBBEQKOYiFeStIJSrovhCi22hqDwEFdEW1ArISyAEFBCrcMGqgFJFFDQIBVEUeQhBCI+c0zX0H7/VYWb2OSf7nCS3e3/f+pIze2b2zN7rn1lrzZo1UVFhuJptPhlNVImoHdFwoj8SPU80n2gh0V+JniZ6iKgfUVOieKIo74r85ff7b/L/+yoiSvXeSHhAEUfUnmgK0Xai80T+IOgk0Vqiu4lqC5B5b9UDSFkHhaAaRI8R7WPM/hNAsoRoJtFEzCLTiRYQvU90gshnAMsForeJbiFK8N502AHyK6LdRLuIqnhvxB1wCGDMAhgEU39D9BRRB6KKAZRPILoG4PqMgUX8/SdRIX7nEw0VIpj31r2rLACjHNH9mAH8mCn6E5UvRp0xANYqzB5niZYSPUt0jD2nvaeneFdpBkcToq1gWCFS3Sp0D5dFNgGCD/GMHUSdMDMVQq+ZQZQYYREkmqgN0VSi5UR5RIuIZhLdSVRbI9NPIXpYlHUQbUS+PxDFKfdqo7x4ziqi14heIHqAqDWvl/6vh3oEpVmel8ry1WPpWUh7kqiiplwCUTui8UQLiN4ELUQbazm8vyS8k8nox1tEa4leIhpJVOn/g67RH4q0ZNKkMM9SQmc5R/QjUQ+iXxJtAXAEgOpECByxRLOgwMrL5//P6zhRI1bmNqSfJ6pmqXsx8m1T0vsSnbQ8T7TlDpa/GlEh7t1ieV5f5DnHgWRS0gVoicYS7fXbr2NE7TXPq0o0g+ioQ/nPiWqUVXAI8WcCRJ/viLpGQswBKLtDxCqEwi6AM5WoiOgQUXYEADIKH7GAaBBRA6J0ooZEQ4iO4P48VuYKgENcfQz1CuY7iDwzWHojolNIFzPWVUQZYpQmupHofdz7lqg8m+G2If05S19mIc9HgVixBIhYP/4mQImZtDFRS6KhrA97iBIN9YrrRaLfoFxj1CNmnzO4v4SoTIJjOhTnT4jqlkAbrib6HiC5EcAZQHQGelDHMIIjnmgfPuDvDHkexv3DQhRhDLsL6U8bymUx5unD0v+MtPeIYjTlrmTl2rP0J5C2U1cOeT5DnidDAEhPQ52d2QzX1wKQFE1ZQb/H/bNOolppA4dY7JsMcAizbEoJtqUVRK3jRFlI60xUAJC0DhNAWrGP38CQpyPuX+BiAhutd+j0EEobg/uFUgwDIL9G+j0Wke9H5BnO0jsxsa6WplwN1pfOLgJEtOcLOUsEAxDkqQWRT1xDyxJARgEcQt6vGgRTJYKxhkMpE4rYUqJlQgwhmg7mEIxVOYj29IKY97GwmGEm6YyZ5FA4ZjcmXv0gmNcBIIK5Mll6LwacTM3IuVLqH1K0gGIudZ12AQCE6yEVoQuJa5Cm3CDcO2kRhYIGCPL9FXk+DAEgYrbNV0XN0g6OdmA8Yam6PABGSoY8uprohEER82nShPy5meheossD0EmehJI+Cb+l8aAIQK7gMkCmop0fm+RjSh+MPKLfFVh6FaKfcG+wUqYcY/LJLL0DezeZFkuUvG5U7uUh/VVNuVdxb7XmXnEB8ijyfCMAHAxAkG8d8iwvC+CoTLSX6LRYyHNgoNoQJU6w6f19mAtvIWpOVB2zSnlYNbLw4h6FqfA0k0GFVae5pW2JWFQU+kh9BpwpAM5MlwHyEtr2tuF+OSiX4tqgggjmTHEt0ph35XUdS89hVqZkw2g7nA0uqcr9Ebh3SOpDzCBwGPdGhgEgdzJrXmIIAFlge8+lzZz7ApjtXpO1StitiaYx06JQ/u6CdYfniyFqRnQ78s8DCOZCObuZqC7Mov/HRJL5JrMfrGhC9FuomIW3wgTd3kWALGaK731EE4lmE+USbWfWJsFYN2nKj8X9IwrDTmOiWzmNefgs1jsmYK1lEWbaw2wmnm0YsKQ834alt2XtrBkGgAxhlr7LQgDIi8izqbQDJBty/ru6BUDIzjcQHWAKaG9uNUGemkSPM4VTilhFIC5uCUBsJBogRlOid5htfaCq4ALEmwCGeiy9GWaW7W65pTCA+DX9OA37/SIwgq58Q/RPXB3ZLCCV2gVK/oGG5/nAqPuxwDaWA05591s1opu0cH1oaGdxATKomACZW+oBApPuBjBeS4Ny+Ht88FP4SOrq72VYkZW2bQGkZzBTNMTMk4gXfzWm5pUs/5dQbvsRfYe0v/BRFm3tiVluipI+A+lDXQLIy2jDB1iPaIpV66omU6qGYXdwcy/9bcKYJkfJz0WsNnhmQ8zM8QG2eTyb1WMAyN1Ie8RQxgNIAAD5FZhrvqYDCRB75KyRpWGE5mxkFHn+J4iPKhjgT3jBPrwwwYhvo763uDsCtTGW6GtQLEuvDlPwF254AbORd5fNZcShDmnn388GGWlNSlLytmcM1SDE52VhEPMB0L9kM3YjDyCh6x6vY/Zoolksk4roGlV5BDi6QFEXsvMjuuk/wI9bl4lYmwAc+fI28pcPN3qfugbCFPYcFwAyhOkElUOsoykz3V7HBpHFmrwZTIe4JcTnRUM/8kNneiIAS5wHEAeA1IHusUbzsp9F41dK1wYlT1uIXMJseYMLTClmq+cw6m2Co5tcdMuVYh219QYA4RFNX4Q38PriusQAsJJBBhSDYT+WLh6MYXo55F0UqusFlbsfdexlriAPWvJ7AHEAyHgw281Kw4eDUTcbvDzT4RMk7P0dXLQexQAk4pqjzGLC81W0OQkz3mrNbLgGIKlZzHYIeh3PzddZ1gDoK7i5VpNnnKJ4f6/qVZrFSTGTdNWYjmPBuF0sddTGrOdn5veaHkBCA0c0FtmO84U2KIcnMALVMDDPcgBomNvtAuO9g4/WEwaAT/DB2qLdn4vFTE2fBgPwo1xoRx3oD37Mkhvgfr6e6B/M9LrBUkcGM4lbV4wxGOQxkGzDAuwarDEdQPpZ2+4/uvcGe94a22zkAcQOkOpYiV6mjOBv4oX1MHSqExhjVagKbADMWQ/K7G4syjWDxUusS4gdiW9gxT9R6VM6TL55LrUjA2LefqYjFKFtBwCaux3qeI2ZbZs65BV9vQcDwmlW7jSse9tg3Ut0YPojoJ4Oz+uKfGJdpipLT8VsJ+51tZTvhzz7uaSBJQHZBhuYZyLP6tIIkByMtqNZg3vhg7xqYn64P583WUZcBMnjYJD++D0Zv8dQm1+E7lRDI2ZthxdwgottESvSKXD8q4ZZLRBzbzRAJI0NwegvyQCoEGcrq6Z1h7LlQNEBiLSX5FXqiLGUj2X5HOs1vNdygVo9Iw2QxwGQlqyz26BX1DF0qCFG0BXhbp/w0cLIuQEfrBJGtYNt3yuYA0tWPU2/ZqNfDUr6HcOhUZpab47yrrJzCTEECm1FfEzpJ/TnAKwkfSLEYK9DtKmO3xcXwybvOfOtBSCjAJDeJQyOaMwaUtGP9biubAHkU6L97IPOx0JTMweGPR+pvcRs70QfJhsX7iy4IPepZ2j61QUAuaeEAdKLzR53eBxX9gByWOz1xsesAI/M7Q4y4364MkSKyVqDwR5jactJxvN133bqhC6iCgJMCIA8UYLgSGRuHntNZtkg67wOXrvdywqPYa/KrXBozSxrABHi1Tp0pLPKiAYzpDBZrongC87ErDaXpV30fJ31z8LPDP3KhPj1QgkyxgRm5hzoUp3S0+DlMgSQeuw9tC1rABGj7Crxf5Hv4iKc37boh5VtoQ8sieALTgEoF7G0uhf9xc/6Vhj6lQ7x66USZowmcDqM8QBSNgHys4vJ8kPnlqETtzqIDWKRamUEX3A1gJJHDuluc6FA5EexvjPHpTaUFmbzABJhgIhgCJvFynTOR6c+lesfNkbBos6WCOogTdCuaSxtFtJaGPpVH7PjjGI++0Fs5nrGA8h/J0C+lO7hzTefPJr/U9FZKOrJlg7/HavIcRF6wf24FQh60CEovjGGfrUBQMYX89lL8ezXPYD8dwLkbwhALc7zuDBjX6EMNDDC0mG5ZTQ7Qi/4eTzvSvyWG4v+aOlXfwDkNg8gHkCKA5DnYO1pLhiqy5aCt+CU97lpXwdbTJwWgZdbHtEy9mCVPxo7/KyBxhD5RACklUsA+QpRTiQN0OQVOw1/S/QKHA6XwRv5UXjfxhqeURVevC+jXC4CGTyNnZtZOoDAy2A49smvwJYEMZj0cHANiUNopvsRsmctfO/EFuPfOW3WgovNQDwrF06rM+BUGh8sQOCS0hHBPl5DP+Zix2mKQ1vSkG8OyuXCT028t2uUWAC/xrd7yMF5swvyTRKMdDsYaRhi4eayTTZ3WF7wXji3JYUZIAOkmzt+34zfcx2A/6acGV0CiHotVPJlA8jqXnJ+PaVxX9eVK1LKTdIA5IjiIazuY5+urmVhcBmBwc92ndIFoUAdLR1i9X6giQNmBAhch/IMYaFkYItuhrb0YqFfTdd+uegtvM5NEWGUepfL6JaCkRoDIMLx7yjRRubFecgUfFl4r6KSCWEERyK2uxbAQbASPk6BbX+DcNtHXz5wYdPUUhbwQKy9jEa40X4sTzILZLEUI1cmgld0wOh+yb4Mpdxq7EOvCefE+kTX4z331gDkNNzYx8Frtjmelcu8jTspfYll+0TeQ1/aI1ZuCwxG+WzPShWlfCoD82ZEfBc7Jq/FTJbP6o53AggAu5gBvi9Cq7bAaL+KAbaRxnBzig0GLfDOf4GyS9gzu6JMXQbEHpbB/3vkmSKDNRxAkLhdiIkVhUBwPnzwGIPokw+nxiZhAEcUtoxe1DXw+y/4Pc42RbL99ZNcaIejDoIVYhmPKklzPxmg/o+4VMyF5ttA3XYYQF4x3K/I4gkvswBkqGWGkHtARiv3JrH4V+maso3ZrJYTAEBasdnyVk198RiYdBFgZCC8dYbQrhms7q6s//k29QBbKiSIbpIMNRt6yEHso0hBZbnIfK8hXEwnrHDv5PsIXAJIL6x97MBHH4oOb3SynjG9KjvcAAFwZXCJOZZ6tkgxi5Vbj7RZbirpbEuAGo8rEIBEsQjyecpoL5nrBcuz16p77i0AmYK0ry367ggWuVJGs6/AwqwONJS7BCBIl4PsdgNPj70keB8OreFnBHZmU+oXyNzX8DJl2Ml33QIJRIaTiI3VFBt6zmB3Y6YDOCpiH8huNw73CQAgCZCTtVELWb4PkGcmm8plaKPbXAYI38l3RTAAQb6pzH8sBmnVWJ19LWUf1ZQ1AeRdnT6n1NeUlZVbMpqztF8ECZAcFogjQ1NuDRMTf2aqWGxf9asOfggj8x0YtK9GyYyBtUVcnxZH3EJdo/GsE5Cpu0E8EZa1qwOwyg1BHx52CaxOAEljU3JXQ55oiF/iuo8pp75gTZ8BAoQfrdAuBICMZMpsOaS1YXVeaSnbn43AFUwAwQDxje1oCTZb+HikF4SUknpY5SABksrisPXXiKcnuFGIM9ZoBpBdPN4UFKDvIZvep7GOxGDkkEHlJgRj3cJMdBXkSR8sD9fgQxUCHO0DAEc83PfFSVjVIwSQRuzjtzL0rQ37WNlIr8XKNXIZIDWYHtEjBIDksLZVQlpv3TEPmrI3srLpFoBUZKdo3enAG3Lb8Sikjcbvo5ao+yaARLEwt/M0kou8rtWJJgfZSbPtNIwgYzotV8/Cw4OvZ3LqYSwoZpt0Btj/+2F/iQx2tgiWiHn4fcDkTqIBiAzWMN1FXcgJIHy6n4zNXFOxFvI22l/EtttGo1wDZpKt6zJA0hgQeocAkB6sT6lI68cscTYTKY9QX8cCkCSm0A916LM8wm0sft/HLG3RwQAE9x5gxhEeG/kZpH+n5VlirJFsFlmimkjB0LnMPj1SE340EabJfeylnETMWLl4th5hRi8wk+RaLBYNZlPvep21xACOZERaPOrW7BEgQFpYbPA+vOyNsMhVYeXqs3z1ShlAurO2pSGtb4DnLnZkZWs5AOSMehCQoc5jyHc3ft9fTIA0ZmJbGyYF7bG+W4go8oRZsWh4lUGeHsxsxflYBU5WNuzHYsV9GpSxH/Byz+PF7MH6wF2waQ9nR4QdQ50xAYKD70G/22VrWjAi1m9gJszCKnc5S70ZrFyzMgCQbmwwqxOggaCKBSDlGePfY6kvmrV5mCJiHbNYv2wAiWW8No0NdD5TUD/ObFfD1OtHADbTeXdVIFL8yGIiLUGMpDpQwnR27UT8zcQus/lKHU/ZRihDm3vCtf3vbkV2Z21eYjp4BvdT2If4dZAuNIW6g3BKKUCasbRsS9lRLIZYggUg3Gz8hKW+dPXAICwESktUarAAwf0/sQE+jv0+rguSqDLcQ0wXGeTwwQRQ/heRUC6wzhyG7T8PfkULIJ69zyw6Uun7BIt/acEysIhaQnQEge8ahmHB8hWHGYSfVvuHIOrlUdfHlQGAJLKyt1vKyrM+trCj5UxmXnkM3RsBzEg/n20C8VSO9q1DBEhz5g7UjoF1fiBMF0e0EiARxzA3CuDDySiEw+A4tgUg+Qkv9iysET9gdfRl6DANQ91XQu2qBovbeTeCVRv6JT2Xt1qCPy9ki0+xQdQ9V1XeSzFA+IlZqw2LbElsbWdiAAuFo9kioOkMwwXsECM+KH1pMxEHAJBYLEvImMkScN0CZT6h9G4DSHaGcsotRsnLYHtOwwt0ZesptSeN6CPMcg9EheliZxAWwromxaN6imIqDwb6rcFJMBkjVRpLb8ecEwcazOcpiv9WiQBEY+q9TTmPMJbFUz6lLFCaAJLCjoabp0RllNa087rtF9jI5sfsnaa8s1rw2HVanxqvGFUOBhVYA/u6PwVIxKlTlaNKwUXtqEW0A+AQR1VHhxEgqUyZPAnnSeHCsU8BwDTG7Dswyq6GU99XzGKTrZSbzUSIXVgLykOgvD0A5qRSApBo5qrhw2r5BrjK72RWrtuV+mzevH3YuzmKFex12JQn27pCnZmxgLiNrdovQL5dDFTyut7Qz9qKR/SUUJgxHef/+fE3o4TB0Q7rNUIpnxBOcCjrAtwl/bR64CRGrv74wAVs9CoEoHZgjaemRocZA6sK/1hnoegKUWKwIreL+p51APW3yNdNaeMhpPe3lO/MYuqmaESTYWDOUwwsPwIonTTGmTqsvmzN87IxKBxlYtFpvLO7LIuBqRDVj7PB6TB03THsG1xrUQvyGLCzQmVKIW6tAEiE12/b4rqRh9CGBBzTUIgTeIdGsg0Qq+qDKlvs71IWz8CKdlX4awUijlaFeTgD4kcFgyUwweawiboSQOr5kZeka8rHsHy2flZCH9N1bTW0J9rhHVdHnZWD0MsqsHZI15hr2GBT19LPTWzNLbo4DBoH61Yh1kieJqoaAWBEAZBSHxL751tFGqDeVbYuLCHImSjOMlP6nI53CJZhWzJmFV6zD4ZDNwEwWohjGRCa6ByOXUvyPr93BQCQGWB80xn3sdAPpYUs3k3mjYdbyjfMFPwsRvaYYtZdCQEX3gEwhCK+DnvmvS/vXVysamrYA5/EjiA37RfJYbPHkHCJP8LBcQzWIuTC4lfYsNQPsaniHGYJod+0FkGmxXFqRAXM1WU5xKtojyW8S2MZ82EN5R9weF0MpXsvOx051gAuuTC4242YyU5AEftJOog4uMwj2A9L0ylsXtoE15XVOGBzK2agcyy/mDHeIxqH2LoeJ3iXCSCXY5bwGQI9TJH7UTRlJ3L/uUhbm8Qe96ZEI4ieJ9pAtIfoBADjR8Bsob98DOvYRKJeYjHSA4V3BQgQaR2riIXBJvAXqw39wlauPsSzK508H/4FoQjRzOaDDxUAAAAASUVORK5CYII="})}function ke(e){return p("div",{class:"_2lVG2",style:{top:e.y+"px",left:e.x+"px"}},p("a",{href:"https://www.eyevinntechnology.se/",target:"_blank"},p("span",null,"Powered by the Eyevinn WebPlayer"),p(Pe,{className:"_yCzmM"})))}function Fe(){return p("div",{class:"_xDOFW"},p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48"},p("path",{d:"M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"})))}function Ue(e){var t,n=e.player,r=e.castAppId,i=e.rootElement,a=q(),o=function(e,t){var n,r,i,a=K(null),o=a[0],s=a[1],l=K(null),c=l[0],d=l[1],f=function(e,t){var n=K(null),r=n[0],i=n[1],a=Y((function(){return null!==t&&new fe(t)}),[]),o=q(null);return o.current=r,V((function(){a&&(a.on(le.CONNECTED,(function(){e.currentSrc&&a.load(e.currentSrc,e.currentTime)})),a.on(le.DISCONNECTED,(function(){var t;i((function(e){return xe({},e,{isCasting:!1})})),e.seekTo({position:null==(t=o.current)?void 0:t.currentTime})})),a.on(le.STATE_CHANGE,(function(e){var t=e.state;i(xe({isCasting:t.playbackState!==u.b.IDLE},t))})))}),[]),[a,r]}(e,t),h=f[0],p=f[1],g=q(!1);return g.current=null!=(n=null==p?void 0:p.isCasting)&&n,V((function(){e.on(u.e.UNREADY,(function(){s(null),d(null)})),e.on(u.e.READYING,(function(){s(!1)})),e.on(u.e.READY,(function(){s(!0)})),e.on(u.e.STATE_CHANGE,(function(t){var n=t.state;g.current&&e.isPlaying&&e.pause(),d(xe({isCasting:!1},n))}))}),[]),p&&p.playbackState!==u.b.IDLE?(i=h,r=p):(i=e,r=c),[o,r,W((function(){return i.isPlaying?i.pause():i.play()}),[i]),W((function(){return i.isMuted?i.unmute():i.mute()}),[i]),W((function(e){return i.setAudioTrack(e)}),[i]),W((function(e){return i.setTextTrack(e)}),[i]),W((function(e){return i.seekTo({percentage:e})}),[i]),W((function(e){return i.seekTo({change:e})}),[i]),W((function(){return i.seekToLive()}),[i])]}(n,r),s=o[0],l=o[1],c=o[2],d=o[3],f=o[4],h=o[5],g=o[6],v=o[7],m=o[8],y=function(e){var t=K(!1),n=t[0],r=t[1],i=Y((function(){return new se(e.video)}),[]),a=W((function(){return i.toggleAirPlay()}),[]);return V((function(){i.on(ie.AVAILABILITY_CHANGED,(function(e){return r(e.available)}))}),[]),[n,a]}(n),E=y[0],T=y[1],_=W((function(){return De()?void(null==(e=document.exitFullscreen||document.webkitExitFullscreen)||e.call(document)):function(e,t){var n,r=e.requestFullscreen||e.webkitRequestFullscreen?e:t;null==(n=r.requestFullscreen||r.webkitRequestFullscreen||r.webkitEnterFullscreen)||n.call(r)}(i,n.video);var e}),[]),b=K({visible:!1,x:0,y:0}),S=b[0],A=b[1],I=W((function(e){e.stopPropagation(),e.preventDefault(),A(e.target===e.currentTarget?{visible:!0,x:e.offsetX,y:e.offsetY}:{visible:!1,x:0,y:0})}),[]);V((function(){document.addEventListener("click",(function(){A({visible:!1,x:0,y:0})}))}),[]),V((function(){var e=a.current;if(e){var t=function(e){switch(e.code){case"Space":c();break;case"ArrowRight":v(5);break;case"ArrowLeft":v(-5)}};return e.addEventListener("keydown",t),function(){return e.removeEventListener("keydown",t)}}}),[a.current]);var w=q(null),R=K(!1),D=R[0],C=R[1],M=W((function(){clearTimeout(w.current),C(!0),w.current=setTimeout((function(){return C(!1)}),2500)}),[]),L=!D&&(null==l?void 0:l.playbackState)!==u.b.READY&&(null==l?void 0:l.playbackState)!==u.b.PAUSED,N=(null==l?void 0:l.playbackState)===u.b.LOADING||(null==l?void 0:l.playbackState)===u.b.BUFFERING||(null==l?void 0:l.playbackState)===u.b.SEEKING;return null===s?null:p("div",{ref:a,tabIndex:0,class:te()("_2jAm9"),onMouseMove:M,onContextMenu:I,onPointerUp:W((function(e){L||e.currentTarget!==e.target?C(!0):c()}),[L])},S.visible&&p(ke,{x:S.x,y:S.y}),(N||!s)&&p(Re,null),(null==l?void 0:l.isCasting)&&p(Fe,null),p("div",{class:te()("_SS6y-",(t={},t._1Wfm6=L,t))},p("div",{class:"_1pnfN"},p(ye,{playbackState:null==l?void 0:l.playbackState,onClick:c}),(null==l?void 0:l.isLive)&&!(null!=l&&l.isSeekable)&&p(he,{onClick:m,isAtLiveEdge:null==l?void 0:l.isAtLiveEdge,isSeekable:null==l?void 0:l.isSeekable}),p("div",{class:"_3ju96"}),p(Oe,null),E&&p(Ne,{onClick:T}),!1===(null==l?void 0:l.isCasting)&&(null==l?void 0:l.textTracks.length)>0&&p(Me,{textTracks:null==l?void 0:l.textTracks,onChange:h}),!1===(null==l?void 0:l.isCasting)&&(null==l?void 0:l.audioTracks.length)>1&&p(Se,{audioTracks:null==l?void 0:l.audioTracks,onChange:f}),p(_e,{muted:null==l?void 0:l.isMuted,onClick:d}),p(we,{isFullscreen:De(),onClick:_})),(!(null!=l&&l.isLive)||(null==l?void 0:l.isSeekable))&&p(ge,{isLive:null==l?void 0:l.isLive,isAtLiveEdge:null==l?void 0:l.isAtLiveEdge,isSeekable:null==l?void 0:l.isSeekable,handleSeek:g,handleSeekToLive:m,currentTime:null==l?void 0:l.currentTime,duration:null==l?void 0:l.duration})))}n(97);function Be(e,{castAppId:t}={}){const n=document.createElement("video");e.appendChild(n);const r=new u.c({video:n});return function(e){var t=e.root,n=e.player,r=e.castAppId;t.classList.add("_1Xl8W"),N(p(Ue,{player:n,rootElement:t,castAppId:r}),t)}({root:e,player:r,castAppId:t}),r}}]).default}));
|