@xibosignage/xibo-layout-renderer 1.0.25 → 1.0.26

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.
@@ -1,4 +1,4 @@
1
- var XiboLayoutRenderer=function(e){"use strict";function t(e,t,n){return t=m(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){h(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function s(){s=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,i){return e[t]=i}}function c(e,t,i,n){var s=t&&t.prototype instanceof v?t:v,a=Object.create(s.prototype),o=new O(n||[]);return r(a,"_invoke",{value:C(e,i,o)}),a}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",m="suspendedYield",g="executing",f="completed",y={};function v(){}function b(){}function _(){}var T={};d(T,o,(function(){return this}));var A=Object.getPrototypeOf,S=A&&A(A(P([])));S&&S!==i&&n.call(S,o)&&(T=S);var w=_.prototype=v.prototype=Object.create(T);function E(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,s,a,o){var l=h(e[r],e,s);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,o)}),(function(e){i("throw",e,a,o)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,o)}))}o(l.arg)}var s;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return s=s?s.then(r,r):r()}})}function C(t,i,n){var r=p;return function(s,a){if(r===g)throw Error("Generator is already running");if(r===f){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var o=n.delegate;if(o){var l=k(o,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=h(t,i,n);if("normal"===u.type){if(r=n.done?f:m,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=f,n.method="throw",n.arg=u.arg)}}}function k(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,k(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var s=h(r,t.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,y;var a=s.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(t){if(t||""===t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function i(){for(;++r<t.length;)if(n.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return b.prototype=_,r(w,"constructor",{value:_,configurable:!0}),r(_,"constructor",{value:b,configurable:!0}),b.displayName=d(_,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,d(e,u,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},E(x.prototype),d(x.prototype,l,(function(){return this})),t.AsyncIterator=x,t.async=function(e,i,n,r,s){void 0===s&&(s=Promise);var a=new x(c(e,i,n,r),s);return t.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(w),d(w,u,"Generator"),d(w,o,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function r(n,r){return o.type="throw",o.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var s=r;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),L(i),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;L(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:P(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function a(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function o(e,t,i,n,r,s,a){try{var o=e[s](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(n,r)}function l(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var s=e.apply(t,i);function a(e){o(s,n,r,a,l,"next",e)}function l(e){o(s,n,r,a,l,"throw",e)}a(void 0)}))}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function c(e,t,i){return t&&d(e.prototype,t),i&&d(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,i){return(t=a(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var s=new(e.bind.apply(e,r));return n&&g(s,n.prototype),s}(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)},f(e)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,a,o=[],l=!0,u=!1;try{if(s=(i=i.call(e)).next,0===t);else for(;!(l=(n=s.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return _(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function T(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=b(e))||t){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f: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.")}var s,a=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw s}}}}var A,S,w=function(){return{emit:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];for(var r=0,s=this.events[e]||[],a=s.length;r<a;r++)s[r].apply(s,i)},events:{},on:function(e,t){var i,n=this;return((i=this.events)[e]||(i[e]=[])).push(t),function(){var i;n.events[e]=null===(i=n.events[e])||void 0===i?void 0:i.filter((function(e){return t!==e}))}}}};e.ELayoutState=void 0,(A=e.ELayoutState||(e.ELayoutState={}))[A.IDLE=0]="IDLE",A[A.RUNNING=1]="RUNNING",A[A.PLAYED=2]="PLAYED",A[A.CANCELLED=3]="CANCELLED",A[A.ERROR=4]="ERROR",e.LayoutPlaybackType=void 0,(S=e.LayoutPlaybackType||(e.LayoutPlaybackType={})).CURRENT="current",S.NEXT="next",S.OVERLAY="overlay";var E,x={id:null,layoutId:-9,sw:0,sh:0,xw:0,xh:0,duration:0,zIndex:0,scaleFactor:1,sWidth:0,sHeight:0,offsetX:0,offsetY:0,bgColor:"",bgImage:"",bgId:"",containerName:"",layoutNode:void 0,regionMaxZIndex:0,ready:!1,regionObjects:[],drawer:null,allExpired:!1,regions:[],actions:[],options:{},done:!1,allEnded:!1,path:"",emitter:{},index:-1,actionController:void 0,enableStat:!1,xlr:{},inLoop:!0,xlfString:"",ad:null,isOverlay:!1,shareOfVoice:0,errorCode:null,prepareLayout:function(){},parseXlf:function(){},run:function(){},on:function(e,t){return{}},regionExpired:function(){},end:function(){},regionEnded:function(){},stopAllMedia:function(){return Promise.resolve()},resetLayout:function(){return Promise.resolve()},finishAllRegions:function(){return Promise.resolve([])},removeLayout:function(){},getXlf:function(){return""},isInterrupt:function(){return!1},state:e.ELayoutState.IDLE,html:null},C={complete:!1,containerName:"",currMedia:void 0,currEl:null,currentMedia:-1,currentMediaIndex:0,end:function(){},ended:!1,ending:!1,exitTransition:function(){},exitTransitionComplete:function(){},finished:function(){},html:{},id:"",index:-1,layout:x,mediaObjects:[],mediaObjectsActions:[],nxtMedia:void 0,nxtEl:null,offsetX:0,offsetY:0,oldMedia:void 0,on:function(e,t){return{}},oneMedia:!1,options:{},playNextMedia:function(){},playPreviousMedia:function(){},prepareMediaObjects:function(){},prepareRegion:function(){},ready:!1,regionId:"",reset:function(){},run:function(){},sHeight:0,sWidth:0,totalMediaObjects:0,transitionNodes:function(){},uniqueId:"",xml:null,zIndex:0,prepareNextMedia:function(){},xlr:{}},k={IDLE:"idle",PLAYING:"playing",ENDED:"ended",CANCELLED:"cancelled"},I={attachedAudio:!1,checkIframeStatus:!1,containerName:"",divHeight:0,divWidth:0,duration:0,emitter:{},enableStat:!1,fileId:"",finished:!1,html:null,id:"",idCounter:0,iframe:null,iframeName:"",index:0,loadIframeOnRun:!1,loop:!1,mediaId:"",mediaType:"",muted:!1,options:{},player:void 0,ready:!0,region:C,render:"html",run:function(){},schemaVersion:"1",singlePlay:!1,state:k.IDLE,stop:function(){return Promise.resolve()},tempSrc:"",timeoutId:setTimeout((function(){}),0),type:"",uri:"",url:null,useDuration:Boolean(0),xml:null,mediaTimer:void 0},L=function(){return c((function e(){u(this,e),h(this,"overlays",[]),h(this,"container",void 0),h(this,"parent",void 0),this.container=document.createElement("div"),this.container.className="overlay-layouts",this.container.style.display="none"}),[{key:"parseOverlays",value:(i=l(s().mark((function e(t){var i=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(function(){var e=l(s().mark((function e(t,n){var a,o,l,u,d;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=r(r({},o={}),t)).index=null!==(a=t.index)&&void 0!==a?a:n,e.next=5,i.parent.prepareLayoutXlf(r(r({},x),o));case 5:return l=e.sent,console.debug("<> XLR.debug OverlayLayoutManager::parseOverlays prepared overlay layout",{overlayLayout:l,inputOverlay:o}),null!==(u=document.querySelector("#".concat(l.containerName,'[data-sequence="').concat(l.index,'"]')))&&(u.style.setProperty("visibility","hidden"),u.style.setProperty("z-index","".concat(null!==(d=l.zIndex)&&void 0!==d?d:-999))),e.abrupt("return",l);case 10:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"prepareOverlayLayouts",value:(t=l(s().mark((function e(t,i){var n,r,a,o,l,u,d,c=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,this.parent=i,console.debug("<> XLR.debug OverlayLayoutManager::prepareOverlayLayouts",{existingOverlays:this.overlays,newOverlays:t,hasChanged:n}),!(this.overlays.length>0&&t.length>=0)){e.next=27;break}if(r=this.overlays.reduce((function(e,t){return[].concat(v(e),[t.layoutId])}),[]),a=t.reduce((function(e,t){return[].concat(v(e),[t.layoutId])}),[]),!(n=r.join(",")!==a.join(","))){e.next=27;break}if(o=r.filter((function(e){return-1===a.indexOf(e)})),console.debug("<> XLR.debug OverlayLayoutManager::prepareOverlayLayouts overlaysRemoved",{overlaysRemoved:o,existingOverlayIds:r,newListIds:a}),!(o.length>0)){e.next=27;break}l=T(o),e.prev=12,d=s().mark((function e(){var t,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.value,!(i=c.overlays.find((function(e){return e.layoutId===t})))){e.next=8;break}if(null===document.querySelector("#".concat(i.containerName,'[data-sequence="').concat(i.index,'"]'))){e.next=8;break}return e.next=7,i.finishAllRegions();case 7:i.emitter.emit("end",i);case 8:case"end":return e.stop()}}),e)})),l.s();case 15:if((u=l.n()).done){e.next=19;break}return e.delegateYield(d(),"t0",17);case 17:e.next=15;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(12),l.e(e.t1);case 24:return e.prev=24,l.f(),e.finish(24);case 27:return console.debug("<> XLR.debug OverlayLayoutManager::prepareOverlayLayouts",{existingOverlays:this.overlays,newOverlays:t,hasChanged:n}),e.next=30,this.parseOverlays(t);case 30:this.overlays=e.sent;case 31:case"end":return e.stop()}}),e,this,[[12,21,24,27]])}))),function(e,i){return t.apply(this,arguments)})},{key:"playOverlays",value:function(){var e;if(0!==this.overlays.length)return this.parent&&null!==(e=this.parent.currentLayout)&&void 0!==e&&e.isInterrupt()?(this.container.style.setProperty("visibility","hidden"),void this.container.style.setProperty("z-index","-999")):void this.overlays.forEach((function(e){e.run()}))}},{key:"stopOverlays",value:function(){0!==this.overlays.length&&this.overlays.forEach(function(){var e=l(s().mark((function e(t){var i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=document.querySelector("#".concat(t.containerName,'[data-sequence="').concat(t.index,'"]')),console.debug("<> XLR.debug OverlayLayoutManager::stopOverlays",{overlay:t,overlayHtml:i}),null===i){e.next=6;break}return e.next=5,t.finishAllRegions();case 5:t.emitter.emit("end",t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"resumeOverlays",value:(e=l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.overlays.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.parseOverlays(this.overlays);case 4:this.overlays=e.sent,this.playOverlays();case 6:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}]);var e,t,i}();e.ELayoutType=void 0,(E=e.ELayoutType||(e.ELayoutType={}))[E.CURRENT=0]="CURRENT",E[E.NEXT=1]="NEXT";var O,P={bootstrap:function(){},config:{},currentLayout:void 0,currentLayoutId:-2,currentLayoutIndex:0,emitSync:function(e){return Promise.resolve()},emitter:{},getLayout:function(e){},getLayoutById:function(e){return{}},gotoNextLayout:function(){},gotoPrevLayout:function(){},init:function(){return Promise.resolve({})},inputLayouts:[],isInterrupted:!1,isLayoutInDOM:function(e,t){return!1},isSspEnabled:!1,isUpdatingLoop:!1,isUpdatingOverlays:!1,layouts:{},nextLayout:void 0,on:function(e,t){return{}},overlayLayoutManager:new L,overlays:[],parseLayouts:function(){return{}},playLayouts:function(e){},playSchedules:function(e){return Promise.resolve()},prepareForSsp:function(e){return Promise.resolve({})},prepareLayoutXlf:function(e){return Promise.resolve({})},prepareLayouts:function(){return Promise.resolve({})},renderOverlayLayouts:function(){return Promise.resolve()},uniqueLayouts:{},updateInputLayout:function(e,t){},updateLayouts:function(e){},updateLoop:function(e){return Promise.resolve()},updateOverlays:function(e){return Promise.resolve()},updateScheduleLayouts:function(e){return Promise.resolve()}};e.ConsumerPlatform=void 0,(O=e.ConsumerPlatform||(e.ConsumerPlatform={})).CMS="CMS",O.CHROMEOS="chromeOS",O.ELECTRON="electron",O.IOS="ios",O.MACOS="macos",O.ANDROID="android",O.LINUX="linux",O.WINDOWS="windows",O.WEBOS="webos",O.TIZEN="tizen";const D=6048e5,M=864e5,N=Symbol.for("constructDateFrom");function R(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&N in e?e[N](t):e instanceof Date?new e.constructor(t):new Date(t)}function B(e,t){return R(t||e,e)}let U={};function q(){return U}function j(e,t){const i=q(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=B(e,t?.in),s=r.getDay(),a=(s<n?7:0)+s-n;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function F(e,t){return j(e,{...t,weekStartsOn:1})}function H(e,t){const i=B(e,t?.in),n=i.getFullYear(),r=R(i,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=F(r),a=R(i,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=F(a);return i.getTime()>=s.getTime()?n+1:i.getTime()>=o.getTime()?n:n-1}function V(e){const t=B(e),i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return i.setUTCFullYear(t.getFullYear()),+e-+i}function z(e,t){const i=B(e,t?.in);return i.setHours(0,0,0,0),i}function X(e,t,i){const[n,r]=function(e,...t){const i=R.bind(null,t.find((e=>"object"==typeof e)));return t.map(i)}(0,e,t),s=z(n),a=z(r),o=+s-V(s),l=+a-V(a);return Math.round((o-l)/M)}function W(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+B(e)));var t}const G={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Y(e){return(t={})=>{const i=t.width?String(t.width):e.defaultWidth;return e.formats[i]||e.formats[e.defaultWidth]}}const K={date:Y({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Y({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Y({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},J={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Q(e){return(t,i)=>{let n;if("formatting"===(i?.context?String(i.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=i?.width?String(i.width):t;n=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=i?.width?String(i.width):e.defaultWidth;n=e.values[r]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function Z(e){return(t,i={})=>{const n=i.width,r=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let i=0;i<e.length;i++)if(t(e[i]))return i;return}(o,(e=>e.test(a))):function(e,t){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t(e[i]))return i;return}(o,(e=>e.test(a)));let u;u=e.valueCallback?e.valueCallback(l):l,u=i.valueCallback?i.valueCallback(u):u;return{value:u,rest:t.slice(a.length)}}}var $;const ee={code:"en-US",formatDistance:(e,t,i)=>{let n;const r=G[e];return n="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+n:n+" ago":n},formatLong:K,formatRelative:(e,t,i,n)=>J[e],localize:{ordinalNumber:(e,t)=>{const i=Number(e),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Q({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Q({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Q({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Q({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Q({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:($={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const i=e.match($.matchPattern);if(!i)return null;const n=i[0],r=e.match($.parsePattern);if(!r)return null;let s=$.valueCallback?$.valueCallback(r[0]):r[0];return s=t.valueCallback?t.valueCallback(s):s,{value:s,rest:e.slice(n.length)}}),era:Z({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Z({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Z({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Z({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function te(e,t){const i=B(e,t?.in),n=X(i,function(e,t){const i=B(e,t?.in);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}(i));return n+1}function ie(e,t){const i=B(e,t?.in),n=+F(i)-+function(e,t){const i=H(e,t),n=R(e,0);return n.setFullYear(i,0,4),n.setHours(0,0,0,0),F(n)}(i);return Math.round(n/D)+1}function ne(e,t){const i=B(e,t?.in),n=i.getFullYear(),r=q(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=R(t?.in||e,0);a.setFullYear(n+1,0,s),a.setHours(0,0,0,0);const o=j(a,t),l=R(t?.in||e,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=j(l,t);return+i>=+o?n+1:+i>=+u?n:n-1}function re(e,t){const i=B(e,t?.in),n=+j(i,t)-+function(e,t){const i=q(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=ne(e,t),s=R(t?.in||e,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),j(s,t)}(i,t);return Math.round(n/D)+1}function se(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const ae={y(e,t){const i=e.getFullYear(),n=i>0?i:1-i;return se("yy"===t?n%100:n,t.length)},M(e,t){const i=e.getMonth();return"M"===t?String(i+1):se(i+1,2)},d:(e,t)=>se(e.getDate(),t.length),a(e,t){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];default:return"am"===i?"a.m.":"p.m."}},h:(e,t)=>se(e.getHours()%12||12,t.length),H:(e,t)=>se(e.getHours(),t.length),m:(e,t)=>se(e.getMinutes(),t.length),s:(e,t)=>se(e.getSeconds(),t.length),S(e,t){const i=t.length,n=e.getMilliseconds();return se(Math.trunc(n*Math.pow(10,i-3)),t.length)}},oe="midnight",le="noon",ue="morning",de="afternoon",ce="evening",he="night",pe={G:function(e,t,i){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});default:return i.era(n,{width:"wide"})}},y:function(e,t,i){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return i.ordinalNumber(n,{unit:"year"})}return ae.y(e,t)},Y:function(e,t,i,n){const r=ne(e,n),s=r>0?r:1-r;if("YY"===t){return se(s%100,2)}return"Yo"===t?i.ordinalNumber(s,{unit:"year"}):se(s,t.length)},R:function(e,t){return se(H(e),t.length)},u:function(e,t){return se(e.getFullYear(),t.length)},Q:function(e,t,i){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return se(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,i){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return se(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,i){const n=e.getMonth();switch(t){case"M":case"MM":return ae.M(e,t);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,i){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return se(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,i,n){const r=re(e,n);return"wo"===t?i.ordinalNumber(r,{unit:"week"}):se(r,t.length)},I:function(e,t,i){const n=ie(e);return"Io"===t?i.ordinalNumber(n,{unit:"week"}):se(n,t.length)},d:function(e,t,i){return"do"===t?i.ordinalNumber(e.getDate(),{unit:"date"}):ae.d(e,t)},D:function(e,t,i){const n=te(e);return"Do"===t?i.ordinalNumber(n,{unit:"dayOfYear"}):se(n,t.length)},E:function(e,t,i){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,i,n){const r=e.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return se(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,i,n){const r=e.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return se(s,t.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,i){const n=e.getDay(),r=0===n?7:n;switch(t){case"i":return String(r);case"ii":return se(r,t.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,i){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,i){const n=e.getHours();let r;switch(r=12===n?le:0===n?oe:n/12>=1?"pm":"am",t){case"b":case"bb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,i){const n=e.getHours();let r;switch(r=n>=17?ce:n>=12?de:n>=4?ue:he,t){case"B":case"BB":case"BBB":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,i){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),i.ordinalNumber(t,{unit:"hour"})}return ae.h(e,t)},H:function(e,t,i){return"Ho"===t?i.ordinalNumber(e.getHours(),{unit:"hour"}):ae.H(e,t)},K:function(e,t,i){const n=e.getHours()%12;return"Ko"===t?i.ordinalNumber(n,{unit:"hour"}):se(n,t.length)},k:function(e,t,i){let n=e.getHours();return 0===n&&(n=24),"ko"===t?i.ordinalNumber(n,{unit:"hour"}):se(n,t.length)},m:function(e,t,i){return"mo"===t?i.ordinalNumber(e.getMinutes(),{unit:"minute"}):ae.m(e,t)},s:function(e,t,i){return"so"===t?i.ordinalNumber(e.getSeconds(),{unit:"second"}):ae.s(e,t)},S:function(e,t){return ae.S(e,t)},X:function(e,t,i){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return ge(n);case"XXXX":case"XX":return fe(n);default:return fe(n,":")}},x:function(e,t,i){const n=e.getTimezoneOffset();switch(t){case"x":return ge(n);case"xxxx":case"xx":return fe(n);default:return fe(n,":")}},O:function(e,t,i){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+me(n,":");default:return"GMT"+fe(n,":")}},z:function(e,t,i){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+me(n,":");default:return"GMT"+fe(n,":")}},t:function(e,t,i){return se(Math.trunc(+e/1e3),t.length)},T:function(e,t,i){return se(+e,t.length)}};function me(e,t=""){const i=e>0?"-":"+",n=Math.abs(e),r=Math.trunc(n/60),s=n%60;return 0===s?i+String(r):i+String(r)+t+se(s,2)}function ge(e,t){if(e%60==0){return(e>0?"-":"+")+se(Math.abs(e)/60,2)}return fe(e,t)}function fe(e,t=""){const i=e>0?"-":"+",n=Math.abs(e);return i+se(Math.trunc(n/60),2)+t+se(n%60,2)}const ye=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},ve=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},be={p:ve,P:(e,t)=>{const i=e.match(/(P+)(p+)?/)||[],n=i[1],r=i[2];if(!r)return ye(e,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"})}return s.replace("{{date}}",ye(n,t)).replace("{{time}}",ve(r,t))}},_e=/^D+$/,Te=/^Y+$/,Ae=["D","DD","YY","YYYY"];const Se=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,we=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ee=/^'([^]*?)'?$/,xe=/''/g,Ce=/[a-zA-Z]/;function ke(e,t,i){const n=q(),r=n.locale??ee,s=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=B(e,i?.in);if(!W(o))throw new RangeError("Invalid time value");let l=t.match(we).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,be[t])(e,r.formatLong)}return e})).join("").match(Se).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Ie(e)};if(pe[t])return{isToken:!0,value:e};if(t.match(Ce))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));r.localize.preprocessor&&(l=r.localize.preprocessor(o,l));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return l.map((i=>{if(!i.isToken)return i.value;const n=i.value;(function(e){return Te.test(e)}(n)||function(e){return _e.test(e)}(n))&&function(e,t,i){const n=function(e,t,i){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,i);if(console.warn(n),Ae.includes(e))throw new RangeError(n)}(n,t,String(e));return(0,pe[n[0]])(o,n,r.localize,u)})).join("")}function Ie(e){const t=e.match(Ee);return t?t[1].replace(xe,"'"):e}var Le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pe(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),i}var De,Me="undefined"!=typeof window?window:void 0!==Le?Le:"undefined"!=typeof self?self:{},Ne=Oe(Me),Re=void 0!==Le?Le:"undefined"!=typeof window?window:{},Be=Pe(Object.freeze({__proto__:null,default:{}}));"undefined"!=typeof document?De=document:(De=Re["__GLOBAL_DOCUMENT_CACHE@4"])||(De=Re["__GLOBAL_DOCUMENT_CACHE@4"]=Be);var Ue=De,qe=Oe(Ue),je={exports:{}},Fe={exports:{}};!function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Fe);var He=Fe.exports,Ve=function(e){if(!e)return!1;var t=ze.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},ze=Object.prototype.toString;function Xe(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return We(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return We(e,t)}(e))||t){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function We(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ge=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var i=this.typeToInterceptorsMap_.get(e);return!i.has(t)&&(i.add(t),!0)},t.removeInterceptor=function(e,t){var i=this.typeToInterceptorsMap_.get(e);return!(!i||!i.has(t))&&(i.delete(t),!0)},t.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},t.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var i,n=Xe(this.getForType(e));!(i=n()).done;){var r=i.value;try{t=r(t)}catch(e){}}return t},e}(),Ye=Ge,Ke=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,i=t.maxAttempts,n=t.delayFactor,r=t.fuzzFactor,s=t.initialDelay;return new Je({maxAttempts:i||this.maxAttempts_,delayFactor:n||this.delayFactor_,fuzzFactor:r||this.fuzzFactor_,initialDelay:s||this.initialDelay_})},e}(),Je=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}(),Qe=Me;var Ze=function(e,t){return void 0===t&&(t=!1),function(i,n,r){if(i)e(i);else if(n.statusCode>=400&&n.statusCode<=599){var s=r;if(t)if(Qe.TextDecoder){var a=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),n=i[0],r=i[1];return"charset"===n.trim()?r.trim():e}),"utf-8")}(n.headers&&n.headers["content-type"]);try{s=new TextDecoder(a).decode(r)}catch(e){}}else s=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:s})}else e(null,r)}},$e=Me,et=He,tt=Ve,it=Ye,nt=Ke;at.httpHandler=Ze,at.requestInterceptorsStorage=new it,at.responseInterceptorsStorage=new it,at.retryManager=new nt;
1
+ var XiboLayoutRenderer=function(e){"use strict";function t(e,t,n){return t=m(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){h(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function s(){s=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,i){return e[t]=i}}function c(e,t,i,n){var s=t&&t.prototype instanceof v?t:v,a=Object.create(s.prototype),o=new O(n||[]);return r(a,"_invoke",{value:C(e,i,o)}),a}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",m="suspendedYield",g="executing",f="completed",y={};function v(){}function b(){}function T(){}var _={};d(_,o,(function(){return this}));var A=Object.getPrototypeOf,S=A&&A(A(P([])));S&&S!==i&&n.call(S,o)&&(_=S);var w=T.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,s,a,o){var l=h(e[r],e,s);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,o)}),(function(e){i("throw",e,a,o)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,o)}))}o(l.arg)}var s;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return s=s?s.then(r,r):r()}})}function C(t,i,n){var r=p;return function(s,a){if(r===g)throw Error("Generator is already running");if(r===f){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var o=n.delegate;if(o){var l=k(o,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=h(t,i,n);if("normal"===u.type){if(r=n.done?f:m,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=f,n.method="throw",n.arg=u.arg)}}}function k(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,k(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var s=h(r,t.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,y;var a=s.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(t){if(t||""===t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function i(){for(;++r<t.length;)if(n.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return b.prototype=T,r(w,"constructor",{value:T,configurable:!0}),r(T,"constructor",{value:b,configurable:!0}),b.displayName=d(T,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,d(e,u,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},E(x.prototype),d(x.prototype,l,(function(){return this})),t.AsyncIterator=x,t.async=function(e,i,n,r,s){void 0===s&&(s=Promise);var a=new x(c(e,i,n,r),s);return t.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(w),d(w,u,"Generator"),d(w,o,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function r(n,r){return o.type="throw",o.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var s=r;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),L(i),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;L(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:P(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function a(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function o(e,t,i,n,r,s,a){try{var o=e[s](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(n,r)}function l(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var s=e.apply(t,i);function a(e){o(s,n,r,a,l,"next",e)}function l(e){o(s,n,r,a,l,"throw",e)}a(void 0)}))}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function c(e,t,i){return t&&d(e.prototype,t),i&&d(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,i){return(t=a(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var s=new(e.bind.apply(e,r));return n&&g(s,n.prototype),s}(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)},f(e)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,a,o=[],l=!0,u=!1;try{if(s=(i=i.call(e)).next,0===t);else for(;!(l=(n=s.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return T(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return T(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function _(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=b(e))||t){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f: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.")}var s,a=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw s}}}}var A,S,w=function(){return{emit:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];for(var r=0,s=this.events[e]||[],a=s.length;r<a;r++)s[r].apply(s,i)},events:{},on:function(e,t){var i,n=this;return((i=this.events)[e]||(i[e]=[])).push(t),function(){var i;n.events[e]=null===(i=n.events[e])||void 0===i?void 0:i.filter((function(e){return t!==e}))}}}};e.ELayoutState=void 0,(A=e.ELayoutState||(e.ELayoutState={}))[A.IDLE=0]="IDLE",A[A.RUNNING=1]="RUNNING",A[A.PLAYED=2]="PLAYED",A[A.CANCELLED=3]="CANCELLED",A[A.ERROR=4]="ERROR",e.LayoutPlaybackType=void 0,(S=e.LayoutPlaybackType||(e.LayoutPlaybackType={})).CURRENT="current",S.NEXT="next",S.OVERLAY="overlay";var E,x={id:null,layoutId:-9,sw:0,sh:0,xw:0,xh:0,duration:0,zIndex:0,scaleFactor:1,sWidth:0,sHeight:0,offsetX:0,offsetY:0,bgColor:"",bgImage:"",bgId:"",containerName:"",layoutNode:void 0,regionMaxZIndex:0,ready:!1,regionObjects:[],drawer:null,allExpired:!1,regions:[],actions:[],options:{},done:!1,allEnded:!1,path:"",emitter:{},index:-1,actionController:void 0,enableStat:!1,xlr:{},inLoop:!0,xlfString:"",ad:null,isOverlay:!1,shareOfVoice:0,errorCode:null,prepareLayout:function(){},parseXlf:function(){},run:function(){},on:function(e,t){return{}},regionExpired:function(){},end:function(){},regionEnded:function(){},stopAllMedia:function(){return Promise.resolve()},resetLayout:function(){return Promise.resolve()},finishAllRegions:function(){return Promise.resolve([])},removeLayout:function(){},discardLayout:function(){},getXlf:function(){return""},isInterrupt:function(){return!1},state:e.ELayoutState.IDLE,html:null},C={IDLE:"idle",PLAYING:"playing",ENDED:"ended",CANCELLED:"cancelled"},k={complete:!1,containerName:"",currMedia:void 0,currEl:null,currentMedia:-1,currentMediaIndex:0,end:function(){},ended:!1,ending:!1,exitTransition:function(){},exitTransitionComplete:function(){},finished:function(){},html:{},id:"",index:-1,layout:x,mediaObjects:[],mediaObjectsActions:[],nxtMedia:void 0,nxtEl:null,offsetX:0,offsetY:0,oldMedia:void 0,on:function(e,t){return{}},oneMedia:!1,options:{},playNextMedia:function(){},playPreviousMedia:function(){},prepareMediaObjects:function(){},prepareRegion:function(){},ready:!1,regionId:"",reset:function(){},run:function(){},sHeight:0,sWidth:0,totalMediaObjects:0,transitionNodes:function(){},uniqueId:"",xml:null,zIndex:0,prepareNextMedia:function(){},xlr:{}},I=function(){return c((function e(){u(this,e),h(this,"overlays",[]),h(this,"container",void 0),h(this,"parent",void 0),this.container=document.createElement("div"),this.container.className="overlay-layouts",this.container.style.display="none"}),[{key:"parseOverlays",value:(i=l(s().mark((function e(t){var i=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(function(){var e=l(s().mark((function e(t,n){var a,o,l,u,d;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=r(r({},o={}),t)).index=null!==(a=t.index)&&void 0!==a?a:n,e.next=5,i.parent.prepareLayoutXlf(r(r({},x),o));case 5:return l=e.sent,console.debug("<> XLR.debug OverlayLayoutManager::parseOverlays prepared overlay layout",{overlayLayout:l,inputOverlay:o}),null!==(u=document.querySelector("#".concat(l.containerName,'[data-sequence="').concat(l.index,'"]')))&&(u.style.setProperty("visibility","hidden"),u.style.setProperty("z-index","".concat(null!==(d=l.zIndex)&&void 0!==d?d:-999))),e.abrupt("return",l);case 10:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"prepareOverlayLayouts",value:(t=l(s().mark((function e(t,i){var n,r,a,o,l,u,d,c=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,this.parent=i,console.debug("<> XLR.debug OverlayLayoutManager::prepareOverlayLayouts",{existingOverlays:this.overlays,newOverlays:t,hasChanged:n}),!(this.overlays.length>0&&t.length>=0)){e.next=27;break}if(r=this.overlays.reduce((function(e,t){return[].concat(v(e),[t.layoutId])}),[]),a=t.reduce((function(e,t){return[].concat(v(e),[t.layoutId])}),[]),!(n=r.join(",")!==a.join(","))){e.next=27;break}if(o=r.filter((function(e){return-1===a.indexOf(e)})),console.debug("<> XLR.debug OverlayLayoutManager::prepareOverlayLayouts overlaysRemoved",{overlaysRemoved:o,existingOverlayIds:r,newListIds:a}),!(o.length>0)){e.next=27;break}l=_(o),e.prev=12,d=s().mark((function e(){var t,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.value,!(i=c.overlays.find((function(e){return e.layoutId===t})))){e.next=8;break}if(null===document.querySelector("#".concat(i.containerName,'[data-sequence="').concat(i.index,'"]'))){e.next=8;break}return e.next=7,i.finishAllRegions();case 7:i.emitter.emit("end",i);case 8:case"end":return e.stop()}}),e)})),l.s();case 15:if((u=l.n()).done){e.next=19;break}return e.delegateYield(d(),"t0",17);case 17:e.next=15;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(12),l.e(e.t1);case 24:return e.prev=24,l.f(),e.finish(24);case 27:return console.debug("<> XLR.debug OverlayLayoutManager::prepareOverlayLayouts",{existingOverlays:this.overlays,newOverlays:t,hasChanged:n}),e.next=30,this.parseOverlays(t);case 30:this.overlays=e.sent;case 31:case"end":return e.stop()}}),e,this,[[12,21,24,27]])}))),function(e,i){return t.apply(this,arguments)})},{key:"playOverlays",value:function(){var e;if(0!==this.overlays.length)return this.parent&&null!==(e=this.parent.currentLayout)&&void 0!==e&&e.isInterrupt()?(this.container.style.setProperty("visibility","hidden"),void this.container.style.setProperty("z-index","-999")):void this.overlays.forEach((function(e){e.run()}))}},{key:"stopOverlays",value:function(){0!==this.overlays.length&&this.overlays.forEach(function(){var e=l(s().mark((function e(t){var i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=document.querySelector("#".concat(t.containerName,'[data-sequence="').concat(t.index,'"]')),console.debug("<> XLR.debug OverlayLayoutManager::stopOverlays",{overlay:t,overlayHtml:i}),null===i){e.next=6;break}return e.next=5,t.finishAllRegions();case 5:t.emitter.emit("end",t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"resumeOverlays",value:(e=l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.overlays.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.parseOverlays(this.overlays);case 4:this.overlays=e.sent,this.playOverlays();case 6:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}]);var e,t,i}();e.ELayoutType=void 0,(E=e.ELayoutType||(e.ELayoutType={}))[E.CURRENT=0]="CURRENT",E[E.NEXT=1]="NEXT";var L,O={bootstrap:function(){},config:{},currentLayout:void 0,currentLayoutId:-2,currentLayoutIndex:0,emitSync:function(e){return Promise.resolve()},emitter:{},getLayout:function(e){},getLayoutById:function(e){return{}},gotoNextLayout:function(){},gotoPrevLayout:function(){},init:function(){return Promise.resolve({})},inputLayouts:[],isInterrupted:!1,isLayoutInDOM:function(e,t){return!1},cleanupOrphanedLayouts:function(e,t){},isSspEnabled:!1,isUpdatingLoop:!1,isUpdatingOverlays:!1,layouts:{},nextLayout:void 0,on:function(e,t){return{}},overlayLayoutManager:new I,overlays:[],parseLayouts:function(){return{}},playLayouts:function(e){},playSchedules:function(e){return Promise.resolve()},prepareForSsp:function(e){return Promise.resolve({})},prepareLayoutXlf:function(e){return Promise.resolve({})},prepareLayouts:function(){return Promise.resolve({})},renderOverlayLayouts:function(){return Promise.resolve()},uniqueLayouts:{},updateInputLayout:function(e,t){},updateLayouts:function(e){},updateLoop:function(e){return Promise.resolve()},updateOverlays:function(e){return Promise.resolve()},updateScheduleLayouts:function(e){return Promise.resolve()}};e.ConsumerPlatform=void 0,(L=e.ConsumerPlatform||(e.ConsumerPlatform={})).CMS="CMS",L.CHROMEOS="chromeOS",L.ELECTRON="electron",L.IOS="ios",L.MACOS="macos",L.ANDROID="android",L.LINUX="linux",L.WINDOWS="windows",L.WEBOS="webos",L.TIZEN="tizen";const P=6048e5,D=864e5,M=Symbol.for("constructDateFrom");function N(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&M in e?e[M](t):e instanceof Date?new e.constructor(t):new Date(t)}function R(e,t){return N(t||e,e)}let B={};function U(){return B}function F(e,t){const i=U(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=R(e,t?.in),s=r.getDay(),a=(s<n?7:0)+s-n;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function j(e,t){return F(e,{...t,weekStartsOn:1})}function q(e,t){const i=R(e,t?.in),n=i.getFullYear(),r=N(i,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=j(r),a=N(i,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=j(a);return i.getTime()>=s.getTime()?n+1:i.getTime()>=o.getTime()?n:n-1}function H(e){const t=R(e),i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return i.setUTCFullYear(t.getFullYear()),+e-+i}function V(e,t){const i=R(e,t?.in);return i.setHours(0,0,0,0),i}function X(e,t,i){const[n,r]=function(e,...t){const i=N.bind(null,t.find((e=>"object"==typeof e)));return t.map(i)}(0,e,t),s=V(n),a=V(r),o=+s-H(s),l=+a-H(a);return Math.round((o-l)/D)}function z(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+R(e)));var t}const W={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function G(e){return(t={})=>{const i=t.width?String(t.width):e.defaultWidth;return e.formats[i]||e.formats[e.defaultWidth]}}const Y={date:G({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:G({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:G({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},K={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function J(e){return(t,i)=>{let n;if("formatting"===(i?.context?String(i.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=i?.width?String(i.width):t;n=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=i?.width?String(i.width):e.defaultWidth;n=e.values[r]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function Q(e){return(t,i={})=>{const n=i.width,r=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let i=0;i<e.length;i++)if(t(e[i]))return i;return}(o,(e=>e.test(a))):function(e,t){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t(e[i]))return i;return}(o,(e=>e.test(a)));let u;u=e.valueCallback?e.valueCallback(l):l,u=i.valueCallback?i.valueCallback(u):u;return{value:u,rest:t.slice(a.length)}}}var Z;const $={code:"en-US",formatDistance:(e,t,i)=>{let n;const r=W[e];return n="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+n:n+" ago":n},formatLong:Y,formatRelative:(e,t,i,n)=>K[e],localize:{ordinalNumber:(e,t)=>{const i=Number(e),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:J({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:J({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:J({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:J({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:J({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Z={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const i=e.match(Z.matchPattern);if(!i)return null;const n=i[0],r=e.match(Z.parsePattern);if(!r)return null;let s=Z.valueCallback?Z.valueCallback(r[0]):r[0];return s=t.valueCallback?t.valueCallback(s):s,{value:s,rest:e.slice(n.length)}}),era:Q({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Q({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Q({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Q({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Q({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ee(e,t){const i=R(e,t?.in),n=X(i,function(e,t){const i=R(e,t?.in);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}(i));return n+1}function te(e,t){const i=R(e,t?.in),n=+j(i)-+function(e,t){const i=q(e,t),n=N(e,0);return n.setFullYear(i,0,4),n.setHours(0,0,0,0),j(n)}(i);return Math.round(n/P)+1}function ie(e,t){const i=R(e,t?.in),n=i.getFullYear(),r=U(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=N(t?.in||e,0);a.setFullYear(n+1,0,s),a.setHours(0,0,0,0);const o=F(a,t),l=N(t?.in||e,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=F(l,t);return+i>=+o?n+1:+i>=+u?n:n-1}function ne(e,t){const i=R(e,t?.in),n=+F(i,t)-+function(e,t){const i=U(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=ie(e,t),s=N(t?.in||e,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),F(s,t)}(i,t);return Math.round(n/P)+1}function re(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const se={y(e,t){const i=e.getFullYear(),n=i>0?i:1-i;return re("yy"===t?n%100:n,t.length)},M(e,t){const i=e.getMonth();return"M"===t?String(i+1):re(i+1,2)},d:(e,t)=>re(e.getDate(),t.length),a(e,t){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];default:return"am"===i?"a.m.":"p.m."}},h:(e,t)=>re(e.getHours()%12||12,t.length),H:(e,t)=>re(e.getHours(),t.length),m:(e,t)=>re(e.getMinutes(),t.length),s:(e,t)=>re(e.getSeconds(),t.length),S(e,t){const i=t.length,n=e.getMilliseconds();return re(Math.trunc(n*Math.pow(10,i-3)),t.length)}},ae="midnight",oe="noon",le="morning",ue="afternoon",de="evening",ce="night",he={G:function(e,t,i){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});default:return i.era(n,{width:"wide"})}},y:function(e,t,i){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return i.ordinalNumber(n,{unit:"year"})}return se.y(e,t)},Y:function(e,t,i,n){const r=ie(e,n),s=r>0?r:1-r;if("YY"===t){return re(s%100,2)}return"Yo"===t?i.ordinalNumber(s,{unit:"year"}):re(s,t.length)},R:function(e,t){return re(q(e),t.length)},u:function(e,t){return re(e.getFullYear(),t.length)},Q:function(e,t,i){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,i){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return re(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,i){const n=e.getMonth();switch(t){case"M":case"MM":return se.M(e,t);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,i){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,i,n){const r=ne(e,n);return"wo"===t?i.ordinalNumber(r,{unit:"week"}):re(r,t.length)},I:function(e,t,i){const n=te(e);return"Io"===t?i.ordinalNumber(n,{unit:"week"}):re(n,t.length)},d:function(e,t,i){return"do"===t?i.ordinalNumber(e.getDate(),{unit:"date"}):se.d(e,t)},D:function(e,t,i){const n=ee(e);return"Do"===t?i.ordinalNumber(n,{unit:"dayOfYear"}):re(n,t.length)},E:function(e,t,i){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,i,n){const r=e.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return re(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,i,n){const r=e.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return re(s,t.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,i){const n=e.getDay(),r=0===n?7:n;switch(t){case"i":return String(r);case"ii":return re(r,t.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,i){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,i){const n=e.getHours();let r;switch(r=12===n?oe:0===n?ae:n/12>=1?"pm":"am",t){case"b":case"bb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,i){const n=e.getHours();let r;switch(r=n>=17?de:n>=12?ue:n>=4?le:ce,t){case"B":case"BB":case"BBB":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,i){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),i.ordinalNumber(t,{unit:"hour"})}return se.h(e,t)},H:function(e,t,i){return"Ho"===t?i.ordinalNumber(e.getHours(),{unit:"hour"}):se.H(e,t)},K:function(e,t,i){const n=e.getHours()%12;return"Ko"===t?i.ordinalNumber(n,{unit:"hour"}):re(n,t.length)},k:function(e,t,i){let n=e.getHours();return 0===n&&(n=24),"ko"===t?i.ordinalNumber(n,{unit:"hour"}):re(n,t.length)},m:function(e,t,i){return"mo"===t?i.ordinalNumber(e.getMinutes(),{unit:"minute"}):se.m(e,t)},s:function(e,t,i){return"so"===t?i.ordinalNumber(e.getSeconds(),{unit:"second"}):se.s(e,t)},S:function(e,t){return se.S(e,t)},X:function(e,t,i){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return me(n);case"XXXX":case"XX":return ge(n);default:return ge(n,":")}},x:function(e,t,i){const n=e.getTimezoneOffset();switch(t){case"x":return me(n);case"xxxx":case"xx":return ge(n);default:return ge(n,":")}},O:function(e,t,i){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+pe(n,":");default:return"GMT"+ge(n,":")}},z:function(e,t,i){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+pe(n,":");default:return"GMT"+ge(n,":")}},t:function(e,t,i){return re(Math.trunc(+e/1e3),t.length)},T:function(e,t,i){return re(+e,t.length)}};function pe(e,t=""){const i=e>0?"-":"+",n=Math.abs(e),r=Math.trunc(n/60),s=n%60;return 0===s?i+String(r):i+String(r)+t+re(s,2)}function me(e,t){if(e%60==0){return(e>0?"-":"+")+re(Math.abs(e)/60,2)}return ge(e,t)}function ge(e,t=""){const i=e>0?"-":"+",n=Math.abs(e);return i+re(Math.trunc(n/60),2)+t+re(n%60,2)}const fe=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},ye=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},ve={p:ye,P:(e,t)=>{const i=e.match(/(P+)(p+)?/)||[],n=i[1],r=i[2];if(!r)return fe(e,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"})}return s.replace("{{date}}",fe(n,t)).replace("{{time}}",ye(r,t))}},be=/^D+$/,Te=/^Y+$/,_e=["D","DD","YY","YYYY"];const Ae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Se=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,we=/^'([^]*?)'?$/,Ee=/''/g,xe=/[a-zA-Z]/;function Ce(e,t,i){const n=U(),r=n.locale??$,s=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=R(e,i?.in);if(!z(o))throw new RangeError("Invalid time value");let l=t.match(Se).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,ve[t])(e,r.formatLong)}return e})).join("").match(Ae).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ke(e)};if(he[t])return{isToken:!0,value:e};if(t.match(xe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));r.localize.preprocessor&&(l=r.localize.preprocessor(o,l));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return l.map((i=>{if(!i.isToken)return i.value;const n=i.value;(function(e){return Te.test(e)}(n)||function(e){return be.test(e)}(n))&&function(e,t,i){const n=function(e,t,i){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,i);if(console.warn(n),_e.includes(e))throw new RangeError(n)}(n,t,String(e));return(0,he[n[0]])(o,n,r.localize,u)})).join("")}function ke(e){const t=e.match(we);return t?t[1].replace(Ee,"'"):e}var Ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Oe(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),i}var Pe,De="undefined"!=typeof window?window:void 0!==Ie?Ie:"undefined"!=typeof self?self:{},Me=Le(De),Ne=void 0!==Ie?Ie:"undefined"!=typeof window?window:{},Re=Oe(Object.freeze({__proto__:null,default:{}}));"undefined"!=typeof document?Pe=document:(Pe=Ne["__GLOBAL_DOCUMENT_CACHE@4"])||(Pe=Ne["__GLOBAL_DOCUMENT_CACHE@4"]=Re);var Be=Pe,Ue=Le(Be),Fe={exports:{}},je={exports:{}};!function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(je);var qe=je.exports,He=function(e){if(!e)return!1;var t=Ve.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Ve=Object.prototype.toString;function Xe(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return ze(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ze(e,t)}(e))||t){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var We=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var i=this.typeToInterceptorsMap_.get(e);return!i.has(t)&&(i.add(t),!0)},t.removeInterceptor=function(e,t){var i=this.typeToInterceptorsMap_.get(e);return!(!i||!i.has(t))&&(i.delete(t),!0)},t.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},t.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var i,n=Xe(this.getForType(e));!(i=n()).done;){var r=i.value;try{t=r(t)}catch(e){}}return t},e}(),Ge=We,Ye=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,i=t.maxAttempts,n=t.delayFactor,r=t.fuzzFactor,s=t.initialDelay;return new Ke({maxAttempts:i||this.maxAttempts_,delayFactor:n||this.delayFactor_,fuzzFactor:r||this.fuzzFactor_,initialDelay:s||this.initialDelay_})},e}(),Ke=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}(),Je=De;var Qe=function(e,t){return void 0===t&&(t=!1),function(i,n,r){if(i)e(i);else if(n.statusCode>=400&&n.statusCode<=599){var s=r;if(t)if(Je.TextDecoder){var a=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),n=i[0],r=i[1];return"charset"===n.trim()?r.trim():e}),"utf-8")}(n.headers&&n.headers["content-type"]);try{s=new TextDecoder(a).decode(r)}catch(e){}}else s=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:s})}else e(null,r)}},Ze=De,$e=qe,et=He,tt=Ge,it=Ye;st.httpHandler=Qe,st.requestInterceptorsStorage=new tt,st.responseInterceptorsStorage=new tt,st.retryManager=new it;
2
2
  /**
3
3
  * @license
4
4
  * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
@@ -6,9 +6,9 @@ var XiboLayoutRenderer=function(e){"use strict";function t(e,t,n){return t=m(t),
6
6
  * Available under the MIT license
7
7
  * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
8
8
  */
9
- var rt=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();void 0===t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t};function st(e,t,i){var n=e;return tt(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=et({},t,{uri:e}),n.callback=i,n}function at(e,t,i){return ot(t=st(e,t,i))}function ot(e){if(void 0===e.callback)throw new Error("callback argument missing");if(e.requestType&&at.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},i=at.requestInterceptorsStorage.execute(e.requestType,t);e.uri=i.uri,e.headers=i.headers,e.body=i.body,e.metadata=i.metadata,e.retry=i.retry,e.timeout=i.timeout}var n=!1,r=function(t,i,r){n||(n=!0,e.callback(t,i,r))};function s(){var e=void 0;if(e=d.response?d.response:d.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(d),y)try{e=JSON.parse(e)}catch(e){}return e}function a(t){if(clearTimeout(c),clearTimeout(e.retryTimeout),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,u||!at.retryManager.getIsEnabled()||!e.retry||!e.retry.shouldRetry()){if(e.requestType&&at.responseInterceptorsStorage.getIsEnabled()){var i={headers:v.headers||{},body:v.body,responseUrl:d.responseURL,responseType:d.responseType},n=at.responseInterceptorsStorage.execute(e.requestType,i);v.body=n.body,v.headers=n.headers}return r(t,v)}e.retryTimeout=setTimeout((function(){e.retry.moveToNextAttempt(),e.xhr=d,ot(e)}),e.retry.getCurrentFuzzedDelay())}function o(){if(!u){var t;clearTimeout(c),clearTimeout(e.retryTimeout),t=e.useXDR&&void 0===d.status?200:1223===d.status?204:d.status;var i=v,n=null;if(0!==t?(i={body:s(),statusCode:t,method:p,headers:{},url:h,rawRequest:d},d.getAllResponseHeaders&&(i.headers=rt(d.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),e.requestType&&at.responseInterceptorsStorage.getIsEnabled()){var a={headers:i.headers||{},body:i.body,responseUrl:d.responseURL,responseType:d.responseType},o=at.responseInterceptorsStorage.execute(e.requestType,a);i.body=o.body,i.headers=o.headers}return r(n,i,i.body)}}var l,u,d=e.xhr||null;d||(d=e.cors||e.useXDR?new at.XDomainRequest:new at.XMLHttpRequest);var c,h=d.url=e.uri||e.url,p=d.method=e.method||"GET",m=e.body||e.data,g=d.headers=e.headers||{},f=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:p,url:h,rawRequest:d};if("json"in e&&!1!==e.json&&(y=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),m=JSON.stringify(!0===e.json?m:e.json))),d.onreadystatechange=function(){4!==d.readyState||at.responseInterceptorsStorage.getIsEnabled()||setTimeout(o,0)},d.onload=o,d.onerror=a,d.onprogress=function(){},d.onabort=function(){u=!0,clearTimeout(e.retryTimeout)},d.ontimeout=a,d.open(p,h,!f,e.username,e.password),f||(d.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(c=setTimeout((function(){if(!u){u=!0,d.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",a(e)}}),e.timeout)),d.setRequestHeader)for(l in g)g.hasOwnProperty(l)&&d.setRequestHeader(l,g[l]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(d.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(d),d.send(m||null),d}je.exports=at,je.exports.default=at,at.XMLHttpRequest=$e.XMLHttpRequest||function(){},at.XDomainRequest="withCredentials"in new at.XMLHttpRequest?at.XMLHttpRequest:$e.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){at["delete"===e?"del":e]=function(t,i,n){return(i=st(t,i,n)).method=e.toUpperCase(),ot(i)}}));var lt=Oe(je.exports),ut={exports:{}},dt=Ue,ct=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function ht(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function pt(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function mt(){this.values=ct(null)}function gt(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"==typeof r[s]){var a=r[s].split(i);if(2===a.length)t(a[0].trim(),a[1].trim())}}function ft(e,t,i){var n=e;function r(){var t=pt(e);if(null===t)throw new ht(ht.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=r(),s(),"--\x3e"!==e.substr(0,3))throw new ht(ht.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),s(),t.endTime=r(),s(),function(e,t){var n=new mt;gt(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),a=s[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===s.length&&n.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),n.percent(e,s[0]),2===s.length&&n.alt("positionAlign",s[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}ht.prototype=ct(Error.prototype),ht.prototype.constructor=ht,ht.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},mt.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var yt=dt.createElement&&dt.createElement("textarea"),vt={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},bt={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},_t={v:"title",lang:"lang"},Tt={rt:"ruby"};function At(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!Tt[t.localName]||Tt[t.localName]===e.localName}function r(t,i){var n=vt[t];if(!n)return null;var r=e.document.createElement(n),s=_t[t];return s&&i&&(r[s]=i.trim()),r}for(var s,a,o=e.document.createElement("div"),l=o,u=[];null!==(s=i());)if("<"!==s[0])l.appendChild(e.document.createTextNode((a=s,yt.innerHTML=a,a=yt.textContent,yt.textContent="",a)));else{if("/"===s[1]){u.length&&u[u.length-1]===s.substr(2).replace(">","")&&(u.pop(),l=l.parentNode);continue}var d,c=pt(s.substr(1,s.length-2));if(c){d=e.document.createProcessingInstruction("timestamp",c),l.appendChild(d);continue}var h=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h)continue;if(!(d=r(h[1],h[3])))continue;if(!n(l,d))continue;if(h[2]){var p=h[2].split(".");p.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(bt.hasOwnProperty(i)){var n=t?"background-color":"color",r=bt[i];d.style[n]=r}})),d.className=p.join(" ")}u.push(h[1]),l.appendChild(d),l=d}return o}var St=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function wt(e){for(var t=0;t<St.length;t++){var i=St[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function Et(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var s=i.match(/^.*(\n|\r)/);return s?(e.length=0,s[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var s=0;s<i.length;s++)if(wt(i.charCodeAt(s)))return"rtl";return"ltr"}function xt(){}function Ct(e,t,i){xt.call(this),this.cue=t,this.cueDiv=At(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:Et(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":case"line-left":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":case"line-right":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function kt(e){var t,i,n,r;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function It(e,t,i,n){var r=new kt(t),s=t.cue,a=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(s),o=[];if(s.snapToLines){var l;switch(s.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var u=r.lineHeight,d=u*Math.round(a),c=i[l]+u,h=o[0];Math.abs(d)>c&&(d=d<0?-1:1,d*=Math.ceil(c/u)*u),a<0&&(d+=""===s.vertical?i.height:i.width,o=o.reverse()),r.move(h,d)}else{var p=r.lineHeight/i.height*100;switch(s.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],r=new kt(t)}var m=function(e,t){for(var r,s=new kt(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(r=new kt(e),a=l),e=new kt(s)}return r||s}(r,o);t.move(m.toCSSCompatValues(i))}function Lt(){}xt.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},xt.prototype.formatStyle=function(e,t){return 0===e?0:e+t},Ct.prototype=ct(xt.prototype),Ct.prototype.constructor=Ct,kt.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},kt.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},kt.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},kt.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},kt.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},kt.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},kt.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},kt.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Lt.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Lt.convertCueToDOMTree=function(e,t){return e&&t?At(e,t):null};Lt.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],s=kt.getSimpleBoxPosition(n),a={font:Math.round(.05*s.height*100)/100+"px sans-serif"};!function(){for(var i,o,l=0;l<t.length;l++)o=t[l],i=new Ct(e,o,a),n.appendChild(i.div),It(0,i,s,r),o.displayState=i.div,r.push(kt.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},Lt.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},Lt.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof ht))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function n(e){e.match(/X-TIMESTAMP-MAP/)?gt(e,(function(e,i){if("X-TIMESTAMP-MAP"===e)!function(e){var i=new mt;gt(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",pt(t))}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)}),/=/):gt(e,(function(e,i){if("Region"===e)!function(e){var i=new mt;if(gt(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var r=new mt;if(r.percent("x",n[0]),r.percent("y",n[1]),!r.has("x")||!r.has("y"))break;i.set(e+"X",r.get("x")),i.set(e+"Y",r.get("y"));break;case"scroll":i.alt(e,t,["up"])}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}(i)}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var r;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var s=(r=i()).match(/^WEBVTT([ \t].*)?$/);if(!s||!s[0])throw new ht(ht.Errors.BadSignature);t.state="HEADER"}for(var a=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:r=i(),t.state){case"HEADER":/:/.test(r)?n(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(e){t.cue.align="middle"}if(t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":try{ft(r,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var o=-1!==r.indexOf("--\x3e");if(!r||o&&(a=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":r||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new ht(ht.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var Ot=Lt,Pt={"":1,lr:1,rl:1},Dt={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Mt(e){return"string"==typeof e&&(!!Dt[e.toLowerCase()]&&e.toLowerCase())}function Nt(e,t,i){this.hasBeenReset=!1;var n="",r=!1,s=e,a=t,o=i,l=null,u="",d=!0,c="auto",h="start",p="auto",m="auto",g=100,f="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");s=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");a=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(e){l=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&!!Pt[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");u=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");c=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){var t=Mt(e);t?(h=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return p},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=Mt(e);t?(m=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");g=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return f},set:function(e){var t=Mt(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");f=t,this.hasBeenReset=!0}}}),this.displayState=void 0}Nt.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Rt=Nt,Bt={"":!0,up:!0};function Ut(e){return"number"==typeof e&&e>=0&&e<=100}var qt=function(){var e=100,t=3,i=0,n=100,r=0,s=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Ut(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!Ut(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!Ut(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!Ut(e))throw new Error("ViewportAnchorY must be between 0 and 100.");s=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!Ut(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return a},set:function(e){var t=function(e){return"string"==typeof e&&!!Bt[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):a=t}}})},jt=Me,Ft=ut.exports={WebVTT:Ot,VTTCue:Rt,VTTRegion:qt};jt.vttjs=Ft,jt.WebVTT=Ft.WebVTT;var Ht=Ft.VTTCue,Vt=Ft.VTTRegion,zt=jt.VTTCue,Xt=jt.VTTRegion;Ft.shim=function(){jt.VTTCue=Ht,jt.VTTRegion=Vt},Ft.restore=function(){jt.VTTCue=zt,jt.VTTRegion=Xt},jt.VTTCue||Ft.shim();var Wt=Oe(ut.exports);function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Gt.apply(this,arguments)}var Yt="https://example.com",Kt=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=Ne.location&&Ne.location.href||"");var i=/^\/\//.test(e),n=!Ne.location&&!/\/\//i.test(e);e=new Ne.URL(e,Ne.location||Yt);var r=new URL(t,e);return n?r.href.slice(19):i?r.href.slice(r.protocol.length):r.href},Jt=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function Qt(e){for(var t,i=(t=e,Ne.atob?Ne.atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(i.length),r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return n}
10
- /*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class Zt extends Jt{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const $t=String.fromCharCode(9),ei=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},ti=function(e){const t={};if(!e)return t;const i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let n,r=i.length;for(;r--;)""!==i[r]&&(n=/([^=]*)=(.*)/.exec(i[r]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),t[n[0]]=n[1]);return t},ii=e=>{const t=e.split("x"),i={};return t[0]&&(i.width=parseInt(t[0],10)),t[1]&&(i.height=parseInt(t[1],10)),i};class ni extends Jt{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(0===(e=e.trim()).length)return;if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(((t,i)=>{const n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return i=Gt(ei(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){const e=ti(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=ei(e.BYTERANGE))}this.trigger("data",i)}else{if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=ti(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=ii(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=ti(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=ti(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=ti(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=ti(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split($t)),void this.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=ti(t[1]),["DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=ei(i.attributes.BYTERANGE)),void this.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=ti(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=ti(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=ti(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}})),void this.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=ti(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))})),void this.trigger("data",i);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=ti(t[1]),["ID","CLASS"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))})),["START-DATE","END-DATE"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))})),["DURATION","PLANNED-DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["END-ON-NEXT"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))}));const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in i.attributes){if(!e.test(t))continue;const n=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),r=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=n?i.attributes[t].toString(16):r?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"i-frames-only"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return i={type:"tag",tagType:"content-steering"},i.attributes=ti(t[1]),void this.trigger("data",i);if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"i-frame-playlist"},i.attributes=ti(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=ii(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),void this.trigger("data",i);if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e),t)return i={type:"tag",tagType:"define"},i.attributes=ti(t[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})}))}addParser({expression:e,customType:t,dataParser:i,segment:n}){"function"!=typeof i&&(i=e=>e),this.customParsers.push((r=>{if(e.exec(r))return this.trigger("data",{type:"custom",data:i(r),customType:t,segment:n}),!0}))}addTagMapper({expression:e,map:t}){this.tagMappers.push((i=>e.test(i)?t(i):i))}}const ri=function(e){const t={};return Object.keys(e).forEach((function(i){var n;t[(n=i,n.toLowerCase().replace(/-(\w)/g,(e=>e[1].toUpperCase())))]=e[i]})),t},si=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:n}=e;if(!t)return;const r="#EXT-X-SERVER-CONTROL",s="holdBack",a="partHoldBack",o=i&&3*i,l=n&&2*n;i&&!t.hasOwnProperty(s)&&(t[s]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[s]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${t[s]}) to targetDuration * 3 (${o})`}),t[s]=o),n&&!t.hasOwnProperty(a)&&(t[a]=3*n,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),n&&t[a]<l&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class ai extends Jt{constructor(e={}){super(),this.lineStream=new Zt,this.parseStream=new ni,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let n,r,s={},a=!1;const o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let u=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let d=0,c=0;const h={};this.on("end",(()=>{s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&r&&(s.key=r),s.timeline||"number"!=typeof u||(s.timeline=u),this.manifest.preloadSegment=s)})),this.parseStream.on("data",(function(e){let p,m;if(t.manifest.definitions)for(const i in t.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace(`{$${i}}`,t.manifest.definitions[i])),e.attributes)for(const n in e.attributes)"string"==typeof e.attributes[n]&&(e.attributes[n]=e.attributes[n].replace(`{$${i}}`,t.manifest.definitions[i]));({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=d)),"offset"in e&&(s.byterange=t,t.offset=e.offset),d=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(s.title=e.title),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Qt(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(r.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence"(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,u=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type"(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),r&&(n.key=r)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(s.attributes||(s.attributes={}),Gt(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},p=t[e.attributes["GROUP-ID"]],m={default:/yes/i.test(e.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(m.language=e.attributes.LANGUAGE),e.attributes.URI&&(m.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(m.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(m.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(m.forced=/yes/i.test(e.attributes.FORCED)),p[e.attributes.NAME]=m},discontinuity(){u+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject;const{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight(((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime)),this.lastProgramDateTime)},targetduration(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,si.call(this,this.manifest))},start(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){s.cueOut=e.data},"cue-out-cont"(){s.cueOutCont=e.data},"cue-in"(){s.cueIn=e.data},skip(){this.manifest.skip=ri(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const t=this.manifest.segments.length,i=ri(e.attributes);s.parts=s.parts||[],s.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=c),c=i.byterange.offset+i.byterange.length);const n=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${n} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const t=this.manifest.serverControl=ri(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),si.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const t=this.manifest.segments.length,i=ri(e.attributes),n=i.type&&"PART"===i.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?c:0,n&&(c=i.byterange.offset+i.byterange.length)));const r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #${t}`,e.attributes,["TYPE","URI"]),i.type)for(let e=0;e<s.preloadHints.length-1;e++){const n=s.preloadHints[e];n.type&&(n.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${r} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`}))}},"rendition-report"(){const t=ri(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);const i=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];a&&n.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,e.attributes,n)},"part-inf"(){this.manifest.partInf=ri(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),si.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(ri(e.attributes));const t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);const i=this.manifest.dateRanges[t];i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),i.plannedDuration&&i.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const n=!!i.endOnNext;if(n&&!i.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),n&&(i.duration||i.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),i.duration&&i.endDate){const e=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(h[i.id]){for(const e in h[i.id])if(i[e]&&JSON.stringify(h[i.id][e])!==JSON.stringify(i[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex((e=>e.id===i.id));this.manifest.dateRanges[e]=Gt(this.manifest.dateRanges[e],i),h[i.id]=Gt(h[i.id],i),this.manifest.dateRanges.pop()}else h[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=ri(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const t=(e,t)=>{e in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`}):this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const i=this.params.get(e.attributes.QUERYPARAM);return i?void t(e.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void t(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:u}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}}[e.tagType]||o).call(t)},uri(){s.uri=e.uri,i.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),r&&(s.key=r),s.timeline=u,n&&(s.map=n),c=0,null!==this.lastProgramDateTime&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*s.duration),s={}},comment(){},custom(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(t)}))}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${n.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var oi,li,ui={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},di=["video","audio","text"],ci=["Video","Audio","Text"],hi=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})):e},pi=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),di.forEach((function(n){var r=ui[n].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=n;var s=e.substring(0,r[1].length),a=e.replace(s,"");i.push({type:s,details:a,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},mi=function(e){return void 0===e&&(e=""),ui.audio.test(e.trim().toLowerCase())},gi=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map((function(e){return hi(e.trim())})),n="video";1===i.length&&mi(i[0])?n="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),ui.text.test(t.trim().toLowerCase()))&&(n="application");var r="mp4";return i.every((function(e){return ui.mp4.test(e)}))?r="mp4":i.every((function(e){return ui.webm.test(e)}))?r="webm":i.every((function(e){return ui.ogg.test(e)}))&&(r="ogg"),n+"/"+r+';codecs="'+e+'"'}},fi=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),Ne.MediaSource&&Ne.MediaSource.isTypeSupported&&Ne.MediaSource.isTypeSupported(gi(e))||t&&Ne.ManagedMediaSource&&Ne.ManagedMediaSource.isTypeSupported&&Ne.ManagedMediaSource.isTypeSupported(gi(e))||!1},yi=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<ci.length;t++){if(ui["muxer"+ci[t]].test(e))return!0}return!1}))},vi="mp4a.40.2",bi=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,_i=/^application\/dash\+xml/i,Ti=function(e){return bi.test(e)?"hls":_i.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},Ai=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Si=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||Ai(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},wi=Ne.BigInt||Number,Ei=[wi("0x1"),wi("0x100"),wi("0x10000"),wi("0x1000000"),wi("0x100000000"),wi("0x10000000000"),wi("0x1000000000000"),wi("0x100000000000000"),wi("0x10000000000000000")];oi=new Uint16Array([65484]),255===(li=new Uint8Array(oi.buffer,oi.byteOffset,oi.byteLength))[0]||li[0];var xi=function(e,t){var i=void 0===t?{}:t,n=i.signed,r=void 0!==n&&n,s=i.le,a=void 0!==s&&s;e=Si(e);var o=a?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,i,n){var r=a?n:Math.abs(n+1-e.length);return t+wi(i)*Ei[r]}),wi(0));if(r){var u=Ei[e.length]/wi(2)-wi(1);(l=wi(l))>u&&(l-=u,l-=u,l-=wi(2))}return Number(l)},Ci=function(e,t){var i={}.le,n=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0),e=wi(e);for(var r,s=(r=e,Math.ceil(function(e){return e.toString(2).length}(r)/8)),a=new Uint8Array(new ArrayBuffer(s)),o=0;o<s;o++){var l=n?o:Math.abs(o+1-a.length);a[l]=Number(e/Ei[o]&wi(255)),e<0&&(a[l]=Math.abs(~a[l]),a[l]-=0===o?1:2)}return a},ki=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i},Ii=function(e,t,i){var n=void 0===i?{}:i,r=n.offset,s=void 0===r?0:r,a=n.mask,o=void 0===a?[]:a;e=Si(e);var l=(t=Si(t)).every?t.every:Array.prototype.every;return t.length&&e.length-s>=t.length&&l.call(t,(function(t,i){return t===(o[i]?o[i]&e[s+i]:e[s+i])}))},Li={},Oi={};function Pi(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var Di=Pi({HTML:"text/html",isHTML:function(e){return e===Di.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Mi=Pi({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===Mi.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Oi.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Oi.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(t.call(void 0,r,n,e))return r}},Oi.freeze=Pi,Oi.MIME_TYPE=Di,Oi.NAMESPACE=Mi;var Ni=Oi,Ri=Ni.find,Bi=Ni.NAMESPACE;function Ui(e){return""!==e}function qi(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function ji(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(Ui):[]}(e);return Object.keys(t.reduce(qi,{}))}function Fi(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function Hi(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,Fi(i,n=new n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var Vi={},zi=Vi.ELEMENT_NODE=1,Xi=Vi.ATTRIBUTE_NODE=2,Wi=Vi.TEXT_NODE=3,Gi=Vi.CDATA_SECTION_NODE=4,Yi=Vi.ENTITY_REFERENCE_NODE=5,Ki=Vi.ENTITY_NODE=6,Ji=Vi.PROCESSING_INSTRUCTION_NODE=7,Qi=Vi.COMMENT_NODE=8,Zi=Vi.DOCUMENT_NODE=9,$i=Vi.DOCUMENT_TYPE_NODE=10,en=Vi.DOCUMENT_FRAGMENT_NODE=11,tn=Vi.NOTATION_NODE=12,nn={},rn={};nn.INDEX_SIZE_ERR=(rn[1]="Index size error",1),nn.DOMSTRING_SIZE_ERR=(rn[2]="DOMString size error",2);var sn=nn.HIERARCHY_REQUEST_ERR=(rn[3]="Hierarchy request error",3);nn.WRONG_DOCUMENT_ERR=(rn[4]="Wrong document",4),nn.INVALID_CHARACTER_ERR=(rn[5]="Invalid character",5),nn.NO_DATA_ALLOWED_ERR=(rn[6]="No data allowed",6),nn.NO_MODIFICATION_ALLOWED_ERR=(rn[7]="No modification allowed",7);var an=nn.NOT_FOUND_ERR=(rn[8]="Not found",8);nn.NOT_SUPPORTED_ERR=(rn[9]="Not supported",9);var on=nn.INUSE_ATTRIBUTE_ERR=(rn[10]="Attribute in use",10);function ln(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,rn[e]),this.message=rn[e],Error.captureStackTrace&&Error.captureStackTrace(this,ln);return i.code=e,t&&(this.message=this.message+": "+t),i}function un(){}function dn(e,t){this._node=e,this._refresh=t,cn(this)}function cn(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(Zn(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var n=i.length;n in e;n++)Object.prototype.hasOwnProperty.call(e,n)&&delete e[n];Fi(i,e),e._inc=t}}function hn(){}function pn(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function mn(e,t,i,n){if(n?t[pn(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&Tn(r,e,n),function(e,t,i){e&&e._inc++;var n=i.namespaceURI;n===Bi.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(r,e,i))}}function gn(e,t,i){var n=pn(t,i);if(!(n>=0))throw new ln(an,new Error(e.tagName+"@"+i));for(var r=t.length-1;n<r;)t[n]=t[++n];if(t.length=r,e){var s=e.ownerDocument;s&&(Tn(s,e,i),i.ownerElement=null)}}function fn(){}function yn(){}function vn(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function bn(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(bn(e,t))return!0}while(e=e.nextSibling)}function _n(){this.ownerDocument=this}function Tn(e,t,i,n){e&&e._inc++,i.namespaceURI===Bi.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function An(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,s=0;r;)n[s++]=r,r=r.nextSibling;n.length=s,delete n[n.length]}}}function Sn(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,An(e.ownerDocument,e),t}function wn(e){return e&&e.nodeType===yn.DOCUMENT_TYPE_NODE}function En(e){return e&&e.nodeType===yn.ELEMENT_NODE}function xn(e){return e&&e.nodeType===yn.TEXT_NODE}function Cn(e,t){var i=e.childNodes||[];if(Ri(i,En)||wn(t))return!1;var n=Ri(i,wn);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function kn(e,t){var i=e.childNodes||[];if(Ri(i,(function(e){return En(e)&&e!==t})))return!1;var n=Ri(i,wn);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function In(e,t,i){if(!function(e){return e&&(e.nodeType===yn.DOCUMENT_NODE||e.nodeType===yn.DOCUMENT_FRAGMENT_NODE||e.nodeType===yn.ELEMENT_NODE)}(e))throw new ln(sn,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new ln(an,"child not in parent");if(!function(e){return e&&(En(e)||xn(e)||wn(e)||e.nodeType===yn.DOCUMENT_FRAGMENT_NODE||e.nodeType===yn.COMMENT_NODE||e.nodeType===yn.PROCESSING_INSTRUCTION_NODE)}(t)||wn(t)&&e.nodeType!==yn.DOCUMENT_NODE)throw new ln(sn,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function Ln(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===yn.DOCUMENT_FRAGMENT_NODE){var s=r.filter(En);if(s.length>1||Ri(r,xn))throw new ln(sn,"More than one element or text in fragment");if(1===s.length&&!Cn(e,i))throw new ln(sn,"Element in fragment can not be inserted before doctype")}if(En(t)&&!Cn(e,i))throw new ln(sn,"Only one element can be added and only after doctype");if(wn(t)){if(Ri(n,wn))throw new ln(sn,"Only one doctype is allowed");var a=Ri(n,En);if(i&&n.indexOf(a)<n.indexOf(i))throw new ln(sn,"Doctype can only be inserted before an element");if(!i&&a)throw new ln(sn,"Doctype can not be appended since element is present")}}function On(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===yn.DOCUMENT_FRAGMENT_NODE){var s=r.filter(En);if(s.length>1||Ri(r,xn))throw new ln(sn,"More than one element or text in fragment");if(1===s.length&&!kn(e,i))throw new ln(sn,"Element in fragment can not be inserted before doctype")}if(En(t)&&!kn(e,i))throw new ln(sn,"Only one element can be added and only after doctype");if(wn(t)){function o(e){return wn(e)&&e!==i}if(Ri(n,o))throw new ln(sn,"Only one doctype is allowed");var a=Ri(n,En);if(i&&n.indexOf(a)<n.indexOf(i))throw new ln(sn,"Doctype can only be inserted before an element")}}function Pn(e,t,i,n){In(e,t,i),e.nodeType===yn.DOCUMENT_NODE&&(n||Ln)(e,t,i);var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===en){var s=t.firstChild;if(null==s)return t;var a=t.lastChild}else s=a=t;var o=i?i.previousSibling:e.lastChild;s.previousSibling=o,a.nextSibling=i,o?o.nextSibling=s:e.firstChild=s,null==i?e.lastChild=a:i.previousSibling=a;do{s.parentNode=e}while(s!==a&&(s=s.nextSibling));return An(e.ownerDocument||e,e),t.nodeType==en&&(t.firstChild=t.lastChild=null),t}function Dn(){this._nsMap={}}function Mn(){}function Nn(){}function Rn(){}function Bn(){}function Un(){}function qn(){}function jn(){}function Fn(){}function Hn(){}function Vn(){}function zn(){}function Xn(){}function Wn(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,s=n.namespaceURI;if(s&&null==r&&null==(r=n.lookupPrefix(s)))var a=[{namespace:s,prefix:null}];return Kn(this,i,e,t,a),i.join("")}function Gn(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===n&&r===Bi.XML||r===Bi.XMLNS)return!1;for(var s=i.length;s--;){var a=i[s];if(a.prefix===n)return a.namespace!==r}return!0}function Yn(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,vn),'"')}function Kn(e,t,i,n,r){if(r||(r=[]),n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case zi:var s=e.attributes,a=s.length,o=e.firstChild,l=e.tagName,u=l;if(!(i=Bi.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var d,c=0;c<s.length;c++)if("xmlns"===s.item(c).name){d=s.item(c).value;break}if(!d)for(var h=r.length-1;h>=0;h--){if(""===(p=r[h]).prefix&&p.namespace===e.namespaceURI){d=p.namespace;break}}if(d!==e.namespaceURI)for(h=r.length-1;h>=0;h--){var p;if((p=r[h]).namespace===e.namespaceURI){p.prefix&&(u=p.prefix+":"+l);break}}}t.push("<",u);for(var m=0;m<a;m++){"xmlns"==(g=s.item(m)).prefix?r.push({prefix:g.localName,namespace:g.value}):"xmlns"==g.nodeName&&r.push({prefix:"",namespace:g.value})}for(m=0;m<a;m++){var g,f,y;if(Gn(g=s.item(m),0,r))Yn(t,(f=g.prefix||"")?"xmlns:"+f:"xmlns",y=g.namespaceURI),r.push({prefix:f,namespace:y});Kn(g,t,i,n,r)}if(l===u&&Gn(e,0,r))Yn(t,(f=e.prefix||"")?"xmlns:"+f:"xmlns",y=e.namespaceURI),r.push({prefix:f,namespace:y});if(o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(">"),i&&/^script$/i.test(l))for(;o;)o.data?t.push(o.data):Kn(o,t,i,n,r.slice()),o=o.nextSibling;else for(;o;)Kn(o,t,i,n,r.slice()),o=o.nextSibling;t.push("</",u,">")}else t.push("/>");return;case Zi:case en:for(o=e.firstChild;o;)Kn(o,t,i,n,r.slice()),o=o.nextSibling;return;case Xi:return Yn(t,e.name,e.value);case Wi:return t.push(e.data.replace(/[<&>]/g,vn));case Gi:return t.push("<![CDATA[",e.data,"]]>");case Qi:return t.push("\x3c!--",e.data,"--\x3e");case $i:var v=e.publicId,b=e.systemId;if(t.push("<!DOCTYPE ",e.name),v)t.push(" PUBLIC ",v),b&&"."!=b&&t.push(" ",b),t.push(">");else if(b&&"."!=b)t.push(" SYSTEM ",b,">");else{var _=e.internalSubset;_&&t.push(" [",_,"]"),t.push(">")}return;case Ji:return t.push("<?",e.target," ",e.data,"?>");case Yi:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Jn(e,t,i){var n;switch(t.nodeType){case zi:(n=t.cloneNode(!1)).ownerDocument=e;case en:break;case Xi:i=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i)for(var r=t.firstChild;r;)n.appendChild(Jn(e,r,i)),r=r.nextSibling;return n}function Qn(e,t,i){var n=new t.constructor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=t[r];"object"!=typeof s&&s!=n[r]&&(n[r]=s)}switch(t.childNodes&&(n.childNodes=new un),n.ownerDocument=e,n.nodeType){case zi:var a=t.attributes,o=n.attributes=new hn,l=a.length;o._ownerElement=n;for(var u=0;u<l;u++)n.setAttributeNode(Qn(e,a.item(u),!0));break;case Xi:i=!0}if(i)for(var d=t.firstChild;d;)n.appendChild(Qn(e,d,i)),d=d.nextSibling;return n}function Zn(e,t,i){e[t]=i}nn.INVALID_STATE_ERR=(rn[11]="Invalid state",11),nn.SYNTAX_ERR=(rn[12]="Syntax error",12),nn.INVALID_MODIFICATION_ERR=(rn[13]="Invalid modification",13),nn.NAMESPACE_ERR=(rn[14]="Invalid namespace",14),nn.INVALID_ACCESS_ERR=(rn[15]="Invalid access",15),ln.prototype=Error.prototype,Fi(nn,ln),un.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)Kn(this[n],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},dn.prototype.item=function(e){return cn(this),this[e]||null},Hi(dn,un),hn.prototype={length:0,item:un.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new ln(on);var i=this.getNamedItem(e.nodeName);return mn(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new ln(on);return t=this.getNamedItemNS(e.namespaceURI,e.localName),mn(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return gn(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return gn(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},fn.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new _n;if(n.implementation=this,n.childNodes=new un,n.doctype=i||null,i&&n.appendChild(i),t){var r=n.createElementNS(e,t);n.appendChild(r)}return n},createDocumentType:function(e,t,i){var n=new qn;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},yn.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Pn(this,e,t)},replaceChild:function(e,t){Pn(this,e,t,On),t&&this.removeChild(t)},removeChild:function(e){return Sn(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return Qn(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==Wi&&e.nodeType==Wi?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n;t=t.nodeType==Xi?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==Xi?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},Fi(Vi,yn),Fi(Vi,yn.prototype),_n.prototype={nodeName:"#document",nodeType:Zi,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==en){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return Pn(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===zi&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Sn(this,e)},replaceChild:function(e,t){Pn(this,e,t,On),e.ownerDocument=this,t&&this.removeChild(t),En(e)&&(this.documentElement=e)},importNode:function(e,t){return Jn(this,e,t)},getElementById:function(e){var t=null;return bn(this.documentElement,(function(i){if(i.nodeType==zi&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=ji(e);return new dn(this,(function(i){var n=[];return t.length>0&&bn(i.documentElement,(function(r){if(r!==i&&r.nodeType===zi){var s=r.getAttribute("class");if(s){var a=e===s;if(!a){var o=ji(s);a=t.every((l=o,function(e){return l&&-1!==l.indexOf(e)}))}a&&n.push(r)}}var l})),n}))},createElement:function(e){var t=new Dn;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new un,(t.attributes=new hn)._ownerElement=t,t},createDocumentFragment:function(){var e=new Vn;return e.ownerDocument=this,e.childNodes=new un,e},createTextNode:function(e){var t=new Rn;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Bn;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Un;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new zn;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Mn;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Hn;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Dn,n=t.split(":"),r=i.attributes=new hn;return i.childNodes=new un,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new Mn,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},Hi(_n,yn),Dn.prototype={nodeType:zi,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===en?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,An(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new dn(this,(function(t){var i=[];return bn(t,(function(n){n===t||n.nodeType!=zi||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new dn(this,(function(i){var n=[];return bn(i,(function(r){r===i||r.nodeType!==zi||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},_n.prototype.getElementsByTagName=Dn.prototype.getElementsByTagName,_n.prototype.getElementsByTagNameNS=Dn.prototype.getElementsByTagNameNS,Hi(Dn,yn),Mn.prototype.nodeType=Xi,Hi(Mn,yn),Nn.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(rn[sn])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},Hi(Nn,yn),Rn.prototype={nodeName:"#text",nodeType:Wi,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},Hi(Rn,Nn),Bn.prototype={nodeName:"#comment",nodeType:Qi},Hi(Bn,Nn),Un.prototype={nodeName:"#cdata-section",nodeType:Gi},Hi(Un,Nn),qn.prototype.nodeType=$i,Hi(qn,yn),jn.prototype.nodeType=tn,Hi(jn,yn),Fn.prototype.nodeType=Ki,Hi(Fn,yn),Hn.prototype.nodeType=Yi,Hi(Hn,yn),Vn.prototype.nodeName="#document-fragment",Vn.prototype.nodeType=en,Hi(Vn,yn),zn.prototype.nodeType=Ji,Hi(zn,yn),Xn.prototype.serializeToString=function(e,t,i){return Wn.call(e,t,i)},yn.prototype.toString=Wn;try{if(Object.defineProperty){function Af(e){switch(e.nodeType){case zi:case en:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(Af(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(dn.prototype,"length",{get:function(){return cn(this),this.$$length}}),Object.defineProperty(yn.prototype,"textContent",{get:function(){return Af(this)},set:function(e){switch(this.nodeType){case zi:case en:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Zn=function(e,t,i){e["$$"+t]=i}}}catch(Sf){}Li.DocumentType=qn,Li.DOMException=ln,Li.DOMImplementation=fn,Li.Element=Dn,Li.Node=yn,Li.NodeList=un,Li.XMLSerializer=Xn;var $n={},er={};!function(e){var t=Oi.freeze;e.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),e.entityMap=e.HTML_ENTITIES}(er);var tr={},ir=Oi.NAMESPACE,nr=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,rr=new RegExp("[\\-\\.0-9"+nr.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),sr=new RegExp("^"+nr.source+rr.source+"*(?::"+nr.source+rr.source+"*)?$"),ar=0,or=1,lr=2,ur=3,dr=4,cr=5,hr=6,pr=7;function mr(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,mr)}function gr(){}function fr(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function yr(e,t,i,n,r,s){function a(e,t,n){i.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),n)}for(var o,l=++t,u=ar;;){var d=e.charAt(l);switch(d){case"=":if(u===or)o=e.slice(t,l),u=ur;else{if(u!==lr)throw new Error("attribute equal must after attrName");u=ur}break;case"'":case'"':if(u===ur||u===or){if(u===or&&(s.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,!((l=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");a(o,c=e.slice(t,l),t-1),u=cr}else{if(u!=dr)throw new Error('attribute value must after "="');a(o,c=e.slice(t,l),t),s.warning('attribute "'+o+'" missed start quot('+d+")!!"),t=l+1,u=cr}break;case"/":switch(u){case ar:i.setTagName(e.slice(t,l));case cr:case hr:case pr:u=pr,i.closed=!0;case dr:case or:break;case lr:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),u==ar&&i.setTagName(e.slice(t,l)),l;case">":switch(u){case ar:i.setTagName(e.slice(t,l));case cr:case hr:case pr:break;case dr:case or:"/"===(c=e.slice(t,l)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case lr:u===lr&&(c=o),u==dr?(s.warning('attribute "'+c+'" missed quot(")!'),a(o,c,t)):(ir.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,t));break;case ur:throw new Error("attribute value missed!!")}return l;case"€":d=" ";default:if(d<=" ")switch(u){case ar:i.setTagName(e.slice(t,l)),u=hr;break;case or:o=e.slice(t,l),u=lr;break;case dr:var c=e.slice(t,l);s.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,t);case cr:u=hr}else switch(u){case lr:i.tagName,ir.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=l,u=or;break;case cr:s.warning('attribute space is required"'+o+'"!!');case hr:u=or,t=l;break;case ur:u=dr,t=l;break;case pr:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function vr(e,t,i){for(var n=e.tagName,r=null,s=e.length;s--;){var a=e[s],o=a.qName,l=a.value;if((h=o.indexOf(":"))>0)var u=a.prefix=o.slice(0,h),d=o.slice(h+1),c="xmlns"===u&&d;else d=o,u=null,c="xmlns"===o&&"";a.localName=d,!1!==c&&(null==r&&(r={},Tr(i,i={})),i[c]=r[c]=l,a.uri=ir.XMLNS,t.startPrefixMapping(c,l))}for(s=e.length;s--;){(u=(a=e[s]).prefix)&&("xml"===u&&(a.uri=ir.XML),"xmlns"!==u&&(a.uri=i[u||""]))}var h;(h=n.indexOf(":"))>0?(u=e.prefix=n.slice(0,h),d=e.localName=n.slice(h+1)):(u=null,d=e.localName=n);var p=e.uri=i[u||""];if(t.startElement(p,d,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(p,d,n),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&t.endPrefixMapping(u)}function br(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("</"+i+">",t),a=e.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(i)?(r.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,n),r.characters(a,0,a.length),s)}return t+1}function _r(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}function Tr(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function Ar(e,t,i,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(r=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var s=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var o=s[1][0],l=!1,u=!1;a>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],u=a>4&&s[4][0]):/^system$/i.test(s[2][0])&&(u=s[3][0]));var d=s[a-1];return i.startDTD(o,l,u),i.endDTD(),d.index+d[0].length}return-1}function Sr(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,i.processingInstruction(r[1],r[2]),n+2):-1}return-1}function wr(){this.attributeNames={}}mr.prototype=new Error,mr.prototype.name=mr.name,gr.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),Tr(t,t={}),function(e,t,i,n,r){function s(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?s(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function o(t){if(t>g){var i=e.substring(g,t).replace(/&#?\w+;/g,a);h&&l(g),n.characters(i,0,t-g),g=t}}function l(t,i){for(;t>=d&&(i=c.exec(e));)u=i.index,d=u+i[0].length,h.lineNumber++;h.columnNumber=t-u+1}var u=0,d=0,c=/.*(?:\r\n?|\n)|.*$/g,h=n.locator,p=[{currentNSMap:t}],m={},g=0;for(;;){try{var f=e.indexOf("<",g);if(f<0){if(!e.substr(g).match(/^\s*$/)){var y=n.doc,v=y.createTextNode(e.substr(g));y.appendChild(v),n.currentElement=v}return}switch(f>g&&o(f),e.charAt(f+1)){case"/":var b=e.indexOf(">",f+3),_=e.substring(f+2,b).replace(/[ \t\n\r]+$/g,""),T=p.pop();b<0?(_=e.substring(f+2).replace(/[\s<].*/,""),r.error("end tag name: "+_+" is not complete:"+T.tagName),b=f+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),r.error("end tag name: "+_+" maybe not complete"),b=f+1+_.length);var A=T.localNSMap,S=T.tagName==_;if(S||T.tagName&&T.tagName.toLowerCase()==_.toLowerCase()){if(n.endElement(T.uri,T.localName,_),A)for(var w in A)Object.prototype.hasOwnProperty.call(A,w)&&n.endPrefixMapping(w);S||r.fatalError("end tag name: "+_+" is not match the current start tagName:"+T.tagName)}else p.push(T);b++;break;case"?":h&&l(f),b=Sr(e,f,n);break;case"!":h&&l(f),b=Ar(e,f,n,r);break;default:h&&l(f);var E=new wr,x=p[p.length-1].currentNSMap,C=(b=yr(e,f,E,x,a,r),E.length);if(!E.closed&&_r(e,b,E.tagName,m)&&(E.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),h&&C){for(var k=fr(h,{}),I=0;I<C;I++){var L=E[I];l(L.offset),L.locator=fr(h,{})}n.locator=k,vr(E,n,x)&&p.push(E),n.locator=h}else vr(E,n,x)&&p.push(E);ir.isHTML(E.uri)&&!E.closed?b=br(e,b,E.tagName,a,n):b++}}catch(e){if(e instanceof mr)throw e;r.error("element parse error: "+e),b=-1}b>g?g=b:o(Math.max(f,g)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},wr.prototype={setTagName:function(e){if(!sr.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!sr.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},tr.XMLReader=gr,tr.ParseError=mr;var Er=Oi,xr=er,Cr=tr,kr=Li.DOMImplementation,Ir=Er.NAMESPACE,Lr=Cr.ParseError,Or=Cr.XMLReader;function Pr(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Dr(e){this.options=e||{locator:{}}}function Mr(){this.cdata=!1}function Nr(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Rr(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Br(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function Ur(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Dr.prototype.parseFromString=function(e,t){var i=this.options,n=new Or,r=i.domBuilder||new Mr,s=i.errorHandler,a=i.locator,o=i.xmlns||{},l=/\/x?html?$/.test(t),u=l?xr.HTML_ENTITIES:xr.XML_ENTITIES;a&&r.setDocumentLocator(a),n.errorHandler=function(e,t,i){if(!e){if(t instanceof Mr)return t;e=t}var n={},r=e instanceof Function;function s(t){var s=e[t];!s&&r&&(s=2==e.length?function(i){e(t,i)}:e),n[t]=s&&function(e){s("[xmldom "+t+"]\t"+e+Rr(i))}||function(){}}return i=i||{},s("warning"),s("error"),s("fatalError"),n}(s,r,a),n.domBuilder=i.domBuilder||r,l&&(o[""]=Ir.HTML),o.xml=o.xml||Ir.XML;var d=i.normalizeLineEndings||Pr;return e&&"string"==typeof e?n.parse(d(e),o,u):n.errorHandler.error("invalid doc source"),r.doc},Mr.prototype={startDocument:function(){this.doc=(new kr).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,s=r.createElementNS(e,i||t),a=n.length;Ur(this,s),this.currentElement=s,this.locator&&Nr(this.locator,s);for(var o=0;o<a;o++){e=n.getURI(o);var l=n.getValue(o),u=(i=n.getQName(o),r.createAttributeNS(e,i));this.locator&&Nr(n.getLocator(o),u),u.value=u.nodeValue=l,s.setAttributeNode(u)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&Nr(this.locator,i),Ur(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=Br.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Nr(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=Br.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Nr(this.locator,n),Ur(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var r=n.createDocumentType(e,t,i);this.locator&&Nr(this.locator,r),Ur(this,r),this.doc.doctype=r}},warning:function(e){console.warn("[xmldom warning]\t"+e,Rr(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,Rr(this.locator))},fatalError:function(e){throw new Lr(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){Mr.prototype[e]=function(){return null}})),$n.__DOMHandler=Mr,$n.normalizeLineEndings=Pr,$n.DOMParser=Dr;var qr=$n.DOMParser;
11
- /*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const jr=e=>!!e&&"object"==typeof e,Fr=(...e)=>e.reduce(((e,t)=>("object"!=typeof t||Object.keys(t).forEach((i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):jr(e[i])&&jr(t[i])?e[i]=Fr(e[i],t[i]):e[i]=t[i]})),e)),{}),Hr=e=>Object.keys(e).map((t=>e[t])),Vr=e=>e.reduce(((e,t)=>e.concat(t)),[]),zr=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var Xr="INVALID_NUMBER_OF_PERIOD",Wr="DASH_EMPTY_MANIFEST",Gr="DASH_INVALID_XML",Yr="NO_BASE_URL",Kr="SEGMENT_TIME_UNSPECIFIED",Jr="UNSUPPORTED_UTC_TIMING_SCHEME";const Qr=({baseUrl:e="",source:t="",range:i="",indexRange:n=""})=>{const r={uri:t,resolvedUri:Kt(e||"",t)};if(i||n){const e=(i||n).split("-");let t,s=Ne.BigInt?Ne.BigInt(e[0]):parseInt(e[0],10),a=Ne.BigInt?Ne.BigInt(e[1]):parseInt(e[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),t="bigint"==typeof a||"bigint"==typeof s?Ne.BigInt(a)-Ne.BigInt(s)+Ne.BigInt(1):a-s+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),r.byterange={length:t,offset:s}}return r},Zr=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),$r={static(e){const{duration:t,timescale:i=1,sourceDuration:n,periodDuration:r}=e,s=Zr(e.endNumber),a=t/i;return"number"==typeof s?{start:0,end:s}:"number"==typeof r?{start:0,end:r/a}:{start:0,end:n/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,u=Zr(e.endNumber),d=(t+i)/1e3,c=n+a,h=d+o-c,p=Math.ceil(h*r/s),m=Math.floor((d-c-l)*r/s),g=Math.floor((d-c)*r/s);return{start:Math.max(0,m),end:"number"==typeof u?u:Math.min(p,g)}}},es=e=>{const{type:t,duration:i,timescale:n=1,periodDuration:r,sourceDuration:s}=e,{start:a,end:o}=$r[t](e),l=((e,t)=>{const i=[];for(let n=e;n<t;n++)i.push(n);return i})(a,o).map((e=>t=>{const{duration:i,timescale:n=1,periodStart:r,startNumber:s=1}=e;return{number:s+t,duration:i/n,timeline:r,time:t*i}})(e));if("static"===t){const e=l.length-1,t="number"==typeof r?r:s;l[e].duration=t-i/n*e}return l},ts=e=>{const{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw new Error(Yr);const u=Qr({baseUrl:t,source:i.sourceURL,range:i.range}),d=Qr({baseUrl:t,source:t,indexRange:r});if(d.map=u,l){const t=es(e);t.length&&(d.duration=t[0].duration,d.timeline=t[0].timeline)}else n&&(d.duration=n,d.timeline=s);return d.presentationTime=a||s,d.number=o,[d]},is=(e,t,i)=>{const n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,s=e.timeline||0,a=e.sidx.byterange,o=a.offset+a.length,l=t.timescale,u=t.references.filter((e=>1!==e.referenceType)),d=[],c=e.endList?"static":"dynamic",h=e.sidx.timeline;let p,m=h,g=e.mediaSequence||0;p="bigint"==typeof t.firstOffset?Ne.BigInt(o)+t.firstOffset:o+t.firstOffset;for(let e=0;e<u.length;e++){const a=t.references[e],o=a.referencedSize,u=a.subsegmentDuration;let f;f="bigint"==typeof p?p+Ne.BigInt(o)-Ne.BigInt(1):p+o-1;const y=ts({baseUrl:i,timescale:l,timeline:s,periodStart:h,presentationTime:m,number:g,duration:u,sourceDuration:r,indexRange:`${p}-${f}`,type:c})[0];n&&(y.map=n),d.push(y),p+="bigint"==typeof p?Ne.BigInt(o):o,m+=u/l,g++}return e.segments=d,e},ns=["AUDIO","SUBTITLES"],rs=1/60,ss=e=>{return(t=e,i=({timeline:e})=>e,Hr(t.reduce(((e,t)=>(t.forEach((t=>{e[i(t)]=t})),e)),{}))).sort(((e,t)=>e.timeline>t.timeline?1:-1));var t,i},as=e=>{let t=[];var i,n;return i=e,n=(e,i,n,r)=>{t=t.concat(e.playlists||[])},ns.forEach((function(e){for(var t in i.mediaGroups[e])for(var r in i.mediaGroups[e][t]){var s=i.mediaGroups[e][t][r];n(s,e,t,r)}})),t},os=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,i)=>{t.number=e.mediaSequence+i}))},ls=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(as(e)),n=t.playlists.concat(as(t));return t.timelineStarts=ss([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach((t=>{t.discontinuitySequence=i.findIndex((function({timeline:e}){return e===t.timeline}));const n=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!n)return;if(t.sidx)return;const r=t.segments[0],s=n.segments.findIndex((function(e){return Math.abs(e.presentationTime-r.presentationTime)<rs}));if(-1===s)return os({playlist:t,mediaSequence:n.mediaSequence+n.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!n.segments.length&&t.timeline>n.timeline||n.segments.length&&t.timeline>n.segments[n.segments.length-1].timeline)&&t.discontinuitySequence--);n.segments[s].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),os({playlist:t,mediaSequence:n.segments[s].number})}))})({oldPlaylists:i,newPlaylists:n,timelineStarts:t.timelineStarts}),t},us=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Ne.BigInt(e.offset)+Ne.BigInt(e.length)-Ne.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),ds=e=>{const t=e.reduce((function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e}),{});let i=[];return Object.values(t).forEach((e=>{const t=Hr(e.reduce(((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{}));i=i.concat(t)})),i.map((e=>{var t,i;return e.discontinuityStarts=(t=e.segments||[],i="discontinuity",t.reduce(((e,t,n)=>(t[i]&&e.push(n),e)),[])),e}))},cs=(e,t)=>{const i=us(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&is(e,n,e.sidx.resolvedUri),e},hs=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=cs(e[i],t);return e},ps=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>{const r={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(r.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(r.contentProtection=e.contentProtection),e.serviceLocation&&(r.attributes.serviceLocation=e.serviceLocation),i&&(r.sidx=i),r},ms=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,gs=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,fs=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,ys=e=>e?Object.keys(e).reduce(((t,i)=>{const n=e[i];return t.concat(n.playlists)}),[]):[],vs=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:n={},previousManifest:r,eventStream:s})=>{if(!e.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=e[0].attributes,d=ds(e.filter(ms)).map(ps),c=ds(e.filter(gs)),h=ds(e.filter(fs)),p=e.map((e=>e.attributes.captionServices)).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:hs(d,n)};u>=0&&(m.minimumUpdatePeriod=1e3*u),t&&(m.locations=t),i&&(m.contentSteering=i),"dynamic"===o&&(m.suggestedPresentationDelay=l),s&&s.length>0&&(m.eventStream=s);const g=0===m.playlists.length,f=c.length?((e,t={},i=!1)=>{let n;const r=e.reduce(((e,r)=>{const s=r.attributes.role&&r.attributes.role.value||"",a=r.attributes.lang||"";let o=r.attributes.label||"main";if(a&&!r.attributes.label){const e=s?` (${s})`:"";o=`${r.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===s,playlists:[],uri:""});const l=cs((({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(r,i),t);return e[o].playlists.push(l),void 0===n&&"main"===s&&(n=r,n.default=!0),e}),{});n||(r[Object.keys(r)[0]].default=!0);return r})(c,n,g):null,y=h.length?((e,t={})=>e.reduce(((e,i)=>{const n=i.attributes.label||i.attributes.lang||"text",r=i.attributes.lang||"und";return e[n]||(e[n]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(cs((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:r})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const s={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(s.CODECS=e.codecs);const a={attributes:s,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:n,discontinuitySequence:r,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e}),{}))(h,n):null,v=d.concat(ys(f),ys(y)),b=v.map((({timelineStarts:e})=>e));var _,T;return m.timelineStarts=ss(b),_=v,T=m.timelineStarts,_.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=T.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t}))})),f&&(m.mediaGroups.AUDIO.audio=f),y&&(m.mediaGroups.SUBTITLES.subs=y),p.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=p.reduce(((e,t)=>t?(t.forEach((t=>{const{channel:i,language:n}=t;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e),{})),r?ls({oldManifest:r,newManifest:m}):m},bs=(e,t,i)=>{const{NOW:n,clientOffset:r,availabilityStartTime:s,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,u=(n+r)/1e3+l-(s+o);return Math.ceil((u*a-t)/i)},_s=(e,t)=>{const{type:i,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[];let d=-1;for(let c=0;c<t.length;c++){const h=t[c],p=h.d,m=h.r||0,g=h.t||0;let f;if(d<0&&(d=g),g&&g>d&&(d=g),m<0){const o=c+1;f=o===t.length?"dynamic"===i&&n>0&&r.indexOf("$Number$")>0?bs(e,d,p):(s*a-d)/p:(t[o].t-d)/p}else f=m+1;const y=o+u.length+f;let v=o+u.length;for(;v<y;)u.push({number:v,duration:p/a,time:d,timeline:l}),d+=p,v++}return u},Ts=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,As=(e,t)=>e.replace(Ts,(e=>(t,i,n,r)=>{if("$$"===t)return"$";if(void 0===e[i])return t;const s=""+e[i];return"RepresentationID"===i?s:(r=n?parseInt(r,10):1,s.length>=r?s:`${new Array(r-s.length+1).join("0")}${s}`)})(t)),Ss=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=e,r=Qr({baseUrl:e.baseUrl,source:As(n.sourceURL,i),range:n.range}),s=((e,t)=>e.duration||t?e.duration?es(e):_s(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return s.map((t=>{i.Number=t.number,i.Time=t.time;const n=As(e.media||"",i),s=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/s;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:Kt(e.baseUrl||"",n),map:r,number:t.number,presentationTime:o}}))},ws=(e,t)=>{const{duration:i,segmentUrls:n=[],periodStart:r}=e;if(!i&&!t||i&&t)throw new Error(Kr);const s=n.map((t=>((e,t)=>{const{baseUrl:i,initialization:n={}}=e,r=Qr({baseUrl:i,source:n.sourceURL,range:n.range}),s=Qr({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=r,s})(e,t)));let a;i&&(a=es(e)),t&&(a=_s(e,t));return a.map(((t,i)=>{if(s[i]){const n=s[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=r+(t.time-o)/a,n}})).filter((e=>e))},Es=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=Ss,i=Fr(e,t.template)):t.base?(n=ts,i=Fr(e,t.base)):t.list&&(n=ws,i=Fr(e,t.list));const r={attributes:e};if(!n)return r;const s=n(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else s.length?i.duration=s.reduce(((e,t)=>Math.max(e,Math.ceil(t.duration))),0):i.duration=0;return r.attributes=i,r.segments=s,t.base&&i.indexRange&&(r.sidx=s[0],r.segments=[]),r},xs=(e,t)=>zr(e.childNodes).filter((({tagName:e})=>e===t)),Cs=e=>e.textContent.trim(),ks=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[i,n,r,s,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(n||0)+86400*parseFloat(r||0)+3600*parseFloat(s||0)+60*parseFloat(a||0)+parseFloat(o||0)},Is={mediaPresentationDuration:e=>ks(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>ks(e),suggestedPresentationDelay:e=>ks(e),type:e=>e,timeShiftBufferDepth:e=>ks(e),start:e=>ks(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce(((e,t)=>e/t))))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?ks(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Ls=e=>e&&e.attributes?zr(e.attributes).reduce(((e,t)=>{const i=Is[t.name]||Is.DEFAULT;return e[t.name]=i(t.value),e}),{}):{},Os={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Ps=(e,t)=>t.length?Vr(e.map((function(e){return t.map((function(t){const i=Cs(t),n=Kt(e.baseUrl,i),r=Fr(Ls(t),{baseUrl:n});return n!==i&&!r.serviceLocation&&e.serviceLocation&&(r.serviceLocation=e.serviceLocation),r}))}))):e,Ds=e=>{const t=xs(e,"SegmentTemplate")[0],i=xs(e,"SegmentList")[0],n=i&&xs(i,"SegmentURL").map((e=>Fr({tag:"SegmentURL"},Ls(e)))),r=xs(e,"SegmentBase")[0],s=i||t,a=s&&xs(s,"SegmentTimeline")[0],o=i||r||t,l=o&&xs(o,"Initialization")[0],u=t&&Ls(t);u&&l?u.initialization=l&&Ls(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const d={template:u,segmentTimeline:a&&xs(a,"S").map((e=>Ls(e))),list:i&&Fr(Ls(i),{segmentUrls:n,initialization:Ls(l)}),base:r&&Fr(Ls(r),{initialization:Ls(l)})};return Object.keys(d).forEach((e=>{d[e]||delete d[e]})),d},Ms=e=>Vr(xs(e.node,"EventStream").map((t=>{const i=Ls(t),n=i.schemeIdUri;return xs(t,"Event").map((t=>{const r=Ls(t),s=r.presentationTime||0,a=i.timescale||1,o=r.duration||0,l=s/a+e.attributes.start;return{schemeIdUri:n,value:i.value,id:r.id,start:l,end:l+o/a,messageData:Cs(t)||r.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}}))}))),Ns=(e,t,i)=>n=>{const r=Ls(n),s=Ps(t,xs(n,"BaseURL")),a=xs(n,"Role")[0],o={role:Ls(a)};let l=Fr(e,r,o);const u=xs(n,"Accessibility")[0],d=(e=>{if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.value.split(";")).map((e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}}));if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.value.split(";")).map((e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,n=""]=e.split("=");t.channel=i,t.language=e,n.split(",").forEach((e=>{const[i,n]=e.split(":");"lang"===i?t.language=n:"er"===i?t.easyReader=Number(n):"war"===i?t.aspectRatio=Number(n):"3D"===i&&(t["3D"]=Number(n))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}))})(Ls(u));d&&(l=Fr(l,{captionServices:d}));const c=xs(n,"Label")[0];if(c&&c.childNodes.length){const e=c.childNodes[0].nodeValue.trim();l=Fr(l,{label:e})}const h=xs(n,"ContentProtection").reduce(((e,t)=>{const i=Ls(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const n=Os[i.schemeIdUri];if(n){e[n]={attributes:i};const r=xs(t,"cenc:pssh")[0];if(r){const t=Cs(r);e[n].pssh=t&&Qt(t)}}return e}),{});Object.keys(h).length&&(l=Fr(l,{contentProtection:h}));const p=Ds(n),m=xs(n,"Representation"),g=Fr(i,p);return Vr(m.map(((e,t,i)=>n=>{const r=xs(n,"BaseURL"),s=Ps(t,r),a=Fr(e,Ls(n)),o=Ds(n);return s.map((e=>({segmentInfo:Fr(i,o),attributes:Fr(a,e)})))})(l,s,g)))},Rs=(e,t)=>(i,n)=>{const r=Ps(t,xs(i.node,"BaseURL")),s=Fr(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(s.periodDuration=i.attributes.duration);const a=xs(i.node,"AdaptationSet"),o=Ds(i.node);return Vr(a.map(Ns(s,r,o)))},Bs=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const i=Fr({serverURL:Cs(e[0])},Ls(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},Us=e=>{if(""===e)throw new Error(Wr);const t=new qr;let i,n;try{i=t.parseFromString(e,"application/xml"),n=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(Gr);return n},qs=(e,t={})=>{const i=((e,t={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:r=0,eventHandler:s=function(){}}=t,a=xs(e,"Period");if(!a.length)throw new Error(Xr);const o=xs(e,"Location"),l=Ls(e),u=Ps([{baseUrl:i}],xs(e,"BaseURL")),d=xs(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=n,l.clientOffset=r,o.length&&(l.locations=o.map(Cs));const c=[];return a.forEach(((e,t)=>{const i=Ls(e),n=c[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:l.type}),c.push({node:e,attributes:i})})),{locations:l.locations,contentSteeringInfo:Bs(d,s),representationInfo:Vr(c.map(Rs(l,u))),eventStream:Vr(c.map(Ms))}})(Us(e),t),n=i.representationInfo.map(Es);return vs({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})},js=e=>(e=>{const t=xs(e,"UTCTiming")[0];if(!t)return null;const i=Ls(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(Jr)}return i})(Us(e));var Fs=Math.pow(2,32),Hs=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*Fs+i.getUint32(4)},Vs=Oe((function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=Hs(e.subarray(n)),i.firstOffset=Hs(e.subarray(n+8)),n+=16),n+=2;var r=t.getUint16(n);for(n+=2;r>0;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i})),zs=Si([73,68,51]),Xs=function e(t,i){return void 0===i&&(i=0),(t=Si(t)).length-i<10||!Ii(t,zs,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=Si(e))[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?n+20:n+10}(t,i),e(t,i))},Ws=function(e){return"string"==typeof e?ki(e):e},Gs=function e(t,i,n){void 0===n&&(n=!1),i=function(e){return Array.isArray(e)?e.map((function(e){return Ws(e)})):[Ws(e)]}(i),t=Si(t);var r=[];if(!i.length)return r;for(var s=0;s<t.length;){var a=(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3])>>>0,o=t.subarray(s+4,s+8);if(0===a)break;var l=s+a;if(l>t.length){if(n)break;l=t.length}var u=t.subarray(s+8,l);Ii(o,i[0])&&(1===i.length?r.push(u):r.push.apply(r,e(u,i.slice(1),n))),s=l}return r},Ys={EBML:Si([26,69,223,163]),DocType:Si([66,130]),Segment:Si([24,83,128,103]),SegmentInfo:Si([21,73,169,102]),Tracks:Si([22,84,174,107]),Track:Si([174]),TrackNumber:Si([215]),DefaultDuration:Si([35,227,131]),TrackEntry:Si([174]),TrackType:Si([131]),FlagDefault:Si([136]),CodecID:Si([134]),CodecPrivate:Si([99,162]),VideoTrack:Si([224]),AudioTrack:Si([225]),Cluster:Si([31,67,182,117]),Timestamp:Si([231]),TimestampScale:Si([42,215,177]),BlockGroup:Si([160]),BlockDuration:Si([155]),Block:Si([161]),SimpleBlock:Si([163])},Ks=[128,64,32,16,8,4,2,1],Js=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;i<Ks.length&&!(e&Ks[i]);i++)t++;return t}(e[t]),s=e.subarray(t,t+r);return i&&((s=Array.prototype.slice.call(e,t,t+r))[0]^=Ks[r-1]),{length:r,value:xi(s,{signed:n}),bytes:s}},Qs=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?Ci(t):t},Zs=function e(t,i,n){if(n>=i.length)return i.length;var r=Js(i,n,!1);if(Ii(t.bytes,r.bytes))return n;var s=Js(i,n+r.length);return e(t,i,n+s.length+s.value+r.length)},$s=function e(t,i){i=function(e){return Array.isArray(e)?e.map((function(e){return Qs(e)})):[Qs(e)]}(i),t=Si(t);var n=[];if(!i.length)return n;for(var r=0;r<t.length;){var s=Js(t,r,!1),a=Js(t,r+s.length),o=r+s.length+a.length;127===a.value&&(a.value=Zs(s,t,o),a.value!==t.length&&(a.value-=o));var l=o+a.value>t.length?t.length:o+a.value,u=t.subarray(o,l);Ii(i[0],s.bytes)&&(1===i.length?n.push(u):n=n.concat(e(u,i.slice(1)))),r+=s.length+a.length+u.length}return n},ea=Si([0,0,0,1]),ta=Si([0,0,1]),ia=Si([0,0,3]),na=function(e){for(var t=[],i=1;i<e.length-2;)Ii(e.subarray(i,i+3),ia)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,r=new Uint8Array(n),s=0;for(i=0;i<n;s++,i++)s===t[0]&&(s++,t.shift()),r[i]=e[s];return r},ra=function(e,t,i,n){e=Si(e),i=[].concat(i);for(var r,s=0,a=0;s<e.length&&(a<n||r);){var o=void 0;if(Ii(e.subarray(s),ea)?o=4:Ii(e.subarray(s),ta)&&(o=3),o){if(a++,r)return na(e.subarray(r,s));var l=void 0;"h264"===t?l=31&e[s+o]:"h265"===t&&(l=e[s+o]>>1&63),-1!==i.indexOf(l)&&(r=s+o),s+=o+("h264"===t?1:2)}else s++}return e.subarray(0,0)},sa={webm:Si([119,101,98,109]),matroska:Si([109,97,116,114,111,115,107,97]),flac:Si([102,76,97,67]),ogg:Si([79,103,103,83]),ac3:Si([11,119]),riff:Si([82,73,70,70]),avi:Si([65,86,73]),wav:Si([87,65,86,69]),"3gp":Si([102,116,121,112,51,103]),mp4:Si([102,116,121,112]),fmp4:Si([115,116,121,112]),mov:Si([102,116,121,112,113,116]),moov:Si([109,111,111,118]),moof:Si([109,111,111,102])},aa={aac:function(e){var t=Xs(e);return Ii(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Xs(e);return Ii(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=$s(e,[Ys.EBML,Ys.DocType])[0];return Ii(t,sa.webm)},mkv:function(e){var t=$s(e,[Ys.EBML,Ys.DocType])[0];return Ii(t,sa.matroska)},mp4:function(e){return!aa["3gp"](e)&&!aa.mov(e)&&(!(!Ii(e,sa.mp4,{offset:4})&&!Ii(e,sa.fmp4,{offset:4}))||(!(!Ii(e,sa.moof,{offset:4})&&!Ii(e,sa.moov,{offset:4}))||void 0))},mov:function(e){return Ii(e,sa.mov,{offset:4})},"3gp":function(e){return Ii(e,sa["3gp"],{offset:4})},ac3:function(e){var t=Xs(e);return Ii(e,sa.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Xs(e);return Ii(e,sa.flac,{offset:t})},ogg:function(e){return Ii(e,sa.ogg)},avi:function(e){return Ii(e,sa.riff)&&Ii(e,sa.avi,{offset:8})},wav:function(e){return Ii(e,sa.riff)&&Ii(e,sa.wav,{offset:8})},h264:function(e){return function(e,t,i){return ra(e,"h264",t,i)}(e,7,3).length},h265:function(e){return function(e,t,i){return ra(e,"h265",t,i)}(e,[32,33],3).length}},oa=Object.keys(aa).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);oa.forEach((function(e){var t=aa[e];aa[e]=function(e){return t(Si(e))}}));var la,ua,da,ca,ha=aa,pa=function(e){e=Si(e);for(var t=0;t<oa.length;t++){var i=oa[t];if(ha[i](e))return i}return""},ma=9e4;var ga=ma,fa=(la=function(e){return e*ma},ua=function(e,t){return e*t},da=function(e){return e/ma},ca=function(e,t){return e/t},"8.19.1");
9
+ var nt=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();void 0===t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t};function rt(e,t,i){var n=e;return et(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=$e({},t,{uri:e}),n.callback=i,n}function st(e,t,i){return at(t=rt(e,t,i))}function at(e){if(void 0===e.callback)throw new Error("callback argument missing");if(e.requestType&&st.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},i=st.requestInterceptorsStorage.execute(e.requestType,t);e.uri=i.uri,e.headers=i.headers,e.body=i.body,e.metadata=i.metadata,e.retry=i.retry,e.timeout=i.timeout}var n=!1,r=function(t,i,r){n||(n=!0,e.callback(t,i,r))};function s(){var e=void 0;if(e=d.response?d.response:d.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(d),y)try{e=JSON.parse(e)}catch(e){}return e}function a(t){if(clearTimeout(c),clearTimeout(e.retryTimeout),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,u||!st.retryManager.getIsEnabled()||!e.retry||!e.retry.shouldRetry()){if(e.requestType&&st.responseInterceptorsStorage.getIsEnabled()){var i={headers:v.headers||{},body:v.body,responseUrl:d.responseURL,responseType:d.responseType},n=st.responseInterceptorsStorage.execute(e.requestType,i);v.body=n.body,v.headers=n.headers}return r(t,v)}e.retryTimeout=setTimeout((function(){e.retry.moveToNextAttempt(),e.xhr=d,at(e)}),e.retry.getCurrentFuzzedDelay())}function o(){if(!u){var t;clearTimeout(c),clearTimeout(e.retryTimeout),t=e.useXDR&&void 0===d.status?200:1223===d.status?204:d.status;var i=v,n=null;if(0!==t?(i={body:s(),statusCode:t,method:p,headers:{},url:h,rawRequest:d},d.getAllResponseHeaders&&(i.headers=nt(d.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),e.requestType&&st.responseInterceptorsStorage.getIsEnabled()){var a={headers:i.headers||{},body:i.body,responseUrl:d.responseURL,responseType:d.responseType},o=st.responseInterceptorsStorage.execute(e.requestType,a);i.body=o.body,i.headers=o.headers}return r(n,i,i.body)}}var l,u,d=e.xhr||null;d||(d=e.cors||e.useXDR?new st.XDomainRequest:new st.XMLHttpRequest);var c,h=d.url=e.uri||e.url,p=d.method=e.method||"GET",m=e.body||e.data,g=d.headers=e.headers||{},f=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:p,url:h,rawRequest:d};if("json"in e&&!1!==e.json&&(y=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),m=JSON.stringify(!0===e.json?m:e.json))),d.onreadystatechange=function(){4!==d.readyState||st.responseInterceptorsStorage.getIsEnabled()||setTimeout(o,0)},d.onload=o,d.onerror=a,d.onprogress=function(){},d.onabort=function(){u=!0,clearTimeout(e.retryTimeout)},d.ontimeout=a,d.open(p,h,!f,e.username,e.password),f||(d.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(c=setTimeout((function(){if(!u){u=!0,d.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",a(e)}}),e.timeout)),d.setRequestHeader)for(l in g)g.hasOwnProperty(l)&&d.setRequestHeader(l,g[l]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(d.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(d),d.send(m||null),d}Fe.exports=st,Fe.exports.default=st,st.XMLHttpRequest=Ze.XMLHttpRequest||function(){},st.XDomainRequest="withCredentials"in new st.XMLHttpRequest?st.XMLHttpRequest:Ze.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){st["delete"===e?"del":e]=function(t,i,n){return(i=rt(t,i,n)).method=e.toUpperCase(),at(i)}}));var ot=Le(Fe.exports),lt={exports:{}},ut=Be,dt=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function ct(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function ht(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function pt(){this.values=dt(null)}function mt(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"==typeof r[s]){var a=r[s].split(i);if(2===a.length)t(a[0].trim(),a[1].trim())}}function gt(e,t,i){var n=e;function r(){var t=ht(e);if(null===t)throw new ct(ct.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=r(),s(),"--\x3e"!==e.substr(0,3))throw new ct(ct.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),s(),t.endTime=r(),s(),function(e,t){var n=new pt;mt(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),a=s[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===s.length&&n.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),n.percent(e,s[0]),2===s.length&&n.alt("positionAlign",s[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}ct.prototype=dt(Error.prototype),ct.prototype.constructor=ct,ct.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},pt.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var ft=ut.createElement&&ut.createElement("textarea"),yt={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},vt={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},bt={v:"title",lang:"lang"},Tt={rt:"ruby"};function _t(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!Tt[t.localName]||Tt[t.localName]===e.localName}function r(t,i){var n=yt[t];if(!n)return null;var r=e.document.createElement(n),s=bt[t];return s&&i&&(r[s]=i.trim()),r}for(var s,a,o=e.document.createElement("div"),l=o,u=[];null!==(s=i());)if("<"!==s[0])l.appendChild(e.document.createTextNode((a=s,ft.innerHTML=a,a=ft.textContent,ft.textContent="",a)));else{if("/"===s[1]){u.length&&u[u.length-1]===s.substr(2).replace(">","")&&(u.pop(),l=l.parentNode);continue}var d,c=ht(s.substr(1,s.length-2));if(c){d=e.document.createProcessingInstruction("timestamp",c),l.appendChild(d);continue}var h=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h)continue;if(!(d=r(h[1],h[3])))continue;if(!n(l,d))continue;if(h[2]){var p=h[2].split(".");p.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(vt.hasOwnProperty(i)){var n=t?"background-color":"color",r=vt[i];d.style[n]=r}})),d.className=p.join(" ")}u.push(h[1]),l.appendChild(d),l=d}return o}var At=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function St(e){for(var t=0;t<At.length;t++){var i=At[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function wt(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var s=i.match(/^.*(\n|\r)/);return s?(e.length=0,s[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var s=0;s<i.length;s++)if(St(i.charCodeAt(s)))return"rtl";return"ltr"}function Et(){}function xt(e,t,i){Et.call(this),this.cue=t,this.cueDiv=_t(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:wt(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":case"line-left":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":case"line-right":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function Ct(e){var t,i,n,r;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function kt(e,t,i,n){var r=new Ct(t),s=t.cue,a=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(s),o=[];if(s.snapToLines){var l;switch(s.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var u=r.lineHeight,d=u*Math.round(a),c=i[l]+u,h=o[0];Math.abs(d)>c&&(d=d<0?-1:1,d*=Math.ceil(c/u)*u),a<0&&(d+=""===s.vertical?i.height:i.width,o=o.reverse()),r.move(h,d)}else{var p=r.lineHeight/i.height*100;switch(s.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],r=new Ct(t)}var m=function(e,t){for(var r,s=new Ct(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(r=new Ct(e),a=l),e=new Ct(s)}return r||s}(r,o);t.move(m.toCSSCompatValues(i))}function It(){}Et.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},Et.prototype.formatStyle=function(e,t){return 0===e?0:e+t},xt.prototype=dt(Et.prototype),xt.prototype.constructor=xt,Ct.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},Ct.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},Ct.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},Ct.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Ct.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},Ct.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Ct.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Ct.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},It.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},It.convertCueToDOMTree=function(e,t){return e&&t?_t(e,t):null};It.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],s=Ct.getSimpleBoxPosition(n),a={font:Math.round(.05*s.height*100)/100+"px sans-serif"};!function(){for(var i,o,l=0;l<t.length;l++)o=t[l],i=new xt(e,o,a),n.appendChild(i.div),kt(0,i,s,r),o.displayState=i.div,r.push(Ct.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},It.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},It.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof ct))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function n(e){e.match(/X-TIMESTAMP-MAP/)?mt(e,(function(e,i){if("X-TIMESTAMP-MAP"===e)!function(e){var i=new pt;mt(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",ht(t))}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)}),/=/):mt(e,(function(e,i){if("Region"===e)!function(e){var i=new pt;if(mt(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var r=new pt;if(r.percent("x",n[0]),r.percent("y",n[1]),!r.has("x")||!r.has("y"))break;i.set(e+"X",r.get("x")),i.set(e+"Y",r.get("y"));break;case"scroll":i.alt(e,t,["up"])}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}(i)}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var r;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var s=(r=i()).match(/^WEBVTT([ \t].*)?$/);if(!s||!s[0])throw new ct(ct.Errors.BadSignature);t.state="HEADER"}for(var a=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:r=i(),t.state){case"HEADER":/:/.test(r)?n(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(e){t.cue.align="middle"}if(t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":try{gt(r,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var o=-1!==r.indexOf("--\x3e");if(!r||o&&(a=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":r||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new ct(ct.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var Lt=It,Ot={"":1,lr:1,rl:1},Pt={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Dt(e){return"string"==typeof e&&(!!Pt[e.toLowerCase()]&&e.toLowerCase())}function Mt(e,t,i){this.hasBeenReset=!1;var n="",r=!1,s=e,a=t,o=i,l=null,u="",d=!0,c="auto",h="start",p="auto",m="auto",g=100,f="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");s=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");a=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(e){l=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&!!Ot[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");u=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");c=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){var t=Dt(e);t?(h=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return p},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=Dt(e);t?(m=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");g=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return f},set:function(e){var t=Dt(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");f=t,this.hasBeenReset=!0}}}),this.displayState=void 0}Mt.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Nt=Mt,Rt={"":!0,up:!0};function Bt(e){return"number"==typeof e&&e>=0&&e<=100}var Ut=function(){var e=100,t=3,i=0,n=100,r=0,s=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Bt(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!Bt(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!Bt(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!Bt(e))throw new Error("ViewportAnchorY must be between 0 and 100.");s=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!Bt(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return a},set:function(e){var t=function(e){return"string"==typeof e&&!!Rt[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):a=t}}})},Ft=De,jt=lt.exports={WebVTT:Lt,VTTCue:Nt,VTTRegion:Ut};Ft.vttjs=jt,Ft.WebVTT=jt.WebVTT;var qt=jt.VTTCue,Ht=jt.VTTRegion,Vt=Ft.VTTCue,Xt=Ft.VTTRegion;jt.shim=function(){Ft.VTTCue=qt,Ft.VTTRegion=Ht},jt.restore=function(){Ft.VTTCue=Vt,Ft.VTTRegion=Xt},Ft.VTTCue||jt.shim();var zt=Le(lt.exports);function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Wt.apply(this,arguments)}var Gt="https://example.com",Yt=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=Me.location&&Me.location.href||"");var i=/^\/\//.test(e),n=!Me.location&&!/\/\//i.test(e);e=new Me.URL(e,Me.location||Gt);var r=new URL(t,e);return n?r.href.slice(19):i?r.href.slice(r.protocol.length):r.href},Kt=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function Jt(e){for(var t,i=(t=e,Me.atob?Me.atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(i.length),r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return n}
10
+ /*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class Qt extends Kt{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const Zt=String.fromCharCode(9),$t=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},ei=function(e){const t={};if(!e)return t;const i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let n,r=i.length;for(;r--;)""!==i[r]&&(n=/([^=]*)=(.*)/.exec(i[r]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),t[n[0]]=n[1]);return t},ti=e=>{const t=e.split("x"),i={};return t[0]&&(i.width=parseInt(t[0],10)),t[1]&&(i.height=parseInt(t[1],10)),i};class ii extends Kt{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(0===(e=e.trim()).length)return;if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(((t,i)=>{const n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return i=Wt($t(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){const e=ei(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=$t(e.BYTERANGE))}this.trigger("data",i)}else{if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=ei(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=ti(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=ei(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=ei(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=ei(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=ei(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(Zt)),void this.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=ei(t[1]),["DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=$t(i.attributes.BYTERANGE)),void this.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=ei(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=ei(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=ei(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}})),void this.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=ei(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))})),void this.trigger("data",i);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=ei(t[1]),["ID","CLASS"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))})),["START-DATE","END-DATE"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))})),["DURATION","PLANNED-DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["END-ON-NEXT"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))}));const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in i.attributes){if(!e.test(t))continue;const n=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),r=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=n?i.attributes[t].toString(16):r?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"i-frames-only"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return i={type:"tag",tagType:"content-steering"},i.attributes=ei(t[1]),void this.trigger("data",i);if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"i-frame-playlist"},i.attributes=ei(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=ti(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),void this.trigger("data",i);if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e),t)return i={type:"tag",tagType:"define"},i.attributes=ei(t[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})}))}addParser({expression:e,customType:t,dataParser:i,segment:n}){"function"!=typeof i&&(i=e=>e),this.customParsers.push((r=>{if(e.exec(r))return this.trigger("data",{type:"custom",data:i(r),customType:t,segment:n}),!0}))}addTagMapper({expression:e,map:t}){this.tagMappers.push((i=>e.test(i)?t(i):i))}}const ni=function(e){const t={};return Object.keys(e).forEach((function(i){var n;t[(n=i,n.toLowerCase().replace(/-(\w)/g,(e=>e[1].toUpperCase())))]=e[i]})),t},ri=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:n}=e;if(!t)return;const r="#EXT-X-SERVER-CONTROL",s="holdBack",a="partHoldBack",o=i&&3*i,l=n&&2*n;i&&!t.hasOwnProperty(s)&&(t[s]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[s]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${t[s]}) to targetDuration * 3 (${o})`}),t[s]=o),n&&!t.hasOwnProperty(a)&&(t[a]=3*n,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),n&&t[a]<l&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class si extends Kt{constructor(e={}){super(),this.lineStream=new Qt,this.parseStream=new ii,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let n,r,s={},a=!1;const o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let u=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let d=0,c=0;const h={};this.on("end",(()=>{s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&r&&(s.key=r),s.timeline||"number"!=typeof u||(s.timeline=u),this.manifest.preloadSegment=s)})),this.parseStream.on("data",(function(e){let p,m;if(t.manifest.definitions)for(const i in t.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace(`{$${i}}`,t.manifest.definitions[i])),e.attributes)for(const n in e.attributes)"string"==typeof e.attributes[n]&&(e.attributes[n]=e.attributes[n].replace(`{$${i}}`,t.manifest.definitions[i]));({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=d)),"offset"in e&&(s.byterange=t,t.offset=e.offset),d=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(s.title=e.title),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Jt(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(r.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence"(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,u=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type"(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),r&&(n.key=r)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(s.attributes||(s.attributes={}),Wt(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},p=t[e.attributes["GROUP-ID"]],m={default:/yes/i.test(e.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(m.language=e.attributes.LANGUAGE),e.attributes.URI&&(m.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(m.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(m.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(m.forced=/yes/i.test(e.attributes.FORCED)),p[e.attributes.NAME]=m},discontinuity(){u+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject;const{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight(((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime)),this.lastProgramDateTime)},targetduration(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,ri.call(this,this.manifest))},start(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){s.cueOut=e.data},"cue-out-cont"(){s.cueOutCont=e.data},"cue-in"(){s.cueIn=e.data},skip(){this.manifest.skip=ni(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const t=this.manifest.segments.length,i=ni(e.attributes);s.parts=s.parts||[],s.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=c),c=i.byterange.offset+i.byterange.length);const n=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${n} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const t=this.manifest.serverControl=ni(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ri.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const t=this.manifest.segments.length,i=ni(e.attributes),n=i.type&&"PART"===i.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?c:0,n&&(c=i.byterange.offset+i.byterange.length)));const r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #${t}`,e.attributes,["TYPE","URI"]),i.type)for(let e=0;e<s.preloadHints.length-1;e++){const n=s.preloadHints[e];n.type&&(n.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${r} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`}))}},"rendition-report"(){const t=ni(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);const i=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];a&&n.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,e.attributes,n)},"part-inf"(){this.manifest.partInf=ni(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ri.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(ni(e.attributes));const t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);const i=this.manifest.dateRanges[t];i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),i.plannedDuration&&i.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const n=!!i.endOnNext;if(n&&!i.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),n&&(i.duration||i.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),i.duration&&i.endDate){const e=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(h[i.id]){for(const e in h[i.id])if(i[e]&&JSON.stringify(h[i.id][e])!==JSON.stringify(i[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex((e=>e.id===i.id));this.manifest.dateRanges[e]=Wt(this.manifest.dateRanges[e],i),h[i.id]=Wt(h[i.id],i),this.manifest.dateRanges.pop()}else h[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=ni(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const t=(e,t)=>{e in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`}):this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const i=this.params.get(e.attributes.QUERYPARAM);return i?void t(e.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void t(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:u}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}}[e.tagType]||o).call(t)},uri(){s.uri=e.uri,i.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),r&&(s.key=r),s.timeline=u,n&&(s.map=n),c=0,null!==this.lastProgramDateTime&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*s.duration),s={}},comment(){},custom(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(t)}))}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${n.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var ai,oi,li={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},ui=["video","audio","text"],di=["Video","Audio","Text"],ci=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})):e},hi=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),ui.forEach((function(n){var r=li[n].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=n;var s=e.substring(0,r[1].length),a=e.replace(s,"");i.push({type:s,details:a,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},pi=function(e){return void 0===e&&(e=""),li.audio.test(e.trim().toLowerCase())},mi=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map((function(e){return ci(e.trim())})),n="video";1===i.length&&pi(i[0])?n="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),li.text.test(t.trim().toLowerCase()))&&(n="application");var r="mp4";return i.every((function(e){return li.mp4.test(e)}))?r="mp4":i.every((function(e){return li.webm.test(e)}))?r="webm":i.every((function(e){return li.ogg.test(e)}))&&(r="ogg"),n+"/"+r+';codecs="'+e+'"'}},gi=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),Me.MediaSource&&Me.MediaSource.isTypeSupported&&Me.MediaSource.isTypeSupported(mi(e))||t&&Me.ManagedMediaSource&&Me.ManagedMediaSource.isTypeSupported&&Me.ManagedMediaSource.isTypeSupported(mi(e))||!1},fi=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<di.length;t++){if(li["muxer"+di[t]].test(e))return!0}return!1}))},yi="mp4a.40.2",vi=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,bi=/^application\/dash\+xml/i,Ti=function(e){return vi.test(e)?"hls":bi.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},_i=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Ai=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||_i(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Si=Me.BigInt||Number,wi=[Si("0x1"),Si("0x100"),Si("0x10000"),Si("0x1000000"),Si("0x100000000"),Si("0x10000000000"),Si("0x1000000000000"),Si("0x100000000000000"),Si("0x10000000000000000")];ai=new Uint16Array([65484]),255===(oi=new Uint8Array(ai.buffer,ai.byteOffset,ai.byteLength))[0]||oi[0];var Ei=function(e,t){var i=void 0===t?{}:t,n=i.signed,r=void 0!==n&&n,s=i.le,a=void 0!==s&&s;e=Ai(e);var o=a?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,i,n){var r=a?n:Math.abs(n+1-e.length);return t+Si(i)*wi[r]}),Si(0));if(r){var u=wi[e.length]/Si(2)-Si(1);(l=Si(l))>u&&(l-=u,l-=u,l-=Si(2))}return Number(l)},xi=function(e,t){var i={}.le,n=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0),e=Si(e);for(var r,s=(r=e,Math.ceil(function(e){return e.toString(2).length}(r)/8)),a=new Uint8Array(new ArrayBuffer(s)),o=0;o<s;o++){var l=n?o:Math.abs(o+1-a.length);a[l]=Number(e/wi[o]&Si(255)),e<0&&(a[l]=Math.abs(~a[l]),a[l]-=0===o?1:2)}return a},Ci=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i},ki=function(e,t,i){var n=void 0===i?{}:i,r=n.offset,s=void 0===r?0:r,a=n.mask,o=void 0===a?[]:a;e=Ai(e);var l=(t=Ai(t)).every?t.every:Array.prototype.every;return t.length&&e.length-s>=t.length&&l.call(t,(function(t,i){return t===(o[i]?o[i]&e[s+i]:e[s+i])}))},Ii={},Li={};function Oi(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var Pi=Oi({HTML:"text/html",isHTML:function(e){return e===Pi.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Di=Oi({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===Di.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Li.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Li.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(t.call(void 0,r,n,e))return r}},Li.freeze=Oi,Li.MIME_TYPE=Pi,Li.NAMESPACE=Di;var Mi=Li,Ni=Mi.find,Ri=Mi.NAMESPACE;function Bi(e){return""!==e}function Ui(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function Fi(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(Bi):[]}(e);return Object.keys(t.reduce(Ui,{}))}function ji(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function qi(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,ji(i,n=new n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var Hi={},Vi=Hi.ELEMENT_NODE=1,Xi=Hi.ATTRIBUTE_NODE=2,zi=Hi.TEXT_NODE=3,Wi=Hi.CDATA_SECTION_NODE=4,Gi=Hi.ENTITY_REFERENCE_NODE=5,Yi=Hi.ENTITY_NODE=6,Ki=Hi.PROCESSING_INSTRUCTION_NODE=7,Ji=Hi.COMMENT_NODE=8,Qi=Hi.DOCUMENT_NODE=9,Zi=Hi.DOCUMENT_TYPE_NODE=10,$i=Hi.DOCUMENT_FRAGMENT_NODE=11,en=Hi.NOTATION_NODE=12,tn={},nn={};tn.INDEX_SIZE_ERR=(nn[1]="Index size error",1),tn.DOMSTRING_SIZE_ERR=(nn[2]="DOMString size error",2);var rn=tn.HIERARCHY_REQUEST_ERR=(nn[3]="Hierarchy request error",3);tn.WRONG_DOCUMENT_ERR=(nn[4]="Wrong document",4),tn.INVALID_CHARACTER_ERR=(nn[5]="Invalid character",5),tn.NO_DATA_ALLOWED_ERR=(nn[6]="No data allowed",6),tn.NO_MODIFICATION_ALLOWED_ERR=(nn[7]="No modification allowed",7);var sn=tn.NOT_FOUND_ERR=(nn[8]="Not found",8);tn.NOT_SUPPORTED_ERR=(nn[9]="Not supported",9);var an=tn.INUSE_ATTRIBUTE_ERR=(nn[10]="Attribute in use",10);function on(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,nn[e]),this.message=nn[e],Error.captureStackTrace&&Error.captureStackTrace(this,on);return i.code=e,t&&(this.message=this.message+": "+t),i}function ln(){}function un(e,t){this._node=e,this._refresh=t,dn(this)}function dn(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(Qn(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var n=i.length;n in e;n++)Object.prototype.hasOwnProperty.call(e,n)&&delete e[n];ji(i,e),e._inc=t}}function cn(){}function hn(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function pn(e,t,i,n){if(n?t[hn(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&Tn(r,e,n),function(e,t,i){e&&e._inc++;var n=i.namespaceURI;n===Ri.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(r,e,i))}}function mn(e,t,i){var n=hn(t,i);if(!(n>=0))throw new on(sn,new Error(e.tagName+"@"+i));for(var r=t.length-1;n<r;)t[n]=t[++n];if(t.length=r,e){var s=e.ownerDocument;s&&(Tn(s,e,i),i.ownerElement=null)}}function gn(){}function fn(){}function yn(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function vn(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(vn(e,t))return!0}while(e=e.nextSibling)}function bn(){this.ownerDocument=this}function Tn(e,t,i,n){e&&e._inc++,i.namespaceURI===Ri.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function _n(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,s=0;r;)n[s++]=r,r=r.nextSibling;n.length=s,delete n[n.length]}}}function An(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,_n(e.ownerDocument,e),t}function Sn(e){return e&&e.nodeType===fn.DOCUMENT_TYPE_NODE}function wn(e){return e&&e.nodeType===fn.ELEMENT_NODE}function En(e){return e&&e.nodeType===fn.TEXT_NODE}function xn(e,t){var i=e.childNodes||[];if(Ni(i,wn)||Sn(t))return!1;var n=Ni(i,Sn);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function Cn(e,t){var i=e.childNodes||[];if(Ni(i,(function(e){return wn(e)&&e!==t})))return!1;var n=Ni(i,Sn);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function kn(e,t,i){if(!function(e){return e&&(e.nodeType===fn.DOCUMENT_NODE||e.nodeType===fn.DOCUMENT_FRAGMENT_NODE||e.nodeType===fn.ELEMENT_NODE)}(e))throw new on(rn,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new on(sn,"child not in parent");if(!function(e){return e&&(wn(e)||En(e)||Sn(e)||e.nodeType===fn.DOCUMENT_FRAGMENT_NODE||e.nodeType===fn.COMMENT_NODE||e.nodeType===fn.PROCESSING_INSTRUCTION_NODE)}(t)||Sn(t)&&e.nodeType!==fn.DOCUMENT_NODE)throw new on(rn,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function In(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===fn.DOCUMENT_FRAGMENT_NODE){var s=r.filter(wn);if(s.length>1||Ni(r,En))throw new on(rn,"More than one element or text in fragment");if(1===s.length&&!xn(e,i))throw new on(rn,"Element in fragment can not be inserted before doctype")}if(wn(t)&&!xn(e,i))throw new on(rn,"Only one element can be added and only after doctype");if(Sn(t)){if(Ni(n,Sn))throw new on(rn,"Only one doctype is allowed");var a=Ni(n,wn);if(i&&n.indexOf(a)<n.indexOf(i))throw new on(rn,"Doctype can only be inserted before an element");if(!i&&a)throw new on(rn,"Doctype can not be appended since element is present")}}function Ln(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===fn.DOCUMENT_FRAGMENT_NODE){var s=r.filter(wn);if(s.length>1||Ni(r,En))throw new on(rn,"More than one element or text in fragment");if(1===s.length&&!Cn(e,i))throw new on(rn,"Element in fragment can not be inserted before doctype")}if(wn(t)&&!Cn(e,i))throw new on(rn,"Only one element can be added and only after doctype");if(Sn(t)){function o(e){return Sn(e)&&e!==i}if(Ni(n,o))throw new on(rn,"Only one doctype is allowed");var a=Ni(n,wn);if(i&&n.indexOf(a)<n.indexOf(i))throw new on(rn,"Doctype can only be inserted before an element")}}function On(e,t,i,n){kn(e,t,i),e.nodeType===fn.DOCUMENT_NODE&&(n||In)(e,t,i);var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===$i){var s=t.firstChild;if(null==s)return t;var a=t.lastChild}else s=a=t;var o=i?i.previousSibling:e.lastChild;s.previousSibling=o,a.nextSibling=i,o?o.nextSibling=s:e.firstChild=s,null==i?e.lastChild=a:i.previousSibling=a;do{s.parentNode=e}while(s!==a&&(s=s.nextSibling));return _n(e.ownerDocument||e,e),t.nodeType==$i&&(t.firstChild=t.lastChild=null),t}function Pn(){this._nsMap={}}function Dn(){}function Mn(){}function Nn(){}function Rn(){}function Bn(){}function Un(){}function Fn(){}function jn(){}function qn(){}function Hn(){}function Vn(){}function Xn(){}function zn(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,s=n.namespaceURI;if(s&&null==r&&null==(r=n.lookupPrefix(s)))var a=[{namespace:s,prefix:null}];return Yn(this,i,e,t,a),i.join("")}function Wn(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===n&&r===Ri.XML||r===Ri.XMLNS)return!1;for(var s=i.length;s--;){var a=i[s];if(a.prefix===n)return a.namespace!==r}return!0}function Gn(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,yn),'"')}function Yn(e,t,i,n,r){if(r||(r=[]),n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case Vi:var s=e.attributes,a=s.length,o=e.firstChild,l=e.tagName,u=l;if(!(i=Ri.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var d,c=0;c<s.length;c++)if("xmlns"===s.item(c).name){d=s.item(c).value;break}if(!d)for(var h=r.length-1;h>=0;h--){if(""===(p=r[h]).prefix&&p.namespace===e.namespaceURI){d=p.namespace;break}}if(d!==e.namespaceURI)for(h=r.length-1;h>=0;h--){var p;if((p=r[h]).namespace===e.namespaceURI){p.prefix&&(u=p.prefix+":"+l);break}}}t.push("<",u);for(var m=0;m<a;m++){"xmlns"==(g=s.item(m)).prefix?r.push({prefix:g.localName,namespace:g.value}):"xmlns"==g.nodeName&&r.push({prefix:"",namespace:g.value})}for(m=0;m<a;m++){var g,f,y;if(Wn(g=s.item(m),0,r))Gn(t,(f=g.prefix||"")?"xmlns:"+f:"xmlns",y=g.namespaceURI),r.push({prefix:f,namespace:y});Yn(g,t,i,n,r)}if(l===u&&Wn(e,0,r))Gn(t,(f=e.prefix||"")?"xmlns:"+f:"xmlns",y=e.namespaceURI),r.push({prefix:f,namespace:y});if(o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(">"),i&&/^script$/i.test(l))for(;o;)o.data?t.push(o.data):Yn(o,t,i,n,r.slice()),o=o.nextSibling;else for(;o;)Yn(o,t,i,n,r.slice()),o=o.nextSibling;t.push("</",u,">")}else t.push("/>");return;case Qi:case $i:for(o=e.firstChild;o;)Yn(o,t,i,n,r.slice()),o=o.nextSibling;return;case Xi:return Gn(t,e.name,e.value);case zi:return t.push(e.data.replace(/[<&>]/g,yn));case Wi:return t.push("<![CDATA[",e.data,"]]>");case Ji:return t.push("\x3c!--",e.data,"--\x3e");case Zi:var v=e.publicId,b=e.systemId;if(t.push("<!DOCTYPE ",e.name),v)t.push(" PUBLIC ",v),b&&"."!=b&&t.push(" ",b),t.push(">");else if(b&&"."!=b)t.push(" SYSTEM ",b,">");else{var T=e.internalSubset;T&&t.push(" [",T,"]"),t.push(">")}return;case Ki:return t.push("<?",e.target," ",e.data,"?>");case Gi:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Kn(e,t,i){var n;switch(t.nodeType){case Vi:(n=t.cloneNode(!1)).ownerDocument=e;case $i:break;case Xi:i=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i)for(var r=t.firstChild;r;)n.appendChild(Kn(e,r,i)),r=r.nextSibling;return n}function Jn(e,t,i){var n=new t.constructor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=t[r];"object"!=typeof s&&s!=n[r]&&(n[r]=s)}switch(t.childNodes&&(n.childNodes=new ln),n.ownerDocument=e,n.nodeType){case Vi:var a=t.attributes,o=n.attributes=new cn,l=a.length;o._ownerElement=n;for(var u=0;u<l;u++)n.setAttributeNode(Jn(e,a.item(u),!0));break;case Xi:i=!0}if(i)for(var d=t.firstChild;d;)n.appendChild(Jn(e,d,i)),d=d.nextSibling;return n}function Qn(e,t,i){e[t]=i}tn.INVALID_STATE_ERR=(nn[11]="Invalid state",11),tn.SYNTAX_ERR=(nn[12]="Syntax error",12),tn.INVALID_MODIFICATION_ERR=(nn[13]="Invalid modification",13),tn.NAMESPACE_ERR=(nn[14]="Invalid namespace",14),tn.INVALID_ACCESS_ERR=(nn[15]="Invalid access",15),on.prototype=Error.prototype,ji(tn,on),ln.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)Yn(this[n],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},un.prototype.item=function(e){return dn(this),this[e]||null},qi(un,ln),cn.prototype={length:0,item:ln.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new on(an);var i=this.getNamedItem(e.nodeName);return pn(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new on(an);return t=this.getNamedItemNS(e.namespaceURI,e.localName),pn(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return mn(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return mn(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},gn.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new bn;if(n.implementation=this,n.childNodes=new ln,n.doctype=i||null,i&&n.appendChild(i),t){var r=n.createElementNS(e,t);n.appendChild(r)}return n},createDocumentType:function(e,t,i){var n=new Un;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},fn.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return On(this,e,t)},replaceChild:function(e,t){On(this,e,t,Ln),t&&this.removeChild(t)},removeChild:function(e){return An(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return Jn(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==zi&&e.nodeType==zi?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n;t=t.nodeType==Xi?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==Xi?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},ji(Hi,fn),ji(Hi,fn.prototype),bn.prototype={nodeName:"#document",nodeType:Qi,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==$i){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return On(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===Vi&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),An(this,e)},replaceChild:function(e,t){On(this,e,t,Ln),e.ownerDocument=this,t&&this.removeChild(t),wn(e)&&(this.documentElement=e)},importNode:function(e,t){return Kn(this,e,t)},getElementById:function(e){var t=null;return vn(this.documentElement,(function(i){if(i.nodeType==Vi&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=Fi(e);return new un(this,(function(i){var n=[];return t.length>0&&vn(i.documentElement,(function(r){if(r!==i&&r.nodeType===Vi){var s=r.getAttribute("class");if(s){var a=e===s;if(!a){var o=Fi(s);a=t.every((l=o,function(e){return l&&-1!==l.indexOf(e)}))}a&&n.push(r)}}var l})),n}))},createElement:function(e){var t=new Pn;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new ln,(t.attributes=new cn)._ownerElement=t,t},createDocumentFragment:function(){var e=new Hn;return e.ownerDocument=this,e.childNodes=new ln,e},createTextNode:function(e){var t=new Nn;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Rn;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Bn;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Vn;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Dn;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new qn;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Pn,n=t.split(":"),r=i.attributes=new cn;return i.childNodes=new ln,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new Dn,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},qi(bn,fn),Pn.prototype={nodeType:Vi,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===$i?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,_n(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new un(this,(function(t){var i=[];return vn(t,(function(n){n===t||n.nodeType!=Vi||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new un(this,(function(i){var n=[];return vn(i,(function(r){r===i||r.nodeType!==Vi||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},bn.prototype.getElementsByTagName=Pn.prototype.getElementsByTagName,bn.prototype.getElementsByTagNameNS=Pn.prototype.getElementsByTagNameNS,qi(Pn,fn),Dn.prototype.nodeType=Xi,qi(Dn,fn),Mn.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(nn[rn])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},qi(Mn,fn),Nn.prototype={nodeName:"#text",nodeType:zi,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},qi(Nn,Mn),Rn.prototype={nodeName:"#comment",nodeType:Ji},qi(Rn,Mn),Bn.prototype={nodeName:"#cdata-section",nodeType:Wi},qi(Bn,Mn),Un.prototype.nodeType=Zi,qi(Un,fn),Fn.prototype.nodeType=en,qi(Fn,fn),jn.prototype.nodeType=Yi,qi(jn,fn),qn.prototype.nodeType=Gi,qi(qn,fn),Hn.prototype.nodeName="#document-fragment",Hn.prototype.nodeType=$i,qi(Hn,fn),Vn.prototype.nodeType=Ki,qi(Vn,fn),Xn.prototype.serializeToString=function(e,t,i){return zn.call(e,t,i)},fn.prototype.toString=zn;try{if(Object.defineProperty){function Sf(e){switch(e.nodeType){case Vi:case $i:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(Sf(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(un.prototype,"length",{get:function(){return dn(this),this.$$length}}),Object.defineProperty(fn.prototype,"textContent",{get:function(){return Sf(this)},set:function(e){switch(this.nodeType){case Vi:case $i:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Qn=function(e,t,i){e["$$"+t]=i}}}catch(wf){}Ii.DocumentType=Un,Ii.DOMException=on,Ii.DOMImplementation=gn,Ii.Element=Pn,Ii.Node=fn,Ii.NodeList=ln,Ii.XMLSerializer=Xn;var Zn={},$n={};!function(e){var t=Li.freeze;e.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),e.entityMap=e.HTML_ENTITIES}($n);var er={},tr=Li.NAMESPACE,ir=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,nr=new RegExp("[\\-\\.0-9"+ir.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),rr=new RegExp("^"+ir.source+nr.source+"*(?::"+ir.source+nr.source+"*)?$"),sr=0,ar=1,or=2,lr=3,ur=4,dr=5,cr=6,hr=7;function pr(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,pr)}function mr(){}function gr(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function fr(e,t,i,n,r,s){function a(e,t,n){i.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),n)}for(var o,l=++t,u=sr;;){var d=e.charAt(l);switch(d){case"=":if(u===ar)o=e.slice(t,l),u=lr;else{if(u!==or)throw new Error("attribute equal must after attrName");u=lr}break;case"'":case'"':if(u===lr||u===ar){if(u===ar&&(s.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,!((l=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");a(o,c=e.slice(t,l),t-1),u=dr}else{if(u!=ur)throw new Error('attribute value must after "="');a(o,c=e.slice(t,l),t),s.warning('attribute "'+o+'" missed start quot('+d+")!!"),t=l+1,u=dr}break;case"/":switch(u){case sr:i.setTagName(e.slice(t,l));case dr:case cr:case hr:u=hr,i.closed=!0;case ur:case ar:break;case or:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),u==sr&&i.setTagName(e.slice(t,l)),l;case">":switch(u){case sr:i.setTagName(e.slice(t,l));case dr:case cr:case hr:break;case ur:case ar:"/"===(c=e.slice(t,l)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case or:u===or&&(c=o),u==ur?(s.warning('attribute "'+c+'" missed quot(")!'),a(o,c,t)):(tr.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,t));break;case lr:throw new Error("attribute value missed!!")}return l;case"€":d=" ";default:if(d<=" ")switch(u){case sr:i.setTagName(e.slice(t,l)),u=cr;break;case ar:o=e.slice(t,l),u=or;break;case ur:var c=e.slice(t,l);s.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,t);case dr:u=cr}else switch(u){case or:i.tagName,tr.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=l,u=ar;break;case dr:s.warning('attribute space is required"'+o+'"!!');case cr:u=ar,t=l;break;case lr:u=ur,t=l;break;case hr:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function yr(e,t,i){for(var n=e.tagName,r=null,s=e.length;s--;){var a=e[s],o=a.qName,l=a.value;if((h=o.indexOf(":"))>0)var u=a.prefix=o.slice(0,h),d=o.slice(h+1),c="xmlns"===u&&d;else d=o,u=null,c="xmlns"===o&&"";a.localName=d,!1!==c&&(null==r&&(r={},Tr(i,i={})),i[c]=r[c]=l,a.uri=tr.XMLNS,t.startPrefixMapping(c,l))}for(s=e.length;s--;){(u=(a=e[s]).prefix)&&("xml"===u&&(a.uri=tr.XML),"xmlns"!==u&&(a.uri=i[u||""]))}var h;(h=n.indexOf(":"))>0?(u=e.prefix=n.slice(0,h),d=e.localName=n.slice(h+1)):(u=null,d=e.localName=n);var p=e.uri=i[u||""];if(t.startElement(p,d,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(p,d,n),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&t.endPrefixMapping(u)}function vr(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("</"+i+">",t),a=e.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(i)?(r.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,n),r.characters(a,0,a.length),s)}return t+1}function br(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}function Tr(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function _r(e,t,i,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(r=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var s=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var o=s[1][0],l=!1,u=!1;a>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],u=a>4&&s[4][0]):/^system$/i.test(s[2][0])&&(u=s[3][0]));var d=s[a-1];return i.startDTD(o,l,u),i.endDTD(),d.index+d[0].length}return-1}function Ar(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,i.processingInstruction(r[1],r[2]),n+2):-1}return-1}function Sr(){this.attributeNames={}}pr.prototype=new Error,pr.prototype.name=pr.name,mr.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),Tr(t,t={}),function(e,t,i,n,r){function s(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?s(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function o(t){if(t>g){var i=e.substring(g,t).replace(/&#?\w+;/g,a);h&&l(g),n.characters(i,0,t-g),g=t}}function l(t,i){for(;t>=d&&(i=c.exec(e));)u=i.index,d=u+i[0].length,h.lineNumber++;h.columnNumber=t-u+1}var u=0,d=0,c=/.*(?:\r\n?|\n)|.*$/g,h=n.locator,p=[{currentNSMap:t}],m={},g=0;for(;;){try{var f=e.indexOf("<",g);if(f<0){if(!e.substr(g).match(/^\s*$/)){var y=n.doc,v=y.createTextNode(e.substr(g));y.appendChild(v),n.currentElement=v}return}switch(f>g&&o(f),e.charAt(f+1)){case"/":var b=e.indexOf(">",f+3),T=e.substring(f+2,b).replace(/[ \t\n\r]+$/g,""),_=p.pop();b<0?(T=e.substring(f+2).replace(/[\s<].*/,""),r.error("end tag name: "+T+" is not complete:"+_.tagName),b=f+1+T.length):T.match(/\s</)&&(T=T.replace(/[\s<].*/,""),r.error("end tag name: "+T+" maybe not complete"),b=f+1+T.length);var A=_.localNSMap,S=_.tagName==T;if(S||_.tagName&&_.tagName.toLowerCase()==T.toLowerCase()){if(n.endElement(_.uri,_.localName,T),A)for(var w in A)Object.prototype.hasOwnProperty.call(A,w)&&n.endPrefixMapping(w);S||r.fatalError("end tag name: "+T+" is not match the current start tagName:"+_.tagName)}else p.push(_);b++;break;case"?":h&&l(f),b=Ar(e,f,n);break;case"!":h&&l(f),b=_r(e,f,n,r);break;default:h&&l(f);var E=new Sr,x=p[p.length-1].currentNSMap,C=(b=fr(e,f,E,x,a,r),E.length);if(!E.closed&&br(e,b,E.tagName,m)&&(E.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),h&&C){for(var k=gr(h,{}),I=0;I<C;I++){var L=E[I];l(L.offset),L.locator=gr(h,{})}n.locator=k,yr(E,n,x)&&p.push(E),n.locator=h}else yr(E,n,x)&&p.push(E);tr.isHTML(E.uri)&&!E.closed?b=vr(e,b,E.tagName,a,n):b++}}catch(e){if(e instanceof pr)throw e;r.error("element parse error: "+e),b=-1}b>g?g=b:o(Math.max(f,g)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},Sr.prototype={setTagName:function(e){if(!rr.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!rr.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},er.XMLReader=mr,er.ParseError=pr;var wr=Li,Er=$n,xr=er,Cr=Ii.DOMImplementation,kr=wr.NAMESPACE,Ir=xr.ParseError,Lr=xr.XMLReader;function Or(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Pr(e){this.options=e||{locator:{}}}function Dr(){this.cdata=!1}function Mr(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Nr(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Rr(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function Br(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Pr.prototype.parseFromString=function(e,t){var i=this.options,n=new Lr,r=i.domBuilder||new Dr,s=i.errorHandler,a=i.locator,o=i.xmlns||{},l=/\/x?html?$/.test(t),u=l?Er.HTML_ENTITIES:Er.XML_ENTITIES;a&&r.setDocumentLocator(a),n.errorHandler=function(e,t,i){if(!e){if(t instanceof Dr)return t;e=t}var n={},r=e instanceof Function;function s(t){var s=e[t];!s&&r&&(s=2==e.length?function(i){e(t,i)}:e),n[t]=s&&function(e){s("[xmldom "+t+"]\t"+e+Nr(i))}||function(){}}return i=i||{},s("warning"),s("error"),s("fatalError"),n}(s,r,a),n.domBuilder=i.domBuilder||r,l&&(o[""]=kr.HTML),o.xml=o.xml||kr.XML;var d=i.normalizeLineEndings||Or;return e&&"string"==typeof e?n.parse(d(e),o,u):n.errorHandler.error("invalid doc source"),r.doc},Dr.prototype={startDocument:function(){this.doc=(new Cr).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,s=r.createElementNS(e,i||t),a=n.length;Br(this,s),this.currentElement=s,this.locator&&Mr(this.locator,s);for(var o=0;o<a;o++){e=n.getURI(o);var l=n.getValue(o),u=(i=n.getQName(o),r.createAttributeNS(e,i));this.locator&&Mr(n.getLocator(o),u),u.value=u.nodeValue=l,s.setAttributeNode(u)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&Mr(this.locator,i),Br(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=Rr.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Mr(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=Rr.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Mr(this.locator,n),Br(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var r=n.createDocumentType(e,t,i);this.locator&&Mr(this.locator,r),Br(this,r),this.doc.doctype=r}},warning:function(e){console.warn("[xmldom warning]\t"+e,Nr(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,Nr(this.locator))},fatalError:function(e){throw new Ir(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){Dr.prototype[e]=function(){return null}})),Zn.__DOMHandler=Dr,Zn.normalizeLineEndings=Or,Zn.DOMParser=Pr;var Ur=Zn.DOMParser;
11
+ /*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Fr=e=>!!e&&"object"==typeof e,jr=(...e)=>e.reduce(((e,t)=>("object"!=typeof t||Object.keys(t).forEach((i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Fr(e[i])&&Fr(t[i])?e[i]=jr(e[i],t[i]):e[i]=t[i]})),e)),{}),qr=e=>Object.keys(e).map((t=>e[t])),Hr=e=>e.reduce(((e,t)=>e.concat(t)),[]),Vr=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var Xr="INVALID_NUMBER_OF_PERIOD",zr="DASH_EMPTY_MANIFEST",Wr="DASH_INVALID_XML",Gr="NO_BASE_URL",Yr="SEGMENT_TIME_UNSPECIFIED",Kr="UNSUPPORTED_UTC_TIMING_SCHEME";const Jr=({baseUrl:e="",source:t="",range:i="",indexRange:n=""})=>{const r={uri:t,resolvedUri:Yt(e||"",t)};if(i||n){const e=(i||n).split("-");let t,s=Me.BigInt?Me.BigInt(e[0]):parseInt(e[0],10),a=Me.BigInt?Me.BigInt(e[1]):parseInt(e[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),t="bigint"==typeof a||"bigint"==typeof s?Me.BigInt(a)-Me.BigInt(s)+Me.BigInt(1):a-s+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),r.byterange={length:t,offset:s}}return r},Qr=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),Zr={static(e){const{duration:t,timescale:i=1,sourceDuration:n,periodDuration:r}=e,s=Qr(e.endNumber),a=t/i;return"number"==typeof s?{start:0,end:s}:"number"==typeof r?{start:0,end:r/a}:{start:0,end:n/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,u=Qr(e.endNumber),d=(t+i)/1e3,c=n+a,h=d+o-c,p=Math.ceil(h*r/s),m=Math.floor((d-c-l)*r/s),g=Math.floor((d-c)*r/s);return{start:Math.max(0,m),end:"number"==typeof u?u:Math.min(p,g)}}},$r=e=>{const{type:t,duration:i,timescale:n=1,periodDuration:r,sourceDuration:s}=e,{start:a,end:o}=Zr[t](e),l=((e,t)=>{const i=[];for(let n=e;n<t;n++)i.push(n);return i})(a,o).map((e=>t=>{const{duration:i,timescale:n=1,periodStart:r,startNumber:s=1}=e;return{number:s+t,duration:i/n,timeline:r,time:t*i}})(e));if("static"===t){const e=l.length-1,t="number"==typeof r?r:s;l[e].duration=t-i/n*e}return l},es=e=>{const{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw new Error(Gr);const u=Jr({baseUrl:t,source:i.sourceURL,range:i.range}),d=Jr({baseUrl:t,source:t,indexRange:r});if(d.map=u,l){const t=$r(e);t.length&&(d.duration=t[0].duration,d.timeline=t[0].timeline)}else n&&(d.duration=n,d.timeline=s);return d.presentationTime=a||s,d.number=o,[d]},ts=(e,t,i)=>{const n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,s=e.timeline||0,a=e.sidx.byterange,o=a.offset+a.length,l=t.timescale,u=t.references.filter((e=>1!==e.referenceType)),d=[],c=e.endList?"static":"dynamic",h=e.sidx.timeline;let p,m=h,g=e.mediaSequence||0;p="bigint"==typeof t.firstOffset?Me.BigInt(o)+t.firstOffset:o+t.firstOffset;for(let e=0;e<u.length;e++){const a=t.references[e],o=a.referencedSize,u=a.subsegmentDuration;let f;f="bigint"==typeof p?p+Me.BigInt(o)-Me.BigInt(1):p+o-1;const y=es({baseUrl:i,timescale:l,timeline:s,periodStart:h,presentationTime:m,number:g,duration:u,sourceDuration:r,indexRange:`${p}-${f}`,type:c})[0];n&&(y.map=n),d.push(y),p+="bigint"==typeof p?Me.BigInt(o):o,m+=u/l,g++}return e.segments=d,e},is=["AUDIO","SUBTITLES"],ns=1/60,rs=e=>{return(t=e,i=({timeline:e})=>e,qr(t.reduce(((e,t)=>(t.forEach((t=>{e[i(t)]=t})),e)),{}))).sort(((e,t)=>e.timeline>t.timeline?1:-1));var t,i},ss=e=>{let t=[];var i,n;return i=e,n=(e,i,n,r)=>{t=t.concat(e.playlists||[])},is.forEach((function(e){for(var t in i.mediaGroups[e])for(var r in i.mediaGroups[e][t]){var s=i.mediaGroups[e][t][r];n(s,e,t,r)}})),t},as=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,i)=>{t.number=e.mediaSequence+i}))},os=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(ss(e)),n=t.playlists.concat(ss(t));return t.timelineStarts=rs([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach((t=>{t.discontinuitySequence=i.findIndex((function({timeline:e}){return e===t.timeline}));const n=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!n)return;if(t.sidx)return;const r=t.segments[0],s=n.segments.findIndex((function(e){return Math.abs(e.presentationTime-r.presentationTime)<ns}));if(-1===s)return as({playlist:t,mediaSequence:n.mediaSequence+n.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!n.segments.length&&t.timeline>n.timeline||n.segments.length&&t.timeline>n.segments[n.segments.length-1].timeline)&&t.discontinuitySequence--);n.segments[s].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),as({playlist:t,mediaSequence:n.segments[s].number})}))})({oldPlaylists:i,newPlaylists:n,timelineStarts:t.timelineStarts}),t},ls=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Me.BigInt(e.offset)+Me.BigInt(e.length)-Me.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),us=e=>{const t=e.reduce((function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e}),{});let i=[];return Object.values(t).forEach((e=>{const t=qr(e.reduce(((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{}));i=i.concat(t)})),i.map((e=>{var t,i;return e.discontinuityStarts=(t=e.segments||[],i="discontinuity",t.reduce(((e,t,n)=>(t[i]&&e.push(n),e)),[])),e}))},ds=(e,t)=>{const i=ls(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&ts(e,n,e.sidx.resolvedUri),e},cs=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=ds(e[i],t);return e},hs=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>{const r={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(r.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(r.contentProtection=e.contentProtection),e.serviceLocation&&(r.attributes.serviceLocation=e.serviceLocation),i&&(r.sidx=i),r},ps=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,ms=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,gs=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,fs=e=>e?Object.keys(e).reduce(((t,i)=>{const n=e[i];return t.concat(n.playlists)}),[]):[],ys=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:n={},previousManifest:r,eventStream:s})=>{if(!e.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=e[0].attributes,d=us(e.filter(ps)).map(hs),c=us(e.filter(ms)),h=us(e.filter(gs)),p=e.map((e=>e.attributes.captionServices)).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:cs(d,n)};u>=0&&(m.minimumUpdatePeriod=1e3*u),t&&(m.locations=t),i&&(m.contentSteering=i),"dynamic"===o&&(m.suggestedPresentationDelay=l),s&&s.length>0&&(m.eventStream=s);const g=0===m.playlists.length,f=c.length?((e,t={},i=!1)=>{let n;const r=e.reduce(((e,r)=>{const s=r.attributes.role&&r.attributes.role.value||"",a=r.attributes.lang||"";let o=r.attributes.label||"main";if(a&&!r.attributes.label){const e=s?` (${s})`:"";o=`${r.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===s,playlists:[],uri:""});const l=ds((({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(r,i),t);return e[o].playlists.push(l),void 0===n&&"main"===s&&(n=r,n.default=!0),e}),{});n||(r[Object.keys(r)[0]].default=!0);return r})(c,n,g):null,y=h.length?((e,t={})=>e.reduce(((e,i)=>{const n=i.attributes.label||i.attributes.lang||"text",r=i.attributes.lang||"und";return e[n]||(e[n]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(ds((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:r})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const s={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(s.CODECS=e.codecs);const a={attributes:s,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:n,discontinuitySequence:r,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e}),{}))(h,n):null,v=d.concat(fs(f),fs(y)),b=v.map((({timelineStarts:e})=>e));var T,_;return m.timelineStarts=rs(b),T=v,_=m.timelineStarts,T.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=_.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t}))})),f&&(m.mediaGroups.AUDIO.audio=f),y&&(m.mediaGroups.SUBTITLES.subs=y),p.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=p.reduce(((e,t)=>t?(t.forEach((t=>{const{channel:i,language:n}=t;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e),{})),r?os({oldManifest:r,newManifest:m}):m},vs=(e,t,i)=>{const{NOW:n,clientOffset:r,availabilityStartTime:s,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,u=(n+r)/1e3+l-(s+o);return Math.ceil((u*a-t)/i)},bs=(e,t)=>{const{type:i,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[];let d=-1;for(let c=0;c<t.length;c++){const h=t[c],p=h.d,m=h.r||0,g=h.t||0;let f;if(d<0&&(d=g),g&&g>d&&(d=g),m<0){const o=c+1;f=o===t.length?"dynamic"===i&&n>0&&r.indexOf("$Number$")>0?vs(e,d,p):(s*a-d)/p:(t[o].t-d)/p}else f=m+1;const y=o+u.length+f;let v=o+u.length;for(;v<y;)u.push({number:v,duration:p/a,time:d,timeline:l}),d+=p,v++}return u},Ts=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,_s=(e,t)=>e.replace(Ts,(e=>(t,i,n,r)=>{if("$$"===t)return"$";if(void 0===e[i])return t;const s=""+e[i];return"RepresentationID"===i?s:(r=n?parseInt(r,10):1,s.length>=r?s:`${new Array(r-s.length+1).join("0")}${s}`)})(t)),As=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=e,r=Jr({baseUrl:e.baseUrl,source:_s(n.sourceURL,i),range:n.range}),s=((e,t)=>e.duration||t?e.duration?$r(e):bs(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return s.map((t=>{i.Number=t.number,i.Time=t.time;const n=_s(e.media||"",i),s=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/s;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:Yt(e.baseUrl||"",n),map:r,number:t.number,presentationTime:o}}))},Ss=(e,t)=>{const{duration:i,segmentUrls:n=[],periodStart:r}=e;if(!i&&!t||i&&t)throw new Error(Yr);const s=n.map((t=>((e,t)=>{const{baseUrl:i,initialization:n={}}=e,r=Jr({baseUrl:i,source:n.sourceURL,range:n.range}),s=Jr({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=r,s})(e,t)));let a;i&&(a=$r(e)),t&&(a=bs(e,t));return a.map(((t,i)=>{if(s[i]){const n=s[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=r+(t.time-o)/a,n}})).filter((e=>e))},ws=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=As,i=jr(e,t.template)):t.base?(n=es,i=jr(e,t.base)):t.list&&(n=Ss,i=jr(e,t.list));const r={attributes:e};if(!n)return r;const s=n(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else s.length?i.duration=s.reduce(((e,t)=>Math.max(e,Math.ceil(t.duration))),0):i.duration=0;return r.attributes=i,r.segments=s,t.base&&i.indexRange&&(r.sidx=s[0],r.segments=[]),r},Es=(e,t)=>Vr(e.childNodes).filter((({tagName:e})=>e===t)),xs=e=>e.textContent.trim(),Cs=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[i,n,r,s,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(n||0)+86400*parseFloat(r||0)+3600*parseFloat(s||0)+60*parseFloat(a||0)+parseFloat(o||0)},ks={mediaPresentationDuration:e=>Cs(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>Cs(e),suggestedPresentationDelay:e=>Cs(e),type:e=>e,timeShiftBufferDepth:e=>Cs(e),start:e=>Cs(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce(((e,t)=>e/t))))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?Cs(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Is=e=>e&&e.attributes?Vr(e.attributes).reduce(((e,t)=>{const i=ks[t.name]||ks.DEFAULT;return e[t.name]=i(t.value),e}),{}):{},Ls={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Os=(e,t)=>t.length?Hr(e.map((function(e){return t.map((function(t){const i=xs(t),n=Yt(e.baseUrl,i),r=jr(Is(t),{baseUrl:n});return n!==i&&!r.serviceLocation&&e.serviceLocation&&(r.serviceLocation=e.serviceLocation),r}))}))):e,Ps=e=>{const t=Es(e,"SegmentTemplate")[0],i=Es(e,"SegmentList")[0],n=i&&Es(i,"SegmentURL").map((e=>jr({tag:"SegmentURL"},Is(e)))),r=Es(e,"SegmentBase")[0],s=i||t,a=s&&Es(s,"SegmentTimeline")[0],o=i||r||t,l=o&&Es(o,"Initialization")[0],u=t&&Is(t);u&&l?u.initialization=l&&Is(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const d={template:u,segmentTimeline:a&&Es(a,"S").map((e=>Is(e))),list:i&&jr(Is(i),{segmentUrls:n,initialization:Is(l)}),base:r&&jr(Is(r),{initialization:Is(l)})};return Object.keys(d).forEach((e=>{d[e]||delete d[e]})),d},Ds=e=>Hr(Es(e.node,"EventStream").map((t=>{const i=Is(t),n=i.schemeIdUri;return Es(t,"Event").map((t=>{const r=Is(t),s=r.presentationTime||0,a=i.timescale||1,o=r.duration||0,l=s/a+e.attributes.start;return{schemeIdUri:n,value:i.value,id:r.id,start:l,end:l+o/a,messageData:xs(t)||r.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}}))}))),Ms=(e,t,i)=>n=>{const r=Is(n),s=Os(t,Es(n,"BaseURL")),a=Es(n,"Role")[0],o={role:Is(a)};let l=jr(e,r,o);const u=Es(n,"Accessibility")[0],d=(e=>{if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.value.split(";")).map((e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}}));if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.value.split(";")).map((e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,n=""]=e.split("=");t.channel=i,t.language=e,n.split(",").forEach((e=>{const[i,n]=e.split(":");"lang"===i?t.language=n:"er"===i?t.easyReader=Number(n):"war"===i?t.aspectRatio=Number(n):"3D"===i&&(t["3D"]=Number(n))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}))})(Is(u));d&&(l=jr(l,{captionServices:d}));const c=Es(n,"Label")[0];if(c&&c.childNodes.length){const e=c.childNodes[0].nodeValue.trim();l=jr(l,{label:e})}const h=Es(n,"ContentProtection").reduce(((e,t)=>{const i=Is(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const n=Ls[i.schemeIdUri];if(n){e[n]={attributes:i};const r=Es(t,"cenc:pssh")[0];if(r){const t=xs(r);e[n].pssh=t&&Jt(t)}}return e}),{});Object.keys(h).length&&(l=jr(l,{contentProtection:h}));const p=Ps(n),m=Es(n,"Representation"),g=jr(i,p);return Hr(m.map(((e,t,i)=>n=>{const r=Es(n,"BaseURL"),s=Os(t,r),a=jr(e,Is(n)),o=Ps(n);return s.map((e=>({segmentInfo:jr(i,o),attributes:jr(a,e)})))})(l,s,g)))},Ns=(e,t)=>(i,n)=>{const r=Os(t,Es(i.node,"BaseURL")),s=jr(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(s.periodDuration=i.attributes.duration);const a=Es(i.node,"AdaptationSet"),o=Ps(i.node);return Hr(a.map(Ms(s,r,o)))},Rs=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const i=jr({serverURL:xs(e[0])},Is(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},Bs=e=>{if(""===e)throw new Error(zr);const t=new Ur;let i,n;try{i=t.parseFromString(e,"application/xml"),n=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(Wr);return n},Us=(e,t={})=>{const i=((e,t={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:r=0,eventHandler:s=function(){}}=t,a=Es(e,"Period");if(!a.length)throw new Error(Xr);const o=Es(e,"Location"),l=Is(e),u=Os([{baseUrl:i}],Es(e,"BaseURL")),d=Es(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=n,l.clientOffset=r,o.length&&(l.locations=o.map(xs));const c=[];return a.forEach(((e,t)=>{const i=Is(e),n=c[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:l.type}),c.push({node:e,attributes:i})})),{locations:l.locations,contentSteeringInfo:Rs(d,s),representationInfo:Hr(c.map(Ns(l,u))),eventStream:Hr(c.map(Ds))}})(Bs(e),t),n=i.representationInfo.map(ws);return ys({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})},Fs=e=>(e=>{const t=Es(e,"UTCTiming")[0];if(!t)return null;const i=Is(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(Kr)}return i})(Bs(e));var js=Math.pow(2,32),qs=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*js+i.getUint32(4)},Hs=Le((function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=qs(e.subarray(n)),i.firstOffset=qs(e.subarray(n+8)),n+=16),n+=2;var r=t.getUint16(n);for(n+=2;r>0;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i})),Vs=Ai([73,68,51]),Xs=function e(t,i){return void 0===i&&(i=0),(t=Ai(t)).length-i<10||!ki(t,Vs,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=Ai(e))[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?n+20:n+10}(t,i),e(t,i))},zs=function(e){return"string"==typeof e?Ci(e):e},Ws=function e(t,i,n){void 0===n&&(n=!1),i=function(e){return Array.isArray(e)?e.map((function(e){return zs(e)})):[zs(e)]}(i),t=Ai(t);var r=[];if(!i.length)return r;for(var s=0;s<t.length;){var a=(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3])>>>0,o=t.subarray(s+4,s+8);if(0===a)break;var l=s+a;if(l>t.length){if(n)break;l=t.length}var u=t.subarray(s+8,l);ki(o,i[0])&&(1===i.length?r.push(u):r.push.apply(r,e(u,i.slice(1),n))),s=l}return r},Gs={EBML:Ai([26,69,223,163]),DocType:Ai([66,130]),Segment:Ai([24,83,128,103]),SegmentInfo:Ai([21,73,169,102]),Tracks:Ai([22,84,174,107]),Track:Ai([174]),TrackNumber:Ai([215]),DefaultDuration:Ai([35,227,131]),TrackEntry:Ai([174]),TrackType:Ai([131]),FlagDefault:Ai([136]),CodecID:Ai([134]),CodecPrivate:Ai([99,162]),VideoTrack:Ai([224]),AudioTrack:Ai([225]),Cluster:Ai([31,67,182,117]),Timestamp:Ai([231]),TimestampScale:Ai([42,215,177]),BlockGroup:Ai([160]),BlockDuration:Ai([155]),Block:Ai([161]),SimpleBlock:Ai([163])},Ys=[128,64,32,16,8,4,2,1],Ks=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;i<Ys.length&&!(e&Ys[i]);i++)t++;return t}(e[t]),s=e.subarray(t,t+r);return i&&((s=Array.prototype.slice.call(e,t,t+r))[0]^=Ys[r-1]),{length:r,value:Ei(s,{signed:n}),bytes:s}},Js=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?xi(t):t},Qs=function e(t,i,n){if(n>=i.length)return i.length;var r=Ks(i,n,!1);if(ki(t.bytes,r.bytes))return n;var s=Ks(i,n+r.length);return e(t,i,n+s.length+s.value+r.length)},Zs=function e(t,i){i=function(e){return Array.isArray(e)?e.map((function(e){return Js(e)})):[Js(e)]}(i),t=Ai(t);var n=[];if(!i.length)return n;for(var r=0;r<t.length;){var s=Ks(t,r,!1),a=Ks(t,r+s.length),o=r+s.length+a.length;127===a.value&&(a.value=Qs(s,t,o),a.value!==t.length&&(a.value-=o));var l=o+a.value>t.length?t.length:o+a.value,u=t.subarray(o,l);ki(i[0],s.bytes)&&(1===i.length?n.push(u):n=n.concat(e(u,i.slice(1)))),r+=s.length+a.length+u.length}return n},$s=Ai([0,0,0,1]),ea=Ai([0,0,1]),ta=Ai([0,0,3]),ia=function(e){for(var t=[],i=1;i<e.length-2;)ki(e.subarray(i,i+3),ta)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,r=new Uint8Array(n),s=0;for(i=0;i<n;s++,i++)s===t[0]&&(s++,t.shift()),r[i]=e[s];return r},na=function(e,t,i,n){e=Ai(e),i=[].concat(i);for(var r,s=0,a=0;s<e.length&&(a<n||r);){var o=void 0;if(ki(e.subarray(s),$s)?o=4:ki(e.subarray(s),ea)&&(o=3),o){if(a++,r)return ia(e.subarray(r,s));var l=void 0;"h264"===t?l=31&e[s+o]:"h265"===t&&(l=e[s+o]>>1&63),-1!==i.indexOf(l)&&(r=s+o),s+=o+("h264"===t?1:2)}else s++}return e.subarray(0,0)},ra={webm:Ai([119,101,98,109]),matroska:Ai([109,97,116,114,111,115,107,97]),flac:Ai([102,76,97,67]),ogg:Ai([79,103,103,83]),ac3:Ai([11,119]),riff:Ai([82,73,70,70]),avi:Ai([65,86,73]),wav:Ai([87,65,86,69]),"3gp":Ai([102,116,121,112,51,103]),mp4:Ai([102,116,121,112]),fmp4:Ai([115,116,121,112]),mov:Ai([102,116,121,112,113,116]),moov:Ai([109,111,111,118]),moof:Ai([109,111,111,102])},sa={aac:function(e){var t=Xs(e);return ki(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Xs(e);return ki(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Zs(e,[Gs.EBML,Gs.DocType])[0];return ki(t,ra.webm)},mkv:function(e){var t=Zs(e,[Gs.EBML,Gs.DocType])[0];return ki(t,ra.matroska)},mp4:function(e){return!sa["3gp"](e)&&!sa.mov(e)&&(!(!ki(e,ra.mp4,{offset:4})&&!ki(e,ra.fmp4,{offset:4}))||(!(!ki(e,ra.moof,{offset:4})&&!ki(e,ra.moov,{offset:4}))||void 0))},mov:function(e){return ki(e,ra.mov,{offset:4})},"3gp":function(e){return ki(e,ra["3gp"],{offset:4})},ac3:function(e){var t=Xs(e);return ki(e,ra.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Xs(e);return ki(e,ra.flac,{offset:t})},ogg:function(e){return ki(e,ra.ogg)},avi:function(e){return ki(e,ra.riff)&&ki(e,ra.avi,{offset:8})},wav:function(e){return ki(e,ra.riff)&&ki(e,ra.wav,{offset:8})},h264:function(e){return function(e,t,i){return na(e,"h264",t,i)}(e,7,3).length},h265:function(e){return function(e,t,i){return na(e,"h265",t,i)}(e,[32,33],3).length}},aa=Object.keys(sa).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);aa.forEach((function(e){var t=sa[e];sa[e]=function(e){return t(Ai(e))}}));var oa,la,ua,da,ca=sa,ha=function(e){e=Ai(e);for(var t=0;t<aa.length;t++){var i=aa[t];if(ca[i](e))return i}return""},pa=9e4;var ma=pa,ga=(oa=function(e){return e*pa},la=function(e,t){return e*t},ua=function(e){return e/pa},da=function(e,t){return e/t},"8.19.1");
12
12
  /**
13
13
  * @license
14
14
  * Video.js 8.19.1 <http://videojs.com/>
@@ -19,11 +19,11 @@ var rt=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){
19
19
  * Includes vtt.js <https://github.com/mozilla/vtt.js>
20
20
  * Available under Apache License Version 2.0
21
21
  * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
22
- */const ya={},va=function(e,t){return ya[e]=ya[e]||[],t&&(ya[e]=ya[e].concat(t)),ya[e]},ba=function(e,t){const i=va(e).indexOf(t);return!(i<=-1)&&(ya[e]=ya[e].slice(),ya[e].splice(i,1),!0)},_a={prefixed:!0},Ta=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Aa=Ta[0];let Sa;for(let wf=0;wf<Ta.length;wf++)if(Ta[wf][1]in qe){Sa=Ta[wf];break}if(Sa){for(let Ef=0;Ef<Sa.length;Ef++)_a[Aa[Ef]]=Sa[Ef];_a.prefixed=Sa[0]!==Aa[0]}let wa=[];const Ea=function e(t,i=":",n=""){let r,s="info";function a(...e){r("log",s,e)}return r=((e,t,i)=>(n,r,s)=>{const a=t.levels[r],o=new RegExp(`^(${a})$`);let l=e;if("log"!==n&&s.unshift(n.toUpperCase()+":"),i&&(l=`%c${e}`,s.unshift(i)),s.unshift(l+":"),wa){wa.push([].concat(s));const e=wa.length-1e3;wa.splice(0,e>0?e:0)}if(!Ne.console)return;let u=Ne.console[n];u||"debug"!==n||(u=Ne.console.info||Ne.console.log),u&&a&&o.test(n)&&u[Array.isArray(s)?"apply":"call"](Ne.console,s)})(t,a,n),a.createLogger=(r,s,a)=>{const o=void 0!==s?s:i;return e(`${t} ${o} ${r}`,o,void 0!==a?a:n)},a.createNewLogger=(t,i,n)=>e(t,i,n),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);s=e}return s},a.history=()=>wa?[].concat(wa):[],a.history.filter=e=>(wa||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),a.history.clear=()=>{wa&&(wa.length=0)},a.history.disable=()=>{null!==wa&&(wa.length=0,wa=null)},a.history.enable=()=>{null===wa&&(wa=[])},a.error=(...e)=>r("error",s,e),a.warn=(...e)=>r("warn",s,e),a.debug=(...e)=>r("debug",s,e),a}("VIDEOJS"),xa=Ea.createLogger,Ca=Object.prototype.toString,ka=function(e){return Oa(e)?Object.keys(e):[]};function Ia(e,t){ka(e).forEach((i=>t(e[i],i)))}function La(e,t,i=0){return ka(e).reduce(((i,n)=>t(i,e[n],n)),i)}function Oa(e){return!!e&&"object"==typeof e}function Pa(e){return Oa(e)&&"[object Object]"===Ca.call(e)&&e.constructor===Object}function Da(...e){const t={};return e.forEach((e=>{e&&Ia(e,((e,i)=>{Pa(e)?(Pa(t[i])||(t[i]={}),t[i]=Da(t[i],e)):t[i]=e}))})),t}function Ma(e={}){const t=[];for(const i in e)if(e.hasOwnProperty(i)){const n=e[i];t.push(n)}return t}function Na(e,t,i,n=!0){const r=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){const e=i();return r(e),e}};return n&&(s.set=r),Object.defineProperty(e,t,s)}var Ra=Object.freeze({__proto__:null,each:Ia,reduce:La,isObject:Oa,isPlain:Pa,merge:Da,values:Ma,defineLazyProperty:Na});let Ba,Ua=!1,qa=null,ja=!1,Fa=!1,Ha=!1,Va=!1,za=!1,Xa=null,Wa=null;const Ga=Boolean(Ne.cast&&Ne.cast.framework&&Ne.cast.framework.CastReceiverContext);let Ya=null,Ka=!1,Ja=!1,Qa=!1,Za=!1,$a=!1,eo=!1,to=!1;const io=Boolean(lo()&&("ontouchstart"in Ne||Ne.navigator.maxTouchPoints||Ne.DocumentTouch&&Ne.document instanceof Ne.DocumentTouch)),no=Ne.navigator&&Ne.navigator.userAgentData;if(no&&no.platform&&no.brands&&(ja="Android"===no.platform,Ha=Boolean(no.brands.find((e=>"Microsoft Edge"===e.brand))),Va=Boolean(no.brands.find((e=>"Chromium"===e.brand))),za=!Ha&&Va,Xa=Wa=(no.brands.find((e=>"Chromium"===e.brand))||{}).version||null,Ja="Windows"===no.platform),!Va){const xf=Ne.navigator&&Ne.navigator.userAgent||"";Ua=/iPod/i.test(xf),qa=function(){const e=xf.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),ja=/Android/i.test(xf),Ba=function(){const e=xf.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),Fa=/Firefox/i.test(xf),Ha=/Edg/i.test(xf),Va=/Chrome/i.test(xf)||/CriOS/i.test(xf),za=!Ha&&Va,Xa=Wa=function(){const e=xf.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ya=function(){const e=/MSIE\s(\d+)\.\d/.exec(xf);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(xf)&&/rv:11.0/.test(xf)&&(t=11),t}(),$a=/Tizen/i.test(xf),eo=/Web0S/i.test(xf),to=$a||eo,Ka=/Safari/i.test(xf)&&!za&&!ja&&!Ha&&!to,Ja=/Windows/i.test(xf),Qa=/iPad/i.test(xf)||Ka&&io&&!/iPhone/i.test(xf),Za=/iPhone/i.test(xf)&&!Qa}const ro=Za||Qa||Ua,so=(Ka||ro)&&!za;var ao=Object.freeze({__proto__:null,get IS_IPOD(){return Ua},get IOS_VERSION(){return qa},get IS_ANDROID(){return ja},get ANDROID_VERSION(){return Ba},get IS_FIREFOX(){return Fa},get IS_EDGE(){return Ha},get IS_CHROMIUM(){return Va},get IS_CHROME(){return za},get CHROMIUM_VERSION(){return Xa},get CHROME_VERSION(){return Wa},IS_CHROMECAST_RECEIVER:Ga,get IE_VERSION(){return Ya},get IS_SAFARI(){return Ka},get IS_WINDOWS(){return Ja},get IS_IPAD(){return Qa},get IS_IPHONE(){return Za},get IS_TIZEN(){return $a},get IS_WEBOS(){return eo},get IS_SMART_TV(){return to},TOUCH_ENABLED:io,IS_IOS:ro,IS_ANY_SAFARI:so});function oo(e){return"string"==typeof e&&Boolean(e.trim())}function lo(){return qe===Ne.document}function uo(e){return Oa(e)&&1===e.nodeType}function co(){try{return Ne.parent!==Ne.self}catch(e){return!0}}function ho(e){return function(t,i){if(!oo(t))return qe[e](null);oo(i)&&(i=qe.querySelector(i));const n=uo(i)?i:qe;return n[e]&&n[e](t)}}function po(e="div",t={},i={},n){const r=qe.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const i=t[e];"textContent"===e?mo(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&Do(r,n),r}function mo(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function go(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function fo(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function yo(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function vo(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(Ea.warn("removeClass was called with an element that doesn't exist"),null)}function bo(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,i))),e}function _o(e,t){Object.getOwnPropertyNames(t).forEach((function(i){const n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function To(e){const t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const n=e.attributes;for(let e=n.length-1;e>=0;e--){const r=n[e].name;let s=n[e].value;i.includes(r)&&(s=null!==s),t[r]=s}}return t}function Ao(e,t){return e.getAttribute(t)}function So(e,t,i){e.setAttribute(t,i)}function wo(e,t){e.removeAttribute(t)}function Eo(){qe.body.focus(),qe.onselectstart=function(){return!1}}function xo(){qe.onselectstart=function(){return!0}}function Co(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Uo(e,"height"))),i.width||(i.width=parseFloat(Uo(e,"width"))),i}}function ko(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let n=0,r=0;for(;e.offsetParent&&e!==qe[_a.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function Io(e,t){const i={x:0,y:0};if(ro){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Uo(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&Ne.WebKitCSSMatrix){const e=Ne.getComputedStyle(t.assignedSlot.parentElement).transform,n=new Ne.WebKitCSSMatrix(e);i.x+=n.m41,i.y+=n.m42}t=t.parentNode||t.host}}const n={},r=ko(t.target),s=ko(e),a=s.width,o=s.height;let l=t.offsetY-(s.top-r.top),u=t.offsetX-(s.left-r.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-s.left,l=t.changedTouches[0].pageY+s.top,ro&&(u-=i.x,l-=i.y)),n.y=1-Math.max(0,Math.min(1,l/o)),n.x=Math.max(0,Math.min(1,u/a)),n}function Lo(e){return Oa(e)&&3===e.nodeType}function Oo(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Po(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),uo(e)||Lo(e)?e:"string"==typeof e&&/\S/.test(e)?qe.createTextNode(e):void 0))).filter((e=>e))}function Do(e,t){return Po(t).forEach((t=>e.appendChild(t))),e}function Mo(e,t){return Do(Oo(e),t)}function No(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||("mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons)))}const Ro=ho("querySelector"),Bo=ho("querySelectorAll");function Uo(e,t){if(!e||!t)return"";if("function"==typeof Ne.getComputedStyle){let i;try{i=Ne.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function qo(e){[...qe.styleSheets].forEach((t=>{try{const i=[...t.cssRules].map((e=>e.cssText)).join(""),n=qe.createElement("style");n.textContent=i,e.document.head.appendChild(n)}catch(i){const n=qe.createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}}))}var jo=Object.freeze({__proto__:null,isReal:lo,isEl:uo,isInFrame:co,createEl:po,textContent:mo,prependTo:go,hasClass:fo,addClass:yo,removeClass:vo,toggleClass:bo,setAttributes:_o,getAttributes:To,getAttribute:Ao,setAttribute:So,removeAttribute:wo,blockTextSelection:Eo,unblockTextSelection:xo,getBoundingClientRect:Co,findPosition:ko,getPointerPosition:Io,isTextNode:Lo,emptyEl:Oo,normalizeContent:Po,appendContent:Do,insertContent:Mo,isSingleLeftClick:No,$:Ro,$$:Bo,computedStyle:Uo,copyStyleSheetsToWindow:qo});let Fo,Ho=!1;const Vo=function(){if(!1===Fo.options.autoSetup)return;const e=Array.prototype.slice.call(qe.getElementsByTagName("video")),t=Array.prototype.slice.call(qe.getElementsByTagName("audio")),i=Array.prototype.slice.call(qe.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(let e=0,t=n.length;e<t;e++){const t=n[e];if(!t||!t.getAttribute){zo(1);break}if(void 0===t.player){null!==t.getAttribute("data-setup")&&Fo(t)}}else Ho||zo(1)};function zo(e,t){lo()&&(t&&(Fo=t),Ne.setTimeout(Vo,e))}function Xo(){Ho=!0,Ne.removeEventListener("load",Xo)}lo()&&("complete"===qe.readyState?Xo():Ne.addEventListener("load",Xo));const Wo=function(e){const t=qe.createElement("style");return t.className=e,t},Go=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Yo=new WeakMap;let Ko,Jo=3;function Qo(){return Jo++}function Zo(e,t){if(!Yo.has(e))return;const i=Yo.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Yo.delete(e)}function $o(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function el(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const n=e||Ne.event;e={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const t in n)r.includes(t)||"returnValue"===t&&n.preventDefault||(e[t]=n[t]);if(e.target||(e.target=e.srcElement||qe),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=qe.documentElement,i=qe.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const tl=function(){if("boolean"!=typeof Ko){Ko=!1;try{const e=Object.defineProperty({},"passive",{get(){Ko=!0}});Ne.addEventListener("test",null,e),Ne.removeEventListener("test",null,e)}catch(e){}}return Ko},il=["touchstart","touchmove"];function nl(e,t,i){if(Array.isArray(t))return $o(nl,e,t,i);Yo.has(e)||Yo.set(e,{});const n=Yo.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=Qo()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(n.disabled)return;t=el(t);const r=n.handlers[t.type];if(r){const n=r.slice(0);for(let r=0,s=n.length;r<s&&!t.isImmediatePropagationStopped();r++)try{n[r].call(e,t,i)}catch(e){Ea.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){let i=!1;tl()&&il.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function rl(e,t,i){if(!Yo.has(e))return;const n=Yo.get(e);if(!n.handlers)return;if(Array.isArray(t))return $o(rl,e,t,i);const r=function(e,t){n.handlers[t]=[],Zo(e,t)};if(void 0===t){for(const t in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},t)&&r(e,t);return}const s=n.handlers[t];if(s)if(i){if(i.guid)for(let e=0;e<s.length;e++)s[e].guid===i.guid&&s.splice(e--,1);Zo(e,t)}else r(e,t)}function sl(e,t,i){const n=Yo.has(e)?Yo.get(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=el(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)sl.call(null,r,t,i);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){Yo.has(t.target)||Yo.set(t.target,{});const e=Yo.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function al(e,t,i){if(Array.isArray(t))return $o(al,e,t,i);const n=function(){rl(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Qo(),nl(e,t,n)}function ol(e,t,i){const n=function(){rl(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Qo(),nl(e,t,n)}var ll=Object.freeze({__proto__:null,fixEvent:el,on:nl,off:rl,trigger:sl,one:al,any:ol});const ul=30,dl=function(e,t,i){t.guid||(t.guid=Qo());const n=t.bind(e);return n.guid=i?i+"_"+t.guid:t.guid,n},cl=function(e,t){let i=Ne.performance.now();return function(...n){const r=Ne.performance.now();r-i>=t&&(e(...n),i=r)}},hl=function(e,t,i,n=Ne){let r;const s=function(){const s=this,a=arguments;let o=function(){r=null,o=null,i||e.apply(s,a)};!r&&i&&e.apply(s,a),n.clearTimeout(r),r=n.setTimeout(o,t)};return s.cancel=()=>{n.clearTimeout(r),r=null},s};var pl=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:ul,bind_:dl,throttle:cl,debounce:hl});let ml;class gl{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},nl(this,e,t),this.addEventListener=i}off(e,t){rl(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},al(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},ol(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=el(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),sl(this,e)}queueTrigger(e){ml||(ml=new Map);const t=e.type||e;let i=ml.get(this);i||(i=new Map,ml.set(this,i));const n=i.get(t);i.delete(t),Ne.clearTimeout(n);const r=Ne.setTimeout((()=>{i.delete(t),0===i.size&&(i=null,ml.delete(this)),this.trigger(e)}),0);i.set(t,r)}}gl.prototype.allowedEvents_={},gl.prototype.addEventListener=gl.prototype.on,gl.prototype.removeEventListener=gl.prototype.off,gl.prototype.dispatchEvent=gl.prototype.trigger;const fl=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,yl=e=>e instanceof gl||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),vl=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,bl=(e,t,i)=>{if(!e||!e.nodeName&&!yl(e))throw new Error(`Invalid target for ${fl(t)}#${i}; must be a DOM node or evented object.`)},_l=(e,t,i)=>{if(!vl(e))throw new Error(`Invalid event type for ${fl(t)}#${i}; must be a non-empty string or array.`)},Tl=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${fl(t)}#${i}; must be a function.`)},Al=(e,t,i)=>{const n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let r,s,a;return n?(r=e.eventBusEl_,t.length>=3&&t.shift(),[s,a]=t):(r=t[0],s=t[1],a=t[2]),bl(r,e,i),_l(s,e,i),Tl(a,e,i),a=dl(e,a),{isTargetingSelf:n,target:r,type:s,listener:a}},Sl=(e,t,i,n)=>{bl(e,e,t),e.nodeName?ll[t](e,i,n):e[t](i,n)},wl={on(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=Al(this,e,"on");if(Sl(i,"on",n,r),!t){const e=()=>this.off(i,n,r);e.guid=r.guid;const t=()=>this.off("dispose",e);t.guid=r.guid,Sl(this,"on","dispose",e),Sl(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=Al(this,e,"one");if(t)Sl(i,"one",n,r);else{const e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Sl(i,"one",n,e)}},any(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=Al(this,e,"any");if(t)Sl(i,"any",n,r);else{const e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Sl(i,"any",n,e)}},off(e,t,i){if(!e||vl(e))rl(this.eventBusEl_,e,t);else{const n=e,r=t;bl(n,this,"off"),_l(r,this,"off"),Tl(i,this,"off"),i=dl(this,i),this.off("dispose",i),n.nodeName?(rl(n,r,i),rl(n,"dispose",i)):yl(n)&&(n.off(r,i),n.off("dispose",i))}},trigger(e,t){bl(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!vl(i))throw new Error(`Invalid event type for ${fl(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return sl(this.eventBusEl_,e,t)}};function El(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=po("span",{className:"vjs-event-bus"});return Object.assign(e,wl),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Yo.has(e)&&Yo.delete(e)})),Ne.setTimeout((()=>{e.eventBusEl_=null}),0)})),e}const xl={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),Ia(e,((e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e})),t&&yl(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function Cl(e,t){return Object.assign(e,xl),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&yl(e)&&e.on("statechanged",e.handleStateChanged),e}const kl=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},Il=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},Ll=function(e,t){return Il(e)===Il(t)};var Ol=Object.freeze({__proto__:null,toLowerCase:kl,toTitleCase:Il,titleCaseEquals:Ll});class Pl{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Da({},this.options_),t=this.options_=Da(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Qo()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),["on","off","one","any","trigger"].forEach((e=>{this[e]=void 0})),!1!==t.evented&&(El(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Cl(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=Da(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return po(e,t,i)}localize(e,t,i=e){const n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a];let l=i;return s&&s[e]?l=s[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){const n=t[i-1];let r=n;return void 0===n&&(r=e),r}))),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",n=po("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),r=qe.createElementNS(i,"svg");r.setAttributeNS(null,"viewBox","0 0 512 512");const s=qe.createElementNS(i,"use");return r.appendChild(s),s.setAttributeNS(null,"href",`#vjs-icon-${e}`),n.appendChild(r),this.iconIsSet_?t.replaceChild(n,t.querySelector(".vjs-icon-placeholder")):t.appendChild(n),this.iconIsSet_=!0,n}addChild(e,t={},i=this.children_.length){let n,r;if("string"==typeof e){r=Il(e);const i=t.componentClass||r;t.name=r;const s=Pl.getComponent(i);if(!s)throw new Error(`Component ${i} does not exist`);if("function"!=typeof s)return null;n=new s(this.player_||this,t)}else n=e;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(i,0,n),n.parentComponent_=this,"function"==typeof n.id&&(this.childIndex_[n.id()]=n),r=r||n.name&&Il(n.name()),r&&(this.childNameIndex_[r]=n,this.childNameIndex_[kl(r)]=n),"function"==typeof n.el&&n.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:uo(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(n.el(),e)}return n}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Il(e.name())]=null,this.childNameIndex_[kl(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let n=e.opts;if(void 0!==t[i]&&(n=t[i]),!1===n)return;!0===n&&(n={}),n.playerOptions=this.options_.playerOptions;const r=this.addChild(i,n);r&&(this[i]=r)};let n;const r=Pl.getComponent("Tech");n=Array.isArray(e)?e:Object.keys(e),n.concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let i,n;return"string"==typeof t?(i=t,n=e[i]||this.options_[i]||{}):(i=t.name,n=t),{name:i,opts:n}})).filter((e=>{const t=Pl.getComponent(e.opts.componentClass||Il(e.name));return t&&!r.isTech(t)})).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return Ro(e,t||this.contentEl())}$$(e,t){return Bo(e,t||this.contentEl())}hasClass(e){return fo(this.el_,e)}addClass(...e){yo(this.el_,...e)}removeClass(...e){vo(this.el_,...e)}toggleClass(e,t){bo(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return Ao(this.el_,e)}setAttribute(e,t){So(this.el_,e,t)}removeAttribute(e){wo(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+Il(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Uo(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${Il(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;let i;this.on("touchstart",(function(n){1===n.touches.length&&(t={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},e=Ne.performance.now(),i=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)i=!1;else if(t){const n=e.touches[0].pageX-t.pageX,r=e.touches[0].pageY-t.pageY;Math.sqrt(n*n+r*r)>10&&(i=!1)}}));const n=function(){i=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){if(t=null,!0===i){Ne.performance.now()-e<200&&(n.preventDefault(),this.trigger("tap"))}}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=dl(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=dl(this,e),this.clearTimersOnDispose_(),i=Ne.setTimeout((()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),Ne.clearTimeout(e)),e}setInterval(e,t){e=dl(this,e),this.clearTimersOnDispose_();const i=Ne.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),Ne.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=dl(this,e),t=Ne.requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=dl(this,t);const i=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}));return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),Ne.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,i)=>this[t](i)))})),this.clearingTimersOnDispose_=!1})))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){const t=Ne.getComputedStyle(e,null),i=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return e||(e=this.el()),!!(function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;const t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0)return!1;if(t.x>(qe.documentElement.clientWidth||Ne.innerWidth))return!1;if(t.y<0)return!1;if(t.y>(qe.documentElement.clientHeight||Ne.innerHeight))return!1;let i=qe.elementFromPoint(t.x,t.y);for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(e)&&(i=e,t(i.parentElement)&&t(i)&&"0"!==i.style.opacity&&"0px"!==Ne.getComputedStyle(i).height&&"0px"!==Ne.getComputedStyle(i).width)&&(!e.parentElement||e.tabIndex>=0));var i}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Pl.getComponent("Tech"),n=i&&i.isTech(t),r=Pl===t||Pl.prototype.isPrototypeOf(t.prototype);if(n||!r){let t;throw t=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=Il(e),Pl.components_||(Pl.components_={});const s=Pl.getComponent("Player");if("Player"===e&&s&&s.players){const e=s.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Pl.components_[e]=t,Pl.components_[kl(e)]=t,t}static getComponent(e){if(e&&Pl.components_)return Pl.components_[e]}}function Dl(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,n,i.length-1),i[n][t]}function Ml(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Dl.bind(null,"start",0,e),end:Dl.bind(null,"end",1,e)},Ne.Symbol&&Ne.Symbol.iterator&&(t[Ne.Symbol.iterator]=()=>(e||[]).values()),t}function Nl(e,t){return Array.isArray(e)?Ml(e):void 0===e||void 0===t?Ml():Ml([[e,t]])}Pl.registerComponent("Component",Pl);const Rl=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600);const s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),r=r>0||a>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i};let Bl=Rl;function Ul(e){Bl=e}function ql(){Bl=Rl}function jl(e,t=e){return Bl(e,t)}var Fl=Object.freeze({__proto__:null,createTimeRanges:Nl,createTimeRange:Nl,setFormatTime:Ul,resetFormatTime:ql,formatTime:jl});function Hl(e,t){let i,n,r=0;if(!t)return 0;e&&e.length||(e=Nl(0,0));for(let s=0;s<e.length;s++)i=e.start(s),n=e.end(s),n>t&&(n=t),r+=n-i;return r/t}function Vl(e){if(e instanceof Vl)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Oa(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Vl.defaultMessages[this.code]||"")}function zl(e){return null!=e&&"function"==typeof e.then}function Xl(e){zl(e)&&e.then(null,(e=>{}))}Vl.prototype.code=0,Vl.prototype.message="",Vl.prototype.status=null,Vl.prototype.metadata=null,Vl.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Vl.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Vl.MEDIA_ERR_CUSTOM=0,Vl.prototype.MEDIA_ERR_CUSTOM=0,Vl.MEDIA_ERR_ABORTED=1,Vl.prototype.MEDIA_ERR_ABORTED=1,Vl.MEDIA_ERR_NETWORK=2,Vl.prototype.MEDIA_ERR_NETWORK=2,Vl.MEDIA_ERR_DECODE=3,Vl.prototype.MEDIA_ERR_DECODE=3,Vl.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Vl.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Vl.MEDIA_ERR_ENCRYPTED=5,Vl.prototype.MEDIA_ERR_ENCRYPTED=5;const Wl=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,i,n)=>(e[i]&&(t[i]=e[i]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})};var Gl=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=Wl(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Wl))},Yl=function(e,t){return e.forEach((function(e){const i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>i.addCue(e)))})),t.textTracks()};const Kl="vjs-modal-dialog";class Jl extends Pl{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=po("div",{className:`${Kl}-content`},{role:"document"}),this.descEl_=po("p",{className:`${Kl}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),mo(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Kl} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Mo(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);const r=this.getChild("closeButton");r&&i.appendChild(r.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Oo(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=qe.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())return e.preventDefault(),void this.close();if("Tab"!==e.key)return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let e=0;e<t.length;e++)if(i===t[e]){n=e;break}qe.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof Ne.HTMLAnchorElement||e instanceof Ne.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof Ne.HTMLInputElement||e instanceof Ne.HTMLSelectElement||e instanceof Ne.HTMLTextAreaElement||e instanceof Ne.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof Ne.HTMLIFrameElement||e instanceof Ne.HTMLObjectElement||e instanceof Ne.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}Jl.prototype.options_={pauseOnOpen:!0,temporary:!0},Pl.registerComponent("ModalDialog",Jl);class Ql extends gl{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},yl(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}Ql.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const Cf in Ql.prototype.allowedEvents_)Ql.prototype["on"+Cf]=null;const Zl=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};const $l=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class eu extends Ql{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class tu{constructor(e){tu.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const n=e.length;this.cues_=e,this.length_=e.length;const r=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const iu={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},nu={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},ru={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},su={disabled:"disabled",hidden:"hidden",showing:"showing"};class au extends gl{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Qo(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const ou=function(e){return new URL(e,qe.baseURI)},lu=function(e){return new URL(e,qe.baseURI).href},uu=function(e){if("string"==typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},du=function(e,t=Ne.location){return ou(e).origin!==t.origin};var cu=Object.freeze({__proto__:null,parseUrl:ou,getAbsoluteURL:lu,getFileExtension:uu,isCrossOrigin:du});const hu=function(e,t){const i=new Ne.WebVTT.Parser(Ne,Ne.vttjs,Ne.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(Ne.console&&Ne.console.groupCollapsed&&Ne.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),n.forEach((e=>Ea.error(e))),Ne.console&&Ne.console.groupEnd&&Ne.console.groupEnd()),i.flush()},pu=function(e,t){const i={uri:e},n=du(e);n&&(i.cors=n);const r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),lt(i,dl(this,(function(e,i,n){if(e)return Ea.error(e,i);t.loaded_=!0,"function"!=typeof Ne.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return hu(n,t);Ea.error(`vttjs failed to load, stopping trying to process ${t.src}`)})):hu(n,t)})))};class mu extends au{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Da(e,{kind:ru[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=su[t.mode]||"disabled";const n=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const r=new tu(this.cues_),s=new tu(this.activeCues_);let a=!1;this.timeupdateHandler=dl(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}));this.tech_.one("dispose",(()=>{this.stopTracking()})),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>n,set(){}},mode:{get:()=>i,set(e){su[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||pu(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?r:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return s;const e=this.tech_.currentTime(),t=[];for(let i=0,n=this.cues.length;i<n;i++){const n=this.cues[i];n.startTime<=e&&n.endTime>=e&&t.push(n)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,s.setCues_(this.activeCues_),s},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&pu(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new Ne.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}mu.prototype.allowedEvents_={cuechange:"cuechange"};class gu extends au{constructor(e={}){const t=Da(e,{kind:nu[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class fu extends au{constructor(e={}){const t=Da(e,{kind:iu[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class yu extends gl{constructor(e={}){let t;super();const i=new mu(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=yu.NONE,i.addEventListener("loadeddata",(()=>{t=yu.LOADED,this.trigger({type:"load",target:this})}))}}yu.prototype.allowedEvents_={load:"load"},yu.NONE=0,yu.LOADING=1,yu.LOADED=2,yu.ERROR=3;const vu={audio:{ListClass:class extends Ql{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Zl(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Zl(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Zl(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:gu,capitalName:"Audio"},video:{ListClass:class extends Ql{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){$l(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&$l(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,$l(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:fu,capitalName:"Video"},text:{ListClass:eu,TrackClass:mu,capitalName:"Text"}};Object.keys(vu).forEach((function(e){vu[e].getterName=`${e}Tracks`,vu[e].privateName=`${e}Tracks_`}));const bu={remoteText:{ListClass:eu,TrackClass:mu,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:yu,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},_u=Object.assign({},vu,bu);bu.names=Object.keys(bu),vu.names=Object.keys(vu),_u.names=[].concat(bu.names).concat(vu.names);class Tu extends Pl{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),_u.names.forEach((t=>{const i=_u[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new _u.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(e)),1))),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(dl(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Nl(0,0)}bufferedPercent(){return Hl(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(vu.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach((e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const n=t[i];"text"===e&&this.removeRemoteTextTrack(n),t.removeTrack(n)}}))}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Vl(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Nl(0,0):Nl()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){vu.names.forEach((e=>{const t=vu[e],i=()=>{this.trigger(`${e}trackchange`)},n=this[t.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.on("dispose",(()=>{n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)}))}))}addWebVttScript_(){if(!Ne.WebVTT)if(qe.body.contains(this.el())){if(!this.options_["vtt.js"]&&Pa(Wt)&&Object.keys(Wt).length>0)return void this.trigger("vttjsloaded");const e=qe.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",(()=>{e.onload=null,e.onerror=null})),Ne.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),n=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_();const r=()=>this.trigger("texttrackchange"),s=()=>{r();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",r),"showing"===i.mode&&i.addEventListener("cuechange",r)}};s(),e.addEventListener("change",s),e.addEventListener("addtrack",s),e.addEventListener("removetrack",s),this.on("dispose",(function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",s),e.removeEventListener("addtrack",s),e.removeEventListener("removetrack",s);for(let t=0;t<e.length;t++){e[t].removeEventListener("cuechange",r)}}))}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r={}){const s=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;const a=new _u.text.TrackClass(r);return s.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){const t=Da(e,{tech:this});return new bu.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track))),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Qo();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",(()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())}))):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Tu.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Tu||e instanceof Tu||e===Tu}static registerTech(e,t){if(Tu.techs_||(Tu.techs_={}),!Tu.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Tu.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Tu.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Il(e),Tu.techs_[e]=t,Tu.techs_[kl(e)]=t,"Tech"!==e&&Tu.defaultTechOrder_.push(e),t}static getTech(e){if(e)return Tu.techs_&&Tu.techs_[e]?Tu.techs_[e]:(e=Il(e),Ne&&Ne.videojs&&Ne.videojs[e]?(Ea.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),Ne.videojs[e]):void 0)}}_u.names.forEach((function(e){const t=_u[e];Tu.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Tu.prototype.featuresVolumeControl=!0,Tu.prototype.featuresMuteControl=!0,Tu.prototype.featuresFullscreenResize=!1,Tu.prototype.featuresPlaybackRate=!1,Tu.prototype.featuresProgressEvents=!1,Tu.prototype.featuresSourceset=!1,Tu.prototype.featuresTimeupdateEvents=!1,Tu.prototype.featuresNativeTextTracks=!1,Tu.prototype.featuresVideoFrameCallback=!1,Tu.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){const i=e.sourceHandlers||[];let n;for(let e=0;e<i.length;e++)if(n=i[e].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){const n=e.sourceHandlers||[];let r;for(let e=0;e<n.length;e++)if(r=n[e].canHandleSource(t,i),r)return n[e];return null},e.canPlaySource=function(t,i){const n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach((function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:Ea.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Pl.registerComponent("Tech",Tu),Tu.registerTech("Tech",Tu),Tu.defaultTechOrder_=[];const Au={},Su={},wu={};function Eu(e,t,i){e.setTimeout((()=>Ou(t,Au[t.type],i,e)),1)}function xu(e,t,i,n=null){const r="call"+Il(i),s=e.reduce(Lu(r),n),a=s===wu,o=a?null:t[i](s);return function(e,t,i,n){for(let r=e.length-1;r>=0;r--){const s=e[r];s[t]&&s[t](n,i)}}(e,i,o,a),o}const Cu={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ku={setCurrentTime:1,setMuted:1,setVolume:1},Iu={play:1,pause:1};function Lu(e){return(t,i)=>t===wu?wu:i[e]?i[e](t):t}function Ou(e={},t=[],i,n,r=[],s=!1){const[a,...o]=t;if("string"==typeof a)Ou(e,Au[a],i,n,r,s);else if(a){const t=function(e,t){const i=Su[e.id()];let n=null;if(null==i)return n=t(e),Su[e.id()]=[[t,n]],n;for(let e=0;e<i.length;e++){const[r,s]=i[e];r===t&&(n=s)}return null===n&&(n=t(e),i.push([t,n])),n}(n,a);if(!t.setSource)return r.push(t),Ou(e,o,i,n,r,s);t.setSource(Object.assign({},e),(function(a,l){if(a)return Ou(e,o,i,n,r,s);r.push(t),Ou(l,e.type===l.type?o:Au[l.type],i,n,r,s)}))}else o.length?Ou(e,o,i,n,r,s):s?i(e,r):Ou(e,Au["*"],i,n,r,!0)}const Pu={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Du=function(e=""){const t=uu(e);return Pu[t.toLowerCase()]||""},Mu=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=Mu(e),Array.isArray(e)?t=t.concat(e):Oa(e)&&t.push(e)})),e=t}else e="string"==typeof e&&e.trim()?[Nu({src:e})]:Oa(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Nu(e)]:[];return e};function Nu(e){if(!e.type){const t=Du(e.src);t&&(e.type=t)}return e}const Ru=$a?10009:eo?461:8,Bu={codes:{play:415,pause:19,ff:417,rw:412,back:Ru},names:{415:"play",19:"pause",417:"ff",412:"rw",[Ru]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!(!this.names[e.keyCode]||this.names[e.keyCode]!==t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){const t=this.codes[e.code];return this.names[t]}return null}};class Uu extends gl{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",(()=>{this.focus(this.updateFocusableComponents()[0])})),this.player_.on("modalclose",(()=>{this.refocusComponent()})),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",(()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())})))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const e=t.key.substring(5).toLowerCase();this.move(e)}else if(Bu.isEventKey(t,"play")||Bu.isEventKey(t,"pause")||Bu.isEventKey(t,"ff")||Bu.isEventKey(t,"rw")){t.preventDefault();const e=Bu.getEventName(t);this.performMediaAction_(e)}else Bu.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const n=this.getCurrentComponent(e.target);t&&(i=Boolean(t.closest(".video-js")),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(n&&"CloseButton"===n.name()?this.refocusComponent():(this.pause(),n&&n.el()&&(this.lastFocusedComponent_=n)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(e){for(const n of e)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach((e=>{if(e.hasOwnProperty("el_")){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);e.hasOwnProperty("children_")&&e.children_.length>0?i(e.children_):e.hasOwnProperty("items")&&e.items.length>0?i(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if("ErrorDisplay"===e.name_&&e.opened_){const i=e.el_.querySelector(".vjs-errors-ok-button-container");if(i){i.querySelectorAll("button").forEach(((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{const t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})}))}}})),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){return e.el()?function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let e=0;e<i.children.length;e++){const n=t(i.children[e]);if(n)return n}return null}(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length)for(const e of this.focusableComponents)if(e.el()===t)return e}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name())return this.focusableComponents.splice(t,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),n=this.focusableComponents.filter((n=>n!==t&&this.isInDirection_(i.boundingClientRect,n.getPositions().boundingClientRect,e))),r=this.findBestCandidate_(i.center,n,e);r?this.focus(r):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let n=1/0,r=null;for(const s of t){const t=s.getPositions().center,a=this.calculateDistance_(e,t,i);a<n&&(n=a,r=s)}return r}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}focus(e){"object"==typeof e&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);let s;switch(i){case"right":case"left":s=n+100*r;break;case"up":s=2*r+.5*n;break;case"down":s=5*r+n;break;default:s=n+r}return s}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if("TextTrackSelect"===t.constructor.name){e.focus(t);break}}}Pl.registerComponent("MediaLoader",class extends Pl{constructor(e,t,i){if(super(e,Da({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,n=t.playerOptions.techOrder;i<n.length;i++){const t=Il(n[i]);let r=Tu.getTech(t);if(t||(r=Pl.getComponent(t)),r&&r.isSupported()){e.loadTech_(t);break}}}});class qu extends Pl{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&Ea.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const n=po(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(po("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=po("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,mo(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Pl.registerComponent("ClickableComponent",qu);class ju extends qu{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return po("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(po("picture",{className:"vjs-poster",tabIndex:-1},{},po("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Xl(this.player_.play()):this.player_.pause())}}ju.prototype.crossorigin=ju.prototype.crossOrigin,Pl.registerComponent("PosterImage",ju);const Fu="#222",Hu="#ccc",Vu={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function zu(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Xu(e,t,i){try{e.style[t]=i}catch(e){return}}function Wu(e){return e?`${e}px`:""}Pl.registerComponent("TextTrackDisplay",class extends Pl{constructor(e,t,i){super(e,t,i);const n=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",(e=>this.updateDisplay(e))),e.on("loadedmetadata",(e=>{this.updateDisplayOverlay(),this.preselectTrack(e)})),e.ready(dl(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",n),e.on("playerresize",n);const t=Ne.screen.orientation||Ne,i=Ne.screen.orientation?"change":"orientationchange";t.addEventListener(i,n),e.on("dispose",(()=>t.removeEventListener(i,n)));const r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()})))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,r,s;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?s=o:s||(s=o):i&&!i.enabled?(s=null,n=null,r=null):o.default&&("descriptions"!==o.kind||n?o.kind in e&&!r&&(r=o):n=o)}s?s.mode="showing":r?r.mode="showing":n&&(n.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof Ne.WebVTT&&Ne.WebVTT.processCues(Ne,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const n=e[i];"showing"===n.mode&&t.push(n)}return void this.updateForTrack(t)}let i=null,n=null,r=e.length;for(;r--;){const t=e[r];"showing"===t.mode&&("descriptions"===t.kind?i=t:n=t)}if(n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!Ne.CSS.supports("inset","10px")){const e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,n=this.player_.el_.getBoundingClientRect().height;e.style="",Xu(e,"position","relative"),Xu(e,"height",n-i+"px"),Xu(e,"top","unset"),Xu(e,"bottom",to?n+"px":"0px"),t.length>0&&t.forEach((e=>{if(e.style.inset){const t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}}))}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!Ne.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,n=this.player_.videoWidth()/this.player_.videoHeight();let r=0,s=0;Math.abs(i-n)>.1&&(i>n?r=Math.round((e-t*n)/2):s=Math.round((t-e/n)/2)),Xu(this.el_,"insetInline",Wu(r)),Xu(this.el_,"insetBlock",Wu(s))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;for(;n--;){const e=i[n];if(!e)continue;const r=e.displayState;if(t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&Xu(r.firstChild,"color",zu(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Xu(r.firstChild,"backgroundColor",zu(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Xu(r,"backgroundColor",zu(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow=`2px 2px 3px ${Fu}, 2px 2px 4px ${Fu}, 2px 2px 5px ${Fu}`:"raised"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${Fu}, 2px 2px ${Fu}, 3px 3px ${Fu}`:"depressed"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${Hu}, 0 1px ${Hu}, -1px -1px ${Fu}, 0 -1px ${Fu}`:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow=`0 0 4px ${Fu}, 0 0 4px ${Fu}, 0 0 4px ${Fu}, 0 0 4px ${Fu}`)),t.fontPercent&&1!==t.fontPercent){const e=Ne.parseFloat(r.style.fontSize);r.style.fontSize=e*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=Vu[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof Ne.WebVTT||e.every((e=>!e.activeCues)))return;const t=[];for(let i=0;i<e.length;++i){const n=e[i];for(let e=0;e<n.activeCues.length;++e)t.push(n.activeCues[e])}Ne.WebVTT.processCues(Ne,t,this.el_);for(let t=0;t<e.length;++t){const i=e[t];for(let e=0;e<i.activeCues.length;++e){const n=i.activeCues[e].displayState;yo(n,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&So(n,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}});Pl.registerComponent("LoadingSpinner",class extends Pl{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=po("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),n=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return n.appendChild(i),n}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class Gu extends qu{createEl(e,t={},i={}){const n=po("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||n.appendChild(po("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}addChild(e,t={}){const i=this.constructor.name;return Ea.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),Pl.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){" "!==e.key&&"Enter"!==e.key?super.handleKeyDown(e):e.stopPropagation()}}Pl.registerComponent("Button",Gu);class Yu extends Gu{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(e=>this.handleMouseDown(e)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Xl(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(!n)return void this.player_.tech(!0).focus();const r=()=>n.focus();zl(t)?t.then(r,(()=>{})):this.setTimeout(r,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Yu.prototype.controlText_="Play Video",Pl.registerComponent("BigPlayButton",Yu);Pl.registerComponent("CloseButton",class extends Gu{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class Ku extends Gu{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",(e=>this.handlePlay(e))),this.on(e,"pause",(e=>this.handlePause(e))),t.replay&&this.on(e,"ended",(e=>this.handleEnded(e)))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Xl(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)))}}Ku.prototype.controlText_="Play",Pl.registerComponent("PlayToggle",Ku);class Ju extends Pl{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],(e=>this.update(e))),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=po("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=po("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=jl(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,Ea.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=qe.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))})))}updateContent(e){}}Ju.prototype.labelText_="Time",Ju.prototype.controlText_="Time",Pl.registerComponent("TimeDisplay",Ju);class Qu extends Ju{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Qu.prototype.labelText_="Current Time",Qu.prototype.controlText_="Current Time",Pl.registerComponent("CurrentTimeDisplay",Qu);class Zu extends Ju{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Zu.prototype.labelText_="Duration",Zu.prototype.controlText_="Duration",Pl.registerComponent("DurationDisplay",Zu);Pl.registerComponent("TimeDivider",class extends Pl{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class $u extends Ju{constructor(e,t){super(e,t),this.on(e,"durationchange",(e=>this.updateContent(e)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(po("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}$u.prototype.labelText_="Remaining Time",$u.prototype.controlText_="Remaining Time",Pl.registerComponent("RemainingTimeDisplay",$u);Pl.registerComponent("LiveDisplay",class extends Pl{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=po("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(po("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(qe.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class ed extends Gu{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=po("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function td(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}ed.prototype.controlText_="Seek to live, currently playing live",Pl.registerComponent("SeekToLive",ed);var id=Object.freeze({__proto__:null,clamp:td});class nd extends Pl{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||za||e.preventDefault(),Eo(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;xo(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"}))),e}getProgress(){return Number(td(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Io(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,n=t&&t.horizontalSeek;i?n&&"ArrowLeft"===e.key||!n&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):n&&"ArrowRight"===e.key||!n&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Pl.registerComponent("Slider",nd);const rd=(e,t)=>td(e/t*100,0,100).toFixed(2)+"%";Pl.registerComponent("LoadProgressBar",class extends Pl{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=po("span",{className:"vjs-control-text"}),i=po("span",{textContent:this.localize("Loaded")}),n=qe.createTextNode(": ");return this.percentageEl_=po("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),r=this.partEls_,s=rd(n,i);this.percent_!==s&&(this.el_.style.width=s,mo(this.percentageEl_,s),this.percent_=s);for(let e=0;e<t.length;e++){const i=t.start(e),s=t.end(e);let a=r[e];a||(a=this.el_.appendChild(po()),r[e]=a),a.dataset.start===i&&a.dataset.end===s||(a.dataset.start=i,a.dataset.end=s,a.style.left=rd(i,n),a.style.width=rd(s-i,n))}for(let e=r.length;e>t.length;e--)this.el_.removeChild(r[e-1]);r.length=t.length}))}});Pl.registerComponent("TimeTooltip",class extends Pl{constructor(e,t){super(e,t),this.update=cl(dl(this,this.update),ul)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const n=ko(this.el_),r=Co(this.player_.el()),s=e.width*t;if(!r||!n)return;let a=e.left-r.left+s,o=e.width-s+(r.right-e.right);o||(o=e.width-s,a=s);let l=n.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>n.width&&(l=n.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){mo(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let r;const s=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;r=(i<1?"":"-")+jl(i,e)}else r=jl(i,s);this.update(e,t,r),n&&n()}))}});class sd extends Pl{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=cl(dl(this,this.update),ul)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}}sd.prototype.options_={children:[]},ro||ja||sd.prototype.options_.children.push("timeTooltip"),Pl.registerComponent("PlayProgressBar",sd);class ad extends Pl{constructor(e,t){super(e,t),this.update=cl(dl(this,this.update),ul)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,(()=>{this.el_.style.left=e.width*t+"px"}))}}ad.prototype.options_={children:["timeTooltip"]},Pl.registerComponent("MouseTimeDisplay",ad);class od extends nd{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=dl(this,this.update),this.update=cl(this.update_,ul),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in qe&&"visibilityState"in qe&&this.on(qe,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===qe.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ul))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===qe.visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[jl(e,n),jl(n,n)],"{1} of {2}")),this.currentTime_=e,this.duration_=n),this.bar&&this.bar.update(Co(this.el()),this.getProgress())})),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){No(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!No(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99)return void r.seekToLiveEdge();const e=r.seekableStart(),t=r.liveCurrentTime();if(i=e+n*r.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=n*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Xl(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in qe&&"visibilityState"in qe&&this.off(qe,"visibilitychange",this.toggleVisibility_),super.dispose()}}od.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},ro||ja||od.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Pl.registerComponent("SeekBar",od);class ld extends Pl{constructor(e,t){super(e,t),this.handleMouseMove=cl(dl(this,this.handleMouseMove),ul),this.throttledHandleMouseSeek=cl(dl(this,this.handleMouseSeek),ul),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!i&&!n)return;const r=t.el(),s=ko(r);let a=Io(r,e).x;a=td(a,0,1),n&&n.update(s,a),i&&i.update(s,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach((e=>e.disable&&e.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Xl(this.player_.play())}}enable(){this.children().forEach((e=>e.enable&&e.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}ld.prototype.options_={children:["seekBar"]},Pl.registerComponent("ProgressControl",ld);class ud extends Gu{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>this.handlePictureInPictureAudioModeChange())),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){qe.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in Ne?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof qe.exitPictureInPicture&&super.show()}}ud.prototype.controlText_="Picture-in-Picture",Pl.registerComponent("PictureInPictureToggle",ud);class dd extends Gu{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",(e=>this.handleFullscreenChange(e))),!1===qe[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}dd.prototype.controlText_="Fullscreen",Pl.registerComponent("FullscreenToggle",dd);Pl.registerComponent("VolumeLevel",class extends Pl{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}});Pl.registerComponent("VolumeLevelTooltip",class extends Pl{constructor(e,t){super(e,t),this.update=cl(dl(this,this.update),ul)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){const i=Co(this.el_),n=Co(this.player_.el()),r=e.width*t;if(!n||!i)return;const s=e.left-n.left+r,a=e.width-r+(n.right-e.right);let o=i.width/2;s<o?o+=o-s:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${n}%`)}write(e){mo(this.el_,e)}updateVolume(e,t,i,n,r){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,i,n.toFixed(0)),r&&r()}))}});class cd extends Pl{constructor(e,t){super(e,t),this.update=cl(dl(this,this.update),ul)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const n=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,n,(()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"}))}}cd.prototype.options_={children:["volumeLevelTooltip"]},Pl.registerComponent("MouseVolumeLevelDisplay",cd);class hd extends nd{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.ready((()=>this.updateARIAAttributes()))}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){No(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),n=Co(i),r=this.vertical();let s=Io(i,e);s=r?s.y:s.x,s=td(s,0,1),t.update(n,s,r)}No(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)}))}}hd.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ro||ja||hd.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),hd.prototype.playerEvent="volumechange",Pl.registerComponent("VolumeBar",hd);class pd extends Pl{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||Pa(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.throttledHandleMouseMove=cl(dl(this,this.handleMouseMove),ul),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",(e=>this.handleMouseDown(e))),this.on("touchstart",(e=>this.handleMouseDown(e))),this.on("mousemove",(e=>this.handleMouseMove(e))),this.on(this.volumeBar,["focus","slideractive"],(()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")})),this.on(this.volumeBar,["blur","sliderinactive"],(()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")}))}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}pd.prototype.options_={children:["volumeBar"]},Pl.registerComponent("VolumeControl",pd);class md extends Gu{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.on(e,["loadstart","volumechange"],(e=>this.update(e)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ro&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),vo(this.el_,[0,1,2,3].reduce(((e,t)=>e+`${t?" ":""}vjs-vol-${t}`),"")),yo(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}md.prototype.controlText_="Mute",Pl.registerComponent("MuteToggle",md);class gd extends Pl{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||Pa(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],(e=>this.volumePanelState_(e))),this.on(this.muteToggle,"keyup",(e=>this.handleKeyPress(e))),this.on(this.volumeControl,"keyup",(e=>this.handleVolumeControlKeyUp(e))),this.on("keydown",(e=>this.handleKeyPress(e))),this.on("mouseover",(e=>this.handleMouseOver(e))),this.on("mouseout",(e=>this.handleMouseOut(e))),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),nl(qe,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),rl(qe,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}gd.prototype.options_={children:["muteToggle","volumeControl"]},Pl.registerComponent("VolumePanel",gd);class fd extends Gu{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()?i.seekableEnd():this.player_.duration();let r;r=t+this.skipTime<=n?t+this.skipTime:n,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}fd.prototype.controlText_="Skip Forward",Pl.registerComponent("SkipForward",fd);class yd extends Gu{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()&&i.seekableStart();let r;r=n&&t-this.skipTime<=n?n:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}yd.prototype.controlText_="Skip Backward",Pl.registerComponent("SkipBackward",yd);class vd extends Pl{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",(e=>this.handleKeyDown(e))),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof Pl&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Pl&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=po(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),nl(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||qe.activeElement;if(!this.children().some((e=>e.el()===t))){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter((t=>t.el()===e.target))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Pl.registerComponent("Menu",vd);class bd extends Pl{constructor(e,t={}){super(e,t),this.menuButton_=new Gu(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Gu.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const n=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",n),this.on(this.menuButton_,"click",n),this.on(this.menuButton_,"keydown",(e=>this.handleKeyDown(e))),this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover"),this.menu.show(),nl(qe,"keyup",this.handleMenuKeyUp_)})),this.on("mouseleave",(e=>this.handleMouseLeave(e))),this.on("keydown",(e=>this.handleSubmenuKeyDown(e)))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new vd(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=po("li",{className:"vjs-menu-title",textContent:Il(this.options_.title),tabIndex:-1}),i=new Pl(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";return`vjs-menu-button ${e} ${Gu.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),rl(qe,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Esc"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus())):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){"Esc"!==e.key&&"Tab"!==e.key||this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){"Esc"!==e.key&&"Tab"!==e.key||(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ro&&co())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Pl.registerComponent("MenuButton",bd);class _d extends bd{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const n=dl(this,this.update);i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),i.addEventListener("labelchange",n),this.player_.on("ready",n),this.player_.on("dispose",(function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n),i.removeEventListener("labelchange",n)}))}}Pl.registerComponent("TrackButton",_d);class Td extends qu{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const n=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),r=po("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?n.appendChild(r):n.replaceChild(r,n.querySelector(".vjs-icon-placeholder")),n}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Pl.registerComponent("MenuItem",Td);class Ad extends Td{constructor(e,t){const i=t.track,n=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const r=(...e)=>{this.handleTracksChange.apply(this,e)},s=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),n.addEventListener("change",r),n.addEventListener("selectedlanguagechange",s),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],r),n.removeEventListener("change",r),n.removeEventListener("selectedlanguagechange",s)})),void 0===n.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof Ne.Event)try{e=new Ne.Event("change")}catch(e){}e||(e=qe.createEvent("Event"),e.initEvent("change",!0,!0)),n.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){const n=i[e];-1!==this.kinds.indexOf(n.kind)&&(n===t?"showing"!==n.mode&&(n.mode="showing"):"disabled"!==n.mode&&(n.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Pl.registerComponent("TextTrackMenuItem",Ad);class Sd extends Ad{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(this.options_.kinds.indexOf(n.kind)>-1&&"showing"===n.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(["captions","descriptions","subtitles"].indexOf(n.kind)>-1&&"showing"===n.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Pl.registerComponent("OffTextTrackMenuItem",Sd);class wd extends _d{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Ad){let i;this.label_&&(i=`${this.label_} off`),e.push(new Sd(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<n.length;i++){const r=n[i];if(this.kinds_.indexOf(r.kind)>-1){const i=new t(this.player_,{track:r,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${r.kind}-menu-item`),e.push(i)}}return e}}Pl.registerComponent("TextTrackButton",wd);class Ed extends Td{constructor(e,t){const i=t.track,n=t.cue,r=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=r&&r<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Pl.registerComponent("ChaptersTrackMenuItem",Ed);class xd extends wd{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach((e=>{e.selected(this.track_.activeCues[0]===e.cue)}))}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Il(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new Ed(this.player_,{track:this.track_,cue:n});e.push(r)}return e}}xd.prototype.kind_="chapters",xd.prototype.controlText_="Chapters",Pl.registerComponent("ChaptersButton",xd);class Cd extends wd{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const n=e.textTracks(),r=dl(this,this.handleTracksChange);n.addEventListener("change",r),this.on("dispose",(function(){n.removeEventListener("change",r)}))}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n.kind!==this.kind_&&"showing"===n.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Cd.prototype.kind_="descriptions",Cd.prototype.controlText_="Descriptions",Pl.registerComponent("DescriptionsButton",Cd);class kd extends wd{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}kd.prototype.kind_="subtitles",kd.prototype.controlText_="Subtitles",Pl.registerComponent("SubtitlesButton",kd);class Id extends Ad{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}Pl.registerComponent("CaptionSettingsMenuItem",Id);class Ld extends wd{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Id(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Ld.prototype.kind_="captions",Ld.prototype.controlText_="Captions",Pl.registerComponent("CaptionsButton",Ld);class Od extends Ad{createEl(e,t,i){const n=super.createEl(e,t,i),r=n.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",n):r.appendChild(po("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(po("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),n}}Pl.registerComponent("SubsCapsMenuItem",Od);class Pd extends wd{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Il(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Id(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Od),e}}Pd.prototype.kinds_=["captions","subtitles"],Pd.prototype.controlText_="Subtitles",Pl.registerComponent("SubsCapsButton",Pd);class Dd extends Td{constructor(e,t){const i=t.track,n=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const r=(...e)=>{this.handleTracksChange.apply(this,e)};n.addEventListener("change",r),this.on("dispose",(()=>{n.removeEventListener("change",r)}))}createEl(e,t,i){const n=super.createEl(e,t,i),r=n.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(r.appendChild(po("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(po("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),n}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Pl.registerComponent("AudioTrackMenuItem",Dd);class Md extends _d{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const n=t[i];e.push(new Dd(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e}}Md.prototype.controlText_="Audio Track",Pl.registerComponent("AudioTrackButton",Md);class Nd extends Td{constructor(e,t){const i=t.rate,n=parseFloat(i,10);t.label=i,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=n,this.on(e,"ratechange",(e=>this.update(e)))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Nd.prototype.contentElType="button",Pl.registerComponent("PlaybackRateMenuItem",Nd);class Rd extends bd{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",(e=>this.updateVisibility(e))),this.on(e,"ratechange",(e=>this.updateLabel(e))),this.on(e,"playbackrateschange",(e=>this.handlePlaybackRateschange(e)))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=po("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new Nd(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Rd.prototype.controlText_="Playback Rate",Pl.registerComponent("PlaybackRateMenuButton",Rd);class Bd extends Pl{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}Pl.registerComponent("Spacer",Bd);Pl.registerComponent("CustomControlSpacer",class extends Bd{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Ud extends Pl{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Ud.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Pl.registerComponent("ControlBar",Ud);class qd extends Jl{constructor(e,t){super(e,t),this.on(e,"error",(e=>{this.open(e)}))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}qd.prototype.options_=Object.assign({},Jl.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Pl.registerComponent("ErrorDisplay",qd);class jd extends Pl{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim();return po("select",{id:this.options_.id},{},this.options_.SelectOptions.map((e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Qo()}`)+"-"+e[1].replace(/\W+/g,""),i=po("option",{id:t,value:this.localize(e[0]),textContent:e[1]});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i})))}}Pl.registerComponent("TextTrackSelect",jd);class Fd extends Pl{constructor(e,t={}){super(e,t);const i=po("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const n=this.options_.selects;for(const t of n){const i=this.options_.selectConfigs[t],n=i.className,r=i.id.replace("%s",this.options_.id_);let s=null;const a=`vjs_select_${Qo()}`;if("colors"===this.options_.type){s=po("span",{className:n});const e=po("label",{id:r,className:"vjs-label",textContent:i.label});e.setAttribute("for",a),s.appendChild(e)}const o=new jd(e,{SelectOptions:i.options,legendId:this.options_.legendId,id:a,labelId:r});this.addChild(o),"colors"===this.options_.type&&(s.appendChild(o.el()),this.el().appendChild(s))}}createEl(){return po("fieldset",{className:this.options_.className})}}Pl.registerComponent("TextTrackFieldset",Fd);class Hd extends Pl{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new Fd(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const r=new Fd(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const s=new Fd(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s)}createEl(){return po("div",{className:"vjs-track-settings-colors"})}}Pl.registerComponent("TextTrackSettingsColors",Hd);class Vd extends Pl{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new Fd(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const r=new Fd(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const s=new Fd(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s)}createEl(){return po("div",{className:"vjs-track-settings-font"})}}Pl.registerComponent("TextTrackSettingsFont",Vd);class zd extends Pl{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),n=new Gu(e,{controlText:i,className:"vjs-default-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Reset"),this.addChild(n);const r=new Gu(e,{controlText:i,className:"vjs-done-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Done"),this.addChild(r)}createEl(){return po("div",{className:"vjs-track-settings-controls"})}}Pl.registerComponent("TrackSettingsControls",zd);const Xd="vjs-text-track-settings",Wd=["#000","Black"],Gd=["#00F","Blue"],Yd=["#0FF","Cyan"],Kd=["#0F0","Green"],Jd=["#F0F","Magenta"],Qd=["#F00","Red"],Zd=["#FFF","White"],$d=["#FF0","Yellow"],ec=["1","Opaque"],tc=["0.5","Semi-Transparent"],ic=["0","Transparent"],nc={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Wd,Zd,Qd,Kd,Gd,$d,Jd,Yd],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[ec,tc,ic],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Zd,Wd,Qd,Kd,Gd,$d,Jd,Yd],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[ec,tc],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[ic,tc,ec],className:"vjs-window-opacity vjs-opacity"}};function rc(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}nc.windowColor.options=nc.backgroundColor.options;Pl.registerComponent("TextTrackSettings",class extends Jl{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=po("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Hd(e,{textTrackComponentid:this.id_,selectConfigs:nc,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Vd(e,{textTrackComponentid:this.id_,selectConfigs:nc,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const n=new zd(e);this.addChild(n)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],(()=>{this.saveSettings(),this.close()})),this.on(this.$(".vjs-default-button"),["click","tap"],(()=>{this.setDefaults(),this.updateDisplay()})),Ia(nc,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay)}))}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return La(nc,((e,t,i)=>{const n=(r=this.$(t.selector),s=t.parser,rc(r.options[r.options.selectedIndex].value,s));var r,s;return void 0!==n&&(e[i]=n),e}),{})}setValues(e){Ia(nc,((t,i)=>{!function(e,t,i){if(t)for(let n=0;n<e.options.length;n++)if(rc(e.options[n].value,i)===t){e.selectedIndex=n;break}}(this.$(t.selector),e[i],t.parser)}))}setDefaults(){Ia(nc,(e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t}))}restoreSettings(){let e;try{e=JSON.parse(Ne.localStorage.getItem(Xd))}catch(e){Ea.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?Ne.localStorage.setItem(Xd,JSON.stringify(e)):Ne.localStorage.removeItem(Xd)}catch(e){Ea.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}});Pl.registerComponent("ResizeManager",class extends Pl{constructor(e,t){let i=t.ResizeObserver||Ne.ResizeObserver;null===t.ResizeObserver&&(i=!1);super(e,Da({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||Ne.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=hl((()=>{this.resizeHandler()}),100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){rl(this,"resize",e),rl(this,"unload",t),t=null};nl(this.el_.contentWindow,"unload",t),nl(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const sc={trackingThreshold:20,liveTolerance:15};Pl.registerComponent("LiveTracker",class extends Pl{constructor(e,t){super(e,Da(sc,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",(e=>this.handleDurationchange(e))),this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(Ne.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const n=this.liveCurrentTime(),r=this.player_.currentTime();let s=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-r)>this.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ul),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}});Pl.registerComponent("TitleBar",class extends Pl{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:po("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Qo()}`}),description:po("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Qo()}`})},po("div",{className:"vjs-title-bar"},{},Ma(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e=>{const n=this.state[e],r=this.els[e],s=i[e];Oo(r),n&&mo(r,n),t&&(t.removeAttribute(s),n&&t.setAttribute(s,r.id))})),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const ac={initialDisplay:4e3,position:[],takeFocus:!1};Pl.registerComponent("TransientButton",class extends Gu{constructor(e,t){super(e,t=Da(ac,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],(e=>{this.removeClass("force-display")}))}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map((e=>`vjs-${e}`)).join(" ")}`}createEl(){const e=po("button",{},{type:"button",class:this.buildCSSClass()},po("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout((()=>{this.removeClass("force-display")}),this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});const oc=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),n=[];let r="";if(!i.length)return!1;for(let e=0;e<i.length;e++){const t=i[e].src;t&&-1===n.indexOf(t)&&n.push(t)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},lc=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=qe.createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=qe.createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",Ne.Element.prototype.appendChild.call(this,i),this.innerHTML}}),uc=(e,t)=>{let i={};for(let n=0;n<e.length&&(i=Object.getOwnPropertyDescriptor(e[n],t),!(i&&i.set&&i.get));n++);return i.enumerable=!0,i.configurable=!0,i},dc=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},n=(e=>uc([e.el(),Ne.HTMLMediaElement.prototype,Ne.Element.prototype,lc],"innerHTML"))(e),r=i=>(...n)=>{const r=i.apply(t,n);return oc(e),r};["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",Da(n,{set:r(n.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach((e=>{t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)},cc=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?lu(Ne.Element.prototype.getAttribute.call(this,"src")):""},set(e){return Ne.Element.prototype.setAttribute.call(this,"src",e),e}}),hc=function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=(e=>uc([e.el(),Ne.HTMLMediaElement.prototype,cc],"src"))(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",Da(i,{set:n=>{const r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=(i,r)=>{const s=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),s},t.load=()=>{const i=r.call(t);return oc(e)||(e.triggerSourceset(""),dc(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):oc(e)||dc(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}};class pc extends Tu{constructor(e,t){super(e,t);const i=e.source;let n=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];for(;t--;){const r=e[t];"track"===r.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),this.textTracks().addTrack(r.track),n||this.el_.hasAttribute("crossorigin")||!du(r.src)||(n=!0)):i.push(r))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&n&&Ea.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(io||Za)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),pc.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){hc(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",(()=>e.removeEventListener("change",i)));const n=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",(()=>{e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)})),this.on("webkitendfullscreen",(()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)}))}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach((e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])})),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=vu[e],i=this.el()[t.getterName],n=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const r={change:t=>{const i={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(i),"text"===e&&this[bu.remoteText.getterName]().trigger(i)},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}},s=function(){const e=[];for(let t=0;t<n.length;t++){let r=!1;for(let e=0;e<i.length;e++)if(i[e]===n[t]){r=!0;break}r||e.push(n[t])}for(;e.length;)n.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=r,Object.keys(r).forEach((e=>{const t=r[e];i.addEventListener(e,t),this.on("dispose",(n=>i.removeEventListener(e,t)))})),this.on("loadstart",s),this.on("dispose",(e=>this.off("loadstart",s)))}proxyNativeTracks_(){vu.names.forEach((e=>{this.proxyNativeTracksForType_(e)}))}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),pc.disposeMediaElement(e),e=t}else{e=qe.createElement("video");const t=Da({},this.options_.tag&&To(this.options_.tag));io&&!0===this.options_.nativeControlsForTouch||delete t.controls,_o(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&So(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const n=t[i],r=this.options_[n];void 0!==r&&(r?So(e,n,n):wo(e,n),e[n]=r)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")}))}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&so?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Ea(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ja&&za&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)}))}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Xl(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return Ea.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const n=po("source",{},i);return this.el_.appendChild(n),!0}removeSourceElement(e){if(!e)return Ea.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return Ea.warn(`No matching source element found with src: ${e}`),!1}reset(){pc.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=qe.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),Ne.performance&&(e.creationTime=Ne.performance.now()),e}}Na(pc,"TEST_VID",(function(){if(!lo())return;const e=qe.createElement("video"),t=qe.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),pc.isSupported=function(){try{pc.TEST_VID.volume=.5}catch(e){return!1}return!(!pc.TEST_VID||!pc.TEST_VID.canPlayType)},pc.canPlayType=function(e){return pc.TEST_VID.canPlayType(e)},pc.canPlaySource=function(e,t){return pc.canPlayType(e.type)},pc.canControlVolume=function(){try{const e=pc.TEST_VID.volume;pc.TEST_VID.volume=e/2+.1;const t=e!==pc.TEST_VID.volume;return t&&ro?(Ne.setTimeout((()=>{pc&&pc.prototype&&(pc.prototype.featuresVolumeControl=e!==pc.TEST_VID.volume)})),!1):t}catch(e){return!1}},pc.canMuteVolume=function(){try{const e=pc.TEST_VID.muted;return pc.TEST_VID.muted=!e,pc.TEST_VID.muted?So(pc.TEST_VID,"muted","muted"):wo(pc.TEST_VID,"muted"),e!==pc.TEST_VID.muted}catch(e){return!1}},pc.canControlPlaybackRate=function(){if(ja&&za&&Wa<58)return!1;try{const e=pc.TEST_VID.playbackRate;return pc.TEST_VID.playbackRate=e/2+.1,e!==pc.TEST_VID.playbackRate}catch(e){return!1}},pc.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(qe.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(qe.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(qe.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(qe.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},pc.supportsNativeTextTracks=function(){return so||ro&&za},pc.supportsNativeVideoTracks=function(){return!(!pc.TEST_VID||!pc.TEST_VID.videoTracks)},pc.supportsNativeAudioTracks=function(){return!(!pc.TEST_VID||!pc.TEST_VID.audioTracks)},pc.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){Na(pc.prototype,e,(()=>pc[t]()),!0)})),pc.prototype.featuresVolumeControl=pc.canControlVolume(),pc.prototype.movingMediaElementInDOM=!ro,pc.prototype.featuresFullscreenResize=!0,pc.prototype.featuresProgressEvents=!0,pc.prototype.featuresTimeupdateEvents=!0,pc.prototype.featuresVideoFrameCallback=!(!pc.TEST_VID||!pc.TEST_VID.requestVideoFrameCallback),pc.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},pc.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){pc.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){pc.prototype["set"+Il(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){pc.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){pc.prototype["set"+Il(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){pc.prototype[e]=function(){return this.el_[e]()}})),Tu.withSourceHandlers(pc),pc.nativeSourceHandler={},pc.nativeSourceHandler.canPlayType=function(e){try{return pc.TEST_VID.canPlayType(e)}catch(e){return""}},pc.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return pc.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=uu(e.src);return pc.nativeSourceHandler.canPlayType(`video/${t}`)}return""},pc.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},pc.nativeSourceHandler.dispose=function(){},pc.registerSourceHandler(pc.nativeSourceHandler),Tu.registerTech("Html5",pc);const mc=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],gc={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},fc=["tiny","xsmall","small","medium","large","xlarge","huge"],yc={};fc.forEach((e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;yc[e]=`vjs-layout-${t}`}));const vc={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class bc extends Pl{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Qo()}`,(t=Object.assign(bc.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=xa(this.id_),this.fsApi_=_a,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&To(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(i){e[i.toLowerCase()]=t.languages[i]})),this.languages_=e}else this.languages_=bc.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),El(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(nl(qe,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const n=Da(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach((e=>{this[e](t.plugins[e])})),t.debug&&this.debug(!0),this.options_.playerOptions=n,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new Ne.DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <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"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))Ea.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Uu(this),this.addClass("vjs-spatial-navigation-enabled")),io&&this.addClass("vjs-touch-enabled"),ro||this.addClass("vjs-workinghover"),bc.players[this.id_]=this;const r=fa.split(".")[0];this.addClass(`vjs-v${r}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)}))}dispose(){var e;this.trigger("dispose"),this.off("dispose"),rl(qe,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),rl(qe,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),bc.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),e=this,Su.hasOwnProperty(e.id())&&delete Su[e.id()],_u.names.forEach((e=>{const t=this[_u[e].getterName]();t&&t.off&&t.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const n="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:n||(e=this.el_=super.createEl("div"));const r=To(t);if(n){for(e=this.el_=t,t=this.tag=qe.createElement("video");e.children.length;)t.appendChild(e.firstChild);fo(e,"video-js")||yo(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach((i=>{try{t[i]=e[i]}catch(e){}}))}t.setAttribute("tabindex","-1"),r.tabindex="-1",za&&Ja&&(t.setAttribute("role","application"),r.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach((function(i){n&&"class"===i||e.setAttribute(i,r[i]),n&&t.setAttribute(i,r[i])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const s=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter((e=>ao[e])).map((e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-")));if(this.addClass(...s),!0!==Ne.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Wo("vjs-styles-dimensions");const e=Ro(".vjs-styles-defaults"),t=Ro("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const a=t.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a.item(e);yo(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),go(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):Ea.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const n=parseFloat(t);isNaN(n)?Ea.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=n,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,yl(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},yl(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===Ne.VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,n;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const r=i.split(":"),s=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Go(this.styleEl_,`\n .${n} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${n}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*s}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Il(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(Tu.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let r=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(r=!1);const s={source:t,autoplay:r,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};_u.names.forEach((e=>{const t=_u[e];s[t.getterName]=this[t.privateName]})),Object.assign(s,this.options_[i]),Object.assign(s,this.options_[n]),Object.assign(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);const a=Tu.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new a(s),this.tech_.ready(dl(this,this.handleTechReady_),!0),Yl(this.textTracksJson_||[],this.tech_),mc.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${Il(e)}_`](t)))})),Object.keys(gc).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${gc[e]}_`].bind(this),event:t}):this[`handleTech${gc[e]}_`](t)}))})),this.on(this.tech_,"loadstart",(e=>this.handleTechLoadStart_(e))),this.on(this.tech_,"sourceset",(e=>this.handleTechSourceset_(e))),this.on(this.tech_,"waiting",(e=>this.handleTechWaiting_(e))),this.on(this.tech_,"ended",(e=>this.handleTechEnded_(e))),this.on(this.tech_,"seeking",(e=>this.handleTechSeeking_(e))),this.on(this.tech_,"play",(e=>this.handleTechPlay_(e))),this.on(this.tech_,"pause",(e=>this.handleTechPause_(e))),this.on(this.tech_,"durationchange",(e=>this.handleTechDurationChange_(e))),this.on(this.tech_,"fullscreenchange",((e,t)=>this.handleTechFullscreenChange_(e,t))),this.on(this.tech_,"fullscreenerror",((e,t)=>this.handleTechFullscreenError_(e,t))),this.on(this.tech_,"enterpictureinpicture",(e=>this.handleTechEnterPictureInPicture_(e))),this.on(this.tech_,"leavepictureinpicture",(e=>this.handleTechLeavePictureInPicture_(e))),this.on(this.tech_,"error",(e=>this.handleTechError_(e))),this.on(this.tech_,"posterchange",(e=>this.handleTechPosterChange_(e))),this.on(this.tech_,"textdata",(e=>this.handleTechTextData_(e))),this.on(this.tech_,"ratechange",(e=>this.handleTechRateChange_(e))),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||go(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){_u.names.forEach((e=>{const t=_u[e];this[t.privateName]=this[t.getterName]()})),this.textTracksJson_=Gl(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&Ea.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":fa}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(zl(i))return i.catch((e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)}))};let i;return"any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),zl(i)&&(i=i.catch(t))),zl(i)?i.then((()=>{this.trigger({type:"autoplay-success",autoplay:e})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:e})})):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter((e=>e.src===t));if(i.length)return i[0].type;const n=e.$$("source");for(let e=0;e<n.length;e++){const i=n[e];if(i.type&&i.src&&i.src===t)return i.type}return Du(t)})(this,t)),this.cache_.source=Da({},e,{src:t,type:i});const n=this.cache_.sources.filter((e=>e.src&&e.src===t)),r=[],s=this.$$("source"),a=[];for(let e=0;e<s.length;e++){const i=To(s[e]);r.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,n=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==i)&&(t=()=>{}),t(n),e.src||this.tech_.any(["sourceset","loadstart"],(e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((e=>e.callback(e.event))),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Xl(this.play()):this.pause()))}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(t=>t.contains(e.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!qe.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let n=qe[this.fsApi_.fullscreenElement]===i;!n&&i.matches&&(n=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready((function(){if(e in ku)return function(e,t,i,n){return t[i](e.reduce(Lu(i),n))}(this.middleware_,this.tech_,e,t);if(e in Iu)return xu(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Ea(e),e}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in Cu)return function(e,t,i){return e.reduceRight(Lu(i),t[i]())}(this.middleware_,this.tech_,e);if(e in Iu)return xu(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Ea(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw Ea(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw Ea(t),t}}}play(){return new Promise((e=>{this.play_(e)}))}play_(e=Xl){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(so||ro);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const n=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Nl(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Nl(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Nl(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Hl(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise(((i,n)=>{function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",s)}function s(){r(),i()}function a(e,t){r(),n(t)}t.one("fullscreenchange",s),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(i,n))}))}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise(((t,i)=>{function n(){e.off("fullscreenerror",s),e.off("fullscreenchange",r)}function r(){n(),t()}function s(e,t){n(),i(t)}e.one("fullscreenchange",r),e.one("fullscreenerror",s);const a=e.exitFullscreenHelper_();a&&(a.then(n,n),a.then(t,i))}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=qe[this.fsApi_.exitFullscreen]();return e&&Xl(e.then((()=>this.isFullscreen(!1)))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=qe.documentElement.style.overflow,nl(qe,"keydown",this.boundFullWindowOnEscKey_),qe.documentElement.style.overflow="hidden",yo(qe.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,rl(qe,"keydown",this.boundFullWindowOnEscKey_),qe.documentElement.style.overflow=this.docOrigOverflow,vo(qe.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&Ne.documentPictureInPicture){const e=qe.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(po("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),Ne.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((t=>(qo(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",(t=>{const i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")})),t)))}return"pictureInPictureEnabled"in qe&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return Ne.documentPictureInPicture&&Ne.documentPictureInPicture.window?(Ne.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in qe?qe.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys)return;(e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=(t=>"f"===e.key.toLowerCase()),muteKey:n=(t=>"m"===e.key.toLowerCase()),playPauseKey:r=(t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase())}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Pl.getComponent("FullscreenToggle");!1!==qe[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else if(n.call(this,e)){e.preventDefault(),e.stopPropagation();Pl.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(r.call(this,e)){e.preventDefault(),e.stopPropagation();Pl.getComponent("PlayToggle").prototype.handleClick.call(this,e)}}canPlayType(e){let t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){const r=n[i];let s=Tu.getTech(r);if(s||(s=Pl.getComponent(r)),s){if(s.isSupported()&&(t=s.canPlayType(e),t))return t}else Ea.error(`The "${r}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map((e=>[e,Tu.getTech(e)])).filter((([e,t])=>t?t.isSupported():(Ea.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1))),i=function(e,t,i){let n;return e.some((e=>t.some((t=>{if(n=i(e,t),n)return!0})))),n};let n;const r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};var s;return n=this.options_.sourceOrder?i(e,t,(s=r,(e,t)=>s(t,e))):i(t,e,r),n||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Mu(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),Eu(this,i[0],((e,n)=>{this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(e);if(this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());var r,s;r=n,s=this.tech_,r.forEach((e=>e.setTech&&e.setTech(s)))})),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Ll(t.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready((()=>{this.changingSrc_=!1})),!1))}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{Xl(this.play().then((()=>this.doReset_())))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),yl(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},{seekBar:r}=i||{};e&&e.updateContent(),t&&t.updateContent(),n&&n.updateContent(),r&&(r.update(),r.loadProgressBar&&r.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(va("beforeerror").forEach((t=>{const i=t(this,e);Oa(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Vl(e),this.addClass("vjs-error"),Ea.error(`(CODE:${this.error_.code} ${Vl.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),va("error").forEach((e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const n=dl(this,this.reportUserActivity),r=function(t){n(),this.clearInterval(e)};this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())})),this.on("mouseup",r),this.on("mouseleave",r);const s=this.getChild("controlBar");let a;!s||ro||ja||(s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n);this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}),250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach((e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach((e=>e.show())),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=e,e){if(this.audioOnlyMode()){return this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_()}))}return Promise.resolve().then((()=>{this.enablePosterModeUI_()}))}return Promise.resolve().then((()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),yl(this)&&this.trigger("languagechange"))}languages(){return Da(bc.prototype.options_.languages,this.languages_)}toJSON(){const e=Da(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let n=t[i];n=Da(n),n.player=void 0,e.tracks[i]=n}return e}createModal(e,t){(t=t||{}).content=e||"";const i=new Jl(this,t);return this.addChild(i),i.on("dispose",(()=>{this.removeChild(i)})),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<fc.length;i++){const n=fc[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(yc[e]),this.addClass(yc[n]),this.breakpoint_=n;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},vc,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;return(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return yc[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const i=this.crossOrigin();this.reset(),this.cache_.media=Da(e);const{artist:n,artwork:r,description:s,poster:a,src:o,textTracks:l,title:u}=this.cache_.media;!r&&a&&(this.cache_.media.artwork=[{src:a,type:Du(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:u,description:s||n||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Du(t.poster)}]),t}return Da(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=To(e),n=i["data-setup"];if(fo(e,"vjs-fill")&&(i.fill=!0),fo(e,"vjs-fluid")&&(i.fluid=!0),null!==n)try{Object.assign(i,JSON.parse(n||"{}"))}catch(e){Ea.error("data-setup",e)}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,n=i.length;e<n;e++){const n=i[e],r=n.nodeName.toLowerCase();"source"===r?t.sources.push(To(n)):"track"===r&&t.tracks.push(To(n))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((e=>"number"==typeof e))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}_u.names.forEach((function(e){const t=_u[e];bc.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),bc.prototype.crossorigin=bc.prototype.crossOrigin,bc.players={};const _c=Ne.navigator;bc.prototype.options_={techOrder:Tu.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:_c&&(_c.languages&&_c.languages[0]||_c.userLanguage||_c.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1},mc.forEach((function(e){bc.prototype[`handleTech${Il(e)}_`]=function(){return this.trigger(e)}})),Pl.registerComponent("Player",bc);const Tc="plugin",Ac="activePlugins_",Sc={},wc=e=>Sc.hasOwnProperty(e),Ec=e=>wc(e)?Sc[e]:void 0,xc=(e,t)=>{e[Ac]=e[Ac]||{},e[Ac][t]=!0},Cc=(e,t,i)=>{const n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},kc=(e,t)=>(t.prototype.name=e,function(...i){Cc(this,{name:e,plugin:t,instance:null},!0);const n=new t(...[this,...i]);return this[e]=()=>n,Cc(this,n.getEventHash()),n});class Ic{constructor(e){if(this.constructor===Ic)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),El(this),delete this.trigger,Cl(this,this.constructor.defaultState),xc(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return sl(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Ac][e]=!1,this.player=this.state=null,t[e]=kc(e,Sc[e])}static isBasic(e){const t="string"==typeof e?Ec(e):e;return"function"==typeof t&&!Ic.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(wc(e))Ea.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(bc.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Sc[e]=t,e!==Tc&&(Ic.isBasic(t)?bc.prototype[e]=function(e,t){const i=function(){Cc(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return xc(this,e),Cc(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(e,t):bc.prototype[e]=kc(e,t)),t}static deregisterPlugin(e){if(e===Tc)throw new Error("Cannot de-register base plugin.");wc(e)&&(delete Sc[e],delete bc.prototype[e])}static getPlugins(e=Object.keys(Sc)){let t;return e.forEach((e=>{const i=Ec(e);i&&(t=t||{},t[e]=i)})),t}static getPluginVersion(e){const t=Ec(e);return t&&t.VERSION||""}}function Lc(e,t,i,n){return function(e,t){let i=!1;return function(...n){return i||Ea.warn(e),i=!0,t.apply(this,n)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n)}Ic.getPlugin=Ec,Ic.BASE_PLUGIN_NAME=Tc,Ic.registerPlugin(Tc,Ic),bc.prototype.usingPlugin=function(e){return!!this[Ac]&&!0===this[Ac][e]},bc.prototype.hasPlugin=function(e){return!!wc(e)};const Oc=e=>0===e.indexOf("#")?e.slice(1):e;function Pc(e,t,i){let n=Pc.getPlayer(e);if(n)return t&&Ea.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&n.ready(i),n;const r="string"==typeof e?Ro("#"+Oc(e)):e;if(!uo(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const s="getRootNode"in r&&r.getRootNode()instanceof Ne.ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&s.contains(r)||Ea.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),va("beforesetup").forEach((e=>{const i=e(r,Da(t));Oa(i)&&!Array.isArray(i)?t=Da(t,i):Ea.error("please return an object in beforesetup hooks")}));const a=Pl.getComponent("Player");return n=new a(r,t,i),va("setup").forEach((e=>e(n))),n}if(Pc.hooks_=ya,Pc.hooks=va,Pc.hook=function(e,t){va(e,t)},Pc.hookOnce=function(e,t){va(e,[].concat(t).map((t=>{const i=(...n)=>(ba(e,i),t(...n));return i})))},Pc.removeHook=ba,!0!==Ne.VIDEOJS_NO_DYNAMIC_STYLE&&lo()){let kf=Ro(".vjs-styles-defaults");if(!kf){kf=Wo("vjs-styles-defaults");const If=Ro("head");If&&If.insertBefore(kf,If.firstChild),Go(kf,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}zo(1,Pc),Pc.VERSION=fa,Pc.options=bc.prototype.options_,Pc.getPlayers=()=>bc.players,Pc.getPlayer=e=>{const t=bc.players;let i;if("string"==typeof e){const n=Oc(e),r=t[n];if(r)return r;i=Ro("#"+n)}else i=e;if(uo(i)){const{player:e,playerId:n}=i;if(e||t[n])return e||t[n]}},Pc.getAllPlayers=()=>Object.keys(bc.players).map((e=>bc.players[e])).filter(Boolean),Pc.players=bc.players,Pc.getComponent=Pl.getComponent,Pc.registerComponent=(e,t)=>(Tu.isTech(t)&&Ea.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Pl.registerComponent.call(Pl,e,t)),Pc.getTech=Tu.getTech,Pc.registerTech=Tu.registerTech,Pc.use=function(e,t){Au[e]=Au[e]||[],Au[e].push(t)},Object.defineProperty(Pc,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Pc.middleware,"TERMINATOR",{value:wu,writeable:!1,enumerable:!0}),Pc.browser=ao,Pc.obj=Ra,Pc.mergeOptions=Lc(9,"videojs.mergeOptions","videojs.obj.merge",Da),Pc.defineLazyProperty=Lc(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Na),Pc.bind=Lc(9,"videojs.bind","native Function.prototype.bind",dl),Pc.registerPlugin=Ic.registerPlugin,Pc.deregisterPlugin=Ic.deregisterPlugin,Pc.plugin=(e,t)=>(Ea.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ic.registerPlugin(e,t)),Pc.getPlugins=Ic.getPlugins,Pc.getPlugin=Ic.getPlugin,Pc.getPluginVersion=Ic.getPluginVersion,Pc.addLanguage=function(e,t){return e=(""+e).toLowerCase(),Pc.options.languages=Da(Pc.options.languages,{[e]:t}),Pc.options.languages[e]},Pc.log=Ea,Pc.createLogger=xa,Pc.time=Fl,Pc.createTimeRange=Lc(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Nl),Pc.createTimeRanges=Lc(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Nl),Pc.formatTime=Lc(9,"videojs.formatTime","videojs.time.formatTime",jl),Pc.setFormatTime=Lc(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ul),Pc.resetFormatTime=Lc(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ql),Pc.parseUrl=Lc(9,"videojs.parseUrl","videojs.url.parseUrl",ou),Pc.isCrossOrigin=Lc(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",du),Pc.EventTarget=gl,Pc.any=ol,Pc.on=nl,Pc.one=al,Pc.off=rl,Pc.trigger=sl,Pc.xhr=lt,Pc.TextTrack=mu,Pc.AudioTrack=gu,Pc.VideoTrack=fu,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{Pc[e]=function(){return Ea.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),jo[e].apply(null,arguments)}})),Pc.computedStyle=Lc(9,"videojs.computedStyle","videojs.dom.computedStyle",Uo),Pc.dom=jo,Pc.fn=pl,Pc.num=id,Pc.str=Ol,Pc.url=cu,Pc.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};
22
+ */const fa={},ya=function(e,t){return fa[e]=fa[e]||[],t&&(fa[e]=fa[e].concat(t)),fa[e]},va=function(e,t){const i=ya(e).indexOf(t);return!(i<=-1)&&(fa[e]=fa[e].slice(),fa[e].splice(i,1),!0)},ba={prefixed:!0},Ta=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],_a=Ta[0];let Aa;for(let Ef=0;Ef<Ta.length;Ef++)if(Ta[Ef][1]in Ue){Aa=Ta[Ef];break}if(Aa){for(let xf=0;xf<Aa.length;xf++)ba[_a[xf]]=Aa[xf];ba.prefixed=Aa[0]!==_a[0]}let Sa=[];const wa=function e(t,i=":",n=""){let r,s="info";function a(...e){r("log",s,e)}return r=((e,t,i)=>(n,r,s)=>{const a=t.levels[r],o=new RegExp(`^(${a})$`);let l=e;if("log"!==n&&s.unshift(n.toUpperCase()+":"),i&&(l=`%c${e}`,s.unshift(i)),s.unshift(l+":"),Sa){Sa.push([].concat(s));const e=Sa.length-1e3;Sa.splice(0,e>0?e:0)}if(!Me.console)return;let u=Me.console[n];u||"debug"!==n||(u=Me.console.info||Me.console.log),u&&a&&o.test(n)&&u[Array.isArray(s)?"apply":"call"](Me.console,s)})(t,a,n),a.createLogger=(r,s,a)=>{const o=void 0!==s?s:i;return e(`${t} ${o} ${r}`,o,void 0!==a?a:n)},a.createNewLogger=(t,i,n)=>e(t,i,n),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);s=e}return s},a.history=()=>Sa?[].concat(Sa):[],a.history.filter=e=>(Sa||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),a.history.clear=()=>{Sa&&(Sa.length=0)},a.history.disable=()=>{null!==Sa&&(Sa.length=0,Sa=null)},a.history.enable=()=>{null===Sa&&(Sa=[])},a.error=(...e)=>r("error",s,e),a.warn=(...e)=>r("warn",s,e),a.debug=(...e)=>r("debug",s,e),a}("VIDEOJS"),Ea=wa.createLogger,xa=Object.prototype.toString,Ca=function(e){return La(e)?Object.keys(e):[]};function ka(e,t){Ca(e).forEach((i=>t(e[i],i)))}function Ia(e,t,i=0){return Ca(e).reduce(((i,n)=>t(i,e[n],n)),i)}function La(e){return!!e&&"object"==typeof e}function Oa(e){return La(e)&&"[object Object]"===xa.call(e)&&e.constructor===Object}function Pa(...e){const t={};return e.forEach((e=>{e&&ka(e,((e,i)=>{Oa(e)?(Oa(t[i])||(t[i]={}),t[i]=Pa(t[i],e)):t[i]=e}))})),t}function Da(e={}){const t=[];for(const i in e)if(e.hasOwnProperty(i)){const n=e[i];t.push(n)}return t}function Ma(e,t,i,n=!0){const r=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){const e=i();return r(e),e}};return n&&(s.set=r),Object.defineProperty(e,t,s)}var Na=Object.freeze({__proto__:null,each:ka,reduce:Ia,isObject:La,isPlain:Oa,merge:Pa,values:Da,defineLazyProperty:Ma});let Ra,Ba=!1,Ua=null,Fa=!1,ja=!1,qa=!1,Ha=!1,Va=!1,Xa=null,za=null;const Wa=Boolean(Me.cast&&Me.cast.framework&&Me.cast.framework.CastReceiverContext);let Ga=null,Ya=!1,Ka=!1,Ja=!1,Qa=!1,Za=!1,$a=!1,eo=!1;const to=Boolean(oo()&&("ontouchstart"in Me||Me.navigator.maxTouchPoints||Me.DocumentTouch&&Me.document instanceof Me.DocumentTouch)),io=Me.navigator&&Me.navigator.userAgentData;if(io&&io.platform&&io.brands&&(Fa="Android"===io.platform,qa=Boolean(io.brands.find((e=>"Microsoft Edge"===e.brand))),Ha=Boolean(io.brands.find((e=>"Chromium"===e.brand))),Va=!qa&&Ha,Xa=za=(io.brands.find((e=>"Chromium"===e.brand))||{}).version||null,Ka="Windows"===io.platform),!Ha){const Cf=Me.navigator&&Me.navigator.userAgent||"";Ba=/iPod/i.test(Cf),Ua=function(){const e=Cf.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Fa=/Android/i.test(Cf),Ra=function(){const e=Cf.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),ja=/Firefox/i.test(Cf),qa=/Edg/i.test(Cf),Ha=/Chrome/i.test(Cf)||/CriOS/i.test(Cf),Va=!qa&&Ha,Xa=za=function(){const e=Cf.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ga=function(){const e=/MSIE\s(\d+)\.\d/.exec(Cf);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Cf)&&/rv:11.0/.test(Cf)&&(t=11),t}(),Za=/Tizen/i.test(Cf),$a=/Web0S/i.test(Cf),eo=Za||$a,Ya=/Safari/i.test(Cf)&&!Va&&!Fa&&!qa&&!eo,Ka=/Windows/i.test(Cf),Ja=/iPad/i.test(Cf)||Ya&&to&&!/iPhone/i.test(Cf),Qa=/iPhone/i.test(Cf)&&!Ja}const no=Qa||Ja||Ba,ro=(Ya||no)&&!Va;var so=Object.freeze({__proto__:null,get IS_IPOD(){return Ba},get IOS_VERSION(){return Ua},get IS_ANDROID(){return Fa},get ANDROID_VERSION(){return Ra},get IS_FIREFOX(){return ja},get IS_EDGE(){return qa},get IS_CHROMIUM(){return Ha},get IS_CHROME(){return Va},get CHROMIUM_VERSION(){return Xa},get CHROME_VERSION(){return za},IS_CHROMECAST_RECEIVER:Wa,get IE_VERSION(){return Ga},get IS_SAFARI(){return Ya},get IS_WINDOWS(){return Ka},get IS_IPAD(){return Ja},get IS_IPHONE(){return Qa},get IS_TIZEN(){return Za},get IS_WEBOS(){return $a},get IS_SMART_TV(){return eo},TOUCH_ENABLED:to,IS_IOS:no,IS_ANY_SAFARI:ro});function ao(e){return"string"==typeof e&&Boolean(e.trim())}function oo(){return Ue===Me.document}function lo(e){return La(e)&&1===e.nodeType}function uo(){try{return Me.parent!==Me.self}catch(e){return!0}}function co(e){return function(t,i){if(!ao(t))return Ue[e](null);ao(i)&&(i=Ue.querySelector(i));const n=lo(i)?i:Ue;return n[e]&&n[e](t)}}function ho(e="div",t={},i={},n){const r=Ue.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const i=t[e];"textContent"===e?po(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&Po(r,n),r}function po(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function mo(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function go(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function fo(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function yo(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(wa.warn("removeClass was called with an element that doesn't exist"),null)}function vo(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,i))),e}function bo(e,t){Object.getOwnPropertyNames(t).forEach((function(i){const n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function To(e){const t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const n=e.attributes;for(let e=n.length-1;e>=0;e--){const r=n[e].name;let s=n[e].value;i.includes(r)&&(s=null!==s),t[r]=s}}return t}function _o(e,t){return e.getAttribute(t)}function Ao(e,t,i){e.setAttribute(t,i)}function So(e,t){e.removeAttribute(t)}function wo(){Ue.body.focus(),Ue.onselectstart=function(){return!1}}function Eo(){Ue.onselectstart=function(){return!0}}function xo(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Bo(e,"height"))),i.width||(i.width=parseFloat(Bo(e,"width"))),i}}function Co(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let n=0,r=0;for(;e.offsetParent&&e!==Ue[ba.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function ko(e,t){const i={x:0,y:0};if(no){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Bo(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&Me.WebKitCSSMatrix){const e=Me.getComputedStyle(t.assignedSlot.parentElement).transform,n=new Me.WebKitCSSMatrix(e);i.x+=n.m41,i.y+=n.m42}t=t.parentNode||t.host}}const n={},r=Co(t.target),s=Co(e),a=s.width,o=s.height;let l=t.offsetY-(s.top-r.top),u=t.offsetX-(s.left-r.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-s.left,l=t.changedTouches[0].pageY+s.top,no&&(u-=i.x,l-=i.y)),n.y=1-Math.max(0,Math.min(1,l/o)),n.x=Math.max(0,Math.min(1,u/a)),n}function Io(e){return La(e)&&3===e.nodeType}function Lo(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Oo(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),lo(e)||Io(e)?e:"string"==typeof e&&/\S/.test(e)?Ue.createTextNode(e):void 0))).filter((e=>e))}function Po(e,t){return Oo(t).forEach((t=>e.appendChild(t))),e}function Do(e,t){return Po(Lo(e),t)}function Mo(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||("mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons)))}const No=co("querySelector"),Ro=co("querySelectorAll");function Bo(e,t){if(!e||!t)return"";if("function"==typeof Me.getComputedStyle){let i;try{i=Me.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function Uo(e){[...Ue.styleSheets].forEach((t=>{try{const i=[...t.cssRules].map((e=>e.cssText)).join(""),n=Ue.createElement("style");n.textContent=i,e.document.head.appendChild(n)}catch(i){const n=Ue.createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}}))}var Fo=Object.freeze({__proto__:null,isReal:oo,isEl:lo,isInFrame:uo,createEl:ho,textContent:po,prependTo:mo,hasClass:go,addClass:fo,removeClass:yo,toggleClass:vo,setAttributes:bo,getAttributes:To,getAttribute:_o,setAttribute:Ao,removeAttribute:So,blockTextSelection:wo,unblockTextSelection:Eo,getBoundingClientRect:xo,findPosition:Co,getPointerPosition:ko,isTextNode:Io,emptyEl:Lo,normalizeContent:Oo,appendContent:Po,insertContent:Do,isSingleLeftClick:Mo,$:No,$$:Ro,computedStyle:Bo,copyStyleSheetsToWindow:Uo});let jo,qo=!1;const Ho=function(){if(!1===jo.options.autoSetup)return;const e=Array.prototype.slice.call(Ue.getElementsByTagName("video")),t=Array.prototype.slice.call(Ue.getElementsByTagName("audio")),i=Array.prototype.slice.call(Ue.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(let e=0,t=n.length;e<t;e++){const t=n[e];if(!t||!t.getAttribute){Vo(1);break}if(void 0===t.player){null!==t.getAttribute("data-setup")&&jo(t)}}else qo||Vo(1)};function Vo(e,t){oo()&&(t&&(jo=t),Me.setTimeout(Ho,e))}function Xo(){qo=!0,Me.removeEventListener("load",Xo)}oo()&&("complete"===Ue.readyState?Xo():Me.addEventListener("load",Xo));const zo=function(e){const t=Ue.createElement("style");return t.className=e,t},Wo=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Go=new WeakMap;let Yo,Ko=3;function Jo(){return Ko++}function Qo(e,t){if(!Go.has(e))return;const i=Go.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Go.delete(e)}function Zo(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function $o(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const n=e||Me.event;e={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const t in n)r.includes(t)||"returnValue"===t&&n.preventDefault||(e[t]=n[t]);if(e.target||(e.target=e.srcElement||Ue),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=Ue.documentElement,i=Ue.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const el=function(){if("boolean"!=typeof Yo){Yo=!1;try{const e=Object.defineProperty({},"passive",{get(){Yo=!0}});Me.addEventListener("test",null,e),Me.removeEventListener("test",null,e)}catch(e){}}return Yo},tl=["touchstart","touchmove"];function il(e,t,i){if(Array.isArray(t))return Zo(il,e,t,i);Go.has(e)||Go.set(e,{});const n=Go.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=Jo()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(n.disabled)return;t=$o(t);const r=n.handlers[t.type];if(r){const n=r.slice(0);for(let r=0,s=n.length;r<s&&!t.isImmediatePropagationStopped();r++)try{n[r].call(e,t,i)}catch(e){wa.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){let i=!1;el()&&tl.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function nl(e,t,i){if(!Go.has(e))return;const n=Go.get(e);if(!n.handlers)return;if(Array.isArray(t))return Zo(nl,e,t,i);const r=function(e,t){n.handlers[t]=[],Qo(e,t)};if(void 0===t){for(const t in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},t)&&r(e,t);return}const s=n.handlers[t];if(s)if(i){if(i.guid)for(let e=0;e<s.length;e++)s[e].guid===i.guid&&s.splice(e--,1);Qo(e,t)}else r(e,t)}function rl(e,t,i){const n=Go.has(e)?Go.get(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=$o(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)rl.call(null,r,t,i);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){Go.has(t.target)||Go.set(t.target,{});const e=Go.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function sl(e,t,i){if(Array.isArray(t))return Zo(sl,e,t,i);const n=function(){nl(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Jo(),il(e,t,n)}function al(e,t,i){const n=function(){nl(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Jo(),il(e,t,n)}var ol=Object.freeze({__proto__:null,fixEvent:$o,on:il,off:nl,trigger:rl,one:sl,any:al});const ll=30,ul=function(e,t,i){t.guid||(t.guid=Jo());const n=t.bind(e);return n.guid=i?i+"_"+t.guid:t.guid,n},dl=function(e,t){let i=Me.performance.now();return function(...n){const r=Me.performance.now();r-i>=t&&(e(...n),i=r)}},cl=function(e,t,i,n=Me){let r;const s=function(){const s=this,a=arguments;let o=function(){r=null,o=null,i||e.apply(s,a)};!r&&i&&e.apply(s,a),n.clearTimeout(r),r=n.setTimeout(o,t)};return s.cancel=()=>{n.clearTimeout(r),r=null},s};var hl=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:ll,bind_:ul,throttle:dl,debounce:cl});let pl;class ml{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},il(this,e,t),this.addEventListener=i}off(e,t){nl(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},sl(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},al(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=$o(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),rl(this,e)}queueTrigger(e){pl||(pl=new Map);const t=e.type||e;let i=pl.get(this);i||(i=new Map,pl.set(this,i));const n=i.get(t);i.delete(t),Me.clearTimeout(n);const r=Me.setTimeout((()=>{i.delete(t),0===i.size&&(i=null,pl.delete(this)),this.trigger(e)}),0);i.set(t,r)}}ml.prototype.allowedEvents_={},ml.prototype.addEventListener=ml.prototype.on,ml.prototype.removeEventListener=ml.prototype.off,ml.prototype.dispatchEvent=ml.prototype.trigger;const gl=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,fl=e=>e instanceof ml||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),yl=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,vl=(e,t,i)=>{if(!e||!e.nodeName&&!fl(e))throw new Error(`Invalid target for ${gl(t)}#${i}; must be a DOM node or evented object.`)},bl=(e,t,i)=>{if(!yl(e))throw new Error(`Invalid event type for ${gl(t)}#${i}; must be a non-empty string or array.`)},Tl=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${gl(t)}#${i}; must be a function.`)},_l=(e,t,i)=>{const n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let r,s,a;return n?(r=e.eventBusEl_,t.length>=3&&t.shift(),[s,a]=t):(r=t[0],s=t[1],a=t[2]),vl(r,e,i),bl(s,e,i),Tl(a,e,i),a=ul(e,a),{isTargetingSelf:n,target:r,type:s,listener:a}},Al=(e,t,i,n)=>{vl(e,e,t),e.nodeName?ol[t](e,i,n):e[t](i,n)},Sl={on(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=_l(this,e,"on");if(Al(i,"on",n,r),!t){const e=()=>this.off(i,n,r);e.guid=r.guid;const t=()=>this.off("dispose",e);t.guid=r.guid,Al(this,"on","dispose",e),Al(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=_l(this,e,"one");if(t)Al(i,"one",n,r);else{const e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Al(i,"one",n,e)}},any(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=_l(this,e,"any");if(t)Al(i,"any",n,r);else{const e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Al(i,"any",n,e)}},off(e,t,i){if(!e||yl(e))nl(this.eventBusEl_,e,t);else{const n=e,r=t;vl(n,this,"off"),bl(r,this,"off"),Tl(i,this,"off"),i=ul(this,i),this.off("dispose",i),n.nodeName?(nl(n,r,i),nl(n,"dispose",i)):fl(n)&&(n.off(r,i),n.off("dispose",i))}},trigger(e,t){vl(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!yl(i))throw new Error(`Invalid event type for ${gl(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return rl(this.eventBusEl_,e,t)}};function wl(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=ho("span",{className:"vjs-event-bus"});return Object.assign(e,Sl),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Go.has(e)&&Go.delete(e)})),Me.setTimeout((()=>{e.eventBusEl_=null}),0)})),e}const El={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),ka(e,((e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e})),t&&fl(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function xl(e,t){return Object.assign(e,El),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&fl(e)&&e.on("statechanged",e.handleStateChanged),e}const Cl=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},kl=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},Il=function(e,t){return kl(e)===kl(t)};var Ll=Object.freeze({__proto__:null,toLowerCase:Cl,toTitleCase:kl,titleCaseEquals:Il});class Ol{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Pa({},this.options_),t=this.options_=Pa(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Jo()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),["on","off","one","any","trigger"].forEach((e=>{this[e]=void 0})),!1!==t.evented&&(wl(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),xl(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=Pa(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ho(e,t,i)}localize(e,t,i=e){const n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a];let l=i;return s&&s[e]?l=s[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){const n=t[i-1];let r=n;return void 0===n&&(r=e),r}))),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",n=ho("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),r=Ue.createElementNS(i,"svg");r.setAttributeNS(null,"viewBox","0 0 512 512");const s=Ue.createElementNS(i,"use");return r.appendChild(s),s.setAttributeNS(null,"href",`#vjs-icon-${e}`),n.appendChild(r),this.iconIsSet_?t.replaceChild(n,t.querySelector(".vjs-icon-placeholder")):t.appendChild(n),this.iconIsSet_=!0,n}addChild(e,t={},i=this.children_.length){let n,r;if("string"==typeof e){r=kl(e);const i=t.componentClass||r;t.name=r;const s=Ol.getComponent(i);if(!s)throw new Error(`Component ${i} does not exist`);if("function"!=typeof s)return null;n=new s(this.player_||this,t)}else n=e;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(i,0,n),n.parentComponent_=this,"function"==typeof n.id&&(this.childIndex_[n.id()]=n),r=r||n.name&&kl(n.name()),r&&(this.childNameIndex_[r]=n,this.childNameIndex_[Cl(r)]=n),"function"==typeof n.el&&n.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:lo(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(n.el(),e)}return n}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[kl(e.name())]=null,this.childNameIndex_[Cl(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let n=e.opts;if(void 0!==t[i]&&(n=t[i]),!1===n)return;!0===n&&(n={}),n.playerOptions=this.options_.playerOptions;const r=this.addChild(i,n);r&&(this[i]=r)};let n;const r=Ol.getComponent("Tech");n=Array.isArray(e)?e:Object.keys(e),n.concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let i,n;return"string"==typeof t?(i=t,n=e[i]||this.options_[i]||{}):(i=t.name,n=t),{name:i,opts:n}})).filter((e=>{const t=Ol.getComponent(e.opts.componentClass||kl(e.name));return t&&!r.isTech(t)})).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return No(e,t||this.contentEl())}$$(e,t){return Ro(e,t||this.contentEl())}hasClass(e){return go(this.el_,e)}addClass(...e){fo(this.el_,...e)}removeClass(...e){yo(this.el_,...e)}toggleClass(e,t){vo(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return _o(this.el_,e)}setAttribute(e,t){Ao(this.el_,e,t)}removeAttribute(e){So(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+kl(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Bo(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${kl(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;let i;this.on("touchstart",(function(n){1===n.touches.length&&(t={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},e=Me.performance.now(),i=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)i=!1;else if(t){const n=e.touches[0].pageX-t.pageX,r=e.touches[0].pageY-t.pageY;Math.sqrt(n*n+r*r)>10&&(i=!1)}}));const n=function(){i=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){if(t=null,!0===i){Me.performance.now()-e<200&&(n.preventDefault(),this.trigger("tap"))}}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=ul(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=ul(this,e),this.clearTimersOnDispose_(),i=Me.setTimeout((()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),Me.clearTimeout(e)),e}setInterval(e,t){e=ul(this,e),this.clearTimersOnDispose_();const i=Me.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),Me.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=ul(this,e),t=Me.requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=ul(this,t);const i=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}));return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),Me.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,i)=>this[t](i)))})),this.clearingTimersOnDispose_=!1})))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){const t=Me.getComputedStyle(e,null),i=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return e||(e=this.el()),!!(function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;const t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0)return!1;if(t.x>(Ue.documentElement.clientWidth||Me.innerWidth))return!1;if(t.y<0)return!1;if(t.y>(Ue.documentElement.clientHeight||Me.innerHeight))return!1;let i=Ue.elementFromPoint(t.x,t.y);for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(e)&&(i=e,t(i.parentElement)&&t(i)&&"0"!==i.style.opacity&&"0px"!==Me.getComputedStyle(i).height&&"0px"!==Me.getComputedStyle(i).width)&&(!e.parentElement||e.tabIndex>=0));var i}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Ol.getComponent("Tech"),n=i&&i.isTech(t),r=Ol===t||Ol.prototype.isPrototypeOf(t.prototype);if(n||!r){let t;throw t=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=kl(e),Ol.components_||(Ol.components_={});const s=Ol.getComponent("Player");if("Player"===e&&s&&s.players){const e=s.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Ol.components_[e]=t,Ol.components_[Cl(e)]=t,t}static getComponent(e){if(e&&Ol.components_)return Ol.components_[e]}}function Pl(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,n,i.length-1),i[n][t]}function Dl(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Pl.bind(null,"start",0,e),end:Pl.bind(null,"end",1,e)},Me.Symbol&&Me.Symbol.iterator&&(t[Me.Symbol.iterator]=()=>(e||[]).values()),t}function Ml(e,t){return Array.isArray(e)?Dl(e):void 0===e||void 0===t?Dl():Dl([[e,t]])}Ol.registerComponent("Component",Ol);const Nl=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600);const s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),r=r>0||a>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i};let Rl=Nl;function Bl(e){Rl=e}function Ul(){Rl=Nl}function Fl(e,t=e){return Rl(e,t)}var jl=Object.freeze({__proto__:null,createTimeRanges:Ml,createTimeRange:Ml,setFormatTime:Bl,resetFormatTime:Ul,formatTime:Fl});function ql(e,t){let i,n,r=0;if(!t)return 0;e&&e.length||(e=Ml(0,0));for(let s=0;s<e.length;s++)i=e.start(s),n=e.end(s),n>t&&(n=t),r+=n-i;return r/t}function Hl(e){if(e instanceof Hl)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:La(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Hl.defaultMessages[this.code]||"")}function Vl(e){return null!=e&&"function"==typeof e.then}function Xl(e){Vl(e)&&e.then(null,(e=>{}))}Hl.prototype.code=0,Hl.prototype.message="",Hl.prototype.status=null,Hl.prototype.metadata=null,Hl.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Hl.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Hl.MEDIA_ERR_CUSTOM=0,Hl.prototype.MEDIA_ERR_CUSTOM=0,Hl.MEDIA_ERR_ABORTED=1,Hl.prototype.MEDIA_ERR_ABORTED=1,Hl.MEDIA_ERR_NETWORK=2,Hl.prototype.MEDIA_ERR_NETWORK=2,Hl.MEDIA_ERR_DECODE=3,Hl.prototype.MEDIA_ERR_DECODE=3,Hl.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Hl.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Hl.MEDIA_ERR_ENCRYPTED=5,Hl.prototype.MEDIA_ERR_ENCRYPTED=5;const zl=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,i,n)=>(e[i]&&(t[i]=e[i]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})};var Wl=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=zl(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(zl))},Gl=function(e,t){return e.forEach((function(e){const i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>i.addCue(e)))})),t.textTracks()};const Yl="vjs-modal-dialog";class Kl extends Ol{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ho("div",{className:`${Yl}-content`},{role:"document"}),this.descEl_=ho("p",{className:`${Yl}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),po(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Yl} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Do(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);const r=this.getChild("closeButton");r&&i.appendChild(r.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Lo(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=Ue.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())return e.preventDefault(),void this.close();if("Tab"!==e.key)return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let e=0;e<t.length;e++)if(i===t[e]){n=e;break}Ue.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof Me.HTMLAnchorElement||e instanceof Me.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof Me.HTMLInputElement||e instanceof Me.HTMLSelectElement||e instanceof Me.HTMLTextAreaElement||e instanceof Me.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof Me.HTMLIFrameElement||e instanceof Me.HTMLObjectElement||e instanceof Me.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}Kl.prototype.options_={pauseOnOpen:!0,temporary:!0},Ol.registerComponent("ModalDialog",Kl);class Jl extends ml{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},fl(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}Jl.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const kf in Jl.prototype.allowedEvents_)Jl.prototype["on"+kf]=null;const Ql=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};const Zl=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class $l extends Jl{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class eu{constructor(e){eu.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const n=e.length;this.cues_=e,this.length_=e.length;const r=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const tu={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},iu={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},nu={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ru={disabled:"disabled",hidden:"hidden",showing:"showing"};class su extends ml{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Jo(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const au=function(e){return new URL(e,Ue.baseURI)},ou=function(e){return new URL(e,Ue.baseURI).href},lu=function(e){if("string"==typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},uu=function(e,t=Me.location){return au(e).origin!==t.origin};var du=Object.freeze({__proto__:null,parseUrl:au,getAbsoluteURL:ou,getFileExtension:lu,isCrossOrigin:uu});const cu=function(e,t){const i=new Me.WebVTT.Parser(Me,Me.vttjs,Me.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(Me.console&&Me.console.groupCollapsed&&Me.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),n.forEach((e=>wa.error(e))),Me.console&&Me.console.groupEnd&&Me.console.groupEnd()),i.flush()},hu=function(e,t){const i={uri:e},n=uu(e);n&&(i.cors=n);const r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),ot(i,ul(this,(function(e,i,n){if(e)return wa.error(e,i);t.loaded_=!0,"function"!=typeof Me.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return cu(n,t);wa.error(`vttjs failed to load, stopping trying to process ${t.src}`)})):cu(n,t)})))};class pu extends su{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Pa(e,{kind:nu[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=ru[t.mode]||"disabled";const n=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const r=new eu(this.cues_),s=new eu(this.activeCues_);let a=!1;this.timeupdateHandler=ul(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}));this.tech_.one("dispose",(()=>{this.stopTracking()})),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>n,set(){}},mode:{get:()=>i,set(e){ru[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||hu(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?r:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return s;const e=this.tech_.currentTime(),t=[];for(let i=0,n=this.cues.length;i<n;i++){const n=this.cues[i];n.startTime<=e&&n.endTime>=e&&t.push(n)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,s.setCues_(this.activeCues_),s},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&hu(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new Me.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}pu.prototype.allowedEvents_={cuechange:"cuechange"};class mu extends su{constructor(e={}){const t=Pa(e,{kind:iu[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class gu extends su{constructor(e={}){const t=Pa(e,{kind:tu[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class fu extends ml{constructor(e={}){let t;super();const i=new pu(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=fu.NONE,i.addEventListener("loadeddata",(()=>{t=fu.LOADED,this.trigger({type:"load",target:this})}))}}fu.prototype.allowedEvents_={load:"load"},fu.NONE=0,fu.LOADING=1,fu.LOADED=2,fu.ERROR=3;const yu={audio:{ListClass:class extends Jl{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Ql(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ql(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ql(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:mu,capitalName:"Audio"},video:{ListClass:class extends Jl{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Zl(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&Zl(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Zl(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:gu,capitalName:"Video"},text:{ListClass:$l,TrackClass:pu,capitalName:"Text"}};Object.keys(yu).forEach((function(e){yu[e].getterName=`${e}Tracks`,yu[e].privateName=`${e}Tracks_`}));const vu={remoteText:{ListClass:$l,TrackClass:pu,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:fu,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},bu=Object.assign({},yu,vu);vu.names=Object.keys(vu),yu.names=Object.keys(yu),bu.names=[].concat(vu.names).concat(yu.names);class Tu extends Ol{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),bu.names.forEach((t=>{const i=bu[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new bu.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(e)),1))),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ul(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ml(0,0)}bufferedPercent(){return ql(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(yu.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach((e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const n=t[i];"text"===e&&this.removeRemoteTextTrack(n),t.removeTrack(n)}}))}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Hl(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ml(0,0):Ml()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){yu.names.forEach((e=>{const t=yu[e],i=()=>{this.trigger(`${e}trackchange`)},n=this[t.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.on("dispose",(()=>{n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)}))}))}addWebVttScript_(){if(!Me.WebVTT)if(Ue.body.contains(this.el())){if(!this.options_["vtt.js"]&&Oa(zt)&&Object.keys(zt).length>0)return void this.trigger("vttjsloaded");const e=Ue.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",(()=>{e.onload=null,e.onerror=null})),Me.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),n=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_();const r=()=>this.trigger("texttrackchange"),s=()=>{r();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",r),"showing"===i.mode&&i.addEventListener("cuechange",r)}};s(),e.addEventListener("change",s),e.addEventListener("addtrack",s),e.addEventListener("removetrack",s),this.on("dispose",(function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",s),e.removeEventListener("addtrack",s),e.removeEventListener("removetrack",s);for(let t=0;t<e.length;t++){e[t].removeEventListener("cuechange",r)}}))}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r={}){const s=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;const a=new bu.text.TrackClass(r);return s.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){const t=Pa(e,{tech:this});return new vu.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track))),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Jo();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",(()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())}))):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Tu.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Tu||e instanceof Tu||e===Tu}static registerTech(e,t){if(Tu.techs_||(Tu.techs_={}),!Tu.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Tu.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Tu.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=kl(e),Tu.techs_[e]=t,Tu.techs_[Cl(e)]=t,"Tech"!==e&&Tu.defaultTechOrder_.push(e),t}static getTech(e){if(e)return Tu.techs_&&Tu.techs_[e]?Tu.techs_[e]:(e=kl(e),Me&&Me.videojs&&Me.videojs[e]?(wa.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),Me.videojs[e]):void 0)}}bu.names.forEach((function(e){const t=bu[e];Tu.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Tu.prototype.featuresVolumeControl=!0,Tu.prototype.featuresMuteControl=!0,Tu.prototype.featuresFullscreenResize=!1,Tu.prototype.featuresPlaybackRate=!1,Tu.prototype.featuresProgressEvents=!1,Tu.prototype.featuresSourceset=!1,Tu.prototype.featuresTimeupdateEvents=!1,Tu.prototype.featuresNativeTextTracks=!1,Tu.prototype.featuresVideoFrameCallback=!1,Tu.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){const i=e.sourceHandlers||[];let n;for(let e=0;e<i.length;e++)if(n=i[e].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){const n=e.sourceHandlers||[];let r;for(let e=0;e<n.length;e++)if(r=n[e].canHandleSource(t,i),r)return n[e];return null},e.canPlaySource=function(t,i){const n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach((function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:wa.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Ol.registerComponent("Tech",Tu),Tu.registerTech("Tech",Tu),Tu.defaultTechOrder_=[];const _u={},Au={},Su={};function wu(e,t,i){e.setTimeout((()=>Lu(t,_u[t.type],i,e)),1)}function Eu(e,t,i,n=null){const r="call"+kl(i),s=e.reduce(Iu(r),n),a=s===Su,o=a?null:t[i](s);return function(e,t,i,n){for(let r=e.length-1;r>=0;r--){const s=e[r];s[t]&&s[t](n,i)}}(e,i,o,a),o}const xu={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Cu={setCurrentTime:1,setMuted:1,setVolume:1},ku={play:1,pause:1};function Iu(e){return(t,i)=>t===Su?Su:i[e]?i[e](t):t}function Lu(e={},t=[],i,n,r=[],s=!1){const[a,...o]=t;if("string"==typeof a)Lu(e,_u[a],i,n,r,s);else if(a){const t=function(e,t){const i=Au[e.id()];let n=null;if(null==i)return n=t(e),Au[e.id()]=[[t,n]],n;for(let e=0;e<i.length;e++){const[r,s]=i[e];r===t&&(n=s)}return null===n&&(n=t(e),i.push([t,n])),n}(n,a);if(!t.setSource)return r.push(t),Lu(e,o,i,n,r,s);t.setSource(Object.assign({},e),(function(a,l){if(a)return Lu(e,o,i,n,r,s);r.push(t),Lu(l,e.type===l.type?o:_u[l.type],i,n,r,s)}))}else o.length?Lu(e,o,i,n,r,s):s?i(e,r):Lu(e,_u["*"],i,n,r,!0)}const Ou={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Pu=function(e=""){const t=lu(e);return Ou[t.toLowerCase()]||""},Du=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=Du(e),Array.isArray(e)?t=t.concat(e):La(e)&&t.push(e)})),e=t}else e="string"==typeof e&&e.trim()?[Mu({src:e})]:La(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Mu(e)]:[];return e};function Mu(e){if(!e.type){const t=Pu(e.src);t&&(e.type=t)}return e}const Nu=Za?10009:$a?461:8,Ru={codes:{play:415,pause:19,ff:417,rw:412,back:Nu},names:{415:"play",19:"pause",417:"ff",412:"rw",[Nu]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!(!this.names[e.keyCode]||this.names[e.keyCode]!==t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){const t=this.codes[e.code];return this.names[t]}return null}};class Bu extends ml{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",(()=>{this.focus(this.updateFocusableComponents()[0])})),this.player_.on("modalclose",(()=>{this.refocusComponent()})),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",(()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())})))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const e=t.key.substring(5).toLowerCase();this.move(e)}else if(Ru.isEventKey(t,"play")||Ru.isEventKey(t,"pause")||Ru.isEventKey(t,"ff")||Ru.isEventKey(t,"rw")){t.preventDefault();const e=Ru.getEventName(t);this.performMediaAction_(e)}else Ru.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const n=this.getCurrentComponent(e.target);t&&(i=Boolean(t.closest(".video-js")),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(n&&"CloseButton"===n.name()?this.refocusComponent():(this.pause(),n&&n.el()&&(this.lastFocusedComponent_=n)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(e){for(const n of e)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach((e=>{if(e.hasOwnProperty("el_")){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);e.hasOwnProperty("children_")&&e.children_.length>0?i(e.children_):e.hasOwnProperty("items")&&e.items.length>0?i(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if("ErrorDisplay"===e.name_&&e.opened_){const i=e.el_.querySelector(".vjs-errors-ok-button-container");if(i){i.querySelectorAll("button").forEach(((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{const t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})}))}}})),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){return e.el()?function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let e=0;e<i.children.length;e++){const n=t(i.children[e]);if(n)return n}return null}(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length)for(const e of this.focusableComponents)if(e.el()===t)return e}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name())return this.focusableComponents.splice(t,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),n=this.focusableComponents.filter((n=>n!==t&&this.isInDirection_(i.boundingClientRect,n.getPositions().boundingClientRect,e))),r=this.findBestCandidate_(i.center,n,e);r?this.focus(r):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let n=1/0,r=null;for(const s of t){const t=s.getPositions().center,a=this.calculateDistance_(e,t,i);a<n&&(n=a,r=s)}return r}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}focus(e){"object"==typeof e&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);let s;switch(i){case"right":case"left":s=n+100*r;break;case"up":s=2*r+.5*n;break;case"down":s=5*r+n;break;default:s=n+r}return s}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if("TextTrackSelect"===t.constructor.name){e.focus(t);break}}}Ol.registerComponent("MediaLoader",class extends Ol{constructor(e,t,i){if(super(e,Pa({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,n=t.playerOptions.techOrder;i<n.length;i++){const t=kl(n[i]);let r=Tu.getTech(t);if(t||(r=Ol.getComponent(t)),r&&r.isSupported()){e.loadTech_(t);break}}}});class Uu extends Ol{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&wa.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const n=ho(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(ho("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ho("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,po(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ol.registerComponent("ClickableComponent",Uu);class Fu extends Uu{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ho("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ho("picture",{className:"vjs-poster",tabIndex:-1},{},ho("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Xl(this.player_.play()):this.player_.pause())}}Fu.prototype.crossorigin=Fu.prototype.crossOrigin,Ol.registerComponent("PosterImage",Fu);const ju="#222",qu="#ccc",Hu={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Vu(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Xu(e,t,i){try{e.style[t]=i}catch(e){return}}function zu(e){return e?`${e}px`:""}Ol.registerComponent("TextTrackDisplay",class extends Ol{constructor(e,t,i){super(e,t,i);const n=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",(e=>this.updateDisplay(e))),e.on("loadedmetadata",(e=>{this.updateDisplayOverlay(),this.preselectTrack(e)})),e.ready(ul(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",n),e.on("playerresize",n);const t=Me.screen.orientation||Me,i=Me.screen.orientation?"change":"orientationchange";t.addEventListener(i,n),e.on("dispose",(()=>t.removeEventListener(i,n)));const r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()})))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,r,s;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?s=o:s||(s=o):i&&!i.enabled?(s=null,n=null,r=null):o.default&&("descriptions"!==o.kind||n?o.kind in e&&!r&&(r=o):n=o)}s?s.mode="showing":r?r.mode="showing":n&&(n.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof Me.WebVTT&&Me.WebVTT.processCues(Me,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const n=e[i];"showing"===n.mode&&t.push(n)}return void this.updateForTrack(t)}let i=null,n=null,r=e.length;for(;r--;){const t=e[r];"showing"===t.mode&&("descriptions"===t.kind?i=t:n=t)}if(n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!Me.CSS.supports("inset","10px")){const e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,n=this.player_.el_.getBoundingClientRect().height;e.style="",Xu(e,"position","relative"),Xu(e,"height",n-i+"px"),Xu(e,"top","unset"),Xu(e,"bottom",eo?n+"px":"0px"),t.length>0&&t.forEach((e=>{if(e.style.inset){const t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}}))}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!Me.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,n=this.player_.videoWidth()/this.player_.videoHeight();let r=0,s=0;Math.abs(i-n)>.1&&(i>n?r=Math.round((e-t*n)/2):s=Math.round((t-e/n)/2)),Xu(this.el_,"insetInline",zu(r)),Xu(this.el_,"insetBlock",zu(s))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;for(;n--;){const e=i[n];if(!e)continue;const r=e.displayState;if(t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&Xu(r.firstChild,"color",Vu(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Xu(r.firstChild,"backgroundColor",Vu(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Xu(r,"backgroundColor",Vu(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow=`2px 2px 3px ${ju}, 2px 2px 4px ${ju}, 2px 2px 5px ${ju}`:"raised"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${ju}, 2px 2px ${ju}, 3px 3px ${ju}`:"depressed"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${qu}, 0 1px ${qu}, -1px -1px ${ju}, 0 -1px ${ju}`:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow=`0 0 4px ${ju}, 0 0 4px ${ju}, 0 0 4px ${ju}, 0 0 4px ${ju}`)),t.fontPercent&&1!==t.fontPercent){const e=Me.parseFloat(r.style.fontSize);r.style.fontSize=e*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=Hu[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof Me.WebVTT||e.every((e=>!e.activeCues)))return;const t=[];for(let i=0;i<e.length;++i){const n=e[i];for(let e=0;e<n.activeCues.length;++e)t.push(n.activeCues[e])}Me.WebVTT.processCues(Me,t,this.el_);for(let t=0;t<e.length;++t){const i=e[t];for(let e=0;e<i.activeCues.length;++e){const n=i.activeCues[e].displayState;fo(n,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&Ao(n,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}});Ol.registerComponent("LoadingSpinner",class extends Ol{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=ho("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),n=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return n.appendChild(i),n}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class Wu extends Uu{createEl(e,t={},i={}){const n=ho("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||n.appendChild(ho("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}addChild(e,t={}){const i=this.constructor.name;return wa.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),Ol.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){" "!==e.key&&"Enter"!==e.key?super.handleKeyDown(e):e.stopPropagation()}}Ol.registerComponent("Button",Wu);class Gu extends Wu{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(e=>this.handleMouseDown(e)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Xl(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(!n)return void this.player_.tech(!0).focus();const r=()=>n.focus();Vl(t)?t.then(r,(()=>{})):this.setTimeout(r,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Gu.prototype.controlText_="Play Video",Ol.registerComponent("BigPlayButton",Gu);Ol.registerComponent("CloseButton",class extends Wu{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class Yu extends Wu{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",(e=>this.handlePlay(e))),this.on(e,"pause",(e=>this.handlePause(e))),t.replay&&this.on(e,"ended",(e=>this.handleEnded(e)))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Xl(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)))}}Yu.prototype.controlText_="Play",Ol.registerComponent("PlayToggle",Yu);class Ku extends Ol{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],(e=>this.update(e))),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ho("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ho("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=Fl(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,wa.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=Ue.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))})))}updateContent(e){}}Ku.prototype.labelText_="Time",Ku.prototype.controlText_="Time",Ol.registerComponent("TimeDisplay",Ku);class Ju extends Ku{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ju.prototype.labelText_="Current Time",Ju.prototype.controlText_="Current Time",Ol.registerComponent("CurrentTimeDisplay",Ju);class Qu extends Ku{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Qu.prototype.labelText_="Duration",Qu.prototype.controlText_="Duration",Ol.registerComponent("DurationDisplay",Qu);Ol.registerComponent("TimeDivider",class extends Ol{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class Zu extends Ku{constructor(e,t){super(e,t),this.on(e,"durationchange",(e=>this.updateContent(e)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(ho("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}Zu.prototype.labelText_="Remaining Time",Zu.prototype.controlText_="Remaining Time",Ol.registerComponent("RemainingTimeDisplay",Zu);Ol.registerComponent("LiveDisplay",class extends Ol{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ho("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ho("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(Ue.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class $u extends Wu{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ho("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function ed(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}$u.prototype.controlText_="Seek to live, currently playing live",Ol.registerComponent("SeekToLive",$u);var td=Object.freeze({__proto__:null,clamp:ed});class id extends Ol{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Va||e.preventDefault(),wo(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Eo(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"}))),e}getProgress(){return Number(ed(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=ko(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,n=t&&t.horizontalSeek;i?n&&"ArrowLeft"===e.key||!n&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):n&&"ArrowRight"===e.key||!n&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Ol.registerComponent("Slider",id);const nd=(e,t)=>ed(e/t*100,0,100).toFixed(2)+"%";Ol.registerComponent("LoadProgressBar",class extends Ol{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ho("span",{className:"vjs-control-text"}),i=ho("span",{textContent:this.localize("Loaded")}),n=Ue.createTextNode(": ");return this.percentageEl_=ho("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),r=this.partEls_,s=nd(n,i);this.percent_!==s&&(this.el_.style.width=s,po(this.percentageEl_,s),this.percent_=s);for(let e=0;e<t.length;e++){const i=t.start(e),s=t.end(e);let a=r[e];a||(a=this.el_.appendChild(ho()),r[e]=a),a.dataset.start===i&&a.dataset.end===s||(a.dataset.start=i,a.dataset.end=s,a.style.left=nd(i,n),a.style.width=nd(s-i,n))}for(let e=r.length;e>t.length;e--)this.el_.removeChild(r[e-1]);r.length=t.length}))}});Ol.registerComponent("TimeTooltip",class extends Ol{constructor(e,t){super(e,t),this.update=dl(ul(this,this.update),ll)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const n=Co(this.el_),r=xo(this.player_.el()),s=e.width*t;if(!r||!n)return;let a=e.left-r.left+s,o=e.width-s+(r.right-e.right);o||(o=e.width-s,a=s);let l=n.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>n.width&&(l=n.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){po(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let r;const s=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;r=(i<1?"":"-")+Fl(i,e)}else r=Fl(i,s);this.update(e,t,r),n&&n()}))}});class rd extends Ol{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=dl(ul(this,this.update),ll)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}}rd.prototype.options_={children:[]},no||Fa||rd.prototype.options_.children.push("timeTooltip"),Ol.registerComponent("PlayProgressBar",rd);class sd extends Ol{constructor(e,t){super(e,t),this.update=dl(ul(this,this.update),ll)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,(()=>{this.el_.style.left=e.width*t+"px"}))}}sd.prototype.options_={children:["timeTooltip"]},Ol.registerComponent("MouseTimeDisplay",sd);class ad extends id{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=ul(this,this.update),this.update=dl(this.update_,ll),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Ue&&"visibilityState"in Ue&&this.on(Ue,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===Ue.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ll))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===Ue.visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Fl(e,n),Fl(n,n)],"{1} of {2}")),this.currentTime_=e,this.duration_=n),this.bar&&this.bar.update(xo(this.el()),this.getProgress())})),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Mo(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Mo(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99)return void r.seekToLiveEdge();const e=r.seekableStart(),t=r.liveCurrentTime();if(i=e+n*r.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=n*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Xl(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Ue&&"visibilityState"in Ue&&this.off(Ue,"visibilitychange",this.toggleVisibility_),super.dispose()}}ad.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},no||Fa||ad.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Ol.registerComponent("SeekBar",ad);class od extends Ol{constructor(e,t){super(e,t),this.handleMouseMove=dl(ul(this,this.handleMouseMove),ll),this.throttledHandleMouseSeek=dl(ul(this,this.handleMouseSeek),ll),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!i&&!n)return;const r=t.el(),s=Co(r);let a=ko(r,e).x;a=ed(a,0,1),n&&n.update(s,a),i&&i.update(s,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach((e=>e.disable&&e.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Xl(this.player_.play())}}enable(){this.children().forEach((e=>e.enable&&e.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}od.prototype.options_={children:["seekBar"]},Ol.registerComponent("ProgressControl",od);class ld extends Wu{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>this.handlePictureInPictureAudioModeChange())),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){Ue.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in Me?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof Ue.exitPictureInPicture&&super.show()}}ld.prototype.controlText_="Picture-in-Picture",Ol.registerComponent("PictureInPictureToggle",ld);class ud extends Wu{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",(e=>this.handleFullscreenChange(e))),!1===Ue[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}ud.prototype.controlText_="Fullscreen",Ol.registerComponent("FullscreenToggle",ud);Ol.registerComponent("VolumeLevel",class extends Ol{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}});Ol.registerComponent("VolumeLevelTooltip",class extends Ol{constructor(e,t){super(e,t),this.update=dl(ul(this,this.update),ll)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){const i=xo(this.el_),n=xo(this.player_.el()),r=e.width*t;if(!n||!i)return;const s=e.left-n.left+r,a=e.width-r+(n.right-e.right);let o=i.width/2;s<o?o+=o-s:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${n}%`)}write(e){po(this.el_,e)}updateVolume(e,t,i,n,r){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,i,n.toFixed(0)),r&&r()}))}});class dd extends Ol{constructor(e,t){super(e,t),this.update=dl(ul(this,this.update),ll)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const n=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,n,(()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"}))}}dd.prototype.options_={children:["volumeLevelTooltip"]},Ol.registerComponent("MouseVolumeLevelDisplay",dd);class cd extends id{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.ready((()=>this.updateARIAAttributes()))}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Mo(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),n=xo(i),r=this.vertical();let s=ko(i,e);s=r?s.y:s.x,s=ed(s,0,1),t.update(n,s,r)}Mo(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)}))}}cd.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},no||Fa||cd.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),cd.prototype.playerEvent="volumechange",Ol.registerComponent("VolumeBar",cd);class hd extends Ol{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||Oa(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.throttledHandleMouseMove=dl(ul(this,this.handleMouseMove),ll),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",(e=>this.handleMouseDown(e))),this.on("touchstart",(e=>this.handleMouseDown(e))),this.on("mousemove",(e=>this.handleMouseMove(e))),this.on(this.volumeBar,["focus","slideractive"],(()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")})),this.on(this.volumeBar,["blur","sliderinactive"],(()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")}))}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}hd.prototype.options_={children:["volumeBar"]},Ol.registerComponent("VolumeControl",hd);class pd extends Wu{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.on(e,["loadstart","volumechange"],(e=>this.update(e)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),no&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),yo(this.el_,[0,1,2,3].reduce(((e,t)=>e+`${t?" ":""}vjs-vol-${t}`),"")),fo(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}pd.prototype.controlText_="Mute",Ol.registerComponent("MuteToggle",pd);class md extends Ol{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||Oa(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],(e=>this.volumePanelState_(e))),this.on(this.muteToggle,"keyup",(e=>this.handleKeyPress(e))),this.on(this.volumeControl,"keyup",(e=>this.handleVolumeControlKeyUp(e))),this.on("keydown",(e=>this.handleKeyPress(e))),this.on("mouseover",(e=>this.handleMouseOver(e))),this.on("mouseout",(e=>this.handleMouseOut(e))),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),il(Ue,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),nl(Ue,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}md.prototype.options_={children:["muteToggle","volumeControl"]},Ol.registerComponent("VolumePanel",md);class gd extends Wu{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()?i.seekableEnd():this.player_.duration();let r;r=t+this.skipTime<=n?t+this.skipTime:n,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}gd.prototype.controlText_="Skip Forward",Ol.registerComponent("SkipForward",gd);class fd extends Wu{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()&&i.seekableStart();let r;r=n&&t-this.skipTime<=n?n:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}fd.prototype.controlText_="Skip Backward",Ol.registerComponent("SkipBackward",fd);class yd extends Ol{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",(e=>this.handleKeyDown(e))),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof Ol&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Ol&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ho(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),il(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||Ue.activeElement;if(!this.children().some((e=>e.el()===t))){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter((t=>t.el()===e.target))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Ol.registerComponent("Menu",yd);class vd extends Ol{constructor(e,t={}){super(e,t),this.menuButton_=new Wu(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Wu.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const n=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",n),this.on(this.menuButton_,"click",n),this.on(this.menuButton_,"keydown",(e=>this.handleKeyDown(e))),this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover"),this.menu.show(),il(Ue,"keyup",this.handleMenuKeyUp_)})),this.on("mouseleave",(e=>this.handleMouseLeave(e))),this.on("keydown",(e=>this.handleSubmenuKeyDown(e)))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new yd(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ho("li",{className:"vjs-menu-title",textContent:kl(this.options_.title),tabIndex:-1}),i=new Ol(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";return`vjs-menu-button ${e} ${Wu.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),nl(Ue,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Esc"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus())):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){"Esc"!==e.key&&"Tab"!==e.key||this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){"Esc"!==e.key&&"Tab"!==e.key||(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),no&&uo())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Ol.registerComponent("MenuButton",vd);class bd extends vd{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const n=ul(this,this.update);i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),i.addEventListener("labelchange",n),this.player_.on("ready",n),this.player_.on("dispose",(function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n),i.removeEventListener("labelchange",n)}))}}Ol.registerComponent("TrackButton",bd);class Td extends Uu{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const n=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),r=ho("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?n.appendChild(r):n.replaceChild(r,n.querySelector(".vjs-icon-placeholder")),n}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Ol.registerComponent("MenuItem",Td);class _d extends Td{constructor(e,t){const i=t.track,n=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const r=(...e)=>{this.handleTracksChange.apply(this,e)},s=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),n.addEventListener("change",r),n.addEventListener("selectedlanguagechange",s),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],r),n.removeEventListener("change",r),n.removeEventListener("selectedlanguagechange",s)})),void 0===n.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof Me.Event)try{e=new Me.Event("change")}catch(e){}e||(e=Ue.createEvent("Event"),e.initEvent("change",!0,!0)),n.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){const n=i[e];-1!==this.kinds.indexOf(n.kind)&&(n===t?"showing"!==n.mode&&(n.mode="showing"):"disabled"!==n.mode&&(n.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Ol.registerComponent("TextTrackMenuItem",_d);class Ad extends _d{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(this.options_.kinds.indexOf(n.kind)>-1&&"showing"===n.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(["captions","descriptions","subtitles"].indexOf(n.kind)>-1&&"showing"===n.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Ol.registerComponent("OffTextTrackMenuItem",Ad);class Sd extends bd{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=_d){let i;this.label_&&(i=`${this.label_} off`),e.push(new Ad(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<n.length;i++){const r=n[i];if(this.kinds_.indexOf(r.kind)>-1){const i=new t(this.player_,{track:r,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${r.kind}-menu-item`),e.push(i)}}return e}}Ol.registerComponent("TextTrackButton",Sd);class wd extends Td{constructor(e,t){const i=t.track,n=t.cue,r=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=r&&r<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Ol.registerComponent("ChaptersTrackMenuItem",wd);class Ed extends Sd{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach((e=>{e.selected(this.track_.activeCues[0]===e.cue)}))}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(kl(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new wd(this.player_,{track:this.track_,cue:n});e.push(r)}return e}}Ed.prototype.kind_="chapters",Ed.prototype.controlText_="Chapters",Ol.registerComponent("ChaptersButton",Ed);class xd extends Sd{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const n=e.textTracks(),r=ul(this,this.handleTracksChange);n.addEventListener("change",r),this.on("dispose",(function(){n.removeEventListener("change",r)}))}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n.kind!==this.kind_&&"showing"===n.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}xd.prototype.kind_="descriptions",xd.prototype.controlText_="Descriptions",Ol.registerComponent("DescriptionsButton",xd);class Cd extends Sd{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Cd.prototype.kind_="subtitles",Cd.prototype.controlText_="Subtitles",Ol.registerComponent("SubtitlesButton",Cd);class kd extends _d{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}Ol.registerComponent("CaptionSettingsMenuItem",kd);class Id extends Sd{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new kd(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Id.prototype.kind_="captions",Id.prototype.controlText_="Captions",Ol.registerComponent("CaptionsButton",Id);class Ld extends _d{createEl(e,t,i){const n=super.createEl(e,t,i),r=n.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",n):r.appendChild(ho("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(ho("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),n}}Ol.registerComponent("SubsCapsMenuItem",Ld);class Od extends Sd{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(kl(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new kd(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Ld),e}}Od.prototype.kinds_=["captions","subtitles"],Od.prototype.controlText_="Subtitles",Ol.registerComponent("SubsCapsButton",Od);class Pd extends Td{constructor(e,t){const i=t.track,n=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const r=(...e)=>{this.handleTracksChange.apply(this,e)};n.addEventListener("change",r),this.on("dispose",(()=>{n.removeEventListener("change",r)}))}createEl(e,t,i){const n=super.createEl(e,t,i),r=n.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(r.appendChild(ho("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(ho("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),n}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Ol.registerComponent("AudioTrackMenuItem",Pd);class Dd extends bd{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const n=t[i];e.push(new Pd(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e}}Dd.prototype.controlText_="Audio Track",Ol.registerComponent("AudioTrackButton",Dd);class Md extends Td{constructor(e,t){const i=t.rate,n=parseFloat(i,10);t.label=i,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=n,this.on(e,"ratechange",(e=>this.update(e)))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Md.prototype.contentElType="button",Ol.registerComponent("PlaybackRateMenuItem",Md);class Nd extends vd{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",(e=>this.updateVisibility(e))),this.on(e,"ratechange",(e=>this.updateLabel(e))),this.on(e,"playbackrateschange",(e=>this.handlePlaybackRateschange(e)))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ho("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new Md(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Nd.prototype.controlText_="Playback Rate",Ol.registerComponent("PlaybackRateMenuButton",Nd);class Rd extends Ol{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}Ol.registerComponent("Spacer",Rd);Ol.registerComponent("CustomControlSpacer",class extends Rd{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Bd extends Ol{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Bd.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Ol.registerComponent("ControlBar",Bd);class Ud extends Kl{constructor(e,t){super(e,t),this.on(e,"error",(e=>{this.open(e)}))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Ud.prototype.options_=Object.assign({},Kl.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Ol.registerComponent("ErrorDisplay",Ud);class Fd extends Ol{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim();return ho("select",{id:this.options_.id},{},this.options_.SelectOptions.map((e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Jo()}`)+"-"+e[1].replace(/\W+/g,""),i=ho("option",{id:t,value:this.localize(e[0]),textContent:e[1]});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i})))}}Ol.registerComponent("TextTrackSelect",Fd);class jd extends Ol{constructor(e,t={}){super(e,t);const i=ho("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const n=this.options_.selects;for(const t of n){const i=this.options_.selectConfigs[t],n=i.className,r=i.id.replace("%s",this.options_.id_);let s=null;const a=`vjs_select_${Jo()}`;if("colors"===this.options_.type){s=ho("span",{className:n});const e=ho("label",{id:r,className:"vjs-label",textContent:i.label});e.setAttribute("for",a),s.appendChild(e)}const o=new Fd(e,{SelectOptions:i.options,legendId:this.options_.legendId,id:a,labelId:r});this.addChild(o),"colors"===this.options_.type&&(s.appendChild(o.el()),this.el().appendChild(s))}}createEl(){return ho("fieldset",{className:this.options_.className})}}Ol.registerComponent("TextTrackFieldset",jd);class qd extends Ol{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new jd(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const r=new jd(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const s=new jd(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s)}createEl(){return ho("div",{className:"vjs-track-settings-colors"})}}Ol.registerComponent("TextTrackSettingsColors",qd);class Hd extends Ol{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new jd(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const r=new jd(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const s=new jd(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s)}createEl(){return ho("div",{className:"vjs-track-settings-font"})}}Ol.registerComponent("TextTrackSettingsFont",Hd);class Vd extends Ol{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),n=new Wu(e,{controlText:i,className:"vjs-default-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Reset"),this.addChild(n);const r=new Wu(e,{controlText:i,className:"vjs-done-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Done"),this.addChild(r)}createEl(){return ho("div",{className:"vjs-track-settings-controls"})}}Ol.registerComponent("TrackSettingsControls",Vd);const Xd="vjs-text-track-settings",zd=["#000","Black"],Wd=["#00F","Blue"],Gd=["#0FF","Cyan"],Yd=["#0F0","Green"],Kd=["#F0F","Magenta"],Jd=["#F00","Red"],Qd=["#FFF","White"],Zd=["#FF0","Yellow"],$d=["1","Opaque"],ec=["0.5","Semi-Transparent"],tc=["0","Transparent"],ic={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[zd,Qd,Jd,Yd,Wd,Zd,Kd,Gd],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[$d,ec,tc],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Qd,zd,Jd,Yd,Wd,Zd,Kd,Gd],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[$d,ec],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[tc,ec,$d],className:"vjs-window-opacity vjs-opacity"}};function nc(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}ic.windowColor.options=ic.backgroundColor.options;Ol.registerComponent("TextTrackSettings",class extends Kl{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=ho("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new qd(e,{textTrackComponentid:this.id_,selectConfigs:ic,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Hd(e,{textTrackComponentid:this.id_,selectConfigs:ic,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const n=new Vd(e);this.addChild(n)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],(()=>{this.saveSettings(),this.close()})),this.on(this.$(".vjs-default-button"),["click","tap"],(()=>{this.setDefaults(),this.updateDisplay()})),ka(ic,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay)}))}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return Ia(ic,((e,t,i)=>{const n=(r=this.$(t.selector),s=t.parser,nc(r.options[r.options.selectedIndex].value,s));var r,s;return void 0!==n&&(e[i]=n),e}),{})}setValues(e){ka(ic,((t,i)=>{!function(e,t,i){if(t)for(let n=0;n<e.options.length;n++)if(nc(e.options[n].value,i)===t){e.selectedIndex=n;break}}(this.$(t.selector),e[i],t.parser)}))}setDefaults(){ka(ic,(e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t}))}restoreSettings(){let e;try{e=JSON.parse(Me.localStorage.getItem(Xd))}catch(e){wa.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?Me.localStorage.setItem(Xd,JSON.stringify(e)):Me.localStorage.removeItem(Xd)}catch(e){wa.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}});Ol.registerComponent("ResizeManager",class extends Ol{constructor(e,t){let i=t.ResizeObserver||Me.ResizeObserver;null===t.ResizeObserver&&(i=!1);super(e,Pa({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||Me.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=cl((()=>{this.resizeHandler()}),100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){nl(this,"resize",e),nl(this,"unload",t),t=null};il(this.el_.contentWindow,"unload",t),il(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const rc={trackingThreshold:20,liveTolerance:15};Ol.registerComponent("LiveTracker",class extends Ol{constructor(e,t){super(e,Pa(rc,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",(e=>this.handleDurationchange(e))),this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(Me.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const n=this.liveCurrentTime(),r=this.player_.currentTime();let s=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-r)>this.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ll),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}});Ol.registerComponent("TitleBar",class extends Ol{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:ho("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Jo()}`}),description:ho("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Jo()}`})},ho("div",{className:"vjs-title-bar"},{},Da(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e=>{const n=this.state[e],r=this.els[e],s=i[e];Lo(r),n&&po(r,n),t&&(t.removeAttribute(s),n&&t.setAttribute(s,r.id))})),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const sc={initialDisplay:4e3,position:[],takeFocus:!1};Ol.registerComponent("TransientButton",class extends Wu{constructor(e,t){super(e,t=Pa(sc,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],(e=>{this.removeClass("force-display")}))}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map((e=>`vjs-${e}`)).join(" ")}`}createEl(){const e=ho("button",{},{type:"button",class:this.buildCSSClass()},ho("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout((()=>{this.removeClass("force-display")}),this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});const ac=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),n=[];let r="";if(!i.length)return!1;for(let e=0;e<i.length;e++){const t=i[e].src;t&&-1===n.indexOf(t)&&n.push(t)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},oc=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=Ue.createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=Ue.createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",Me.Element.prototype.appendChild.call(this,i),this.innerHTML}}),lc=(e,t)=>{let i={};for(let n=0;n<e.length&&(i=Object.getOwnPropertyDescriptor(e[n],t),!(i&&i.set&&i.get));n++);return i.enumerable=!0,i.configurable=!0,i},uc=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},n=(e=>lc([e.el(),Me.HTMLMediaElement.prototype,Me.Element.prototype,oc],"innerHTML"))(e),r=i=>(...n)=>{const r=i.apply(t,n);return ac(e),r};["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",Pa(n,{set:r(n.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach((e=>{t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)},dc=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?ou(Me.Element.prototype.getAttribute.call(this,"src")):""},set(e){return Me.Element.prototype.setAttribute.call(this,"src",e),e}}),cc=function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=(e=>lc([e.el(),Me.HTMLMediaElement.prototype,dc],"src"))(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",Pa(i,{set:n=>{const r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=(i,r)=>{const s=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),s},t.load=()=>{const i=r.call(t);return ac(e)||(e.triggerSourceset(""),uc(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):ac(e)||uc(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}};class hc extends Tu{constructor(e,t){super(e,t);const i=e.source;let n=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];for(;t--;){const r=e[t];"track"===r.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),this.textTracks().addTrack(r.track),n||this.el_.hasAttribute("crossorigin")||!uu(r.src)||(n=!0)):i.push(r))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&n&&wa.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(to||Qa)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),hc.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){cc(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",(()=>e.removeEventListener("change",i)));const n=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",(()=>{e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)})),this.on("webkitendfullscreen",(()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)}))}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach((e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])})),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=yu[e],i=this.el()[t.getterName],n=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const r={change:t=>{const i={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(i),"text"===e&&this[vu.remoteText.getterName]().trigger(i)},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}},s=function(){const e=[];for(let t=0;t<n.length;t++){let r=!1;for(let e=0;e<i.length;e++)if(i[e]===n[t]){r=!0;break}r||e.push(n[t])}for(;e.length;)n.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=r,Object.keys(r).forEach((e=>{const t=r[e];i.addEventListener(e,t),this.on("dispose",(n=>i.removeEventListener(e,t)))})),this.on("loadstart",s),this.on("dispose",(e=>this.off("loadstart",s)))}proxyNativeTracks_(){yu.names.forEach((e=>{this.proxyNativeTracksForType_(e)}))}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),hc.disposeMediaElement(e),e=t}else{e=Ue.createElement("video");const t=Pa({},this.options_.tag&&To(this.options_.tag));to&&!0===this.options_.nativeControlsForTouch||delete t.controls,bo(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&Ao(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const n=t[i],r=this.options_[n];void 0!==r&&(r?Ao(e,n,n):So(e,n),e[n]=r)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")}))}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&ro?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){wa(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Fa&&Va&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)}))}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Xl(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return wa.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const n=ho("source",{},i);return this.el_.appendChild(n),!0}removeSourceElement(e){if(!e)return wa.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return wa.warn(`No matching source element found with src: ${e}`),!1}reset(){hc.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=Ue.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),Me.performance&&(e.creationTime=Me.performance.now()),e}}Ma(hc,"TEST_VID",(function(){if(!oo())return;const e=Ue.createElement("video"),t=Ue.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),hc.isSupported=function(){try{hc.TEST_VID.volume=.5}catch(e){return!1}return!(!hc.TEST_VID||!hc.TEST_VID.canPlayType)},hc.canPlayType=function(e){return hc.TEST_VID.canPlayType(e)},hc.canPlaySource=function(e,t){return hc.canPlayType(e.type)},hc.canControlVolume=function(){try{const e=hc.TEST_VID.volume;hc.TEST_VID.volume=e/2+.1;const t=e!==hc.TEST_VID.volume;return t&&no?(Me.setTimeout((()=>{hc&&hc.prototype&&(hc.prototype.featuresVolumeControl=e!==hc.TEST_VID.volume)})),!1):t}catch(e){return!1}},hc.canMuteVolume=function(){try{const e=hc.TEST_VID.muted;return hc.TEST_VID.muted=!e,hc.TEST_VID.muted?Ao(hc.TEST_VID,"muted","muted"):So(hc.TEST_VID,"muted"),e!==hc.TEST_VID.muted}catch(e){return!1}},hc.canControlPlaybackRate=function(){if(Fa&&Va&&za<58)return!1;try{const e=hc.TEST_VID.playbackRate;return hc.TEST_VID.playbackRate=e/2+.1,e!==hc.TEST_VID.playbackRate}catch(e){return!1}},hc.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(Ue.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(Ue.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(Ue.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(Ue.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},hc.supportsNativeTextTracks=function(){return ro||no&&Va},hc.supportsNativeVideoTracks=function(){return!(!hc.TEST_VID||!hc.TEST_VID.videoTracks)},hc.supportsNativeAudioTracks=function(){return!(!hc.TEST_VID||!hc.TEST_VID.audioTracks)},hc.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){Ma(hc.prototype,e,(()=>hc[t]()),!0)})),hc.prototype.featuresVolumeControl=hc.canControlVolume(),hc.prototype.movingMediaElementInDOM=!no,hc.prototype.featuresFullscreenResize=!0,hc.prototype.featuresProgressEvents=!0,hc.prototype.featuresTimeupdateEvents=!0,hc.prototype.featuresVideoFrameCallback=!(!hc.TEST_VID||!hc.TEST_VID.requestVideoFrameCallback),hc.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},hc.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){hc.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){hc.prototype["set"+kl(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){hc.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){hc.prototype["set"+kl(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){hc.prototype[e]=function(){return this.el_[e]()}})),Tu.withSourceHandlers(hc),hc.nativeSourceHandler={},hc.nativeSourceHandler.canPlayType=function(e){try{return hc.TEST_VID.canPlayType(e)}catch(e){return""}},hc.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return hc.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=lu(e.src);return hc.nativeSourceHandler.canPlayType(`video/${t}`)}return""},hc.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},hc.nativeSourceHandler.dispose=function(){},hc.registerSourceHandler(hc.nativeSourceHandler),Tu.registerTech("Html5",hc);const pc=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],mc={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},gc=["tiny","xsmall","small","medium","large","xlarge","huge"],fc={};gc.forEach((e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;fc[e]=`vjs-layout-${t}`}));const yc={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class vc extends Ol{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Jo()}`,(t=Object.assign(vc.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=Ea(this.id_),this.fsApi_=ba,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&To(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(i){e[i.toLowerCase()]=t.languages[i]})),this.languages_=e}else this.languages_=vc.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),wl(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(il(Ue,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const n=Pa(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach((e=>{this[e](t.plugins[e])})),t.debug&&this.debug(!0),this.options_.playerOptions=n,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new Me.DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <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"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))wa.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Bu(this),this.addClass("vjs-spatial-navigation-enabled")),to&&this.addClass("vjs-touch-enabled"),no||this.addClass("vjs-workinghover"),vc.players[this.id_]=this;const r=ga.split(".")[0];this.addClass(`vjs-v${r}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)}))}dispose(){var e;this.trigger("dispose"),this.off("dispose"),nl(Ue,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),nl(Ue,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),vc.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),e=this,Au.hasOwnProperty(e.id())&&delete Au[e.id()],bu.names.forEach((e=>{const t=this[bu[e].getterName]();t&&t.off&&t.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const n="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:n||(e=this.el_=super.createEl("div"));const r=To(t);if(n){for(e=this.el_=t,t=this.tag=Ue.createElement("video");e.children.length;)t.appendChild(e.firstChild);go(e,"video-js")||fo(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach((i=>{try{t[i]=e[i]}catch(e){}}))}t.setAttribute("tabindex","-1"),r.tabindex="-1",Va&&Ka&&(t.setAttribute("role","application"),r.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach((function(i){n&&"class"===i||e.setAttribute(i,r[i]),n&&t.setAttribute(i,r[i])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const s=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter((e=>so[e])).map((e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-")));if(this.addClass(...s),!0!==Me.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=zo("vjs-styles-dimensions");const e=No(".vjs-styles-defaults"),t=No("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const a=t.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a.item(e);fo(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),mo(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):wa.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const n=parseFloat(t);isNaN(n)?wa.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=n,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,fl(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},fl(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===Me.VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,n;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const r=i.split(":"),s=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Wo(this.styleEl_,`\n .${n} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${n}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*s}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=kl(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(Tu.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let r=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(r=!1);const s={source:t,autoplay:r,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};bu.names.forEach((e=>{const t=bu[e];s[t.getterName]=this[t.privateName]})),Object.assign(s,this.options_[i]),Object.assign(s,this.options_[n]),Object.assign(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);const a=Tu.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new a(s),this.tech_.ready(ul(this,this.handleTechReady_),!0),Gl(this.textTracksJson_||[],this.tech_),pc.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${kl(e)}_`](t)))})),Object.keys(mc).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${mc[e]}_`].bind(this),event:t}):this[`handleTech${mc[e]}_`](t)}))})),this.on(this.tech_,"loadstart",(e=>this.handleTechLoadStart_(e))),this.on(this.tech_,"sourceset",(e=>this.handleTechSourceset_(e))),this.on(this.tech_,"waiting",(e=>this.handleTechWaiting_(e))),this.on(this.tech_,"ended",(e=>this.handleTechEnded_(e))),this.on(this.tech_,"seeking",(e=>this.handleTechSeeking_(e))),this.on(this.tech_,"play",(e=>this.handleTechPlay_(e))),this.on(this.tech_,"pause",(e=>this.handleTechPause_(e))),this.on(this.tech_,"durationchange",(e=>this.handleTechDurationChange_(e))),this.on(this.tech_,"fullscreenchange",((e,t)=>this.handleTechFullscreenChange_(e,t))),this.on(this.tech_,"fullscreenerror",((e,t)=>this.handleTechFullscreenError_(e,t))),this.on(this.tech_,"enterpictureinpicture",(e=>this.handleTechEnterPictureInPicture_(e))),this.on(this.tech_,"leavepictureinpicture",(e=>this.handleTechLeavePictureInPicture_(e))),this.on(this.tech_,"error",(e=>this.handleTechError_(e))),this.on(this.tech_,"posterchange",(e=>this.handleTechPosterChange_(e))),this.on(this.tech_,"textdata",(e=>this.handleTechTextData_(e))),this.on(this.tech_,"ratechange",(e=>this.handleTechRateChange_(e))),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||mo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){bu.names.forEach((e=>{const t=bu[e];this[t.privateName]=this[t.getterName]()})),this.textTracksJson_=Wl(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&wa.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":ga}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(Vl(i))return i.catch((e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)}))};let i;return"any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),Vl(i)&&(i=i.catch(t))),Vl(i)?i.then((()=>{this.trigger({type:"autoplay-success",autoplay:e})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:e})})):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter((e=>e.src===t));if(i.length)return i[0].type;const n=e.$$("source");for(let e=0;e<n.length;e++){const i=n[e];if(i.type&&i.src&&i.src===t)return i.type}return Pu(t)})(this,t)),this.cache_.source=Pa({},e,{src:t,type:i});const n=this.cache_.sources.filter((e=>e.src&&e.src===t)),r=[],s=this.$$("source"),a=[];for(let e=0;e<s.length;e++){const i=To(s[e]);r.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,n=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==i)&&(t=()=>{}),t(n),e.src||this.tech_.any(["sourceset","loadstart"],(e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((e=>e.callback(e.event))),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Xl(this.play()):this.pause()))}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(t=>t.contains(e.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!Ue.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let n=Ue[this.fsApi_.fullscreenElement]===i;!n&&i.matches&&(n=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready((function(){if(e in Cu)return function(e,t,i,n){return t[i](e.reduce(Iu(i),n))}(this.middleware_,this.tech_,e,t);if(e in ku)return Eu(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw wa(e),e}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in xu)return function(e,t,i){return e.reduceRight(Iu(i),t[i]())}(this.middleware_,this.tech_,e);if(e in ku)return Eu(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw wa(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw wa(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw wa(t),t}}}play(){return new Promise((e=>{this.play_(e)}))}play_(e=Xl){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(ro||no);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const n=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Ml(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Ml(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Ml(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return ql(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise(((i,n)=>{function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",s)}function s(){r(),i()}function a(e,t){r(),n(t)}t.one("fullscreenchange",s),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(i,n))}))}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise(((t,i)=>{function n(){e.off("fullscreenerror",s),e.off("fullscreenchange",r)}function r(){n(),t()}function s(e,t){n(),i(t)}e.one("fullscreenchange",r),e.one("fullscreenerror",s);const a=e.exitFullscreenHelper_();a&&(a.then(n,n),a.then(t,i))}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=Ue[this.fsApi_.exitFullscreen]();return e&&Xl(e.then((()=>this.isFullscreen(!1)))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=Ue.documentElement.style.overflow,il(Ue,"keydown",this.boundFullWindowOnEscKey_),Ue.documentElement.style.overflow="hidden",fo(Ue.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,nl(Ue,"keydown",this.boundFullWindowOnEscKey_),Ue.documentElement.style.overflow=this.docOrigOverflow,yo(Ue.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&Me.documentPictureInPicture){const e=Ue.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ho("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),Me.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((t=>(Uo(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",(t=>{const i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")})),t)))}return"pictureInPictureEnabled"in Ue&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return Me.documentPictureInPicture&&Me.documentPictureInPicture.window?(Me.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in Ue?Ue.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys)return;(e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=(t=>"f"===e.key.toLowerCase()),muteKey:n=(t=>"m"===e.key.toLowerCase()),playPauseKey:r=(t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase())}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Ol.getComponent("FullscreenToggle");!1!==Ue[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else if(n.call(this,e)){e.preventDefault(),e.stopPropagation();Ol.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(r.call(this,e)){e.preventDefault(),e.stopPropagation();Ol.getComponent("PlayToggle").prototype.handleClick.call(this,e)}}canPlayType(e){let t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){const r=n[i];let s=Tu.getTech(r);if(s||(s=Ol.getComponent(r)),s){if(s.isSupported()&&(t=s.canPlayType(e),t))return t}else wa.error(`The "${r}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map((e=>[e,Tu.getTech(e)])).filter((([e,t])=>t?t.isSupported():(wa.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1))),i=function(e,t,i){let n;return e.some((e=>t.some((t=>{if(n=i(e,t),n)return!0})))),n};let n;const r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};var s;return n=this.options_.sourceOrder?i(e,t,(s=r,(e,t)=>s(t,e))):i(t,e,r),n||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Du(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),wu(this,i[0],((e,n)=>{this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(e);if(this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());var r,s;r=n,s=this.tech_,r.forEach((e=>e.setTech&&e.setTech(s)))})),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Il(t.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready((()=>{this.changingSrc_=!1})),!1))}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{Xl(this.play().then((()=>this.doReset_())))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),fl(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},{seekBar:r}=i||{};e&&e.updateContent(),t&&t.updateContent(),n&&n.updateContent(),r&&(r.update(),r.loadProgressBar&&r.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(ya("beforeerror").forEach((t=>{const i=t(this,e);La(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Hl(e),this.addClass("vjs-error"),wa.error(`(CODE:${this.error_.code} ${Hl.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),ya("error").forEach((e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const n=ul(this,this.reportUserActivity),r=function(t){n(),this.clearInterval(e)};this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())})),this.on("mouseup",r),this.on("mouseleave",r);const s=this.getChild("controlBar");let a;!s||no||Fa||(s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n);this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}),250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach((e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach((e=>e.show())),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=e,e){if(this.audioOnlyMode()){return this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_()}))}return Promise.resolve().then((()=>{this.enablePosterModeUI_()}))}return Promise.resolve().then((()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),fl(this)&&this.trigger("languagechange"))}languages(){return Pa(vc.prototype.options_.languages,this.languages_)}toJSON(){const e=Pa(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let n=t[i];n=Pa(n),n.player=void 0,e.tracks[i]=n}return e}createModal(e,t){(t=t||{}).content=e||"";const i=new Kl(this,t);return this.addChild(i),i.on("dispose",(()=>{this.removeChild(i)})),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<gc.length;i++){const n=gc[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(fc[e]),this.addClass(fc[n]),this.breakpoint_=n;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},yc,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;return(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return fc[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const i=this.crossOrigin();this.reset(),this.cache_.media=Pa(e);const{artist:n,artwork:r,description:s,poster:a,src:o,textTracks:l,title:u}=this.cache_.media;!r&&a&&(this.cache_.media.artwork=[{src:a,type:Pu(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:u,description:s||n||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Pu(t.poster)}]),t}return Pa(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=To(e),n=i["data-setup"];if(go(e,"vjs-fill")&&(i.fill=!0),go(e,"vjs-fluid")&&(i.fluid=!0),null!==n)try{Object.assign(i,JSON.parse(n||"{}"))}catch(e){wa.error("data-setup",e)}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,n=i.length;e<n;e++){const n=i[e],r=n.nodeName.toLowerCase();"source"===r?t.sources.push(To(n)):"track"===r&&t.tracks.push(To(n))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((e=>"number"==typeof e))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}bu.names.forEach((function(e){const t=bu[e];vc.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),vc.prototype.crossorigin=vc.prototype.crossOrigin,vc.players={};const bc=Me.navigator;vc.prototype.options_={techOrder:Tu.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:bc&&(bc.languages&&bc.languages[0]||bc.userLanguage||bc.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1},pc.forEach((function(e){vc.prototype[`handleTech${kl(e)}_`]=function(){return this.trigger(e)}})),Ol.registerComponent("Player",vc);const Tc="plugin",_c="activePlugins_",Ac={},Sc=e=>Ac.hasOwnProperty(e),wc=e=>Sc(e)?Ac[e]:void 0,Ec=(e,t)=>{e[_c]=e[_c]||{},e[_c][t]=!0},xc=(e,t,i)=>{const n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},Cc=(e,t)=>(t.prototype.name=e,function(...i){xc(this,{name:e,plugin:t,instance:null},!0);const n=new t(...[this,...i]);return this[e]=()=>n,xc(this,n.getEventHash()),n});class kc{constructor(e){if(this.constructor===kc)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),wl(this),delete this.trigger,xl(this,this.constructor.defaultState),Ec(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return rl(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[_c][e]=!1,this.player=this.state=null,t[e]=Cc(e,Ac[e])}static isBasic(e){const t="string"==typeof e?wc(e):e;return"function"==typeof t&&!kc.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Sc(e))wa.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(vc.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Ac[e]=t,e!==Tc&&(kc.isBasic(t)?vc.prototype[e]=function(e,t){const i=function(){xc(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return Ec(this,e),xc(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(e,t):vc.prototype[e]=Cc(e,t)),t}static deregisterPlugin(e){if(e===Tc)throw new Error("Cannot de-register base plugin.");Sc(e)&&(delete Ac[e],delete vc.prototype[e])}static getPlugins(e=Object.keys(Ac)){let t;return e.forEach((e=>{const i=wc(e);i&&(t=t||{},t[e]=i)})),t}static getPluginVersion(e){const t=wc(e);return t&&t.VERSION||""}}function Ic(e,t,i,n){return function(e,t){let i=!1;return function(...n){return i||wa.warn(e),i=!0,t.apply(this,n)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n)}kc.getPlugin=wc,kc.BASE_PLUGIN_NAME=Tc,kc.registerPlugin(Tc,kc),vc.prototype.usingPlugin=function(e){return!!this[_c]&&!0===this[_c][e]},vc.prototype.hasPlugin=function(e){return!!Sc(e)};const Lc=e=>0===e.indexOf("#")?e.slice(1):e;function Oc(e,t,i){let n=Oc.getPlayer(e);if(n)return t&&wa.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&n.ready(i),n;const r="string"==typeof e?No("#"+Lc(e)):e;if(!lo(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const s="getRootNode"in r&&r.getRootNode()instanceof Me.ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&s.contains(r)||wa.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),ya("beforesetup").forEach((e=>{const i=e(r,Pa(t));La(i)&&!Array.isArray(i)?t=Pa(t,i):wa.error("please return an object in beforesetup hooks")}));const a=Ol.getComponent("Player");return n=new a(r,t,i),ya("setup").forEach((e=>e(n))),n}if(Oc.hooks_=fa,Oc.hooks=ya,Oc.hook=function(e,t){ya(e,t)},Oc.hookOnce=function(e,t){ya(e,[].concat(t).map((t=>{const i=(...n)=>(va(e,i),t(...n));return i})))},Oc.removeHook=va,!0!==Me.VIDEOJS_NO_DYNAMIC_STYLE&&oo()){let If=No(".vjs-styles-defaults");if(!If){If=zo("vjs-styles-defaults");const Lf=No("head");Lf&&Lf.insertBefore(If,Lf.firstChild),Wo(If,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Vo(1,Oc),Oc.VERSION=ga,Oc.options=vc.prototype.options_,Oc.getPlayers=()=>vc.players,Oc.getPlayer=e=>{const t=vc.players;let i;if("string"==typeof e){const n=Lc(e),r=t[n];if(r)return r;i=No("#"+n)}else i=e;if(lo(i)){const{player:e,playerId:n}=i;if(e||t[n])return e||t[n]}},Oc.getAllPlayers=()=>Object.keys(vc.players).map((e=>vc.players[e])).filter(Boolean),Oc.players=vc.players,Oc.getComponent=Ol.getComponent,Oc.registerComponent=(e,t)=>(Tu.isTech(t)&&wa.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Ol.registerComponent.call(Ol,e,t)),Oc.getTech=Tu.getTech,Oc.registerTech=Tu.registerTech,Oc.use=function(e,t){_u[e]=_u[e]||[],_u[e].push(t)},Object.defineProperty(Oc,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Oc.middleware,"TERMINATOR",{value:Su,writeable:!1,enumerable:!0}),Oc.browser=so,Oc.obj=Na,Oc.mergeOptions=Ic(9,"videojs.mergeOptions","videojs.obj.merge",Pa),Oc.defineLazyProperty=Ic(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Ma),Oc.bind=Ic(9,"videojs.bind","native Function.prototype.bind",ul),Oc.registerPlugin=kc.registerPlugin,Oc.deregisterPlugin=kc.deregisterPlugin,Oc.plugin=(e,t)=>(wa.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),kc.registerPlugin(e,t)),Oc.getPlugins=kc.getPlugins,Oc.getPlugin=kc.getPlugin,Oc.getPluginVersion=kc.getPluginVersion,Oc.addLanguage=function(e,t){return e=(""+e).toLowerCase(),Oc.options.languages=Pa(Oc.options.languages,{[e]:t}),Oc.options.languages[e]},Oc.log=wa,Oc.createLogger=Ea,Oc.time=jl,Oc.createTimeRange=Ic(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ml),Oc.createTimeRanges=Ic(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ml),Oc.formatTime=Ic(9,"videojs.formatTime","videojs.time.formatTime",Fl),Oc.setFormatTime=Ic(9,"videojs.setFormatTime","videojs.time.setFormatTime",Bl),Oc.resetFormatTime=Ic(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Ul),Oc.parseUrl=Ic(9,"videojs.parseUrl","videojs.url.parseUrl",au),Oc.isCrossOrigin=Ic(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",uu),Oc.EventTarget=ml,Oc.any=al,Oc.on=il,Oc.one=sl,Oc.off=nl,Oc.trigger=rl,Oc.xhr=ot,Oc.TextTrack=pu,Oc.AudioTrack=mu,Oc.VideoTrack=gu,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{Oc[e]=function(){return wa.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Fo[e].apply(null,arguments)}})),Oc.computedStyle=Ic(9,"videojs.computedStyle","videojs.dom.computedStyle",Bo),Oc.dom=Fo,Oc.fn=hl,Oc.num=td,Oc.str=Ll,Oc.url=du,Oc.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};
23
23
  /*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */
24
- class Dc{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class Mc extends Pc.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new Dc(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Mc.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const Lf in Mc.prototype.allowedEvents_)Mc.prototype["on"+Lf]=null;var Nc="4.1.0";const Rc=function(e){return function(e,t){const i=e.qualityLevels,n=new Mc,r=function(){n.dispose(),e.qualityLevels=i,e.off("dispose",r)};return e.on("dispose",r),e.qualityLevels=()=>n,e.qualityLevels.VERSION=Nc,n}(this,Pc.obj.merge({},e))};Pc.registerPlugin("qualityLevels",Rc),Rc.VERSION=Nc;
24
+ class Pc{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class Dc extends Oc.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new Pc(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Dc.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const Of in Dc.prototype.allowedEvents_)Dc.prototype["on"+Of]=null;var Mc="4.1.0";const Nc=function(e){return function(e,t){const i=e.qualityLevels,n=new Dc,r=function(){n.dispose(),e.qualityLevels=i,e.off("dispose",r)};return e.on("dispose",r),e.qualityLevels=()=>n,e.qualityLevels.VERSION=Mc,n}(this,Oc.obj.merge({},e))};Oc.registerPlugin("qualityLevels",Nc),Nc.VERSION=Mc;
25
25
  /*! @name @videojs/http-streaming @version 3.15.0 @license Apache-2.0 */
26
- const Bc=Kt,Uc=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,qc=e=>Pc.log.debug?Pc.log.debug.bind(Pc,"VHS:",`${e} >`):function(){};function jc(...e){const t=Pc.obj||Pc;return(t.merge||t.mergeOptions).apply(t,e)}function Fc(...e){const t=Pc.time||Pc;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const Hc=1/30,Vc=.1,zc=function(e,t){const i=[];let n;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return Fc(i)},Xc=function(e,t){return zc(e,(function(e,i){return e-Vc<=t&&i+Vc>=t}))},Wc=function(e,t){return zc(e,(function(e){return e-Hc>=t}))},Gc=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Yc=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Kc=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Jc=function(e,t){let i=0;if(!e||!e.length)return i;for(let n=0;n<e.length;n++){const r=e.start(n),s=e.end(n);t>s||(i+=t>r&&t<=s?s-t:s-r)}return i},Qc=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},Zc=e=>(e.segments||[]).reduce(((e,t,i)=>(t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e)),[]),$c=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},eh=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let n=(i||[]).reduce(((e,t)=>e+("PART"===t.type?1:0)),0);return n+=t&&t.length?t.length:0,n},th=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=$c(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},ih=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const n=function(e,t){let i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(r=e.segments[n],void 0!==r.end)return{result:i+r.end,precise:!0};if(i+=Qc(e,r),void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(n.precise)return n.result;const r=function(e,t){let i,n=0,r=t-e.mediaSequence;for(;r<e.segments.length;r++){if(i=e.segments[r],void 0!==i.start)return{result:i.start-n,precise:!0};if(n+=Qc(e,i),void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return r.precise?r.result:n.result+i},nh=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return Ne.Infinity}return ih(e,t,i)},rh=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:n}){let r=0;if(i>n&&([i,n]=[n,i]),i<0){for(let t=i;t<Math.min(0,n);t++)r+=e;i=0}for(let e=i;e<n;e++)r+=t[e].duration;return r},sh=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return nh(e);if(null===t)return null;t=t||0;let r=ih(e,e.mediaSequence+e.segments.length,t);return i&&(r-=n="number"==typeof n?n:th(null,e)),Math.max(0,r)},ah=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},oh=function(e){return e.excludeUntil&&e.excludeUntil===1/0},lh=function(e){const t=ah(e);return!e.disabled&&!t},uh=function(e,t){return t.attributes&&t.attributes[e]},dh=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!lh(e)&&(e.attributes.BANDWIDTH||0)<i)).length},ch=(e,t)=>!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri)))),hh=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=!1;for(const e in i){for(const r in i[e])if(n=t(i[e][r]),n)break;if(n)break}return!!n},ph=e=>{if(!e||!e.playlists||!e.playlists.length){return hh(e,(e=>e.playlists&&e.playlists.length||e.uri))}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;if(n&&n.split(",").every((e=>mi(e))))continue;if(!hh(e,(e=>ch(i,e))))return!1}return!0};var mh={liveEdgeDelay:th,duration:nh,seekable:function(e,t,i){const n=t||0;let r=sh(e,t,!0,i);return null===r?Fc():(r<n&&(r=n),Fc(n,r))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:r,exactManifestTimings:s}){let a=t-r;const o=Zc(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i===t.segmentIndex&&("number"!=typeof n||"number"!=typeof t.partIndex||n===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,s){if(a<0)continue}else if(a+Hc<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:r-rh({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){const i=o[t];a-=i.duration;const n=i.duration>Hc;if(!(0===a)&&!(n&&a+Hc>=0)||t===o.length-1){if(s){if(a>0)continue}else if(a-Hc>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:r+rh({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:lh,isDisabled:function(e){return e.disabled},isExcluded:ah,isIncompatible:oh,playlistEnd:sh,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:uh,estimateSegmentRequestTime:function(e,t,i,n=0){if(!uh("BANDWIDTH",i))return NaN;return(e*i.attributes.BANDWIDTH-8*n)/t},isLowestEnabledRendition:dh,isAudioOnly:ph,playlistMatch:ch,segmentDurationWithParts:Qc};const{log:gh}=Pc,fh=(e,t)=>`${e}-${t}`,yh=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,vh=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i=>{if(e.mediaGroups[i])for(const n in e.mediaGroups[i])for(const r in e.mediaGroups[i][n]){const s=e.mediaGroups[i][n][r];t(s,i,n,r)}}))},bh=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},_h=(e,t,i=yh)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const i=`placeholder-uri-${t}`;e.playlists[t].uri=i}const n=ph(e);vh(e,((t,r,s,a)=>{if(!t.playlists||!t.playlists.length){if(n&&"AUDIO"===r&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===s)return}t.playlists=[Gt({},t)]}t.playlists.forEach((function(t,n){const o=i(r,s,a,t),l=fh(n,o);t.uri?t.resolvedUri=t.resolvedUri||Bc(e.uri,t.uri):(t.uri=0===n?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),(e=>{let t=e.playlists.length;for(;t--;){const i=e.playlists[t];bh({playlist:i,id:fh(t,i.uri)}),i.resolvedUri=Bc(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||gh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{vh(e,(t=>{t.uri&&(t.resolvedUri=Bc(e.uri,t.uri))}))})(e)};class Th{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach(((i,n)=>{if(!this.processedDateRanges_.has(n)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0}));for(const i of t){const t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach(((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)}))}}const Ah=({requestType:e,request:t,error:i,parseFailure:n})=>{const r=t.status<200||t.status>299,s=t.status>=400&&t.status<=499,a={uri:t.uri,requestType:e},o=r&&!s||n;if(i&&s)a.error=Gt({},i),a.errorType=Pc.Error.NetworkRequestFailed;else if(t.aborted)a.errorType=Pc.Error.NetworkRequestAborted;else if(t.timedout)a.erroType=Pc.Error.NetworkRequestTimeout;else if(o){const e=n?Pc.Error.NetworkBodyParserFailed:Pc.Error.NetworkBadStatus;a.errorType=e,a.status=t.status,a.headers=t.headers}return a},{EventTarget:Sh}=Pc,wh=(e,t)=>{if(!e)return t;const i=jc(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=jc(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},Eh=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=Bc(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Bc(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Bc(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Bc(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=Bc(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=Bc(t,e.uri))}))},xh=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},Ch=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,kh=(e,t,i=Ch)=>{const n=jc(e,{}),r=n.playlists[t.id];if(!r)return null;if(i(r,t))return null;t.segments=xh(t);const s=jc(r,t);if(s.preloadSegment&&!t.preloadSegment&&delete s.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}s.segments=((e,t,i)=>{const n=e.slice(),r=t.slice();i=i||0;const s=[];let a;for(let e=0;e<r.length;e++){const t=n[e+i],o=r[e];t?(a=t.map||a,s.push(wh(t,o))):(a&&!o.map&&(o.map=a),s.push(o))}return s})(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}s.segments.forEach((e=>{Eh(e,s.resolvedUri)}));for(let e=0;e<n.playlists.length;e++)n.playlists[e].id===t.id&&(n.playlists[e]=s);return n.playlists[t.id]=s,n.playlists[t.uri]=s,vh(e,((e,i,n,r)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=s)})),n},Ih=(e,t)=>{const i=e.segments||[],n=i[i.length-1],r=n&&n.parts&&n.parts[n.parts.length-1],s=r&&r.duration||n&&n.duration;return t&&s?1e3*s:500*(e.partTargetDuration||e.targetDuration||10)},Lh=(e,t,i)=>{if(!e)return;const n=[];return e.forEach((e=>{if(!e.attributes)return;const{BANDWIDTH:t,RESOLUTION:i,CODECS:r}=e.attributes;n.push({id:e.id,bandwidth:t,resolution:i,codecs:r})})),{type:t,isLive:i,renditions:n}};class Oh extends Sh{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=qc("PlaylistLoader");const{withCredentials:n=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=n,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const r=t.options_;this.customTagParsers=r&&r.customTagParsers||[],this.customTagMappers=r&&r.customTagMappers||[],this.llhls=r&&r.llhls,this.dateRangesStorage_=new Th,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=Bc(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let n=t.mediaSequence+t.segments.length;if(e){const r=e.parts||[],s=eh(t)-1;s>-1&&s!==r.length-1&&(i._HLS_part=s),(s>-1||r.length)&&n--}i._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new Ne.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])})),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(e,t,i){const{uri:n,id:r}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[r],status:e.status,message:`HLS playlist request error at URL: ${n}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Ah({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:n=[],customTagMappers:r=[],llhls:s})=>{const a=new ai;e&&a.on("warn",e),t&&a.on("info",t),n.forEach((e=>a.addParser(e))),r.forEach((e=>a.addTagMapper(e))),a.push(i),a.end();const o=a.manifest;if(s||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce(((e,t)=>Math.max(e,t.duration)),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const l=$c(o);if(l.length&&!o.partTargetDuration){const t=l.reduce(((e,t)=>Math.max(e,t.duration)),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),gh.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(e){this.error=e,this.error.metadata={errorType:Pc.Error.StreamingHlsPlaylistParserError,error:e}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null,this.state="HAVE_METADATA";const r={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:r});const s=t||this.parseManifest_({url:i,manifestString:e});s.lastRequest=Date.now(),bh({playlist:s,uri:i,id:n});const a=kh(this.main,s);this.targetDuration=s.partTargetDuration||s.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ih(this.media(),!!a)),r.parsedPlaylist=Lh(this.main.playlists,r.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:r}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),Ne.clearTimeout(this.mediaUpdateTimeout),Ne.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Th,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(Ne.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=Ne.setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,n=!this.media_||e.id!==this.media_.id,r=this.main.playlists[e.id];if(r&&r.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Ih(e,!0)),!n)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const s={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:s}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,n)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Uc(e.resolvedUri,n),t)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:s}),this.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}}))}pause(){this.mediaUpdateTimeout&&(Ne.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(Ne.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=Ne.setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(Ne.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=Ne.setTimeout((()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)}),e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=Ne.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Ah({requestType:i.requestType,request:i,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Uc(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const n=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=Lh(n.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(n)}))}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,_h(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=xh(e),e.segments.forEach((t=>{Eh(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||Ne.location.href;this.main=((e,t)=>{const i=fh(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:Ne.location.href,resolvedUri:Ne.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,n=e.ID;let r=i.playlists.length;for(;r--;){const s=i.playlists[r];if(s.attributes["PATHWAY-ID"]===n){const a=s.resolvedUri,o=s.id;if(t){const t=this.createCloneURI_(s.resolvedUri,e),a=fh(n,t),o=this.createCloneAttributes_(n,s.attributes),l=this.createClonePlaylist_(s,a,e,o);i.playlists[r]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(r,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][n])for(const t in i.mediaGroups[e])if(t===n){for(const n in i.mediaGroups[e][t]){i.mediaGroups[e][t][n].playlists.forEach(((e,t)=>{const n=i.playlists[e.id],r=n.id,s=n.resolvedUri;delete i.playlists[r],delete i.playlists[s]}))}delete i.mediaGroups[e][t]}})),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,n=i.playlists.length,r=this.createCloneURI_(t.resolvedUri,e),s=fh(e.ID,r),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,s,e,a);i.playlists[n]=o,i.playlists[s]=o,i.playlists[r]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],n=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((r=>{if(n.mediaGroups[r]&&!n.mediaGroups[r][t])for(const s in n.mediaGroups[r])if(s===i){n.mediaGroups[r][t]={};for(const i in n.mediaGroups[r][s]){const a=n.mediaGroups[r][s][i];n.mediaGroups[r][t][i]=Gt({},a);const o=n.mediaGroups[r][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach(((s,a)=>{const l=n.playlists[s.id],u=yh(r,t,i),d=fh(t,u);if(l&&!n.playlists[d]){const t=this.createClonePlaylist_(l,d,e),i=t.resolvedUri;n.playlists[d]=t,n.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(s,d,e)}))}}}))}createClonePlaylist_(e,t,i,n){const r=this.createCloneURI_(e.resolvedUri,i),s={resolvedUri:r,uri:r,id:t};return e.segments&&(s.segments=[]),n&&(s.attributes=n),jc(e,s)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const n=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(n))i.searchParams.set(e,n[e]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((n=>{t[n]&&(i[n]=e)})),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes.keyId;n&&t.add(n.toLowerCase())}return t}}}const Ph=function(e,t,i,n){const r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},Dh=function(){const e=function e(t,i){t=jc({timeout:45e3},t);const n=e.beforeRequest||Pc.Vhs.xhr.beforeRequest,r=e._requestCallbackSet||Pc.Vhs.xhr._requestCallbackSet||new Set,s=e._responseCallbackSet||Pc.Vhs.xhr._responseCallbackSet;n&&"function"==typeof n&&(Pc.log.warn("beforeRequest is deprecated, use onRequest instead."),r.add(n));const a=!0===Pc.Vhs.xhr.original?Pc.xhr:Pc.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach((e=>{i=e(i)})),i})(r,t);r.delete(n);const l=a(o||t,(function(e,t){return((e,t,i,n)=>{e&&e.size&&e.forEach((e=>{e(t,i,n)}))})(s,l,e,t),Ph(l,e,t,i)})),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=t.uri,l.requestType=t.requestType,l.requestTime=Date.now(),l};return e.original=!0,e},Mh=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Ne.BigInt(e.offset)+Ne.BigInt(e.length)-Ne.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},Nh=function(e,t){return e.start(t)+"-"+e.end(t)},Rh=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Bh=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Uh=function(e){const t={};return Object.keys(e).forEach((i=>{const n=e[i];Ai(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},qh=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},jh=function(e){return e.resolvedUri},Fh=e=>{const t=Array.prototype.slice.call(e),i=16;let n,r,s="";for(let e=0;e<t.length/i;e++)n=t.slice(e*i,e*i+i).map(Rh).join(""),r=t.slice(e*i,e*i+i).map(Bh).join(""),s+=n+" "+r+"\n";return s};var Hh=Object.freeze({__proto__:null,createTransferableMessage:Uh,initSegmentId:qh,segmentKeyId:jh,hexDump:Fh,tagDump:({bytes:e})=>Fh(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=Nh(e,t)+" ";return i}});const Vh=({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const n=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,n=0;for(let r=0;r<t.segments.length&&(i=t.segments[r],n=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration,!(e<=n));r++);const r=t.segments[t.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*r.duration)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!n)return i({message:"valid programTime was not found"});if("estimate"===n.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const r={mediaSeconds:t},s=((e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n)})(t,n.segment);return s&&(r.programDateTime=s.toISOString()),i(null,r)},zh=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:r=!0,tech:s,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!s.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let n=t.segments[0];if(i<new Date(n.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(n=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);const r=t.segments[t.segments.length-1],s=r.dateTimeObject,a=r.videoTimingInfo?(o=r.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:r.duration+.25*r.duration;var o;return i>new Date(s.getTime()+1e3*a)?null:(i>new Date(s)&&(n=r),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:mh.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});const l=o.segment,u=((e,t)=>{let i,n;try{i=new Date(e),n=new Date(t)}catch(e){}const r=i.getTime();return(n.getTime()-r)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(n(o.estimatedStart+u),void s.one("seeked",(()=>{zh({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:r,tech:s,callback:a})})));const d=l.start+u;s.one("seeked",(()=>a(null,s.currentTime()))),r&&s.pause(),n(d)},Xh=(e,t)=>{if(4===e.readyState)return t()},Wh=(e,t,i,n)=>{let r,s=[],a=!1;const o=function(e,t,n,r){return t.abort(),a=!0,i(e,t,n,r)},l=function(e,t){if(a)return;if(e)return e.metadata=Ah({requestType:n,request:t,error:e}),o(e,t,"",s);const i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length);if(s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})),t.length<=1)return Si(t[0]);var n=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}),0),r=new Uint8Array(n),s=0;return t.forEach((function(e){e=Si(e),r.set(e,s),s+=e.byteLength})),r}(s,ki(i,!0)),r=r||Xs(s),s.length<10||r&&s.length<r+2)return Xh(t,(()=>o(e,t,"",s)));const l=pa(s);return"ts"===l&&s.length<188||!l&&s.length<376?Xh(t,(()=>o(e,t,"",s))):o(null,t,l,s)},u={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:i}){return Ph(e,null,{statusCode:e.status},l)}))}},d=t(u,(function(e,t){return Ph(d,e,t,l)}));return d},{EventTarget:Gh}=Pc,Yh=function(e,t){if(!Ch(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const n=e.segments[i],r=t.segments[i];if(n.uri!==r.uri)return!1;if(!n.byterange&&!r.byterange)continue;const s=n.byterange,a=r.byterange;if(s&&!a||!s&&a)return!1;if(s.offset!==a.offset||s.length!==a.length)return!1}return!0},Kh=(e,t,i,n)=>`placeholder-uri-${e}-${t}-${n.attributes.NAME||i}`,Jh=(e,t,i)=>{let n=!0,r=jc(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const s=t.playlists[e];if(s.sidx){const e=us(s.sidx);i&&i[e]&&i[e].sidx&&is(s,i[e].sidx,s.sidx.resolvedUri)}const a=kh(r,s,Yh);a&&(r=a,n=!1)}return vh(t,((e,t,i,s)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=kh(r,e.playlists[0],Yh);o&&(r=o,s in r.mediaGroups[t][i]||(r.mediaGroups[t][i][s]=e),r.mediaGroups[t][i][s].playlists[0]=r.playlists[a],n=!1)}})),((e,t)=>{vh(e,((i,n,r,s)=>{t.mediaGroups[n][r]&&s in t.mediaGroups[n][r]||delete e.mediaGroups[n][r][s]}))})(r,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:r},Qh=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,Zh=(e,t)=>{const i={};for(const n in e){const r=e[n].sidx;if(r){const e=us(r);if(!t[e])break;const n=t[e].sidxInfo;Qh(n,r)&&(i[e]=t[e])}}return i};class $h extends Gh{constructor(e,t,i={},n){super(),this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);const{withCredentials:r=!1}=i;if(this.vhs_=t,this.withCredentials=r,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()})),this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)})),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=qc("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const n=e.sidx&&us(e.sidx);if(!e.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n])return void(this.mediaRequest_=Ne.setTimeout((()=>i(!1)),0));const r=Uc(e.sidx.resolvedUri),s=(r,s)=>{if(this.requestErrored_(r,s,t))return;const a=this.mainPlaylistLoader_.sidxMapping_,{requestType:o}=s;let l;try{l=Vs(Si(s.response).subarray(8))}catch(e){return e.metadata=Ah({requestType:o,request:s,parseFailure:!0}),void this.requestErrored_(e,s,t)}return a[n]={sidxInfo:e.sidx,sidx:l},is(e,l,e.sidx.resolvedUri),i(!0)};this.request=Wh(r,this.vhs_.xhr,((t,i,n,a)=>{if(t)return s(t,i);if(!n||"mp4"!==n){const t=n||"unknown";return s({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${r}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i)}const{offset:o,length:l}=e.sidx.byterange;if(a.length>=l+o)return s(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",requestType:"dash-sidx",headers:Mh({byterange:e.sidx.byterange})},s)}),"dash-sidx")}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},Ne.clearTimeout(this.minimumUpdatePeriodTimeout_),Ne.clearTimeout(this.mediaRequest_),Ne.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,(i=>{this.haveMetadata({startingState:t,playlist:e})})))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),Ne.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(Ne.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){Ne.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=Ne.setTimeout((()=>this.load()),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_(((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})):this.mediaRequest_=Ne.setTimeout((()=>this.haveMain_()),0)}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},((i,n)=>{if(i){const{requestType:e}=n;i.metadata=Ah({requestType:e,request:n,error:i})}if(this.requestErrored_(i,n))return void("HAVE_NOTHING"===this.state&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const r=n.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?this.mainLoaded_=Date.parse(n.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Uc(this.mainPlaylistLoader_.srcUrl,n),r?(this.handleMain_(),void this.syncClientServerClock_((()=>e(n,r)))):e(n,r)}))}syncClientServerClock_(e){const t=js(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Bc(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},((i,n)=>{if(!this.request)return;if(i){const{requestType:t}=n;return this.error.metadata=Ah({requestType:t,request:n,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let r;r="HEAD"===t.method?n.responseHeaders&&n.responseHeaders.date?Date.parse(n.responseHeaders.date):this.mainLoaded_:Date.parse(n.responseText),this.mainPlaylistLoader_.clientOffset_=r-Date.now(),e()})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:r})=>{const s=qs(e,{manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:r});return _h(s,t,Kh),s})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:Pc.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}e&&(i=Jh(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const n=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(n&&n!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=n),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:e,endList:n}=i,r=[];i.playlists.forEach((e=>{r.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}));const s={duration:e,isLive:!n,renditions:r};t.parsedManifest=s,this.trigger({type:"manifestparsecomplete",metadata:t})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(Ne.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=Ne.setTimeout((()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)}refreshXml_(){this.requestMain_(((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let i=Zh(e.playlists,t);return vh(e,((e,n,r,s)=>{if(e.playlists&&e.playlists.length){const n=e.playlists;i=jc(i,Zh(n,t))}})),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(e=>{this.refreshMedia_(this.media().id)})))}))}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=Ne.setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),Ih(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map((e=>({cueTime:e.start,frames:[{data:e.messageData}]})));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes["cenc:default_KID"];n&&t.add(n.replace(/-/g,"").toLowerCase())}return t}}}var ep={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const tp=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},ip=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e),i=tp(new Worker(t));i.objURL=t;const n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},np=function(e){return`var browserWorkerPolyFill = ${tp.toString()};\nbrowserWorkerPolyFill(self);\n`+e},rp=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},sp=np(rp((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(s=[],n=arguments.length,n=1;n<arguments.length;++n)s.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,s)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},t.prototype.partialFlush=function(e){this.trigger("partialdone",e)},t.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},t.prototype.reset=function(e){this.trigger("reset",e)};var i,n,r,s,a,o,l,u,d,c,h,p,m,g,f,y,v,b,_,T,A,S,w,E,x,C,k,I,L,O,P,D,M,N,R,B,U,q,j,F,H=t,V=Math.pow(2,32),z={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*V+i.getUint32(4)},MAX_UINT32:V},X=z.MAX_UINT32;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),x=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),E=new Uint8Array([0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),k=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),I={video:C,audio:k},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),O=new Uint8Array([0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,0,0,0,0,0]),M=D,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=D,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),i=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},n=function(){return i(S.dinf,i(S.dref,P))},r=function(e){return i(S.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},f=function(e){return i(S.hdlr,I[e])},g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),i(S.mdhd,t)},m=function(e){return i(S.mdia,g(e),f(e.type),o(e))},a=function(e){return i(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return i(S.minf,"video"===e.type?i(S.vmhd,L):i(S.smhd,O),n(),v(e))},l=function(e,t){for(var n=[],r=t.length;r--;)n[r]=_(t[r]);return i.apply(null,[S.moof,a(e)].concat(n))},u=function(e){for(var t=e.length,n=[];t--;)n[t]=h(e[t]);return i.apply(null,[S.moov,c(4294967295)].concat(n).concat(d(e)))},d=function(e){for(var t=e.length,n=[];t--;)n[t]=T(e[t]);return i.apply(null,[S.mvex].concat(n))},c=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i(S.mvhd,t)},y=function(e){var t,n,r=e.samples||[],s=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)t=r[n].flags,s[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return i(S.sdtp,s)},v=function(e){return i(S.stbl,b(e),i(S.stts,R),i(S.stsc,M),i(S.stsz,N),i(S.stco,D))},b=function(e){return i(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?B(e):U(e))},B=function(e){var t,n,r=e.sps||[],s=e.pps||[],a=[],o=[];for(t=0;t<r.length;t++)a.push((65280&r[t].byteLength)>>>8),a.push(255&r[t].byteLength),a=a.concat(Array.prototype.slice.call(r[t]));for(t=0;t<s.length;t++)o.push((65280&s[t].byteLength)>>>8),o.push(255&s[t].byteLength),o=o.concat(Array.prototype.slice.call(s[t]));if(n=[S.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i(S.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],a,[s.length],o))),i(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];n.push(i(S.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return i.apply(null,n)},U=function(e){return i(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),r(e))},p=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return i(S.tkhd,t)},_=function(e){var t,n,r,s,a,o;return t=i(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/X),o=Math.floor(e.baseMediaDecodeTime%X),n=i(S.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=A(e,92),i(S.traf,t,n,r)):(s=y(e),r=A(e,s.length+92),i(S.traf,t,n,r,s))},h=function(e){return e.duration=e.duration||4294967295,i(S.trak,p(e),m(e))},T=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),i(S.trex,t)},F=function(e,t){var i=0,n=0,r=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(s=8)),[0,0,i|n|r|s,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(e,t){var n,r,s,a,o,l;for(t+=20+16*(a=e.samples||[]).length,s=F(a,t),(r=new Uint8Array(s.length+16*a.length)).set(s),n=s.length,l=0;l<a.length;l++)o=a[l],r[n++]=(4278190080&o.duration)>>>24,r[n++]=(16711680&o.duration)>>>16,r[n++]=(65280&o.duration)>>>8,r[n++]=255&o.duration,r[n++]=(4278190080&o.size)>>>24,r[n++]=(16711680&o.size)>>>16,r[n++]=(65280&o.size)>>>8,r[n++]=255&o.size,r[n++]=o.flags.isLeading<<2|o.flags.dependsOn,r[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[n++]=61440&o.flags.degradationPriority,r[n++]=15&o.flags.degradationPriority,r[n++]=(4278190080&o.compositionTimeOffset)>>>24,r[n++]=(16711680&o.compositionTimeOffset)>>>16,r[n++]=(65280&o.compositionTimeOffset)>>>8,r[n++]=255&o.compositionTimeOffset;return i(S.trun,r)},q=function(e,t){var n,r,s,a,o,l;for(t+=20+8*(a=e.samples||[]).length,s=F(a,t),(n=new Uint8Array(s.length+8*a.length)).set(s),r=s.length,l=0;l<a.length;l++)o=a[l],n[r++]=(4278190080&o.duration)>>>24,n[r++]=(16711680&o.duration)>>>16,n[r++]=(65280&o.duration)>>>8,n[r++]=255&o.duration,n[r++]=(4278190080&o.size)>>>24,n[r++]=(16711680&o.size)>>>16,n[r++]=(65280&o.size)>>>8,n[r++]=255&o.size;return i(S.trun,n)},A=function(e,t){return"audio"===e.type?q(e,t):j(e,t)};var W,G,Y,K,J,Q,Z,$,ee={ftyp:s=function(){return i(S.ftyp,w,E,w,x)},mdat:function(e){return i(S.mdat,e)},moof:l,moov:u,initSegment:function(e){var t,i=s(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},te=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},ie={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},groupFramesIntoGops:function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,n,r,s,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(s=e[i],n=0;n<s.length;n++)a=s[n],o+=(r=te(a,o)).size,l.push(r);return l},concatenateNalData:function(e){var t,i,n,r,s,a,o=0,l=e.byteLength,u=e.nalCount,d=new Uint8Array(l+4*u),c=new DataView(d.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(s=r[i],n=0;n<s.length;n++)a=s[n],c.setUint32(o,a.data.byteLength),o+=4,d.set(a.data,o),o+=a.data.byteLength;return d},generateSampleTableForFrame:function(e,t){var i,n=[];return i=te(e,t||0),n.push(i),n},concatenateNalDataForFrame:function(e){var t,i,n=0,r=e.byteLength,s=e.length,a=new Uint8Array(r+4*s),o=new DataView(a.buffer);for(t=0;t<e.length;t++)i=e[t],o.setUint32(n,i.data.byteLength),n+=4,a.set(i.data,n),n+=i.data.byteLength;return a}},ne=[33,16,5,32,164,27],re=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(e){for(var t=[];e--;)t.push(0);return t},ae=9e4;Q=function(e,t){return G(J(e,t))},Z=function(e,t){return Y(K(e),t)},$=function(e,t,i){return K(i?e:e-t)};var oe={ONE_SECOND_IN_TS:ae,secondsToVideoTs:G=function(e){return e*ae},secondsToAudioTs:Y=function(e,t){return e*t},videoTsToSeconds:K=function(e){return e/ae},audioTsToSeconds:J=function(e,t){return e/t},audioTsToVideoTs:Q,videoTsToAudioTs:Z,metadataTsToSeconds:$},le=function(){if(!W){var e={96e3:[ne,[227,64],se(154),[56]],88200:[ne,[231],se(170),[56]],64e3:[ne,[248,192],se(240),[56]],48e3:[ne,[255,192],se(268),[55,148,128],se(54),[112]],44100:[ne,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[ne,[255,192],se(268),[55,234],se(226),[112]],24e3:[ne,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[ne,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12e3:[re,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[re,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8e3:[re,se(268),[3,121,16],se(47),[7]]};t=e,W=Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return W},ue=oe,de={prefixWithSilence:function(e,t,i,n){var r,s,a,o,l,u=0,d=0,c=0;if(t.length&&(r=ue.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),s=Math.ceil(ue.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(u=r-Math.max(i,n),c=(d=Math.floor(u/s))*s),!(d<1||c>ue.ONE_SECOND_IN_TS/2))){for((a=le()[e.samplerate])||(a=t[0].data),o=0;o<d;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-s,pts:l.pts-s});return e.baseMediaDecodeTime-=Math.floor(ue.videoTsToAudioTs(c,e.samplerate)),c}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r}},ce=oe.ONE_SECOND_IN_TS,he={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/ce,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},pe={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,n=0,r=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,r,s,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)s={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(s.ccData=t[r+3]<<8|t[r+4],a.push(s));return a},discardEmulationPreventionBytes:function(e){for(var t,i,n=e.byteLength,r=[],s=1;s<n-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},me=H,ge=pe,fe=function(e){e=e||{},fe.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new xe(0,0),new xe(0,1),new xe(1,0),new xe(1,1)],this.parse708captions_&&(this.cc708Stream_=new Te({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};fe.prototype=new me,fe.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=ge.parseSei(e.escapedRBSP)).payload&&t.payloadType===ge.USER_DATA_REGISTERED_ITU_T_T35&&(i=ge.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=ge.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},fe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},fe.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},fe.prototype.flush=function(){return this.flushStream("flush")},fe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},fe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},fe.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},fe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},fe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},fe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},fe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ve=function(e){return 32<=e&&e<=127||160<=e&&e<=255},be=function(e){this.windowNum=e,this.reset()};be.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},be.prototype.getText=function(){return this.rows.join("\n")},be.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},be.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},be.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},be.prototype.addText=function(e){this.rows[this.rowIdx]+=e},be.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var _e=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new be(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};_e.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new be(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},_e.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},_e.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var Te=function(e){e=e||{},Te.prototype.init.call(this);var t,i=this,n=e.captionServices||{},r={};Object.keys(n).forEach((e=>{t=n[e],/^SERVICE/.test(e)&&(r[e]=t.encoding)})),this.serviceEncodings=r,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};Te.prototype=new me,Te.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Te.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},Te.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,s=t[r++];for(e.seq=s>>6,e.sizeCode=63&s;r<t.length;r++)n=31&(s=t[r++]),7===(i=s>>5)&&n>0&&(i=s=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},Te.prototype.pushServiceBlock=function(e,t,i){var n,r=t,s=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,r));r<t+i&&r<s.length;r++)n=s[r],ve(n)?r=this.handleText(r,a):24===n?r=this.multiByteCharacter(r,a):16===n?r=this.extendedCommands(r,a):128<=n&&n<=135?r=this.setCurrentWindow(r,a):152<=n&&n<=159?r=this.defineWindow(r,a):136===n?r=this.clearWindows(r,a):140===n?r=this.deleteWindows(r,a):137===n?r=this.displayWindows(r,a):138===n?r=this.hideWindows(r,a):139===n?r=this.toggleWindows(r,a):151===n?r=this.setWindowAttributes(r,a):144===n?r=this.setPenAttributes(r,a):145===n?r=this.setPenColor(r,a):146===n?r=this.setPenLocation(r,a):143===n?a=this.reset(r,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&r++},Te.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return ve(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},Te.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Te.prototype.initService=function(e,t){var i,n,r=this;return(i="SERVICE"+e)in this.serviceEncodings&&(n=this.serviceEncodings[i]),this.services[e]=new _e(e,n,r),this.services[e].init(this.getPts(t),(function(t){r.flushDisplayed(t,r.services[e])})),this.services[e]},Te.prototype.handleText=function(e,t,i){var n,r,s,a,o=i&&i.isExtended,l=i&&i.isMultiByte,u=this.current708Packet.data,d=o?4096:0,c=u[e],h=u[e+1],p=t.currentWindow;if(l?(r=[c,h],e++):r=[c],t.textDecoder_&&!o)n=t.textDecoder_.decode(new Uint8Array(r));else if(l){const e=r.map((e=>("0"+(255&e).toString(16)).slice(-2))).join("");n=String.fromCharCode(parseInt(e,16))}else a=ye[s=d|c]||s,n=4096&s&&s===a?"":String.fromCharCode(a);return p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(n),e},Te.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,n=i[e+1],r=i[e+2];return ve(n)&&ve(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Te.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},Te.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],r=7&n;t.setCurrentWindow(r);var s=t.currentWindow;return n=i[++e],s.visible=(32&n)>>5,s.rowLock=(16&n)>>4,s.columnLock=(8&n)>>3,s.priority=7&n,n=i[++e],s.relativePositioning=(128&n)>>7,s.anchorVertical=127&n,n=i[++e],s.anchorHorizontal=n,n=i[++e],s.anchorPoint=(240&n)>>4,s.rowCount=15&n,n=i[++e],s.columnCount=63&n,n=i[++e],s.windowStyle=(56&n)>>3,s.penStyle=7&n,s.virtualRowCount=s.rowCount+1,e},Te.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},Te.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},Te.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Te.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=1);return e},Te.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=0);return e},Te.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible^=1);return e},Te.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].clearText();return e},Te.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].reset();return e},Te.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penAttr;return n=i[++e],r.textTag=(240&n)>>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},Te.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},Te.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},Te.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Ae={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Se=function(e){return null===e?"":(e=Ae[e]||e,String.fromCharCode(e))},we=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ee=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},xe=function(e,t){xe.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,s;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ee();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ee();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ee()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))s=Se((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),s=Se((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~r||this.addFormatting(e.pts,["i"]),1&~r||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r)){const e=3&r;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(n,r)){var a=we.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(r)&&(14&~r||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(n)&&(0===r&&(r=null),s=Se(n),s+=Se(r),this[this.mode_](e.pts,s),this.column_+=s.length)}else this.lastControlCode_=null}};xe.prototype=new me,xe.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach(((e,n)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(n)}e.text.length&&i.push({text:e.text,line:n+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(n)})),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},xe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ee(),this.nonDisplayed_=Ee(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},xe.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},xe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},xe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},xe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},xe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},xe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},xe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},xe.prototype.isNormalChar=function(e){return e>=32&&e<=127},xe.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ee(),this.displayed_=Ee()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},xe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},xe.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},xe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},xe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},xe.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},xe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var Ce={CaptionStream:fe,Cea608Stream:xe,Cea708Stream:Te},ke={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ie=H,Le="shared",Oe=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Pe=function(e){var t,i;Pe.prototype.init.call(this),this.type_=e||Le,this.push=function(e){"metadata"!==e.type?this.type_!==Le&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Oe(e.dts,i),e.pts=Oe(e.pts,i),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Pe.prototype=new Ie;var De,Me={TimestampRolloverStream:Pe,handleRollover:Oe},Ne=(e,t,i)=>{if(!e)return-1;for(var n=i;n<e.length;n++)if(e[n]===t)return n;return-1},Re=Ne,Be=3,Ue=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},qe=function(e,t,i){return decodeURIComponent(Ue(e,t,i))},je=function(e,t,i){return unescape(Ue(e,t,i))},Fe=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},He={APIC:function(e){var t,i,n=1;e.data[0]===Be&&((t=Re(e.data,0,n))<0||(e.mimeType=je(e.data,n,t),n=t+1,e.pictureType=e.data[n],n++,(i=Re(e.data,0,n))<0||(e.description=qe(e.data,n,i),n=i+1,"--\x3e"===e.mimeType?e.url=je(e.data,n,e.data.length):e.pictureData=e.data.subarray(n,e.data.length))))},"T*":function(e){e.data[0]===Be&&(e.value=qe(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===Be&&-1!==(t=Re(e.data,0,1))&&(e.description=qe(e.data,1,t),e.value=qe(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=je(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;e.data[0]===Be&&-1!==(t=Re(e.data,0,1))&&(e.description=qe(e.data,1,t),e.url=je(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=je(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},Ve={parseId3Frames:function(e){var t,i=10,n=0,r=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){n=Fe(e.subarray(6,10)),n+=10,64&e[5]&&(i+=4,i+=Fe(e.subarray(10,14)),n-=Fe(e.subarray(16,20)));do{if((t=Fe(e.subarray(i+4,i+8)))<1)break;var s={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};s.key=s.id,He[s.id]?He[s.id](s):"T"===s.id[0]?He["T*"](s):"W"===s.id[0]&&He["W*"](s),r.push(s),i+=10,i+=t}while(i<n);return r}},parseSyncSafeInteger:Fe,frameParsers:He},ze=ke,Xe=Ve;(De=function(e){var t,i={descriptor:e&&e.descriptor},n=0,r=[],s=0;if(De.prototype.init.call(this),this.dispatchType=ze.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(s=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(e),s+=e.data.byteLength,1===r.length&&(n=Xe.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(s<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)t.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,s-=r[0].data.byteLength,r.shift();i=10,64&t.data[5]&&(i+=4,i+=Xe.parseSyncSafeInteger(t.data.subarray(10,14)),n-=Xe.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=Xe.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,Xe.frameParsers[o.id]?Xe.frameParsers[o.id](o):"T"===o.id[0]?Xe.frameParsers["T*"](o):"W"===o.id[0]&&Xe.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var u=o.data,d=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;d*=4,d+=3&u[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<n);this.trigger("data",t)}}}).prototype=new H;var We,Ge,Ye,Ke=De,Je=H,Qe=Ce,Ze=ke,$e=Me.TimestampRolloverStream,et=188;(We=function(){var e=new Uint8Array(et),t=0;We.prototype.init.call(this),this.push=function(i){var n,r=0,s=et;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;s<n.byteLength;)71!==n[r]||71!==n[s]?(r++,s++):(this.trigger("data",n.subarray(r,s)),r+=et,s+=et);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===et&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new Je,Ge=function(){var e,t,i,n;Ge.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var s=e[r],a=(31&e[r+1])<<8|e[r+2];s===Ze.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:s===Ze.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:s===Ze.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=s),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ze.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ze.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},Ge.prototype=new Je,Ge.STREAM_TYPES={h264:27,adts:15},Ye=function(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},s={data:[],size:0},a=function(e,i,n){var r,s,a=new Uint8Array(e.size),o={type:i},l=0,u=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)s=e.data[l],a.set(s.data,u),u+=s.data.byteLength;!function(e,t){var i;const n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,o),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};Ye.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ze.H264_STREAM_TYPE:e=n,t="video";break;case Ze.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ze.METADATA_STREAM_TYPE:e=s,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[o.type]()},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(n,"video"),a(r,"audio"),a(s,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}},Ye.prototype=new Je;var tt={PAT_PID:0,MP2T_PACKET_LENGTH:et,TransportPacketStream:We,TransportParseStream:Ge,ElementaryStream:Ye,TimestampRolloverStream:$e,CaptionStream:Qe.CaptionStream,Cea608Stream:Qe.Cea608Stream,Cea708Stream:Qe.Cea708Stream,MetadataStream:Ke};for(var it in Ze)Ze.hasOwnProperty(it)&&(tt[it]=Ze[it]);var nt,rt=tt,st=oe.ONE_SECOND_IN_TS,at=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(nt=function(e){var t,i=0;nt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(n){var r,s,a,o,l,u=0;if(e||(i=0),"audio"===n.type){var d;for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+n.data.byteLength)).set(a),t.set(n.data,a.byteLength)):t=n.data;u+7<t.length;)if(255===t[u]&&240==(246&t[u+1])){if("number"==typeof d&&(this.skipWarn_(d,u),d=null),s=2*(1&~t[u+1]),r=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,l=(o=1024*(1+(3&t[u+6])))*st/at[(60&t[u+2])>>>2],t.byteLength-u<r)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:o,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:at[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+s,u+r)}),i++,u+=r}else"number"!=typeof d&&(d=u),u++;"number"==typeof d&&(this.skipWarn_(d,u),d=null),t=t.subarray(u)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new H;var ot,lt=nt;ot=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");s.set(e.subarray(r,r+a)),i=new DataView(s.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),s=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?s<<r|this.readBits(r):s},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(i&2147483648>>>e)return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var ut,dt,ct,ht=H,pt=ot;(dt=function(){var e,t,i=0;dt.prototype.init.call(this),this.push=function(n){var r;t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var s=t.byteLength;i<s-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<s;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<s);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ht,ct={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ut=function(){var e,t,i,n,r,s,a,o=new dt;ut.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:n,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(a.subarray(1)),o.config=s(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},r=function(e){for(var t,i,n=e.byteLength,r=[],s=1;s<n-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},s=function(e){var t,i,n,r,s,o,l,u,d,c,h,p,m=0,g=0,f=0,y=0,v=[1,1];if(i=(t=new pt(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ct[i]&&(3===(s=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==s?8:12,p=0;p<h;p++)t.readBoolean()&&a(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),d=t.readUnsignedExpGolomb(),0===(c=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),f=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:16*(u+1)-2*m-2*g,height:(2-c)*(d+1)*16-2*f-2*y,sarRatio:v}}},ut.prototype=new ht;var mt,gt={H264Stream:ut,NalByteStream:dt},ft=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],yt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},vt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=yt(e,t),vt(e,t))},bt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},_t={isLikelyAacData:function(e){var t=vt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:yt,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&!(240&~e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return ft[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=bt(e.subarray(10,14)));do{if((i=bt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r<n.byteLength;r++)if(0===n[r]){var s=unescape(function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r}(n,0,r));if("com.apple.streaming.transportStreamTimestamp"===s){var a=n.subarray(r+1),o=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return o*=4,o+=3&a[7]}break}}t+=10,t+=i}while(t<e.byteLength);return null}},Tt=_t;(mt=function(){var e=new Uint8Array,t=0;mt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s,a,o=0,l=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255&~e[l]||240&~e[l+1])l++;else{if(e.length-l<7)break;if(l+(o=Tt.parseAdtsSize(e,l))>e.length)break;s={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",s),l+=o}else{if(e.length-l<10)break;if(l+(o=Tt.parseId3TagSize(e,l))>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",r),l+=o}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var At,St,wt,Et,xt=H,Ct=ee,kt=ie,It=de,Lt=he,Ot=rt,Pt=oe,Dt=lt,Mt=gt.H264Stream,Nt=mt,Rt=_t.isLikelyAacData,Bt=oe.ONE_SECOND_IN_TS,Ut=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],qt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],jt=function(e,t){t.stream=e,this.trigger("log",t)},Ft=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var r=i[n];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",jt.bind(e,r))}},Ht=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Vt=function(e,t,i,n,r,s){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(r-i)},prependedContentDuration:s,baseMediaDecodeTime:e}};St=function(e,t){var i,n=[],r=0,s=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,St.prototype.init.call(this),this.push=function(t){Lt.collectDtsInfo(e,t),e&&Ut.forEach((function(i){e[i]=t[i]})),n.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var o,l,u,d,c,h,p;0!==n.length?(o=It.trimAdtsFramesByEarliestDts(n,e,r),e.baseMediaDecodeTime=Lt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=It.prefixWithSilence(e,o,s,a),e.samples=It.generateSampleTable(o),u=Ct.mdat(It.concatenateFrameData(o)),n=[],l=Ct.moof(i,[e]),d=new Uint8Array(l.byteLength+u.byteLength),i++,d.set(l),d.set(u,l.byteLength),Lt.clearDtsInfo(e),c=Math.ceil(1024*Bt/e.samplerate),o.length&&(h=o.length*c,this.trigger("segmentTimingInfo",Vt(Pt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:d}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Lt.clearDtsInfo(e),n=[],this.trigger("reset")}},St.prototype=new xt,At=function(e,t){var i,n,r,s=[],a=[];i=(t=t||{}).firstSequenceNumber||0,At.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Lt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],qt.forEach((function(t){e[t]=n[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var n,r,o,l,u,d,c,h,p=0;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=kt.groupNalsIntoFrames(s),(o=kt.groupFramesIntoGops(n))[0][0].keyFrame||((r=this.getGopForFusion_(s[0],e))?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=kt.extendFirstKeyFrame(o)),a.length){var m;if(!(m=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Lt.clearDtsInfo(e),o=m}Lt.collectDtsInfo(e,o),e.samples=kt.generateSampleTable(o),u=Ct.mdat(kt.concatenateNalData(o)),e.baseMediaDecodeTime=Lt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),c=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Vt(e.baseMediaDecodeTime,c.dts,c.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=Ct.moof(i,[e]),d=new Uint8Array(l.byteLength+u.byteLength),i++,d.set(l),d.set(u,l.byteLength),this.trigger("data",{track:e,boxes:d}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),s=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){Lt.clearDtsInfo(e),n=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,s,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)r=(s=this.gopCache_[a]).gop,e.pps&&Ht(e.pps[0],s.pps[0])&&e.sps&&Ht(e.sps[0],s.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=s,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,s,o,l,u;for(s=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(n=a[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,s-=r.byteLength,o-=r.nalCount,l-=r.duration);return 0===i?e:i===e.length?null:((u=e.slice(i)).byteLength=s,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,i,n,r,s,o,l;for(t=a.length-1,i=e.length-1,s=null,o=!1;t>=0&&i>=0;){if(n=a[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===a.length-1&&(s=i),i--)}if(!o&&null===s)return null;if(0===(l=o?i:s))return e;var u=e.slice(l),d=u.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return u.byteLength=d.byteLength,u.duration=d.duration,u.nalCount=d.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){a=e}},At.prototype=new xt,Et=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Et.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},Et.prototype=new xt,Et.prototype.flush=function(e){var t,i,n,r,s=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,qt.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Ut.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,n=Ct.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(n.byteLength),a.initSegment.set(n),a.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)a.data.set(this.pendingBoxes[r],s),s+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=Pt.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Pt.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=Pt.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),r=0;r<a.captions.length;r++)t=a.captions[r],this.trigger("caption",t);for(r=0;r<a.metadata.length;r++)i=a.metadata[r],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Et.prototype.setRemux=function(e){this.remuxTracks=e},(wt=function(e){var t,i,n=this,r=!0;wt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new Ot.MetadataStream,r.aacStream=new Nt,r.audioTimestampRolloverStream=new Ot.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new Ot.TimestampRolloverStream("timed-metadata"),r.adtsStream=new Dt,r.coalesceStream=new Et(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(s){"timed-metadata"!==s.type&&"audio"!==s.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new St(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Ft(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new Ot.MetadataStream,r.packetStream=new Ot.TransportPacketStream,r.parseStream=new Ot.TransportParseStream,r.elementaryStream=new Ot.ElementaryStream,r.timestampRolloverStream=new Ot.TimestampRolloverStream,r.adtsStream=new Dt,r.h264Stream=new Mt,r.captionStream=new Ot.CaptionStream(e),r.coalesceStream=new Et(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(s){var a;if("metadata"===s.type){for(a=s.tracks.length;a--;)t||"video"!==s.tracks[a].type?i||"audio"!==s.tracks[a].type||((i=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new At(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new St(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Ft(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Lt.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Lt.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=Rt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new xt;var zt,Xt,Wt,Gt,Yt,Kt={Transmuxer:wt,VideoSegmentStream:At,AudioSegmentStream:St,AUDIO_PROPERTIES:Ut,VIDEO_PROPERTIES:qt,generateSegmentTimingInfo:Vt},Jt=function(e){return e>>>0},Qt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Zt=Jt,$t=Qt,ei=function(e,t){var i,n,r,s,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Zt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=$t(e.subarray(i+4,i+8)),s=n>1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,s)):(a=ei(e.subarray(i+8,s),t.slice(1))).length&&(o=o.concat(a))),i=s;return o},ti=Jt,ii=z.getUint64,ni=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=ii(e.subarray(4)):t.baseMediaDecodeTime=ti(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ri=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},si=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],d=n.getUint32(4),c=8;for(r&&(i.dataOffset=n.getInt32(c),c+=4),s&&d&&(t={flags:ri(e.subarray(c,c+4))},c+=4,a&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t),d--);d--;)t={},a&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),l&&(t.flags=ri(e.subarray(c,c+4)),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t);return i},ai=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],s=2&n.flags[2],a=8&n.flags[2],o=16&n.flags[2],l=32&n.flags[2],u=65536&n.flags[0],d=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),s&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),u&&(n.durationIsEmpty=!0),!r&&d&&(n.baseDataOffsetIsMoof=!0),n},oi=(zt="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},pe.discardEmulationPreventionBytes),li=Ce.CaptionStream,ui=ei,di=ni,ci=si,hi=ai,pi=zt,mi=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},gi=function(e,t){var i=ui(e,["moof","traf"]),n=ui(e,["mdat"]),r={},s=[];return n.forEach((function(e,t){var n=i[t];s.push({mdat:e,traf:n})})),s.forEach((function(e){var i,n,s=e.mdat,a=e.traf,o=ui(a,["tfhd"]),l=hi(o[0]),u=l.trackId,d=ui(a,["tfdt"]),c=d.length>0?di(d[0]).baseMediaDecodeTime:0,h=ui(a,["trun"]);t===u&&h.length>0&&(i=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,s=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=ci(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=s),e.trackId=a,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof n?(e.pts=n+pi.BigInt(e.compositionTimeOffset),n+=pi.BigInt(e.duration)):(e.pts=n+e.compositionTimeOffset,n+=e.duration)})),o=o.concat(t)})),o}(h,c,l),n=function(e,t,i){var n,r,s,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=s)if(s=o.getUint32(r),r+=4,!(s<=0))switch(31&e[r]){case 6:var u=e.subarray(r+1,r+1+s),d=mi(r,t);if(n={nalUnitType:"sei_rbsp",size:s,data:u,escapedRBSP:oi(u),trackId:i},d)n.pts=d.pts,n.dts=d.dts,a=d;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+i+". See mux.js#223."});break}n.pts=a.pts,n.dts=a.dts}l.seiNals.push(n)}return l}(s,i,u),r[u]||(r[u]={seiNals:[],logs:[]}),r[u].seiNals=r[u].seiNals.concat(n.seiNals),r[u].logs=r[u].logs.concat(n.logs))})),r},fi=function(){var e,t,i,n,r,s,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new li,a=!0,s=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0})),e.on("log",(function(e){r.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,s,a){var o;if(!this.isInitialized())return null;if(!s||!a)return null;if(this.isNewInit(s,a))i=s[0],n=a[i];else if(null===i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,s,a)}return o=function(e,t,i){if(null===t)return null;var n=gi(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}}(e,i,n),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;s?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},yi=function(e){for(var t=0,i=String.fromCharCode(e[t]),n="";"\0"!==i;)n+=i,t++,i=String.fromCharCode(e[t]);return n+=i},vi=z.getUint64,bi=function(e,t){var i="\0"!==t.scheme_id_uri,n=0===e&&_i(t.presentation_time_delta)&&i,r=1===e&&_i(t.presentation_time)&&i;return!(e>1)&&n||r},_i=function(e){return void 0!==e||null!==e},Ti={parseEmsgBox:function(e){var t,i,n,r,s,a,o,l=4,u=e[0];if(0===u)l+=(t=yi(e.subarray(l))).length,l+=(i=yi(e.subarray(l))).length,n=(d=new DataView(e.buffer)).getUint32(l),l+=4,s=d.getUint32(l),l+=4,a=d.getUint32(l),l+=4,o=d.getUint32(l),l+=4;else if(1===u){var d;n=(d=new DataView(e.buffer)).getUint32(l),l+=4,r=vi(e.subarray(l)),l+=8,a=d.getUint32(l),l+=4,o=d.getUint32(l),l+=4,l+=(t=yi(e.subarray(l))).length,l+=(i=yi(e.subarray(l))).length}var c={scheme_id_uri:t,value:i,timescale:n||1,presentation_time:r,presentation_time_delta:s,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return bi(u,c)?c:void 0},scaleTime:function(e,t,i,n){return e||0===e?e/t:n+i/t}},Ai=Jt,Si=function(e){return("00"+e.toString(16)).slice(-2)},wi=ei,Ei=Qt,xi=Ti,Ci=ai,ki=si,Ii=ni,Li=z.getUint64,Oi=zt,Pi=Ve.parseId3Frames;Xt=function(e,t){var i=wi(t,["moof","traf"]).reduce((function(t,i){var n,r=wi(i,["tfhd"])[0],s=Ai(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),a=e[s]||9e4,o=wi(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let u;return"bigint"==typeof(n=1===o[0]?Li(o.subarray(4,12)):l.getUint32(4))?u=n/Oi.BigInt(a):"number"!=typeof n||isNaN(n)||(u=n/a),u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),u<t&&(t=u),t}),1/0);return"bigint"==typeof i||isFinite(i)?i:0},Gt=function(e){var t=0===e[0]?12:20;return Ai(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Wt=function(e){var t=wi(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,r={},s=wi(e,["tkhd"])[0];s&&(n=(t=new DataView(s.buffer,s.byteOffset,s.byteLength)).getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var a=wi(e,["mdia","hdlr"])[0];if(a){var o=Ei(a.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var l=wi(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);r.codec=Ei(u.subarray(4,8));var d,c=wi(u,[r.codec])[0];c&&(/^[asm]vc[1-9]$/i.test(r.codec)?(d=c.subarray(78),"avcC"===Ei(d.subarray(4,8))&&d.length>11?(r.codec+=".",r.codec+=Si(d[9]),r.codec+=Si(d[10]),r.codec+=Si(d[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(d=c.subarray(28),"esds"===Ei(d.subarray(4,8))&&d.length>20&&0!==d[19]?(r.codec+="."+Si(d[19]),r.codec+="."+Si(d[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var h=wi(e,["mdia","mdhd"])[0];h&&(r.timescale=Gt(h)),i.push(r)})),i},Yt=function(e,t=0){return wi(e,["emsg"]).map((e=>{var i=xi.parseEmsgBox(new Uint8Array(e)),n=Pi(i.message_data);return{cueTime:xi.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:xi.scaleTime(i.event_duration,i.timescale),frames:n}}))};var Di=Xt,Mi=Wt,Ni=Yt,Ri=ke,Bi=function(e){var t=31&e[1];return t<<=8,t|=e[2]},Ui=function(e){return!!(64&e[1])},qi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},ji=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Fi={parseType:function(e,t){var i=Bi(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=Ui(e),i=4+qi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Ui(e),n=4+qi(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var s=12+((15&e[n+10])<<8|e[n+11]);s<r;){var a=n+s;t[(31&e[a+1])<<8|e[a+2]]=e[a],s+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:Ui,parsePesType:function(e,t){switch(t[Bi(e)]){case Ri.H264_STREAM_TYPE:return"video";case Ri.ADTS_STREAM_TYPE:return"audio";case Ri.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Ui(e))return null;var t=4+qi(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+qi(e),i=e.subarray(t),n=0,r=0,s=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===ji(31&i[r+3])&&(s=!0);do{n++}while(1!==i[n]&&n<i.length);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===ji(31&i[r+3])&&(s=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===ji(31&i[r+3])&&(s=!0),s}},Hi=ke,Vi=Me.handleRollover,zi={};zi.ts=Fi,zi.aac=_t;var Xi=oe.ONE_SECOND_IN_TS,Wi=188,Gi=71,Yi=function(e,t,i){for(var n,r,s,a,o=0,l=Wi,u=!1;l<=e.byteLength;)if(e[o]!==Gi||e[l]!==Gi&&l!==e.byteLength)o++,l++;else{if(n=e.subarray(o,l),"pes"===zi.ts.parseType(n,t.pid))r=zi.ts.parsePesType(n,t.table),s=zi.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=zi.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o+=Wi,l+=Wi}for(o=(l=e.byteLength)-Wi,u=!1;o>=0;)if(e[o]!==Gi||e[l]!==Gi&&l!==e.byteLength)o--,l--;else{if(n=e.subarray(o,l),"pes"===zi.ts.parseType(n,t.pid))r=zi.ts.parsePesType(n,t.table),s=zi.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=zi.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o-=Wi,l-=Wi}},Ki=function(e,t,i){for(var n,r,s,a,o,l,u,d=0,c=Wi,h=!1,p={data:[],size:0};c<e.byteLength;)if(e[d]!==Gi||e[c]!==Gi)d++,c++;else{if(n=e.subarray(d,c),"pes"===zi.ts.parseType(n,t.pid))if(r=zi.ts.parsePesType(n,t.table),s=zi.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!h&&(a=zi.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),h=!0),!i.firstKeyFrame)){if(s&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)u=p.data.shift(),o.set(u,l),l+=u.byteLength;if(zi.ts.videoPacketContainsKeyFrame(o)){var m=zi.ts.parsePesTime(o);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}p.size=0}p.data.push(n),p.size+=n.byteLength}if(h&&i.firstKeyFrame)break;d+=Wi,c+=Wi}for(d=(c=e.byteLength)-Wi,h=!1;d>=0;)if(e[d]!==Gi||e[c]!==Gi)d--,c--;else{if(n=e.subarray(d,c),"pes"===zi.ts.parseType(n,t.pid))r=zi.ts.parsePesType(n,t.table),s=zi.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(a=zi.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),h=!0);if(h)break;d-=Wi,c-=Wi}},Ji=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=Wi;r<e.byteLength;)if(e[n]!==Gi||e[r]!==Gi)n++,r++;else{switch(i=e.subarray(n,r),zi.ts.parseType(i,t.pid)){case"pat":t.pid=zi.ts.parsePat(i);break;case"pmt":var s=zi.ts.parsePmt(i);t.table=t.table||{},Object.keys(s).forEach((function(e){t.table[e]=s[e]}))}n+=Wi,r+=Wi}}(e,t),t.table){if(t.table.hasOwnProperty(n))switch(t.table[n]){case Hi.H264_STREAM_TYPE:i.video=[],Ki(e,t,i),0===i.video.length&&delete i.video;break;case Hi.ADTS_STREAM_TYPE:i.audio=[],Yi(e,t,i),0===i.audio.length&&delete i.audio}}return i},Qi=function(e,t){var i;return i=zi.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,s=null,a=0,o=0;e.length-o>=3;){switch(zi.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=zi.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=zi.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=zi.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=zi.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===r||null===s)return null;var l=Xi/r;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*l,pts:s+1024*n*l}]}}(e):Ji(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Vi(e.dts,i),e.pts=Vi(e.pts,i),e.dtsTime=e.dts/Xi,e.ptsTime=e.pts/Xi}))}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=Vi(e.dts,n),e.pts=Vi(e.pts,n),e.dtsTime=e.dts/Xi,e.ptsTime=e.pts/Xi})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=Vi(r.dts,n),r.pts=Vi(r.pts,n),r.dtsTime=r.dts/Xi,r.ptsTime=r.pts/Xi}}}(i,t),i):null};class Zi{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Kt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new fi,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Di(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Mi(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Ni(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!=typeof t||isNaN(t)?void 0:t*oe.ONE_SECOND_IN_TS,n=Qi(e,i);let r=null;n&&(r={hasVideo:n.video&&2===n.video.length||!1,hasAudio:n.audio&&2===n.audio.length||!1},r.hasVideo&&(r.videoStart=n.video[0].ptsTime),r.hasAudio&&(r.audioStart=n.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:r,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(oe.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(oe.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Zi(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Zi(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var ap=ip(sp);const op=e=>{const{transmuxer:t,bytes:i,audioAppendStart:n,gopsToAlignWith:r,remux:s,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:d,onAudioSegmentTimingInfo:c,onId3:h,onCaptions:p,onDone:m,onEndedTimeline:g,onTransmuxerLog:f,isEndOfTimeline:y,segment:v,triggerSegmentEventFn:b}=e,_={buffer:[]};let T=y;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&((e,t,i)=>{const{type:n,initSegment:r,captions:s,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:s,captionStreams:a,metadata:o});const d=e.data.segment.boxes||{data:e.data.segment.data},c={type:n,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};void 0!==l&&(c.videoFrameDtsTime=l),void 0!==u&&(c.videoFramePtsTime=u),i(c)})(i,_,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(i,_),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&c(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,g()),"log"===i.data.action&&f(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:_,callback:m}),lp(t))))},t.onerror=()=>{const e={message:"Received an error message from the transmuxer worker",metadata:{errorType:Pc.Error.StreamingFailedToTransmuxSegment,segmentInfo:tm({segment:v})}};m(null,e)},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==s&&t.postMessage({action:"setRemux",remux:s}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,n=i instanceof ArrayBuffer?0:i.byteOffset;b({type:"segmenttransmuxingstart",segment:v}),t.postMessage({action:"push",data:e,byteOffset:n,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},lp=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():op(e.currentTransmux))},up=(e,t)=>{e.postMessage({action:t}),lp(e)},dp=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void up(t,e);t.transmuxQueue.push(up.bind(null,t,e))},cp=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void op(e);e.transmuxer.transmuxQueue.push(e)};var hp=e=>{dp("reset",e)},pp=e=>{const t=new ap;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t};const mp=function(e){const t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=Gt({},e,{endAction:null,transmuxer:null,callback:null}),s=r=>{r.data.action===i&&(t.removeEventListener("message",s),r.data.data&&(r.data.data=new Uint8Array(r.data.data,e.byteOffset||0,e.byteLength||r.data.data.byteLength),e.data&&(e.data=r.data.data)),n(r.data))};if(t.addEventListener("message",s),e.data){const i=e.data instanceof ArrayBuffer;r.byteOffset=i?0:e.data.byteOffset,r.byteLength=e.data.byteLength;const n=[i?e.data:e.data.buffer];t.postMessage(r,n)}else t.postMessage(r)},gp=2,fp=-101,yp=-102,vp=e=>{e.forEach((e=>{e.abort()}))},bp=(e,t)=>{const{requestType:i}=t,n=Ah({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:fp,xhr:t,metadata:n}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:yp,xhr:t,metadata:n}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:gp,xhr:t,metadata:n}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:gp,xhr:t,metadata:n}:null},_p=(e,t,i,n)=>(r,s)=>{const a=s.response,o=bp(r,s);if(o)return i(o,e);if(16!==a.byteLength)return i({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:gp,xhr:s},e);const l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=u;const d={uri:s.uri};return n({type:"segmentkeyloadcomplete",segment:e,keyInfo:d}),i(null,e)},Tp=(e,t)=>{const i=pa(e.map.bytes);if("mp4"!==i){const n=e.map.resolvedUri||e.map.uri,r=i||"unknown";return t({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${n}`,code:gp,metadata:{mediaType:r}})}mp({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,i.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null))})},Ap=({segment:e,finishProcessingFn:t,responseType:i,triggerSegmentEventFn:n})=>(r,s)=>{const a=bp(r,s);if(a)return t(a,e);n({type:"segmentloaded",segment:e});const o="arraybuffer"!==i&&s.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(s.responseText.substring(e.lastReachedChar||0)):s.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(s),e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)},Sp=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{const m=e.map&&e.map.tracks||{},g=Boolean(m.audio&&m.video);let f=n.bind(null,e,"audio","start");const y=n.bind(null,e,"audio","end");let v=n.bind(null,e,"video","start");const b=n.bind(null,e,"video","end");mp({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:n=>{e.bytes=t=n.data;const m=n.result;m&&(i(e,{hasAudio:m.hasAudio,hasVideo:m.hasVideo,isMuxed:g}),i=null),cp({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:g,onData:t=>{t.type="combined"===t.type?"video":t.type,d(e,t)},onTrackInfo:t=>{i&&(g&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{f&&void 0!==e.start&&(f(e.start),f=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:e=>{v&&void 0!==e.start&&(v(e.start),v=null),b&&void 0!==e.end&&b(e.end)},onVideoSegmentTimingInfo:t=>{const i={pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),r(t)},onAudioSegmentTimingInfo:t=>{const i={pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),s(t)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:h,onDone:(t,i)=>{c&&(t.type="combined"===t.type?"video":t.type,p({type:"segmenttransmuxingcomplete",segment:e}),c(i,e,t))},segment:e,triggerSegmentEventFn:p})}})},wp=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let m=new Uint8Array(t);if(function(e){return Gs(e,["moof"]).length>0}(m)){e.isFmp4=!0;const{tracks:r}=e.map,s={isFmp4:!0,hasVideo:!!r.video,hasAudio:!!r.audio};r.audio&&r.audio.codec&&"enca"!==r.audio.codec&&(s.audioCodec=r.audio.codec),r.video&&r.video.codec&&"encv"!==r.video.codec&&(s.videoCodec=r.video.codec),r.video&&r.audio&&(s.isMuxed=!0),i(e,s);const l=(t,i)=>{d(e,{data:m,type:s.hasAudio&&!s.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),c(null,e,{})};mp({action:"probeMp4StartTime",timescales:e.map.timescales,data:m,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=m=i,s.hasAudio&&!s.isMuxed&&n(e,"audio","start",a),s.hasVideo&&n(e,"video","start",a),mp({action:"probeEmsgID3",data:m,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:n})=>{t=i.buffer,e.bytes=m=i,r.video&&i.byteLength&&e.transmuxer?mp({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:m,timescales:e.map.timescales,trackIds:[r.video.id],callback:i=>{t=i.data.buffer,e.bytes=m=i.data,i.logs.forEach((function(e){h(jc(e,{stream:"mp4CaptionParser"}))})),l(i.captions,n)}}):l(void 0,n)}})}})}else if(e.transmuxer){if(void 0===e.container&&(e.container=pa(m)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void c(null,e,{});Sp({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})}else c(null,e,{})},Ep=function({id:e,key:t,encryptedBytes:i,decryptionWorker:n,segment:r,doneFn:s},a){const o=t=>{if(t.data.source===e){n.removeEventListener("message",o);const e=t.data.decrypted;a(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let l;n.onerror=()=>{const e="An error occurred in the decryption worker",t=tm({segment:r}),i={message:e,metadata:{error:new Error(e),errorType:Pc.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};s(i,r)},n.addEventListener("message",o),l=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),n.postMessage(Uh({source:e,encrypted:i,key:l,iv:t.iv}),[i.buffer,l.buffer])},xp=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let m=0,g=!1;return(f,y)=>{if(!g){if(f)return g=!0,vp(e),c(f,y);if(m+=1,m===e.length){const m=function(){if(y.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{p({type:"segmentdecryptionstart"}),Ep({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:c},(e=>{t.bytes=e,p({type:"segmentdecryptioncomplete",segment:t}),wp({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})}))})({decryptionWorker:t,segment:y,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p});wp({segment:y,bytes:y.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return p({type:"segmentdecryptionstart",segment:y}),Ep({decryptionWorker:t,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.key,segment:y,doneFn:c},(t=>{y.map.bytes=t,p({type:"segmentdecryptioncomplete",segment:y}),Tp(y,(t=>{if(t)return vp(e),c(t,y);m()}))}));m()}}}},Cp=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d})=>i=>{if(!i.target.aborted)return e.stats=jc(e.stats,(e=>{const t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)},kp=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:r,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y})=>{const v=[],b=xp({activeXhrs:v,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y});if(n.key&&!n.key.bytes){const i=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&i.push(n.map.key);const r=jc(t,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),s=_p(n,i,b,y);y({type:"segmentkeyloadstart",segment:n,keyInfo:{uri:n.key.resolvedUri}});const a=e(r,s);v.push(a)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const i=jc(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=_p(n,[n.map.key],b,y);y({type:"segmentkeyloadstart",segment:n,keyInfo:{uri:n.map.key.resolvedUri}});const s=e(i,r);v.push(s)}const i=jc(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Mh(n.map),requestType:"segment-media-initialization"}),r=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:i})=>(n,r)=>{const s=bp(n,r);if(s)return t(s,e);const a=new Uint8Array(r.response);if(i({type:"segmentloaded",segment:e}),e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,Tp(e,(function(i){if(i)return i.xhr=r,i.status=r.status,t(i,e);t(null,e)}))})({segment:n,finishProcessingFn:b,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:n});const s=e(i,r);v.push(s)}const _=jc(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Mh(n),requestType:"segment"}),T=Ap({segment:n,finishProcessingFn:b,responseType:_.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:n});const A=e(_,T);A.addEventListener("progress",Cp({segment:n,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m})),v.push(A);const S={};return v.forEach((e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:S,abortFn:r}))})),()=>vp(v)},Ip=qc("CodecUtils"),Lp=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},Op=function(e){const t={};return e.forEach((({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(hi(`${i}${n}`))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return Ip(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},Pp=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Dp=function(e,t){const i=t.attributes||{},n=Op(function(e){const t=e.attributes||{};if(t.CODECS)return pi(t.CODECS)}(t)||[]);if(Lp(e,t)&&!n.audio&&!((e,t)=>{if(!Lp(e,t))return!0;const i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(const e in n)if(!n[e].uri&&!n[e].playlists)return!0;return!1})(e,t)){const t=Op(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return pi(r.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(n.audio=t.audio)}return n},Mp=qc("PlaylistSelector"),Np=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},Rp=function(e,t){if(!e)return"";const i=Ne.getComputedStyle(e);return i?i[t]:""},Bp=function(e,t){const i=e.slice();e.sort((function(e,n){const r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Up=function(e,t){let i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||Ne.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||Ne.Number.MAX_VALUE,i-n};let qp=function(e,t,i,n,r,s){if(!e)return;const a={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r};let o=e.playlists;mh.isAudioOnly(e)&&(o=s.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map((e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||Ne.Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}}));Bp(l,((e,t)=>e.bandwidth-t.bandwidth)),l=l.filter((e=>!mh.isIncompatible(e.playlist)));let u=l.filter((e=>mh.isEnabled(e.playlist)));u.length||(u=l.filter((e=>!mh.isDisabled(e.playlist))));const d=u.filter((e=>e.bandwidth*ep.BANDWIDTH_VARIANCE<t));let c=d[d.length-1];const h=d.filter((e=>e.bandwidth===c.bandwidth))[0];if(!1===r){const e=h||u[0]||l[0];if(e&&e.playlist){let t="sortedPlaylistReps";return h&&(t="bandwidthBestRep"),u[0]&&(t="enabledPlaylistReps"),Mp(`choosing ${Np(e)} using ${t} with options`,a),e.playlist}return Mp("could not choose a playlist with options",a),null}const p=d.filter((e=>e.width&&e.height));Bp(p,((e,t)=>e.width-t.width));const m=p.filter((e=>e.width===i&&e.height===n));c=m[m.length-1];const g=m.filter((e=>e.bandwidth===c.bandwidth))[0];let f,y,v,b;if(g||(f=p.filter((e=>e.width>i||e.height>n)),y=f.filter((e=>e.width===f[0].width&&e.height===f[0].height)),c=y[y.length-1],v=y.filter((e=>e.bandwidth===c.bandwidth))[0]),s.leastPixelDiffSelector){const e=p.map((e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e)));Bp(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),b=e[0]}const _=b||v||g||h||u[0]||l[0];if(_&&_.playlist){let e="sortedPlaylistReps";return b?e="leastPixelDiffRep":v?e="resolutionPlusOneRep":g?e="resolutionBestRep":h?e="bandwidthBestRep":u[0]&&(e="enabledPlaylistReps"),Mp(`choosing ${Np(_)} using ${e} with options`,a),_.playlist}return Mp("could not choose a playlist with options",a),null};const jp=function(){let e=this.useDevicePixelRatio&&Ne.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),qp(this.playlists.main,this.systemBandwidth,parseInt(Rp(this.tech_.el(),"width"),10)*e,parseInt(Rp(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};function Fp(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const Hp=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(!t)return;const r=Ne.WebKitDataCue||Ne.VTTCue,s=e.metadataTrack_;if(!s)return;if(t.forEach((e=>{const t=e.cueTime+i;!("number"!=typeof t||Ne.isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach((e=>{const i=new r(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(Pc.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(Pc.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(Pc.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(i),s.addCue(i)}))})),!s.cues||!s.cues.length)return;const a=s.cues,o=[];for(let e=0;e<a.length;e++)a[e]&&o.push(a[e]);const l=o.reduce(((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),u=Object.keys(l).sort(((e,t)=>Number(e)-Number(t)));u.forEach(((e,t)=>{const i=l[e],r=isFinite(n)?n:e,s=Number(u[t+1])||r;i.forEach((e=>{e.endTime=s}))}))},Vp={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},zp=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Xp=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Pc.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},Wp=function(e,t,i){let n,r;if(i&&i.cues)for(n=i.cues.length;n--;)r=i.cues[n],r.startTime>=e&&r.endTime<=t&&i.removeCue(r)},Gp=e=>"number"==typeof e&&isFinite(e),Yp=1/60,Kp=e=>{const{startOfSegment:t,duration:i,segment:n,part:r,playlist:{mediaSequence:s,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:d}=e,c=o.length-1;let h="mediaIndex/partIndex increment";e.getMediaInfoForTime?h=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(h="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(h+=` with independent ${e.independent}`);const p="number"==typeof u,m=e.segment.uri?"segment":"pre-segment",g=p?eh({preloadSegment:n})-1:0;return`${m} [${s+l}/${s+c}]`+(p?` part [${u}/${g}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(p?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${d}]`+` selected by [${h}]`+` playlist [${a}]`},Jp=e=>`${e}TimingInfo`,Qp=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:n,audioDisabled:r})=>{if(t===i)return!1;if("audio"===n){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===n&&r){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},Zp=e=>{const t=e.pendingSegment_;if(!t)return;if(Qp({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;const t=e.pendingTimelineChange({type:"audio"}),i=e.pendingTimelineChange({type:"main"}),n=t&&i,r=n&&t.to!==i.to;return!(!n||-1===t.from||-1===i.from||!r)})(e.timelineChangeController_)){if((e=>{const t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&i&&t.to<i.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");(e=>{e&&(e.pause(),e.resetEverything(),e.load())})(e)}},$p=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Hc,em=(e,t)=>{if("hls"!==t)return null;const i=(e=>{let t=0;return["video","audio"].forEach((function(i){const n=e[`${i}TimingInfo`];if(!n)return;const{start:r,end:s}=n;let a;"bigint"==typeof r||"bigint"==typeof s?a=Ne.BigInt(s)-Ne.BigInt(r):"number"==typeof r&&"number"==typeof s&&(a=s-r),void 0!==a&&a>t&&(t=a)})),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const n=e.playlist.targetDuration,r=$p({segmentDuration:i,maxDuration:2*n}),s=$p({segmentDuration:i,maxDuration:n}),a=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||s?{severity:r?"warn":"info",message:a}:null},tm=({type:e,segment:t})=>{if(!t)return;const i=Boolean(t.key||t.map&&t.map.ke),n=Boolean(t.map&&!t.map.bytes),r=void 0===t.startOfSegment?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:r,duration:t.duration,isEncrypted:i,isMediaInitialization:n}};class im extends Pc.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=qc(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Zp(this)})),this.sourceUpdater_.on("codecschange",(e=>{this.trigger(Gt({type:"codecschange"},e))})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Zp(this)})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(e=>{this.trigger(Gt({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Zp(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Zp(this)}))}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return pp({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&Ne.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,Ne.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&hp(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Fc();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:n}=e;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=qh(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e}segmentKey(e,t=!1){if(!e)return null;const i=jh(e);let n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});const r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_(`playlist update [${r} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Kc(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){if(null!==this.mediaIndex){!e.endList&&"number"==typeof e.partTargetDuration?this.resetLoader():this.resyncLoader()}return this.currentMediaInfo_=void 0,void this.trigger("playlistupdate")}const s=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${s}]`),null!==this.mediaIndex)if(this.mediaIndex-=s,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}n&&(n.mediaIndex-=s,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(Ne.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&hp(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"===this.sourceType_&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=(()=>{}),n=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let r=1;const s=()=>{r--,0===r&&i()};!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,s)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,n)=>{const r=Math.ceil((t-n)*ga),s=Math.ceil((i-n)*ga),a=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=s););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,s));for(const i in this.inbandTextTracks_)Wp(e,t,this.inbandTextTracks_[i]);Wp(e,t,this.segmentMetadataTrack_),s()}monitorBuffer_(){this.checkBufferTimeout_&&Ne.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Ne.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&Ne.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Ne.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:tm({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,s=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&s}chooseNextRequest_(){const e=this.buffered_(),t=Kc(e)||0,i=Jc(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),s=this.playlist_.segments;if(!s.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];const n=[];let r=0;for(let s=0;s<t.length;s++){const a=t[s];if(e===a.timeline&&(n.push(s),r+=a.duration,r>i))return s}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,s,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){const e=s[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,n;const r=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${r}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(r);if(!t){const e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:Pc.Error.StreamingFailedToSelectNextSegment,error:new Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,n=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=mh.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:r,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,n=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${r}`:`currentTime ${r}`,a.mediaIndex=e,a.startOfSegment=n,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=s[a.mediaIndex];let l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);const u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!u&&!l.independent)if(0===a.partIndex){const e=s[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const d=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=s.length-1&&d&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const n=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return n?(n.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),n):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:n,startOfSegment:r,isSyncRequest:s,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,u=i.segments[n],d="number"==typeof a&&u.parts[a],c={requestId:"segment-loader-"+Math.random(),uri:d&&d.resolvedUri||u.resolvedUri,mediaIndex:n,partIndex:d?a:null,isSyncRequest:s,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:d&&d.duration||u.duration,segment:u,part:d,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});const p=Kc(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(c.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];const n=Math.ceil((t-i+3)*ga);let r;for(r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,overrideCheck:r})=>r||e!==t?e<t?i:n.length?n.end(n.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=mh.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),s=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(r<=s)return;const a=function(e){const{main:t,currentTime:i,bandwidth:n,duration:r,segmentDuration:s,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=t.playlists.filter((e=>!mh.isIncompatible(e)));let d=u.filter(mh.isEnabled);d.length||(d=u.filter((e=>!mh.isDisabled(e))));const c=d.filter(mh.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=l.getSyncPoint(e,r,o,i)?1:2;return{playlist:e,rebufferingImpact:mh.estimateSegmentRequestTime(s,n,e)*t-a}})),h=c.filter((e=>e.rebufferingImpact<=0));return Bp(h,((e,t)=>Up(t.playlist,e.playlist))),h.length?h[0]:(Bp(c,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),c[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=r-s-a.rebufferingImpact;let l=.5;s<=Hc&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*ep.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Kp(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:n}=t,r={segmentInfo:tm({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:n}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:r}),this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(let r=0;r<i.length;r++){const s=i[r];if(s!==n[r])return!1;if(e[s]!==t[s])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Zp(this)))}handleTimingInfo_(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const r=this.pendingSegment_,s=Jp(t);r[s]=r[s]||{},r[s][i]=n,this.logger_(`timinginfo: ${t} - ${i} - ${n}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Zp(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach((e=>{n[e.stream]=n[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=n[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)})),Object.keys(n).forEach((e=>{const{startTime:t,endTime:r,captions:s}=n[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${r} for ${e}`),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);const r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{let r=i,s=i,a=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];o&&(r=o.label,s=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:a,label:r,language:s},!1).track}}}(a,this.vhs_.tech_,e),Wp(t,r,a[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const n=Ne.WebKitDataCue||Ne.VTTCue;t.forEach((t=>{const r=t.stream;t.content?t.content.forEach((s=>{const a=new n(t.startTime+i,t.endTime+i,s.text);a.line=s.line,a.align="left",a.position=s.position,a.positionAlign="line-left",e[r].addCue(a)})):e[r].addCue(new n(t.startTime+i,t.endTime+i,t.text))}))}({captionArray:s,inbandTextTracks:a,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))}processMetadataQueue_(){this.metadataQueue_.id3.forEach((e=>e())),this.metadataQueue_.caption.forEach((e=>e())),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach((e=>e()))}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach((e=>e()))}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Qp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:n,isMuxed:r}=t;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Qp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Zp(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[Jp(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let n;t&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:n}){if(i){const e=qh(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){const r=this.sourceUpdater_.audioBuffered(),s=this.sourceUpdater_.videoBuffered();r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Yc(r).join(", ")),s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Yc(s).join(", "));const a=r.length?r.start(0):0,o=r.length?r.end(r.length-1):0,l=s.length?s.start(0):0,u=s.length?s.end(s.length-1):0;if(o-a<=1&&u-l<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Yc(r).join(", ")}, video buffer: ${Yc(s).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const d=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`),this.remove(0,d,(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=Ne.setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()}),1e3)}),!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},n){n&&(22!==n.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Pc.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:r}){if(!r){const e=[n];let t=n.byteLength;i&&(e.unshift(i),t+=i.byteLength),r=(e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((e=>{t.set(e,i),i+=e.byteLength}))),t})({bytes:t,segments:e})}const s={segmentInfo:tm({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:s}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:r},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:r}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const n=this.pendingSegment_.segment,r=`${e}TimingInfo`;n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:n}=t;if(!n||!n.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Zp(this),void this.loadQueue_.push((()=>{const t=Gt({},e,{forceTimestampOffset:!0});Gt(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}));this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),n=null!==this.mediaIndex,r=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||n&&r;this.logger_(`Requesting\n${Fp(e.uri)}\n${Kp(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=kp({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:n})=>{this.logger_(`${Kp(e)} logged from transmuxer stream ${n} as a ${i}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:n,timingInfo:r})=>{const s={segmentInfo:tm({segment:t})};i&&(s.keyInfo=i),n&&(s.trackInfo=n),r&&(s.timingInfo=r),this.trigger({type:e,metadata:s})}})}trimBackBuffer_(e){const t=((e,t,i)=>{let n=t-ep.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));const r=t-i;return Math.min(r,n)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,n=e.segment.key||e.segment.map&&e.segment.map.key,r=e.segment.map&&!e.segment.map.bytes,s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:n,isMediaInitialization:r},a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline&&(a.videoTimingInfo?s.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd:a.audioTimingInfo&&(s.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key),s.key.iv=i}return t.map&&(s.map=this.initSegmentForMap(t.map)),s}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Yp)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`);const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===yp)return;return this.pause(),e.code===fp?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const n=t[0].pts;let r=0;for(;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:n,currentVideoTimestampOffset:r,useVideoTimingInfo:s,videoTimingInfo:a,audioTimingInfo:o}){if(void 0!==e)return e;if(!s)return o.start;const l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===n+r?a.start:n}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:i,hasVideo:n,isMuxed:r}=t,s="main"===this.loaderType_&&n,a=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);s&&e.waitingOnAppends++,a&&e.waitingOnAppends++,s&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const e={segmentInfo:tm({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=em(e,this.sourceType_);if(t&&("warn"===t.severity?Pc.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${Kp(e)}`);this.logger_(`Appended ${Kp(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,n=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,s=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||s)return this.logger_(`bad ${r?"segment":"part"} ${Kp(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Yp)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,n=t.end;if(!Gp(i)||!Gp(n))return;Wp(i,n,this.segmentMetadataTrack_);const r=Ne.WebKitDataCue||Ne.VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},a=new r(i,n,JSON.stringify(s));a.value=s,this.segmentMetadataTrack_.addCue(a)}}function nm(){}const rm=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},sm=["video","audio"],am=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},om=(e,t)=>{if(0===t.queue.length)return;let i=0,n=t.queue[i];if("mediaSource"!==n.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!am(e,t)){if(n.type!==e){if(i=((e,t)=>{for(let i=0;i<t.length;i++){const n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null})(e,t.queue),null===i)return;n=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=n,n.action(e,t),n.doneFn?void 0:(t.queuePending[e]=null,void om(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),om("audio",t),om("video",t))},lm=(e,t)=>{const i=t[`${e}Buffer`],n=rm(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},um=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),dm=(e,t,i)=>(n,r)=>{const s=r[`${n}Buffer`];if(um(r.mediaSource,s)){r.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${n}Buffer`);try{s.appendBuffer(e)}catch(e){r.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${n}Buffer`),r.queuePending[n]=null,i(e)}}},cm=(e,t)=>(i,n)=>{const r=n[`${i}Buffer`];if(um(n.mediaSource,r)){n.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{r.remove(e,t)}catch(r){n.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},hm=e=>(t,i)=>{const n=i[`${t}Buffer`];um(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),n.timestampOffset=e)},pm=e=>(t,i)=>{e()},mm=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){Pc.log.warn("Failed to call media source endOfStream",e)}}},gm=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){Pc.log.warn("Failed to set media source duration",e)}},fm=()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(um(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){Pc.log.warn(`Failed to abort on ${e}Buffer`,t)}}},ym=(e,t)=>i=>{const n=rm(e),r=gi(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const s=i.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",i[`on${n}UpdateEnd_`]),s.addEventListener("error",i[`on${n}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=s},vm=e=>t=>{const i=t[`${e}Buffer`];if(lm(e,t),um(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){Pc.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},bm=e=>(t,i)=>{const n=i[`${t}Buffer`],r=gi(e);if(!um(i.mediaSource,n))return;const s=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))===s)return;const o={codecsChangeInfo:{from:a,to:e}};i.trigger({type:"codecschange",metadata:o}),i.logger_(`changing ${t}Buffer codec from ${a} to ${e}`);try{n.changeType(r),i.codecs[t]=e}catch(e){o.errorType=Pc.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,i.error_=e,i.trigger("error"),Pc.log.warn(`Failed to changeType on ${t}Buffer`,e)}},_m=({type:e,sourceUpdater:t,action:i,doneFn:n,name:r})=>{t.queue.push({type:e,action:i,doneFn:n,name:r}),om(e,t)},Tm=(e,t)=>i=>{const n=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const n=e.start(i),r=e.end(i);t+=`${n} --\x3e ${r}. Duration (${r-n})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,n),t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}om(e,t)};class Am extends Pc.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>om("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=qc("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Tm("video",this),this.onAudioUpdateEnd_=Tm("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){_m({type:"mediaSource",sourceUpdater:this,action:ym(e,t),name:"addSourceBuffer"})}abort(e){_m({type:e,sourceUpdater:this,action:fm(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?_m({type:"mediaSource",sourceUpdater:this,action:vm(e),name:"removeSourceBuffer"}):Pc.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!Pc.browser.IS_FIREFOX&&Ne.MediaSource&&Ne.MediaSource.prototype&&"function"==typeof Ne.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return Ne.SourceBuffer&&Ne.SourceBuffer.prototype&&"function"==typeof Ne.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?_m({type:e,sourceUpdater:this,action:bm(t),name:"changeType"}):Pc.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)}))}appendBuffer(e,t){const{segmentInfo:i,type:n,bytes:r}=e;if(this.processedAppend_=!0,"audio"===n&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${r.length} until video append`);if(_m({type:n,sourceUpdater:this,action:dm(r,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===n){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach((e=>{this.appendBuffer.apply(this,e)}))}}audioBuffered(){return um(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Fc()}videoBuffered(){return um(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Fc()}buffered(){const e=um(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=um(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let i=null,n=null,r=0;const s=[],a=[];if(!(e&&e.length&&t&&t.length))return Fc();let o=e.length;for(;o--;)s.push({time:e.start(o),type:"start"}),s.push({time:e.end(o),type:"end"});for(o=t.length;o--;)s.push({time:t.start(o),type:"start"}),s.push({time:t.end(o),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),o=0;o<s.length;o++)"start"===s[o].type?(r++,2===r&&(i=s[o].time)):"end"===s[o].type&&(r--,1===r&&(n=s[o].time)),null!==i&&null!==n&&(a.push([i,n]),i=null,n=null);return Fc(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=nm){_m({type:"mediaSource",sourceUpdater:this,action:gm(e),name:"duration",doneFn:t})}endOfStream(e=null,t=nm){"string"!=typeof e&&(e=void 0),_m({type:"mediaSource",sourceUpdater:this,action:mm(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=nm){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?_m({type:"audio",sourceUpdater:this,action:cm(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=nm){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?_m({type:"video",sourceUpdater:this,action:cm(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!am("audio",this)&&!am("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(_m({type:"audio",sourceUpdater:this,action:hm(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(_m({type:"video",sourceUpdater:this,action:hm(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&_m({type:"audio",sourceUpdater:this,action:pm(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&_m({type:"video",sourceUpdater:this,action:pm(e),name:"callback"})}dispose(){this.trigger("dispose"),sm.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>lm(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Sm=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),wm=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class Em extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class xm extends im{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Fc();const e=this.subtitlesTrack_.cues;return Fc([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=qh(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const t=wm.byteLength+e.bytes.byteLength,r=new Uint8Array(t);r.set(e.bytes),r.set(wm,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:r}}return n||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){Wp(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===fp&&this.handleTimeout_(),e.code===yp?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const r=n.segment;if(r.map&&(r.map.bytes=t.map.bytes),n.bytes=t.bytes,"function"!=typeof Ne.WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((()=>this.segmentRequestFinished_(e,t,i)),(()=>this.stopForError({message:"Error loading vtt.js"})));r.requested=!0;try{this.parseVTTCues_(n)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:Pc.Error.StreamingVttParserError,error:e}})}if(this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.cues.length?n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}:n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration},n.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,n.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new Ne.VTTCue(e.startTime,e.endTime,e.text):e)})),function(e){const t=e.cues;if(!t)return;const i={};for(let n=t.length-1;n>=0;n--){const r=t[n],s=`${r.startTime}-${r.endTime}-${r.text}`;i[s]?e.removeCue(r):i[s]=r}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if("function"!=typeof Ne.WebVTT)throw new Em;"function"==typeof Ne.TextDecoder?t=new Ne.TextDecoder("utf8"):(t=Ne.WebVTT.StringDecoder(),i=!0);const n=new Ne.WebVTT.Parser(Ne,Ne.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{Pc.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=Sm(t)),n.parse(t)}let r=e.bytes;i&&(r=Sm(r)),n.parse(r),n.flush()}updateTimeMapping_(e,t,i){const n=e.segment;if(!t)return;if(!e.cues.length)return void(n.empty=!0);const{MPEGTS:r,LOCAL:s}=e.timestampmap,a=r/ga-s+t.mapping;if(e.cues.forEach((e=>{const i=e.endTime-e.startTime,n=this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(n,0),e.endTime=Math.max(n+i,0)})),!i.syncInfo){const t=e.cues[0].startTime,r=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,r-n.duration)}}}handleRollover_(e,t){if(null===t)return e;let i=e*ga;const n=t*ga;let r;for(r=n<i?-8589934592:8589934592;Math.abs(i-n)>4294967296;)i+=r;return i/ga}}const Cm=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const n=i[e];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null};class km{constructor({start:e,end:t,segmentIndex:i,partIndex:n=null,appended:r=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=n,this.appended_=r}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class Im{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach((e=>e.resetAppendedStatus()))}}class Lm{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach((e=>e.resetAppendStatus()))}update(e,t){const{mediaSequence:i,segments:n}=e;if(this.isReliable_=this.isReliablePlaylist_(i,n),this.isReliable_)return this.updateStorage_(n,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const n=new Map;let r="\n",s=i,a=t;this.start_=s,e.forEach(((e,t)=>{const i=this.storage_.get(a),o=s,l=o+e.duration,u=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),d=new km({start:o,end:l,appended:u,segmentIndex:t});e.syncInfo=d;let c=s;const h=(e.parts||[]).map(((e,n)=>{const s=c,o=c+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[n]&&i.partsSyncInfo[n].isAppended),u=new km({start:s,end:o,appended:l,segmentIndex:t,partIndex:n});return c=o,r+=`Media Sequence: ${a}.${n} | Range: ${s} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=u,u}));n.set(a,new Im(d,h)),r+=`${Fp(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${u}\n`,a++,s=l})),this.end_=s,this.storage_=n,this.diagnostics_=r}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class Om extends Lm{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const Pm=[{name:"VOD",run:(e,t,i,n,r)=>{if(i!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"MediaSequence",run:(e,t,i,n,r,s)=>{const a=e.getMediaSequenceSync(s);if(!a)return null;if(!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,n,r)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let s=null,a=null;const o=Zc(t);r=r||0;for(let i=0;i<o.length;i++){const n=o[t.endList||0===r?i:o.length-(i+1)],l=n.segment,u=e.timelineToDatetimeMappings[l.timeline];if(!u||!l.dateTimeObject)continue;let d=l.dateTimeObject.getTime()/1e3+u;if(l.parts&&"number"==typeof n.partIndex)for(let e=0;e<n.partIndex;e++)d+=l.parts[e].duration;const c=Math.abs(r-d);if(null!==a&&(0===c||a<c))break;a=c,s={time:d,segmentIndex:n.segmentIndex,partIndex:n.partIndex}}return s}},{name:"Segment",run:(e,t,i,n,r)=>{let s=null,a=null;r=r||0;const o=Zc(t);for(let e=0;e<o.length;e++){const i=o[t.endList||0===r?e:o.length-(e+1)],l=i.segment,u=i.part&&i.part.start||l&&l.start;if(l.timeline===n&&void 0!==u){const e=Math.abs(r-u);if(null!==a&&a<e)break;(!s||null===a||a>=e)&&(a=e,s={time:u,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return s}},{name:"Discontinuity",run:(e,t,i,n,r)=>{let s=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let n=0;n<t.discontinuityStarts.length;n++){const a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,l=e.discontinuities[o];if(l){const e=Math.abs(r-l.time);if(null!==i&&i<e)break;(!s||null===i||i>=e)&&(i=e,s={time:l.time,segmentIndex:a,partIndex:null})}}}return s}},{name:"Playlist",run:(e,t,i,n,r)=>{if(t.syncInfo){return{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}];class Dm extends Pc.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Lm,i=new Om(t),n=new Om(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:n},this.logger_=qc("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,n,r){if(t!==1/0){return Pm.find((({name:e})=>"VOD"===e)).run(this,e,t)}const s=this.runStrategies_(e,t,i,n,r);if(!s.length)return null;for(const t of s){const{syncPoint:i,strategy:r}=t,{segmentIndex:s,time:a}=i;if(s<0)continue;const o=a,l=o+e.segments[s].duration;if(this.logger_(`Strategy: ${r}. Current time: ${n}. selected segment: ${s}. Time: [${o} -> ${l}]}`),n>=o&&n<l)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(s,{key:"time",value:n})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+rh({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,n,r){const s=[];for(let a=0;a<Pm.length;a++){const o=Pm[a],l=o.run(this,e,t,i,n,r);l&&(l.strategy=o.name,s.push({strategy:o.name,syncPoint:l}))}return s}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy;for(let s=1;s<e.length;s++){const a=Math.abs(e[s].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[s].syncPoint,r=e[s].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${r}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>86400)Pc.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let n=i-1;n>=0;n--){const i=e.segments[n];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),n=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start}));const r=n.dateTimeObject;n.discontinuity&&t&&r&&(this.timelineToDatetimeMappings[n.timeline]=-r.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const n=e.segment,r=e.part;let s,a,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),s=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;s=t.start+o.mapping,a=t.end+o.mapping}return r&&(r.start=s,r.end=a),(!n.start||s<n.start)&&(n.start=s),n.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let n=0;n<t.discontinuityStarts.length;n++){const r=t.discontinuityStarts[n],s=t.discontinuitySequence+n+1,a=r-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>o){let n;n=a<0?i.start-rh({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+rh({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[s]={time:n,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class Mm extends Pc.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if("number"==typeof t&&"number"==typeof i){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const n={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:n})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Nm=np(rp((function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();
27
- /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */let t=null;class i{constructor(e){let i,n,r;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4];let s,a,o;const l=[],u=[];let d,c,h,p,m,g;for(s=0;s<256;s++)u[(l[s]=s<<1^283*(s>>7))^s]=s;for(a=o=0;!n[a];a^=d||1,o=u[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,n[a]=p,r[p]=a,h=l[c=l[d=l[a]]],g=16843009*h^65537*c^257*d^16843008*a,m=257*l[p]^16843008*p,s=0;s<4;s++)t[s][a]=m=m<<24^m>>>8,i[s][p]=g=g<<24^g>>>8;for(s=0;s<5;s++)t[s]=t[s].slice(0),i[s]=i[s].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const s=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const u=e.slice(0),d=[];for(this._key=[u,d],i=o;i<4*o+28;i++)r=u[i-1],(i%o==0||8===o&&i%o==4)&&(r=s[r>>>24]<<24^s[r>>16&255]<<16^s[r>>8&255]<<8^s[255&r],i%o==0&&(r=r<<8^r>>>24^l<<24,l=l<<1^283*(l>>7))),u[i]=u[i-o]^r;for(n=0;i;n++,i--)r=u[3&n?i:i-4],d[n]=i<=4||n<4?r:a[0][s[r>>>24]]^a[1][s[r>>16&255]]^a[2][s[r>>8&255]]^a[3][s[255&r]]}decrypt(e,t,i,n,r,s){const a=this._key[1];let o,l,u,d=e^a[0],c=n^a[1],h=i^a[2],p=t^a[3];const m=a.length/4-2;let g,f=4;const y=this._tables[1],v=y[0],b=y[1],_=y[2],T=y[3],A=y[4];for(g=0;g<m;g++)o=v[d>>>24]^b[c>>16&255]^_[h>>8&255]^T[255&p]^a[f],l=v[c>>>24]^b[h>>16&255]^_[p>>8&255]^T[255&d]^a[f+1],u=v[h>>>24]^b[p>>16&255]^_[d>>8&255]^T[255&c]^a[f+2],p=v[p>>>24]^b[d>>16&255]^_[c>>8&255]^T[255&h]^a[f+3],f+=4,d=o,c=l,h=u;for(g=0;g<4;g++)r[(3&-g)+s]=A[d>>>24]<<24^A[c>>16&255]<<16^A[h>>8&255]<<8^A[255&p]^a[f++],o=d,d=c,c=h,h=p,p=o}}class n extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const r=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class s{constructor(e,t,i,a){const o=s.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength);let d=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),t,i,u)),d=o;d<l.length;d+=o)i=new Uint32Array([r(l[d-4]),r(l[d-3]),r(l[d-2]),r(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),t,i,u));this.asyncStream_.push((function(){var e;
28
- /*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */a(null,(e=u).subarray(0,e.byteLength-e[e.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(e,t,n,s){return function(){const a=function(e,t,n){const s=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),l=new Int32Array(o.buffer);let u,d,c,h,p,m,g,f,y;for(u=n[0],d=n[1],c=n[2],h=n[3],y=0;y<s.length;y+=4)p=r(s[y]),m=r(s[y+1]),g=r(s[y+2]),f=r(s[y+3]),a.decrypt(p,m,g,f,l,y),l[y]=r(l[y]^u),l[y+1]=r(l[y+1]^d),l[y+2]=r(l[y+2]^c),l[y+3]=r(l[y+3]^h),u=p,d=m,c=g,h=f;return o}(e,t,n);s.set(a,e.byteOffset)}}}var a,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};a="undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{};var l=a.BigInt||Number;l("0x1"),l("0x100"),l("0x10000"),l("0x1000000"),l("0x100000000"),l("0x10000000000"),l("0x1000000000000"),l("0x100000000000000"),l("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();const u=function(e){const t={};return Object.keys(e).forEach((i=>{const n=e[i];var r;r=n,("function"===ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t};self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new s(i,n,r,(function(e,i){self.postMessage(u({source:t.source,decrypted:i}),[i.buffer])}))}})));var Rm=ip(Nm);const Bm=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Um=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},qm=(e,t)=>{t.activePlaylistLoader=e,e.load()},jm={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:i},excludePlaylist:n}=t,r=i.activeTrack(),s=i.activeGroup(),a=(s.filter((e=>e.default))[0]||s[0]).id,o=i.tracks[a];if(r!==o){Pc.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}else n({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:i}}=t;Pc.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},Fm={AUDIO:(e,t,i)=>{if(!t)return;const{tech:n,requestOptions:r,segmentLoaders:{[e]:s}}=i;t.on("loadedmetadata",(()=>{const e=t.media();s.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(()=>{s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",jm[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:n,requestOptions:r,segmentLoaders:{[e]:s},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",(()=>{const e=t.media();s.playlist(e,r),s.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(()=>{s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",jm[e](e,i))}},Hm={AUDIO:(e,t)=>{const{vhs:i,sourceType:n,segmentLoaders:{[e]:r},requestOptions:s,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:d}=t,c=ph(d.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},c&&(a[e].main.default.playlists=d.main.playlists));for(const r in a[e]){o[r]||(o[r]=[]);for(const h in a[e][r]){let p,m=a[e][r][h];if(c?(u(`AUDIO group '${r}' label '${h}' is a main playlist`),m.isMainPlaylist=!0,p=null):p="vhs-json"===n&&m.playlists?new Oh(m.playlists[0],i,s):m.resolvedUri?new Oh(m.resolvedUri,i,s):m.playlists&&"dash"===n?new $h(m.playlists[0],i,s,d):null,m=jc({id:h,playlistLoader:p},m),Fm[e](e,m.playlistLoader,t),o[r].push(m),void 0===l[h]){const e=new Pc.AudioTrack({id:h,kind:Bm(m),enabled:!1,language:m.language,default:m.default,label:h});l[h]=e}}}r.on("error",jm[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:n,sourceType:r,segmentLoaders:{[e]:s},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:d}=t;for(const s in o[e]){l[s]||(l[s]=[]);for(const c in o[e][s]){if(!n.options_.useForcedSubtitles&&o[e][s][c].forced)continue;let h,p=o[e][s][c];if("hls"===r)h=new Oh(p.resolvedUri,n,a);else if("dash"===r){if(!p.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;h=new $h(p.playlists[0],n,a,d)}else"vhs-json"===r&&(h=new Oh(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=jc({id:c,playlistLoader:h},p),Fm[e](e,p.playlistLoader,t),l[s].push(p),void 0===u[c]){const e=i.addRemoteTextTrack({id:c,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:c},!1).track;u[c]=e}}}s.on("error",jm[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[e]:{groups:r,tracks:s}}}=t;for(const t in n[e]){r[t]||(r[t]=[]);for(const a in n[e][t]){const o=n[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let u={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[u.instreamId]&&(u=jc(u,l[u.instreamId])),void 0===u.default&&delete u.default,r[t].push(jc({id:a},o)),void 0===s[a]){const e=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;s[a]=e}}}}},Vm=(e,t)=>{for(let i=0;i<e.length;i++){if(ch(t,e[i]))return!0;if(e[i].playlists&&Vm(e[i].playlists,t))return!0}return!1},zm={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}},Xm=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{Hm[t](t,e)}));const{mediaTypes:t,mainPlaylistLoader:i,tech:n,vhs:r,segmentLoaders:{AUDIO:s,main:a}}=e;["AUDIO","SUBTITLES"].forEach((i=>{t[i].activeGroup=((e,t)=>i=>{const{mainPlaylistLoader:n,mediaTypes:{[e]:{groups:r}}}=t,s=n.media();if(!s)return null;let a=null;s.attributes[e]&&(a=r[s.attributes[e]]);const o=Object.keys(r);if(!a)if("AUDIO"===e&&o.length>1&&ph(t.main))for(let e=0;e<o.length;e++){const t=r[o[e]];if(Vm(t,s)){a=t;break}}else r.main?a=r.main:1===o.length&&(a=r[o[0]]);return void 0===i?a:null!==i&&a&&a.filter((e=>e.id===i.id))[0]||null})(i,e),t[i].activeTrack=zm[i](i,e),t[i].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:i,main:n},mediaTypes:{[e]:r}}=t,s=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;a&&l&&a.id===l.id||(r.lastGroup_=a,r.lastTrack_=s,Um(i,r),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),qm(a.playlistLoader,r)):o&&n.resetEverything()))})(i,e),t[i].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:n}}=t;n.lastGroup_=null,i.abort(),i.pause()})(i,e),t[i].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:s}}=t,a=s.activeTrack(),o=s.getActiveGroup(),l=s.activePlaylistLoader,u=s.lastTrack_;if((!u||!a||u.id!==a.id)&&(s.lastGroup_=o,s.lastTrack_=a,Um(n,s),o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const e=t.vhs.playlistController_,n=e.selectPlaylist();if(e.media()===n)return;return s.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),i.pause(),r.resetEverything(),void e.fastQualityChange_(n)}if("AUDIO"===e){if(!o.playlistLoader)return r.setAudio(!0),void r.resetEverything();n.setAudio(!0),r.setAudio(!1)}l!==o.playlistLoader?(n.track&&n.track(a),n.resetEverything(),qm(o.playlistLoader,s)):qm(o.playlistLoader,s)}})(i,e),t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)}));const o=t.AUDIO.activeGroup();if(o){const e=(o.filter((e=>e.default))[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),s.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanged()))})),i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanging()))}));const l=()=>{t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",l),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(()=>{n.audioTracks().removeEventListener("change",l),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio");for(const e in t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[e])};class Wm{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Bc(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map((e=>[e.ID,e]))))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class Gm extends Pc.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Wm,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=qc("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=Bc(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const n={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:n}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},((e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){const i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}let r;this.trigger({type:"contentsteeringloadcomplete",metadata:n});try{r=JSON.parse(this.request_.responseText)}catch(e){const t={errorType:Pc.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:"error",metadata:t})}this.assignSteeringProperties_(r);const s={contentSteeringInfo:n.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:s}),this.startTTLTimeout_()}))}setProxyServerUrl_(e){const t=new Ne.URL(e),i=new Ne.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(Ne.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new Ne.URL(e),i=this.getPathway(),n=this.getBandwidth_();if(i){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(n){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,n)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=Ne.setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){Ne.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Wm}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Bc(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let Ym;const Km=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Jm=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class Qm extends Pc.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:n,bandwidth:r,externVhs:s,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:u,cacheEncryptionKeys:d,bufferBasedABR:c,leastPixelDiffSelector:h,captionServices:p,experimentalUseMMS:m}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:g}=e;null==g&&(g=1/0),Ym=s,this.bufferBasedABR=Boolean(c),this.leastPixelDiffSelector=Boolean(h),this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.player_=e.player_,this.sourceType_=u,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=g,this.enableLowInitialPlaylist=l,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:g,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:nm,activeTrack:nm,getActiveGroup:nm,onGroupChanged:nm,onTrackChanged:nm,lastTrack_:null,logger_:qc(`MediaGroups[${t}]`)}})),e})(),m&&Ne.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new Ne.ManagedMediaSource,Pc.log("Using ManagedMediaSource")):Ne.MediaSource&&(this.mediaSource=new Ne.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Fc(),this.hasPlayed_=!1,this.syncController_=new Dm(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Rm,this.sourceUpdater_=new Am(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Mm,this.keyStatusMap_=new Map;const f={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new $h(t,this.vhs_,jc(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Oh(t,this.vhs_,jc(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new im(jc(f,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new im(jc(f,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new xm(jc(f,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((e,t)=>{function i(){n.off("vttjserror",r),e()}function r(){n.off("vttjsloaded",i),t()}n.one("vttjsloaded",i),n.one("vttjserror",r),n.addWebVttScript_()}))}),e);this.contentSteeringController_=new Gm(this.vhs_.xhr,(()=>this.mainSegmentLoader_.bandwidth)),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),Km.forEach((e=>{this[e+"_"]=Jm.bind(this,e)})),this.logger_=qc("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,(()=>{const e=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const n=this.media(),r=n&&(n.id||n.uri),s=e&&(e.id||e.uri);if(r&&r!==s){this.logger_(`switch media ${r} -> ${s} from ${t}`);const i={renditionInfo:{id:s,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:i}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,n=this.contentSteeringController_.getPathway();if(i&&n){const t=(i.length?i[0].playlists:i.playlists).filter((e=>e.attributes.serviceLocation===n));t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}}))}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=Ne.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Ne.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,n=Object.keys(i);let r;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)r=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||n.length&&i[n[0]];for(const t in e)if(e[t].default){r={label:t};break}}if(!r)return t;const s=[];for(const t in i)if(i[t][r.label]){const n=i[t][r.label];if(n.playlists&&n.playlists.length)s.push.apply(s,n.playlists);else if(n.uri)s.push(n);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const n=e.playlists[i];n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===t&&s.push(n)}}return s.length?s:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;dh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Xm({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial");if(!("vhs-json"===this.sourceType_&&this.initialMedia_.segments))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)})),this.mainPlaylistLoader_.on("error",(()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()})),this.mainPlaylistLoader_.on("mediachange",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;dh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const e=this.mainPlaylistLoader_.media();if("playlist-unchanged"===e.lastExcludeReason_)return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))})),this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})})),this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}));["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach((e=>{this.mainPlaylistLoader_.on(e,(e=>{this.player_.trigger(Gt({},e))}))}))}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let n=!0;const r=Object.keys(i.AUDIO);for(const e in i.AUDIO)for(const t in i.AUDIO[e]){i.AUDIO[e][t].uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ym.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:n,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:a,bufferBasedABR:o,log:l}){if(!n)return Pc.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${e&&e.id||"null"} -> ${n.id}`;if(!e)return l(`${u} as current playlist is not set`),!0;if(n.id===e.id)return!1;const d=Boolean(Xc(t,i).length);if(!e.endList)return d||"number"!=typeof e.partTargetDuration?(l(`${u} as current playlist is live`),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const c=Jc(t,i),h=o?ep.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ep.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${u} as duration < max low water line (${a} < ${h})`),!0;const p=n.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!o||c<s)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${m})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${c} < ${s})`),l(e),!0}if((!o||p>m)&&c>=r){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${c} >= ${r})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),l(e),!0}return l(`not ${u} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()})),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")})),this.mainSegmentLoader_.on("error",(()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended"),this.onEndOfStream()})),this.timelineChangeController_.on("audioTimelineBehind",(()=>{const e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;const t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)})),this.mainSegmentLoader_.on("earlyabort",(e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))}));const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}));["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach((e=>{this.mainSegmentLoader_.on(e,(e=>{this.player_.trigger(Gt({},e))})),this.audioSegmentLoader_.on(e,(e=>{this.player_.trigger(Gt({},e))})),this.subtitleSegmentLoader_.on(e,(e=>{this.player_.trigger(Gt({},e))}))}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything((()=>{this.mainSegmentLoader_.load()}))}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let n=i;if(e.start){const r=e.start.timeOffset;n=r<0?Math.max(i+r,t.start(0)):Math.min(i,r)}this.trigger("firstplay"),this.tech_.setCurrentTime(n)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(e=>{}))}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const i=Ym.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-n<=Vc;const s=r.end(r.length-1);return s-n<=Vc&&i-s<=Vc}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists,r=n.filter(lh),s=1===r.length&&r[0]===e;if(1===n.length&&i!==1/0)return Pc.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(t)}),i)}let t=!1;n.forEach((i=>{if(i===e)return;const n=i.excludeUntil;void 0!==n&&n!==1/0&&(t=!0,delete i.excludeUntil)})),t&&(Pc.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:Pc.log.warn,u=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${u} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const d=o.targetDuration/2*1e3||5e3,c="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=d;return this.switchMedia_(o,"exclude",s||c)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],n="all"===e;(n||"main"===e)&&i.push(this.mainPlaylistLoader_);const r=[];(n||"audio"===e)&&r.push("AUDIO"),(n||"subtitle"===e)&&(r.push("CLOSED-CAPTIONS"),r.push("SUBTITLES")),r.forEach((e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)})),["main","audio","subtitle"].forEach((t=>{const n=this[`${t}SegmentLoader_`];!n||e!==t&&"all"!==e||i.push(n)})),i.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]()}))))}setCurrentTime(e){const t=Xc(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Ym.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const n=this.mainPlaylistLoader_.main,r=Ym.Playlist.seekable(t,i,Ym.Playlist.liveEdgeDelay(n,t));if(0===r.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=Ym.Playlist.seekable(t,i,Ym.Playlist.liveEdgeDelay(n,t)),0===e.length)return}let s,a;if(this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Fc([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===s&&this.seekable_.start(0)===a)return;this.logger_(`seekable updated [${Gc(this.seekable_)}]`);const o={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:o}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=Ym.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach((e=>{e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=Dp(this.main(),t),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(n.video+=`,${i.audio||e.main.audioCodec||vi}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||vi,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!n.audio&&!n.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const s={};let a;if(["video","audio"].forEach((function(t){if(n.hasOwnProperty(t)&&(i=e[t].isFmp4,r=n[t],!(i?fi(r):yi(r)))){const i=e[t].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[t]),"audio"===t&&(a=i)}var i,r})),r&&a&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach((i=>{(i.attributes&&i.attributes.AUDIO)===e&&i!==t&&(i.excludeUntil=1/0)})),this.logger_(`excluding audio group ${e} as ${a} does not support codec(s): "${n.audio}"`)}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const i=(pi(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(pi(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${n[t]}"`)})),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return n}{const e=Object.keys(s).reduce(((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${s[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach((i=>{const n=e[i];if(-1!==t.indexOf(n.id))return;t.push(n.id);const r=Dp(this.main,n),s=[];!r.audio||yi(r.audio)||fi(r.audio)||s.push(`audio codec ${r.audio}`),!r.video||yi(r.video)||fi(r.video)||s.push(`video codec ${r.video}`),r.text&&"stpp.ttml.im1t"===r.text&&s.push(`text codec ${r.text}`),s.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id} for unsupported: ${s.join(", ")}`))}))}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,n=Op(pi(e)),r=Pp(n),s=n.video&&pi(n.video)[0]||null,a=n.audio&&pi(n.audio)[0]||null;Object.keys(i).forEach((e=>{const n=i[e];if(-1!==t.indexOf(n.id)||n.excludeUntil===1/0)return;t.push(n.id);const o=[],l=Dp(this.mainPlaylistLoader_.main,n),u=Pp(l);if(l.audio||l.video){if(u!==r&&o.push(`codec count "${u}" !== "${r}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&pi(l.video)[0]||null,t=l.audio&&pi(l.audio)[0]||null;e&&s&&e.type.toLowerCase()!==s.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${s.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id}: ${o.join(" && ")}`))}}))}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i=0){if(!e.segments)return;let n,r=i;for(let i=0;i<e.segments.length;i++){const s=e.segments[i];if(n||(n=Cm(t,r+s.duration/2)),n){if("cueIn"in s){n.endTime=r,n.adEndTime=r,r+=s.duration,n=null;continue}if(r<n.endTime){r+=s.duration;continue}n.endTime+=s.duration}else if("cueOut"in s&&(n=new Ne.VTTCue(r,r+s.duration,s.cueOut),n.adStartTime=r,n.adEndTime=r+parseFloat(s.cueOut),t.addCue(n)),"cueOutCont"in s){const[e,i]=s.cueOutCont.split("/").map(parseFloat);n=new Ne.VTTCue(r,r+s.duration,""),n.adStartTime=r-e,n.adEndTime=n.adStartTime+i,t.addCue(n)}r+=s.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=ep.GOAL_BUFFER_LENGTH,i=ep.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,ep.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=ep.BUFFER_LOW_WATER_LINE,i=ep.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,ep.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,ep.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?r:n)}bufferHighWaterLine(){return ep.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Xp(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const n=Ne.WebKitDataCue||Ne.VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(zp.has(t))continue;const r=new n(e.startTime,e.endTime,"");r.id=e.id,r.type="com.apple.quicktime.HLS",r.value={key:Vp[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(r.value.data=new Uint8Array(r.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(r)}e.processDateRange()}))})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const n=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Xp(this.inbandTextTracks_,e,this.tech_),Hp({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach((e=>{this.contentSteeringController_.on(e,(e=>{this.trigger(Gt({},e))}))})),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const n of e.playlists){const e=n.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()}))}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let n=!1;Object.keys(t).forEach((r=>{const s=t[r],a=this.pathwayAttribute_(s),o=a&&e!==a;s.excludeUntil===1/0&&"content-steering"===s.lastExcludeReason_&&!o&&(delete s.excludeUntil,delete s.lastExcludeReason_,n=!0);const l=!s.excludeUntil&&s.excludeUntil!==1/0;!i.has(s.id)&&o&&l&&(i.add(s.id),s.excludeUntil=1/0,s.lastExcludeReason_="content-steering",this.logger_(`excluding ${s.id} for ${s.lastExcludeReason_}`))})),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((t=>{const i=this.mediaTypes_[t];if(i.activePlaylistLoader){const t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(n=!0)}})),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[e,n]of t.entries()){i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(e))}for(const[n,r]of i.entries()){const i=t.get(n);if(i)this.equalPathwayClones_(i,r)||(this.mainPlaylistLoader_.updateOrDeleteClone(r,!0),this.contentSteeringController_.addAvailablePathway(n));else{e.filter((e=>e.attributes["PATHWAY-ID"]===r["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(r,e)})),this.contentSteeringController_.addAvailablePathway(n)}}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,n=t["URI-REPLACEMENT"].PARAMS;for(const e in i)if(i[e]!==n[e])return!1;for(const e in n)if(i[e]!==n[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((i=>{const n=this.mainPlaylistLoader_.getKeyIdSet(i);n&&n.size&&n.forEach((n=>{const r="usable",s=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===r,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;s?s&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${r}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${r}`)),e++)}))})),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach((e=>{const i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,n=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&n&&(delete e.excludeUntil,Pc.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))}))}addKeyStatus_(e,t){const i=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map((e=>e.toString(16).padStart(2,"0"))).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class Zm{constructor(e,t,i){const{playlistController_:n}=e,r=n.fastQualityChange_.bind(n);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var s,a,o;this.codecs=Dp(n.main(),t),this.playlist=t,this.id=i,this.enabled=(s=e.playlists,a=t.id,o=r,e=>{const t=s.main.playlists[a],i=oh(t),n=lh(t);if(void 0===e)return n;e?delete t.disabled:t.disabled=!0;const r={renditionInfo:{id:a,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};return e===n||i||(o(t),e?s.trigger({type:"renditionenabled",metadata:r}):s.trigger({type:"renditiondisabled",metadata:r})),e})}}const $m=["seeking","seeked","pause","playing","error"];class eg extends Pc.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=qc("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),s=this.playlistController_,a=["main","subtitle","audio"],o={};a.forEach((e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},s[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend),s[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)}));const l=e=>{["main","audio"].forEach((t=>{s[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",n),this.tech_.on($m,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",n),this.tech_.off($m,r),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach((e=>{s[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend),s[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)})),this.checkCurrentTimeTimeout_&&Ne.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Ne.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Ne.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[`${e}Buffered_`],n);if(this[`${e}Buffered_`]=n,r){const i={bufferedRanges:n};return t.trigger({type:"bufferedrangeschanged",metadata:i}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Yc(n)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Vc>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Fc([this.lastRecordedTime,e]));const t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)){i=e.end(e.length-1)}if(this.beforeSeekableWindow_(e,t)){const t=e.start(0);i=t+(t===e.end(0)?0:Vc)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Gc(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const n=this.playlistController_.sourceUpdater_,r=this.tech_.buffered(),s=n.audioBuffer?n.audioBuffered():null,a=n.videoBuffer?n.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-Hc),u=[s,a];for(let e=0;e<u.length;e++){if(!u[e])continue;if(Jc(u[e],t)<l)return!1}const d=Wc(r,t);return 0!==d.length&&(i=d.start(0)+Vc,this.logger_(`Buffered region starts (${d.start(0)}) just beyond seek point (${t}). Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Xc(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,n=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const r=Wc(n,t);return r.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${r.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let r=e.end(e.length-1)+Vc;const s=!i.endList,a="number"==typeof i.partTargetDuration;return s&&(a||n)&&(r=e.end(e.length-1)+3*i.targetDuration),t>r}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let n;if(e.length&&t.length){const r=Xc(e,i-3),s=Xc(e,i),a=Xc(t,i);a.length&&!s.length&&r.length&&(n={start:r.end(0),end:a.end(0)})}else{Wc(e,i).length||(n=this.gapFromVideoUnderflow_(e,i))}return!!n&&(this.logger_(`Encountered a gap in video from ${n.start} to ${n.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Wc(t,i);if(this.resetTimeUpdate_(),0===n.length||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+Hc);const r={gapInfo:{from:i,to:n.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:r}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=function(e){if(e.length<2)return Fc();const t=[];for(let i=1;i<e.length;i++){const n=e.end(i-1),r=e.start(i);t.push([n,r])}return Fc(t)}(e);for(let e=0;e<i.length;e++){const n=i.start(e),r=i.end(e);if(t-n<4&&t-n>2)return{start:n,end:r}}return null}}const tg={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ig=function(e,t){let i=0,n=0;const r=jc(tg,t);e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const s=function(){n&&e.currentTime(n)},a=function(t){null!=t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",s),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*r.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&"function"==typeof r.getSource)return i=Date.now(),r.getSource.call(e,a);Pc.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",s),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),ig(e,t)}},ng=function(e){ig(this,e)};var rg="3.15.0";const sg={PlaylistLoader:Oh,Playlist:mh,utils:Hh,STANDARD_PLAYLIST_SELECTOR:jp,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(mh.isEnabled);Bp(e,((e,t)=>Up(e,t)));return e.filter((e=>!!Dp(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:jp,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&Ne.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),qp(this.playlists.main,t,parseInt(Rp(this.tech_.el(),"width"),10)*n,parseInt(Rp(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:Up,comparePlaylistResolution:function(e,t){let i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||Ne.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||Ne.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Dh()};Object.keys(ep).forEach((e=>{Object.defineProperty(sg,e,{get:()=>(Pc.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),ep[e]),set(t){Pc.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?Pc.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):ep[e]=t}})}));const ag="videojs-vhs",og=function(e,t){const i=t.media();let n=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){n=t;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};sg.canPlaySource=function(){return Pc.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const lg=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:n})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const r=((e,t)=>e.reduce(((e,i)=>{if(!i.contentProtection)return e;const n=t.reduce(((e,t)=>{const n=i.contentProtection[t];return n&&n.pssh&&(e[t]={pssh:n.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[]))(i?n.concat([i]):n,Object.keys(t)),s=[],a=[];return r.forEach((t=>{a.push(new Promise(((t,i)=>{e.tech_.one("keysessioncreated",t)}))),s.push(new Promise(((i,n)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?n(e):i()}))})))})),Promise.race([Promise.all(s),Promise.race(a)])},ug=({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>{const r=((e,t,i)=>{if(!e)return e;let n={};t&&t.attributes&&t.attributes.CODECS&&(n=Op(pi(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const r=gi(n.video),s=gi(n.audio),a={};for(const i in e)a[i]={},s&&(a[i].audioContentType=s),r&&(a[i].videoContentType=r),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return jc(e,a)})(t,i,n);return!!r&&(e.currentSource().keySystems=r,!(r&&!e.eme)||(Pc.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},dg=()=>{if(!Ne.localStorage)return null;const e=Ne.localStorage.getItem(ag);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},cg=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},hg=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},pg=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},mg=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};sg.supportsNativeHls=function(){if(!qe||!qe.createElement)return!1;const e=qe.createElement("video");if(!Pc.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),sg.supportsNativeDash=!!(qe&&qe.createElement&&Pc.getTech("Html5").isSupported())&&/maybe|probably/i.test(qe.createElement("video").canPlayType("application/dash+xml")),sg.supportsTypeNatively=e=>"hls"===e?sg.supportsNativeHls:"dash"===e&&sg.supportsNativeDash,sg.isSupported=function(){return Pc.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},sg.xhr.onRequest=function(e){cg(sg.xhr,e)},sg.xhr.onResponse=function(e){hg(sg.xhr,e)},sg.xhr.offRequest=function(e){pg(sg.xhr,e)},sg.xhr.offResponse=function(e){mg(sg.xhr,e)};const gg=Pc.getComponent("Component");class fg extends gg{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=qc("VhsHandler"),t.options_&&t.options_.playerId){const e=Pc.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(qe,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=qe.fullscreenElement||qe.webkitFullscreenElement||qe.mozFullScreenElement||qe.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=jc(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=dg();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=ep.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ep.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=sg,this.options_.sourceType=Ti(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new Qm(this.options_);const n=jc({liveRangeSafeTimeDelta:Vc},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new eg(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",(()=>{const e=Pc.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));const r=this.options_.bufferBasedABR?sg.movingAverageBandwidthSelector(.55):sg.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=sg.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=Ne.navigator.connection||Ne.navigator.mozConnection||Ne.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const n=1e3*t.downlink*1e3;e=n>=i&&e>=i?Math.max(e,n):n}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;t=this.throughput>0?1/this.throughput:0;return Math.floor(1/(e+t))},set(){Pc.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Yc(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Yc(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",(()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!Ne.localStorage)return!1;let t=dg();t=t?jc(t,e):e;try{Ne.localStorage.setItem(ag,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),i=ph(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((e=>!oh(e))).map(((t,i)=>new Zm(e,t,t.id))):[]}})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=Ne.URL.createObjectURL(this.playlistController_.mediaSource),(Pc.browser.IS_ANY_SAFARI||Pc.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),lg({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()})).catch((e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=ug({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=Pc.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{!function(e,t){t.representations().forEach((t=>{e.addQualityLevel(t)})),og(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{og(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":rg,"mux.js":"7.0.3","mpd-parser":"1.3.1","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return Am.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&Ne.URL.revokeObjectURL&&(Ne.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Vh({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return zh({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{cg(this.xhr,e)},this.xhr.onResponse=e=>{hg(this.xhr,e)},this.xhr.offRequest=e=>{pg(this.xhr,e)},this.xhr.offResponse=e=>{mg(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach((e=>{this.playlistController_.on(e,(e=>{this.player_.trigger(Gt({},e))}))})),["gapjumped","playedrangeschanged"].forEach((e=>{this.playbackWatcher_.on(e,(e=>{this.player_.trigger(Gt({},e))}))}))}}const yg={name:"videojs-http-streaming",VERSION:rg,canHandleSource(e,t={}){const i=jc(Pc.options,t);return!(!i.vhs.experimentalUseMMS&&!fi("avc1.4d400d,mp4a.40.2",!1))&&yg.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=jc(Pc.options,i);return t.vhs=new fg(e,t,n),t.vhs.xhr=Dh(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=Ti(e);if(!i)return"";const n=yg.getOverrideNative(t);return!sg.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!(Pc.browser.IS_ANY_SAFARI||Pc.browser.IS_IOS),{overrideNative:n=i}=t;return n}};function vg(e,t){var i=Hg(jg(t.uri));if(0===e.querySelectorAll('source[type="'.concat(i,'"]')).length){var n=document.createElement("source");n.src=t.url,n.type=i,e.insertBefore(n,e.lastElementChild)}return e}fi("avc1.4d400d,mp4a.40.2",!0)&&Pc.getTech("Html5").registerSourceHandler(yg,0),Pc.VhsHandler=fg,Pc.VhsSourceHandler=yg,Pc.Vhs=sg,Pc.use||Pc.registerComponent("Vhs",sg),Pc.options.vhs=Pc.options.vhs||{},Pc.getPlugin&&Pc.getPlugin("reloadSourceOnError")||Pc.registerPlugin("reloadSourceOnError",ng);var bg={autoplay:!1,muted:!0,preload:"auto",controls:!1},_g=function(e){return r({controls:!1,preload:"auto",autoplay:!1,muted:!0},e)},Tg=[e.ConsumerPlatform.CHROMEOS,e.ConsumerPlatform.ELECTRON];function Ag(e,t){var i=Dg(e),n={duration:0,init:function(){var r=this,a=!1;n.duration=e.duration;var o=Pc(i);o&&(o.on("loadstart",(function(){console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," has started loading data . . ."))})),o.on("loadedmetadata",(function(){0===e.duration&&(n.duration=o.duration()),console.debug("??? XLR.debug >> VideoMedia: loadedmetadata: Setting video duration to = "+n.duration)})),o.on("canplay",(function(){console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," can be played . . ."))})),o.on("playing",(function(){0===n.duration&&(n.duration=o.duration()),console.debug("??? XLR.debug >> VideoMedia: playing: Showing Media "+e.id+" for "+n.duration+"s of Region "+e.region.regionId),console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," is now playing . . ."))})),o.ready((function(){var n=document.querySelector(".media--item.".concat(i));document.body.contains(n)?void 0!==o&&(o.muted(!0),Promise.race([new Promise((function(t,i){return setTimeout(l(s().mark((function n(){return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," : Trying to force play after 0.1 seconds")),n.prev=1,0!==o.currentTime()){n.next=6;break}return o.muted(e.muted),n.next=6,o.play();case 6:t(!0),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(1),i("Play failed");case 12:case"end":return n.stop()}}),n,null,[[1,9]])}))),100)})),new Promise((function(e,t){return setTimeout((function(){return t("Timeout")}),5e3)}))]).then((function(){console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," : Autoplay started"))})).catch(function(){var i=l(s().mark((function i(n){return s().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:"Timeout"===n?(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," : Promise not resolved within 5 seconds. Move to next media")),r.stop()):(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," : Autoplay error: ").concat(n)),Tg.includes(t.config.platform)&&sf("Media autoplay error",e).then((function(){r.stop()})));case 1:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}()),o.on("loadstart",(function(){a=!1})),0===e.duration&&o.on("timeupdate",(function(){var t=o.duration(),i=o.currentTime(),n=e.region.totalMediaObjects>1,r=0;void 0!==t&&void 0!==i&&(r=1e3*(t-i)),n&&0===r&&!a?e.region.prepareNextMedia():n&&r<=2e3&&!a&&(console.log("Less than preloadBufferTimeMs remaining! Do something now."),e.region.prepareNextMedia(),a=!0),r>2e3&&(a=!1)}))):e.emitter.emit("cancelled",e)})),o.on("error",function(){var i=l(s().mark((function i(n){return s().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:console.debug("??? XLR.debug >> VideoMedia: Media Error: ".concat(Mg(e.mediaType)," for media > ").concat(e.id)),Tg.includes(t.config.platform)?sf("Video file source not supported",e).then((function(){r.stop()})):setTimeout((function(){console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," has ended . . .")),r.stop()}),5e3);case 2:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}()),0===e.duration&&o.on("ended",(function(){console.debug("??? XLR.debug >> VideoMedia: onended: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," has ended playing . . .")),r.stop()})))},stop:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=e.player;console.debug("??? XLR.debug >> VideoMedia::stop",{vjsPlayer:i,isDisposed:null==i?void 0:i.isDisposed_,el:null==i?void 0:i.el_}),void 0===i||i.isDisposed_?(e.player=void 0,e.html=null,e.emitter.emit("end",e)):(t||e.emitter.emit("end",e),i.dispose(),e.player=void 0)},play:function(){var n,r=this,a=Pc(i);void 0!==a&&(null===(n=a.play())||void 0===n||n.catch(function(){var i=l(s().mark((function i(n){return s().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:"Timeout"===n?(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," : Promise not resolved within 5 seconds. Move to next media")),r.stop()):(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(e.mediaType)," for media > ").concat(e.id," : Autoplay error: ").concat(n)),Tg.includes(t.config.platform)&&sf("Media autoplay error",e).then((function(){r.stop()})));case 1:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}()))}};return n}var Sg,wg=function(e,t){return{keyframes:[{display:"in"===t?"none":"block"},{display:"out"===t?"none":"block"}],timing:{duration:e}}},Eg=function(e){return{keyframes:[{opacity:0},{opacity:1}],timing:{duration:e,fill:"forwards"}}},xg=function(e){return{keyframes:[{opacity:1},{opacity:0,zIndex:-1}],timing:{duration:e,fill:"forwards"}}},Cg=function(e,t,i){var n=[{opacity:0},{opacity:1,zIndex:1}],s={duration:e,fill:"forwards"};return t&&Boolean(t.from)&&(n[0]=r(r({},t.from),n[0])),t&&Boolean(t.to)&&(n[1]=r(r({},t.to),n[1])),{keyframes:n,timing:s}},kg=function(e,t,i){var n=[{opacity:1},{opacity:0,zIndex:-1}],s={duration:e,fill:"forwards"};return t&&Boolean(t.from)&&(n[0]=r(r({},t.from),n[0])),t&&Boolean(t.to)&&(n[1]=r(r({},t.to),n[1])),{keyframes:n,timing:s}},Ig=function(e,t){return{fadeIn:Eg(t.duration),fadeOut:xg(t.duration),flyIn:Cg(t.duration,t.keyframes,t.direction),flyOut:kg(t.duration,t.keyframes,t.direction),defaultIn:wg(t.duration,"in"),defaultOut:wg(t.duration,"out")}[e]},Lg=function(e){var t={from:{},to:{}},i=function(t){return"from"===t?"in"===e.trans?0:1:"out"===e.trans?1:0};switch(e.direction){case"N":default:t.from={opacity:i("from"),top:"in"===e.trans?"".concat(e.height,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"-".concat(e.height,"px")};break;case"NE":t.from={opacity:i("from"),top:"in"===e.trans?"".concat(e.height,"px"):0,left:"in"===e.trans?"-".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"-".concat(e.height,"px"),left:"in"===e.trans?0:"".concat(e.width,"px")};break;case"E":t.from={opacity:i("from"),left:"in"===e.trans?"-".concat(e.width,"px"):0},t.to={opacity:i("to"),left:"in"===e.trans?0:"".concat(e.width,"px")};break;case"SE":t.from={opacity:i("from"),top:"in"===e.trans?"-".concat(e.height,"px"):0,left:"in"===e.trans?"-".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"".concat(e.height,"px"),left:"in"===e.trans?0:"".concat(e.width,"px")};break;case"S":t.from={opacity:i("from"),top:"in"===e.trans?"-".concat(e.height,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"".concat(e.height,"px")};break;case"SW":t.from={opacity:i("from"),top:"in"===e.trans?"-".concat(e.height,"px"):0,left:"in"===e.trans?"".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"".concat(e.height,"px"),left:"in"===e.trans?0:"-".concat(e.width,"px")};break;case"W":t.from={opacity:i("from"),left:"in"===e.trans?"".concat(e.width,"px"):0},t.to={opacity:i("to"),left:"in"===e.trans?0:"-".concat(e.width,"px")};break;case"NW":t.from={opacity:i("from"),top:"in"===e.trans?"".concat(e.height,"px"):0,left:"in"===e.trans?"".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"-".concat(e.height,"px"),left:"in"===e.trans?0:"-".concat(e.width,"px")}}return t},Og=function(){return c((function e(){u(this,e)}),null,[{key:"load",value:(e=l(s().mark((function e(t){var i,n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.cache.has(t)){e.next=2;break}return e.abrupt("return",this.cache.get(t));case 2:return e.prev=2,e.next=5,fetch(t);case 5:if((i=e.sent).ok){e.next=8;break}throw new Error("Failed to fetch video: ".concat(i.statusText));case 8:return e.next=10,i.blob();case 10:return n=e.sent,r=URL.createObjectURL(n),this.cache.set(t,r),e.abrupt("return",r);case 16:throw e.prev=16,e.t0=e.catch(2),console.error("BlobLoader Error:",e.t0),e.t0;case 20:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(t){return e.apply(this,arguments)})},{key:"release",value:function(e){if(this.cache.has(e)){var t=this.cache.get(e);URL.revokeObjectURL(t),this.cache.delete(e)}}}]);var e}();function Pg(e){return e.idCounter>500&&(e.idCounter=0),e.idCounter=e.idCounter+1,e.idCounter}h(Og,"cache",new Map),function(e){e.actionControllerTitle="Webhook Controller",e.navigateToLayout="Navigate to layout with code [layoutTag]?",e.emptyRegionMessage="Empty region!",e.next="Next Item",e.previous="Previous Item",e.navWidget="Navigate to Widget",e.navLayout="Navigate to Layout",e.widgetId="Widget ID",e.layoutCode="Layout Code",e.target="Target"}(Sg||(Sg={}));var Dg=function(e){var t=e.mediaType,i=e.containerName;return"video"===t?i+="-vid":"audio"===t&&(i+="-aud"),i},Mg=function(e){return null===e?"":String(e).charAt(0).toUpperCase()+String(e).substring(1)};function Ng(){return(Ng=l(s().mark((function e(t,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":i||""}}).then((function(e){return e.blob()})).then((function(e){return new Promise((function(t,i){var n=new FileReader;n.onloadend=function(){return t(n.result)},n.onerror=i,n.readAsDataURL(e)}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rg(){return(Rg=l(s().mark((function e(t,i,n){var r,a,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":n||""}});case 2:if(r=e.sent,a=new Blob,"image"!==i){e.next=8;break}a=new Blob,e.next=19;break;case 8:if("video"!==i){e.next=14;break}return e.next=11,r.blob();case 11:a=e.sent,e.next=19;break;case 14:if("audio"!==i){e.next=19;break}return e.next=17,r.arrayBuffer();case 17:o=e.sent,a=new Blob([o],{type:Fg(jg(t))});case 19:return e.abrupt("return",URL.createObjectURL(a));case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bg(e,t){return Ug.apply(this,arguments)}function Ug(){return(Ug=l(s().mark((function e(t,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":i||""}}).then((function(e){return e.json()})).catch((function(e){console.debug(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qg(){return(qg=l(s().mark((function e(t,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":i||""}}).then((function(e){return e.text()})).then((function(e){return String(e).length>0?e:""})).catch((function(e){return console.debug(e),null==e?void 0:e.message})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jg(e){var t=String(e).split(".");return t[t.length-1]}function Fg(e){var t={mp3:"audio/mp3",wav:"audio/wav",ogg:"audio/ogg"};if(Boolean(t[e]))return t[e]}function Hg(e){var t={mp4:"video/mp4",webm:"video/webm",wmv:"video/x-ms-wmv"};if(Boolean(t[e]))return t[e]}function Vg(t,i){var n="";if(i.regionOptions&&Boolean(i.regionOptions.getResourceUrl)&&(n=i.regionOptions.getResourceUrl.replace(":regionId",i.regionId).replace(":id",i.mediaId)+"?preview=1&layoutPreview=1"),t.platform===e.ConsumerPlatform.CMS&&Boolean(i.regionOptions.previewJwt)&&(n+="&jwt="+i.regionOptions.previewJwt),t.platform===e.ConsumerPlatform.CHROMEOS){!i.isGlobalContent&&i.isImageOrVideo&&(n="/required-files/resource/"+i.fileId+"?saveAs="+i.uri)}else t.platform===e.ConsumerPlatform.ELECTRON?"html"===i.render||"ticker"===i.mediaType||"webpage"===i.mediaType?n=t.appHost+"layout_"+i.layoutId+"_region_"+i.regionId+"_media_"+i.mediaId+".html":"native"===i.render&&i.isImageOrVideo&&(n=t.appHost+i.uri):Boolean(i.mediaType)||(n+="&scale_override="+i.scaleFactor);return n}function zg(e,t){var i,n,r,s=e&&(null===(i=e.config)||void 0===i?void 0:i.schemaVersion),a=e&&(null===(n=e.config)||void 0===n?void 0:n.hardwareKey);return"/pwa/getResource?v="+s+"&serverKey="+(e&&(null===(r=e.config)||void 0===r?void 0:r.cmsKey))+"&hardwareKey="+a+"&layoutId="+t.layoutId+"&regionId="+t.regionId+"&mediaId="+t.mediaId}function Xg(e){return"/xmds.php?file="+e.uri}function Wg(t,i){var n="";return t===e.ConsumerPlatform.CMS?n=i.options.layoutBackgroundDownloadUrl.replace(":id",i.id)+"&preview=1&width="+i.sWidth+"&height="+i.sHeight+"&dynamic&proportional=0":t===e.ConsumerPlatform.CHROMEOS?n=Xg({uri:i.bgImage}):t===e.ConsumerPlatform.ELECTRON&&(n=i.options.appHost+i.bgImage),n}function Gg(e){return e&&null!==e?e.getAttributeNames().reduce((function(t,i){return r(r({},t),{},h({},i,{value:e.getAttribute(i)}))}),{}):{}}function Yg(e){var t=new Date;return new Date(t.setHours(24*e||1)).toJSON()}function Kg(e,t){return!(e.length<1||!t)&&-1!==e.findIndex((function(e){return e.layoutId===t}))}function Jg(e,t){return e.length<1||!t?null:e.findIndex((function(e){return e.layoutId===t}))}function Qg(e){var t;return!!e&&(1===e.length&&"default"===(null===(t=e[0].response)||void 0===t?void 0:t.nodeName))}function Zg(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&0!==e.length?void 0!==e.find((function(e){return-1===e.layoutId})):t}function $g(e){var t=e,i=Dg(t),n=".media--item.".concat(i),r=t.region.html.querySelector(n);null===r&&((r="video"===t.mediaType?document.createElement("video"):"audio"===t.mediaType?new Audio:document.createElement("div")).id=i),r.dataset.mediaId=t.id,r.dataset.mediaType=t.mediaType,r.dataset.type=t.type,r.dataset.render=t.render,r.dataset.duration=String(t.duration),r.dataset.fileId=t.fileId,r.className="media--item ".concat(i);var a,o,u="\n width: ".concat(t.divWidth,"px;\n height: ").concat(t.divHeight,"px;\n position: absolute;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n ");if("video"!==t.mediaType&&(u+="\n visibility: hidden;\n opacity: 0;\n z-index: 0;\n "),r.style.cssText=u,"html"===t.render||"ticker"===t.mediaType||"webpage"===t.mediaType?(t.checkIframeStatus=!0,t.iframe=(a=t,(o=document.createElement("iframe")).scrolling="no",o.id=a.iframeName,o.width="".concat(a.divWidth,"px"),o.height="".concat(a.divHeight,"px"),o.style.cssText="border: 0;","html"!==a.render&&"webpage"!==a.render||null===a.url?o.src="".concat(a.url,"&width=").concat(a.divWidth,"&height=").concat(a.divHeight):o.src=a.url,o)):"image"===t.mediaType?r=function(e,t){if("stretch"===e.options.scaletype)t.style.cssText=t.style.cssText.concat("background-size: 100% 100%;");else if("fit"===e.options.scaletype)t.style.cssText=t.style.cssText.concat("background-size: cover;");else{var i=""==e.options.align?"center":e.options.align,n=""==e.options.valign||"middle"==e.options.valign?"center":e.options.valign;t.style.cssText=t.style.cssText.concat("background-position: ".concat(i," ").concat(n))}return t}(t,r):"video"===t.mediaType?r=function(e,t){var i=vg(t,e),n=!1;return Boolean(e.options.mute)&&(n="1"===e.options.mute),Boolean(e.options.scaletype)&&"stretch"===e.options.scaletype&&(i.style.objectFit="fill"),i.classList.add("video-js","vjs-default-skin"),e.loop&&(e.loop=!0,i.loop=!0),e.muted=n,i}(t,r):"audio"===t.mediaType&&(r=function(e,t){var i=t;return i.preload="auto",i.textContent="Unsupported Audio",i.autoplay=!0,e.loop&&(i.loop=!0),i}(t,r)),("html"===t.render||"ticker"===t.mediaType)&&null!==t.url&&"1"===t.options.durationisperitem){var d=new RegExp("\x3c!-- NUMITEMS=(.*?) --\x3e");l(s().mark((function e(){var i,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bg("".concat(t.url,"&width=").concat(t.divWidth,"&height=").concat(t.divHeight),t.options.previewJwt);case 2:i=e.sent,console.debug({html:i}),null!==(n=d.exec(i))&&(t.duration=parseInt(String(t.duration))*parseInt(n[1]));case 6:case"end":return e.stop()}}),e)})))()}if(Boolean(t.options.transin)&&Boolean(t.options.transinduration)){var c=Number(t.options.transinduration),h=Ig("fadeIn",{duration:c});r.animate(h.keyframes,h.timing)}return r}function ef(t,i){var n=Dg(t);if(null!==t.html){var a=Pc.getPlayer(n);void 0!==a&&(a.dispose(),t.player=void 0);var o=i.layout.html,u="#"+i.layout.containerName+'[data-sequence="'+i.layout.index+'"]',d=document.querySelector(u),c=document.querySelector("#"+i.containerName),h=null==c?void 0:c.querySelector("."+n);console.debug("??? XLR.debug >> [Generators::prepareVideoMedia]",{layoutSelector:u,$layoutWithIndex:d,$region:c,mediaInRegion:h,mediaHtml:t.html,existingPlayer:a,mediaId:n,layoutInDOM:document.body.contains(o)}),h?(h.remove(),t.html=$g(t)):t.html=$g(t),null!==c&&c.appendChild(t.html);var p=document.body.contains(t.html);console.debug("??? XLR.debug >> [Generators::prepareVideoMedia]",{isMediaInDOM:p,mediaHtml:t.html,mediaId:n}),t.player=Pc(n,r(r({},bg),{},{errorDisplay:i.xlr.config.platform!==e.ConsumerPlatform.CHROMEOS,loop:t.loop})),t.player.on("error",function(){var i=l(s().mark((function i(n){return s().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t.region.xlr.config.platform===e.ConsumerPlatform.CHROMEOS&&sf("Video file not supported",t).then((function(){t.emitter.emit("end",t)}));case 1:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}()),t.player.el().style.setProperty("visibility","hidden"),t.player.el().style.setProperty("opacity","0"),t.player.el().style.setProperty("z-index","-99")}}function tf(e,t){var i=Dg(e);e.html.style.setProperty("background-image","url(".concat(e.url));var n=t.html.querySelector("."+i);n&&n.remove();var r=document.querySelector("#"+t.containerName);null!==r&&r.appendChild(e.html)}function nf(e,t){var i=Dg(e);null!==e.url&&(e.html.src=e.url);var n=t.html.querySelector("."+i);n&&n.remove();var r=document.querySelector("#"+t.containerName);null!==r&&r.appendChild(e.html)}function rf(e,t){if(e.ready=!1,e.html){var i=Dg(e),n=document.querySelector("#".concat(t.layout.containerName,'[data-sequence="').concat(t.layout.index,'"]')).querySelector("#"+t.containerName).querySelector("."+i);if(console.debug("<><> XLR.debug >> [Media] - [Generators::prepareHtmlMedia]",{mediaId:i,mediaInRegion:n}),e.html.innerHTML="",e.html.appendChild(e.iframe),!n){var r=document.querySelector("#"+t.containerName);null!==r&&r.appendChild(e.html),e.ready=!0}}}function sf(e,t){return af.apply(this,arguments)}function af(){return(af=l(s().mark((function e(t,i){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={getSW:function(){return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.serviceWorker.getRegistration("/pwa/sw.js");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))()},postMsg:function(e){return new Promise((function(t){var i;null===(i=navigator.serviceWorker.controller)||void 0===i||i.postMessage(e),t(!0)}))}},e.next=3,n.getSW();case 3:e.sent&&n.postMsg({type:"MEDIA_FAULT",code:5002,reason:t,mediaId:i.id,regionId:i.region.id,layoutId:i.region.layout.id,date:ke(new Date,"yyyy-MM-dd HH:mm:ss"),expires:ke(new Date(Yg(1)),"yyyy-MM-dd HH:mm:ss")}).then((function(){i.region.totalMediaObjects>1&&i.region.prepareNextMedia()})).finally((function(){console.debug("??? XLR.debug >> VideoMedia - Done reporting media fault",{mediaId:i.id,regionItems:i.region.totalMediaObjects})}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function of(e,t){if(e&&null!==e.id)return e.index=t,e}function lf(e){return{init:function(){var t=document.getElementById(Dg(e)),i=null;if(t){t.onloadstart=function(){console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," has started loading data . . ."))},t.onloadeddata=function(){t.readyState>=2&&console.debug("".concat(Mg(e.mediaType)," data for media > ").concat(e.id," has been fully loaded . . ."))},t.oncanplay=function(){console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," can be played . . ."))},t.onplaying=function(){console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," is now playing . . .")),null!==i&&i.remove()};var n=t.play();void 0!==n&&n.then((function(){console.debug("autoplay started . . .")})).catch((function(e){var n;"NotAllowedError"===e.name&&((i=document.createElement("button")).classList.add("play-audio-btn"),i.textContent="Play Audio",i.addEventListener("click",(function(){t.muted=!1,t.play()})),null===(n=t.parentNode)||void 0===n||n.insertBefore(i,t.nextSibling))})),0===e.duration&&(t.ondurationchange=function(){console.debug("Showing Media "+e.id+" for "+t.duration+"s of Region "+e.region.regionId)},t.onended=function(){var t;console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," has ended playing . . .")),null===(t=e.emitter)||void 0===t||t.emit("end",e)})}}}}var uf=function(){return c((function e(t,i,n,r,s){var a,o,l,d,c,p=this;u(this,e),h(this,"attachedAudio",!1),h(this,"checkIframeStatus",!1),h(this,"containerName",""),h(this,"divHeight",0),h(this,"divWidth",0),h(this,"duration",0),h(this,"emitter",w()),h(this,"enableStat",!1),h(this,"fileId",""),h(this,"finished",!1),h(this,"html",null),h(this,"id",""),h(this,"idCounter",0),h(this,"iframe",null),h(this,"iframeName",""),h(this,"index",0),h(this,"loadIframeOnRun",!1),h(this,"loop",!1),h(this,"mediaId",""),h(this,"mediaType",""),h(this,"muted",!1),h(this,"options",{}),h(this,"player",void 0),h(this,"ready",!0),h(this,"region",{}),h(this,"render","html"),h(this,"schemaVersion","1"),h(this,"singlePlay",!1),h(this,"state",k.IDLE),h(this,"tempSrc",""),h(this,"timeoutId",setTimeout((function(){}),0)),h(this,"type",""),h(this,"uri",""),h(this,"url",null),h(this,"useDuration",!1),h(this,"xml",null),h(this,"videoHandler",void 0),h(this,"mediaTimer",void 0),h(this,"mediaTimeCount",0),h(this,"xlr",{}),h(this,"statsBC",new BroadcastChannel("statsBC")),h(this,"hasCommandExecuted",void 0),this.region=t,this.id=i,this.mediaId=this.id,this.xml=n,this.options=r,this.xlr=s,this.fileId=(null===(a=this.xml)||void 0===a?void 0:a.getAttribute("fileId"))||"",this.idCounter=Pg(this.options),this.containerName="M-".concat(this.id,"-").concat(this.idCounter),this.iframeName="".concat(this.containerName,"-iframe"),this.mediaType=(null===(o=this.xml)||void 0===o?void 0:o.getAttribute("type"))||"",this.render=(null===(l=this.xml)||void 0===l?void 0:l.getAttribute("render"))||"",this.duration=parseInt(null===(d=this.xml)||void 0===d?void 0:d.getAttribute("duration"))||0,this.enableStat=Boolean((null===(c=this.xml)||void 0===c?void 0:c.getAttribute("enableStat"))||!1),this.hasCommandExecuted=!1,this.on("start",(function(e){if(e.state!==k.PLAYING){if(e.state=k.PLAYING,"video"===e.mediaType)Ag(e,p.xlr).init(),e.duration>0&&p.startMediaTimer(e);else if("audio"===e.mediaType)lf(e).init(),e.duration>0&&p.startMediaTimer(e);else if("shellcommand"===e.mediaType){if(p.hasCommandExecuted&&!p.loop)return;p.hasCommandExecuted=!0,p.emitCommand(e),e.duration>0&&p.startMediaTimer(e)}else p.startMediaTimer(e);e.enableStat&&p.statsBC.postMessage({action:"START_STAT",mediaId:parseInt(e.id),layoutId:e.region.layout.id,scheduleId:e.region.layout.scheduleId,type:"media"}),console.debug("Media::Emitter > Start - Calling widgetStart event"),p.xlr.emitter.emit("widgetStart",parseInt(e.id))}})),this.on("end",(function(e){e.state!==k.ENDED&&(e.state=k.ENDED,p.mediaTimer&&(clearInterval(p.mediaTimer),p.mediaTimeCount=0),e.enableStat&&p.statsBC.postMessage({action:"END_STAT",mediaId:parseInt(e.id),layoutId:e.region.layout.id,scheduleId:e.region.layout.scheduleId,type:"media"}),console.debug("Media::Emitter > End - Calling widgetEnd event",{mediaId:e.id,regionId:e.region.id,layoutId:e.region.layout.id}),p.xlr.emitter.emit("widgetEnd",parseInt(e.id)),e.region.playNextMedia())})),this.on("cancelled",(function(e){e.state!==k.CANCELLED&&(e.state=k.CANCELLED,p.mediaTimer&&(clearInterval(p.mediaTimer),p.mediaTimeCount=0),e.enableStat&&p.statsBC.postMessage({action:"END_STAT",mediaId:parseInt(e.id),layoutId:e.region.layout.id,scheduleId:e.region.layout.scheduleId,type:"media"}),console.debug("Media::Emitter > End - Calling widgetEnd event",{mediaId:e.id,regionId:e.region.id,layoutId:e.region.layout.id}),p.xlr.emitter.emit("widgetEnd",parseInt(e.id)),e.region.playNextMedia())})),this.init()}),[{key:"startMediaTimer",value:function(e){var t=this,i=2e3,n=1e3*e.duration/2-i,r=!1;n<i&&(n=e.duration/2*1e3),console.debug("<><> XLR.debug >> [Media::startMediaTimer]",{preloadTimeMs:i,preloadTimeBufferMs:n,isPreparingNextMedia:r,mediaDuration:e.duration}),this.mediaTimer=setInterval((function(){t.mediaTimeCount++;var i=1e3*t.mediaTimeCount;t.region.totalMediaObjects>1&&i>=n&&!r&&(r=!0,t.region.prepareNextMedia()),t.mediaTimeCount>e.duration&&(console.debug("??? XLR.debug >> Media::startMediaTimer: emit>end: on media "+e.id+" of Region "+e.region.regionId),console.debug("??? XLR.debug >> Media::startMediaTimer - Media::Emitter > End",{currentLayout:t.xlr.currentLayout,media:e,region:e.region,layout:e.region.layout}),e.emitter.emit("end",e),"video"===e.mediaType&&(console.debug("??? XLR.debug >> VideoMedia::stop - ".concat(Mg(e.mediaType)," for media > ").concat(e.id," has ended playing . . .")),void 0!==e.player&&Ag(e,t.xlr).stop(!0)))}),1e3),console.debug("startMediaTimer: Showing Media "+e.id+" for "+e.duration+"s of Region "+e.region.regionId)}},{key:"on",value:function(e,t){return this.emitter.on(e,t)}},{key:"init",value:function(){var t,i=null===(t=this.xml)||void 0===t?void 0:t.getElementsByTagName("options");if(i)for(var n=0,s=Array.from(i);n<s.length;n++)for(var a=s[n].children,o=0,l=Array.from(a);o<l.length;o++){var u=l[o];this.options[u.nodeName.toLowerCase()]=u.textContent}Boolean(this.options.uri)&&(this.uri=this.options.uri),"1"===this.options.showfullscreen?(this.divWidth=this.region.layout.sWidth,this.divHeight=this.region.layout.sHeight):(this.divWidth=this.region.sWidth,this.divHeight=this.region.sHeight);var d=r(r({},this.xlr.config.config),{},{regionOptions:this.region.options,layoutId:this.region.layout.layoutId,regionId:this.region.id,mediaId:this.id,fileId:this.fileId,scaleFactor:this.region.layout.scaleFactor,uri:this.uri,isGlobalContent:"global"===this.mediaType,isImageOrVideo:"image"===this.mediaType||"video"===this.mediaType,render:this.render});"image"!==this.mediaType&&"video"!==this.mediaType||(d.mediaType=this.mediaType);var c="";this.xlr.config.platform===e.ConsumerPlatform.CMS?c=Vg(this.xlr.config,d):this.xlr.config.platform===e.ConsumerPlatform.CHROMEOS?(c=zg(this.xlr.config,d),"image"!==this.mediaType&&"video"!==this.mediaType&&"audio"!==this.mediaType||(c=Xg(d),-1===this.region.layout.layoutId&&(c=this.uri))):this.xlr.config.platform===e.ConsumerPlatform.ELECTRON&&(c=Vg(this.xlr.config,d)),this.url=c,this.loop="1"==this.options.loop||"1"==this.region.options.loop&&1==this.region.totalMediaObjects,this.html=$g(this)}},{key:"run",value:function(){var t=this,i=1,n="E";Boolean(this.options.transinduration)&&(i=Number(this.options.transinduration)),Boolean(this.options.transindirection)&&(n=this.options.transindirection);var s={duration:i},a=Ig("defaultIn",{duration:s.duration});if(Boolean(this.options.transin)){var o=this.options.transin;"fly"===o&&(o="".concat(o,"In"),s.keyframes=Lg({trans:"in",direction:n,height:this.divHeight,width:this.divWidth})),a=Ig(o,s)}var l=function(){var e=document.getElementById("".concat(t.region.containerName));return t.region.complete&&!t.region.layout.allEnded?(e&&e.insertBefore(t.html,e.lastElementChild),t.html):null};!function(){var i=Dg({mediaType:t.mediaType,containerName:t.containerName}),n=document.querySelector("#"+t.region.containerName),s=null!==n&&n.querySelector("."+i);if(s||(s=l()),console.debug("??? XLR.debug >> Media run - show current media:",{inDOM:document.body.contains(s),mediaId:i,$media:s,mediaObject:t}),s){if("video"===t.mediaType){var o,u,d,c;if(console.debug("??? XLR.debug >> Media.run() > showCurrentMedia() - Video media::START",{mediaPlayer:t.player,isDisposed:null===(o=t.player)||void 0===o?void 0:o.isDisposed(),el:null===(u=t.player)||void 0===u?void 0:u.el_}),void 0!==t.player){var h=Pc(i);h?t.player=h:t.player.isDisposed_&&(t.player=void 0,t.player=Pc(i,r({},_g({errorDisplay:t.xlr.config.platform!==e.ConsumerPlatform.CHROMEOS,loop:t.loop}))))}console.debug("??? XLR.debug >> Media.run() > showCurrentMedia() - Video media::END",{mediaPlayer:t.player,isDisposed:null===(d=t.player)||void 0===d?void 0:d.isDisposed(),el:null===(c=t.player)||void 0===c?void 0:c.el_}),void 0!==t.player&&null!==t.player.el_&&(t.player.el().style.setProperty("visibility","visible"),t.player.el().style.setProperty("z-index","10"),t.player.el().style.setProperty("opacity","1"))}else console.debug("??? XLR.debug >> Media::run() > showCurrentMedia",{mediaType:t.mediaType,render:t.render,$media:s,state:t.state}),s.style.setProperty("visibility","visible"),s.style.setProperty("z-index","10"),s.style.setProperty("opacity","1");Boolean(t.options.transin)&&s.animate(a.keyframes,a.timing),(!t.region.layout.isOverlay||t.region.layout.isOverlay&&t.region.totalMediaObjects>1)&&t.emitter.emit("start",t)}}()}},{key:"stop",value:(t=l(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=document.getElementById(Dg({mediaType:this.mediaType,containerName:this.containerName})))&&(t.style.display="none",t.remove()),"image"===this.mediaType&&this.url&&Og.release(this.url);case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"emitCommand",value:function(t){if("shellcommand"===t.mediaType){var i=t.options;if("storedCommand"===i.commandtype&&i.commandcode)return console.debug("Media::Emitter > Shell Command - Calling commandCodeReceived event"),void this.xlr.emitter.emit("commandCodeReceived",i.commandcode);var n="";return"1"===i.useglobalcommand?n=i.globalcommand||"":(this.xlr.config.platform===e.ConsumerPlatform.CHROMEOS?n=i.chromeoscommand||"":this.xlr.config.platform===e.ConsumerPlatform.ANDROID?n=i.androidcommand||"":this.xlr.config.platform===e.ConsumerPlatform.LINUX?n=i.linuxcommand||"":this.xlr.config.platform===e.ConsumerPlatform.TIZEN?n=i.tizencommand||"":this.xlr.config.platform===e.ConsumerPlatform.WEBOS?n=i.weboscommand||"":this.xlr.config.platform===e.ConsumerPlatform.WINDOWS&&(n=i.windowscommand||""),!n&&i.globalcommand&&(n=i.globalcommand)),n?(console.debug("Media::Emitter > Shell Command - Calling commandStringReceived event"),void this.xlr.emitter.emit("commandStringReceived",n)):void 0}}}]);var t}(),df=function(){return c((function e(t,i,n,r,s){u(this,e),h(this,"layout",void 0),h(this,"xml",void 0),h(this,"regionId",void 0),h(this,"options",void 0),h(this,"xlr",void 0),h(this,"complete",!1),h(this,"containerName",""),h(this,"currMedia",void 0),h(this,"currEl",null),h(this,"currentMedia",-1),h(this,"currentMediaIndex",-1),h(this,"ended",!1),h(this,"ending",!1),h(this,"html",document.createElement("div")),h(this,"id",""),h(this,"index",-1),h(this,"mediaObjects",[]),h(this,"mediaObjectsActions",[]),h(this,"nxtMedia",void 0),h(this,"nxtEl",null),h(this,"offsetX",0),h(this,"offsetY",0),h(this,"oldMedia",void 0),h(this,"oneMedia",!1),h(this,"ready",!1),h(this,"sHeight",0),h(this,"sWidth",0),h(this,"totalMediaObjects",0),h(this,"uniqueId",((e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[e]];return t})()),h(this,"zIndex",0),h(this,"emitter",w()),this.layout=t,this.xml=i,this.regionId=n,this.options=r,this.xlr=s,this.ready=!1,this.id=n,this.containerName="R-".concat(this.id,"-").concat(this.uniqueId),this.html=document.createElement("div"),this.prepareRegion()}),[{key:"prepareRegion",value:function(){var e,t,i,n,r,a,o,u=this;this.complete=!1,this.ending=!1,this.ended=!1,this.currMedia=void 0,this.nxtMedia=void 0,this.oldMedia=void 0,this.currentMediaIndex=-1,this.id=this.regionId,this.uniqueId="".concat(Pg(this.options)),this.containerName="R-".concat(this.id,"-").concat(this.uniqueId),this.mediaObjects=[],this.sWidth=this.xml?Number(null===(e=this.xml)||void 0===e?void 0:e.getAttribute("width"))*this.layout.scaleFactor:0,this.sHeight=this.xml?Number(null===(t=this.xml)||void 0===t?void 0:t.getAttribute("height"))*this.layout.scaleFactor:0,this.offsetX=this.xml?Number(null===(i=this.xml)||void 0===i?void 0:i.getAttribute("left"))*this.layout.scaleFactor:0,this.offsetY=this.xml?Number(null===(n=this.xml)||void 0===n?void 0:n.getAttribute("top"))*this.layout.scaleFactor:0,this.zIndex=this.xml?Number(null===(r=this.xml)||void 0===r?void 0:r.getAttribute("zindex")):0;var d=null===(a=this.xml)||void 0===a?void 0:a.getElementsByTagName("options");if(d)for(var c=0,h=Array.from(d);c<h.length;c++)for(var p=h[c].children,m=0,g=Array.from(p);m<g.length;m++){var f=g[m];this.options[f.nodeName.toLowerCase()]=f.textContent}var y=document.querySelector("#".concat(this.layout.containerName,'[data-sequence="').concat(this.layout.index,'"]')),v=null;null!==y&&(v=y.querySelector("#"+this.containerName)),null===v&&((v=document.createElement("div")).id=this.containerName),v.style.cssText="\n width: ".concat(this.sWidth,"px;\n height: ").concat(this.sHeight,"px;\n position: absolute;\n left: ").concat(this.offsetX,"px;\n top: ").concat(this.offsetY,"px;\n z-index: ").concat(Math.round(this.zIndex),";\n "),v.className="region--item",String(this.layout.bgImage).length>0&&this.zIndex<=0&&v.style.setProperty("visibility","hidden"),this.html=v;var b=Array.from(this.xml.getElementsByTagName("media"));this.totalMediaObjects=b.length,y&&y.appendChild(this.html),Array.from(b).forEach(function(){var e=l(s().mark((function e(t,i){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=new uf(u,(null==t?void 0:t.getAttribute("id"))||"",t,u.options,u.xlr)).index=i,u.mediaObjects.push(n);case 3:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()),console.debug("??? XLR.debug >> Region - done looping through media",{mediaObjects:this.mediaObjects}),null===(o=this.layout.actionController)||void 0===o||o.actions.forEach((function(e){var t,i=Gg(e.xml);"region"===i.target.value&&"navWidget"===i.actionType.value&&i.targetId.value==u.id&&Array.from((null===(t=u.layout.drawer)||void 0===t?void 0:t.getElementsByTagName("media"))||[]).forEach((function(e){var t;e.id===(null===(t=i.widgetId)||void 0===t?void 0:t.value)&&u.mediaObjectsActions.push(new uf(u,(null==e?void 0:e.getAttribute("id"))||"",e,u.options,u.xlr))}))})),console.debug("??? XLR.debug >> Region::prepareRegion",{mediaItems:this.mediaObjects,totalMediaItems:this.totalMediaObjects}),this.mediaObjects.length>0&&this.prepareFirstMedia()}},{key:"prepareMedia",value:function(e){"video"===e.mediaType?ef(e,this):"image"===e.mediaType&&null!==e.url?tf(e,this):"audio"===e.mediaType&&null!==e.url?nf(e,this):("html"===e.render||"webpage"===e.mediaType)&&e.iframe&&e.checkIframeStatus&&rf(e,this)}},{key:"prepareFirstMedia",value:function(){this.currentMediaIndex=0,this.oldMedia=void 0,this.currMedia=this.mediaObjects[this.currentMediaIndex];var e=this.currMedia;e&&this.prepareMedia(e)}},{key:"prepareNextMedia",value:function(){var e=(this.currentMediaIndex+1)%this.totalMediaObjects,t=this.mediaObjects[e];console.debug("<><> XLR.debug >> [Media] - [Region::prepareNextMedia()] - Preparing next media",{currentMediaIndex:this.currentMediaIndex,nextMediaIndex:e,nextMediaId:t.mediaId}),this.prepareMedia(t)}},{key:"prepareMediaObjects",value:function(){var e,t;(this.currentMediaIndex=(this.currentMediaIndex+1)%this.mediaObjects.length,this.mediaObjects.length>0)&&(this.currMedia=this.mediaObjects[this.currentMediaIndex],e=(this.currentMediaIndex+1)%this.totalMediaObjects,Boolean(this.mediaObjects[e])&&(this.nxtMedia=this.currentMediaIndex===e?r({},this.mediaObjects[e]):this.mediaObjects[e]),console.debug("<> XLR.debug prepareMediaObjects::oldMedia",{regionId:this.id,oldMedia:null===(t=this.oldMedia)||void 0===t?void 0:t.containerName}))}},{key:"finished",value:function(){console.debug("<> XLR.debug Region::finished called . . . ",{regionId:this.id}),this.complete=!0,this.layout.regions[this.index]=this,this.layout.regionExpired()}},{key:"run",value:function(){console.debug("??? XLR.debug >> Region Called Region::run > ",this.id),this.reset(),this.currMedia&&this.transitionNodes(this.oldMedia,this.currMedia)}},{key:"transitionNodes",value:function(e,t){var i=this,n=1,r="E";if(t){e&&Boolean(e.options.transoutduration)&&(n=Number(e.options.transoutduration)),e&&Boolean(e.options.transoutdirection)&&(r=e.options.transoutdirection);var s={duration:n},a=Ig("defaultOut",{duration:s.duration}),o="";e&&Boolean(e.options.transout)&&("fly"===(o=e.options.transout)&&(o="".concat(o,"Out"),s.keyframes=Lg({trans:"out",direction:r,height:e.divHeight,width:e.divWidth})),a=Ig(o,s)),console.debug("??? XLR.debug >> Region > transitionNodes - transOut options",{transOutName:o,transOut:a,transOutDuration:n,transOutDirection:r,totalMediaObjects:this.totalMediaObjects});e?(!function(){if(e){var t=document.querySelector("#".concat(i.layout.containerName,'[data-sequence="').concat(i.layout.index,'"]')).querySelector("#"+i.containerName),r=t?t.querySelector("."+Dg(e)):null;if(r){var s,l=function(){console.debug("??? XLR.debug >> Region transitionNodes - removeOldMedia fn",{$oldMedia:r}),r.style.setProperty("visibility","hidden"),r.style.setProperty("z-index","-999"),r.style.setProperty("opacity","0");var t,i=null;"video"===e.mediaType&&null!==r&&null!=r&&null!==(t=r.parentElement)&&void 0!==t&&t.classList.contains("video-js")&&null!==(i=r.parentElement)&&(i.style.setProperty("visibility","hidden"),i.style.setProperty("z-index","-999"),i.style.setProperty("opacity","0"),e.player&&e.videoHandler&&e.videoHandler.stop(!0)),setTimeout((function(){console.debug("??? XLR.debug >> Region transitionNodes - removeOldMedia setTimeout"),i&&i.remove(),r.remove()}),1e3)};Boolean(e.options.transout)&&(s=r.animate(a.keyframes,a.timing)),Boolean(e.options.transout)&&i.totalMediaObjects>1?"flyOut"===o?s&&s.finished.then((function(){var e;null===(e=s)||void 0===e||null===(e=e.effect)||void 0===e||e.updateTiming({fill:"none"}),l()})):(console.debug("??? XLR.debug >> Region transitionNode - hideOldMedia setTimeout",{transOutDuration:n}),setTimeout((function(){console.debug("??? XLR.debug >> Region transitionNode - hideOldMedia execute setTimeout",{transOutDuration:n,oldMedia:e,$oldMedia:r}),l()}),n/2)):(console.debug("??? XLR.debug >> Region transitionNode - hideOldMediano transout and only 1 media"),l())}}}(),t.run()):t.run()}}},{key:"playNextMedia",value:function(){var e,t,i,n,r,s,a,o,l,u,d;(console.debug("??? XLR.debug Region playing next media",{regionId:this.id,currentMediaIndex:this.currentMediaIndex,mediaItemsLn:this.mediaObjects.length,oldMedia:null===(e=this.oldMedia)||void 0===e?void 0:e.containerName,currMedia:null===(t=this.currMedia)||void 0===t?void 0:t.containerName,nxtMedia:null===(i=this.nxtMedia)||void 0===i?void 0:i.containerName}),this.ended)?console.debug("??? XLR.debug >> Region - playNextMedia - region ended",{ended:this.ended}):(this.currentMediaIndex===this.mediaObjects.length-1&&this.mediaObjects.length>1&&this.mediaObjects.forEach((function(e){"shellcommand"===e.mediaType&&(e.hasCommandExecuted=!1)})),this.layout.isOverlay||this.currentMediaIndex!==this.mediaObjects.length-1||(this.finished(),!this.layout.allEnded)?this.complete&&"html"===(null===(n=this.currMedia)||void 0===n?void 0:n.render)||(!this.complete||1!==this.mediaObjects.length||"html"===(null===(r=this.currMedia)||void 0===r?void 0:r.render)||"image"!==(null===(s=this.currMedia)||void 0===s?void 0:s.mediaType)&&"video"!==(null===(a=this.currMedia)||void 0===a?void 0:a.mediaType)||null!==(o=this.currMedia)&&void 0!==o&&o.loop)&&(this.currMedia?this.oldMedia=this.currMedia:this.oldMedia=void 0,this.currentMediaIndex=(this.currentMediaIndex+1)%this.totalMediaObjects,this.currMedia=this.mediaObjects[this.currentMediaIndex],this.nxtMedia=this.mediaObjects[(this.currentMediaIndex+1)%this.totalMediaObjects],console.debug("??? XLR.debug >> End Region::playNextMedia > execute transitionNodes",{regionId:this.id,currentMediaIndex:this.currentMediaIndex,mediaItemsLn:this.mediaObjects.length,oldMedia:null===(l=this.oldMedia)||void 0===l?void 0:l.containerName,currMedia:null===(u=this.currMedia)||void 0===u?void 0:u.containerName,nxtMedia:null===(d=this.nxtMedia)||void 0===d?void 0:d.containerName}),this.transitionNodes(this.oldMedia,this.currMedia)):console.debug("??? XLR.debug >> Region - playNextMedia - layout all ended"))}},{key:"playPreviousMedia",value:function(){this.currentMediaIndex=this.currentMediaIndex-1,this.currentMediaIndex<0||this.ended?this.currentMediaIndex=0:(this.prepareMediaObjects(),console.debug("region::playPreviousMedia",this),this.transitionNodes(this.oldMedia,this.currMedia))}},{key:"end",value:function(){this.ending=!0,this.layout.regions[this.index]=this,console.debug("Calling Region::end ",this),this.exitTransition()}},{key:"exitTransition",value:function(){document.getElementById("".concat(this.containerName)),console.debug("Called Region::exitTransition ",this.id),this.exitTransitionComplete()}},{key:"exitTransitionComplete",value:function(){console.debug("Called Region::exitTransitionComplete ",this.id),this.ended=!0,this.layout.regions[this.index]=this,this.layout.regionEnded()}},{key:"reset",value:function(){this.ended=!1,this.complete=!1,this.ending=!1,console.debug("Resetting region states",this)}},{key:"on",value:function(e,t){return this.emitter.on(e,t)}}])}(),cf=c((function e(t,i){u(this,e),h(this,"id",void 0),h(this,"xml",void 0),this.id=t,this.xml=i})),hf=function(e){function i(){var e;return u(this,i),(e=t(this,i)).classList.add("action-controller","noselect"),e}return p(i,e),c(i)}(f(HTMLDivElement));customElements.define("action-controller",hf,{extends:"div"});var pf=function(){return c((function e(t,i,n){u(this,e),h(this,"parent",void 0),h(this,"actions",void 0),h(this,"options",void 0),h(this,"$container",void 0),h(this,"$actionController",void 0),h(this,"$actionListContainer",void 0),h(this,"$actionControllerTitle",void 0),h(this,"$actionsContainer",void 0),h(this,"translations",{}),this.parent=t,this.actions=i,this.options=n,this.$actionListContainer=null,this.$container=document.querySelector("#".concat(this.parent.containerName,'[data-sequence="').concat(this.parent.index,'"]')),this.$actionControllerTitle=null,this.$actionsContainer=null,this.$container&&this.$container.getElementsByClassName("action-controller")[0]?this.$actionController=this.$container.getElementsByClassName("action-controller")[0]:this.$actionController=document.createElement("div",{is:"action-controller"}),this.init()}),[{key:"init",value:function(){var t=this,i=this,n={};i.translations=Sg,"previewTranslations"in window&&(n=window.previewTranslations,i.translations=n);var r,s=document.querySelector("#".concat(this.parent.containerName,'[data-sequence="').concat(this.parent.index,'"]'));(this.$actionController.innerHTML="",this.$actionController&&this.$actionController.getElementsByClassName("action-controller-title").length>0?this.$actionControllerTitle=this.$actionController.getElementsByClassName("action-controller-title")[0]:(this.$actionControllerTitle=document.createElement("div"),this.$actionControllerTitle.classList.add("action-controller-title"),this.$actionControllerTitle.innerHTML='\n <button class="toggle"></button>\n <span class="title">'.concat(i.translations.actionControllerTitle,"</span>\n ")),this.$actionController&&this.$actionController.getElementsByClassName("actions-container").length>0)&&(null===(r=this.$actionsContainer)||void 0===r||r.remove());if(this.$actionsContainer=document.createElement("div"),this.$actionsContainer.classList.add("actions-container"),s){s.insertBefore(this.$actionController,s.firstElementChild),this.$actionController&&0===this.$actionController.getElementsByClassName("action-controller-title").length&&this.$actionController.appendChild(this.$actionControllerTitle),this.$actionController.appendChild(this.$actionsContainer),Array.from(this.actions).forEach((function(e){var n,r,s=document.createElement("div"),a=Gg(e.xml);Array.from(Object.keys(a)).forEach((function(e){s.setAttribute("data-".concat(e),a[e].value),s.setAttribute(e,a[e].value)}));var o="";o+='<span class="action-row-title">'+i.translations[s.getAttribute("actiontype")||""],"navWidget"==s.getAttribute("actiontype")?o+=' <span title="'+i.translations.widgetId+'">['+s.getAttribute("widgetid")+"]</span>":"navLayout"==s.getAttribute("actiontype")&&(o+=' <span title="'+i.translations.layoutCode+'">['+s.getAttribute("layoutcode")+"]</span>"),o+="</span>",o+='<span class="action-row-target" title="'+i.translations.target+'">'+s.getAttribute("target"),""!=s.getAttribute("targetid")&&(o+="("+s.getAttribute("targetid")+s.getAttribute("layoutcode")+")"),o+="</span>",s.innerHTML=o,s.classList.add("action"),s.setAttribute("originalid",e.id),s.setAttribute("id","A-"+e.id+"-"+Pg(i.options)),null===(n=t.$actionsContainer)||void 0===n||n.insertBefore(s,null===(r=t.$actionsContainer)||void 0===r?void 0:r.lastElementChild)}));var a=this.$actionController.querySelector(".toggle");if(a&&(a.onclick=function(){i.$actionController.classList.toggle("d-none")}),this.parent.xlr.config.platform!==e.ConsumerPlatform.CMS)return void(this.$actionController.style.display="none");var o=this.$actionController.querySelectorAll('.action[triggertype="webhook"]');this.$actionController.style.setProperty("display",0===o.length?"none":"flex"),o.length>0&&o.forEach((function(e){e.onclick=function(t){t.stopPropagation(),i.runAction(e.dataset,i.options)},e.classList.add("clickable")}))}}},{key:"openLayoutInNewTab",value:function(e,t){var i=t.layoutPreviewUrl.replace("[layoutCode]",e)+"?findByCode=1";window.parent.postMessage({type:"xlr:navLayout",layoutCode:e,url:i},"*"),this.parent.xlr.emitter.emit("navLayout",e,i)}},{key:"openLayoutInPlayer",value:function(e,t){}},{key:"prevOrNextLayout",value:function(e,t){var i;(null===(i=this.parent.xlr.currentLayout)||void 0===i?void 0:i.layoutId)===parseInt(e)&&("next"===t?this.parent.xlr.gotoNextLayout():"previous"===t&&this.parent.xlr.gotoPrevLayout())}},{key:"nextMediaInRegion",value:function(e,t){this.parent.regions.forEach((function(i){i.id===e&&("next"===t?i.playNextMedia():i.playPreviousMedia())}))}},{key:"loadMediaInRegion",value:function(e,t){var i,n,r,s,a;this.parent.regions.forEach((function(t){t.id===e&&(s=t)})),s&&s.mediaObjectsActions.forEach((function(e){e.id===t&&(a=e)})),a&&(a.singlePlay=!0),0===(null===(i=s)||void 0===i?void 0:i.mediaObjects.length)&&(s.complete=!1),null===(n=s)||void 0===n||n.mediaObjects.splice(s.currentMediaIndex+1,0,a),null===(r=s)||void 0===r||r.playNextMedia()}},{key:"runAction",value:function(t,i){"navLayout"==t.actiontype?this.parent.xlr.config.platform===e.ConsumerPlatform.CMS?this.openLayoutInNewTab(t.layoutcode,i):this.parent.xlr.config.platform===e.ConsumerPlatform.CHROMEOS&&this.openLayoutInPlayer(t.layoutcode,i):"previous"!=t.actiontype&&"next"!=t.actiontype||"region"!=t.target?"navWidget"==t.actiontype&&"region"==t.target?this.loadMediaInRegion(t.targetid,t.widgetid):"screen"===t.target?this.prevOrNextLayout(t.targetid,t.actiontype):console.log(t.actiontype+" > "+t.target+"["+t.targetid+"]"):this.nextMediaInRegion(t.targetid,t.actiontype)}},{key:"initTouchActions",value:function(){var e=this;this.$actionController.querySelectorAll('.action[triggerType="touch"]').forEach((function(t){var i,n=t.dataset;if("layout"===n.source)i=document.querySelector("#".concat(e.parent.containerName,'[data-sequence="').concat(e.parent.index,'"]'));else for(var r=0,s=Array.from(e.parent.regions);r<s.length;r++){var a=s[r];if("region"===n.source){if(a.id===n.sourceid){i=document.getElementById(a.containerName);break}}else if("widget"===n.source)for(var o=0,l=Array.from(a.mediaObjects);o<l.length;o++){var u=l[o];if(u.id===n.sourceid){i=document.getElementById(u.containerName);break}}if(null!=i)break}null!=i&&(i.onclick=function(t){t.stopPropagation(),e.runAction(n,e.options)},i.classList.add("clickable"))}))}},{key:"initKeyboardActions",value:function(){var e=this,t=new Map;this.$actionController.querySelectorAll('.action[triggerType="keyPress"]').forEach((function(e){var i=e.dataset,n=i.triggercode;n&&(t.get(n)||t.set(n,[]),t.get(n).push(i))})),document.addEventListener("keydown",(function(i){var n=t.get(i.code);n&&n.forEach((function(t){e.runAction(t,e.options)}))}))}}])}(),mf=function(e){e.preventDefault(),history.go(0)};function gf(e){var t=e,i=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),s=document.createElement("a");i.className="player-preview",i.id="player_container",n.className="screen-preview",n.id="screen_container",r.className="preview-ended",r.id="play_ended",r.style.display="none",s.id="play_back_preview",s.className="play-back-preview",s.style.cssText="text-decoration: none; color: #ffffff;",s.innerHTML="Play again?",s.removeEventListener("click",mf),s.addEventListener("click",mf),t||(t=document.body),t&&null===t.querySelector("#player_container")&&(t.insertBefore(i,t.firstChild),null===i.querySelector("#screen_container")&&i.appendChild(n),null===i.querySelector("#play_ended")&&(i.appendChild(r),null===r.querySelector("a")&&r.appendChild(s)))}function ff(e){return yf.apply(this,arguments)}function yf(){return(yf=l(s().mark((function t(i){var n,r,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.xlfUrl,r={},i.platform===e.ConsumerPlatform.CMS?(n=i.xlfUrl,r.mode="no-cors"):i.platform===e.ConsumerPlatform.CHROMEOS?(n=i.xlfUrl,r.mode="cors",r.headers={"Content-Type":"text/xml"}):i.platform===e.ConsumerPlatform.ELECTRON?(n=i.appHost+i.xlfUrl,r.mode="no-cors",r.headers={"Content-Type":"text/xml"}):null!==i.appHost&&(n=i.appHost+i.xlfUrl),t.next=5,fetch(n,{method:"GET",headers:{"X-PREVIEW-JWT":i.previewJwt}});case 5:return a=t.sent,t.next=8,a.text();case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vf=function(){return c((function t(i,n,r,a){var o=this;u(this,t),h(this,"id",null),h(this,"layoutId",-1),h(this,"sw",0),h(this,"sh",0),h(this,"xw",0),h(this,"xh",0),h(this,"duration",0),h(this,"zIndex",0),h(this,"scaleFactor",1),h(this,"sWidth",0),h(this,"sHeight",0),h(this,"offsetX",0),h(this,"offsetY",0),h(this,"bgColor",""),h(this,"bgImage",""),h(this,"bgId",""),h(this,"containerName",""),h(this,"regionMaxZIndex",0),h(this,"ready",!1),h(this,"regionObjects",[]),h(this,"drawer",null),h(this,"allExpired",!1),h(this,"regions",[]),h(this,"actions",[]),h(this,"done",!1),h(this,"allEnded",!1),h(this,"emitter",w()),h(this,"index",-1),h(this,"actionController",void 0),h(this,"enableStat",!1),h(this,"inLoop",!0),h(this,"xlfString",""),h(this,"ad",null),h(this,"isOverlay",!1),h(this,"shareOfVoice",0),h(this,"state",e.ELayoutState.IDLE),h(this,"scheduleId",void 0),h(this,"layoutNode",void 0),h(this,"path",""),h(this,"errorCode",null),h(this,"html",void 0),h(this,"options",{}),h(this,"xlr",{}),h(this,"layoutObj",{}),h(this,"statsBC",new BroadcastChannel("statsBC")),this.layoutNode=a,this.options=n,this.xlr=r,this.layoutObj=i,this.html=null,this.prepareLayout(),this.on("start",(function(t){t.done=!1,t.state=e.ELayoutState.RUNNING,console.debug(">>>> XLR.debug Layout start emitted > Layout ID > ",t.id),t.enableStat&&o.statsBC.postMessage({action:"START_STAT",layoutId:t.id,scheduleId:t.scheduleId,type:"layout"}),console.debug(">>>> XLR.debug Layout::Emitter > Start - Calling layoutStart event"),t.xlr.emitter.emit("layoutStart",t)})),this.on("end",function(){var t=l(s().mark((function t(i){var n,r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.state!==e.ELayoutState.CANCELLED){t.next=2;break}return t.abrupt("return");case 2:return console.debug(">>>> XLR.debug Ending layout with ID of > ",i.layoutId),n=document.querySelector("#".concat(i.containerName,'[data-sequence="').concat(i.index,'"]')),i.state===e.ELayoutState.RUNNING&&(i.state=e.ELayoutState.PLAYED),i.done=!0,console.debug(">>> XLR.debug Layout end emitted > Layout ID > ",{$layout:n,layoutId:i.id,isOverlay:i.isOverlay,isInterrupt:i.isInterrupt()}),null!==n&&(n.style.setProperty("visibility","hidden"),n.style.setProperty("opacity","0"),n.style.setProperty("z-index","-99"),console.debug('??? XLR.debug >> Layout.on("end") - Hiding currentLayout...'),console.debug('??? XLR.debug >> Layout.on("end") > setTimeout - Removing currentLayout',{layoutId:i.layoutId}),null===(r=n.parentElement)||void 0===r||r.removeChild(n)),i.enableStat&&o.statsBC.postMessage({action:"END_STAT",layoutId:i.id,scheduleId:i.scheduleId,type:"layout"}),console.debug(">>>>> XLR.debug Awaited XLR::emitSync > End - Calling layoutEnd event"),t.next=12,i.xlr.emitSync("layoutEnd",i);case 12:o.xlr.config.platform!==e.ConsumerPlatform.CMS&&i.inLoop&&o.xlr.prepareLayouts().then(function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log('>>>> XLR.debug XLR::Layout.on("end")',{_xlr:t,layout:i}),o.xlr.playLayouts(t),!i.isInterrupt()||!t.currentLayout||t.currentLayout.isInterrupt()){e.next=5;break}return e.next=5,t.overlayLayoutManager.resumeOverlays();case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.on("cancelled",(function(t){console.debug(">>>>> XLR.debug / Layout cancelled > Layout ID > ",t.id),t.state=e.ELayoutState.CANCELLED}))}),[{key:"prepareLayout",value:function(){this.parseXlf()}},{key:"parseXlf",value:function(){var t,i,n,r,s,a,o,l,u,d=this;0===this.options.idCounter&&(this.options.idCounter=Pg(this.options)),this.id=this.layoutObj.id,this.layoutId=this.layoutObj.layoutId,this.scheduleId=this.layoutObj.scheduleId,this.index=this.layoutObj.index,this.xlfString=this.layoutObj.xlfString,this.duration=this.layoutObj.duration,this.ad=this.layoutObj.ad,this.isOverlay=this.layoutObj.isOverlay,this.shareOfVoice=this.layoutObj.shareOfVoice,this.done=!1,this.allEnded=!1,this.allExpired=!1,this.containerName="L"+this.id+"-"+this.options.idCounter,this.regions=[],this.actions=[],console.log("XLR::Layout/parseXlf",this);var c=document.querySelector("#".concat(this.containerName,'[data-sequence="').concat(this.index,'"]'));null===c&&((c=document.createElement("div")).id=this.containerName);var h=document.getElementById("screen_container");h&&h.append(c);var p="\n position: absolute;\n overflow: hidden;\n ";if(c&&(c.dataset.sequence="".concat(this.index),this.xlr.config.platform===e.ConsumerPlatform.CMS&&(p+="outline: red solid thin;"),this.isOverlay&&c.classList.add("is-overlay")),this.sw=(null==h?void 0:h.offsetWidth)||0,this.sh=(null==h?void 0:h.offsetHeight)||0,this.xw=Number(null===(t=this.layoutNode)||void 0===t||null===(t=t.firstElementChild)||void 0===t?void 0:t.getAttribute("width")),this.xh=Number(null===(i=this.layoutNode)||void 0===i||null===(i=i.firstElementChild)||void 0===i?void 0:i.getAttribute("height")),this.zIndex=Number(null===(n=this.layoutNode)||void 0===n||null===(n=n.firstElementChild)||void 0===n?void 0:n.getAttribute("zindex"))||0,this.enableStat=Boolean((null===(r=this.layoutNode)||void 0===r||null===(r=r.firstElementChild)||void 0===r?void 0:r.getAttribute("enableStat"))||!1),this.scaleFactor=Math.min(this.sw/this.xw,this.sh/this.xh),this.sWidth=this.xw*this.scaleFactor,this.sHeight=this.xh*this.scaleFactor,this.offsetX=Math.abs(this.sw-this.sWidth)/2,this.offsetY=Math.abs(this.sh-this.sHeight)/2,c&&(p+="\n visibility: hidden;\n opacity: 0;\n z-index: -99;\n width: ".concat(this.sWidth,"px;\n height: ").concat(this.sHeight,"px;\n left: ").concat(this.offsetX,"px;\n top: ").concat(this.offsetY,"px;\n "),c.style.cssText=p),c&&null!==this.zIndex&&this.isOverlay&&c.style.setProperty("z-index","999"),this.bgColor=(null===(s=this.layoutNode)||void 0===s||null===(s=s.firstElementChild)||void 0===s?void 0:s.getAttribute("bgcolor"))||"",this.bgImage=(null===(a=this.layoutNode)||void 0===a||null===(a=a.firstElementChild)||void 0===a?void 0:a.getAttribute("background"))||"",""!==this.bgImage&&void 0!==this.bgImage){this.bgId=this.bgImage.substring(0,this.bgImage.indexOf("."));var m=Wg(this.xlr.config.platform,this);console.debug(">>> XLR.debug Layout::parseXlf - Composed background image URL > ",{bgImageUrl:m}),c&&(this.isOverlay||(c.style.setProperty("background-image",'url("'.concat(m,'")')),c.style.setProperty("background-repeat","no-repeat"),c.style.setProperty("background-size","".concat(this.sWidth,"px ").concat(this.sHeight,"px")),c.style.setProperty("background-position","0px 0px")))}c&&this.bgColor&&c.style.setProperty("background-color",this.isOverlay?"transparent":"".concat(this.bgColor)),c&&void 0!==this.xlr.currentLayoutId&&this.xlr.currentLayoutId!==this.id&&(c.style.setProperty("visibility","hidden"),c.style.setProperty("opacity","0"),c.style.setProperty("z-index","-99")),this.isOverlay,this.html=c;var g=Array.from((null===(o=this.layoutNode)||void 0===o?void 0:o.getElementsByTagName("action"))||[]);Array.from(g).forEach((function(e){d.actions.push(new cf((null==e?void 0:e.getAttribute("id"))||"",e))})),this.actionController=new pf(this,this.actions,this.options);var f=Array.from((null===(l=this.layoutNode)||void 0===l?void 0:l.getElementsByTagName("drawer"))||[]);Array.from(f).forEach((function(e){d.drawer=e}));var y=Array.from((null==this||null===(u=this.layoutNode)||void 0===u?void 0:u.getElementsByTagName("region"))||[]);Array.from(y).forEach((function(e,t){var i=new df(d,e,(null==e?void 0:e.getAttribute("id"))||"",d.options,d.xlr);i.index=t,d.regions.push(i)})),this.actionController.initTouchActions(),this.actionController.initKeyboardActions()}},{key:"run",value:function(){var e=document.querySelector("#".concat(this.containerName,'[data-sequence="').concat(this.index,'"]')),t=document.getElementById("splash_".concat(this.id));t&&(t.style.display="none"),e&&(e.style.setProperty("visibility","visible"),e.style.setProperty("opacity","1"),e.style.setProperty("z-index",null!==this.zIndex?"".concat(this.zIndex):"1"),this.isOverlay||document.body.style.setProperty("background-color","".concat(this.bgColor)),this.emitter.emit("start",this),this.playRegions())}},{key:"playRegions",value:function(){console.debug("??? XLR.debug >> Layout playRegions() - Layout running > Layout ID > ",this.id),console.debug("??? XLR.debug >> Layout playRegions() - Layout Regions > ",this.regions);for(var e=0;e<this.regions.length;e++){this.regions[e].run()}}},{key:"regionExpired",value:function(){this.allExpired=!0;var e,t=T(this.regions);try{for(t.s();!(e=t.n()).done;){e.value.complete||(this.allExpired=!1)}}catch(e){t.e(e)}finally{t.f()}this.allExpired&&this.end()}},{key:"end",value:function(){console.debug("Executing Layout::end and Calling Region::end ",this);var e,t=T(this.regions);try{for(t.s();!(e=t.n()).done;){e.value.end()}}catch(e){t.e(e)}finally{t.f()}}},{key:"regionEnded",value:function(){this.allEnded=!0;for(var t=0;t<this.regions.length;t++)this.regions[t].ended||(this.allEnded=!1);if(this.allEnded){if(console.debug("starting to end layout . . ."),this.xlr.config.platform===e.ConsumerPlatform.CMS){var i=document.getElementById("play_ended"),n=document.getElementById("screen_container");if(n){for(;n.firstChild;)n.removeChild(n.firstChild);n.style.display="none"}i&&(i.style.display="block")}this.isOverlay||this.emitter.emit("end",this)}}},{key:"stopAllMedia",value:function(){var e=this;return console.debug("Stopping all media . . ."),new Promise(function(){var t=l(s().mark((function t(i){var n,r,a,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0;case 1:if(!(n<e.regions.length)){t.next=14;break}r=e.regions[n],a=0;case 4:if(!(a<r.mediaObjects.length)){t.next=11;break}return o=r.mediaObjects[a],t.next=8,o.stop();case 8:a++,t.next=4;break;case 11:n++,t.next=1;break;case 14:i();case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"resetLayout",value:function(){throw new Error("Method not implemented.")}},{key:"finishAllRegions",value:function(){return Promise.all(this.regions.map((function(e){return e.finished()})))}},{key:"removeLayout",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.LayoutPlaybackType.CURRENT;console.debug("??? XLR.debug >> Layout::removeLayout",{containerName:this.containerName,index:this.index,caller:t});var i,n=document.querySelector("#".concat(this.containerName,'[data-sequence="').concat(this.index,'"]'));(this.done=!0,console.debug({$layout:n}),null!==n)&&(null===(i=n.parentElement)||void 0===i||i.removeChild(n))}},{key:"getXlf",value:function(){return this.xlfString}},{key:"isInterrupt",value:function(){return this.shareOfVoice>0}},{key:"on",value:function(e,t){return this.emitter.on(e,t)}}])}(),bf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAJWCAYAAADLFK1VAAAACXBIWXMAACDOAAAgzgFjDuzcAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3XeYXGXZx/HffWb7bgrJNkJLQqRIERSlC6gUFRXBkNCxgCKghnThlbUgpNAVpVgBKfFFRBFsiCigAlKklwQpybaEtG3ZnXO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leN8lH1IWAcRgkZgCgYiaBGJojGgHHFTgtagAFYSZhF7/qnTpY+faVlNAnqJN0EHWa6ozAZjBtgmmBokwMB01LW5jAZwbqfmlNips4B4eOqJgDJ2+imXRZpthuigeC6XZTWIxilXmRo8iYKBCwiWmWkJVEAkfB0w8KI1IvlIpKnOkVpqdB5+h96o8d3lFnijrgprjbfGRSt0lH0nAZG5vsprWxYRW6Suq4UWqrLEsspWg8Io6yv/q6EhK0Fw0GLbjKYn5CZYBYht1laPrnEY67kyrhYbuyceiR28Pso7bYwiXjihjWsWuWF5p/H765HmNoiur3RJsGKNG/jq748XMrwmjhwCfO6QD9v7LQsDxPTAMKsFpthyJCdkmgYiw0VdXF/Om9dyv7YMWGXTLYpZg5wNR11C78oW3p8HSGgul4qyrJppgllJHJZHn0Y0yUwDXCXUNquFZNLKyYXBAVZvxtAKYIQEsmPgDacr0tltO1y/DMwYpkgUpJfTasLGzd3cdCN3gN3UWRcY3epIEPevfq+3njBxq/kqBoGBduvea8f393zICS63ivRBTqgFpgaWZEIUULdcK+frIfAAL2AjscXqrLfu+uuwx05FF0XUbvvtuOeu++689+7778AHL/wJIQAAOwAAAAAAAAAAAA==";var Tf=function(i){function n(i,r,a,o){var d;return u(this,n),h(d=t(this,n,[i,r,a,o]),"emitter",w()),d.state=e.ELayoutState.IDLE,d.on("start",(function(t){t.state!==e.ELayoutState.RUNNING&&(t.done=!1,t.state=e.ELayoutState.RUNNING,console.debug(">>>> XLR.debug Overlay layout start emitted > Layout ID > ",t.id),t.enableStat&&d.statsBC.postMessage({action:"START_STAT",layoutId:t.id,scheduleId:t.scheduleId,type:"layout"}),console.debug("Overlay::Emitter > Start - Calling overlayStart event"),t.xlr.emitter.emit("overlayStart",t))})),d.on("end",function(){var t=l(s().mark((function t(i){var n,r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.state!==e.ELayoutState.PLAYED){t.next=2;break}return t.abrupt("return");case 2:i.state=e.ELayoutState.PLAYED,console.log('XLR::OverlayLayout >> emitter.on("end")',{currentLayout:i.xlr.currentLayout,overlay:i}),console.debug("XLR::OverlayLayout >> Ending overlay layout with ID of > ",i.layoutId),n=document.querySelector("#".concat(i.containerName,'[data-sequence="').concat(i.index,'"]')),i.done=!0,console.debug({overlayHtml:n}),null!==n&&(null===(r=n.parentElement)||void 0===r||r.removeChild(n)),console.debug("Overlay::Emitter > End - Calling overlayEnd event"),i.xlr.emitter.emit("overlayEnd",i),i.enableStat&&d.statsBC.postMessage({action:"END_STAT",layoutId:i.id,scheduleId:i.scheduleId,type:"layout"});case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),d}return p(n,i),c(n,[{key:"on",value:function(e,t){return this.emitter.on(e,t)}}])}(vf);return e.Action=cf,e.ActionsWrapper=hf,e.AudioMedia=lf,e.Media=uf,e.MediaState=k,e.Region=df,e.VideoMedia=Ag,e.audioFileType=Fg,e.capitalizeStr=Mg,e.composeBgUrlByPlatform=Wg,e.composeMediaUrl=Xg,e.composeResourceUrl=zg,e.composeResourceUrlByPlatform=Vg,e.composeVideoSource=vg,e.createMediaElement=$g,e.default=function(t,i,n){console.debug("??? Xibo Layout Renderer loaded"),n&&null==n.idCounter&&(n.idCounter=0);var a={inputLayouts:t,options:n},o=r({},P),u=function(){var e=l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.overlayLayoutManager.prepareOverlayLayouts(o.overlays,o);case 2:o.overlayLayoutManager.playOverlays();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return o.isUpdatingLoop=!1,o.isUpdatingOverlays=!1,o.overlayLayoutManager=new L,o.emitter=w(),o.on=function(e,t){return o.emitter.on(e,t)},o.on("layoutChange",function(){var t=l(s().mark((function t(i){var n,r,a,l;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i===(null===(n=o.nextLayout)||void 0===n?void 0:n.layoutId)&&(l={layout:o.nextLayout,pos:e.ELayoutType.NEXT}),null===(r=l)||void 0===r||!r.layout||null===(a=l)||void 0===a||!a.pos){t.next=5;break}return t.next=4,o.prepareLayoutXlf(o.nextLayout);case 4:o.nextLayout=t.sent;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.on("updateLoop",function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.isUpdatingLoop=!0,e.next=3,o.updateLoop(t);case 3:o.isUpdatingLoop=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),o.on("updateOverlays",function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.isUpdatingOverlays=!0,e.next=3,o.updateOverlays(t);case 3:o.isUpdatingOverlays=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),o.emitSync=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new Promise(function(){var t=l(s().mark((function t(n){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(r=o.emitter).emit.apply(r,[e].concat(i)),n();case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},o.bootstrap=function(){var t=this;t.inputLayouts=Array.isArray(a.inputLayouts)?a.inputLayouts:[a.inputLayouts],t.overlays=i,t.config=a.options,gf(document.querySelector("#preview_canvas")),function(t,i){var n=document.createElement("div"),r=document.createElement("div"),a=document.createElement("div");document.createElement("div");var o={init:function(){var t=this;return l(s().mark((function o(){var l,u;return s().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:n.classList.add("preview-splash"),i&&i.platform!==e.ConsumerPlatform.CMS&&(u=bf,null!==(l=i.icons)&&void 0!==l&&l.splashScreen&&i.icons.splashScreen.length>0&&(u=i.icons.splashScreen),n.style.setProperty("background-image","url(".concat(u,")")),n.style.setProperty("background-size","200px"),n.style.setProperty("background-position","calc(100% - 50px) calc(100% - 30px)")),n.hide=function(){t.hide()},n.show=function(){t.show()},r.classList.add("preview-loader"),a.classList.add("preview-loaderCaption"),i&&i.platform===e.ConsumerPlatform.CMS&&(r.style.setProperty("background-image","url(".concat(_f,")")),a.innerHTML="<p>Loading Layout...</p>"),n.insertBefore(r,n.lastElementChild),n.insertBefore(a,null),t.hide();case 10:case"end":return s.stop()}}),o)})))()},show:function(){t&&(t.insertBefore(n,t.firstElementChild),n.style.setProperty("display","block"))},hide:function(){n.style.setProperty("display","none")}};return o.init(),o}(document.querySelector(".player-preview"),t.config).show()},o.init=function(){var e=this;return new Promise((function(t){var i=e;1===i.inputLayouts.length&&0===i.inputLayouts[0].layoutId?t(i):i.prepareLayouts().then((function(e){t(e)}))}))},o.playLayouts=function(e){var t=document.querySelector(".preview-splash");void 0!==e.currentLayout?(t&&"block"===t.style.display&&(null==t||t.hide()),e.currentLayout.done||(e.currentLayout.isInterrupt()&&o.overlayLayoutManager.stopOverlays(),console.log(">>>> XLR.debug XLR::playSchedules > Running currentLayout",e.currentLayout),e.currentLayout.run())):t&&(null==t||t.show())},o.playSchedules=function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.playLayouts(t),void 0===t.currentLayout||t.currentLayout.isInterrupt()){e.next=4;break}return e.next=4,u();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.renderOverlayLayouts=l(s().mark((function e(){var t,i=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.overlays.reduce((function(e,t){var i={};(i=r(r({},i),t)).index=t.index;var n=x;return[].concat(v(e),[r(r({},n),i)])}),[]),console.log("XLR::renderOverlayLayouts",{overlayLayouts:t}),e.next=4,Promise.all(t.map(function(){var e=l(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.prepareLayoutXlf(t);case 2:if(r=e.sent,console.log(">>>> XLR.debug XLR::renderOverlayLayouts >> prepareLayoutXlf",r),console.log(">>>> XLR.debug XLR::renderOverlayLayouts >> currentLayout.isInterrupt()",null===(n=i.currentLayout)||void 0===n?void 0:n.isInterrupt()),!r){e.next=14;break}if(!i.currentLayout||!i.currentLayout.isInterrupt()){e.next=13;break}if(!i.isLayoutInDOM(r.containerName,r.index)){e.next=11;break}return e.next=10,r.finishAllRegions();case 10:r.removeLayout();case 11:e.next=14;break;case 13:r.run();case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 4:case"end":return e.stop()}}),e,this)}))),o.updateScheduleLayouts=function(){var e=l(s().mark((function e(t){var i,n,r,a,o,l,u,d,c,h;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.debug("XLR::updateScheduleLayouts > Updating schedule layouts . . ."),i=[],n=T(t.entries());try{for(n.s();!(r=n.n()).done;)a=y(r.value,2),o=a[0],l=a[1],(u=l).index=o,u.id=l.layoutId,this.uniqueLayouts[l.layoutId]=u,i.push(l.layoutId)}catch(e){n.e(e)}finally{n.f()}for(d=0,c=Object.keys(this.uniqueLayouts);d<c.length;d++)h=c[d],i.includes(parseInt(h))||delete this.uniqueLayouts[h];case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),o.isLayoutInDOM=function(e,t){return null!==document.querySelector("#".concat(e,'[data-sequence="').concat(t,'"]'))},o.updateLoop=function(){var e=l(s().mark((function e(t){var i,n,r,a,o=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.debug(">>>> XLR.debug XLR::updateLoop > Updating schedule loop . . ."),this.inputLayouts=t,n=this.parseLayouts(!0),r=Kg(this.inputLayouts,null===(i=this.currentLayout)||void 0===i?void 0:i.layoutId),this.isSspEnabled&&-1===this.currentLayoutId&&(r=!0),!r&&this.currentLayout&&this.currentLayout.emitter.emit("cancelled",this.currentLayout),console.debug(">>>>> XLR.debug XLR::updateLoop > uniqueLayouts",this.uniqueLayouts),console.debug(">>>>> XLR.debug XLR::updateLoop > inputLayouts",this.inputLayouts),console.debug(">>>>> XLR.debug XLR::updateLoop > isCurrentLayoutValid",r),console.debug(">>>>> XLR.debug XLR::updateLoop > currentLayout",this.currentLayout),console.debug(">>>>> XLR.debug XLR::updateLoop > nextLayout",this.nextLayout),console.debug(">>>>> XLR.debug XLR::updateLoop > playback",n),a=function(){var e=l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.prepareLayoutXlf(n.currentLayout);case 2:o.currentLayout=e.sent,o.currentLayoutId=o.currentLayout.layoutId,o.currentLayoutIndex=n.currentLayoutIndex;case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),r){e.next=54;break}if(!n.hasDefaultOnly){e.next=33;break}if(!this.currentLayout||!n.currentLayout||this.currentLayout.layoutId===n.currentLayout.layoutId){e.next=20;break}return this.currentLayout.inLoop=!1,e.next=19,this.currentLayout.finishAllRegions();case 19:this.currentLayout.removeLayout();case 20:return e.next=22,this.prepareLayoutXlf(n.currentLayout);case 22:return this.currentLayout=e.sent,this.currentLayoutId=this.currentLayout.layoutId,e.t0=this,e.next=27,this.prepareLayoutXlf(n.nextLayout);case 27:return e.t1=e.sent,e.next=30,e.t0.prepareForSsp.call(e.t0,e.t1);case 30:this.nextLayout=e.sent,e.next=50;break;case 33:if(!this.currentLayout||!this.isLayoutInDOM(this.currentLayout.containerName,this.currentLayout.index)){e.next=38;break}return this.currentLayout.inLoop=!1,e.next=37,this.currentLayout.finishAllRegions();case 37:this.currentLayout.removeLayout();case 38:if(this.nextLayout&&this.isLayoutInDOM(this.nextLayout.containerName,this.nextLayout.index)&&this.nextLayout.removeLayout(),!n.currentLayout){e.next=42;break}return e.next=42,a();case 42:if(!n.nextLayout){e.next=50;break}return e.t2=this,e.next=46,this.prepareLayoutXlf(n.nextLayout);case 46:return e.t3=e.sent,e.next=49,e.t2.prepareForSsp.call(e.t2,e.t3);case 49:this.nextLayout=e.sent;case 50:return e.next=52,this.playSchedules(this);case 52:e.next=67;break;case 54:if(this.nextLayout&&this.isLayoutInDOM(this.nextLayout.containerName,this.nextLayout.index)&&this.nextLayout.removeLayout(),!n.currentLayout){e.next=58;break}return e.next=58,a();case 58:if(!n.nextLayout){e.next=66;break}return e.t4=this,e.next=62,this.prepareLayoutXlf(n.nextLayout);case 62:return e.t5=e.sent,e.next=65,e.t4.prepareForSsp.call(e.t4,e.t5);case 65:this.nextLayout=e.sent;case 66:console.debug(">>>> XLR.debug XLR::updateLoop > updated nextLayout",this.nextLayout);case 67:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),o.updateOverlays=function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.overlays=t,e.next=3,u();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.parseLayouts=function(t){var i,n,r,s,a=Qg(this.inputLayouts),o=this.inputLayouts.length>0,l=this.currentLayoutIndex,u=l+1,d=Kg(this.inputLayouts,null===(i=this.currentLayout)||void 0===i?void 0:i.layoutId);if(this.isSspEnabled=Zg(this.inputLayouts),this.isSspEnabled&&-1===(null===(n=this.currentLayout)||void 0===n?void 0:n.layoutId)&&(d=!0),r=this.currentLayout,this.currentLayout&&this.nextLayout){if(o)if(d)t?(r=this.currentLayout,1===this.inputLayouts.length?r.layoutId===this.inputLayouts[0].layoutId&&r.index!==this.inputLayouts[0].index&&((r=this.getLayout(this.inputLayouts[0]))&&(l=r.index),r=of(r,l),u=0,s=of(s=this.getLayout(this.inputLayouts[u]),u)):(l=this.nextLayout.index>this.inputLayouts.length-1?0:this.nextLayout.index,r=of(r=this.getLayout(this.inputLayouts[l]),l),u=l+1>this.inputLayouts.length-1?0:l+1,s=of(s=this.getLayout(this.inputLayouts[u]),u))):(u=((l=(r=this.nextLayout).index)+1)%this.inputLayouts.length,s=of(s=this.getLayout(this.inputLayouts[u]),u));else{var c;if(this.currentLayout.state===e.ELayoutState.PLAYED&&Kg(this.inputLayouts,null===(c=this.nextLayout)||void 0===c?void 0:c.layoutId)){var h=Jg(this.inputLayouts,this.nextLayout.layoutId);l=null!=h?h:0,r=of(r=this.getLayout(this.inputLayouts[null!=h?h:0]),l)}else r=of(r=this.getLayout(this.inputLayouts[0]),0);this.inputLayouts.length>1?(u=l+1>this.inputLayouts.length-1?0:l+1,s=of(s=this.getLayout(this.inputLayouts[u]),u)):s=r}}else o&&(r=of(r=this.getLayout(this.inputLayouts[l]),l),s=this.inputLayouts.length>1?of(s=this.getLayout(this.inputLayouts[u]),u):of(s=this.getLayout(this.inputLayouts[0]),0));return void 0===r&&void 0===s&&a&&(r=of(r=this.getLayout(this.inputLayouts[0]),0),s=of(s=this.getLayout(this.inputLayouts[0]),0)),void 0!==r&&void 0!==s&&(r.xlr=this,s.xlr=this),{currentLayout:r,nextLayout:s,currentLayoutIndex:l,nextLayoutIndex:u,isCurrentLayoutValid:d,hasDefaultOnly:a}},o.getLayout=function(t){var i=this.config.platform===e.ConsumerPlatform.CMS;if(i||0!==Object.keys(this.uniqueLayouts).length){var n={};if(t)if(-1===t.layoutId)(n=t).id=t.layoutId;else{var s=t;i?s.index=0:s=r({},this.uniqueLayouts[t.layoutId]),n=r(r({},n),s),console.debug("XLR::getLayout > activeLayout from uniqueLayouts",{activeLayout:s,inputLayout:t,uniqueLayouts:this.uniqueLayouts}),n.index=s.index}var a=x;return a=r(r({},a),n)}},o.getLayoutById=function(e,t){if(e&&0!==Object.keys(this.uniqueLayouts).length){var i=r(r({},x),this.uniqueLayouts[e]);return t&&(i.index=t),i}},o.prepareLayouts=l(s().mark((function e(){var t,i,n,r,a,u,d;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o,!this.isUpdatingLoop){e.next=3;break}return e.abrupt("return",Promise.resolve(n));case 3:if(r=n.parseLayouts(),1!==n.inputLayouts.length||0!==n.inputLayouts[0].layoutId){e.next=6;break}return e.abrupt("return",Promise.resolve(n));case 6:if(console.debug("??? XLR.debug prepareLayouts::playback",{layoutPlayback:r,shouldParse:!1}),n.currentLayoutId=null===(t=r.currentLayout)||void 0===t?void 0:t.layoutId,null===(i=r.currentLayout)||void 0===i||!i.layoutNode){e.next=12;break}e.t0=r.currentLayout,e.next=15;break;case 12:return e.next=14,n.prepareLayoutXlf(r.currentLayout);case 14:e.t0=e.sent;case 15:return a=e.t0,e.next=18,n.prepareLayoutXlf(r.nextLayout);case 18:return u=e.sent,e.t1=Promise,e.t2=a,e.next=23,n.prepareForSsp(u);case 23:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=27,e.t1.all.call(e.t1,e.t4);case 27:return d=e.sent,n.isUpdatingLoop&&r.nextLayout&&u&&this.isLayoutInDOM(u.containerName,u.index)&&u.removeLayout(),console.debug(">>>>> XLR.debug prepared layout XLF",d),e.abrupt("return",new Promise(function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.layouts.current=d[0],n.layouts.next=d[1],n.layouts.current&&n.layouts.next&&(n.layouts.current.xlr=n,n.layouts.next.xlr=n),n.currentLayoutIndex=r.currentLayoutIndex,n.currentLayout=n.layouts.current,n.currentLayoutId=n.currentLayout.layoutId,n.nextLayout=n.layouts.next,t(o);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 31:case"end":return e.stop()}}),e,this)}))),o.prepareLayoutXlf=function(){var t=l(s().mark((function t(i){var n,o,l,u,d,c,h,p;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i){t.next=3;break}return console.warn("XLR::prepareLayoutXlf called with undefined inputLayout"),t.abrupt("return",x);case 3:if(n=this,o=r({},a.options),n.config.platform===e.ConsumerPlatform.CMS&&i&&Boolean(i.layoutId)?o.xlfUrl=o.xlfUrl.replace(":layoutId",String(i.layoutId)):n.config.platform!==e.ConsumerPlatform.CHROMEOS&&n.config.platform!==e.ConsumerPlatform.ELECTRON||void 0===i||(o.xlfUrl=i.path),!i||void 0!==i.layoutNode){t.next=21;break}if(-1!==i.layoutId){t.next=14;break}return t.next=10,n.emitSync("adRequest",i.index);case 10:d=n.inputLayouts[i.index],l=(null===(c=d)||void 0===c?void 0:c.getXlf())||"",t.next=17;break;case 14:return t.next=16,ff(o);case 16:l=t.sent;case 17:h=new window.DOMParser,u=h.parseFromString(l,"text/xml"),t.next=22;break;case 21:u=i&&i.layoutNode;case 22:return p=!(null==i||!i.isOverlay),t.abrupt("return",new Promise((function(e){var t,s=r(r({},x),{},{ad:null!==(t=i.ad)&&void 0!==t?t:x.ad});console.log("XLR::prepareLayoutXlf >> Promise",{xlrLayoutObj:s,inputLayout:i}),s.id=Number(i.layoutId),s.layoutId=Number(i.layoutId),s.scheduleId=(null==i?void 0:i.scheduleId)||void 0,s.options=o,s.index=i.index,s.xlfString=l,s.duration=i.duration,s.isOverlay=p,s.shareOfVoice=i.shareOfVoice,console.log("XLR::prepareLayoutXlf >> Promise >> xlrLayoutObj",s),d&&(s.duration=d.duration||0,s.ad=d.ad),e(p?new Tf(s,o,n,u):new vf(s,o,n,u))})));case 24:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),o.prepareForSsp=function(){var e=l(s().mark((function e(t){var i,n,r,a,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this,n=t;case 2:if(!n||""!==n.xlfString){e.next=17;break}if(n.removeLayout(),!((r=n.index+1)>=i.inputLayouts.length)){e.next=7;break}return e.abrupt("break",17);case 7:if(a=i.inputLayouts[r]){e.next=10;break}return e.abrupt("break",17);case 10:return o=of(o=i.getLayout(a),r),e.next=14,i.prepareLayoutXlf(o);case 14:n=e.sent,e.next=2;break;case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),o.gotoPrevLayout=l(s().mark((function e(){var t,i,n,r=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.currentLayoutIndex,!((i=t-1)<0)){e.next=4;break}return e.abrupt("return");case 4:if(console.debug("XLR::gotoPrevLayout",{previousLayoutIndex:i,method:"XLR::gotoPrevLayout",shouldParse:!1}),!Boolean(this.inputLayouts[i])){e.next=10;break}return e.next=8,null===(n=this.currentLayout)||void 0===n?void 0:n.finishAllRegions();case 8:this.currentLayoutIndex=i,this.prepareLayouts().then(function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.playSchedules(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 10:case"end":return e.stop()}}),e,this)}))),o.gotoNextLayout=l(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.debug("XLR::gotoNextLayout",{nextLayoutIndex:this.currentLayoutIndex+1,method:"XLR::gotoNextLayout",shouldParse:!1}),e.next=3,null===(t=o.currentLayout)||void 0===t?void 0:t.finishAllRegions();case 3:case"end":return e.stop()}}),e,this)}))),o.updateInputLayout=function(e,t){var i=this.inputLayouts[e];null!==t&&(t.index=i.index),this.inputLayouts[e]=t||i},o.bootstrap(),o},e.defaultTrans=wg,e.defaultVjsOpts=bg,e.fadeInElem=Eg,e.fadeOutElem=xg,e.fetchJSON=Bg,e.fetchText=function(e,t){return qg.apply(this,arguments)},e.flyInElem=Cg,e.flyOutElem=kg,e.flyTransitionKeyframes=Lg,e.getAllAttributes=Gg,e.getDataBlob=function(e,t){return Ng.apply(this,arguments)},e.getFileExt=jg,e.getIndexByLayoutId=function(e,t){var i=e.reduce((function(e,t,i){return e[Number(t.layoutId)]=r(r({},t),{},{index:i}),e}),{});return null!==t&&t?Boolean(i[t])?i[t]:{index:0}:i},e.getLayout=function(e){var t,i,n=void 0,s=void 0,a=e.xlr,o=a.inputLayouts,l=a.currentLayout,u=a.nextLayout,d=a.currentLayoutIndex,c=o.length>0,h=d,p=h+1;if(void 0===l&&void 0===u){if(c){var m=r({},x);t=o[h],n=r(r({},x),t),s=o.length>1?m=r(r({},m),o[p]):n,n.id=t.layoutId,m&&(s.id=m.layoutId)}}else c&&(p=(h=null===(i=n=u)||void 0===i?void 0:i.index)+1,s=o.length>1&&p<o.length&&Boolean(o[p])?r(r({},x),o[p]):r(r({},x),o[0]));return{currentLayoutIndex:h,nextLayoutIndex:p,inputLayouts:e.xlr.inputLayouts,current:n,next:s}},e.getLayoutIndexByLayoutId=Jg,e.getMediaId=Dg,e.getXlf=ff,e.hasDefaultOnly=Qg,e.hasSspLayout=Zg,e.initRenderingDOM=gf,e.initialLayout=x,e.initialMedia=I,e.initialRegion=C,e.initialXlr=P,e.isEmpty=function(e){return!Boolean(e)||0===String(e).length},e.isLayoutValid=Kg,e.nextId=Pg,e.playerReportFault=sf,e.preloadMediaBlob=function(e,t,i){return Rg.apply(this,arguments)},e.prepareAudioMedia=nf,e.prepareHtmlMedia=rf,e.prepareImageMedia=tf,e.prepareVideoMedia=ef,e.setExpiry=Yg,e.transitionElement=Ig,e.videoFileType=Hg,e.vjsDefaultOptions=_g,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
26
+ const Rc=Yt,Bc=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Uc=e=>Oc.log.debug?Oc.log.debug.bind(Oc,"VHS:",`${e} >`):function(){};function Fc(...e){const t=Oc.obj||Oc;return(t.merge||t.mergeOptions).apply(t,e)}function jc(...e){const t=Oc.time||Oc;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const qc=1/30,Hc=.1,Vc=function(e,t){const i=[];let n;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return jc(i)},Xc=function(e,t){return Vc(e,(function(e,i){return e-Hc<=t&&i+Hc>=t}))},zc=function(e,t){return Vc(e,(function(e){return e-qc>=t}))},Wc=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Gc=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Yc=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Kc=function(e,t){let i=0;if(!e||!e.length)return i;for(let n=0;n<e.length;n++){const r=e.start(n),s=e.end(n);t>s||(i+=t>r&&t<=s?s-t:s-r)}return i},Jc=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},Qc=e=>(e.segments||[]).reduce(((e,t,i)=>(t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e)),[]),Zc=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},$c=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let n=(i||[]).reduce(((e,t)=>e+("PART"===t.type?1:0)),0);return n+=t&&t.length?t.length:0,n},eh=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=Zc(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},th=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const n=function(e,t){let i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(r=e.segments[n],void 0!==r.end)return{result:i+r.end,precise:!0};if(i+=Jc(e,r),void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(n.precise)return n.result;const r=function(e,t){let i,n=0,r=t-e.mediaSequence;for(;r<e.segments.length;r++){if(i=e.segments[r],void 0!==i.start)return{result:i.start-n,precise:!0};if(n+=Jc(e,i),void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return r.precise?r.result:n.result+i},ih=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return Me.Infinity}return th(e,t,i)},nh=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:n}){let r=0;if(i>n&&([i,n]=[n,i]),i<0){for(let t=i;t<Math.min(0,n);t++)r+=e;i=0}for(let e=i;e<n;e++)r+=t[e].duration;return r},rh=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return ih(e);if(null===t)return null;t=t||0;let r=th(e,e.mediaSequence+e.segments.length,t);return i&&(r-=n="number"==typeof n?n:eh(null,e)),Math.max(0,r)},sh=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ah=function(e){return e.excludeUntil&&e.excludeUntil===1/0},oh=function(e){const t=sh(e);return!e.disabled&&!t},lh=function(e,t){return t.attributes&&t.attributes[e]},uh=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!oh(e)&&(e.attributes.BANDWIDTH||0)<i)).length},dh=(e,t)=>!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri)))),ch=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=!1;for(const e in i){for(const r in i[e])if(n=t(i[e][r]),n)break;if(n)break}return!!n},hh=e=>{if(!e||!e.playlists||!e.playlists.length){return ch(e,(e=>e.playlists&&e.playlists.length||e.uri))}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;if(n&&n.split(",").every((e=>pi(e))))continue;if(!ch(e,(e=>dh(i,e))))return!1}return!0};var ph={liveEdgeDelay:eh,duration:ih,seekable:function(e,t,i){const n=t||0;let r=rh(e,t,!0,i);return null===r?jc():(r<n&&(r=n),jc(n,r))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:r,exactManifestTimings:s}){let a=t-r;const o=Qc(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i===t.segmentIndex&&("number"!=typeof n||"number"!=typeof t.partIndex||n===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,s){if(a<0)continue}else if(a+qc<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:r-nh({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){const i=o[t];a-=i.duration;const n=i.duration>qc;if(!(0===a)&&!(n&&a+qc>=0)||t===o.length-1){if(s){if(a>0)continue}else if(a-qc>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:r+nh({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:oh,isDisabled:function(e){return e.disabled},isExcluded:sh,isIncompatible:ah,playlistEnd:rh,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:lh,estimateSegmentRequestTime:function(e,t,i,n=0){if(!lh("BANDWIDTH",i))return NaN;return(e*i.attributes.BANDWIDTH-8*n)/t},isLowestEnabledRendition:uh,isAudioOnly:hh,playlistMatch:dh,segmentDurationWithParts:Jc};const{log:mh}=Oc,gh=(e,t)=>`${e}-${t}`,fh=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,yh=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i=>{if(e.mediaGroups[i])for(const n in e.mediaGroups[i])for(const r in e.mediaGroups[i][n]){const s=e.mediaGroups[i][n][r];t(s,i,n,r)}}))},vh=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},bh=(e,t,i=fh)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const i=`placeholder-uri-${t}`;e.playlists[t].uri=i}const n=hh(e);yh(e,((t,r,s,a)=>{if(!t.playlists||!t.playlists.length){if(n&&"AUDIO"===r&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===s)return}t.playlists=[Wt({},t)]}t.playlists.forEach((function(t,n){const o=i(r,s,a,t),l=gh(n,o);t.uri?t.resolvedUri=t.resolvedUri||Rc(e.uri,t.uri):(t.uri=0===n?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),(e=>{let t=e.playlists.length;for(;t--;){const i=e.playlists[t];vh({playlist:i,id:gh(t,i.uri)}),i.resolvedUri=Rc(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||mh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{yh(e,(t=>{t.uri&&(t.resolvedUri=Rc(e.uri,t.uri))}))})(e)};class Th{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach(((i,n)=>{if(!this.processedDateRanges_.has(n)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0}));for(const i of t){const t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach(((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)}))}}const _h=({requestType:e,request:t,error:i,parseFailure:n})=>{const r=t.status<200||t.status>299,s=t.status>=400&&t.status<=499,a={uri:t.uri,requestType:e},o=r&&!s||n;if(i&&s)a.error=Wt({},i),a.errorType=Oc.Error.NetworkRequestFailed;else if(t.aborted)a.errorType=Oc.Error.NetworkRequestAborted;else if(t.timedout)a.erroType=Oc.Error.NetworkRequestTimeout;else if(o){const e=n?Oc.Error.NetworkBodyParserFailed:Oc.Error.NetworkBadStatus;a.errorType=e,a.status=t.status,a.headers=t.headers}return a},{EventTarget:Ah}=Oc,Sh=(e,t)=>{if(!e)return t;const i=Fc(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=Fc(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},wh=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=Rc(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Rc(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Rc(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Rc(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=Rc(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=Rc(t,e.uri))}))},Eh=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},xh=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,Ch=(e,t,i=xh)=>{const n=Fc(e,{}),r=n.playlists[t.id];if(!r)return null;if(i(r,t))return null;t.segments=Eh(t);const s=Fc(r,t);if(s.preloadSegment&&!t.preloadSegment&&delete s.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}s.segments=((e,t,i)=>{const n=e.slice(),r=t.slice();i=i||0;const s=[];let a;for(let e=0;e<r.length;e++){const t=n[e+i],o=r[e];t?(a=t.map||a,s.push(Sh(t,o))):(a&&!o.map&&(o.map=a),s.push(o))}return s})(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}s.segments.forEach((e=>{wh(e,s.resolvedUri)}));for(let e=0;e<n.playlists.length;e++)n.playlists[e].id===t.id&&(n.playlists[e]=s);return n.playlists[t.id]=s,n.playlists[t.uri]=s,yh(e,((e,i,n,r)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=s)})),n},kh=(e,t)=>{const i=e.segments||[],n=i[i.length-1],r=n&&n.parts&&n.parts[n.parts.length-1],s=r&&r.duration||n&&n.duration;return t&&s?1e3*s:500*(e.partTargetDuration||e.targetDuration||10)},Ih=(e,t,i)=>{if(!e)return;const n=[];return e.forEach((e=>{if(!e.attributes)return;const{BANDWIDTH:t,RESOLUTION:i,CODECS:r}=e.attributes;n.push({id:e.id,bandwidth:t,resolution:i,codecs:r})})),{type:t,isLive:i,renditions:n}};class Lh extends Ah{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Uc("PlaylistLoader");const{withCredentials:n=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=n,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const r=t.options_;this.customTagParsers=r&&r.customTagParsers||[],this.customTagMappers=r&&r.customTagMappers||[],this.llhls=r&&r.llhls,this.dateRangesStorage_=new Th,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=Rc(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let n=t.mediaSequence+t.segments.length;if(e){const r=e.parts||[],s=$c(t)-1;s>-1&&s!==r.length-1&&(i._HLS_part=s),(s>-1||r.length)&&n--}i._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new Me.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])})),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(e,t,i){const{uri:n,id:r}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[r],status:e.status,message:`HLS playlist request error at URL: ${n}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:_h({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:n=[],customTagMappers:r=[],llhls:s})=>{const a=new si;e&&a.on("warn",e),t&&a.on("info",t),n.forEach((e=>a.addParser(e))),r.forEach((e=>a.addTagMapper(e))),a.push(i),a.end();const o=a.manifest;if(s||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce(((e,t)=>Math.max(e,t.duration)),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const l=Zc(o);if(l.length&&!o.partTargetDuration){const t=l.reduce(((e,t)=>Math.max(e,t.duration)),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),mh.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(e){this.error=e,this.error.metadata={errorType:Oc.Error.StreamingHlsPlaylistParserError,error:e}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null,this.state="HAVE_METADATA";const r={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:r});const s=t||this.parseManifest_({url:i,manifestString:e});s.lastRequest=Date.now(),vh({playlist:s,uri:i,id:n});const a=Ch(this.main,s);this.targetDuration=s.partTargetDuration||s.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(kh(this.media(),!!a)),r.parsedPlaylist=Ih(this.main.playlists,r.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:r}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),Me.clearTimeout(this.mediaUpdateTimeout),Me.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Th,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(Me.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=Me.setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,n=!this.media_||e.id!==this.media_.id,r=this.main.playlists[e.id];if(r&&r.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(kh(e,!0)),!n)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const s={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:s}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,n)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Bc(e.resolvedUri,n),t)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:s}),this.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}}))}pause(){this.mediaUpdateTimeout&&(Me.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(Me.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=Me.setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(Me.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=Me.setTimeout((()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)}),e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=Me.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:_h({requestType:i.requestType,request:i,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Bc(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const n=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=Ih(n.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(n)}))}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,bh(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=Eh(e),e.segments.forEach((t=>{wh(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||Me.location.href;this.main=((e,t)=>{const i=gh(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:Me.location.href,resolvedUri:Me.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,n=e.ID;let r=i.playlists.length;for(;r--;){const s=i.playlists[r];if(s.attributes["PATHWAY-ID"]===n){const a=s.resolvedUri,o=s.id;if(t){const t=this.createCloneURI_(s.resolvedUri,e),a=gh(n,t),o=this.createCloneAttributes_(n,s.attributes),l=this.createClonePlaylist_(s,a,e,o);i.playlists[r]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(r,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][n])for(const t in i.mediaGroups[e])if(t===n){for(const n in i.mediaGroups[e][t]){i.mediaGroups[e][t][n].playlists.forEach(((e,t)=>{const n=i.playlists[e.id],r=n.id,s=n.resolvedUri;delete i.playlists[r],delete i.playlists[s]}))}delete i.mediaGroups[e][t]}})),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,n=i.playlists.length,r=this.createCloneURI_(t.resolvedUri,e),s=gh(e.ID,r),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,s,e,a);i.playlists[n]=o,i.playlists[s]=o,i.playlists[r]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],n=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((r=>{if(n.mediaGroups[r]&&!n.mediaGroups[r][t])for(const s in n.mediaGroups[r])if(s===i){n.mediaGroups[r][t]={};for(const i in n.mediaGroups[r][s]){const a=n.mediaGroups[r][s][i];n.mediaGroups[r][t][i]=Wt({},a);const o=n.mediaGroups[r][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach(((s,a)=>{const l=n.playlists[s.id],u=fh(r,t,i),d=gh(t,u);if(l&&!n.playlists[d]){const t=this.createClonePlaylist_(l,d,e),i=t.resolvedUri;n.playlists[d]=t,n.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(s,d,e)}))}}}))}createClonePlaylist_(e,t,i,n){const r=this.createCloneURI_(e.resolvedUri,i),s={resolvedUri:r,uri:r,id:t};return e.segments&&(s.segments=[]),n&&(s.attributes=n),Fc(e,s)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const n=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(n))i.searchParams.set(e,n[e]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((n=>{t[n]&&(i[n]=e)})),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes.keyId;n&&t.add(n.toLowerCase())}return t}}}const Oh=function(e,t,i,n){const r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},Ph=function(){const e=function e(t,i){t=Fc({timeout:45e3},t);const n=e.beforeRequest||Oc.Vhs.xhr.beforeRequest,r=e._requestCallbackSet||Oc.Vhs.xhr._requestCallbackSet||new Set,s=e._responseCallbackSet||Oc.Vhs.xhr._responseCallbackSet;n&&"function"==typeof n&&(Oc.log.warn("beforeRequest is deprecated, use onRequest instead."),r.add(n));const a=!0===Oc.Vhs.xhr.original?Oc.xhr:Oc.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach((e=>{i=e(i)})),i})(r,t);r.delete(n);const l=a(o||t,(function(e,t){return((e,t,i,n)=>{e&&e.size&&e.forEach((e=>{e(t,i,n)}))})(s,l,e,t),Oh(l,e,t,i)})),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=t.uri,l.requestType=t.requestType,l.requestTime=Date.now(),l};return e.original=!0,e},Dh=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Me.BigInt(e.offset)+Me.BigInt(e.length)-Me.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},Mh=function(e,t){return e.start(t)+"-"+e.end(t)},Nh=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Rh=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Bh=function(e){const t={};return Object.keys(e).forEach((i=>{const n=e[i];_i(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},Uh=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Fh=function(e){return e.resolvedUri},jh=e=>{const t=Array.prototype.slice.call(e),i=16;let n,r,s="";for(let e=0;e<t.length/i;e++)n=t.slice(e*i,e*i+i).map(Nh).join(""),r=t.slice(e*i,e*i+i).map(Rh).join(""),s+=n+" "+r+"\n";return s};var qh=Object.freeze({__proto__:null,createTransferableMessage:Bh,initSegmentId:Uh,segmentKeyId:Fh,hexDump:jh,tagDump:({bytes:e})=>jh(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=Mh(e,t)+" ";return i}});const Hh=({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const n=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,n=0;for(let r=0;r<t.segments.length&&(i=t.segments[r],n=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration,!(e<=n));r++);const r=t.segments[t.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*r.duration)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!n)return i({message:"valid programTime was not found"});if("estimate"===n.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const r={mediaSeconds:t},s=((e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n)})(t,n.segment);return s&&(r.programDateTime=s.toISOString()),i(null,r)},Vh=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:r=!0,tech:s,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!s.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let n=t.segments[0];if(i<new Date(n.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(n=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);const r=t.segments[t.segments.length-1],s=r.dateTimeObject,a=r.videoTimingInfo?(o=r.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:r.duration+.25*r.duration;var o;return i>new Date(s.getTime()+1e3*a)?null:(i>new Date(s)&&(n=r),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:ph.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});const l=o.segment,u=((e,t)=>{let i,n;try{i=new Date(e),n=new Date(t)}catch(e){}const r=i.getTime();return(n.getTime()-r)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(n(o.estimatedStart+u),void s.one("seeked",(()=>{Vh({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:r,tech:s,callback:a})})));const d=l.start+u;s.one("seeked",(()=>a(null,s.currentTime()))),r&&s.pause(),n(d)},Xh=(e,t)=>{if(4===e.readyState)return t()},zh=(e,t,i,n)=>{let r,s=[],a=!1;const o=function(e,t,n,r){return t.abort(),a=!0,i(e,t,n,r)},l=function(e,t){if(a)return;if(e)return e.metadata=_h({requestType:n,request:t,error:e}),o(e,t,"",s);const i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length);if(s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})),t.length<=1)return Ai(t[0]);var n=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}),0),r=new Uint8Array(n),s=0;return t.forEach((function(e){e=Ai(e),r.set(e,s),s+=e.byteLength})),r}(s,Ci(i,!0)),r=r||Xs(s),s.length<10||r&&s.length<r+2)return Xh(t,(()=>o(e,t,"",s)));const l=ha(s);return"ts"===l&&s.length<188||!l&&s.length<376?Xh(t,(()=>o(e,t,"",s))):o(null,t,l,s)},u={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:i}){return Oh(e,null,{statusCode:e.status},l)}))}},d=t(u,(function(e,t){return Oh(d,e,t,l)}));return d},{EventTarget:Wh}=Oc,Gh=function(e,t){if(!xh(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const n=e.segments[i],r=t.segments[i];if(n.uri!==r.uri)return!1;if(!n.byterange&&!r.byterange)continue;const s=n.byterange,a=r.byterange;if(s&&!a||!s&&a)return!1;if(s.offset!==a.offset||s.length!==a.length)return!1}return!0},Yh=(e,t,i,n)=>`placeholder-uri-${e}-${t}-${n.attributes.NAME||i}`,Kh=(e,t,i)=>{let n=!0,r=Fc(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const s=t.playlists[e];if(s.sidx){const e=ls(s.sidx);i&&i[e]&&i[e].sidx&&ts(s,i[e].sidx,s.sidx.resolvedUri)}const a=Ch(r,s,Gh);a&&(r=a,n=!1)}return yh(t,((e,t,i,s)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=Ch(r,e.playlists[0],Gh);o&&(r=o,s in r.mediaGroups[t][i]||(r.mediaGroups[t][i][s]=e),r.mediaGroups[t][i][s].playlists[0]=r.playlists[a],n=!1)}})),((e,t)=>{yh(e,((i,n,r,s)=>{t.mediaGroups[n][r]&&s in t.mediaGroups[n][r]||delete e.mediaGroups[n][r][s]}))})(r,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:r},Jh=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,Qh=(e,t)=>{const i={};for(const n in e){const r=e[n].sidx;if(r){const e=ls(r);if(!t[e])break;const n=t[e].sidxInfo;Jh(n,r)&&(i[e]=t[e])}}return i};class Zh extends Wh{constructor(e,t,i={},n){super(),this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);const{withCredentials:r=!1}=i;if(this.vhs_=t,this.withCredentials=r,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()})),this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)})),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Uc("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const n=e.sidx&&ls(e.sidx);if(!e.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n])return void(this.mediaRequest_=Me.setTimeout((()=>i(!1)),0));const r=Bc(e.sidx.resolvedUri),s=(r,s)=>{if(this.requestErrored_(r,s,t))return;const a=this.mainPlaylistLoader_.sidxMapping_,{requestType:o}=s;let l;try{l=Hs(Ai(s.response).subarray(8))}catch(e){return e.metadata=_h({requestType:o,request:s,parseFailure:!0}),void this.requestErrored_(e,s,t)}return a[n]={sidxInfo:e.sidx,sidx:l},ts(e,l,e.sidx.resolvedUri),i(!0)};this.request=zh(r,this.vhs_.xhr,((t,i,n,a)=>{if(t)return s(t,i);if(!n||"mp4"!==n){const t=n||"unknown";return s({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${r}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i)}const{offset:o,length:l}=e.sidx.byterange;if(a.length>=l+o)return s(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",requestType:"dash-sidx",headers:Dh({byterange:e.sidx.byterange})},s)}),"dash-sidx")}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},Me.clearTimeout(this.minimumUpdatePeriodTimeout_),Me.clearTimeout(this.mediaRequest_),Me.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,(i=>{this.haveMetadata({startingState:t,playlist:e})})))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),Me.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(Me.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){Me.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=Me.setTimeout((()=>this.load()),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_(((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})):this.mediaRequest_=Me.setTimeout((()=>this.haveMain_()),0)}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},((i,n)=>{if(i){const{requestType:e}=n;i.metadata=_h({requestType:e,request:n,error:i})}if(this.requestErrored_(i,n))return void("HAVE_NOTHING"===this.state&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const r=n.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?this.mainLoaded_=Date.parse(n.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Bc(this.mainPlaylistLoader_.srcUrl,n),r?(this.handleMain_(),void this.syncClientServerClock_((()=>e(n,r)))):e(n,r)}))}syncClientServerClock_(e){const t=Fs(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Rc(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},((i,n)=>{if(!this.request)return;if(i){const{requestType:t}=n;return this.error.metadata=_h({requestType:t,request:n,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let r;r="HEAD"===t.method?n.responseHeaders&&n.responseHeaders.date?Date.parse(n.responseHeaders.date):this.mainLoaded_:Date.parse(n.responseText),this.mainPlaylistLoader_.clientOffset_=r-Date.now(),e()})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:r})=>{const s=Us(e,{manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:r});return bh(s,t,Yh),s})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:Oc.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}e&&(i=Kh(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const n=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(n&&n!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=n),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:e,endList:n}=i,r=[];i.playlists.forEach((e=>{r.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}));const s={duration:e,isLive:!n,renditions:r};t.parsedManifest=s,this.trigger({type:"manifestparsecomplete",metadata:t})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(Me.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=Me.setTimeout((()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)}refreshXml_(){this.requestMain_(((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let i=Qh(e.playlists,t);return yh(e,((e,n,r,s)=>{if(e.playlists&&e.playlists.length){const n=e.playlists;i=Fc(i,Qh(n,t))}})),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(e=>{this.refreshMedia_(this.media().id)})))}))}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=Me.setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),kh(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map((e=>({cueTime:e.start,frames:[{data:e.messageData}]})));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes["cenc:default_KID"];n&&t.add(n.replace(/-/g,"").toLowerCase())}return t}}}var $h={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const ep=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},tp=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e),i=ep(new Worker(t));i.objURL=t;const n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},ip=function(e){return`var browserWorkerPolyFill = ${ep.toString()};\nbrowserWorkerPolyFill(self);\n`+e},np=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},rp=ip(np((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(s=[],n=arguments.length,n=1;n<arguments.length;++n)s.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,s)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},t.prototype.partialFlush=function(e){this.trigger("partialdone",e)},t.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},t.prototype.reset=function(e){this.trigger("reset",e)};var i,n,r,s,a,o,l,u,d,c,h,p,m,g,f,y,v,b,T,_,A,S,w,E,x,C,k,I,L,O,P,D,M,N,R,B,U,F,j,q,H=t,V=Math.pow(2,32),X={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*V+i.getUint32(4)},MAX_UINT32:V},z=X.MAX_UINT32;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),x=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),E=new Uint8Array([0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),k=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),I={video:C,audio:k},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),O=new Uint8Array([0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,0,0,0,0,0]),M=D,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=D,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),i=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},n=function(){return i(S.dinf,i(S.dref,P))},r=function(e){return i(S.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},f=function(e){return i(S.hdlr,I[e])},g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),i(S.mdhd,t)},m=function(e){return i(S.mdia,g(e),f(e.type),o(e))},a=function(e){return i(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return i(S.minf,"video"===e.type?i(S.vmhd,L):i(S.smhd,O),n(),v(e))},l=function(e,t){for(var n=[],r=t.length;r--;)n[r]=T(t[r]);return i.apply(null,[S.moof,a(e)].concat(n))},u=function(e){for(var t=e.length,n=[];t--;)n[t]=h(e[t]);return i.apply(null,[S.moov,c(4294967295)].concat(n).concat(d(e)))},d=function(e){for(var t=e.length,n=[];t--;)n[t]=_(e[t]);return i.apply(null,[S.mvex].concat(n))},c=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i(S.mvhd,t)},y=function(e){var t,n,r=e.samples||[],s=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)t=r[n].flags,s[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return i(S.sdtp,s)},v=function(e){return i(S.stbl,b(e),i(S.stts,R),i(S.stsc,M),i(S.stsz,N),i(S.stco,D))},b=function(e){return i(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?B(e):U(e))},B=function(e){var t,n,r=e.sps||[],s=e.pps||[],a=[],o=[];for(t=0;t<r.length;t++)a.push((65280&r[t].byteLength)>>>8),a.push(255&r[t].byteLength),a=a.concat(Array.prototype.slice.call(r[t]));for(t=0;t<s.length;t++)o.push((65280&s[t].byteLength)>>>8),o.push(255&s[t].byteLength),o=o.concat(Array.prototype.slice.call(s[t]));if(n=[S.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i(S.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],a,[s.length],o))),i(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];n.push(i(S.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return i.apply(null,n)},U=function(e){return i(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),r(e))},p=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return i(S.tkhd,t)},T=function(e){var t,n,r,s,a,o;return t=i(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/z),o=Math.floor(e.baseMediaDecodeTime%z),n=i(S.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=A(e,92),i(S.traf,t,n,r)):(s=y(e),r=A(e,s.length+92),i(S.traf,t,n,r,s))},h=function(e){return e.duration=e.duration||4294967295,i(S.trak,p(e),m(e))},_=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),i(S.trex,t)},q=function(e,t){var i=0,n=0,r=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(s=8)),[0,0,i|n|r|s,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(e,t){var n,r,s,a,o,l;for(t+=20+16*(a=e.samples||[]).length,s=q(a,t),(r=new Uint8Array(s.length+16*a.length)).set(s),n=s.length,l=0;l<a.length;l++)o=a[l],r[n++]=(4278190080&o.duration)>>>24,r[n++]=(16711680&o.duration)>>>16,r[n++]=(65280&o.duration)>>>8,r[n++]=255&o.duration,r[n++]=(4278190080&o.size)>>>24,r[n++]=(16711680&o.size)>>>16,r[n++]=(65280&o.size)>>>8,r[n++]=255&o.size,r[n++]=o.flags.isLeading<<2|o.flags.dependsOn,r[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[n++]=61440&o.flags.degradationPriority,r[n++]=15&o.flags.degradationPriority,r[n++]=(4278190080&o.compositionTimeOffset)>>>24,r[n++]=(16711680&o.compositionTimeOffset)>>>16,r[n++]=(65280&o.compositionTimeOffset)>>>8,r[n++]=255&o.compositionTimeOffset;return i(S.trun,r)},F=function(e,t){var n,r,s,a,o,l;for(t+=20+8*(a=e.samples||[]).length,s=q(a,t),(n=new Uint8Array(s.length+8*a.length)).set(s),r=s.length,l=0;l<a.length;l++)o=a[l],n[r++]=(4278190080&o.duration)>>>24,n[r++]=(16711680&o.duration)>>>16,n[r++]=(65280&o.duration)>>>8,n[r++]=255&o.duration,n[r++]=(4278190080&o.size)>>>24,n[r++]=(16711680&o.size)>>>16,n[r++]=(65280&o.size)>>>8,n[r++]=255&o.size;return i(S.trun,n)},A=function(e,t){return"audio"===e.type?F(e,t):j(e,t)};var W,G,Y,K,J,Q,Z,$,ee={ftyp:s=function(){return i(S.ftyp,w,E,w,x)},mdat:function(e){return i(S.mdat,e)},moof:l,moov:u,initSegment:function(e){var t,i=s(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},te=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},ie={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},groupFramesIntoGops:function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,n,r,s,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(s=e[i],n=0;n<s.length;n++)a=s[n],o+=(r=te(a,o)).size,l.push(r);return l},concatenateNalData:function(e){var t,i,n,r,s,a,o=0,l=e.byteLength,u=e.nalCount,d=new Uint8Array(l+4*u),c=new DataView(d.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(s=r[i],n=0;n<s.length;n++)a=s[n],c.setUint32(o,a.data.byteLength),o+=4,d.set(a.data,o),o+=a.data.byteLength;return d},generateSampleTableForFrame:function(e,t){var i,n=[];return i=te(e,t||0),n.push(i),n},concatenateNalDataForFrame:function(e){var t,i,n=0,r=e.byteLength,s=e.length,a=new Uint8Array(r+4*s),o=new DataView(a.buffer);for(t=0;t<e.length;t++)i=e[t],o.setUint32(n,i.data.byteLength),n+=4,a.set(i.data,n),n+=i.data.byteLength;return a}},ne=[33,16,5,32,164,27],re=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(e){for(var t=[];e--;)t.push(0);return t},ae=9e4;Q=function(e,t){return G(J(e,t))},Z=function(e,t){return Y(K(e),t)},$=function(e,t,i){return K(i?e:e-t)};var oe={ONE_SECOND_IN_TS:ae,secondsToVideoTs:G=function(e){return e*ae},secondsToAudioTs:Y=function(e,t){return e*t},videoTsToSeconds:K=function(e){return e/ae},audioTsToSeconds:J=function(e,t){return e/t},audioTsToVideoTs:Q,videoTsToAudioTs:Z,metadataTsToSeconds:$},le=function(){if(!W){var e={96e3:[ne,[227,64],se(154),[56]],88200:[ne,[231],se(170),[56]],64e3:[ne,[248,192],se(240),[56]],48e3:[ne,[255,192],se(268),[55,148,128],se(54),[112]],44100:[ne,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[ne,[255,192],se(268),[55,234],se(226),[112]],24e3:[ne,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[ne,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12e3:[re,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[re,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8e3:[re,se(268),[3,121,16],se(47),[7]]};t=e,W=Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return W},ue=oe,de={prefixWithSilence:function(e,t,i,n){var r,s,a,o,l,u=0,d=0,c=0;if(t.length&&(r=ue.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),s=Math.ceil(ue.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(u=r-Math.max(i,n),c=(d=Math.floor(u/s))*s),!(d<1||c>ue.ONE_SECOND_IN_TS/2))){for((a=le()[e.samplerate])||(a=t[0].data),o=0;o<d;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-s,pts:l.pts-s});return e.baseMediaDecodeTime-=Math.floor(ue.videoTsToAudioTs(c,e.samplerate)),c}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r}},ce=oe.ONE_SECOND_IN_TS,he={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/ce,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},pe={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,n=0,r=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,r,s,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)s={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(s.ccData=t[r+3]<<8|t[r+4],a.push(s));return a},discardEmulationPreventionBytes:function(e){for(var t,i,n=e.byteLength,r=[],s=1;s<n-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},me=H,ge=pe,fe=function(e){e=e||{},fe.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new xe(0,0),new xe(0,1),new xe(1,0),new xe(1,1)],this.parse708captions_&&(this.cc708Stream_=new _e({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};fe.prototype=new me,fe.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=ge.parseSei(e.escapedRBSP)).payload&&t.payloadType===ge.USER_DATA_REGISTERED_ITU_T_T35&&(i=ge.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=ge.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},fe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},fe.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},fe.prototype.flush=function(){return this.flushStream("flush")},fe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},fe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},fe.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},fe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},fe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},fe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},fe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ve=function(e){return 32<=e&&e<=127||160<=e&&e<=255},be=function(e){this.windowNum=e,this.reset()};be.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},be.prototype.getText=function(){return this.rows.join("\n")},be.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},be.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},be.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},be.prototype.addText=function(e){this.rows[this.rowIdx]+=e},be.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Te=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new be(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};Te.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new be(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},Te.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Te.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var _e=function(e){e=e||{},_e.prototype.init.call(this);var t,i=this,n=e.captionServices||{},r={};Object.keys(n).forEach((e=>{t=n[e],/^SERVICE/.test(e)&&(r[e]=t.encoding)})),this.serviceEncodings=r,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};_e.prototype=new me,_e.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},_e.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},_e.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,s=t[r++];for(e.seq=s>>6,e.sizeCode=63&s;r<t.length;r++)n=31&(s=t[r++]),7===(i=s>>5)&&n>0&&(i=s=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},_e.prototype.pushServiceBlock=function(e,t,i){var n,r=t,s=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,r));r<t+i&&r<s.length;r++)n=s[r],ve(n)?r=this.handleText(r,a):24===n?r=this.multiByteCharacter(r,a):16===n?r=this.extendedCommands(r,a):128<=n&&n<=135?r=this.setCurrentWindow(r,a):152<=n&&n<=159?r=this.defineWindow(r,a):136===n?r=this.clearWindows(r,a):140===n?r=this.deleteWindows(r,a):137===n?r=this.displayWindows(r,a):138===n?r=this.hideWindows(r,a):139===n?r=this.toggleWindows(r,a):151===n?r=this.setWindowAttributes(r,a):144===n?r=this.setPenAttributes(r,a):145===n?r=this.setPenColor(r,a):146===n?r=this.setPenLocation(r,a):143===n?a=this.reset(r,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&r++},_e.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return ve(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},_e.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},_e.prototype.initService=function(e,t){var i,n,r=this;return(i="SERVICE"+e)in this.serviceEncodings&&(n=this.serviceEncodings[i]),this.services[e]=new Te(e,n,r),this.services[e].init(this.getPts(t),(function(t){r.flushDisplayed(t,r.services[e])})),this.services[e]},_e.prototype.handleText=function(e,t,i){var n,r,s,a,o=i&&i.isExtended,l=i&&i.isMultiByte,u=this.current708Packet.data,d=o?4096:0,c=u[e],h=u[e+1],p=t.currentWindow;if(l?(r=[c,h],e++):r=[c],t.textDecoder_&&!o)n=t.textDecoder_.decode(new Uint8Array(r));else if(l){const e=r.map((e=>("0"+(255&e).toString(16)).slice(-2))).join("");n=String.fromCharCode(parseInt(e,16))}else a=ye[s=d|c]||s,n=4096&s&&s===a?"":String.fromCharCode(a);return p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(n),e},_e.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,n=i[e+1],r=i[e+2];return ve(n)&&ve(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},_e.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},_e.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],r=7&n;t.setCurrentWindow(r);var s=t.currentWindow;return n=i[++e],s.visible=(32&n)>>5,s.rowLock=(16&n)>>4,s.columnLock=(8&n)>>3,s.priority=7&n,n=i[++e],s.relativePositioning=(128&n)>>7,s.anchorVertical=127&n,n=i[++e],s.anchorHorizontal=n,n=i[++e],s.anchorPoint=(240&n)>>4,s.rowCount=15&n,n=i[++e],s.columnCount=63&n,n=i[++e],s.windowStyle=(56&n)>>3,s.penStyle=7&n,s.virtualRowCount=s.rowCount+1,e},_e.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},_e.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},_e.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},_e.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=1);return e},_e.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=0);return e},_e.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible^=1);return e},_e.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].clearText();return e},_e.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].reset();return e},_e.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penAttr;return n=i[++e],r.textTag=(240&n)>>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},_e.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},_e.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},_e.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Ae={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Se=function(e){return null===e?"":(e=Ae[e]||e,String.fromCharCode(e))},we=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ee=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},xe=function(e,t){xe.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,s;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ee();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ee();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ee()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))s=Se((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),s=Se((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~r||this.addFormatting(e.pts,["i"]),1&~r||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r)){const e=3&r;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(n,r)){var a=we.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(r)&&(14&~r||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(n)&&(0===r&&(r=null),s=Se(n),s+=Se(r),this[this.mode_](e.pts,s),this.column_+=s.length)}else this.lastControlCode_=null}};xe.prototype=new me,xe.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach(((e,n)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(n)}e.text.length&&i.push({text:e.text,line:n+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(n)})),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},xe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ee(),this.nonDisplayed_=Ee(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},xe.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},xe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},xe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},xe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},xe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},xe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},xe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},xe.prototype.isNormalChar=function(e){return e>=32&&e<=127},xe.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ee(),this.displayed_=Ee()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},xe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},xe.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},xe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},xe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},xe.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},xe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var Ce={CaptionStream:fe,Cea608Stream:xe,Cea708Stream:_e},ke={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ie=H,Le="shared",Oe=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Pe=function(e){var t,i;Pe.prototype.init.call(this),this.type_=e||Le,this.push=function(e){"metadata"!==e.type?this.type_!==Le&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Oe(e.dts,i),e.pts=Oe(e.pts,i),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Pe.prototype=new Ie;var De,Me={TimestampRolloverStream:Pe,handleRollover:Oe},Ne=(e,t,i)=>{if(!e)return-1;for(var n=i;n<e.length;n++)if(e[n]===t)return n;return-1},Re=Ne,Be=3,Ue=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},Fe=function(e,t,i){return decodeURIComponent(Ue(e,t,i))},je=function(e,t,i){return unescape(Ue(e,t,i))},qe=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},He={APIC:function(e){var t,i,n=1;e.data[0]===Be&&((t=Re(e.data,0,n))<0||(e.mimeType=je(e.data,n,t),n=t+1,e.pictureType=e.data[n],n++,(i=Re(e.data,0,n))<0||(e.description=Fe(e.data,n,i),n=i+1,"--\x3e"===e.mimeType?e.url=je(e.data,n,e.data.length):e.pictureData=e.data.subarray(n,e.data.length))))},"T*":function(e){e.data[0]===Be&&(e.value=Fe(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===Be&&-1!==(t=Re(e.data,0,1))&&(e.description=Fe(e.data,1,t),e.value=Fe(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=je(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;e.data[0]===Be&&-1!==(t=Re(e.data,0,1))&&(e.description=Fe(e.data,1,t),e.url=je(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=je(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},Ve={parseId3Frames:function(e){var t,i=10,n=0,r=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){n=qe(e.subarray(6,10)),n+=10,64&e[5]&&(i+=4,i+=qe(e.subarray(10,14)),n-=qe(e.subarray(16,20)));do{if((t=qe(e.subarray(i+4,i+8)))<1)break;var s={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};s.key=s.id,He[s.id]?He[s.id](s):"T"===s.id[0]?He["T*"](s):"W"===s.id[0]&&He["W*"](s),r.push(s),i+=10,i+=t}while(i<n);return r}},parseSyncSafeInteger:qe,frameParsers:He},Xe=ke,ze=Ve;(De=function(e){var t,i={descriptor:e&&e.descriptor},n=0,r=[],s=0;if(De.prototype.init.call(this),this.dispatchType=Xe.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(s=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(e),s+=e.data.byteLength,1===r.length&&(n=ze.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(s<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)t.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,s-=r[0].data.byteLength,r.shift();i=10,64&t.data[5]&&(i+=4,i+=ze.parseSyncSafeInteger(t.data.subarray(10,14)),n-=ze.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=ze.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,ze.frameParsers[o.id]?ze.frameParsers[o.id](o):"T"===o.id[0]?ze.frameParsers["T*"](o):"W"===o.id[0]&&ze.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var u=o.data,d=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;d*=4,d+=3&u[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<n);this.trigger("data",t)}}}).prototype=new H;var We,Ge,Ye,Ke=De,Je=H,Qe=Ce,Ze=ke,$e=Me.TimestampRolloverStream,et=188;(We=function(){var e=new Uint8Array(et),t=0;We.prototype.init.call(this),this.push=function(i){var n,r=0,s=et;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;s<n.byteLength;)71!==n[r]||71!==n[s]?(r++,s++):(this.trigger("data",n.subarray(r,s)),r+=et,s+=et);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===et&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new Je,Ge=function(){var e,t,i,n;Ge.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var s=e[r],a=(31&e[r+1])<<8|e[r+2];s===Ze.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:s===Ze.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:s===Ze.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=s),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ze.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ze.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},Ge.prototype=new Je,Ge.STREAM_TYPES={h264:27,adts:15},Ye=function(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},s={data:[],size:0},a=function(e,i,n){var r,s,a=new Uint8Array(e.size),o={type:i},l=0,u=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)s=e.data[l],a.set(s.data,u),u+=s.data.byteLength;!function(e,t){var i;const n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,o),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};Ye.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ze.H264_STREAM_TYPE:e=n,t="video";break;case Ze.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ze.METADATA_STREAM_TYPE:e=s,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[o.type]()},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(n,"video"),a(r,"audio"),a(s,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}},Ye.prototype=new Je;var tt={PAT_PID:0,MP2T_PACKET_LENGTH:et,TransportPacketStream:We,TransportParseStream:Ge,ElementaryStream:Ye,TimestampRolloverStream:$e,CaptionStream:Qe.CaptionStream,Cea608Stream:Qe.Cea608Stream,Cea708Stream:Qe.Cea708Stream,MetadataStream:Ke};for(var it in Ze)Ze.hasOwnProperty(it)&&(tt[it]=Ze[it]);var nt,rt=tt,st=oe.ONE_SECOND_IN_TS,at=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(nt=function(e){var t,i=0;nt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(n){var r,s,a,o,l,u=0;if(e||(i=0),"audio"===n.type){var d;for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+n.data.byteLength)).set(a),t.set(n.data,a.byteLength)):t=n.data;u+7<t.length;)if(255===t[u]&&240==(246&t[u+1])){if("number"==typeof d&&(this.skipWarn_(d,u),d=null),s=2*(1&~t[u+1]),r=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,l=(o=1024*(1+(3&t[u+6])))*st/at[(60&t[u+2])>>>2],t.byteLength-u<r)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:o,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:at[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+s,u+r)}),i++,u+=r}else"number"!=typeof d&&(d=u),u++;"number"==typeof d&&(this.skipWarn_(d,u),d=null),t=t.subarray(u)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new H;var ot,lt=nt;ot=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");s.set(e.subarray(r,r+a)),i=new DataView(s.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),s=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?s<<r|this.readBits(r):s},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(i&2147483648>>>e)return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var ut,dt,ct,ht=H,pt=ot;(dt=function(){var e,t,i=0;dt.prototype.init.call(this),this.push=function(n){var r;t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var s=t.byteLength;i<s-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<s;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<s);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ht,ct={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ut=function(){var e,t,i,n,r,s,a,o=new dt;ut.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:n,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(a.subarray(1)),o.config=s(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},r=function(e){for(var t,i,n=e.byteLength,r=[],s=1;s<n-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},s=function(e){var t,i,n,r,s,o,l,u,d,c,h,p,m=0,g=0,f=0,y=0,v=[1,1];if(i=(t=new pt(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ct[i]&&(3===(s=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==s?8:12,p=0;p<h;p++)t.readBoolean()&&a(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),d=t.readUnsignedExpGolomb(),0===(c=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),f=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:16*(u+1)-2*m-2*g,height:(2-c)*(d+1)*16-2*f-2*y,sarRatio:v}}},ut.prototype=new ht;var mt,gt={H264Stream:ut,NalByteStream:dt},ft=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],yt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},vt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=yt(e,t),vt(e,t))},bt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Tt={isLikelyAacData:function(e){var t=vt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:yt,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&!(240&~e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return ft[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=bt(e.subarray(10,14)));do{if((i=bt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r<n.byteLength;r++)if(0===n[r]){var s=unescape(function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r}(n,0,r));if("com.apple.streaming.transportStreamTimestamp"===s){var a=n.subarray(r+1),o=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return o*=4,o+=3&a[7]}break}}t+=10,t+=i}while(t<e.byteLength);return null}},_t=Tt;(mt=function(){var e=new Uint8Array,t=0;mt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s,a,o=0,l=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255&~e[l]||240&~e[l+1])l++;else{if(e.length-l<7)break;if(l+(o=_t.parseAdtsSize(e,l))>e.length)break;s={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",s),l+=o}else{if(e.length-l<10)break;if(l+(o=_t.parseId3TagSize(e,l))>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",r),l+=o}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var At,St,wt,Et,xt=H,Ct=ee,kt=ie,It=de,Lt=he,Ot=rt,Pt=oe,Dt=lt,Mt=gt.H264Stream,Nt=mt,Rt=Tt.isLikelyAacData,Bt=oe.ONE_SECOND_IN_TS,Ut=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ft=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],jt=function(e,t){t.stream=e,this.trigger("log",t)},qt=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var r=i[n];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",jt.bind(e,r))}},Ht=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Vt=function(e,t,i,n,r,s){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(r-i)},prependedContentDuration:s,baseMediaDecodeTime:e}};St=function(e,t){var i,n=[],r=0,s=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,St.prototype.init.call(this),this.push=function(t){Lt.collectDtsInfo(e,t),e&&Ut.forEach((function(i){e[i]=t[i]})),n.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var o,l,u,d,c,h,p;0!==n.length?(o=It.trimAdtsFramesByEarliestDts(n,e,r),e.baseMediaDecodeTime=Lt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=It.prefixWithSilence(e,o,s,a),e.samples=It.generateSampleTable(o),u=Ct.mdat(It.concatenateFrameData(o)),n=[],l=Ct.moof(i,[e]),d=new Uint8Array(l.byteLength+u.byteLength),i++,d.set(l),d.set(u,l.byteLength),Lt.clearDtsInfo(e),c=Math.ceil(1024*Bt/e.samplerate),o.length&&(h=o.length*c,this.trigger("segmentTimingInfo",Vt(Pt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:d}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Lt.clearDtsInfo(e),n=[],this.trigger("reset")}},St.prototype=new xt,At=function(e,t){var i,n,r,s=[],a=[];i=(t=t||{}).firstSequenceNumber||0,At.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Lt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],Ft.forEach((function(t){e[t]=n[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var n,r,o,l,u,d,c,h,p=0;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=kt.groupNalsIntoFrames(s),(o=kt.groupFramesIntoGops(n))[0][0].keyFrame||((r=this.getGopForFusion_(s[0],e))?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=kt.extendFirstKeyFrame(o)),a.length){var m;if(!(m=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Lt.clearDtsInfo(e),o=m}Lt.collectDtsInfo(e,o),e.samples=kt.generateSampleTable(o),u=Ct.mdat(kt.concatenateNalData(o)),e.baseMediaDecodeTime=Lt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),c=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Vt(e.baseMediaDecodeTime,c.dts,c.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=Ct.moof(i,[e]),d=new Uint8Array(l.byteLength+u.byteLength),i++,d.set(l),d.set(u,l.byteLength),this.trigger("data",{track:e,boxes:d}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),s=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){Lt.clearDtsInfo(e),n=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,s,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)r=(s=this.gopCache_[a]).gop,e.pps&&Ht(e.pps[0],s.pps[0])&&e.sps&&Ht(e.sps[0],s.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=s,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,s,o,l,u;for(s=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(n=a[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,s-=r.byteLength,o-=r.nalCount,l-=r.duration);return 0===i?e:i===e.length?null:((u=e.slice(i)).byteLength=s,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,i,n,r,s,o,l;for(t=a.length-1,i=e.length-1,s=null,o=!1;t>=0&&i>=0;){if(n=a[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===a.length-1&&(s=i),i--)}if(!o&&null===s)return null;if(0===(l=o?i:s))return e;var u=e.slice(l),d=u.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return u.byteLength=d.byteLength,u.duration=d.duration,u.nalCount=d.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){a=e}},At.prototype=new xt,Et=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Et.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},Et.prototype=new xt,Et.prototype.flush=function(e){var t,i,n,r,s=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Ft.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Ut.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,n=Ct.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(n.byteLength),a.initSegment.set(n),a.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)a.data.set(this.pendingBoxes[r],s),s+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=Pt.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Pt.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=Pt.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),r=0;r<a.captions.length;r++)t=a.captions[r],this.trigger("caption",t);for(r=0;r<a.metadata.length;r++)i=a.metadata[r],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Et.prototype.setRemux=function(e){this.remuxTracks=e},(wt=function(e){var t,i,n=this,r=!0;wt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new Ot.MetadataStream,r.aacStream=new Nt,r.audioTimestampRolloverStream=new Ot.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new Ot.TimestampRolloverStream("timed-metadata"),r.adtsStream=new Dt,r.coalesceStream=new Et(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(s){"timed-metadata"!==s.type&&"audio"!==s.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new St(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),qt(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new Ot.MetadataStream,r.packetStream=new Ot.TransportPacketStream,r.parseStream=new Ot.TransportParseStream,r.elementaryStream=new Ot.ElementaryStream,r.timestampRolloverStream=new Ot.TimestampRolloverStream,r.adtsStream=new Dt,r.h264Stream=new Mt,r.captionStream=new Ot.CaptionStream(e),r.coalesceStream=new Et(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(s){var a;if("metadata"===s.type){for(a=s.tracks.length;a--;)t||"video"!==s.tracks[a].type?i||"audio"!==s.tracks[a].type||((i=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new At(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new St(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),qt(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Lt.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Lt.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=Rt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new xt;var Xt,zt,Wt,Gt,Yt,Kt={Transmuxer:wt,VideoSegmentStream:At,AudioSegmentStream:St,AUDIO_PROPERTIES:Ut,VIDEO_PROPERTIES:Ft,generateSegmentTimingInfo:Vt},Jt=function(e){return e>>>0},Qt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Zt=Jt,$t=Qt,ei=function(e,t){var i,n,r,s,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Zt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=$t(e.subarray(i+4,i+8)),s=n>1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,s)):(a=ei(e.subarray(i+8,s),t.slice(1))).length&&(o=o.concat(a))),i=s;return o},ti=Jt,ii=X.getUint64,ni=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=ii(e.subarray(4)):t.baseMediaDecodeTime=ti(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ri=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},si=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],d=n.getUint32(4),c=8;for(r&&(i.dataOffset=n.getInt32(c),c+=4),s&&d&&(t={flags:ri(e.subarray(c,c+4))},c+=4,a&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t),d--);d--;)t={},a&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),l&&(t.flags=ri(e.subarray(c,c+4)),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t);return i},ai=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],s=2&n.flags[2],a=8&n.flags[2],o=16&n.flags[2],l=32&n.flags[2],u=65536&n.flags[0],d=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),s&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),u&&(n.durationIsEmpty=!0),!r&&d&&(n.baseDataOffsetIsMoof=!0),n},oi=(Xt="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},pe.discardEmulationPreventionBytes),li=Ce.CaptionStream,ui=ei,di=ni,ci=si,hi=ai,pi=Xt,mi=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},gi=function(e,t){var i=ui(e,["moof","traf"]),n=ui(e,["mdat"]),r={},s=[];return n.forEach((function(e,t){var n=i[t];s.push({mdat:e,traf:n})})),s.forEach((function(e){var i,n,s=e.mdat,a=e.traf,o=ui(a,["tfhd"]),l=hi(o[0]),u=l.trackId,d=ui(a,["tfdt"]),c=d.length>0?di(d[0]).baseMediaDecodeTime:0,h=ui(a,["trun"]);t===u&&h.length>0&&(i=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,s=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=ci(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=s),e.trackId=a,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof n?(e.pts=n+pi.BigInt(e.compositionTimeOffset),n+=pi.BigInt(e.duration)):(e.pts=n+e.compositionTimeOffset,n+=e.duration)})),o=o.concat(t)})),o}(h,c,l),n=function(e,t,i){var n,r,s,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=s)if(s=o.getUint32(r),r+=4,!(s<=0))switch(31&e[r]){case 6:var u=e.subarray(r+1,r+1+s),d=mi(r,t);if(n={nalUnitType:"sei_rbsp",size:s,data:u,escapedRBSP:oi(u),trackId:i},d)n.pts=d.pts,n.dts=d.dts,a=d;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+i+". See mux.js#223."});break}n.pts=a.pts,n.dts=a.dts}l.seiNals.push(n)}return l}(s,i,u),r[u]||(r[u]={seiNals:[],logs:[]}),r[u].seiNals=r[u].seiNals.concat(n.seiNals),r[u].logs=r[u].logs.concat(n.logs))})),r},fi=function(){var e,t,i,n,r,s,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new li,a=!0,s=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0})),e.on("log",(function(e){r.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,s,a){var o;if(!this.isInitialized())return null;if(!s||!a)return null;if(this.isNewInit(s,a))i=s[0],n=a[i];else if(null===i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,s,a)}return o=function(e,t,i){if(null===t)return null;var n=gi(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}}(e,i,n),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;s?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},yi=function(e){for(var t=0,i=String.fromCharCode(e[t]),n="";"\0"!==i;)n+=i,t++,i=String.fromCharCode(e[t]);return n+=i},vi=X.getUint64,bi=function(e,t){var i="\0"!==t.scheme_id_uri,n=0===e&&Ti(t.presentation_time_delta)&&i,r=1===e&&Ti(t.presentation_time)&&i;return!(e>1)&&n||r},Ti=function(e){return void 0!==e||null!==e},_i={parseEmsgBox:function(e){var t,i,n,r,s,a,o,l=4,u=e[0];if(0===u)l+=(t=yi(e.subarray(l))).length,l+=(i=yi(e.subarray(l))).length,n=(d=new DataView(e.buffer)).getUint32(l),l+=4,s=d.getUint32(l),l+=4,a=d.getUint32(l),l+=4,o=d.getUint32(l),l+=4;else if(1===u){var d;n=(d=new DataView(e.buffer)).getUint32(l),l+=4,r=vi(e.subarray(l)),l+=8,a=d.getUint32(l),l+=4,o=d.getUint32(l),l+=4,l+=(t=yi(e.subarray(l))).length,l+=(i=yi(e.subarray(l))).length}var c={scheme_id_uri:t,value:i,timescale:n||1,presentation_time:r,presentation_time_delta:s,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return bi(u,c)?c:void 0},scaleTime:function(e,t,i,n){return e||0===e?e/t:n+i/t}},Ai=Jt,Si=function(e){return("00"+e.toString(16)).slice(-2)},wi=ei,Ei=Qt,xi=_i,Ci=ai,ki=si,Ii=ni,Li=X.getUint64,Oi=Xt,Pi=Ve.parseId3Frames;zt=function(e,t){var i=wi(t,["moof","traf"]).reduce((function(t,i){var n,r=wi(i,["tfhd"])[0],s=Ai(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),a=e[s]||9e4,o=wi(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let u;return"bigint"==typeof(n=1===o[0]?Li(o.subarray(4,12)):l.getUint32(4))?u=n/Oi.BigInt(a):"number"!=typeof n||isNaN(n)||(u=n/a),u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),u<t&&(t=u),t}),1/0);return"bigint"==typeof i||isFinite(i)?i:0},Gt=function(e){var t=0===e[0]?12:20;return Ai(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Wt=function(e){var t=wi(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,r={},s=wi(e,["tkhd"])[0];s&&(n=(t=new DataView(s.buffer,s.byteOffset,s.byteLength)).getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var a=wi(e,["mdia","hdlr"])[0];if(a){var o=Ei(a.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var l=wi(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);r.codec=Ei(u.subarray(4,8));var d,c=wi(u,[r.codec])[0];c&&(/^[asm]vc[1-9]$/i.test(r.codec)?(d=c.subarray(78),"avcC"===Ei(d.subarray(4,8))&&d.length>11?(r.codec+=".",r.codec+=Si(d[9]),r.codec+=Si(d[10]),r.codec+=Si(d[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(d=c.subarray(28),"esds"===Ei(d.subarray(4,8))&&d.length>20&&0!==d[19]?(r.codec+="."+Si(d[19]),r.codec+="."+Si(d[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var h=wi(e,["mdia","mdhd"])[0];h&&(r.timescale=Gt(h)),i.push(r)})),i},Yt=function(e,t=0){return wi(e,["emsg"]).map((e=>{var i=xi.parseEmsgBox(new Uint8Array(e)),n=Pi(i.message_data);return{cueTime:xi.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:xi.scaleTime(i.event_duration,i.timescale),frames:n}}))};var Di=zt,Mi=Wt,Ni=Yt,Ri=ke,Bi=function(e){var t=31&e[1];return t<<=8,t|=e[2]},Ui=function(e){return!!(64&e[1])},Fi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},ji=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},qi={parseType:function(e,t){var i=Bi(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=Ui(e),i=4+Fi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Ui(e),n=4+Fi(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var s=12+((15&e[n+10])<<8|e[n+11]);s<r;){var a=n+s;t[(31&e[a+1])<<8|e[a+2]]=e[a],s+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:Ui,parsePesType:function(e,t){switch(t[Bi(e)]){case Ri.H264_STREAM_TYPE:return"video";case Ri.ADTS_STREAM_TYPE:return"audio";case Ri.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Ui(e))return null;var t=4+Fi(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+Fi(e),i=e.subarray(t),n=0,r=0,s=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===ji(31&i[r+3])&&(s=!0);do{n++}while(1!==i[n]&&n<i.length);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===ji(31&i[r+3])&&(s=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===ji(31&i[r+3])&&(s=!0),s}},Hi=ke,Vi=Me.handleRollover,Xi={};Xi.ts=qi,Xi.aac=Tt;var zi=oe.ONE_SECOND_IN_TS,Wi=188,Gi=71,Yi=function(e,t,i){for(var n,r,s,a,o=0,l=Wi,u=!1;l<=e.byteLength;)if(e[o]!==Gi||e[l]!==Gi&&l!==e.byteLength)o++,l++;else{if(n=e.subarray(o,l),"pes"===Xi.ts.parseType(n,t.pid))r=Xi.ts.parsePesType(n,t.table),s=Xi.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=Xi.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o+=Wi,l+=Wi}for(o=(l=e.byteLength)-Wi,u=!1;o>=0;)if(e[o]!==Gi||e[l]!==Gi&&l!==e.byteLength)o--,l--;else{if(n=e.subarray(o,l),"pes"===Xi.ts.parseType(n,t.pid))r=Xi.ts.parsePesType(n,t.table),s=Xi.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=Xi.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o-=Wi,l-=Wi}},Ki=function(e,t,i){for(var n,r,s,a,o,l,u,d=0,c=Wi,h=!1,p={data:[],size:0};c<e.byteLength;)if(e[d]!==Gi||e[c]!==Gi)d++,c++;else{if(n=e.subarray(d,c),"pes"===Xi.ts.parseType(n,t.pid))if(r=Xi.ts.parsePesType(n,t.table),s=Xi.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!h&&(a=Xi.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),h=!0),!i.firstKeyFrame)){if(s&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)u=p.data.shift(),o.set(u,l),l+=u.byteLength;if(Xi.ts.videoPacketContainsKeyFrame(o)){var m=Xi.ts.parsePesTime(o);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}p.size=0}p.data.push(n),p.size+=n.byteLength}if(h&&i.firstKeyFrame)break;d+=Wi,c+=Wi}for(d=(c=e.byteLength)-Wi,h=!1;d>=0;)if(e[d]!==Gi||e[c]!==Gi)d--,c--;else{if(n=e.subarray(d,c),"pes"===Xi.ts.parseType(n,t.pid))r=Xi.ts.parsePesType(n,t.table),s=Xi.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(a=Xi.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),h=!0);if(h)break;d-=Wi,c-=Wi}},Ji=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=Wi;r<e.byteLength;)if(e[n]!==Gi||e[r]!==Gi)n++,r++;else{switch(i=e.subarray(n,r),Xi.ts.parseType(i,t.pid)){case"pat":t.pid=Xi.ts.parsePat(i);break;case"pmt":var s=Xi.ts.parsePmt(i);t.table=t.table||{},Object.keys(s).forEach((function(e){t.table[e]=s[e]}))}n+=Wi,r+=Wi}}(e,t),t.table){if(t.table.hasOwnProperty(n))switch(t.table[n]){case Hi.H264_STREAM_TYPE:i.video=[],Ki(e,t,i),0===i.video.length&&delete i.video;break;case Hi.ADTS_STREAM_TYPE:i.audio=[],Yi(e,t,i),0===i.audio.length&&delete i.audio}}return i},Qi=function(e,t){var i;return i=Xi.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,s=null,a=0,o=0;e.length-o>=3;){switch(Xi.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=Xi.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=Xi.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=Xi.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=Xi.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===r||null===s)return null;var l=zi/r;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*l,pts:s+1024*n*l}]}}(e):Ji(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Vi(e.dts,i),e.pts=Vi(e.pts,i),e.dtsTime=e.dts/zi,e.ptsTime=e.pts/zi}))}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=Vi(e.dts,n),e.pts=Vi(e.pts,n),e.dtsTime=e.dts/zi,e.ptsTime=e.pts/zi})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=Vi(r.dts,n),r.pts=Vi(r.pts,n),r.dtsTime=r.dts/zi,r.ptsTime=r.pts/zi}}}(i,t),i):null};class Zi{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Kt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new fi,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Di(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Mi(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Ni(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!=typeof t||isNaN(t)?void 0:t*oe.ONE_SECOND_IN_TS,n=Qi(e,i);let r=null;n&&(r={hasVideo:n.video&&2===n.video.length||!1,hasAudio:n.audio&&2===n.audio.length||!1},r.hasVideo&&(r.videoStart=n.video[0].ptsTime),r.hasAudio&&(r.audioStart=n.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:r,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(oe.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(oe.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Zi(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Zi(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var sp=tp(rp);const ap=e=>{const{transmuxer:t,bytes:i,audioAppendStart:n,gopsToAlignWith:r,remux:s,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:d,onAudioSegmentTimingInfo:c,onId3:h,onCaptions:p,onDone:m,onEndedTimeline:g,onTransmuxerLog:f,isEndOfTimeline:y,segment:v,triggerSegmentEventFn:b}=e,T={buffer:[]};let _=y;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&((e,t,i)=>{const{type:n,initSegment:r,captions:s,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:s,captionStreams:a,metadata:o});const d=e.data.segment.boxes||{data:e.data.segment.data},c={type:n,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};void 0!==l&&(c.videoFrameDtsTime=l),void 0!==u&&(c.videoFramePtsTime=u),i(c)})(i,T,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(i,T),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&c(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,g()),"log"===i.data.action&&f(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:T,callback:m}),op(t))))},t.onerror=()=>{const e={message:"Received an error message from the transmuxer worker",metadata:{errorType:Oc.Error.StreamingFailedToTransmuxSegment,segmentInfo:em({segment:v})}};m(null,e)},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==s&&t.postMessage({action:"setRemux",remux:s}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,n=i instanceof ArrayBuffer?0:i.byteOffset;b({type:"segmenttransmuxingstart",segment:v}),t.postMessage({action:"push",data:e,byteOffset:n,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},op=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():ap(e.currentTransmux))},lp=(e,t)=>{e.postMessage({action:t}),op(e)},up=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void lp(t,e);t.transmuxQueue.push(lp.bind(null,t,e))},dp=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void ap(e);e.transmuxer.transmuxQueue.push(e)};var cp=e=>{up("reset",e)},hp=e=>{const t=new sp;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t};const pp=function(e){const t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=Wt({},e,{endAction:null,transmuxer:null,callback:null}),s=r=>{r.data.action===i&&(t.removeEventListener("message",s),r.data.data&&(r.data.data=new Uint8Array(r.data.data,e.byteOffset||0,e.byteLength||r.data.data.byteLength),e.data&&(e.data=r.data.data)),n(r.data))};if(t.addEventListener("message",s),e.data){const i=e.data instanceof ArrayBuffer;r.byteOffset=i?0:e.data.byteOffset,r.byteLength=e.data.byteLength;const n=[i?e.data:e.data.buffer];t.postMessage(r,n)}else t.postMessage(r)},mp=2,gp=-101,fp=-102,yp=e=>{e.forEach((e=>{e.abort()}))},vp=(e,t)=>{const{requestType:i}=t,n=_h({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:gp,xhr:t,metadata:n}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:fp,xhr:t,metadata:n}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:mp,xhr:t,metadata:n}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:mp,xhr:t,metadata:n}:null},bp=(e,t,i,n)=>(r,s)=>{const a=s.response,o=vp(r,s);if(o)return i(o,e);if(16!==a.byteLength)return i({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:mp,xhr:s},e);const l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=u;const d={uri:s.uri};return n({type:"segmentkeyloadcomplete",segment:e,keyInfo:d}),i(null,e)},Tp=(e,t)=>{const i=ha(e.map.bytes);if("mp4"!==i){const n=e.map.resolvedUri||e.map.uri,r=i||"unknown";return t({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${n}`,code:mp,metadata:{mediaType:r}})}pp({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,i.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null))})},_p=({segment:e,finishProcessingFn:t,responseType:i,triggerSegmentEventFn:n})=>(r,s)=>{const a=vp(r,s);if(a)return t(a,e);n({type:"segmentloaded",segment:e});const o="arraybuffer"!==i&&s.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(s.responseText.substring(e.lastReachedChar||0)):s.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(s),e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)},Ap=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{const m=e.map&&e.map.tracks||{},g=Boolean(m.audio&&m.video);let f=n.bind(null,e,"audio","start");const y=n.bind(null,e,"audio","end");let v=n.bind(null,e,"video","start");const b=n.bind(null,e,"video","end");pp({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:n=>{e.bytes=t=n.data;const m=n.result;m&&(i(e,{hasAudio:m.hasAudio,hasVideo:m.hasVideo,isMuxed:g}),i=null),dp({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:g,onData:t=>{t.type="combined"===t.type?"video":t.type,d(e,t)},onTrackInfo:t=>{i&&(g&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{f&&void 0!==e.start&&(f(e.start),f=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:e=>{v&&void 0!==e.start&&(v(e.start),v=null),b&&void 0!==e.end&&b(e.end)},onVideoSegmentTimingInfo:t=>{const i={pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),r(t)},onAudioSegmentTimingInfo:t=>{const i={pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),s(t)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:h,onDone:(t,i)=>{c&&(t.type="combined"===t.type?"video":t.type,p({type:"segmenttransmuxingcomplete",segment:e}),c(i,e,t))},segment:e,triggerSegmentEventFn:p})}})},Sp=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let m=new Uint8Array(t);if(function(e){return Ws(e,["moof"]).length>0}(m)){e.isFmp4=!0;const{tracks:r}=e.map,s={isFmp4:!0,hasVideo:!!r.video,hasAudio:!!r.audio};r.audio&&r.audio.codec&&"enca"!==r.audio.codec&&(s.audioCodec=r.audio.codec),r.video&&r.video.codec&&"encv"!==r.video.codec&&(s.videoCodec=r.video.codec),r.video&&r.audio&&(s.isMuxed=!0),i(e,s);const l=(t,i)=>{d(e,{data:m,type:s.hasAudio&&!s.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),c(null,e,{})};pp({action:"probeMp4StartTime",timescales:e.map.timescales,data:m,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=m=i,s.hasAudio&&!s.isMuxed&&n(e,"audio","start",a),s.hasVideo&&n(e,"video","start",a),pp({action:"probeEmsgID3",data:m,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:n})=>{t=i.buffer,e.bytes=m=i,r.video&&i.byteLength&&e.transmuxer?pp({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:m,timescales:e.map.timescales,trackIds:[r.video.id],callback:i=>{t=i.data.buffer,e.bytes=m=i.data,i.logs.forEach((function(e){h(Fc(e,{stream:"mp4CaptionParser"}))})),l(i.captions,n)}}):l(void 0,n)}})}})}else if(e.transmuxer){if(void 0===e.container&&(e.container=ha(m)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void c(null,e,{});Ap({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})}else c(null,e,{})},wp=function({id:e,key:t,encryptedBytes:i,decryptionWorker:n,segment:r,doneFn:s},a){const o=t=>{if(t.data.source===e){n.removeEventListener("message",o);const e=t.data.decrypted;a(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let l;n.onerror=()=>{const e="An error occurred in the decryption worker",t=em({segment:r}),i={message:e,metadata:{error:new Error(e),errorType:Oc.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};s(i,r)},n.addEventListener("message",o),l=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),n.postMessage(Bh({source:e,encrypted:i,key:l,iv:t.iv}),[i.buffer,l.buffer])},Ep=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let m=0,g=!1;return(f,y)=>{if(!g){if(f)return g=!0,yp(e),c(f,y);if(m+=1,m===e.length){const m=function(){if(y.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{p({type:"segmentdecryptionstart"}),wp({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:c},(e=>{t.bytes=e,p({type:"segmentdecryptioncomplete",segment:t}),Sp({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})}))})({decryptionWorker:t,segment:y,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p});Sp({segment:y,bytes:y.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return p({type:"segmentdecryptionstart",segment:y}),wp({decryptionWorker:t,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.key,segment:y,doneFn:c},(t=>{y.map.bytes=t,p({type:"segmentdecryptioncomplete",segment:y}),Tp(y,(t=>{if(t)return yp(e),c(t,y);m()}))}));m()}}}},xp=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d})=>i=>{if(!i.target.aborted)return e.stats=Fc(e.stats,(e=>{const t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)},Cp=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:r,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y})=>{const v=[],b=Ep({activeXhrs:v,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y});if(n.key&&!n.key.bytes){const i=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&i.push(n.map.key);const r=Fc(t,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),s=bp(n,i,b,y);y({type:"segmentkeyloadstart",segment:n,keyInfo:{uri:n.key.resolvedUri}});const a=e(r,s);v.push(a)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const i=Fc(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=bp(n,[n.map.key],b,y);y({type:"segmentkeyloadstart",segment:n,keyInfo:{uri:n.map.key.resolvedUri}});const s=e(i,r);v.push(s)}const i=Fc(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Dh(n.map),requestType:"segment-media-initialization"}),r=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:i})=>(n,r)=>{const s=vp(n,r);if(s)return t(s,e);const a=new Uint8Array(r.response);if(i({type:"segmentloaded",segment:e}),e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,Tp(e,(function(i){if(i)return i.xhr=r,i.status=r.status,t(i,e);t(null,e)}))})({segment:n,finishProcessingFn:b,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:n});const s=e(i,r);v.push(s)}const T=Fc(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Dh(n),requestType:"segment"}),_=_p({segment:n,finishProcessingFn:b,responseType:T.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:n});const A=e(T,_);A.addEventListener("progress",xp({segment:n,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m})),v.push(A);const S={};return v.forEach((e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:S,abortFn:r}))})),()=>yp(v)},kp=Uc("CodecUtils"),Ip=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},Lp=function(e){const t={};return e.forEach((({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(ci(`${i}${n}`))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return kp(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},Op=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Pp=function(e,t){const i=t.attributes||{},n=Lp(function(e){const t=e.attributes||{};if(t.CODECS)return hi(t.CODECS)}(t)||[]);if(Ip(e,t)&&!n.audio&&!((e,t)=>{if(!Ip(e,t))return!0;const i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(const e in n)if(!n[e].uri&&!n[e].playlists)return!0;return!1})(e,t)){const t=Lp(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return hi(r.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(n.audio=t.audio)}return n},Dp=Uc("PlaylistSelector"),Mp=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},Np=function(e,t){if(!e)return"";const i=Me.getComputedStyle(e);return i?i[t]:""},Rp=function(e,t){const i=e.slice();e.sort((function(e,n){const r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Bp=function(e,t){let i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||Me.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||Me.Number.MAX_VALUE,i-n};let Up=function(e,t,i,n,r,s){if(!e)return;const a={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r};let o=e.playlists;ph.isAudioOnly(e)&&(o=s.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map((e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||Me.Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}}));Rp(l,((e,t)=>e.bandwidth-t.bandwidth)),l=l.filter((e=>!ph.isIncompatible(e.playlist)));let u=l.filter((e=>ph.isEnabled(e.playlist)));u.length||(u=l.filter((e=>!ph.isDisabled(e.playlist))));const d=u.filter((e=>e.bandwidth*$h.BANDWIDTH_VARIANCE<t));let c=d[d.length-1];const h=d.filter((e=>e.bandwidth===c.bandwidth))[0];if(!1===r){const e=h||u[0]||l[0];if(e&&e.playlist){let t="sortedPlaylistReps";return h&&(t="bandwidthBestRep"),u[0]&&(t="enabledPlaylistReps"),Dp(`choosing ${Mp(e)} using ${t} with options`,a),e.playlist}return Dp("could not choose a playlist with options",a),null}const p=d.filter((e=>e.width&&e.height));Rp(p,((e,t)=>e.width-t.width));const m=p.filter((e=>e.width===i&&e.height===n));c=m[m.length-1];const g=m.filter((e=>e.bandwidth===c.bandwidth))[0];let f,y,v,b;if(g||(f=p.filter((e=>e.width>i||e.height>n)),y=f.filter((e=>e.width===f[0].width&&e.height===f[0].height)),c=y[y.length-1],v=y.filter((e=>e.bandwidth===c.bandwidth))[0]),s.leastPixelDiffSelector){const e=p.map((e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e)));Rp(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),b=e[0]}const T=b||v||g||h||u[0]||l[0];if(T&&T.playlist){let e="sortedPlaylistReps";return b?e="leastPixelDiffRep":v?e="resolutionPlusOneRep":g?e="resolutionBestRep":h?e="bandwidthBestRep":u[0]&&(e="enabledPlaylistReps"),Dp(`choosing ${Mp(T)} using ${e} with options`,a),T.playlist}return Dp("could not choose a playlist with options",a),null};const Fp=function(){let e=this.useDevicePixelRatio&&Me.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),Up(this.playlists.main,this.systemBandwidth,parseInt(Np(this.tech_.el(),"width"),10)*e,parseInt(Np(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};function jp(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const qp=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(!t)return;const r=Me.WebKitDataCue||Me.VTTCue,s=e.metadataTrack_;if(!s)return;if(t.forEach((e=>{const t=e.cueTime+i;!("number"!=typeof t||Me.isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach((e=>{const i=new r(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(Oc.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(Oc.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(Oc.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(i),s.addCue(i)}))})),!s.cues||!s.cues.length)return;const a=s.cues,o=[];for(let e=0;e<a.length;e++)a[e]&&o.push(a[e]);const l=o.reduce(((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),u=Object.keys(l).sort(((e,t)=>Number(e)-Number(t)));u.forEach(((e,t)=>{const i=l[e],r=isFinite(n)?n:e,s=Number(u[t+1])||r;i.forEach((e=>{e.endTime=s}))}))},Hp={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},Vp=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Xp=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Oc.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},zp=function(e,t,i){let n,r;if(i&&i.cues)for(n=i.cues.length;n--;)r=i.cues[n],r.startTime>=e&&r.endTime<=t&&i.removeCue(r)},Wp=e=>"number"==typeof e&&isFinite(e),Gp=1/60,Yp=e=>{const{startOfSegment:t,duration:i,segment:n,part:r,playlist:{mediaSequence:s,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:d}=e,c=o.length-1;let h="mediaIndex/partIndex increment";e.getMediaInfoForTime?h=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(h="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(h+=` with independent ${e.independent}`);const p="number"==typeof u,m=e.segment.uri?"segment":"pre-segment",g=p?$c({preloadSegment:n})-1:0;return`${m} [${s+l}/${s+c}]`+(p?` part [${u}/${g}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(p?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${d}]`+` selected by [${h}]`+` playlist [${a}]`},Kp=e=>`${e}TimingInfo`,Jp=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:n,audioDisabled:r})=>{if(t===i)return!1;if("audio"===n){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===n&&r){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},Qp=e=>{const t=e.pendingSegment_;if(!t)return;if(Jp({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;const t=e.pendingTimelineChange({type:"audio"}),i=e.pendingTimelineChange({type:"main"}),n=t&&i,r=n&&t.to!==i.to;return!(!n||-1===t.from||-1===i.from||!r)})(e.timelineChangeController_)){if((e=>{const t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&i&&t.to<i.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");(e=>{e&&(e.pause(),e.resetEverything(),e.load())})(e)}},Zp=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+qc,$p=(e,t)=>{if("hls"!==t)return null;const i=(e=>{let t=0;return["video","audio"].forEach((function(i){const n=e[`${i}TimingInfo`];if(!n)return;const{start:r,end:s}=n;let a;"bigint"==typeof r||"bigint"==typeof s?a=Me.BigInt(s)-Me.BigInt(r):"number"==typeof r&&"number"==typeof s&&(a=s-r),void 0!==a&&a>t&&(t=a)})),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const n=e.playlist.targetDuration,r=Zp({segmentDuration:i,maxDuration:2*n}),s=Zp({segmentDuration:i,maxDuration:n}),a=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||s?{severity:r?"warn":"info",message:a}:null},em=({type:e,segment:t})=>{if(!t)return;const i=Boolean(t.key||t.map&&t.map.ke),n=Boolean(t.map&&!t.map.bytes),r=void 0===t.startOfSegment?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:r,duration:t.duration,isEncrypted:i,isMediaInitialization:n}};class tm extends Oc.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=Uc(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qp(this)})),this.sourceUpdater_.on("codecschange",(e=>{this.trigger(Wt({type:"codecschange"},e))})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qp(this)})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(e=>{this.trigger(Wt({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Qp(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qp(this)}))}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return hp({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&Me.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,Me.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&cp(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return jc();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:n}=e;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Uh(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e}segmentKey(e,t=!1){if(!e)return null;const i=Fh(e);let n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});const r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_(`playlist update [${r} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Yc(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){if(null!==this.mediaIndex){!e.endList&&"number"==typeof e.partTargetDuration?this.resetLoader():this.resyncLoader()}return this.currentMediaInfo_=void 0,void this.trigger("playlistupdate")}const s=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${s}]`),null!==this.mediaIndex)if(this.mediaIndex-=s,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}n&&(n.mediaIndex-=s,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(Me.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&cp(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"===this.sourceType_&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=(()=>{}),n=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let r=1;const s=()=>{r--,0===r&&i()};!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,s)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,n)=>{const r=Math.ceil((t-n)*ma),s=Math.ceil((i-n)*ma),a=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=s););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,s));for(const i in this.inbandTextTracks_)zp(e,t,this.inbandTextTracks_[i]);zp(e,t,this.segmentMetadataTrack_),s()}monitorBuffer_(){this.checkBufferTimeout_&&Me.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Me.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&Me.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Me.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:em({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,s=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&s}chooseNextRequest_(){const e=this.buffered_(),t=Yc(e)||0,i=Kc(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),s=this.playlist_.segments;if(!s.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];const n=[];let r=0;for(let s=0;s<t.length;s++){const a=t[s];if(e===a.timeline&&(n.push(s),r+=a.duration,r>i))return s}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,s,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){const e=s[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,n;const r=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${r}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(r);if(!t){const e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:Oc.Error.StreamingFailedToSelectNextSegment,error:new Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,n=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=ph.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:r,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,n=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${r}`:`currentTime ${r}`,a.mediaIndex=e,a.startOfSegment=n,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=s[a.mediaIndex];let l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);const u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!u&&!l.independent)if(0===a.partIndex){const e=s[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const d=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=s.length-1&&d&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const n=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return n?(n.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),n):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:n,startOfSegment:r,isSyncRequest:s,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,u=i.segments[n],d="number"==typeof a&&u.parts[a],c={requestId:"segment-loader-"+Math.random(),uri:d&&d.resolvedUri||u.resolvedUri,mediaIndex:n,partIndex:d?a:null,isSyncRequest:s,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:d&&d.duration||u.duration,segment:u,part:d,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});const p=Yc(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(c.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];const n=Math.ceil((t-i+3)*ma);let r;for(r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,overrideCheck:r})=>r||e!==t?e<t?i:n.length?n.end(n.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=ph.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),s=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(r<=s)return;const a=function(e){const{main:t,currentTime:i,bandwidth:n,duration:r,segmentDuration:s,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=t.playlists.filter((e=>!ph.isIncompatible(e)));let d=u.filter(ph.isEnabled);d.length||(d=u.filter((e=>!ph.isDisabled(e))));const c=d.filter(ph.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=l.getSyncPoint(e,r,o,i)?1:2;return{playlist:e,rebufferingImpact:ph.estimateSegmentRequestTime(s,n,e)*t-a}})),h=c.filter((e=>e.rebufferingImpact<=0));return Rp(h,((e,t)=>Bp(t.playlist,e.playlist))),h.length?h[0]:(Rp(c,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),c[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=r-s-a.rebufferingImpact;let l=.5;s<=qc&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*$h.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Yp(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:n}=t,r={segmentInfo:em({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:n}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:r}),this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(let r=0;r<i.length;r++){const s=i[r];if(s!==n[r])return!1;if(e[s]!==t[s])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qp(this)))}handleTimingInfo_(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const r=this.pendingSegment_,s=Kp(t);r[s]=r[s]||{},r[s][i]=n,this.logger_(`timinginfo: ${t} - ${i} - ${n}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qp(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach((e=>{n[e.stream]=n[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=n[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)})),Object.keys(n).forEach((e=>{const{startTime:t,endTime:r,captions:s}=n[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${r} for ${e}`),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);const r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{let r=i,s=i,a=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];o&&(r=o.label,s=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:a,label:r,language:s},!1).track}}}(a,this.vhs_.tech_,e),zp(t,r,a[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const n=Me.WebKitDataCue||Me.VTTCue;t.forEach((t=>{const r=t.stream;t.content?t.content.forEach((s=>{const a=new n(t.startTime+i,t.endTime+i,s.text);a.line=s.line,a.align="left",a.position=s.position,a.positionAlign="line-left",e[r].addCue(a)})):e[r].addCue(new n(t.startTime+i,t.endTime+i,t.text))}))}({captionArray:s,inbandTextTracks:a,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))}processMetadataQueue_(){this.metadataQueue_.id3.forEach((e=>e())),this.metadataQueue_.caption.forEach((e=>e())),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach((e=>e()))}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach((e=>e()))}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Jp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:n,isMuxed:r}=t;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Jp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Qp(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[Kp(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let n;t&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:n}){if(i){const e=Uh(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){const r=this.sourceUpdater_.audioBuffered(),s=this.sourceUpdater_.videoBuffered();r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Gc(r).join(", ")),s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Gc(s).join(", "));const a=r.length?r.start(0):0,o=r.length?r.end(r.length-1):0,l=s.length?s.start(0):0,u=s.length?s.end(s.length-1):0;if(o-a<=1&&u-l<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Gc(r).join(", ")}, video buffer: ${Gc(s).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const d=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`),this.remove(0,d,(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=Me.setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()}),1e3)}),!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},n){n&&(22!==n.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Oc.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:r}){if(!r){const e=[n];let t=n.byteLength;i&&(e.unshift(i),t+=i.byteLength),r=(e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((e=>{t.set(e,i),i+=e.byteLength}))),t})({bytes:t,segments:e})}const s={segmentInfo:em({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:s}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:r},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:r}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const n=this.pendingSegment_.segment,r=`${e}TimingInfo`;n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:n}=t;if(!n||!n.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Qp(this),void this.loadQueue_.push((()=>{const t=Wt({},e,{forceTimestampOffset:!0});Wt(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}));this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),n=null!==this.mediaIndex,r=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||n&&r;this.logger_(`Requesting\n${jp(e.uri)}\n${Yp(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Cp({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:n})=>{this.logger_(`${Yp(e)} logged from transmuxer stream ${n} as a ${i}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:n,timingInfo:r})=>{const s={segmentInfo:em({segment:t})};i&&(s.keyInfo=i),n&&(s.trackInfo=n),r&&(s.timingInfo=r),this.trigger({type:e,metadata:s})}})}trimBackBuffer_(e){const t=((e,t,i)=>{let n=t-$h.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));const r=t-i;return Math.min(r,n)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,n=e.segment.key||e.segment.map&&e.segment.map.key,r=e.segment.map&&!e.segment.map.bytes,s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:n,isMediaInitialization:r},a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline&&(a.videoTimingInfo?s.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd:a.audioTimingInfo&&(s.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key),s.key.iv=i}return t.map&&(s.map=this.initSegmentForMap(t.map)),s}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Gp)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`);const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===fp)return;return this.pause(),e.code===gp?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const n=t[0].pts;let r=0;for(;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:n,currentVideoTimestampOffset:r,useVideoTimingInfo:s,videoTimingInfo:a,audioTimingInfo:o}){if(void 0!==e)return e;if(!s)return o.start;const l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===n+r?a.start:n}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:i,hasVideo:n,isMuxed:r}=t,s="main"===this.loaderType_&&n,a=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);s&&e.waitingOnAppends++,a&&e.waitingOnAppends++,s&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const e={segmentInfo:em({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=$p(e,this.sourceType_);if(t&&("warn"===t.severity?Oc.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${Yp(e)}`);this.logger_(`Appended ${Yp(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,n=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,s=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||s)return this.logger_(`bad ${r?"segment":"part"} ${Yp(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Gp)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,n=t.end;if(!Wp(i)||!Wp(n))return;zp(i,n,this.segmentMetadataTrack_);const r=Me.WebKitDataCue||Me.VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},a=new r(i,n,JSON.stringify(s));a.value=s,this.segmentMetadataTrack_.addCue(a)}}function im(){}const nm=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},rm=["video","audio"],sm=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},am=(e,t)=>{if(0===t.queue.length)return;let i=0,n=t.queue[i];if("mediaSource"!==n.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!sm(e,t)){if(n.type!==e){if(i=((e,t)=>{for(let i=0;i<t.length;i++){const n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null})(e,t.queue),null===i)return;n=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=n,n.action(e,t),n.doneFn?void 0:(t.queuePending[e]=null,void am(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),am("audio",t),am("video",t))},om=(e,t)=>{const i=t[`${e}Buffer`],n=nm(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},lm=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),um=(e,t,i)=>(n,r)=>{const s=r[`${n}Buffer`];if(lm(r.mediaSource,s)){r.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${n}Buffer`);try{s.appendBuffer(e)}catch(e){r.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${n}Buffer`),r.queuePending[n]=null,i(e)}}},dm=(e,t)=>(i,n)=>{const r=n[`${i}Buffer`];if(lm(n.mediaSource,r)){n.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{r.remove(e,t)}catch(r){n.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},cm=e=>(t,i)=>{const n=i[`${t}Buffer`];lm(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),n.timestampOffset=e)},hm=e=>(t,i)=>{e()},pm=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){Oc.log.warn("Failed to call media source endOfStream",e)}}},mm=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){Oc.log.warn("Failed to set media source duration",e)}},gm=()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(lm(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){Oc.log.warn(`Failed to abort on ${e}Buffer`,t)}}},fm=(e,t)=>i=>{const n=nm(e),r=mi(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const s=i.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",i[`on${n}UpdateEnd_`]),s.addEventListener("error",i[`on${n}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=s},ym=e=>t=>{const i=t[`${e}Buffer`];if(om(e,t),lm(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){Oc.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},vm=e=>(t,i)=>{const n=i[`${t}Buffer`],r=mi(e);if(!lm(i.mediaSource,n))return;const s=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))===s)return;const o={codecsChangeInfo:{from:a,to:e}};i.trigger({type:"codecschange",metadata:o}),i.logger_(`changing ${t}Buffer codec from ${a} to ${e}`);try{n.changeType(r),i.codecs[t]=e}catch(e){o.errorType=Oc.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,i.error_=e,i.trigger("error"),Oc.log.warn(`Failed to changeType on ${t}Buffer`,e)}},bm=({type:e,sourceUpdater:t,action:i,doneFn:n,name:r})=>{t.queue.push({type:e,action:i,doneFn:n,name:r}),am(e,t)},Tm=(e,t)=>i=>{const n=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const n=e.start(i),r=e.end(i);t+=`${n} --\x3e ${r}. Duration (${r-n})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,n),t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}am(e,t)};class _m extends Oc.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>am("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Uc("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Tm("video",this),this.onAudioUpdateEnd_=Tm("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){bm({type:"mediaSource",sourceUpdater:this,action:fm(e,t),name:"addSourceBuffer"})}abort(e){bm({type:e,sourceUpdater:this,action:gm(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?bm({type:"mediaSource",sourceUpdater:this,action:ym(e),name:"removeSourceBuffer"}):Oc.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!Oc.browser.IS_FIREFOX&&Me.MediaSource&&Me.MediaSource.prototype&&"function"==typeof Me.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return Me.SourceBuffer&&Me.SourceBuffer.prototype&&"function"==typeof Me.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?bm({type:e,sourceUpdater:this,action:vm(t),name:"changeType"}):Oc.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)}))}appendBuffer(e,t){const{segmentInfo:i,type:n,bytes:r}=e;if(this.processedAppend_=!0,"audio"===n&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${r.length} until video append`);if(bm({type:n,sourceUpdater:this,action:um(r,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===n){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach((e=>{this.appendBuffer.apply(this,e)}))}}audioBuffered(){return lm(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:jc()}videoBuffered(){return lm(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:jc()}buffered(){const e=lm(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=lm(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let i=null,n=null,r=0;const s=[],a=[];if(!(e&&e.length&&t&&t.length))return jc();let o=e.length;for(;o--;)s.push({time:e.start(o),type:"start"}),s.push({time:e.end(o),type:"end"});for(o=t.length;o--;)s.push({time:t.start(o),type:"start"}),s.push({time:t.end(o),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),o=0;o<s.length;o++)"start"===s[o].type?(r++,2===r&&(i=s[o].time)):"end"===s[o].type&&(r--,1===r&&(n=s[o].time)),null!==i&&null!==n&&(a.push([i,n]),i=null,n=null);return jc(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=im){bm({type:"mediaSource",sourceUpdater:this,action:mm(e),name:"duration",doneFn:t})}endOfStream(e=null,t=im){"string"!=typeof e&&(e=void 0),bm({type:"mediaSource",sourceUpdater:this,action:pm(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=im){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?bm({type:"audio",sourceUpdater:this,action:dm(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=im){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?bm({type:"video",sourceUpdater:this,action:dm(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!sm("audio",this)&&!sm("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(bm({type:"audio",sourceUpdater:this,action:cm(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(bm({type:"video",sourceUpdater:this,action:cm(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&bm({type:"audio",sourceUpdater:this,action:hm(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&bm({type:"video",sourceUpdater:this,action:hm(e),name:"callback"})}dispose(){this.trigger("dispose"),rm.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>om(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Am=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Sm=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class wm extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Em extends tm{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return jc();const e=this.subtitlesTrack_.cues;return jc([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Uh(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const t=Sm.byteLength+e.bytes.byteLength,r=new Uint8Array(t);r.set(e.bytes),r.set(Sm,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:r}}return n||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){zp(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===gp&&this.handleTimeout_(),e.code===fp?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const r=n.segment;if(r.map&&(r.map.bytes=t.map.bytes),n.bytes=t.bytes,"function"!=typeof Me.WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((()=>this.segmentRequestFinished_(e,t,i)),(()=>this.stopForError({message:"Error loading vtt.js"})));r.requested=!0;try{this.parseVTTCues_(n)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:Oc.Error.StreamingVttParserError,error:e}})}if(this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.cues.length?n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}:n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration},n.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,n.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new Me.VTTCue(e.startTime,e.endTime,e.text):e)})),function(e){const t=e.cues;if(!t)return;const i={};for(let n=t.length-1;n>=0;n--){const r=t[n],s=`${r.startTime}-${r.endTime}-${r.text}`;i[s]?e.removeCue(r):i[s]=r}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if("function"!=typeof Me.WebVTT)throw new wm;"function"==typeof Me.TextDecoder?t=new Me.TextDecoder("utf8"):(t=Me.WebVTT.StringDecoder(),i=!0);const n=new Me.WebVTT.Parser(Me,Me.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{Oc.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=Am(t)),n.parse(t)}let r=e.bytes;i&&(r=Am(r)),n.parse(r),n.flush()}updateTimeMapping_(e,t,i){const n=e.segment;if(!t)return;if(!e.cues.length)return void(n.empty=!0);const{MPEGTS:r,LOCAL:s}=e.timestampmap,a=r/ma-s+t.mapping;if(e.cues.forEach((e=>{const i=e.endTime-e.startTime,n=this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(n,0),e.endTime=Math.max(n+i,0)})),!i.syncInfo){const t=e.cues[0].startTime,r=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,r-n.duration)}}}handleRollover_(e,t){if(null===t)return e;let i=e*ma;const n=t*ma;let r;for(r=n<i?-8589934592:8589934592;Math.abs(i-n)>4294967296;)i+=r;return i/ma}}const xm=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const n=i[e];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null};class Cm{constructor({start:e,end:t,segmentIndex:i,partIndex:n=null,appended:r=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=n,this.appended_=r}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class km{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach((e=>e.resetAppendedStatus()))}}class Im{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach((e=>e.resetAppendStatus()))}update(e,t){const{mediaSequence:i,segments:n}=e;if(this.isReliable_=this.isReliablePlaylist_(i,n),this.isReliable_)return this.updateStorage_(n,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const n=new Map;let r="\n",s=i,a=t;this.start_=s,e.forEach(((e,t)=>{const i=this.storage_.get(a),o=s,l=o+e.duration,u=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),d=new Cm({start:o,end:l,appended:u,segmentIndex:t});e.syncInfo=d;let c=s;const h=(e.parts||[]).map(((e,n)=>{const s=c,o=c+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[n]&&i.partsSyncInfo[n].isAppended),u=new Cm({start:s,end:o,appended:l,segmentIndex:t,partIndex:n});return c=o,r+=`Media Sequence: ${a}.${n} | Range: ${s} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=u,u}));n.set(a,new km(d,h)),r+=`${jp(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${u}\n`,a++,s=l})),this.end_=s,this.storage_=n,this.diagnostics_=r}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class Lm extends Im{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const Om=[{name:"VOD",run:(e,t,i,n,r)=>{if(i!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"MediaSequence",run:(e,t,i,n,r,s)=>{const a=e.getMediaSequenceSync(s);if(!a)return null;if(!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,n,r)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let s=null,a=null;const o=Qc(t);r=r||0;for(let i=0;i<o.length;i++){const n=o[t.endList||0===r?i:o.length-(i+1)],l=n.segment,u=e.timelineToDatetimeMappings[l.timeline];if(!u||!l.dateTimeObject)continue;let d=l.dateTimeObject.getTime()/1e3+u;if(l.parts&&"number"==typeof n.partIndex)for(let e=0;e<n.partIndex;e++)d+=l.parts[e].duration;const c=Math.abs(r-d);if(null!==a&&(0===c||a<c))break;a=c,s={time:d,segmentIndex:n.segmentIndex,partIndex:n.partIndex}}return s}},{name:"Segment",run:(e,t,i,n,r)=>{let s=null,a=null;r=r||0;const o=Qc(t);for(let e=0;e<o.length;e++){const i=o[t.endList||0===r?e:o.length-(e+1)],l=i.segment,u=i.part&&i.part.start||l&&l.start;if(l.timeline===n&&void 0!==u){const e=Math.abs(r-u);if(null!==a&&a<e)break;(!s||null===a||a>=e)&&(a=e,s={time:u,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return s}},{name:"Discontinuity",run:(e,t,i,n,r)=>{let s=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let n=0;n<t.discontinuityStarts.length;n++){const a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,l=e.discontinuities[o];if(l){const e=Math.abs(r-l.time);if(null!==i&&i<e)break;(!s||null===i||i>=e)&&(i=e,s={time:l.time,segmentIndex:a,partIndex:null})}}}return s}},{name:"Playlist",run:(e,t,i,n,r)=>{if(t.syncInfo){return{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}];class Pm extends Oc.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Im,i=new Lm(t),n=new Lm(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:n},this.logger_=Uc("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,n,r){if(t!==1/0){return Om.find((({name:e})=>"VOD"===e)).run(this,e,t)}const s=this.runStrategies_(e,t,i,n,r);if(!s.length)return null;for(const t of s){const{syncPoint:i,strategy:r}=t,{segmentIndex:s,time:a}=i;if(s<0)continue;const o=a,l=o+e.segments[s].duration;if(this.logger_(`Strategy: ${r}. Current time: ${n}. selected segment: ${s}. Time: [${o} -> ${l}]}`),n>=o&&n<l)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(s,{key:"time",value:n})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+nh({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,n,r){const s=[];for(let a=0;a<Om.length;a++){const o=Om[a],l=o.run(this,e,t,i,n,r);l&&(l.strategy=o.name,s.push({strategy:o.name,syncPoint:l}))}return s}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy;for(let s=1;s<e.length;s++){const a=Math.abs(e[s].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[s].syncPoint,r=e[s].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${r}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>86400)Oc.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let n=i-1;n>=0;n--){const i=e.segments[n];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),n=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start}));const r=n.dateTimeObject;n.discontinuity&&t&&r&&(this.timelineToDatetimeMappings[n.timeline]=-r.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const n=e.segment,r=e.part;let s,a,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),s=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;s=t.start+o.mapping,a=t.end+o.mapping}return r&&(r.start=s,r.end=a),(!n.start||s<n.start)&&(n.start=s),n.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let n=0;n<t.discontinuityStarts.length;n++){const r=t.discontinuityStarts[n],s=t.discontinuitySequence+n+1,a=r-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>o){let n;n=a<0?i.start-nh({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+nh({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[s]={time:n,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class Dm extends Oc.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if("number"==typeof t&&"number"==typeof i){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const n={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:n})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Mm=ip(np((function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();
27
+ /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */let t=null;class i{constructor(e){let i,n,r;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4];let s,a,o;const l=[],u=[];let d,c,h,p,m,g;for(s=0;s<256;s++)u[(l[s]=s<<1^283*(s>>7))^s]=s;for(a=o=0;!n[a];a^=d||1,o=u[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,n[a]=p,r[p]=a,h=l[c=l[d=l[a]]],g=16843009*h^65537*c^257*d^16843008*a,m=257*l[p]^16843008*p,s=0;s<4;s++)t[s][a]=m=m<<24^m>>>8,i[s][p]=g=g<<24^g>>>8;for(s=0;s<5;s++)t[s]=t[s].slice(0),i[s]=i[s].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const s=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const u=e.slice(0),d=[];for(this._key=[u,d],i=o;i<4*o+28;i++)r=u[i-1],(i%o==0||8===o&&i%o==4)&&(r=s[r>>>24]<<24^s[r>>16&255]<<16^s[r>>8&255]<<8^s[255&r],i%o==0&&(r=r<<8^r>>>24^l<<24,l=l<<1^283*(l>>7))),u[i]=u[i-o]^r;for(n=0;i;n++,i--)r=u[3&n?i:i-4],d[n]=i<=4||n<4?r:a[0][s[r>>>24]]^a[1][s[r>>16&255]]^a[2][s[r>>8&255]]^a[3][s[255&r]]}decrypt(e,t,i,n,r,s){const a=this._key[1];let o,l,u,d=e^a[0],c=n^a[1],h=i^a[2],p=t^a[3];const m=a.length/4-2;let g,f=4;const y=this._tables[1],v=y[0],b=y[1],T=y[2],_=y[3],A=y[4];for(g=0;g<m;g++)o=v[d>>>24]^b[c>>16&255]^T[h>>8&255]^_[255&p]^a[f],l=v[c>>>24]^b[h>>16&255]^T[p>>8&255]^_[255&d]^a[f+1],u=v[h>>>24]^b[p>>16&255]^T[d>>8&255]^_[255&c]^a[f+2],p=v[p>>>24]^b[d>>16&255]^T[c>>8&255]^_[255&h]^a[f+3],f+=4,d=o,c=l,h=u;for(g=0;g<4;g++)r[(3&-g)+s]=A[d>>>24]<<24^A[c>>16&255]<<16^A[h>>8&255]<<8^A[255&p]^a[f++],o=d,d=c,c=h,h=p,p=o}}class n extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const r=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class s{constructor(e,t,i,a){const o=s.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength);let d=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),t,i,u)),d=o;d<l.length;d+=o)i=new Uint32Array([r(l[d-4]),r(l[d-3]),r(l[d-2]),r(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),t,i,u));this.asyncStream_.push((function(){var e;
28
+ /*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */a(null,(e=u).subarray(0,e.byteLength-e[e.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(e,t,n,s){return function(){const a=function(e,t,n){const s=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),l=new Int32Array(o.buffer);let u,d,c,h,p,m,g,f,y;for(u=n[0],d=n[1],c=n[2],h=n[3],y=0;y<s.length;y+=4)p=r(s[y]),m=r(s[y+1]),g=r(s[y+2]),f=r(s[y+3]),a.decrypt(p,m,g,f,l,y),l[y]=r(l[y]^u),l[y+1]=r(l[y+1]^d),l[y+2]=r(l[y+2]^c),l[y+3]=r(l[y+3]^h),u=p,d=m,c=g,h=f;return o}(e,t,n);s.set(a,e.byteOffset)}}}var a,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};a="undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{};var l=a.BigInt||Number;l("0x1"),l("0x100"),l("0x10000"),l("0x1000000"),l("0x100000000"),l("0x10000000000"),l("0x1000000000000"),l("0x100000000000000"),l("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();const u=function(e){const t={};return Object.keys(e).forEach((i=>{const n=e[i];var r;r=n,("function"===ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t};self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new s(i,n,r,(function(e,i){self.postMessage(u({source:t.source,decrypted:i}),[i.buffer])}))}})));var Nm=tp(Mm);const Rm=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Bm=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Um=(e,t)=>{t.activePlaylistLoader=e,e.load()},Fm={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:i},excludePlaylist:n}=t,r=i.activeTrack(),s=i.activeGroup(),a=(s.filter((e=>e.default))[0]||s[0]).id,o=i.tracks[a];if(r!==o){Oc.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}else n({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:i}}=t;Oc.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},jm={AUDIO:(e,t,i)=>{if(!t)return;const{tech:n,requestOptions:r,segmentLoaders:{[e]:s}}=i;t.on("loadedmetadata",(()=>{const e=t.media();s.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(()=>{s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",Fm[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:n,requestOptions:r,segmentLoaders:{[e]:s},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",(()=>{const e=t.media();s.playlist(e,r),s.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(()=>{s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",Fm[e](e,i))}},qm={AUDIO:(e,t)=>{const{vhs:i,sourceType:n,segmentLoaders:{[e]:r},requestOptions:s,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:d}=t,c=hh(d.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},c&&(a[e].main.default.playlists=d.main.playlists));for(const r in a[e]){o[r]||(o[r]=[]);for(const h in a[e][r]){let p,m=a[e][r][h];if(c?(u(`AUDIO group '${r}' label '${h}' is a main playlist`),m.isMainPlaylist=!0,p=null):p="vhs-json"===n&&m.playlists?new Lh(m.playlists[0],i,s):m.resolvedUri?new Lh(m.resolvedUri,i,s):m.playlists&&"dash"===n?new Zh(m.playlists[0],i,s,d):null,m=Fc({id:h,playlistLoader:p},m),jm[e](e,m.playlistLoader,t),o[r].push(m),void 0===l[h]){const e=new Oc.AudioTrack({id:h,kind:Rm(m),enabled:!1,language:m.language,default:m.default,label:h});l[h]=e}}}r.on("error",Fm[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:n,sourceType:r,segmentLoaders:{[e]:s},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:d}=t;for(const s in o[e]){l[s]||(l[s]=[]);for(const c in o[e][s]){if(!n.options_.useForcedSubtitles&&o[e][s][c].forced)continue;let h,p=o[e][s][c];if("hls"===r)h=new Lh(p.resolvedUri,n,a);else if("dash"===r){if(!p.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;h=new Zh(p.playlists[0],n,a,d)}else"vhs-json"===r&&(h=new Lh(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=Fc({id:c,playlistLoader:h},p),jm[e](e,p.playlistLoader,t),l[s].push(p),void 0===u[c]){const e=i.addRemoteTextTrack({id:c,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:c},!1).track;u[c]=e}}}s.on("error",Fm[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[e]:{groups:r,tracks:s}}}=t;for(const t in n[e]){r[t]||(r[t]=[]);for(const a in n[e][t]){const o=n[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let u={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[u.instreamId]&&(u=Fc(u,l[u.instreamId])),void 0===u.default&&delete u.default,r[t].push(Fc({id:a},o)),void 0===s[a]){const e=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;s[a]=e}}}}},Hm=(e,t)=>{for(let i=0;i<e.length;i++){if(dh(t,e[i]))return!0;if(e[i].playlists&&Hm(e[i].playlists,t))return!0}return!1},Vm={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}},Xm=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{qm[t](t,e)}));const{mediaTypes:t,mainPlaylistLoader:i,tech:n,vhs:r,segmentLoaders:{AUDIO:s,main:a}}=e;["AUDIO","SUBTITLES"].forEach((i=>{t[i].activeGroup=((e,t)=>i=>{const{mainPlaylistLoader:n,mediaTypes:{[e]:{groups:r}}}=t,s=n.media();if(!s)return null;let a=null;s.attributes[e]&&(a=r[s.attributes[e]]);const o=Object.keys(r);if(!a)if("AUDIO"===e&&o.length>1&&hh(t.main))for(let e=0;e<o.length;e++){const t=r[o[e]];if(Hm(t,s)){a=t;break}}else r.main?a=r.main:1===o.length&&(a=r[o[0]]);return void 0===i?a:null!==i&&a&&a.filter((e=>e.id===i.id))[0]||null})(i,e),t[i].activeTrack=Vm[i](i,e),t[i].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:i,main:n},mediaTypes:{[e]:r}}=t,s=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;a&&l&&a.id===l.id||(r.lastGroup_=a,r.lastTrack_=s,Bm(i,r),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),Um(a.playlistLoader,r)):o&&n.resetEverything()))})(i,e),t[i].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:n}}=t;n.lastGroup_=null,i.abort(),i.pause()})(i,e),t[i].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:s}}=t,a=s.activeTrack(),o=s.getActiveGroup(),l=s.activePlaylistLoader,u=s.lastTrack_;if((!u||!a||u.id!==a.id)&&(s.lastGroup_=o,s.lastTrack_=a,Bm(n,s),o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const e=t.vhs.playlistController_,n=e.selectPlaylist();if(e.media()===n)return;return s.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),i.pause(),r.resetEverything(),void e.fastQualityChange_(n)}if("AUDIO"===e){if(!o.playlistLoader)return r.setAudio(!0),void r.resetEverything();n.setAudio(!0),r.setAudio(!1)}l!==o.playlistLoader?(n.track&&n.track(a),n.resetEverything(),Um(o.playlistLoader,s)):Um(o.playlistLoader,s)}})(i,e),t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)}));const o=t.AUDIO.activeGroup();if(o){const e=(o.filter((e=>e.default))[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),s.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanged()))})),i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanging()))}));const l=()=>{t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",l),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(()=>{n.audioTracks().removeEventListener("change",l),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio");for(const e in t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[e])};class zm{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Rc(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map((e=>[e.ID,e]))))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class Wm extends Oc.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new zm,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Uc("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=Rc(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const n={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:n}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},((e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){const i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}let r;this.trigger({type:"contentsteeringloadcomplete",metadata:n});try{r=JSON.parse(this.request_.responseText)}catch(e){const t={errorType:Oc.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:"error",metadata:t})}this.assignSteeringProperties_(r);const s={contentSteeringInfo:n.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:s}),this.startTTLTimeout_()}))}setProxyServerUrl_(e){const t=new Me.URL(e),i=new Me.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(Me.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new Me.URL(e),i=this.getPathway(),n=this.getBandwidth_();if(i){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(n){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,n)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=Me.setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){Me.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new zm}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Rc(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let Gm;const Ym=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Km=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class Jm extends Oc.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:n,bandwidth:r,externVhs:s,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:u,cacheEncryptionKeys:d,bufferBasedABR:c,leastPixelDiffSelector:h,captionServices:p,experimentalUseMMS:m}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:g}=e;null==g&&(g=1/0),Gm=s,this.bufferBasedABR=Boolean(c),this.leastPixelDiffSelector=Boolean(h),this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.player_=e.player_,this.sourceType_=u,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=g,this.enableLowInitialPlaylist=l,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:g,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:im,activeTrack:im,getActiveGroup:im,onGroupChanged:im,onTrackChanged:im,lastTrack_:null,logger_:Uc(`MediaGroups[${t}]`)}})),e})(),m&&Me.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new Me.ManagedMediaSource,Oc.log("Using ManagedMediaSource")):Me.MediaSource&&(this.mediaSource=new Me.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=jc(),this.hasPlayed_=!1,this.syncController_=new Pm(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Nm,this.sourceUpdater_=new _m(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Dm,this.keyStatusMap_=new Map;const f={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new Zh(t,this.vhs_,Fc(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Lh(t,this.vhs_,Fc(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new tm(Fc(f,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new tm(Fc(f,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Em(Fc(f,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((e,t)=>{function i(){n.off("vttjserror",r),e()}function r(){n.off("vttjsloaded",i),t()}n.one("vttjsloaded",i),n.one("vttjserror",r),n.addWebVttScript_()}))}),e);this.contentSteeringController_=new Wm(this.vhs_.xhr,(()=>this.mainSegmentLoader_.bandwidth)),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),Ym.forEach((e=>{this[e+"_"]=Km.bind(this,e)})),this.logger_=Uc("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,(()=>{const e=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const n=this.media(),r=n&&(n.id||n.uri),s=e&&(e.id||e.uri);if(r&&r!==s){this.logger_(`switch media ${r} -> ${s} from ${t}`);const i={renditionInfo:{id:s,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:i}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,n=this.contentSteeringController_.getPathway();if(i&&n){const t=(i.length?i[0].playlists:i.playlists).filter((e=>e.attributes.serviceLocation===n));t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}}))}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=Me.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Me.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,n=Object.keys(i);let r;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)r=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||n.length&&i[n[0]];for(const t in e)if(e[t].default){r={label:t};break}}if(!r)return t;const s=[];for(const t in i)if(i[t][r.label]){const n=i[t][r.label];if(n.playlists&&n.playlists.length)s.push.apply(s,n.playlists);else if(n.uri)s.push(n);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const n=e.playlists[i];n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===t&&s.push(n)}}return s.length?s:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;uh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Xm({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial");if(!("vhs-json"===this.sourceType_&&this.initialMedia_.segments))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)})),this.mainPlaylistLoader_.on("error",(()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()})),this.mainPlaylistLoader_.on("mediachange",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;uh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const e=this.mainPlaylistLoader_.media();if("playlist-unchanged"===e.lastExcludeReason_)return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))})),this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})})),this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}));["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach((e=>{this.mainPlaylistLoader_.on(e,(e=>{this.player_.trigger(Wt({},e))}))}))}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let n=!0;const r=Object.keys(i.AUDIO);for(const e in i.AUDIO)for(const t in i.AUDIO[e]){i.AUDIO[e][t].uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Gm.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:n,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:a,bufferBasedABR:o,log:l}){if(!n)return Oc.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${e&&e.id||"null"} -> ${n.id}`;if(!e)return l(`${u} as current playlist is not set`),!0;if(n.id===e.id)return!1;const d=Boolean(Xc(t,i).length);if(!e.endList)return d||"number"!=typeof e.partTargetDuration?(l(`${u} as current playlist is live`),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const c=Kc(t,i),h=o?$h.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:$h.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${u} as duration < max low water line (${a} < ${h})`),!0;const p=n.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!o||c<s)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${m})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${c} < ${s})`),l(e),!0}if((!o||p>m)&&c>=r){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${c} >= ${r})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),l(e),!0}return l(`not ${u} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()})),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")})),this.mainSegmentLoader_.on("error",(()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended"),this.onEndOfStream()})),this.timelineChangeController_.on("audioTimelineBehind",(()=>{const e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;const t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)})),this.mainSegmentLoader_.on("earlyabort",(e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))}));const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}));["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach((e=>{this.mainSegmentLoader_.on(e,(e=>{this.player_.trigger(Wt({},e))})),this.audioSegmentLoader_.on(e,(e=>{this.player_.trigger(Wt({},e))})),this.subtitleSegmentLoader_.on(e,(e=>{this.player_.trigger(Wt({},e))}))}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything((()=>{this.mainSegmentLoader_.load()}))}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let n=i;if(e.start){const r=e.start.timeOffset;n=r<0?Math.max(i+r,t.start(0)):Math.min(i,r)}this.trigger("firstplay"),this.tech_.setCurrentTime(n)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(e=>{}))}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const i=Gm.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-n<=Hc;const s=r.end(r.length-1);return s-n<=Hc&&i-s<=Hc}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists,r=n.filter(oh),s=1===r.length&&r[0]===e;if(1===n.length&&i!==1/0)return Oc.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(t)}),i)}let t=!1;n.forEach((i=>{if(i===e)return;const n=i.excludeUntil;void 0!==n&&n!==1/0&&(t=!0,delete i.excludeUntil)})),t&&(Oc.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:Oc.log.warn,u=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${u} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const d=o.targetDuration/2*1e3||5e3,c="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=d;return this.switchMedia_(o,"exclude",s||c)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],n="all"===e;(n||"main"===e)&&i.push(this.mainPlaylistLoader_);const r=[];(n||"audio"===e)&&r.push("AUDIO"),(n||"subtitle"===e)&&(r.push("CLOSED-CAPTIONS"),r.push("SUBTITLES")),r.forEach((e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)})),["main","audio","subtitle"].forEach((t=>{const n=this[`${t}SegmentLoader_`];!n||e!==t&&"all"!==e||i.push(n)})),i.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]()}))))}setCurrentTime(e){const t=Xc(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Gm.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const n=this.mainPlaylistLoader_.main,r=Gm.Playlist.seekable(t,i,Gm.Playlist.liveEdgeDelay(n,t));if(0===r.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=Gm.Playlist.seekable(t,i,Gm.Playlist.liveEdgeDelay(n,t)),0===e.length)return}let s,a;if(this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=jc([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===s&&this.seekable_.start(0)===a)return;this.logger_(`seekable updated [${Wc(this.seekable_)}]`);const o={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:o}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=Gm.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach((e=>{e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=Pp(this.main(),t),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(n.video+=`,${i.audio||e.main.audioCodec||yi}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||yi,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!n.audio&&!n.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const s={};let a;if(["video","audio"].forEach((function(t){if(n.hasOwnProperty(t)&&(i=e[t].isFmp4,r=n[t],!(i?gi(r):fi(r)))){const i=e[t].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[t]),"audio"===t&&(a=i)}var i,r})),r&&a&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach((i=>{(i.attributes&&i.attributes.AUDIO)===e&&i!==t&&(i.excludeUntil=1/0)})),this.logger_(`excluding audio group ${e} as ${a} does not support codec(s): "${n.audio}"`)}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const i=(hi(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(hi(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${n[t]}"`)})),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return n}{const e=Object.keys(s).reduce(((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${s[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach((i=>{const n=e[i];if(-1!==t.indexOf(n.id))return;t.push(n.id);const r=Pp(this.main,n),s=[];!r.audio||fi(r.audio)||gi(r.audio)||s.push(`audio codec ${r.audio}`),!r.video||fi(r.video)||gi(r.video)||s.push(`video codec ${r.video}`),r.text&&"stpp.ttml.im1t"===r.text&&s.push(`text codec ${r.text}`),s.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id} for unsupported: ${s.join(", ")}`))}))}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,n=Lp(hi(e)),r=Op(n),s=n.video&&hi(n.video)[0]||null,a=n.audio&&hi(n.audio)[0]||null;Object.keys(i).forEach((e=>{const n=i[e];if(-1!==t.indexOf(n.id)||n.excludeUntil===1/0)return;t.push(n.id);const o=[],l=Pp(this.mainPlaylistLoader_.main,n),u=Op(l);if(l.audio||l.video){if(u!==r&&o.push(`codec count "${u}" !== "${r}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&hi(l.video)[0]||null,t=l.audio&&hi(l.audio)[0]||null;e&&s&&e.type.toLowerCase()!==s.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${s.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id}: ${o.join(" && ")}`))}}))}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i=0){if(!e.segments)return;let n,r=i;for(let i=0;i<e.segments.length;i++){const s=e.segments[i];if(n||(n=xm(t,r+s.duration/2)),n){if("cueIn"in s){n.endTime=r,n.adEndTime=r,r+=s.duration,n=null;continue}if(r<n.endTime){r+=s.duration;continue}n.endTime+=s.duration}else if("cueOut"in s&&(n=new Me.VTTCue(r,r+s.duration,s.cueOut),n.adStartTime=r,n.adEndTime=r+parseFloat(s.cueOut),t.addCue(n)),"cueOutCont"in s){const[e,i]=s.cueOutCont.split("/").map(parseFloat);n=new Me.VTTCue(r,r+s.duration,""),n.adStartTime=r-e,n.adEndTime=n.adStartTime+i,t.addCue(n)}r+=s.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=$h.GOAL_BUFFER_LENGTH,i=$h.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,$h.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=$h.BUFFER_LOW_WATER_LINE,i=$h.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,$h.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,$h.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?r:n)}bufferHighWaterLine(){return $h.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Xp(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const n=Me.WebKitDataCue||Me.VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(Vp.has(t))continue;const r=new n(e.startTime,e.endTime,"");r.id=e.id,r.type="com.apple.quicktime.HLS",r.value={key:Hp[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(r.value.data=new Uint8Array(r.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(r)}e.processDateRange()}))})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const n=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Xp(this.inbandTextTracks_,e,this.tech_),qp({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach((e=>{this.contentSteeringController_.on(e,(e=>{this.trigger(Wt({},e))}))})),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const n of e.playlists){const e=n.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()}))}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let n=!1;Object.keys(t).forEach((r=>{const s=t[r],a=this.pathwayAttribute_(s),o=a&&e!==a;s.excludeUntil===1/0&&"content-steering"===s.lastExcludeReason_&&!o&&(delete s.excludeUntil,delete s.lastExcludeReason_,n=!0);const l=!s.excludeUntil&&s.excludeUntil!==1/0;!i.has(s.id)&&o&&l&&(i.add(s.id),s.excludeUntil=1/0,s.lastExcludeReason_="content-steering",this.logger_(`excluding ${s.id} for ${s.lastExcludeReason_}`))})),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((t=>{const i=this.mediaTypes_[t];if(i.activePlaylistLoader){const t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(n=!0)}})),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[e,n]of t.entries()){i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(e))}for(const[n,r]of i.entries()){const i=t.get(n);if(i)this.equalPathwayClones_(i,r)||(this.mainPlaylistLoader_.updateOrDeleteClone(r,!0),this.contentSteeringController_.addAvailablePathway(n));else{e.filter((e=>e.attributes["PATHWAY-ID"]===r["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(r,e)})),this.contentSteeringController_.addAvailablePathway(n)}}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,n=t["URI-REPLACEMENT"].PARAMS;for(const e in i)if(i[e]!==n[e])return!1;for(const e in n)if(i[e]!==n[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((i=>{const n=this.mainPlaylistLoader_.getKeyIdSet(i);n&&n.size&&n.forEach((n=>{const r="usable",s=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===r,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;s?s&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${r}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${r}`)),e++)}))})),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach((e=>{const i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,n=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&n&&(delete e.excludeUntil,Oc.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))}))}addKeyStatus_(e,t){const i=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map((e=>e.toString(16).padStart(2,"0"))).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class Qm{constructor(e,t,i){const{playlistController_:n}=e,r=n.fastQualityChange_.bind(n);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var s,a,o;this.codecs=Pp(n.main(),t),this.playlist=t,this.id=i,this.enabled=(s=e.playlists,a=t.id,o=r,e=>{const t=s.main.playlists[a],i=ah(t),n=oh(t);if(void 0===e)return n;e?delete t.disabled:t.disabled=!0;const r={renditionInfo:{id:a,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};return e===n||i||(o(t),e?s.trigger({type:"renditionenabled",metadata:r}):s.trigger({type:"renditiondisabled",metadata:r})),e})}}const Zm=["seeking","seeked","pause","playing","error"];class $m extends Oc.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Uc("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),s=this.playlistController_,a=["main","subtitle","audio"],o={};a.forEach((e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},s[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend),s[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)}));const l=e=>{["main","audio"].forEach((t=>{s[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",n),this.tech_.on(Zm,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",n),this.tech_.off(Zm,r),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach((e=>{s[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend),s[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)})),this.checkCurrentTimeTimeout_&&Me.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Me.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Me.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[`${e}Buffered_`],n);if(this[`${e}Buffered_`]=n,r){const i={bufferedRanges:n};return t.trigger({type:"bufferedrangeschanged",metadata:i}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Gc(n)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Hc>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(jc([this.lastRecordedTime,e]));const t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)){i=e.end(e.length-1)}if(this.beforeSeekableWindow_(e,t)){const t=e.start(0);i=t+(t===e.end(0)?0:Hc)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Wc(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const n=this.playlistController_.sourceUpdater_,r=this.tech_.buffered(),s=n.audioBuffer?n.audioBuffered():null,a=n.videoBuffer?n.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-qc),u=[s,a];for(let e=0;e<u.length;e++){if(!u[e])continue;if(Kc(u[e],t)<l)return!1}const d=zc(r,t);return 0!==d.length&&(i=d.start(0)+Hc,this.logger_(`Buffered region starts (${d.start(0)}) just beyond seek point (${t}). Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Xc(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,n=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const r=zc(n,t);return r.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${r.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let r=e.end(e.length-1)+Hc;const s=!i.endList,a="number"==typeof i.partTargetDuration;return s&&(a||n)&&(r=e.end(e.length-1)+3*i.targetDuration),t>r}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let n;if(e.length&&t.length){const r=Xc(e,i-3),s=Xc(e,i),a=Xc(t,i);a.length&&!s.length&&r.length&&(n={start:r.end(0),end:a.end(0)})}else{zc(e,i).length||(n=this.gapFromVideoUnderflow_(e,i))}return!!n&&(this.logger_(`Encountered a gap in video from ${n.start} to ${n.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),n=zc(t,i);if(this.resetTimeUpdate_(),0===n.length||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+qc);const r={gapInfo:{from:i,to:n.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:r}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=function(e){if(e.length<2)return jc();const t=[];for(let i=1;i<e.length;i++){const n=e.end(i-1),r=e.start(i);t.push([n,r])}return jc(t)}(e);for(let e=0;e<i.length;e++){const n=i.start(e),r=i.end(e);if(t-n<4&&t-n>2)return{start:n,end:r}}return null}}const eg={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},tg=function(e,t){let i=0,n=0;const r=Fc(eg,t);e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const s=function(){n&&e.currentTime(n)},a=function(t){null!=t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",s),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*r.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&"function"==typeof r.getSource)return i=Date.now(),r.getSource.call(e,a);Oc.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",s),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),tg(e,t)}},ig=function(e){tg(this,e)};var ng="3.15.0";const rg={PlaylistLoader:Lh,Playlist:ph,utils:qh,STANDARD_PLAYLIST_SELECTOR:Fp,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(ph.isEnabled);Rp(e,((e,t)=>Bp(e,t)));return e.filter((e=>!!Pp(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:Fp,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&Me.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Up(this.playlists.main,t,parseInt(Np(this.tech_.el(),"width"),10)*n,parseInt(Np(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:Bp,comparePlaylistResolution:function(e,t){let i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||Me.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||Me.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Ph()};Object.keys($h).forEach((e=>{Object.defineProperty(rg,e,{get:()=>(Oc.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),$h[e]),set(t){Oc.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?Oc.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):$h[e]=t}})}));const sg="videojs-vhs",ag=function(e,t){const i=t.media();let n=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){n=t;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};rg.canPlaySource=function(){return Oc.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const og=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:n})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const r=((e,t)=>e.reduce(((e,i)=>{if(!i.contentProtection)return e;const n=t.reduce(((e,t)=>{const n=i.contentProtection[t];return n&&n.pssh&&(e[t]={pssh:n.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[]))(i?n.concat([i]):n,Object.keys(t)),s=[],a=[];return r.forEach((t=>{a.push(new Promise(((t,i)=>{e.tech_.one("keysessioncreated",t)}))),s.push(new Promise(((i,n)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?n(e):i()}))})))})),Promise.race([Promise.all(s),Promise.race(a)])},lg=({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>{const r=((e,t,i)=>{if(!e)return e;let n={};t&&t.attributes&&t.attributes.CODECS&&(n=Lp(hi(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const r=mi(n.video),s=mi(n.audio),a={};for(const i in e)a[i]={},s&&(a[i].audioContentType=s),r&&(a[i].videoContentType=r),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return Fc(e,a)})(t,i,n);return!!r&&(e.currentSource().keySystems=r,!(r&&!e.eme)||(Oc.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},ug=()=>{if(!Me.localStorage)return null;const e=Me.localStorage.getItem(sg);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},dg=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},cg=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},hg=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},pg=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};rg.supportsNativeHls=function(){if(!Ue||!Ue.createElement)return!1;const e=Ue.createElement("video");if(!Oc.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),rg.supportsNativeDash=!!(Ue&&Ue.createElement&&Oc.getTech("Html5").isSupported())&&/maybe|probably/i.test(Ue.createElement("video").canPlayType("application/dash+xml")),rg.supportsTypeNatively=e=>"hls"===e?rg.supportsNativeHls:"dash"===e&&rg.supportsNativeDash,rg.isSupported=function(){return Oc.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},rg.xhr.onRequest=function(e){dg(rg.xhr,e)},rg.xhr.onResponse=function(e){cg(rg.xhr,e)},rg.xhr.offRequest=function(e){hg(rg.xhr,e)},rg.xhr.offResponse=function(e){pg(rg.xhr,e)};const mg=Oc.getComponent("Component");class gg extends mg{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Uc("VhsHandler"),t.options_&&t.options_.playerId){const e=Oc.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(Ue,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=Ue.fullscreenElement||Ue.webkitFullscreenElement||Ue.mozFullScreenElement||Ue.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Fc(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=ug();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=$h.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===$h.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=rg,this.options_.sourceType=Ti(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new Jm(this.options_);const n=Fc({liveRangeSafeTimeDelta:Hc},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new $m(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",(()=>{const e=Oc.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));const r=this.options_.bufferBasedABR?rg.movingAverageBandwidthSelector(.55):rg.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=rg.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=Me.navigator.connection||Me.navigator.mozConnection||Me.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const n=1e3*t.downlink*1e3;e=n>=i&&e>=i?Math.max(e,n):n}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;t=this.throughput>0?1/this.throughput:0;return Math.floor(1/(e+t))},set(){Oc.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Gc(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Gc(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",(()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!Me.localStorage)return!1;let t=ug();t=t?Fc(t,e):e;try{Me.localStorage.setItem(sg,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),i=hh(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((e=>!ah(e))).map(((t,i)=>new Qm(e,t,t.id))):[]}})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=Me.URL.createObjectURL(this.playlistController_.mediaSource),(Oc.browser.IS_ANY_SAFARI||Oc.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),og({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()})).catch((e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=lg({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=Oc.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{!function(e,t){t.representations().forEach((t=>{e.addQualityLevel(t)})),ag(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{ag(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":ng,"mux.js":"7.0.3","mpd-parser":"1.3.1","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return _m.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&Me.URL.revokeObjectURL&&(Me.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Hh({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return Vh({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{dg(this.xhr,e)},this.xhr.onResponse=e=>{cg(this.xhr,e)},this.xhr.offRequest=e=>{hg(this.xhr,e)},this.xhr.offResponse=e=>{pg(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach((e=>{this.playlistController_.on(e,(e=>{this.player_.trigger(Wt({},e))}))})),["gapjumped","playedrangeschanged"].forEach((e=>{this.playbackWatcher_.on(e,(e=>{this.player_.trigger(Wt({},e))}))}))}}const fg={name:"videojs-http-streaming",VERSION:ng,canHandleSource(e,t={}){const i=Fc(Oc.options,t);return!(!i.vhs.experimentalUseMMS&&!gi("avc1.4d400d,mp4a.40.2",!1))&&fg.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=Fc(Oc.options,i);return t.vhs=new gg(e,t,n),t.vhs.xhr=Ph(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=Ti(e);if(!i)return"";const n=fg.getOverrideNative(t);return!rg.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!(Oc.browser.IS_ANY_SAFARI||Oc.browser.IS_IOS),{overrideNative:n=i}=t;return n}};function yg(e,t){var i=Hg(jg(t.uri));if(!i)return console.warn("XLR >> VideoMedia: Unsupported video type for media ".concat(t.id," with uri ").concat(t.uri)),e;if(0===e.querySelectorAll('source[type="'.concat(i,'"]')).length){var n=document.createElement("source");n.src=t.url,n.type=i,e.insertBefore(n,e.lastElementChild)}return e}gi("avc1.4d400d,mp4a.40.2",!0)&&Oc.getTech("Html5").registerSourceHandler(fg,0),Oc.VhsHandler=gg,Oc.VhsSourceHandler=fg,Oc.Vhs=rg,Oc.use||Oc.registerComponent("Vhs",rg),Oc.options.vhs=Oc.options.vhs||{},Oc.getPlugin&&Oc.getPlugin("reloadSourceOnError")||Oc.registerPlugin("reloadSourceOnError",ig);var vg={autoplay:!1,muted:!0,preload:"auto",controls:!1},bg=function(e){return r({controls:!1,preload:"auto",autoplay:!1,muted:!0},e)},Tg=[e.ConsumerPlatform.CHROMEOS,e.ConsumerPlatform.ELECTRON];function _g(t,i){var n,r=!1,a=Dg(t),o=function(){void 0!==n&&(clearTimeout(n),n=void 0)},u=function(e,n){r||(Tg.includes(i.config.platform)?af(e,t,n).then((function(){return d.stop()})):d.stop())},d={player:void 0,duration:0,init:function(){var i=this,c=!1;d.duration=t.duration;var h=Oc(a);if(h){d.player=h;var p=Hg(jg(t.uri));if(!p)return console.warn("XLR >> VideoMedia: unrecognised file extension for media ".concat(t.id," (uri: ").concat(t.uri,")")),void u("Unsupported video file extension for media ".concat(t.id),e.FaultCodes.FaultVideoSource);if(""===document.createElement("video").canPlayType(p))return console.warn('XLR >> VideoMedia: browser cannot play type "'.concat(p,'" for media ').concat(t.id)),void u('Browser cannot play video type "'.concat(p,'" for media ').concat(t.id),e.FaultCodes.FaultVideoSource);var m=function(){o(),n=setTimeout((function(){r||(console.warn("XLR >> VideoMedia: stall timeout on media ".concat(t.id)),u("Video stall timeout",e.FaultCodes.FaultVideoUnexpected))}),1e4)};h.on("waiting",m),h.on("stalled",m),h.on("playing",o),h.on("ended",o),h.on("loadedmetadata",(function(){0===t.duration&&(d.duration=h.duration()),console.debug("??? XLR.debug >> VideoMedia: loadedmetadata: Setting video duration to = "+d.duration)})),h.on("canplay",(function(){console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," can be played . . ."))})),h.on("playing",(function(){0===d.duration&&(d.duration=h.duration()),console.debug("??? XLR.debug >> VideoMedia: playing: Showing Media "+t.id+" for "+d.duration+"s of Region "+t.region.regionId),console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," is now playing . . ."))})),h.ready((function(){var i=document.querySelector(".media--item.".concat(a));document.body.contains(i)?void 0!==h&&(h.muted(!0),Promise.race([new Promise((function(e,i){return setTimeout(l(s().mark((function n(){return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," : Trying to force play after 0.1 seconds")),n.prev=1,0!==h.currentTime()){n.next=6;break}return h.muted(t.muted),n.next=6,h.play();case 6:e(!0),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(1),i("Play failed");case 12:case"end":return n.stop()}}),n,null,[[1,9]])}))),100)})),new Promise((function(e,t){return setTimeout((function(){return t("Timeout")}),5e3)}))]).then((function(){console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," : Autoplay started"))})).catch((function(i){r||("Timeout"===i?(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," : Promise not resolved within 5 seconds. Move to next media")),d.stop()):(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," : Autoplay error: ").concat(i)),u("Media autoplay error",e.FaultCodes.FaultVideoUnexpected)))})),h.on("loadstart",(function(){console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," has started loading data . . .")),c=!1})),0===t.duration&&h.on("timeupdate",(function(){var e=h.duration(),i=h.currentTime(),n=0;void 0!==e&&void 0!==i&&(n=1e3*(e-i)),t.region.totalMediaObjects>1&&!c&&(0===n||n<=2e3)&&(console.log("Less than preloadBufferTimeMs remaining! Do something now."),t.region.prepareNextMedia(),c=!0),n>2e3&&(c=!1)}))):t.emitter.emit("cancelled",t)})),h.on("error",(function(){if(!r){o();var i=h.error(),n=i?"Video error (code ".concat(i.code,"): ").concat(i.message):"Unknown video error";console.warn("XLR >> VideoMedia: error on media ".concat(t.id),i),u(n,e.FaultCodes.FaultVideoUnexpected)}})),0===t.duration&&h.on("ended",(function(){console.debug("??? XLR.debug >> VideoMedia: onended: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," has ended playing . . .")),i.stop()}))}},stop:function(){var e,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];o();var n=null!==(e=d.player)&&void 0!==e?e:t.player;console.debug("??? XLR.debug >> VideoMedia::stop",{vjsPlayer:n,isDisposed:null==n?void 0:n.isDisposed(),el:null==n?void 0:n.el()}),void 0===n||n.isDisposed()?(d.player=void 0,t.player=void 0,t.html=null,i||t.emitter.emit("end",t)):(i||t.emitter.emit("end",t),n.dispose(),d.player=void 0,t.player=void 0,t.html=null),r=!0},play:function(){var e,n=this,r=Oc(a);void 0!==r&&(null===(e=r.play())||void 0===e||e.catch(function(){var e=l(s().mark((function e(r){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"Timeout"===r?(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," : Promise not resolved within 5 seconds. Move to next media")),n.stop()):(console.debug("??? XLR.debug >> VideoMedia: ".concat(Mg(t.mediaType)," for media > ").concat(t.id," : Autoplay error: ").concat(r)),Tg.includes(i.config.platform)&&af("Media autoplay error",t).then((function(){n.stop()})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()))}};return d}var Ag,Sg=function(e,t){return{keyframes:[{display:"in"===t?"none":"block"},{display:"out"===t?"none":"block"}],timing:{duration:e}}},wg=function(e){return{keyframes:[{opacity:0},{opacity:1}],timing:{duration:e,fill:"forwards"}}},Eg=function(e){return{keyframes:[{opacity:1},{opacity:0,zIndex:-1}],timing:{duration:e,fill:"forwards"}}},xg=function(e,t,i){var n=[{opacity:0},{opacity:1,zIndex:1}],s={duration:e,fill:"forwards"};return t&&Boolean(t.from)&&(n[0]=r(r({},t.from),n[0])),t&&Boolean(t.to)&&(n[1]=r(r({},t.to),n[1])),{keyframes:n,timing:s}},Cg=function(e,t,i){var n=[{opacity:1},{opacity:0,zIndex:-1}],s={duration:e,fill:"forwards"};return t&&Boolean(t.from)&&(n[0]=r(r({},t.from),n[0])),t&&Boolean(t.to)&&(n[1]=r(r({},t.to),n[1])),{keyframes:n,timing:s}},kg=function(e,t){return{fadeIn:wg(t.duration),fadeOut:Eg(t.duration),flyIn:xg(t.duration,t.keyframes,t.direction),flyOut:Cg(t.duration,t.keyframes,t.direction),defaultIn:Sg(t.duration,"in"),defaultOut:Sg(t.duration,"out")}[e]},Ig=function(e){var t={from:{},to:{}},i=function(t){return"from"===t?"in"===e.trans?0:1:"out"===e.trans?1:0};switch(e.direction){case"N":default:t.from={opacity:i("from"),top:"in"===e.trans?"".concat(e.height,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"-".concat(e.height,"px")};break;case"NE":t.from={opacity:i("from"),top:"in"===e.trans?"".concat(e.height,"px"):0,left:"in"===e.trans?"-".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"-".concat(e.height,"px"),left:"in"===e.trans?0:"".concat(e.width,"px")};break;case"E":t.from={opacity:i("from"),left:"in"===e.trans?"-".concat(e.width,"px"):0},t.to={opacity:i("to"),left:"in"===e.trans?0:"".concat(e.width,"px")};break;case"SE":t.from={opacity:i("from"),top:"in"===e.trans?"-".concat(e.height,"px"):0,left:"in"===e.trans?"-".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"".concat(e.height,"px"),left:"in"===e.trans?0:"".concat(e.width,"px")};break;case"S":t.from={opacity:i("from"),top:"in"===e.trans?"-".concat(e.height,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"".concat(e.height,"px")};break;case"SW":t.from={opacity:i("from"),top:"in"===e.trans?"-".concat(e.height,"px"):0,left:"in"===e.trans?"".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"".concat(e.height,"px"),left:"in"===e.trans?0:"-".concat(e.width,"px")};break;case"W":t.from={opacity:i("from"),left:"in"===e.trans?"".concat(e.width,"px"):0},t.to={opacity:i("to"),left:"in"===e.trans?0:"-".concat(e.width,"px")};break;case"NW":t.from={opacity:i("from"),top:"in"===e.trans?"".concat(e.height,"px"):0,left:"in"===e.trans?"".concat(e.width,"px"):0},t.to={opacity:i("to"),top:"in"===e.trans?0:"-".concat(e.height,"px"),left:"in"===e.trans?0:"-".concat(e.width,"px")}}return t},Lg=function(){return c((function e(){u(this,e)}),null,[{key:"load",value:(e=l(s().mark((function e(t){var i,n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.cache.has(t)){e.next=2;break}return e.abrupt("return",this.cache.get(t));case 2:return e.prev=2,e.next=5,fetch(t);case 5:if((i=e.sent).ok){e.next=8;break}throw new Error("Failed to fetch video: ".concat(i.statusText));case 8:return e.next=10,i.blob();case 10:return n=e.sent,r=URL.createObjectURL(n),this.cache.set(t,r),e.abrupt("return",r);case 16:throw e.prev=16,e.t0=e.catch(2),console.error("BlobLoader Error:",e.t0),e.t0;case 20:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(t){return e.apply(this,arguments)})},{key:"release",value:function(e){if(this.cache.has(e)){var t=this.cache.get(e);URL.revokeObjectURL(t),this.cache.delete(e)}}}]);var e}();function Og(e){return e.idCounter>500&&(e.idCounter=0),e.idCounter=e.idCounter+1,e.idCounter}h(Lg,"cache",new Map),function(e){e.actionControllerTitle="Webhook Controller",e.navigateToLayout="Navigate to layout with code [layoutTag]?",e.emptyRegionMessage="Empty region!",e.next="Next Item",e.previous="Previous Item",e.navWidget="Navigate to Widget",e.navLayout="Navigate to Layout",e.widgetId="Widget ID",e.layoutCode="Layout Code",e.target="Target"}(Ag||(Ag={}));var Pg,Dg=function(e){var t=e.mediaType,i=e.containerName;return"video"===t?i+="-vid":"audio"===t&&(i+="-aud"),i},Mg=function(e){return null===e?"":String(e).charAt(0).toUpperCase()+String(e).substring(1)};function Ng(){return(Ng=l(s().mark((function e(t,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":i||""}}).then((function(e){return e.blob()})).then((function(e){return new Promise((function(t,i){var n=new FileReader;n.onloadend=function(){return t(n.result)},n.onerror=i,n.readAsDataURL(e)}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rg(){return(Rg=l(s().mark((function e(t,i,n){var r,a,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":n||""}});case 2:if(r=e.sent,a=new Blob,"image"!==i){e.next=8;break}a=new Blob,e.next=19;break;case 8:if("video"!==i){e.next=14;break}return e.next=11,r.blob();case 11:a=e.sent,e.next=19;break;case 14:if("audio"!==i){e.next=19;break}return e.next=17,r.arrayBuffer();case 17:o=e.sent,a=new Blob([o],{type:qg(jg(t))});case 19:return e.abrupt("return",URL.createObjectURL(a));case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bg(e,t){return Ug.apply(this,arguments)}function Ug(){return(Ug=l(s().mark((function e(t,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":i||""}}).then((function(e){return e.json()})).catch((function(e){console.debug(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fg(){return(Fg=l(s().mark((function e(t,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch(t,{method:"GET",headers:{"X-PREVIEW-JWT":i||""}}).then((function(e){return e.text()})).then((function(e){return String(e).length>0?e:""})).catch((function(e){return console.debug(e),null==e?void 0:e.message})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jg(e){var t=String(e).split(".");return t[t.length-1]}function qg(e){var t={mp3:"audio/mp3",wav:"audio/wav",ogg:"audio/ogg"};if(Boolean(t[e]))return t[e]}function Hg(e){var t={mp4:"video/mp4",webm:"video/webm",wmv:"video/x-ms-wmv"};if(Boolean(t[e]))return t[e]}function Vg(t,i){var n="";if(i.regionOptions&&Boolean(i.regionOptions.getResourceUrl)&&(n=i.regionOptions.getResourceUrl.replace(":regionId",i.regionId).replace(":id",i.mediaId)+"?preview=1&layoutPreview=1"),t.platform===e.ConsumerPlatform.CMS&&Boolean(i.regionOptions.previewJwt)&&(n+="&jwt="+i.regionOptions.previewJwt),t.platform===e.ConsumerPlatform.CHROMEOS){!i.isGlobalContent&&i.isImageOrVideo&&(n="/required-files/resource/"+i.fileId+"?saveAs="+i.uri)}else t.platform===e.ConsumerPlatform.ELECTRON?"html"===i.render||"ticker"===i.mediaType||"webpage"===i.mediaType?n=t.appHost+"layout_"+i.layoutId+"_region_"+i.regionId+"_media_"+i.mediaId+".html":"native"===i.render&&i.isImageOrVideo&&(n=t.appHost+i.uri):Boolean(i.mediaType)||(n+="&scale_override="+i.scaleFactor);return n}function Xg(e,t){var i,n,r,s=e&&(null===(i=e.config)||void 0===i?void 0:i.schemaVersion),a=e&&(null===(n=e.config)||void 0===n?void 0:n.hardwareKey);return"/pwa/getResource?v="+s+"&serverKey="+(e&&(null===(r=e.config)||void 0===r?void 0:r.cmsKey))+"&hardwareKey="+a+"&layoutId="+t.layoutId+"&regionId="+t.regionId+"&mediaId="+t.mediaId}function zg(e){return"/xmds.php?file="+e.uri}function Wg(t,i){var n="";return t===e.ConsumerPlatform.CMS?n=i.options.layoutBackgroundDownloadUrl.replace(":id",i.id)+"&preview=1&width="+i.sWidth+"&height="+i.sHeight+"&dynamic&proportional=0":t===e.ConsumerPlatform.CHROMEOS?n=zg({uri:i.bgImage}):t===e.ConsumerPlatform.ELECTRON&&(n=i.options.appHost+i.bgImage),n}function Gg(e){return e&&null!==e?e.getAttributeNames().reduce((function(t,i){return r(r({},t),{},h({},i,{value:e.getAttribute(i)}))}),{}):{}}function Yg(e){var t=new Date;return new Date(t.setHours(24*e||1)).toJSON()}function Kg(e,t){var i=Date.now();if(e){var n=new Date(e).getTime();if(!isNaN(n)&&i<n)return!1}if(t){var r=new Date(t).getTime();if(!isNaN(r)&&i>r)return!1}return!0}function Jg(e,t){return!(e.length<1||!t)&&-1!==e.findIndex((function(e){return e.layoutId===t}))}function Qg(e,t){return e.length<1||!t?null:e.findIndex((function(e){return e.layoutId===t}))}function Zg(e){var t;return!!e&&(1===e.length&&"default"===(null===(t=e[0].response)||void 0===t?void 0:t.nodeName))}function $g(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&0!==e.length?void 0!==e.find((function(e){return-1===e.layoutId})):t}function ef(e){var t=e,i=Dg(t),n=".media--item.".concat(i),r=t.region.html.querySelector(n);null===r&&((r="video"===t.mediaType?document.createElement("video"):"audio"===t.mediaType?new Audio:document.createElement("div")).id=i),r.dataset.mediaId=t.id,r.dataset.mediaType=t.mediaType,r.dataset.type=t.type,r.dataset.render=t.render,r.dataset.duration=String(t.duration),r.dataset.fileId=t.fileId,r.className="media--item ".concat(i);var a,o,u="\n width: ".concat(t.divWidth,"px;\n height: ").concat(t.divHeight,"px;\n position: absolute;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n ");if("video"!==t.mediaType&&(u+="\n visibility: hidden;\n opacity: 0;\n z-index: 0;\n "),r.style.cssText=u,"html"===t.render||"ticker"===t.mediaType||"webpage"===t.mediaType?(t.checkIframeStatus=!0,t.iframe=(a=t,(o=document.createElement("iframe")).scrolling="no",o.id=a.iframeName,o.width="".concat(a.divWidth,"px"),o.height="".concat(a.divHeight,"px"),o.style.cssText="border: 0;","html"!==a.render&&"webpage"!==a.render||null===a.url?o.src="".concat(a.url,"&width=").concat(a.divWidth,"&height=").concat(a.divHeight):o.src=a.url,o)):"image"===t.mediaType?r=function(e,t){if("stretch"===e.options.scaletype)t.style.cssText=t.style.cssText.concat("background-size: 100% 100%;");else if("fit"===e.options.scaletype)t.style.cssText=t.style.cssText.concat("background-size: cover;");else{var i=""==e.options.align?"center":e.options.align,n=""==e.options.valign||"middle"==e.options.valign?"center":e.options.valign;t.style.cssText=t.style.cssText.concat("background-position: ".concat(i," ").concat(n))}return t}(t,r):"video"===t.mediaType?r=function(e,t){var i=yg(t,e),n=!1;return Boolean(e.options.mute)&&(n="1"===e.options.mute),Boolean(e.options.scaletype)&&"stretch"===e.options.scaletype&&(i.style.objectFit="fill"),i.classList.add("video-js","vjs-default-skin"),e.loop&&(e.loop=!0,i.loop=!0),e.muted=n,i}(t,r):"audio"===t.mediaType&&(r=function(e,t){var i=t;return i.preload="auto",i.textContent="Unsupported Audio",i.autoplay=!0,e.loop&&(i.loop=!0),i}(t,r)),("html"===t.render||"ticker"===t.mediaType)&&null!==t.url&&"1"===t.options.durationisperitem){var d=new RegExp("\x3c!-- NUMITEMS=(.*?) --\x3e");l(s().mark((function e(){var i,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bg("".concat(t.url,"&width=").concat(t.divWidth,"&height=").concat(t.divHeight),t.options.previewJwt);case 2:i=e.sent,console.debug({html:i}),null!==(n=d.exec(i))&&(t.duration=parseInt(String(t.duration))*parseInt(n[1]));case 6:case"end":return e.stop()}}),e)})))()}if(Boolean(t.options.transin)&&Boolean(t.options.transinduration)){var c=Number(t.options.transinduration),h=kg("fadeIn",{duration:c});r.animate(h.keyframes,h.timing)}return r}function tf(e,t){var i=Dg(e);if(null!==e.html){var n=Oc.getPlayer(i);void 0!==n&&(n.dispose(),e.player=void 0);var s=t.layout.html,a="#"+t.layout.containerName+'[data-sequence="'+t.layout.index+'"]',o=document.querySelector(a),l=t.html,u=null==l?void 0:l.querySelector("."+i);console.debug("??? XLR.debug >> [Generators::prepareVideoMedia]",{layoutSelector:a,$layoutWithIndex:o,$region:l,mediaInRegion:u,mediaHtml:e.html,existingPlayer:n,mediaId:i,layoutInDOM:document.body.contains(s)}),u?(u.remove(),e.html=ef(e)):e.html=ef(e),t.html.appendChild(e.html);var d=document.body.contains(e.html);console.debug("??? XLR.debug >> [Generators::prepareVideoMedia]",{isMediaInDOM:d,mediaHtml:e.html,mediaId:i}),e.player=Oc(i,r(r({},vg),{},{errorDisplay:!Tg.includes(t.xlr.config.platform),loop:e.loop})),e.player.el().style.setProperty("visibility","hidden"),e.player.el().style.setProperty("opacity","0"),e.player.el().style.setProperty("z-index","-99")}}function nf(e,t){var i=Dg(e);e.html.style.setProperty("background-image","url(".concat(e.url));var n=t.html.querySelector("."+i);n&&n.remove(),t.html.appendChild(e.html)}function rf(e,t){var i=Dg(e);null!==e.url&&(e.html.src=e.url);var n=t.html.querySelector("."+i);n&&n.remove(),t.html.appendChild(e.html)}function sf(e,t){if(e.ready=!1,e.html){var i=Dg(e),n=document.querySelector("#".concat(t.layout.containerName,'[data-sequence="').concat(t.layout.index,'"]')).querySelector("#"+t.containerName).querySelector("."+i);console.debug("<><> XLR.debug >> [Media] - [Generators::prepareHtmlMedia]",{mediaId:i,mediaInRegion:n}),e.html.innerHTML="",e.html.appendChild(e.iframe),n||(t.html.appendChild(e.html),e.ready=!0)}}function af(e,t){return of.apply(this,arguments)}function of(){return of=l(s().mark((function t(i,n){var r,a,o,u,d,c=arguments;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=c.length>2&&void 0!==c[2]?c[2]:e.FaultCodes.FaultVideoUnexpected,a=n.region.xlr.config.platform,o={getSW:function(){return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.serviceWorker.getRegistration("/pwa/sw.js");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))()},postMsg:function(e){return new Promise((function(t){var i;null===(i=navigator.serviceWorker.controller)||void 0===i||i.postMessage(e),t(!0)}))}},t.next=5,o.getSW();case 5:if(u=t.sent,d={type:"MEDIA_FAULT",code:r,reason:i,mediaId:n.id,regionId:n.region.id,layoutId:n.region.layout.id,date:Ce(new Date,"yyyy-MM-dd HH:mm:ss"),expires:Ce(new Date(Yg(1)),"yyyy-MM-dd HH:mm:ss")},console.debug("playerReportFault >> Reporting media fault",{mediaFault:d,platform:a,hasSW:u}),a!==e.ConsumerPlatform.CHROMEOS||!u){t.next=12;break}return t.abrupt("return",o.postMsg(d).then((function(){n.region.totalMediaObjects>1&&n.region.prepareNextMedia()})).finally((function(){console.debug("??? XLR.debug >> VideoMedia - Done reporting media fault",{mediaId:n.id,regionItems:n.region.totalMediaObjects})})));case 12:if(a!==e.ConsumerPlatform.ELECTRON){t.next=17;break}return new BroadcastChannel("player-faults-bc").postMessage(d),console.debug("playerReportFault >> Electron platform - posted media fault to channel",{mediaFault:d}),t.abrupt("return",Promise.resolve());case 17:return t.abrupt("return",Promise.resolve());case 18:case"end":return t.stop()}}),t)}))),of.apply(this,arguments)}function lf(e,t){if(e&&null!==e.id)return e.index=t,e}e.FaultCodes=void 0,(Pg=e.FaultCodes||(e.FaultCodes={}))[Pg.FaultVideoSource=2001]="FaultVideoSource",Pg[Pg.FaultVideoUnexpected=2099]="FaultVideoUnexpected";function uf(e){return{init:function(){var t=e.html,i=null;if(t){t.onloadstart=function(){console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," has started loading data . . ."))},t.onloadeddata=function(){t.readyState>=2&&console.debug("".concat(Mg(e.mediaType)," data for media > ").concat(e.id," has been fully loaded . . ."))},t.oncanplay=function(){console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," can be played . . ."))},t.onplaying=function(){console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," is now playing . . .")),null!==i&&i.remove()};var n=t.play();void 0!==n&&n.then((function(){console.debug("autoplay started . . .")})).catch((function(e){var n;"NotAllowedError"===e.name&&((i=document.createElement("button")).classList.add("play-audio-btn"),i.textContent="Play Audio",i.addEventListener("click",(function(){t.muted=!1,t.play()})),null===(n=t.parentNode)||void 0===n||n.insertBefore(i,t.nextSibling))})),0===e.duration&&(t.ondurationchange=function(){console.debug("Showing Media "+e.id+" for "+t.duration+"s of Region "+e.region.regionId)},t.onended=function(){var t;console.debug("".concat(Mg(e.mediaType)," for media > ").concat(e.id," has ended playing . . .")),null===(t=e.emitter)||void 0===t||t.emit("end",e)})}}}}var df=function(){return c((function e(t,i,n,r,s){var a,o,l,d,c,p,m,g=this;u(this,e),h(this,"attachedAudio",!1),h(this,"checkIframeStatus",!1),h(this,"containerName",""),h(this,"divHeight",0),h(this,"divWidth",0),h(this,"duration",0),h(this,"emitter",w()),h(this,"enableStat",!1),h(this,"fileId",""),h(this,"finished",!1),h(this,"fromDt",""),h(this,"html",null),h(this,"id",""),h(this,"idCounter",0),h(this,"iframe",null),h(this,"iframeName",""),h(this,"index",0),h(this,"loadIframeOnRun",!1),h(this,"loop",!1),h(this,"mediaId",""),h(this,"mediaType",""),h(this,"muted",!1),h(this,"options",{}),h(this,"player",void 0),h(this,"ready",!0),h(this,"region",{}),h(this,"render","html"),h(this,"schemaVersion","1"),h(this,"singlePlay",!1),h(this,"state",C.IDLE),h(this,"tempSrc",""),h(this,"timeoutId",setTimeout((function(){}),0)),h(this,"toDt",""),h(this,"type",""),h(this,"uri",""),h(this,"url",null),h(this,"useDuration",!1),h(this,"xml",null),h(this,"videoHandler",void 0),h(this,"mediaTimer",void 0),h(this,"mediaTimeCount",0),h(this,"xlr",{}),h(this,"statsBC",new BroadcastChannel("statsBC")),h(this,"hasCommandExecuted",void 0),this.region=t,this.id=i,this.mediaId=this.id,this.xml=n,this.options=r,this.xlr=s,this.fileId=(null===(a=this.xml)||void 0===a?void 0:a.getAttribute("fileId"))||"",this.idCounter=Og(this.options),this.containerName="M-".concat(this.id,"-").concat(this.idCounter),this.iframeName="".concat(this.containerName,"-iframe"),this.mediaType=(null===(o=this.xml)||void 0===o?void 0:o.getAttribute("type"))||"",this.render=(null===(l=this.xml)||void 0===l?void 0:l.getAttribute("render"))||"",this.duration=parseInt(null===(d=this.xml)||void 0===d?void 0:d.getAttribute("duration"))||0,this.enableStat=Boolean((null===(c=this.xml)||void 0===c?void 0:c.getAttribute("enableStat"))||!1),this.hasCommandExecuted=!1,this.fromDt=(null===(p=this.xml)||void 0===p?void 0:p.getAttribute("fromDt"))||"",this.toDt=(null===(m=this.xml)||void 0===m?void 0:m.getAttribute("toDt"))||"",this.on("start",(function(e){if(e.state!==C.PLAYING){if(e.state=C.PLAYING,"video"===e.mediaType)e.videoHandler=_g(e,g.xlr),e.videoHandler.init(),e.duration>0&&g.startMediaTimer(e);else if("audio"===e.mediaType)uf(e).init(),e.duration>0&&g.startMediaTimer(e);else if("shellcommand"===e.mediaType){if(g.hasCommandExecuted&&!g.loop)return;g.hasCommandExecuted=!0,g.emitCommand(e),e.duration>0&&g.startMediaTimer(e)}else g.startMediaTimer(e);e.enableStat&&g.statsBC.postMessage({action:"START_STAT",mediaId:parseInt(e.id),layoutId:e.region.layout.id,scheduleId:e.region.layout.scheduleId,type:"media"}),console.debug("Media::Emitter > Start - Calling widgetStart event"),g.xlr.emitter.emit("widgetStart",parseInt(e.id))}})),this.on("end",(function(e){e.state!==C.ENDED&&(e.state=C.ENDED,g.mediaTimer&&(clearInterval(g.mediaTimer),g.mediaTimeCount=0),e.enableStat&&g.statsBC.postMessage({action:"END_STAT",mediaId:parseInt(e.id),layoutId:e.region.layout.id,scheduleId:e.region.layout.scheduleId,type:"media"}),console.debug("Media::Emitter > End - Calling widgetEnd event",{mediaId:e.id,regionId:e.region.id,layoutId:e.region.layout.id}),g.xlr.emitter.emit("widgetEnd",parseInt(e.id)),e.region.playNextMedia())})),this.on("cancelled",(function(e){e.state!==C.CANCELLED&&(e.state=C.CANCELLED,g.mediaTimer&&(clearInterval(g.mediaTimer),g.mediaTimeCount=0),e.enableStat&&g.statsBC.postMessage({action:"END_STAT",mediaId:parseInt(e.id),layoutId:e.region.layout.id,scheduleId:e.region.layout.scheduleId,type:"media"}),console.debug("Media::Emitter > End - Calling widgetEnd event",{mediaId:e.id,regionId:e.region.id,layoutId:e.region.layout.id}),g.xlr.emitter.emit("widgetEnd",parseInt(e.id)),e.region.playNextMedia())})),this.init()}),[{key:"startMediaTimer",value:function(e){var t=this,i=2e3,n=1e3*e.duration/2-i,r=!1;n<i&&(n=e.duration/2*1e3),console.debug("<><> XLR.debug >> [Media::startMediaTimer]",{preloadTimeMs:i,preloadTimeBufferMs:n,isPreparingNextMedia:r,mediaDuration:e.duration}),this.mediaTimer=setInterval((function(){t.mediaTimeCount++;var i=1e3*t.mediaTimeCount;t.region.totalMediaObjects>1&&i>=n&&!r&&(r=!0,t.region.prepareNextMedia()),t.mediaTimeCount>e.duration&&(console.debug("??? XLR.debug >> Media::startMediaTimer: emit>end: on media "+e.id+" of Region "+e.region.regionId),console.debug("??? XLR.debug >> Media::startMediaTimer - Media::Emitter > End",{currentLayout:t.xlr.currentLayout,media:e,region:e.region,layout:e.region.layout}),e.emitter.emit("end",e),"video"===e.mediaType&&(console.debug("??? XLR.debug >> VideoMedia::stop - ".concat(Mg(e.mediaType)," for media > ").concat(e.id," has ended playing . . .")),void 0!==e.videoHandler&&e.videoHandler.stop(!0)))}),1e3),console.debug("startMediaTimer: Showing Media "+e.id+" for "+e.duration+"s of Region "+e.region.regionId)}},{key:"on",value:function(e,t){return this.emitter.on(e,t)}},{key:"init",value:function(){var t,i=null===(t=this.xml)||void 0===t?void 0:t.getElementsByTagName("options");if(i)for(var n=0,s=Array.from(i);n<s.length;n++)for(var a=s[n].children,o=0,l=Array.from(a);o<l.length;o++){var u=l[o];this.options[u.nodeName.toLowerCase()]=u.textContent}Boolean(this.options.uri)&&(this.uri=this.options.uri),"1"===this.options.showfullscreen?(this.divWidth=this.region.layout.sWidth,this.divHeight=this.region.layout.sHeight):(this.divWidth=this.region.sWidth,this.divHeight=this.region.sHeight);var d=r(r({},this.xlr.config.config),{},{regionOptions:this.region.options,layoutId:this.region.layout.layoutId,regionId:this.region.id,mediaId:this.id,fileId:this.fileId,scaleFactor:this.region.layout.scaleFactor,uri:this.uri,isGlobalContent:"global"===this.mediaType,isImageOrVideo:"image"===this.mediaType||"video"===this.mediaType,render:this.render});"image"!==this.mediaType&&"video"!==this.mediaType||(d.mediaType=this.mediaType);var c="";this.xlr.config.platform===e.ConsumerPlatform.CMS?c=Vg(this.xlr.config,d):this.xlr.config.platform===e.ConsumerPlatform.CHROMEOS?(c=Xg(this.xlr.config,d),"image"!==this.mediaType&&"video"!==this.mediaType&&"audio"!==this.mediaType||(c=zg(d),-1===this.region.layout.layoutId&&(c=this.uri))):this.xlr.config.platform===e.ConsumerPlatform.ELECTRON&&(c=Vg(this.xlr.config,d),-1===this.region.layout.layoutId&&(c=this.uri)),this.url=c,this.loop="1"==this.options.loop||"1"==this.region.options.loop&&1==this.region.totalMediaObjects,this.html=ef(this)}},{key:"run",value:function(){var t=this,i=1,n="E";Boolean(this.options.transinduration)&&(i=Number(this.options.transinduration)),Boolean(this.options.transindirection)&&(n=this.options.transindirection);var s={duration:i},a=kg("defaultIn",{duration:s.duration});if(Boolean(this.options.transin)){var o=this.options.transin;"fly"===o&&(o="".concat(o,"In"),s.keyframes=Ig({trans:"in",direction:n,height:this.divHeight,width:this.divWidth})),a=kg(o,s)}var l=function(){var e=t.region.html;return t.region.complete&&!t.region.layout.allEnded?(e.insertBefore(t.html,e.lastElementChild),t.html):null};!function(){var i=Dg({mediaType:t.mediaType,containerName:t.containerName}),n=t.region.html.querySelector("."+i);if(n||(n=l()),console.debug("??? XLR.debug >> Media run - show current media:",{inDOM:document.body.contains(n),mediaId:i,$media:n,mediaObject:t}),n){if("video"===t.mediaType){var s,o,u,d;if(console.debug("??? XLR.debug >> Media.run() > showCurrentMedia() - Video media::START",{mediaPlayer:t.player,isDisposed:null===(s=t.player)||void 0===s?void 0:s.isDisposed(),el:null===(o=t.player)||void 0===o?void 0:o.el_}),void 0!==t.player){var c=Oc(i);c?t.player=c:t.player.isDisposed_&&(t.player=void 0,t.player=Oc(i,r({},bg({errorDisplay:t.xlr.config.platform!==e.ConsumerPlatform.CHROMEOS,loop:t.loop}))))}console.debug("??? XLR.debug >> Media.run() > showCurrentMedia() - Video media::END",{mediaPlayer:t.player,isDisposed:null===(u=t.player)||void 0===u?void 0:u.isDisposed(),el:null===(d=t.player)||void 0===d?void 0:d.el_}),void 0!==t.player&&null!==t.player.el_&&(t.player.el().style.setProperty("visibility","visible"),t.player.el().style.setProperty("z-index","10"),t.player.el().style.setProperty("opacity","1"))}else console.debug("??? XLR.debug >> Media::run() > showCurrentMedia",{mediaType:t.mediaType,render:t.render,$media:n,state:t.state}),n.style.setProperty("visibility","visible"),n.style.setProperty("z-index","10"),n.style.setProperty("opacity","1");Boolean(t.options.transin)&&n.animate(a.keyframes,a.timing),(!t.region.layout.isOverlay||t.region.layout.isOverlay&&t.region.totalMediaObjects>1)&&t.emitter.emit("start",t)}}()}},{key:"stop",value:(t=l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.html&&(this.html.style.display="none",this.html.remove()),"image"===this.mediaType&&this.url&&Lg.release(this.url);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"emitCommand",value:function(t){if("shellcommand"===t.mediaType){var i=t.options;if("storedCommand"===i.commandtype&&i.commandcode)return console.debug("Media::Emitter > Shell Command - Calling commandCodeReceived event"),void this.xlr.emitter.emit("commandCodeReceived",i.commandcode);var n="";return"1"===i.useglobalcommand?n=i.globalcommand||"":(this.xlr.config.platform===e.ConsumerPlatform.CHROMEOS?n=i.chromeoscommand||"":this.xlr.config.platform===e.ConsumerPlatform.ANDROID?n=i.androidcommand||"":this.xlr.config.platform===e.ConsumerPlatform.LINUX?n=i.linuxcommand||"":this.xlr.config.platform===e.ConsumerPlatform.TIZEN?n=i.tizencommand||"":this.xlr.config.platform===e.ConsumerPlatform.WEBOS?n=i.weboscommand||"":this.xlr.config.platform===e.ConsumerPlatform.WINDOWS&&(n=i.windowscommand||""),!n&&i.globalcommand&&(n=i.globalcommand)),n?(console.debug("Media::Emitter > Shell Command - Calling commandStringReceived event"),void this.xlr.emitter.emit("commandStringReceived",n)):void 0}}}]);var t}(),cf=function(){return c((function e(t,i,n,r,s){u(this,e),h(this,"layout",void 0),h(this,"xml",void 0),h(this,"regionId",void 0),h(this,"options",void 0),h(this,"xlr",void 0),h(this,"complete",!1),h(this,"containerName",""),h(this,"currMedia",void 0),h(this,"currEl",null),h(this,"currentMedia",-1),h(this,"currentMediaIndex",-1),h(this,"ended",!1),h(this,"ending",!1),h(this,"html",document.createElement("div")),h(this,"id",""),h(this,"index",-1),h(this,"mediaObjects",[]),h(this,"mediaObjectsActions",[]),h(this,"nxtMedia",void 0),h(this,"nxtEl",null),h(this,"offsetX",0),h(this,"offsetY",0),h(this,"oldMedia",void 0),h(this,"oneMedia",!1),h(this,"ready",!1),h(this,"sHeight",0),h(this,"sWidth",0),h(this,"totalMediaObjects",0),h(this,"uniqueId",((e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[e]];return t})()),h(this,"zIndex",0),h(this,"emitter",w()),this.layout=t,this.xml=i,this.regionId=n,this.options=r,this.xlr=s,this.ready=!1,this.id=n,this.containerName="R-".concat(this.id,"-").concat(this.uniqueId),this.html=document.createElement("div"),this.prepareRegion()}),[{key:"prepareRegion",value:function(){var e,t,i,n,r,a,o,u=this;this.complete=!1,this.ending=!1,this.ended=!1,this.currMedia=void 0,this.nxtMedia=void 0,this.oldMedia=void 0,this.currentMediaIndex=-1,this.id=this.regionId,this.uniqueId="".concat(Og(this.options)),this.containerName="R-".concat(this.id,"-").concat(this.uniqueId),this.mediaObjects=[],this.sWidth=this.xml?Number(null===(e=this.xml)||void 0===e?void 0:e.getAttribute("width"))*this.layout.scaleFactor:0,this.sHeight=this.xml?Number(null===(t=this.xml)||void 0===t?void 0:t.getAttribute("height"))*this.layout.scaleFactor:0,this.offsetX=this.xml?Number(null===(i=this.xml)||void 0===i?void 0:i.getAttribute("left"))*this.layout.scaleFactor:0,this.offsetY=this.xml?Number(null===(n=this.xml)||void 0===n?void 0:n.getAttribute("top"))*this.layout.scaleFactor:0,this.zIndex=this.xml?Number(null===(r=this.xml)||void 0===r?void 0:r.getAttribute("zindex")):0;var d=null===(a=this.xml)||void 0===a?void 0:a.getElementsByTagName("options");if(d)for(var c=0,h=Array.from(d);c<h.length;c++)for(var p=h[c].children,m=0,g=Array.from(p);m<g.length;m++){var f=g[m];this.options[f.nodeName.toLowerCase()]=f.textContent}var y=document.querySelector("#".concat(this.layout.containerName,'[data-sequence="').concat(this.layout.index,'"]')),v=null;null!==y&&(v=y.querySelector("#"+this.containerName)),null===v&&((v=document.createElement("div")).id=this.containerName),v.style.cssText="\n width: ".concat(this.sWidth,"px;\n height: ").concat(this.sHeight,"px;\n position: absolute;\n left: ").concat(this.offsetX,"px;\n top: ").concat(this.offsetY,"px;\n z-index: ").concat(Math.round(this.zIndex),";\n "),v.className="region--item",String(this.layout.bgImage).length>0&&this.zIndex<=0&&v.style.setProperty("visibility","hidden"),this.html=v;var b=Array.from(this.xml.getElementsByTagName("media"));y&&y.appendChild(this.html),Array.from(b).forEach(function(){var e=l(s().mark((function e(t,i){var n,r,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.getAttribute("fromDt")||"",r=t.getAttribute("toDt")||"",Kg(n,r)){e.next=5;break}return console.debug("??? XLR.debug >> Region::prepareRegion - skipping expired/inactive media",{mediaId:t.getAttribute("id"),fromDt:n,toDt:r}),e.abrupt("return");case 5:(a=new df(u,(null==t?void 0:t.getAttribute("id"))||"",t,u.options,u.xlr)).index=i,u.mediaObjects.push(a);case 8:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()),this.totalMediaObjects=this.mediaObjects.length,console.debug("??? XLR.debug >> Region - done looping through media",{mediaObjects:this.mediaObjects}),null===(o=this.layout.actionController)||void 0===o||o.actions.forEach((function(e){var t,i=Gg(e.xml);"region"===i.target.value&&"navWidget"===i.actionType.value&&i.targetId.value==u.id&&Array.from((null===(t=u.layout.drawer)||void 0===t?void 0:t.getElementsByTagName("media"))||[]).forEach((function(e){var t;e.id===(null===(t=i.widgetId)||void 0===t?void 0:t.value)&&u.mediaObjectsActions.push(new df(u,(null==e?void 0:e.getAttribute("id"))||"",e,u.options,u.xlr))}))})),console.debug("??? XLR.debug >> Region::prepareRegion",{mediaItems:this.mediaObjects,totalMediaItems:this.totalMediaObjects}),this.mediaObjects.length>0&&this.prepareFirstMedia()}},{key:"prepareMedia",value:function(e){"video"===e.mediaType?tf(e,this):"image"===e.mediaType&&null!==e.url?nf(e,this):"audio"===e.mediaType&&null!==e.url?rf(e,this):("html"===e.render||"webpage"===e.mediaType)&&e.iframe&&e.checkIframeStatus&&sf(e,this)}},{key:"prepareFirstMedia",value:function(){this.currentMediaIndex=0,this.oldMedia=void 0,this.currMedia=this.mediaObjects[this.currentMediaIndex];var e=this.currMedia;e&&this.prepareMedia(e)}},{key:"prepareNextMedia",value:function(){for(var e=(this.currentMediaIndex+1)%this.totalMediaObjects,t=0;t<this.totalMediaObjects;){var i=this.mediaObjects[e];if(Kg(i.fromDt,i.toDt))break;t++,e=(e+1)%this.totalMediaObjects}if(t>=this.totalMediaObjects||e===this.currentMediaIndex)console.debug("<><> XLR.debug >> [Region::prepareNextMedia()] - no active next media to preload");else{var n=this.mediaObjects[e];console.debug("<><> XLR.debug >> [Media] - [Region::prepareNextMedia()] - Preparing next media",{currentMediaIndex:this.currentMediaIndex,nextMediaIndex:e,nextMediaId:n.mediaId}),this.prepareMedia(n)}}},{key:"prepareMediaObjects",value:function(){var e,t;(this.currentMediaIndex=(this.currentMediaIndex+1)%this.mediaObjects.length,this.mediaObjects.length>0)&&(this.currMedia=this.mediaObjects[this.currentMediaIndex],e=(this.currentMediaIndex+1)%this.totalMediaObjects,Boolean(this.mediaObjects[e])&&(this.nxtMedia=this.currentMediaIndex===e?r({},this.mediaObjects[e]):this.mediaObjects[e]),console.debug("<> XLR.debug prepareMediaObjects::oldMedia",{regionId:this.id,oldMedia:null===(t=this.oldMedia)||void 0===t?void 0:t.containerName}))}},{key:"finished",value:function(){console.debug("<> XLR.debug Region::finished called . . . ",{regionId:this.id}),this.complete=!0,this.layout.regions[this.index]=this,this.layout.regionExpired()}},{key:"run",value:function(){var e,t;if(console.debug("??? XLR.debug >> Region Called Region::run > ",this.id),this.reset(),0===this.mediaObjects.length)return console.debug("??? XLR.debug >> Region::run - no active media, finishing region",this.id),void this.finished();console.debug("??? XLR.debug >> Region Called Region::run - after reset > ",{regionId:this.id,currMedia:null===(e=this.currMedia)||void 0===e?void 0:e.containerName,oldMedia:null===(t=this.oldMedia)||void 0===t?void 0:t.containerName}),this.currMedia&&this.transitionNodes(this.oldMedia,this.currMedia)}},{key:"transitionNodes",value:function(e,t){var i=this,n=1,r="E";if(t){e&&Boolean(e.options.transoutduration)&&(n=Number(e.options.transoutduration)),e&&Boolean(e.options.transoutdirection)&&(r=e.options.transoutdirection);var s={duration:n},a=kg("defaultOut",{duration:s.duration}),o="";e&&Boolean(e.options.transout)&&("fly"===(o=e.options.transout)&&(o="".concat(o,"Out"),s.keyframes=Ig({trans:"out",direction:r,height:e.divHeight,width:e.divWidth})),a=kg(o,s)),console.debug("??? XLR.debug >> Region > transitionNodes - transOut options",{transOutName:o,transOut:a,transOutDuration:n,transOutDirection:r,totalMediaObjects:this.totalMediaObjects});e?(!function(){if(e){var t=document.querySelector("#".concat(i.layout.containerName,'[data-sequence="').concat(i.layout.index,'"]'));if(!t)return;var r=t.querySelector("#"+i.containerName),s=r?r.querySelector("."+Dg(e)):null;if(s){var l,u=function(){console.debug("??? XLR.debug >> Region transitionNodes - removeOldMedia fn",{$oldMedia:s}),s.style.setProperty("visibility","hidden"),s.style.setProperty("z-index","-999"),s.style.setProperty("opacity","0");var t,i=null;"video"===e.mediaType&&null!==s&&null!=s&&null!==(t=s.parentElement)&&void 0!==t&&t.classList.contains("video-js")&&null!==(i=s.parentElement)&&(i.style.setProperty("visibility","hidden"),i.style.setProperty("z-index","-999"),i.style.setProperty("opacity","0"),e.videoHandler&&e.videoHandler.stop(!0)),setTimeout((function(){console.debug("??? XLR.debug >> Region transitionNodes - removeOldMedia setTimeout"),i&&i.remove(),s.remove()}),1e3)};Boolean(e.options.transout)&&(l=s.animate(a.keyframes,a.timing)),Boolean(e.options.transout)&&i.totalMediaObjects>1?"flyOut"===o?l&&l.finished.then((function(){var e;null===(e=l)||void 0===e||null===(e=e.effect)||void 0===e||e.updateTiming({fill:"none"}),u()})):(console.debug("??? XLR.debug >> Region transitionNode - hideOldMedia setTimeout",{transOutDuration:n}),setTimeout((function(){console.debug("??? XLR.debug >> Region transitionNode - hideOldMedia execute setTimeout",{transOutDuration:n,oldMedia:e,$oldMedia:s}),u()}),n/2)):(console.debug("??? XLR.debug >> Region transitionNode - hideOldMediano transout and only 1 media"),u())}}}(),t.run()):t.run()}}},{key:"playNextMedia",value:function(){var e,t,i,n,r,s,a,o,l,u;if(console.debug("??? XLR.debug Region playing next media",{regionId:this.id,currentMediaIndex:this.currentMediaIndex,mediaItemsLn:this.mediaObjects.length,oldMedia:null===(e=this.oldMedia)||void 0===e?void 0:e.containerName,currMedia:null===(t=this.currMedia)||void 0===t?void 0:t.containerName,nxtMedia:null===(i=this.nxtMedia)||void 0===i?void 0:i.containerName}),this.ended)console.debug("??? XLR.debug >> Region - playNextMedia - region ended",{ended:this.ended});else{var d=this.currentMediaIndex;if(!(this.complete&&"html"===(null===(n=this.currMedia)||void 0===n?void 0:n.render)||this.complete&&1===this.mediaObjects.length&&"html"!==(null===(r=this.currMedia)||void 0===r?void 0:r.render)&&("image"===(null===(s=this.currMedia)||void 0===s?void 0:s.mediaType)||"video"===(null===(a=this.currMedia)||void 0===a?void 0:a.mediaType)))){this.currMedia?this.oldMedia=this.currMedia:this.oldMedia=void 0,this.currentMediaIndex=(d+1)%this.totalMediaObjects,this.currMedia=this.mediaObjects[this.currentMediaIndex];for(var c=0;this.currMedia&&!Kg(this.currMedia.fromDt,this.currMedia.toDt);){if(++c>=this.totalMediaObjects)return console.debug("??? XLR.debug >> Region::playNextMedia - all media expired, finishing region",this.id),void this.finished();this.currentMediaIndex=(this.currentMediaIndex+1)%this.totalMediaObjects,this.currMedia=this.mediaObjects[this.currentMediaIndex]}this.nxtMedia=this.mediaObjects[(this.currentMediaIndex+1)%this.totalMediaObjects];var h=d+1+c>=this.totalMediaObjects;h&&this.mediaObjects.length>1&&this.mediaObjects.forEach((function(e){"shellcommand"===e.mediaType&&(e.hasCommandExecuted=!1)})),console.debug("??? XLR.debug >> End Region::playNextMedia > execute transitionNodes",{regionId:this.id,currentMediaIndex:this.currentMediaIndex,mediaItemsLn:this.mediaObjects.length,oldMedia:null===(o=this.oldMedia)||void 0===o?void 0:o.containerName,currMedia:null===(l=this.currMedia)||void 0===l?void 0:l.containerName,nxtMedia:null===(u=this.nxtMedia)||void 0===u?void 0:u.containerName}),!this.layout.isOverlay&&h&&(this.finished(),this.layout.allEnded)?console.debug("??? XLR.debug >> Region - playNextMedia - layout all ended"):this.transitionNodes(this.oldMedia,this.currMedia)}}}},{key:"playPreviousMedia",value:function(){this.currentMediaIndex=this.currentMediaIndex-1,this.currentMediaIndex<0||this.ended?this.currentMediaIndex=0:(this.prepareMediaObjects(),console.debug("region::playPreviousMedia",this),this.transitionNodes(this.oldMedia,this.currMedia))}},{key:"end",value:function(){this.ending=!0,this.layout.regions[this.index]=this,console.debug("Calling Region::end ",this),this.exitTransition()}},{key:"exitTransition",value:function(){console.debug("Called Region::exitTransition ",this.id),this.exitTransitionComplete()}},{key:"exitTransitionComplete",value:function(){console.debug("Called Region::exitTransitionComplete ",this.id),this.ended=!0,this.layout.regions[this.index]=this,this.layout.regionEnded()}},{key:"reset",value:function(){this.ended=!1,this.complete=!1,this.ending=!1,console.debug("Resetting region states",this)}},{key:"on",value:function(e,t){return this.emitter.on(e,t)}}])}(),hf=c((function e(t,i){u(this,e),h(this,"id",void 0),h(this,"xml",void 0),this.id=t,this.xml=i})),pf=function(e){function i(){var e;return u(this,i),(e=t(this,i)).classList.add("action-controller","noselect"),e}return p(i,e),c(i)}(f(HTMLDivElement));customElements.define("action-controller",pf,{extends:"div"});var mf=function(){return c((function e(t,i,n){u(this,e),h(this,"parent",void 0),h(this,"actions",void 0),h(this,"options",void 0),h(this,"$container",void 0),h(this,"$actionController",void 0),h(this,"$actionListContainer",void 0),h(this,"$actionControllerTitle",void 0),h(this,"$actionsContainer",void 0),h(this,"translations",{}),this.parent=t,this.actions=i,this.options=n,this.$actionListContainer=null,this.$container=document.querySelector("#".concat(this.parent.containerName,'[data-sequence="').concat(this.parent.index,'"]')),this.$actionControllerTitle=null,this.$actionsContainer=null,this.$container&&this.$container.getElementsByClassName("action-controller")[0]?this.$actionController=this.$container.getElementsByClassName("action-controller")[0]:this.$actionController=document.createElement("div",{is:"action-controller"}),this.init()}),[{key:"init",value:function(){var t=this,i=this,n={};i.translations=Ag,"previewTranslations"in window&&(n=window.previewTranslations,i.translations=n);var r,s=document.querySelector("#".concat(this.parent.containerName,'[data-sequence="').concat(this.parent.index,'"]'));(this.$actionController.innerHTML="",this.$actionController&&this.$actionController.getElementsByClassName("action-controller-title").length>0?this.$actionControllerTitle=this.$actionController.getElementsByClassName("action-controller-title")[0]:(this.$actionControllerTitle=document.createElement("div"),this.$actionControllerTitle.classList.add("action-controller-title"),this.$actionControllerTitle.innerHTML='\n <button class="toggle"></button>\n <span class="title">'.concat(i.translations.actionControllerTitle,"</span>\n ")),this.$actionController&&this.$actionController.getElementsByClassName("actions-container").length>0)&&(null===(r=this.$actionsContainer)||void 0===r||r.remove());if(this.$actionsContainer=document.createElement("div"),this.$actionsContainer.classList.add("actions-container"),s){s.insertBefore(this.$actionController,s.firstElementChild),this.$actionController&&0===this.$actionController.getElementsByClassName("action-controller-title").length&&this.$actionController.appendChild(this.$actionControllerTitle),this.$actionController.appendChild(this.$actionsContainer),Array.from(this.actions).forEach((function(e){var n,r,s=document.createElement("div"),a=Gg(e.xml);Array.from(Object.keys(a)).forEach((function(e){s.setAttribute("data-".concat(e),a[e].value),s.setAttribute(e,a[e].value)}));var o="";o+='<span class="action-row-title">'+i.translations[s.getAttribute("actiontype")||""],"navWidget"==s.getAttribute("actiontype")?o+=' <span title="'+i.translations.widgetId+'">['+s.getAttribute("widgetid")+"]</span>":"navLayout"==s.getAttribute("actiontype")&&(o+=' <span title="'+i.translations.layoutCode+'">['+s.getAttribute("layoutcode")+"]</span>"),o+="</span>",o+='<span class="action-row-target" title="'+i.translations.target+'">'+s.getAttribute("target"),""!=s.getAttribute("targetid")&&(o+="("+s.getAttribute("targetid")+s.getAttribute("layoutcode")+")"),o+="</span>",s.innerHTML=o,s.classList.add("action"),s.setAttribute("originalid",e.id),s.setAttribute("id","A-"+e.id+"-"+Og(i.options)),null===(n=t.$actionsContainer)||void 0===n||n.insertBefore(s,null===(r=t.$actionsContainer)||void 0===r?void 0:r.lastElementChild)}));var a=this.$actionController.querySelector(".toggle");if(a&&(a.onclick=function(){i.$actionController.classList.toggle("d-none")}),this.parent.xlr.config.platform!==e.ConsumerPlatform.CMS)return void(this.$actionController.style.display="none");var o=this.$actionController.querySelectorAll('.action[triggertype="webhook"]');this.$actionController.style.setProperty("display",0===o.length?"none":"flex"),o.length>0&&o.forEach((function(e){e.onclick=function(t){t.stopPropagation(),i.runAction(e.dataset,i.options)},e.classList.add("clickable")}))}}},{key:"openLayoutInNewTab",value:function(e,t){var i=t.layoutPreviewUrl.replace("[layoutCode]",e)+"?findByCode=1";window.parent.postMessage({type:"xlr:navLayout",layoutCode:e,url:i},"*"),this.parent.xlr.emitter.emit("navLayout",e,i)}},{key:"openLayoutInPlayer",value:function(e,t){}},{key:"prevOrNextLayout",value:function(e,t){var i;(null===(i=this.parent.xlr.currentLayout)||void 0===i?void 0:i.layoutId)===parseInt(e)&&("next"===t?this.parent.xlr.gotoNextLayout():"previous"===t&&this.parent.xlr.gotoPrevLayout())}},{key:"nextMediaInRegion",value:function(e,t){this.parent.regions.forEach((function(i){i.id===e&&("next"===t?i.playNextMedia():i.playPreviousMedia())}))}},{key:"loadMediaInRegion",value:function(e,t){var i,n,r,s,a;this.parent.regions.forEach((function(t){t.id===e&&(s=t)})),s&&s.mediaObjectsActions.forEach((function(e){e.id===t&&(a=e)})),a&&(a.singlePlay=!0),0===(null===(i=s)||void 0===i?void 0:i.mediaObjects.length)&&(s.complete=!1),null===(n=s)||void 0===n||n.mediaObjects.splice(s.currentMediaIndex+1,0,a),null===(r=s)||void 0===r||r.playNextMedia()}},{key:"runAction",value:function(t,i){"navLayout"==t.actiontype?this.parent.xlr.config.platform===e.ConsumerPlatform.CMS?this.openLayoutInNewTab(t.layoutcode,i):this.parent.xlr.config.platform===e.ConsumerPlatform.CHROMEOS&&this.openLayoutInPlayer(t.layoutcode,i):"previous"!=t.actiontype&&"next"!=t.actiontype||"region"!=t.target?"navWidget"==t.actiontype&&"region"==t.target?this.loadMediaInRegion(t.targetid,t.widgetid):"screen"===t.target?this.prevOrNextLayout(t.targetid,t.actiontype):console.log(t.actiontype+" > "+t.target+"["+t.targetid+"]"):this.nextMediaInRegion(t.targetid,t.actiontype)}},{key:"initTouchActions",value:function(){var e=this;this.$actionController.querySelectorAll('.action[triggerType="touch"]').forEach((function(t){var i,n=t.dataset;if("layout"===n.source)i=document.querySelector("#".concat(e.parent.containerName,'[data-sequence="').concat(e.parent.index,'"]'));else for(var r=0,s=Array.from(e.parent.regions);r<s.length;r++){var a=s[r];if("region"===n.source){if(a.id===n.sourceid){i=a.html;break}}else if("widget"===n.source)for(var o=0,l=Array.from(a.mediaObjects);o<l.length;o++){var u=l[o];if(u.id===n.sourceid){i=u.html;break}}if(null!=i)break}null!=i&&(i.onclick=function(t){t.stopPropagation(),e.runAction(n,e.options)},i.classList.add("clickable"))}))}},{key:"initKeyboardActions",value:function(){var e=this,t=new Map;this.$actionController.querySelectorAll('.action[triggerType="keyPress"]').forEach((function(e){var i=e.dataset,n=i.triggercode;n&&(t.get(n)||t.set(n,[]),t.get(n).push(i))})),document.addEventListener("keydown",(function(i){var n=t.get(i.code);n&&n.forEach((function(t){e.runAction(t,e.options)}))}))}}])}(),gf=function(e){e.preventDefault(),history.go(0)};function ff(e){var t=e,i=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),s=document.createElement("a");i.className="player-preview",i.id="player_container",n.className="screen-preview",n.id="screen_container",r.className="preview-ended",r.id="play_ended",r.style.display="none",s.id="play_back_preview",s.className="play-back-preview",s.style.cssText="text-decoration: none; color: #ffffff;",s.innerHTML="Play again?",s.removeEventListener("click",gf),s.addEventListener("click",gf),t||(t=document.body),t&&null===t.querySelector("#player_container")&&(t.insertBefore(i,t.firstChild),null===i.querySelector("#screen_container")&&i.appendChild(n),null===i.querySelector("#play_ended")&&(i.appendChild(r),null===r.querySelector("a")&&r.appendChild(s)))}function yf(e){return vf.apply(this,arguments)}function vf(){return(vf=l(s().mark((function t(i){var n,r,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.xlfUrl,r={},i.platform===e.ConsumerPlatform.CMS?(n=i.xlfUrl,r.mode="no-cors"):i.platform===e.ConsumerPlatform.CHROMEOS?(n=i.xlfUrl,r.mode="cors",r.headers={"Content-Type":"text/xml"}):i.platform===e.ConsumerPlatform.ELECTRON?(n=i.appHost+i.xlfUrl,r.mode="no-cors",r.headers={"Content-Type":"text/xml"}):null!==i.appHost&&(n=i.appHost+i.xlfUrl),t.next=5,fetch(n,{method:"GET",headers:{"X-PREVIEW-JWT":i.previewJwt}});case 5:return a=t.sent,t.next=8,a.text();case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var bf=function(){return c((function t(i,n,r,a){var o=this;u(this,t),h(this,"id",null),h(this,"layoutId",-1),h(this,"sw",0),h(this,"sh",0),h(this,"xw",0),h(this,"xh",0),h(this,"duration",0),h(this,"zIndex",0),h(this,"scaleFactor",1),h(this,"sWidth",0),h(this,"sHeight",0),h(this,"offsetX",0),h(this,"offsetY",0),h(this,"bgColor",""),h(this,"bgImage",""),h(this,"bgId",""),h(this,"containerName",""),h(this,"regionMaxZIndex",0),h(this,"ready",!1),h(this,"regionObjects",[]),h(this,"drawer",null),h(this,"allExpired",!1),h(this,"regions",[]),h(this,"actions",[]),h(this,"done",!1),h(this,"allEnded",!1),h(this,"emitter",w()),h(this,"index",-1),h(this,"actionController",void 0),h(this,"enableStat",!1),h(this,"inLoop",!0),h(this,"xlfString",""),h(this,"ad",null),h(this,"isOverlay",!1),h(this,"shareOfVoice",0),h(this,"state",e.ELayoutState.IDLE),h(this,"scheduleId",void 0),h(this,"layoutNode",void 0),h(this,"path",""),h(this,"errorCode",null),h(this,"html",void 0),h(this,"options",{}),h(this,"xlr",{}),h(this,"layoutObj",{}),h(this,"statsBC",new BroadcastChannel("statsBC")),this.layoutNode=a,this.options=n,this.xlr=r,this.layoutObj=i,this.html=null,this.prepareLayout(),this.on("start",(function(t){t.done=!1,t.state=e.ELayoutState.RUNNING,console.debug(">>>> XLR.debug Layout start emitted > Layout > ",{layoutId:t.id,layoutIndex:t.index,layoutState:t.state}),t.enableStat&&o.statsBC.postMessage({action:"START_STAT",layoutId:t.id,scheduleId:t.scheduleId,type:"layout"}),console.debug(">>>> XLR.debug Layout::Emitter > Start - Calling layoutStart event"),t.xlr.emitter.emit("layoutStart",t)})),this.on("end",function(){var t=l(s().mark((function t(i){var n,r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.state!==e.ELayoutState.CANCELLED){t.next=3;break}return console.debug(">>>> XLR.debug Layout end emitted but layout is already cancelled > Layout ID > ",{layoutId:i.id,layoutIndex:i.index,layoutState:i.state}),t.abrupt("return");case 3:return console.debug(">>>> XLR.debug Ending layout",{layoutId:i.id,layoutIndex:i.index,layoutState:i.state}),n=document.querySelector("#".concat(i.containerName,'[data-sequence="').concat(i.index,'"]')),i.state===e.ELayoutState.RUNNING&&(i.state=e.ELayoutState.PLAYED),i.done=!0,console.debug(">>> XLR.debug Layout end emitted > Layout ID > ",{$layout:n,layoutId:i.id,layoutIndex:i.index,layoutState:i.state,isOverlay:i.isOverlay,isInterrupt:i.isInterrupt()}),null!==n&&(n.style.setProperty("visibility","hidden"),n.style.setProperty("opacity","0"),n.style.setProperty("z-index","-99"),console.debug('??? XLR.debug >> Layout.on("end") - Hiding currentLayout...'),console.debug('??? XLR.debug >> Layout.on("end") > setTimeout - Removing currentLayout',{layoutId:i.layoutId}),null===(r=n.parentElement)||void 0===r||r.removeChild(n)),i.enableStat&&o.statsBC.postMessage({action:"END_STAT",layoutId:i.id,scheduleId:i.scheduleId,type:"layout"}),console.debug(">>>>> XLR.debug Awaited XLR::emitSync > End - Calling layoutEnd event"),t.next=13,i.xlr.emitSync("layoutEnd",i);case 13:o.xlr.config.platform!==e.ConsumerPlatform.CMS&&i.inLoop&&o.xlr.prepareLayouts().then(function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log('>>>> XLR.debug XLR::Layout.on("end")',{_xlr:t,layout:i}),o.xlr.playLayouts(t),!i.isInterrupt()||!t.currentLayout||t.currentLayout.isInterrupt()){e.next=5;break}return e.next=5,t.overlayLayoutManager.resumeOverlays();case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.on("cancelled",(function(t){console.debug(">>>>> XLR.debug / Layout cancelled > Layout ID > ",t.id),t.state=e.ELayoutState.CANCELLED,t.inLoop=!1;var i,n=_(t.regions);try{for(n.s();!(i=n.n()).done;){var r,s=_(i.value.mediaObjects);try{for(s.s();!(r=s.n()).done;){var a=r.value;a.videoHandler&&a.videoHandler.stop(!0)}}catch(e){s.e(e)}finally{s.f()}}}catch(e){n.e(e)}finally{n.f()}}))}),[{key:"prepareLayout",value:function(){this.parseXlf()}},{key:"parseXlf",value:function(){var t,i,n,r,s,a,o,l,u,d=this;0===this.options.idCounter&&(this.options.idCounter=Og(this.options)),this.id=this.layoutObj.id,this.layoutId=this.layoutObj.layoutId,this.scheduleId=this.layoutObj.scheduleId,this.index=this.layoutObj.index,this.xlfString=this.layoutObj.xlfString,this.duration=this.layoutObj.duration,this.ad=this.layoutObj.ad,this.isOverlay=this.layoutObj.isOverlay,this.shareOfVoice=this.layoutObj.shareOfVoice,this.done=!1,this.allEnded=!1,this.allExpired=!1,this.containerName="L"+this.id+"-"+this.options.idCounter,this.regions=[],this.actions=[],console.log("XLR::Layout/parseXlf",this);var c=document.querySelector("#".concat(this.containerName,'[data-sequence="').concat(this.index,'"]'));null===c&&((c=document.createElement("div")).id=this.containerName);var h=document.getElementById("screen_container");h&&h.append(c);var p="\n position: absolute;\n overflow: hidden;\n ";if(c&&(c.dataset.sequence="".concat(this.index),this.xlr.config.platform===e.ConsumerPlatform.CMS&&(p+="outline: red solid thin;"),this.isOverlay&&c.classList.add("is-overlay")),this.sw=(null==h?void 0:h.offsetWidth)||0,this.sh=(null==h?void 0:h.offsetHeight)||0,this.xw=Number(null===(t=this.layoutNode)||void 0===t||null===(t=t.firstElementChild)||void 0===t?void 0:t.getAttribute("width")),this.xh=Number(null===(i=this.layoutNode)||void 0===i||null===(i=i.firstElementChild)||void 0===i?void 0:i.getAttribute("height")),this.zIndex=Number(null===(n=this.layoutNode)||void 0===n||null===(n=n.firstElementChild)||void 0===n?void 0:n.getAttribute("zindex"))||0,this.enableStat=Boolean((null===(r=this.layoutNode)||void 0===r||null===(r=r.firstElementChild)||void 0===r?void 0:r.getAttribute("enableStat"))||!1),this.scaleFactor=Math.min(this.sw/this.xw,this.sh/this.xh),this.sWidth=this.xw*this.scaleFactor,this.sHeight=this.xh*this.scaleFactor,this.offsetX=Math.abs(this.sw-this.sWidth)/2,this.offsetY=Math.abs(this.sh-this.sHeight)/2,c&&(p+="\n visibility: hidden;\n opacity: 0;\n z-index: -99;\n width: ".concat(this.sWidth,"px;\n height: ").concat(this.sHeight,"px;\n left: ").concat(this.offsetX,"px;\n top: ").concat(this.offsetY,"px;\n "),c.style.cssText=p),c&&null!==this.zIndex&&this.isOverlay&&c.style.setProperty("z-index","999"),this.bgColor=(null===(s=this.layoutNode)||void 0===s||null===(s=s.firstElementChild)||void 0===s?void 0:s.getAttribute("bgcolor"))||"",this.bgImage=(null===(a=this.layoutNode)||void 0===a||null===(a=a.firstElementChild)||void 0===a?void 0:a.getAttribute("background"))||"",""!==this.bgImage&&void 0!==this.bgImage){this.bgId=this.bgImage.substring(0,this.bgImage.indexOf("."));var m=Wg(this.xlr.config.platform,this);console.debug(">>> XLR.debug Layout::parseXlf - Composed background image URL > ",{bgImageUrl:m}),c&&(this.isOverlay||(c.style.setProperty("background-image",'url("'.concat(m,'")')),c.style.setProperty("background-repeat","no-repeat"),c.style.setProperty("background-size","".concat(this.sWidth,"px ").concat(this.sHeight,"px")),c.style.setProperty("background-position","0px 0px")))}c&&this.bgColor&&c.style.setProperty("background-color",this.isOverlay?"transparent":"".concat(this.bgColor)),c&&void 0!==this.xlr.currentLayoutId&&this.xlr.currentLayoutId!==this.id&&(c.style.setProperty("visibility","hidden"),c.style.setProperty("opacity","0"),c.style.setProperty("z-index","-99")),this.isOverlay,this.html=c;var g=Array.from((null===(o=this.layoutNode)||void 0===o?void 0:o.getElementsByTagName("action"))||[]);Array.from(g).forEach((function(e){d.actions.push(new hf((null==e?void 0:e.getAttribute("id"))||"",e))})),this.actionController=new mf(this,this.actions,this.options);var f=Array.from((null===(l=this.layoutNode)||void 0===l?void 0:l.getElementsByTagName("drawer"))||[]);Array.from(f).forEach((function(e){d.drawer=e}));var y=Array.from((null==this||null===(u=this.layoutNode)||void 0===u?void 0:u.getElementsByTagName("region"))||[]);Array.from(y).forEach((function(e,t){var i=new cf(d,e,(null==e?void 0:e.getAttribute("id"))||"",d.options,d.xlr);i.index=t,d.regions.push(i)})),this.actionController.initTouchActions(),this.actionController.initKeyboardActions()}},{key:"run",value:function(){var e=document.querySelector("#".concat(this.containerName,'[data-sequence="').concat(this.index,'"]')),t=document.getElementById("splash_".concat(this.id));t&&(t.style.display="none"),console.debug("??? XLR.debug >> Layout::run() - Checking if layout container is still in the DOM before playing regions...",{layoutId:this.id,layoutContainerExists:!!e,$layoutContainer:e,layoutIndex:this.index,shouldParse:!1}),e&&(e.style.setProperty("visibility","visible"),e.style.setProperty("opacity","1"),e.style.setProperty("z-index",null!==this.zIndex?"".concat(this.zIndex):"1"),this.isOverlay||document.body.style.setProperty("background-color","".concat(this.bgColor)),this.emitter.emit("start",this),this.playRegions())}},{key:"playRegions",value:function(){console.debug("??? XLR.debug >> Layout playRegions() - Layout running > Layout ID > ",this.id),console.debug("??? XLR.debug >> Layout playRegions() - Layout Regions > ",this.regions);for(var e=0;e<this.regions.length;e++){this.regions[e].run()}}},{key:"regionExpired",value:function(){this.allExpired=!0;var e,t=_(this.regions);try{for(t.s();!(e=t.n()).done;){e.value.complete||(this.allExpired=!1)}}catch(e){t.e(e)}finally{t.f()}this.allExpired&&this.end()}},{key:"end",value:function(){console.debug("Executing Layout::end and Calling Region::end ",this);var e,t=_(this.regions);try{for(t.s();!(e=t.n()).done;){e.value.end()}}catch(e){t.e(e)}finally{t.f()}}},{key:"regionEnded",value:function(){this.allEnded=!0;for(var t=0;t<this.regions.length;t++)this.regions[t].ended||(this.allEnded=!1);if(this.allEnded){if(console.debug("starting to end layout . . .",{layoutId:this.layoutId,layoutIndex:this.index,layoutState:this.state}),this.xlr.config.platform===e.ConsumerPlatform.CMS){var i=document.getElementById("play_ended"),n=document.getElementById("screen_container");if(n){for(;n.firstChild;)n.removeChild(n.firstChild);n.style.display="none"}i&&(i.style.display="block")}this.isOverlay||this.emitter.emit("end",this)}}},{key:"stopAllMedia",value:function(){var e=this;return console.debug("Stopping all media . . ."),new Promise(function(){var t=l(s().mark((function t(i){var n,r,a,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0;case 1:if(!(n<e.regions.length)){t.next=14;break}r=e.regions[n],a=0;case 4:if(!(a<r.mediaObjects.length)){t.next=11;break}return o=r.mediaObjects[a],t.next=8,o.stop();case 8:a++,t.next=4;break;case 11:n++,t.next=1;break;case 14:i();case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"resetLayout",value:function(){throw new Error("Method not implemented.")}},{key:"finishAllRegions",value:function(){return Promise.all(this.regions.map((function(e){return e.finished()})))}},{key:"removeLayout",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.LayoutPlaybackType.CURRENT;console.debug("??? XLR.debug >> Layout::removeLayout",{containerName:this.containerName,index:this.index,caller:t});var i,n=document.querySelector("#".concat(this.containerName,'[data-sequence="').concat(this.index,'"]'));(this.done=!0,console.debug({$layout:n}),null!==n)&&(null===(i=n.parentElement)||void 0===i||i.removeChild(n))}},{key:"discardLayout",value:function(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.LayoutPlaybackType.NEXT,n=_(this.regions);try{for(n.s();!(t=n.n()).done;){var r,s=_(t.value.mediaObjects);try{for(s.s();!(r=s.n()).done;){var a=r.value;a.player&&!a.player.isDisposed()&&(a.player.dispose(),a.player=void 0,a.html=null)}}catch(e){s.e(e)}finally{s.f()}}}catch(e){n.e(e)}finally{n.f()}this.removeLayout(i)}},{key:"getXlf",value:function(){return this.xlfString}},{key:"isInterrupt",value:function(){return this.shareOfVoice>0}},{key:"on",value:function(e,t){return this.emitter.on(e,t)}}])}(),Tf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAJWCAYAAADLFK1VAAAACXBIWXMAACDOAAAgzgFjDuzcAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3XeYXGXZx/HffWb7bgrJNkJLQqRIERSlC6gUFRXBkNCxgCKghnThlbUgpNAVpVgBKfFFRBFsiCigAlKklwQpybaEtG3ZnXO/fyyv7s7MJlvnzJn9fq7LS+Y5Z+b8JjM7M/dznvM8EgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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0Y0yUwDXCXUNquFZNLKyYXBAVZvxtAKYIQEsmPgDacr0tltO1y/DMwYpkgUpJfTasLGzd3cdCN3gN3UWRcY3epIEPevfq+3njBxq/kqBoGBduvea8f393zICS63ivRBTqgFpgaWZEIUULdcK+frIfAAL2AjscXqrLfu+uuwx05FF0XUbvvtuOeu++689+7778AHL/wJIQAAOwAAAAAAAAAAAA==";var Af=function(i){function n(i,r,a,o){var d;return u(this,n),h(d=t(this,n,[i,r,a,o]),"emitter",w()),d.state=e.ELayoutState.IDLE,d.on("start",(function(t){t.state!==e.ELayoutState.RUNNING&&(t.done=!1,t.state=e.ELayoutState.RUNNING,console.debug(">>>> XLR.debug Overlay layout start emitted > Layout ID > ",t.id),t.enableStat&&d.statsBC.postMessage({action:"START_STAT",layoutId:t.id,scheduleId:t.scheduleId,type:"layout"}),console.debug("Overlay::Emitter > Start - Calling overlayStart event"),t.xlr.emitter.emit("overlayStart",t))})),d.on("end",function(){var t=l(s().mark((function t(i){var n,r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.state!==e.ELayoutState.PLAYED){t.next=2;break}return t.abrupt("return");case 2:i.state=e.ELayoutState.PLAYED,console.log('XLR::OverlayLayout >> emitter.on("end")',{currentLayout:i.xlr.currentLayout,overlay:i}),console.debug("XLR::OverlayLayout >> Ending overlay layout with ID of > ",i.layoutId),n=document.querySelector("#".concat(i.containerName,'[data-sequence="').concat(i.index,'"]')),i.done=!0,console.debug({overlayHtml:n}),null!==n&&(null===(r=n.parentElement)||void 0===r||r.removeChild(n)),console.debug("Overlay::Emitter > End - Calling overlayEnd event"),i.xlr.emitter.emit("overlayEnd",i),i.enableStat&&d.statsBC.postMessage({action:"END_STAT",layoutId:i.id,scheduleId:i.scheduleId,type:"layout"});case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),d}return p(n,i),c(n,[{key:"on",value:function(e,t){return this.emitter.on(e,t)}}])}(bf);return e.Action=hf,e.ActionsWrapper=pf,e.AudioMedia=uf,e.Media=df,e.MediaState=C,e.Region=cf,e.VideoMedia=_g,e.audioFileType=qg,e.capitalizeStr=Mg,e.composeBgUrlByPlatform=Wg,e.composeMediaUrl=zg,e.composeResourceUrl=Xg,e.composeResourceUrlByPlatform=Vg,e.composeVideoSource=yg,e.createMediaElement=ef,e.default=function(t,i,n){console.debug("??? Xibo Layout Renderer loaded"),n&&null==n.idCounter&&(n.idCounter=0);var a={inputLayouts:t,options:n},o=r({},O),u=function(){var e=l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.overlayLayoutManager.prepareOverlayLayouts(o.overlays,o);case 2:o.overlayLayoutManager.playOverlays();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return o.isUpdatingLoop=!1,o.isUpdatingOverlays=!1,o.overlayLayoutManager=new I,o.emitter=w(),o.on=function(e,t){return o.emitter.on(e,t)},o.on("layoutChange",function(){var t=l(s().mark((function t(i){var n,r,a,l;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i===(null===(n=o.nextLayout)||void 0===n?void 0:n.layoutId)&&(l={layout:o.nextLayout,pos:e.ELayoutType.NEXT}),null===(r=l)||void 0===r||!r.layout||null===(a=l)||void 0===a||!a.pos){t.next=5;break}return t.next=4,o.prepareLayoutXlf(o.nextLayout);case 4:o.nextLayout=t.sent;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.on("updateLoop",function(){var e=l(s().mark((function e(t){var i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.isUpdatingLoop=!0,e.next=3,o.updateLoop(t);case 3:o.isUpdatingLoop=!1,null!==(i=o.currentLayout)&&void 0!==i&&i.done&&o.prepareLayouts().then((function(e){return o.playLayouts(e)}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),o.on("updateOverlays",function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.isUpdatingOverlays=!0,e.next=3,o.updateOverlays(t);case 3:o.isUpdatingOverlays=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),o.emitSync=function(){var e=l(s().mark((function e(t){var i,n,r,a,l,u=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=u.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=u[a];return l=null!==(i=o.emitter.events[t])&&void 0!==i?i:[],e.next=4,Promise.all(l.map((function(e){return e.apply(void 0,r)})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.bootstrap=function(){var t=this;t.inputLayouts=Array.isArray(a.inputLayouts)?a.inputLayouts:[a.inputLayouts],t.overlays=i,t.config=a.options,ff(document.querySelector("#preview_canvas")),function(t,i){var n=document.createElement("div"),r=document.createElement("div"),a=document.createElement("div");document.createElement("div");var o={init:function(){var t=this;return l(s().mark((function o(){var l,u;return s().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:n.classList.add("preview-splash"),i&&i.platform!==e.ConsumerPlatform.CMS&&(u=Tf,null!==(l=i.icons)&&void 0!==l&&l.splashScreen&&i.icons.splashScreen.length>0&&(u=i.icons.splashScreen),n.style.setProperty("background-image","url(".concat(u,")")),n.style.setProperty("background-size","200px"),n.style.setProperty("background-position","calc(100% - 50px) calc(100% - 30px)")),n.hide=function(){t.hide()},n.show=function(){t.show()},r.classList.add("preview-loader"),a.classList.add("preview-loaderCaption"),i&&i.platform===e.ConsumerPlatform.CMS&&(r.style.setProperty("background-image","url(".concat(_f,")")),a.innerHTML="<p>Loading Layout...</p>"),n.insertBefore(r,n.lastElementChild),n.insertBefore(a,null),t.hide();case 10:case"end":return s.stop()}}),o)})))()},show:function(){t&&(t.insertBefore(n,t.firstElementChild),n.style.setProperty("display","block"))},hide:function(){n.style.setProperty("display","none")}};return o.init(),o}(document.querySelector(".player-preview"),t.config).show()},o.init=function(){var e=this;return new Promise((function(t){var i=e;1===i.inputLayouts.length&&0===i.inputLayouts[0].layoutId?t(i):i.prepareLayouts().then((function(e){t(e)}))}))},o.playLayouts=function(e){var t=document.querySelector(".preview-splash");void 0!==e.currentLayout?(t&&"block"===t.style.display&&(null==t||t.hide()),console.debug(">>>> XLR.debug XLR::playLayouts > currentLayout",{layoutId:e.currentLayout.layoutId,layoutIndex:e.currentLayout.index,layoutState:e.currentLayout.state}),e.currentLayout.done||(e.currentLayout.isInterrupt()&&o.overlayLayoutManager.stopOverlays(),console.debug(">>>> XLR.debug XLR::playLayouts > Running currentLayout",{layoutId:e.currentLayout.layoutId,layoutIndex:e.currentLayout.index,layoutState:e.currentLayout.state}),e.currentLayout.run())):t&&(null==t||t.show())},o.playSchedules=function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.playLayouts(t),void 0===t.currentLayout||t.currentLayout.isInterrupt()){e.next=4;break}return e.next=4,u();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.renderOverlayLayouts=l(s().mark((function t(){var i,n=this;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.overlays.reduce((function(e,t){var i={};(i=r(r({},i),t)).index=t.index;var n=x;return[].concat(v(e),[r(r({},n),i)])}),[]),console.log("XLR::renderOverlayLayouts",{overlayLayouts:i}),t.next=4,Promise.all(i.map(function(){var t=l(s().mark((function t(i){var r,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.prepareLayoutXlf(i);case 2:if(a=t.sent,console.log(">>>> XLR.debug XLR::renderOverlayLayouts >> prepareLayoutXlf",a),console.log(">>>> XLR.debug XLR::renderOverlayLayouts >> currentLayout.isInterrupt()",null===(r=n.currentLayout)||void 0===r?void 0:r.isInterrupt()),!a){t.next=14;break}if(!n.currentLayout||!n.currentLayout.isInterrupt()){t.next=13;break}if(!n.isLayoutInDOM(a.containerName,a.index)){t.next=11;break}return t.next=10,a.finishAllRegions();case 10:a.removeLayout(e.LayoutPlaybackType.OVERLAY);case 11:t.next=14;break;case 13:a.run();case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 4:case"end":return t.stop()}}),t,this)}))),o.updateScheduleLayouts=function(){var e=l(s().mark((function e(t){var i,n,r,a,o,l,u,d,c,h;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.debug("XLR::updateScheduleLayouts > Updating schedule layouts . . ."),i=[],n=_(t.entries());try{for(n.s();!(r=n.n()).done;)a=y(r.value,2),o=a[0],l=a[1],(u=l).index=o,u.id=l.layoutId,this.uniqueLayouts[l.layoutId]=u,i.push(l.layoutId)}catch(e){n.e(e)}finally{n.f()}for(d=0,c=Object.keys(this.uniqueLayouts);d<c.length;d++)h=c[d],i.includes(parseInt(h))||delete this.uniqueLayouts[h];case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),o.isLayoutInDOM=function(e,t){return null!==document.querySelector("#".concat(e,'[data-sequence="').concat(t,'"]'))},o.cleanupOrphanedLayouts=function(e,t){var i=document.getElementById("screen_container");if(i){var n=void 0!==e?e:this.currentLayout,r=void 0!==t?t:this.nextLayout;Array.from(i.querySelectorAll(":scope > div:not(.is-overlay)")).forEach((function(e){var t,i=e,s=n&&i.id===n.containerName&&i.dataset.sequence===String(n.index),a=r&&i.id===r.containerName&&i.dataset.sequence===String(r.index);s||a||(console.debug("XLR::cleanupOrphanedLayouts - removing orphaned layout element",i.id),null===(t=i.parentElement)||void 0===t||t.removeChild(i))}))}},o.updateLoop=function(){var t=l(s().mark((function t(i){var n,r,a,o,u=this;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(console.debug(">>>> XLR.debug XLR::updateLoop > Updating schedule loop . . ."),this.inputLayouts=i,r=this.parseLayouts(!0),a=Jg(this.inputLayouts,null===(n=this.currentLayout)||void 0===n?void 0:n.layoutId),this.isSspEnabled&&-1===this.currentLayoutId&&(a=!0),!a&&this.currentLayout&&this.currentLayout.emitter.emit("cancelled",this.currentLayout),console.debug(">>>>> XLR.debug XLR::updateLoop > uniqueLayouts",this.uniqueLayouts),console.debug(">>>>> XLR.debug XLR::updateLoop > inputLayouts",this.inputLayouts),console.debug(">>>>> XLR.debug XLR::updateLoop > isCurrentLayoutValid",a),console.debug(">>>>> XLR.debug XLR::updateLoop > currentLayout",this.currentLayout),console.debug(">>>>> XLR.debug XLR::updateLoop > nextLayout",this.nextLayout),console.debug(">>>>> XLR.debug XLR::updateLoop > playback",r),o=function(){var e=l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.prepareLayoutXlf(r.currentLayout);case 2:u.currentLayout=e.sent,u.currentLayoutId=u.currentLayout.layoutId,u.currentLayoutIndex=r.currentLayoutIndex;case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a){t.next=55;break}if(!r.hasDefaultOnly){t.next=34;break}if(!this.currentLayout||!r.currentLayout||this.currentLayout.layoutId===r.currentLayout.layoutId){t.next=20;break}return this.currentLayout.inLoop=!1,t.next=19,this.currentLayout.finishAllRegions();case 19:this.currentLayout.removeLayout();case 20:return this.nextLayout&&this.isLayoutInDOM(this.nextLayout.containerName,this.nextLayout.index)&&this.nextLayout.discardLayout(e.LayoutPlaybackType.NEXT),t.next=23,this.prepareLayoutXlf(r.currentLayout);case 23:return this.currentLayout=t.sent,this.currentLayoutId=this.currentLayout.layoutId,t.t0=this,t.next=28,this.prepareLayoutXlf(r.nextLayout);case 28:return t.t1=t.sent,t.next=31,t.t0.prepareForSsp.call(t.t0,t.t1);case 31:this.nextLayout=t.sent,t.next=51;break;case 34:if(!this.currentLayout||!this.isLayoutInDOM(this.currentLayout.containerName,this.currentLayout.index)){t.next=39;break}return this.currentLayout.inLoop=!1,t.next=38,this.currentLayout.finishAllRegions();case 38:this.currentLayout.removeLayout();case 39:if(this.nextLayout&&this.isLayoutInDOM(this.nextLayout.containerName,this.nextLayout.index)&&this.nextLayout.discardLayout(e.LayoutPlaybackType.NEXT),!r.currentLayout){t.next=43;break}return t.next=43,o();case 43:if(!r.nextLayout){t.next=51;break}return t.t2=this,t.next=47,this.prepareLayoutXlf(r.nextLayout);case 47:return t.t3=t.sent,t.next=50,t.t2.prepareForSsp.call(t.t2,t.t3);case 50:this.nextLayout=t.sent;case 51:return t.next=53,this.playSchedules(this);case 53:t.next=67;break;case 55:if(this.nextLayout&&this.isLayoutInDOM(this.nextLayout.containerName,this.nextLayout.index)&&this.nextLayout.discardLayout(e.LayoutPlaybackType.NEXT),this.cleanupOrphanedLayouts(this.currentLayout,null),!r.currentLayout){t.next=66;break}return this.currentLayoutIndex=r.currentLayoutIndex,t.t4=this,t.next=62,this.prepareLayoutXlf(r.currentLayout);case 62:return t.t5=t.sent,t.next=65,t.t4.prepareForSsp.call(t.t4,t.t5);case 65:this.nextLayout=t.sent;case 66:console.debug(">>>> XLR.debug XLR::updateLoop > updated nextLayout",this.nextLayout);case 67:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),o.updateOverlays=function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.overlays=t,e.next=3,u();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.parseLayouts=function(t){var i,n,r,s,a=Zg(this.inputLayouts),o=this.inputLayouts.length>0,l=this.currentLayoutIndex,u=l+1,d=Jg(this.inputLayouts,null===(i=this.currentLayout)||void 0===i?void 0:i.layoutId);if(this.isSspEnabled=$g(this.inputLayouts),this.isSspEnabled&&-1===(null===(n=this.currentLayout)||void 0===n?void 0:n.layoutId)&&(d=!0),r=this.currentLayout,this.currentLayout&&this.nextLayout){if(o)if(d){var c,h;if(t)r=this.currentLayout,1===this.inputLayouts.length?r.layoutId===this.inputLayouts[0].layoutId&&r.index!==this.inputLayouts[0].index&&((r=this.getLayout(this.inputLayouts[0]))&&(l=r.index),r=lf(r,l),u=0,s=lf(s=this.getLayout(this.inputLayouts[u]),u)):(l=this.nextLayout.index>this.inputLayouts.length-1?0:this.nextLayout.index,r=lf(r=this.getLayout(this.inputLayouts[l]),l),u=l+1>this.inputLayouts.length-1?0:l+1,s=lf(s=this.getLayout(this.inputLayouts[u]),u));else l=(r=this.nextLayout).index,this.inputLayouts.length>1&&null!==(c=this.currentLayout)&&void 0!==c&&c.done&&l===(null===(h=this.currentLayout)||void 0===h?void 0:h.index)&&(l=(l+1)%this.inputLayouts.length,r=lf(r=this.getLayout(this.inputLayouts[l]),l)),u=(l+1)%this.inputLayouts.length,s=lf(s=this.getLayout(this.inputLayouts[u]),u)}else{var p;if(this.currentLayout.state===e.ELayoutState.PLAYED&&Jg(this.inputLayouts,null===(p=this.nextLayout)||void 0===p?void 0:p.layoutId)){var m=Qg(this.inputLayouts,this.nextLayout.layoutId);l=null!=m?m:0,r=lf(r=this.getLayout(this.inputLayouts[null!=m?m:0]),l)}else r=lf(r=this.getLayout(this.inputLayouts[0]),0);this.inputLayouts.length>1?(u=l+1>this.inputLayouts.length-1?0:l+1,s=lf(s=this.getLayout(this.inputLayouts[u]),u)):s=r}}else o&&(r=lf(r=this.getLayout(this.inputLayouts[l]),l),s=this.inputLayouts.length>1?lf(s=this.getLayout(this.inputLayouts[u]),u):lf(s=this.getLayout(this.inputLayouts[0]),0));return void 0===r&&void 0===s&&a&&(r=lf(r=this.getLayout(this.inputLayouts[0]),0),s=lf(s=this.getLayout(this.inputLayouts[0]),0)),void 0!==r&&void 0!==s&&(r.xlr=this,s.xlr=this),{currentLayout:r,nextLayout:s,currentLayoutIndex:l,nextLayoutIndex:u,isCurrentLayoutValid:d,hasDefaultOnly:a}},o.getLayout=function(t){var i=this.config.platform===e.ConsumerPlatform.CMS;if(i||0!==Object.keys(this.uniqueLayouts).length){var n={};if(t)if(-1===t.layoutId)(n=t).id=t.layoutId;else{var s=t;i?(s.index=0,null==s.id&&(s.id=s.layoutId)):s=r({},this.uniqueLayouts[t.layoutId]),n=r(r({},n),s),console.debug("XLR::getLayout > activeLayout from uniqueLayouts",{activeLayout:s,inputLayout:t,uniqueLayouts:this.uniqueLayouts}),n.index=s.index}var a=x;return a=r(r({},a),n)}},o.getLayoutById=function(e,t){if(e&&0!==Object.keys(this.uniqueLayouts).length){var i=r(r({},x),this.uniqueLayouts[e]);return t&&(i.index=t),i}},o.prepareLayouts=l(s().mark((function t(){var i,n,r,a,u,d,c,h;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=o,!this.isUpdatingLoop){t.next=3;break}return t.abrupt("return",Promise.resolve(r));case 3:if(a=r.parseLayouts(),1!==r.inputLayouts.length||0!==r.inputLayouts[0].layoutId){t.next=6;break}return t.abrupt("return",Promise.resolve(r));case 6:if(console.debug("??? XLR.debug prepareLayouts::playback",{layoutPlayback:a,shouldParse:!1}),r.currentLayoutId=null===(i=a.currentLayout)||void 0===i?void 0:i.layoutId,null===(n=a.currentLayout)||void 0===n||!n.layoutNode||a.currentLayout.done||""===a.currentLayout.xlfString){t.next=12;break}t.t0=a.currentLayout,t.next=15;break;case 12:return t.next=14,r.prepareLayoutXlf(a.currentLayout);case 14:t.t0=t.sent;case 15:return u=t.t0,d=u===a.currentLayout,t.next=19,r.prepareLayoutXlf(a.nextLayout);case 19:return c=t.sent,t.t1=Promise,t.t2=u,t.next=24,r.prepareForSsp(c);case 24:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=28,t.t1.all.call(t.t1,t.t4);case 28:if(h=t.sent,!r.isUpdatingLoop&&!h[0].done){t.next=33;break}return!d&&this.isLayoutInDOM(u.containerName,u.index)&&u.discardLayout(e.LayoutPlaybackType.NEXT),a.nextLayout&&c&&this.isLayoutInDOM(c.containerName,c.index)&&c.discardLayout(e.LayoutPlaybackType.NEXT),t.abrupt("return",Promise.resolve(r));case 33:return console.debug(">>>>> XLR.debug prepared layout XLF",h),t.abrupt("return",new Promise(function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.layouts.current=h[0],r.layouts.next=h[1],r.layouts.current&&r.layouts.next&&(r.layouts.current.xlr=r,r.layouts.next.xlr=r),r.currentLayoutIndex=a.currentLayoutIndex,r.currentLayout=r.layouts.current,r.currentLayoutId=r.currentLayout.layoutId,r.nextLayout=r.layouts.next,r.cleanupOrphanedLayouts(r.currentLayout,r.nextLayout),t(o);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 35:case"end":return t.stop()}}),t,this)}))),o.prepareLayoutXlf=function(){var t=l(s().mark((function t(i){var n,o,l,u,d,c,h,p;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i){t.next=3;break}return console.warn("XLR::prepareLayoutXlf called with undefined inputLayout"),t.abrupt("return",x);case 3:if(n=this,o=r({},a.options),n.config.platform===e.ConsumerPlatform.CMS&&i&&Boolean(i.layoutId)?o.xlfUrl=o.xlfUrl.replace(":layoutId",String(i.layoutId)):n.config.platform!==e.ConsumerPlatform.CHROMEOS&&n.config.platform!==e.ConsumerPlatform.ELECTRON||void 0===i||(o.xlfUrl=i.path),!i||void 0!==i.layoutNode){t.next=22;break}if(-1!==i.layoutId){t.next=15;break}return t.next=10,n.emitSync("adRequest",i.index);case 10:d=n.inputLayouts[i.index],console.debug("XLR::prepareLayoutXlf > SSP input layout",{sspInputLayout:d,inputLayout:i}),l="function"==typeof(null===(c=d)||void 0===c?void 0:c.getXlf)?d.getXlf():"",t.next=18;break;case 15:return t.next=17,yf(o);case 17:l=t.sent;case 18:h=new window.DOMParser,u=h.parseFromString(l,"text/xml"),t.next=23;break;case 22:u=i&&i.layoutNode;case 23:return p=!(null==i||!i.isOverlay),t.abrupt("return",new Promise((function(e){var t,s,c=r(r({},x),{},{ad:null!==(t=i.ad)&&void 0!==t?t:x.ad});console.log("XLR::prepareLayoutXlf >> Promise",{xlrLayoutObj:c,inputLayout:i}),c.id=Number(i.layoutId),c.layoutId=Number(i.layoutId),c.scheduleId=(null==i?void 0:i.scheduleId)||void 0,c.options=o,c.index=i.index,c.xlfString=l,c.duration=i.duration,c.isOverlay=p,c.shareOfVoice=i.shareOfVoice,console.log("XLR::prepareLayoutXlf >> Promise >> xlrLayoutObj",c),d&&(c.duration=d.duration||0,c.ad=d.ad),s=p?new Af(c,o,n,u):new bf(c,o,n,u),a.options&&(a.options.idCounter=o.idCounter),e(s)})));case 25:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),o.prepareForSsp=function(){var t=l(s().mark((function t(i){var n,r,a,o,l,u,d;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=i,a=0,o=(n=this).inputLayouts.length;case 4:if(!(r&&""===r.xlfString&&a<o)){t.next=20;break}if(r.removeLayout(e.LayoutPlaybackType.NEXT),a++,l=(r.index+1)%n.inputLayouts.length,u=n.inputLayouts[l]){t.next=11;break}return t.abrupt("break",20);case 11:if(d=lf(d=n.getLayout(u),l)){t.next=15;break}return t.abrupt("break",20);case 15:return t.next=17,n.prepareLayoutXlf(d);case 17:r=t.sent,t.next=4;break;case 20:return t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),o.gotoPrevLayout=l(s().mark((function e(){var t,i,n,r=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.currentLayoutIndex,!((i=t-1)<0)){e.next=4;break}return e.abrupt("return");case 4:if(console.debug("XLR::gotoPrevLayout",{previousLayoutIndex:i,method:"XLR::gotoPrevLayout",shouldParse:!1}),!Boolean(this.inputLayouts[i])){e.next=10;break}return e.next=8,null===(n=this.currentLayout)||void 0===n?void 0:n.finishAllRegions();case 8:this.currentLayoutIndex=i,this.prepareLayouts().then(function(){var e=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.playSchedules(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 10:case"end":return e.stop()}}),e,this)}))),o.gotoNextLayout=l(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.debug("XLR::gotoNextLayout",{nextLayoutIndex:this.currentLayoutIndex+1,method:"XLR::gotoNextLayout",shouldParse:!1}),e.next=3,null===(t=o.currentLayout)||void 0===t?void 0:t.finishAllRegions();case 3:case"end":return e.stop()}}),e,this)}))),o.updateInputLayout=function(e,t){var i=this.inputLayouts[e];null!==t&&(t.index=i.index),console.debug("XLR::updateInputLayout",{layoutIndex:e,layout:t,xlrInputLayout:i}),this.inputLayouts[e]=t||i},o.bootstrap(),o},e.defaultTrans=Sg,e.defaultVjsOpts=vg,e.fadeInElem=wg,e.fadeOutElem=Eg,e.fetchJSON=Bg,e.fetchText=function(e,t){return Fg.apply(this,arguments)},e.flyInElem=xg,e.flyOutElem=Cg,e.flyTransitionKeyframes=Ig,e.getAllAttributes=Gg,e.getDataBlob=function(e,t){return Ng.apply(this,arguments)},e.getFileExt=jg,e.getIndexByLayoutId=function(e,t){var i=e.reduce((function(e,t,i){return e[Number(t.layoutId)]=r(r({},t),{},{index:i}),e}),{});return null!==t&&t?Boolean(i[t])?i[t]:{index:0}:i},e.getLayout=function(e){var t,i,n=void 0,s=void 0,a=e.xlr,o=a.inputLayouts,l=a.currentLayout,u=a.nextLayout,d=a.currentLayoutIndex,c=o.length>0,h=d,p=h+1;if(void 0===l&&void 0===u){if(c){var m=r({},x);t=o[h],n=r(r({},x),t),s=o.length>1?m=r(r({},m),o[p]):n,n.id=t.layoutId,m&&(s.id=m.layoutId)}}else c&&(p=(h=null===(i=n=u)||void 0===i?void 0:i.index)+1,s=o.length>1&&p<o.length&&Boolean(o[p])?r(r({},x),o[p]):r(r({},x),o[0]));return{currentLayoutIndex:h,nextLayoutIndex:p,inputLayouts:e.xlr.inputLayouts,current:n,next:s}},e.getLayoutIndexByLayoutId=Qg,e.getMediaId=Dg,e.getXlf=yf,e.hasDefaultOnly=Zg,e.hasSspLayout=$g,e.initRenderingDOM=ff,e.initialLayout=x,e.initialRegion=k,e.initialXlr=O,e.isEmpty=function(e){return!Boolean(e)||0===String(e).length},e.isLayoutValid=Jg,e.isMediaActive=Kg,e.nextId=Og,e.playerReportFault=af,e.preloadMediaBlob=function(e,t,i){return Rg.apply(this,arguments)},e.prepareAudioMedia=rf,e.prepareHtmlMedia=sf,e.prepareImageMedia=nf,e.prepareVideoMedia=tf,e.reportToPlayerPlatform=Tg,e.setExpiry=Yg,e.transitionElement=kg,e.videoFileType=Hg,e.vjsDefaultOptions=bg,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
29
29
  //# sourceMappingURL=xibo-layout-renderer.min.js.map