@playkit-js/kaltura-player-js 3.18.0-canary.0-ecfabb5 → 3.18.0-canary.0-14a3ea8

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.
@@ -57,5 +57,5 @@ function Wb(e){this.h=e,(this.g=Ph.get("ISOBoxer")())&&function(e){function t(){
57
57
  Copyright 2019 Google LLC
58
58
  SPDX-License-Identifier: Apache-2.0
59
59
  */
60
- function e_(){}function t_(){Qb?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(Qb=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=n_):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function n_(e,t){var n,r=this;return R((function(i){return 1==i.g?(console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),_(i,Qb.call(r,e,t),2)):p_(n=i.h)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=Qb,i.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=r_,i.return(r_.call(r,e,t)))}))}function r_(e,t){var n,r,i,a,o,s,l,c,d,p,h=this;return R((function(f){if(1==f.g){for(console.assert(h==navigator,'bad "this" for requestMediaKeySystemAccess'),n=d_(e),r=[],i=u(t),a=i.next();!a.done;a=i.next())o=a.value,s=i_(o.videoCapabilities,n),l=i_(o.audioCapabilities,n),o.videoCapabilities&&o.videoCapabilities.length&&!s.length||o.audioCapabilities&&o.audioCapabilities.length&&!l.length||((c=Object.assign({},o)).videoCapabilities=s,c.audioCapabilities=l,r.push(c));if(!r.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return _(f,Qb.call(h,e,r),2)}return p=f.h,f.return(new c_(p,n))}))}function i_(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function a_(){}function o_(){$b?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?($b=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=s_):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function s_(e){var t,n,r,i=this;return R((function(a){switch(a.g){case 1:return console.assert(i==navigator.mediaCapabilities,'bad "this" for decodingInfo'),_(a,$b.call(i,e),2);case 2:if(t=a.h,!e.keySystemConfiguration)return a.return(t);if((n=t.keySystemAccess)&&p_(n))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=$b,a.return(t);if(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=l_,n){a.B(3);break}return r=t,_(a,u_(e),4);case 4:return r.keySystemAccess=a.h,a.return(t);case 3:return a.return(l_.call(i,e))}}))}function l_(e){var t,n,r,i,a,o,s,l,u=this;return R((function(c){switch(c.g){case 1:return console.assert(u==navigator.mediaCapabilities,'bad "this" for decodingInfo'),t=null,e.keySystemConfiguration&&(n=e.keySystemConfiguration,r=n.keySystem,i=n.audio&&n.audio.encryptionScheme,a=n.video&&n.video.encryptionScheme,t=d_(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},i&&i!=t||a&&a!=t)?c.return(o):_(c,$b.call(u,e),2);case 2:if((s=c.h).keySystemAccess){s.keySystemAccess=new c_(s.keySystemAccess,t),c.B(3);break}if(!e.keySystemConfiguration){c.B(3);break}return l=s,_(c,u_(e),5);case 5:l.keySystemAccess=c.h;case 3:return c.return(s)}}))}function u_(e){var t,n;return R((function(r){if(1==r.g){var i=e.keySystemConfiguration,a=[],o=[];return i.audio&&a.push({robustness:i.audio.robustness||"",contentType:e.audio.contentType}),i.video&&o.push({robustness:i.video.robustness||"",contentType:e.video.contentType}),i={initDataTypes:i.initDataType?[i.initDataType]:[],distinctiveIdentifier:i.distinctiveIdentifier,persistentState:i.persistentState,sessionTypes:i.sessionTypes},a.length&&(i.audioCapabilities=a),o.length&&(i.videoCapabilities=o),t=i,_(r,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[t]),2)}return n=r.h,r.return(n)}))}function c_(e,t){this.h=e,this.g=t,this.keySystem=e.keySystem}function d_(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.chromecast")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function p_(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function h_(){}function f_(){t_(),o_()}Be("video/mp2t",(function(){return new Xb("video/mp2t")}),Ke),j("EmeEncryptionSchemePolyfill",e_),e_.install=t_,j("McEncryptionSchemePolyfill",a_),a_.install=o_,c_.prototype.getConfiguration=function(){var e=this.h.getConfiguration();if(e.videoCapabilities)for(var t=u(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.g;if(e.audioCapabilities)for(n=(t=u(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.g;return e},c_.prototype.createMediaKeys=function(){return this.h.createMediaKeys()},j("EncryptionSchemePolyfills",h_),h_.install=f_,void 0!==n&&n.exports&&(n.exports=h_)}.call(r,n,n,void 0),r.shaka)t[i]=r.shaka[i]}()}).call(this,n(8))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){!function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var e=function(e){for(var t=window.document,n=i(t);n;)n=i(t=n.ownerDocument);return t}(),t=[],n=null,r=null;o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.USE_MUTATION_OBSERVER=!0,o._setupCrossOriginUpdater=function(){return n||(n=function(e,n){r=e&&n?d(e,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},t.forEach((function(e){e._checkForIntersections()}))}),n},o._resetCrossOriginUpdater=function(){n=null,r=null},o.prototype.observe=function(e){if(!this._observationTargets.some((function(t){return t.element==e}))){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(e.ownerDocument),this._checkForIntersections()}},o.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter((function(t){return t.element!=e})),this._unmonitorIntersections(e.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},o.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter((function(e,t,n){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==n[t-1]}))},o.prototype._parseRootMargin=function(e){var t=(e||"0px").split(/\s+/).map((function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}}));return t[1]=t[1]||t[0],t[2]=t[2]||t[0],t[3]=t[3]||t[1],t},o.prototype._monitorIntersections=function(t){var n=t.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(t)){var r=this._checkForIntersections,a=null,o=null;this.POLL_INTERVAL?a=n.setInterval(r,this.POLL_INTERVAL):(s(n,"resize",r,!0),s(t,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(o=new n.MutationObserver(r)).observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(t),this._monitoringUnsubscribes.push((function(){var e=t.defaultView;e&&(a&&e.clearInterval(a),l(e,"resize",r,!0)),l(t,"scroll",r,!0),o&&o.disconnect()}));var u=this.root&&(this.root.ownerDocument||this.root)||e;if(t!=u){var c=i(t);c&&this._monitorIntersections(c.ownerDocument)}}},o.prototype._unmonitorIntersections=function(t){var n=this._monitoringDocuments.indexOf(t);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||e;if(!this._observationTargets.some((function(e){var n=e.element.ownerDocument;if(n==t)return!0;for(;n&&n!=r;){var a=i(n);if((n=a&&a.ownerDocument)==t)return!0}return!1}))){var a=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),a(),t!=r){var o=i(t);o&&this._unmonitorIntersections(o.ownerDocument)}}}},o.prototype._unmonitorAllIntersections=function(){var e=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var t=0;t<e.length;t++)e[t]()},o.prototype._checkForIntersections=function(){if(this.root||!n||r){var e=this._rootIsInDom(),t=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var i=r.element,o=u(i),s=this._rootContainsTarget(i),l=r.entry,c=e&&s&&this._computeTargetAndRootIntersection(i,o,t),d=null;this._rootContainsTarget(i)?n&&!this.root||(d=t):d={top:0,bottom:0,left:0,right:0,width:0,height:0};var p=r.entry=new a({time:window.performance&&performance.now&&performance.now(),target:i,boundingClientRect:o,rootBounds:d,intersectionRect:c});l?e&&s?this._hasCrossedThreshold(l,p)&&this._queuedEntries.push(p):l&&l.isIntersecting&&this._queuedEntries.push(p):this._queuedEntries.push(p)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},o.prototype._computeTargetAndRootIntersection=function(t,i,a){if("none"!=window.getComputedStyle(t).display){for(var o,s,l,c,p,f,g,y,v=i,m=h(t),b=!1;!b&&m;){var _=null,k=1==m.nodeType?window.getComputedStyle(m):{};if("none"==k.display)return null;if(m==this.root||9==m.nodeType)if(b=!0,m==this.root||m==e)n&&!this.root?!r||0==r.width&&0==r.height?(m=null,_=null,v=null):_=r:_=a;else{var E=h(m),T=E&&u(E),A=E&&this._computeTargetAndRootIntersection(E,T,a);T&&A?(m=E,_=d(T,A)):(m=null,v=null)}else{var w=m.ownerDocument;m!=w.body&&m!=w.documentElement&&"visible"!=k.overflow&&(_=u(m))}if(_&&(o=_,s=v,l=void 0,c=void 0,p=void 0,f=void 0,g=void 0,y=void 0,l=Math.max(o.top,s.top),c=Math.min(o.bottom,s.bottom),p=Math.max(o.left,s.left),f=Math.min(o.right,s.right),y=c-l,v=(g=f-p)>=0&&y>=0&&{top:l,bottom:c,left:p,right:f,width:g,height:y}||null),!v)break;m=m&&h(m)}return v}},o.prototype._getRootRect=function(){var t;if(this.root&&!f(this.root))t=u(this.root);else{var n=f(this.root)?this.root:e,r=n.documentElement,i=n.body;t={top:0,left:0,right:r.clientWidth||i.clientWidth,width:r.clientWidth||i.clientWidth,bottom:r.clientHeight||i.clientHeight,height:r.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(t)},o.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map((function(t,n){return"px"==t.unit?t.value:t.value*(n%2?e.width:e.height)/100})),n={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},o.prototype._hasCrossedThreshold=function(e,t){var n=e&&e.isIntersecting?e.intersectionRatio||0:-1,r=t.isIntersecting?t.intersectionRatio||0:-1;if(n!==r)for(var i=0;i<this.thresholds.length;i++){var a=this.thresholds[i];if(a==n||a==r||a<n!=a<r)return!0}},o.prototype._rootIsInDom=function(){return!this.root||p(e,this.root)},o.prototype._rootContainsTarget=function(t){var n=this.root&&(this.root.ownerDocument||this.root)||e;return p(n,t)&&(!this.root||n==t.ownerDocument)},o.prototype._registerInstance=function(){t.indexOf(this)<0&&t.push(this)},o.prototype._unregisterInstance=function(){var e=t.indexOf(this);-1!=e&&t.splice(e,1)},window.IntersectionObserver=o,window.IntersectionObserverEntry=a}function i(e){try{return e.defaultView&&e.defaultView.frameElement||null}catch(e){return null}}function a(e){this.time=e.time,this.target=e.target,this.rootBounds=c(e.rootBounds),this.boundingClientRect=c(e.boundingClientRect),this.intersectionRect=c(e.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!e.intersectionRect;var t=this.boundingClientRect,n=t.width*t.height,r=this.intersectionRect,i=r.width*r.height;this.intersectionRatio=n?Number((i/n).toFixed(4)):this.isIntersecting?1:0}function o(e,t){var n,r,i,a=t||{};if("function"!=typeof e)throw new Error("callback must be a function");if(a.root&&1!=a.root.nodeType&&9!=a.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,i=null,function(){i||(i=setTimeout((function(){n(),i=null}),r))}),this._callback=e,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(a.rootMargin),this.thresholds=this._initThresholds(a.threshold),this.root=a.root||null,this.rootMargin=this._rootMarginValues.map((function(e){return e.value+e.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function s(e,t,n,r){"function"==typeof e.addEventListener?e.addEventListener(t,n,r||!1):"function"==typeof e.attachEvent&&e.attachEvent("on"+t,n)}function l(e,t,n,r){"function"==typeof e.removeEventListener?e.removeEventListener(t,n,r||!1):"function"==typeof e.detachEvent&&e.detachEvent("on"+t,n)}function u(e){var t;try{t=e.getBoundingClientRect()}catch(e){}return t?(t.width&&t.height||(t={top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.right-t.left,height:t.bottom-t.top}),t):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function c(e){return!e||"x"in e?e:{top:e.top,y:e.top,bottom:e.bottom,left:e.left,x:e.left,right:e.right,width:e.width,height:e.height}}function d(e,t){var n=t.top-e.top,r=t.left-e.left;return{top:n,left:r,height:t.height,width:t.width,bottom:n+t.height,right:r+t.width}}function p(e,t){for(var n=t;n;){if(n==e)return!0;n=h(n)}return!1}function h(t){var n=t.parentNode;return 9==t.nodeType&&t!=e?i(t):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function f(e){return e&&9===e.nodeType}}()},function(e,t,n){var r=n(11),i=n(12);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:"head",singleton:!1};r(i,a);e.exports=i.locals||{}},function(e,t,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function s(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var a=e[i],l=t.base?a[0]+t.base:a[0],u=n[l]||0,c="".concat(l," ").concat(u);n[l]=u+1;var d=s(c),p={css:a[1],media:a[2],sourceMap:a[3]};-1!==d?(o[d].references++,o[d].updater(p)):o.push({identifier:c,updater:y(p,t),references:1}),r.push(c)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=a(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function p(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function h(e,t,n){var r=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,g=0;function y(e,t){var n,r,i;if(t.singleton){var a=g++;n=f||(f=u(t)),r=p.bind(null,n,a,!1),i=p.bind(null,n,a,!0)}else n=u(t),r=h.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=s(n[r]);o[i].references--}for(var a=l(e,t),u=0;u<n.length;u++){var c=s(n[u]);0===o[c].references&&(o[c].updater(),o.splice(c,1))}n=a}}}},function(e,t,n){(t=n(13)(!1)).push([e.i,".kaltura-player-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #000;\n outline: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(o=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),a=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(a).concat([i]).join("\n")}var o,s,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var a=0;a<this.length;a++){var o=this[a][0];null!=o&&(i[o]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},function(e,t,n){"use strict";n.r(t),n.d(t,"getPlayers",(function(){return yn})),n.d(t,"getPlayer",(function(){return vn})),n.d(t,"core",(function(){return r})),n.d(t,"ui",(function(){return i})),n.d(t,"providers",(function(){return a})),n.d(t,"setup",(function(){return _n})),n.d(t,"cast",(function(){return xn})),n.d(t,"playlist",(function(){return In})),n.d(t,"Ad",(function(){return bt})),n.d(t,"AdBreak",(function(){return yt})),n.d(t,"BasePlugin",(function(){return $})),n.d(t,"registerPlugin",(function(){return ee})),n.d(t,"PLAYER_TYPE",(function(){return Dn})),n.d(t,"VERSION",(function(){return Rn})),n.d(t,"PLAYER_NAME",(function(){return Pn})),n.d(t,"KALTURA_PLAYER_START_TIME_QS",(function(){return F}));n(3);var r=n(0),i=n(1),a=n(2);n(4),n(6);function o(e,t){var n=function(e){var t=document.createElement("a");return t.href=e,t.hostname},r=n(t),i=!1,a="",o="";return e&&(e.flavors&&Array.isArray(e.flavors)?(a=(i=1===e.flavors.length)&&n(e.flavors[0].url),o=e.flavors[0].url):e.result&&(i=!0,a=n(e.result.url),o=e.result.url)),i&&r!==a?o:t}function s(e,t){return void 0===t&&(t={}),r.Utils.Object.mergeDeep({},function(e,t){void 0===t&&(t={});var n={},i=r.Utils.Object.getPropertyPath(e,"sources.options.redirectExternalStreamsHandler"),a=r.Utils.Object.getPropertyPath(t,"sources.options.redirectExternalStreamsHandler");return"function"!=typeof i&&"function"!=typeof a&&r.Utils.Object.mergeDeep(n,{sources:{options:{redirectExternalStreamsHandler:o}}}),n}(e,t))}var l="Must provide initial providers config",u="Must provide target id",c="Must provide DOM element with id of: ",d="The target id provided is already in use. Id: ";function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var f,g,y,v="@playkit-js/kaltura-player-js_",m=function(){function e(){}var t,n,r;return e.isLocalStorageAvailable=function(){if("undefined"==typeof Storage)return!1;try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},e.setItem=function(t,n){e._validateKey(t);try{e._logger.debug("Sets item for key: "+t,n),localStorage.setItem(v+t,n)}catch(t){e._isQuotaExceeded(t)?e._logger.error("Quota exceeded: "+t.message):e._logger.error(t.message)}},e.getItem=function(t){e._validateKey(t);var n=null;try{return"string"==typeof(n=localStorage.getItem(v+t))?JSON.parse(n):null}catch(e){return n}},e._isQuotaExceeded=function(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t},e._validateKey=function(e){if("string"!=typeof e||0===e.length)throw new Error("Invalid key")},t=e,r=[{key:"size",get:function(){return Object.keys(localStorage).filter((function(e){return e.startsWith(v)})).length}}],(n=null)&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}f=m,g="_logger",y=Object(r.getLogger)("StorageWrapper"),(g=h(g))in f?Object.defineProperty(f,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[g]=y;var _=function(){function e(){}return e.isLocalStorageAvailable=function(){return m.isLocalStorageAvailable()},e.attach=function(t){e._logger.debug("Attach local storage");var n=new r.EventManager;n.listen(t,t.Event.UI.USER_CLICKED_MUTE,(function(){t.isCasting()||m.setItem(e.StorageKeys.MUTED,t.muted)})),n.listen(t,t.Event.UI.USER_CLICKED_UNMUTE,(function(){t.isCasting()||m.setItem(e.StorageKeys.MUTED,t.muted)})),n.listen(t,t.Event.UI.USER_SELECTED_SPEED,(function(){t.isCasting()||m.setItem(e.StorageKeys.PLAYBACK_RATE,t.playbackRate)})),n.listen(t,t.Event.UI.USER_CHANGED_VOLUME,(function(){t.isCasting()||(t.volume>0?m.setItem(e.StorageKeys.MUTED,!1):m.setItem(e.StorageKeys.MUTED,!0),m.setItem(e.StorageKeys.VOLUME,t.volume))})),n.listen(t,t.Event.UI.USER_SELECTED_AUDIO_TRACK,(function(t){var n=t.payload.audioTrack;m.setItem(e.StorageKeys.AUDIO_LANG,n.language)})),n.listen(t,t.Event.UI.USER_SELECTED_CAPTION_TRACK,(function(t){var n=t.payload.captionTrack;"off"!==n.language?(m.setItem(e.StorageKeys.TEXT_LANG,n.language),m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!0)):m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!1)}));var i=function(){n.listenOnce(t,t.Event.TEXT_TRACK_CHANGED,(function(t){var n=t.payload.selectedTextTrack;"off"!==n.language?(m.setItem(e.StorageKeys.TEXT_LANG,n.language),m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!0)):m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!1)}))};n.listen(t,t.Event.UI.USER_SHOWED_CAPTIONS,i),n.listen(t,t.Event.UI.USER_HID_CAPTIONS,i),n.listen(t,t.Event.UI.USER_SELECTED_CAPTIONS_STYLE,(function(t){try{var n=JSON.stringify(t.payload.captionsStyle);m.setItem(e.StorageKeys.TEXT_STYLE,n)}catch(t){e._logger.error(t.message)}})),n.listen(t,t.Event.PLAYER_DESTROY,(function(){return n.destroy()}))},e.getPlayerTextStyle=function(){return m.getItem(e.StorageKeys.TEXT_STYLE)},e.hasStorage=function(){var t=m.size,n=0!==t;return n?e._logger.debug("Storage found with size of ",t):e._logger.debug("No storage found"),n},e.getStorageConfig=function(){var t=e._getExistingValues(),n=e._buildStorageConfig(t);return e._logger.debug("Gets storage config",n),n},e._getExistingValues=function(){var t={};return Object.keys(e.StorageKeys).forEach((function(n){var r=e.StorageKeys[n],i=m.getItem(r);null!=i&&(t[r]=i)})),t},e._buildStorageConfig=function(e){var t=r.Utils.Object.mergeDeep({},e);return delete t.textStyle,{playback:t}},e}();b(_,"StorageKeys",{MUTED:"muted",VOLUME:"volume",AUDIO_LANG:"audioLanguage",TEXT_LANG:"textLanguage",CAPTIONS_DISPLAY:"captionsDisplay",TEXT_STYLE:"textStyle",PLAYBACK_RATE:"playbackRate"}),b(_,"_logger",Object(r.getLogger)("StorageManager"));var k="kaltura.com",E="custom_data=",T="signature=";function A(e,t){e.config.session&&e.config.session.id?function(e,t){var n=/:((?:[a-z0-9]|-)*)/i.exec(e.config.session.id);n&&n[1]&&w(t,e.config.session.id.replace(n[1],r.Utils.Generator.guid()))}(e,t):function(e){var t=r.Utils.Generator.guid(),n=r.Utils.Generator.guid();w(e,t+":"+n)}(t)}function w(e,t){e.session=e.session||{},e.session.id=t}function S(e,t,n){if(void 0===n&&(n="playSessionId="),t){var r=new RegExp(n+"((?:[a-z0-9]|-)*:(?:[a-z0-9]|-)*)","i").exec(e);r&&r[1]?e=e.replace(r[1],t):e+=I(e)+n+t}return e}function C(){var e;try{e=window.parent.document.URL}catch(t){e=document.referrer}return e}function x(e){if(-1===e.indexOf("referrer=")){var t=btoa(C().substr(0,1e3));e+=I(e)+"referrer="+t}return e}function I(e){return-1===e.indexOf("?")?"?":"&"}function P(e,t){return-1===e.indexOf("clientTag=html5:v")&&(e+=I(e)+"clientTag=html5:v"+(t||"3.18.0-canary.0-ecfabb5")),e}function D(e,t){var n;A(e,t);var i=t.sources,a=t.session&&t.session.id,o=null==(n=V())?void 0:n.productVersion;Object.values(r.StreamType).forEach((function(e){i[e]&&i[e].forEach((function(e){"string"==typeof e.url&&e.url.toLowerCase().indexOf("playmanifest/")>-1&&!e.localSource&&(e.url=S(e.url,a),e.url=x(e.url),e.url=P(e.url,o),e.url=function(e,t){var n=r.Utils.Object.getPropertyPath(t,"seekFrom"),i=r.Utils.Object.getPropertyPath(t,"clipTo");return n&&"number"==typeof n&&-1===e.indexOf("seekFrom=")&&(e+=I(e)+"seekFrom="+1e3*n),i&&"number"==typeof i&&-1===e.indexOf("clipTo=")&&(e+=I(e)+"clipTo="+1e3*i),e}(e.url,i)),e.drmData&&e.drmData.length&&e.drmData.forEach((function(e){"string"==typeof e.licenseUrl&&[k,E,T].every((function(t){return e.licenseUrl.includes(t)}))&&(e.licenseUrl=S(e.licenseUrl,a,"sessionId="),e.licenseUrl=P(e.licenseUrl,o),e.licenseUrl=x(e.licenseUrl),e.licenseUrl=function(e,t){var n=r.Utils.Object.getPropertyPath(t,"provider.uiConfId");return-1===e.indexOf("uiConfId=")&&"number"==typeof n&&(e+=I(e)+"uiConfId="+n),e}(e.licenseUrl,t))}))}))}))}n(9);var R=function(){function e(e){void 0===e&&(e={}),e.observedThresholds=e.observedThresholds||M,e.playerThreshold="number"==typeof e.playerThreshold?e.playerThreshold:N,this._config=e,this._eventManager=new r.EventManager,this._targetsObserved=new r.Utils.MultiMap;var t={threshold:e.observedThresholds.map((function(e){return e/100}))};this._observer=new window.IntersectionObserver(this._intersectionChangedHandler.bind(this),t),this._initTabVisibility()}var t=e.prototype;return t._intersectionChangedHandler=function(e){var t=this;e.forEach((function(e){t._targetsObserved.get(e.target).forEach((function(t){var n=e.intersectionRatio>=t.threshold;t.lastIntersectionRatio=e.intersectionRatio,n!==t.lastVisible&&(t.lastVisible=n,t.listener(n,L.VIEWPORT))}))}))},t._handleTabVisibilityChange=function(){var e=this;this._isTabVisible=!document[this._visibilityTabHiddenAttr],this._targetsObserved.getAll().forEach((function(t){t.lastVisible&&t.listener(e._isTabVisible,L.TAB)}))},t._initTabVisibility=function(){void 0!==document.hidden?(this._visibilityTabHiddenAttr="hidden",this._visibilityTabChangeEventName="visibilitychange"):void 0!==document.msHidden?(this._visibilityTabHiddenAttr="msHidden",this._visibilityTabChangeEventName="msvisibilitychange"):void 0!==document.webkitHidden&&(this._visibilityTabHiddenAttr="webkitHidden",this._visibilityTabChangeEventName="webkitvisibilitychange"),this._visibilityTabHiddenAttr&&this._visibilityTabChangeEventName&&(this._eventManager.listen(document,this._visibilityTabChangeEventName,this._handleTabVisibilityChange.bind(this)),this._isTabVisible=!document[this._visibilityTabHiddenAttr])},t.observe=function(e,t,n){if(this._observer){var r="number"==typeof n?n:this._config.playerThreshold,i=new O(r/100,t);if(this._targetsObserved.has(e)){var a=this._targetsObserved.get(e)[0].lastIntersectionRatio;void 0!==a&&(i.lastIntersectionRatio=a,i.listener(this._isTabVisible&&a>=i.threshold,L.VIEWPORT))}else this._observer.observe(e);this._targetsObserved.push(e,i)}},t.unObserve=function(e,t){this._observer&&(this._targetsObserved.remove(e,t),this._targetsObserved.has(e)||this._observer.unobserve(e))},t.destroy=function(){this._observer&&(this._eventManager.destroy(),this._observer.disconnect(),this._targetsObserved.clear())},e}(),L={VIEWPORT:"viewport",TAB:"tab"},O=function(e,t){this.threshold=e,this.listener=t},M=[0,10,20,30,40,50,60,70,80,90,100],N=50,U=[],F="kalturaStartTime";function B(e){if(!e)throw new Error(l);!function(e){if(!e)throw new Error(u);var t=document.getElementById(e);if(!t)throw new Error(c+e);if(t.getElementsByClassName("kaltura-player-container").length>0)throw new Error(d+e)}(e.targetId)}function j(e){r.Utils.Object.getPropertyPath(e,"ui.log")||r.Utils.Object.createPropertyPath(e,"ui.log",{}),r.Utils.Object.getPropertyPath(e,"provider.log")||r.Utils.Object.createPropertyPath(e,"provider.log",{}),r.Utils.Object.getPropertyPath(e,"log")||r.Utils.Object.createPropertyPath(e,"log",{}),e.log&&"function"==typeof e.log.handler&&(Object(r.setLogHandler)(e.log.handler),e.ui.log.handler=e.provider.log.handler=e.log.handler);var t=r.LogLevel.ERROR;!e.log||!0!==window.DEBUG_KALTURA_PLAYER&&""!==H("debugKalturaPlayer")?e.log&&e.log.level&&r.LogLevel[e.log.level]&&(t=r.LogLevel[e.log.level]):(t=r.LogLevel.DEBUG,e.log.level=r.LogLevel.DEBUG.name),e.ui.log.level=e.provider.log.level=t.name,Object(r.setLogLevel)(t)}function H(e){var t;window.URLSearchParams?t=new URLSearchParams(window.location.search).get(e):t=function(e){e=e.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search),n=location.search.indexOf(e)>-1;return null===t?n?"":null:decodeURIComponent(t[1].replace(/\+/g," "))}(e);return t}function V(){return window.__kalturaplayerdata||{}}function G(e){var t=function(e){var t=document.createElement("div");t.id=r.Utils.Generator.uniqueId(5),t.className="kaltura-player-container",t.setAttribute("tabindex","-1");var n=document.getElementById(e);return n&&t&&n.appendChild(t),t.id}(e.targetId),n={targetId:e.targetId,provider:{partnerId:e.provider.partnerId},ui:{targetId:t},plugins:{},advertising:{adBreaks:[]},viewability:{observedThresholds:M,playerThreshold:N}};if(r.Utils.Object.mergeDeep(n,e),!e.provider.ignoreServerConfig){var i=r.Utils.Object.copyDeep(V());delete i.productVersion,n=r.Utils.Object.mergeDeep({},K(i),n)}return function(e){if(r.Env.isMacOS&&r.Env.isSafari||r.Env.isIOS){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.preferNative.hls")&&r.Utils.Object.mergeDeep(e,{playback:{preferNative:{hls:!0}}})}}(n),function(e){if(r.Env.isMacOS&&r.Env.isSafari||r.Env.isIOS){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"text.useNativeTextTrack")&&r.Utils.Object.mergeDeep(e,{text:{useNativeTextTrack:!0}})}}(n),function(e){r.Utils.Object.getPropertyPath(e,"plugins.kava")||r.Utils.Object.mergeDeep(e,{plugins:{kava:{disable:!0}}}),r.Utils.Object.getPropertyPath(e,"plugins.ottAnalytics")||r.Utils.Object.mergeDeep(e,{plugins:{ottAnalytics:{}}})}(n),function(e){if(r.Env.isSmartTV){if(Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!0}),function(e){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.playAdsWithMSE")&&(e=r.Utils.Object.createPropertyPath(e,"playback.playAdsWithMSE",!0));var t=r.Utils.Object.getPropertyPath(e,"plugins.ima.disableMediaPreload"),n=r.Utils.Object.getPropertyPath(e,"plugins.bumper.disableMediaPreload");e.plugins&&e.plugins.ima&&"boolean"!=typeof t&&(e=r.Utils.Object.createPropertyPath(e,"plugins.ima.disableMediaPreload",!0));e.plugins&&e.plugins.bumper&&"boolean"!=typeof n&&(e=r.Utils.Object.createPropertyPath(e,"plugins.bumper.disableMediaPreload",!0))}(e),function(e){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.options.html5.hls.liveSyncDurationCount")&&r.Env.isSafari&&(e=r.Utils.Object.createPropertyPath(e,"playback.options.html5.hls.liveSyncDurationCount",2))}(e),e.plugins&&e.plugins.ima){var t=r.Utils.Object.getPropertyPath(e,"plugins.ima.forceReloadMediaAfterAds"),n=r.Utils.Object.getPropertyPath(e,"plugins.ima.delayInitUntilSourceSelected");"boolean"!=typeof t&&(e=r.Utils.Object.createPropertyPath(e,"plugins.ima.forceReloadMediaAfterAds",!0)),"boolean"!=typeof n&&(e=r.Utils.Object.createPropertyPath(e,"plugins.ima.delayInitUntilSourceSelected",!0))}if(e.plugins&&e.plugins.youbora)"number"!=typeof r.Utils.Object.getPropertyPath(e,"plugins.youbora.playheadMonitorInterval")&&(e=r.Utils.Object.createPropertyPath(e,"plugins.youbora.playheadMonitorInterval",2e3));"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"streaming.lowLatencyMode")&&(e=r.Utils.Object.createPropertyPath(e,"streaming.lowLatencyMode",!1))}}(n),function(e){if("Edge"===r.Env.browser.name){r.Utils.Object.getPropertyPath(e,"drm.keySystem")||(e="Windows"===r.Env.os.name?r.Utils.Object.createPropertyPath(e,"drm.keySystem",r.DrmScheme.PLAYREADY):r.Utils.Object.createPropertyPath(e,"drm.keySystem",r.DrmScheme.WIDEVINE))}}(n),function(e){if(r.Env.isIOS&&e.plugins&&e.plugins.ima&&!e.plugins.ima.disable){var t=r.Utils.Object.getPropertyPath(e,"playback.playsinline"),n=r.Utils.Object.getPropertyPath(e,"plugins.ima.disableMediaPreload");!1===t&&"boolean"!=typeof n&&r.Utils.Object.createPropertyPath(e,"plugins.ima.disableMediaPreload",!0)}}(n),function(e){if(e.plugins&&e.plugins.imadai&&!e.plugins.imadai.disable){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.options.html5.hls.autoStartLoad")&&r.Utils.Object.mergeDeep(e,{playback:{options:{html5:{hls:{autoStartLoad:!1}}}}})}}(n),function(e){var t=r.Utils.Object.getPropertyPath(e,"plugins.bumper"),n=r.Utils.Object.getPropertyPath(e,"plugins.imadai");if(t){var i={};"boolean"!=typeof t.playOnMainVideoTag&&(r.Env.isSmartTV||r.Env.isIOS&&e.playback&&!1===e.playback.playsinline)&&(i.playOnMainVideoTag=!0),n&&!n.disable&&(Array.isArray(t.position)||(i.position=[0]),"boolean"!=typeof t.disableMediaPreload&&(i.disableMediaPreload=!0)),r.Utils.Object.mergeDeep(e,{plugins:{bumper:i}})}}(n),function(e){var t=r.Utils.Object.getPropertyPath(e,"plugins.vr");if(t&&!t.disable){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.inBrowserFullscreen")&&r.Utils.Object.mergeDeep(e,{playback:{inBrowserFullscreen:!0}})}}(n),function(e){if(r.Env.isIOS){var t=r.Utils.Object.getPropertyPath(e,"playback.playsinline"),n=r.Utils.Object.hasPropertyPath(e,"plugins.airplay"),i=!1!==t;n?Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!1,mutedAutoPlay:i}):"iPhone"!==r.Env.device.model||i||Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!1,mutedAutoPlay:!1})}}(n),n}function K(e){return function(){if(e.player){U.push({level:"warn",msg:"Path config.player will be deprecated soon. Please update your config structure as describe here: https://github.com/kaltura/kaltura-player-js/blob/master/docs/configuration.md"});var t=r.Utils.Object.copyDeep(e.player);delete e.player,r.Utils.Object.mergeDeep(e,t)}}(),[["duration","sources.duration"],["type","sources.type"],["dvr","sources.dvr"],["id","sources.id"],["name","metadata.name"],["metadata.poster","sources.poster"],["metadata","sources.metadata"],["logLevel","log.level"],["ui.components.fullscreen.inBrowserFullscreenForIOS","playback.inBrowserFullscreen"],["playback.enableCEA708Captions","text.enableCEA708Captions"],["playback.useNativeTextTrack","text.useNativeTextTrack"],["playback.options.html5.dash.useShakaTextTrackDisplay","text.useShakaTextTrackDisplay"],["playback.captionsTextTrack1Label","text.captionsTextTrack1Label"],["playback.captionsTextTrack1LanguageCode","text.captionsTextTrack1LanguageCode"],["playback.captionsTextTrack2Label","text.captionsTextTrack2Label"],["playback.captionsTextTrack2LanguageCode","text.captionsTextTrack2LanguageCode"],["plugins.visibility.threshold","viewability.playerThreshold"],["plugins.visibility.floating","plugins.floating"],["playback.startTime","sources.startTime"]].forEach((function(t){return function(t,n){if(r.Utils.Object.hasPropertyPath(e,t))if(U.push({level:"warn",msg:"Path config.player."+t+" will be deprecated soon. Please update your config structure as describe here: https://github.com/kaltura/kaltura-player-js/blob/master/docs/configuration.md"}),r.Utils.Object.hasPropertyPath(e,n))r.Utils.Object.deletePropertyPath(e,t);else{var i=r.Utils.Object.getPropertyPath(e,t),a=r.Utils.Object.createPropertyPath({},n,i);r.Utils.Object.mergeDeep(e,a),r.Utils.Object.deletePropertyPath(e,t)}}(t[0],t[1])})),e}function z(e,t,n){var r=e.config.playback,i=!1;return r.streamPriority.forEach((function(e){e.engine===t&&(i=!0)})),i||r.streamPriority.push({engine:t,format:n}),r}function W(e){var t=e&&e.progressive;return!(!t||!t[0]||"video/youtube"!==t[0].mimetype)}function Y(e){var t=e&&e.image;return!(!t||!t[0])}function q(e,t){var n={},i={};return r.Utils.Object.isObject(e)&&Object.entries(e).forEach((function(e){var a=e[0],o=e[1];n[a]={},i[a]={},Object.entries(o).forEach((function(e){var o=e[0],s=e[1],l=r.Utils.Object.getPropertyPath(t[a],o);n[a][o]=l||s,i[a][o]=l}))})),[n,i]}function X(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q(r.key),r)}}function Q(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var $=function(){function e(e,t,n){this.name=e,this.player=t,this.eventManager=new r.EventManager,this.logger=Object(r.getLogger)(r.Utils.String.capitlize(this.name)),this.config={},r.Utils.Object.mergeDeep(this.config,this.constructor.defaultConfig,n)}e.createPlugin=function(e,t,n){return void 0===n&&(n={}),new this(e,t,n)},e.isValid=function(){throw new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED,"isValid()")};var t,n,i,a=e.prototype;return a.getConfig=function(e){return e?r.Utils.Object.copyDeep(this.config[e]):r.Utils.Object.copyDeep(this.config)},a.updateConfig=function(e){r.Utils.Object.mergeDeep(this.config,e)},a.loadMedia=function(){},a.destroy=function(){this.eventManager.destroy()},a.reset=function(){},a.getName=function(){return this.name},a.dispatchEvent=function(e,t){this.logger.debug("Fire event: "+e,t),this.player.dispatchEvent(new r.FakeEvent(e,t))},t=e,(n=[{key:"ready",get:function(){return Promise.resolve()}}])&&X(t.prototype,n),i&&X(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function J(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){(t=Q(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}($,"defaultConfig",{});var Z=function(){function e(){J(this,"_plugins",{}),J(this,"_isDisabledPluginMap",new Map)}e.register=function(t,n){return"function"!=typeof n||n.prototype instanceof $==!1?(e._logger.error("Plugin <"+t+"> registration failed, either plugin is not an instance of BasePlugin or plugin handler is not a function"),!1):e._registry.has(t)?(e._logger.debug("Plugin <"+t+"> is already registered, do not register again"),!1):(e._registry.set(t,n),e._logger.debug("Plugin <"+t+"> has been registered successfully"),!0)},e.unRegister=function(t){e._registry.has(t)&&(e._registry.delete(t),e._logger.debug("Unregistered <"+t+"> plugin."))};var t=e.prototype;return t.load=function(t,n,i){if(void 0===i&&(i={}),!e._registry.has(t))throw e._logger.warn("Plugin <"+t+"> loading failed, plugin is not registered"),new r.Error(r.Error.Severity.RECOVERABLE,r.Error.Category.PLAYER,r.Error.Code.RUNTIME_ERROR_NOT_REGISTERED_PLUGIN,t);var a=e._registry.get(t);"boolean"==typeof i.disable&&this._isDisabledPluginMap.set(t,i.disable);var o=!!this._isDisabledPluginMap.get(t),s=!!a&&a.isValid();if(a&&s&&!o){try{this._plugins[t]=a.createPlugin(t,n,i)}catch(e){throw new r.Error(r.Error.Severity.RECOVERABLE,r.Error.Category.PLAYER,r.Error.Code.PLUGIN_LOAD_FAILED,e)}return this._isDisabledPluginMap.set(t,!1),e._logger.debug("Plugin <"+t+"> has been loaded"),!0}return e._logger.debug("Plugin <"+t+"> isn't loaded, isValid()="+s.toString()+", disabled="+o.toString()),!1},t.loadMedia=function(){var e=this;Object.keys(this._plugins).forEach((function(t){return e._plugins[t].loadMedia()}))},t.destroy=function(){var e=this;Object.keys(this._plugins).forEach((function(t){e._plugins[t].destroy(),delete e._plugins[t]}))},t.reset=function(){var e=this;Object.keys(this._plugins).forEach((function(t){return e._plugins[t].reset()}))},t.get=function(e){return this._plugins[e]},t.getAll=function(){return this._plugins},e}();J(Z,"_logger",Object(r.getLogger)("PluginManager")),J(Z,"_registry",new Map);var ee=Z.register,te={youbora:{playerVersion:"{{pVersion}}",playerName:"{{pName}}",entryId:"{{entryId}}",entryName:"{{entryName}}",entryType:"{{entryType}}",sessionId:"{{sessionId}}",uiConfId:"{{uiConfId}}"},googleAnalytics:{entryId:"{{entryId}}",entryName:"{{entryName}}",uiConfId:"{{uiConfId}}",partnerId:"{{partnerId}}"},ottAnalytics:{entryId:"{{entryId}}",ks:"{{ks}}",isAnonymous:"{{isAnonymous}}",partnerId:"{{partnerId}}",serviceUrl:"{{serviceUrl}}"},ima:{playerVersion:"{{pVersion}}",playerName:"{{pName}}"},kava:{playerVersion:"{{pVersion}}",playerName:"{{pName}}",partnerId:"{{partnerId}}",playlistId:"{{playlistId}}",entryId:"{{entryId}}",entryType:"{{entryType}}",sessionId:"{{sessionId}}",ks:"{{ks}}",uiConfId:"{{uiConfId}}",referrer:"{{referrer}}",encodedReferrer:"{{encodedReferrer}}",serviceUrl:"{{analyticsServiceUrl}}"},comscore:{playerVersion:"{{pVersion}}"},vr:{rootElement:"{{domRootElementId}}"},share:{partnerId:"{{partnerId}}",uiConfId:"{{uiConfId}}",entryId:"{{entryId}}",embedBaseUrl:"{{embedBaseUrl}}"}},ne=new RegExp("{{.*}}");function re(e,t){return(re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ie(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ae=function(e){var t,n;function i(){var t;return ie(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call(this)||this),"_ottPluginsConfig",{kava:{ks:""}}),t._config=r.Utils.Object.mergeDeep({},t._basePluginsConfig,t._ottPluginsConfig),t}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,re(t,n),i}(function(){function e(){this._basePluginsConfig=r.Utils.Object.copyDeep(te)}var t=e.prototype;return t.get=function(){return this._config},t.set=function(e){if(e){var t=function e(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var i=n[0],a=n[1];return r.Utils.Object.isObject(a)?t[i]=e(a):"string"==typeof a&&ne.test(a)?t[i]=a:t[i]=void 0,t}),{})}(e);this._config=function e(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var i=n[0],a=n[1];return r.Utils.Object.isObject(a)?t[i]=e(a):a&&(t[i]=a),t}),{})}(r.Utils.Object.mergeDeep(this._config,t))}},t.reset=function(){this._config=r.Utils.Object.copyDeep(te)},e}());var oe=function(e,t){void 0===t&&(t={});try{var n,r=e;for(var i in t){var a=void 0!==t[i]&&null!==t[i]?t[i]:"";"string"==typeof a&&a.indexOf('"')>-1&&(a=a.replace(/"/g,'\\"')),n=new RegExp("{{"+i+"}}","g"),r=r.replace(n,a)}return r}catch(e){return""}},se=Object(r.getLogger)("PluginsConfig"),le=function(e){return("number"==typeof e||"function"==typeof e||"string"==typeof e||"boolean"==typeof e||r.Utils.Object.isClassInstance(e))&&!ne.test(e.toString())},ue=function(e){return r.Utils.Object.isObject(e)&&"function"!=typeof e&&!r.Utils.Object.isClassInstance(e)},ce=function(e){return e.map((function(e){if(ue(e)){var t=de(e);return r.Utils.Object.isEmptyObject(t)?null:t}return le(e)?e:null})).filter((function(e){return null!==e}))},de=function e(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var r=n[0],i=n[1];return ue(i)?t[r]=e(i):Array.isArray(i)?t[r]=ce(i):le(i)&&(t[r]=i),t}),{})};var pe=function(){function e(){this._pluginConfigStore=new ae}return e.prototype.evaluatePluginsConfig=function(e,t){if(e){this._pluginConfigStore.set(e);var n=function(e){var t,n={pVersion:(null==(t=V())?void 0:t.productVersion)||"3.18.0-canary.0-ecfabb5",pName:"@playkit-js/kaltura-player-js"};if(e.targetId&&(n.domRootElementId=e.targetId),e.provider&&e.provider.env){n.serviceUrl=e.provider.env.serviceUrl;var i=r.Utils.Object.getPropertyPath(e,"provider.env.analyticsServiceUrl");i&&(n.analyticsServiceUrl=i+"/api_v3/index.php"),n.serviceUrl&&(n.embedBaseUrl=n.serviceUrl.replace("api_v3",""))}var a,o={referrer:C(),encodedReferrer:(a=C(),encodeURIComponent(a))};return e.provider&&r.Utils.Object.mergeDeep(o,{ks:e.provider.ks,uiConfId:e.provider.uiConfId,partnerId:e.provider.partnerId}),e.session&&r.Utils.Object.mergeDeep(o,{sessionId:e.session.id,ks:e.session.ks,isAnonymous:e.session.isAnonymous,uiConfId:e.session.uiConfId,partnerId:e.session.partnerId}),e.sources&&r.Utils.Object.mergeDeep(o,{entryId:e.sources.id,entryName:e.sources.metadata&&e.sources.metadata.name,entryType:e.sources.type}),e.playlist&&r.Utils.Object.mergeDeep(o,{playlistId:e.playlist.id}),Object.keys(o).forEach((function(e){void 0===o[e]&&delete o[e]})),r.Utils.Object.mergeDeep(n,o),n}(t),i=r.Utils.Object.mergeDeep({},this._pluginConfigStore.get(),e);!function(e,t){var n=de(t),i=de(e);i&&n&&Object.keys(e).forEach((function(t){e&&e[t]&&(e[t]=r.Utils.Object.mergeDeep({},n[t],i[t]))}))}(e,function(e){var t,n;e=(n=e)?n.replace(/\\n/g,"\\n").replace(/\\'/g,"\\'").replace(/\\"/g,'\\"').replace(/\\&/g,"\\&").replace(/\\r/g,"\\r").replace(/\\t/g,"\\t").replace(/\\b/g,"\\b").replace(/\\f/g,"\\f").replace(/[\u0000-\u0019]+/g,""):"";try{t=JSON.parse(e,(function(e){try{return JSON.parse(this[e])}catch(t){return this[e]}}))}catch(e){se.error("An error occurred while formatting config string.",e),t={}}return t}(oe(JSON.stringify(i),n)))}},e}();function he(e,t,n){var r=e.poster,i=t.poster,a=n.width,o=n.height;if("string"==typeof r&&r===i){/.*\/thumbnail\/.*(?:width|height)\/\d+\/(?:height|width)\/\d+/.test(r)&&(e.poster=function(e,t,n){var r=e.match(/width\/(\d+)/),i=e.match(/height\/(\d+)/);Array.isArray(r)&&(e=e.replace(r[1],t.toString()));Array.isArray(i)&&(e=e.replace(i[1],n.toString()));return e}(r,a,o))}else Array.isArray(r)&&(e.poster=function(e,t,n){var r=1/0,i="";return e.forEach((function(e){var a=e.width,o=e.height,s=Math.abs(a-t)+Math.abs(o-n);s<r&&(r=s,i=e.url)})),i}(r,a,o));t.poster=e.poster||""}n(10);function fe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ye(r.key),r)}}function ge(e,t,n){return(t=ye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var ve=function(){function e(e,t){var n=this;ge(this,"_disabled",!1),this._player=e;var r=t.ui;if(r.disable){this._disabled=!0;var a=document.getElementById(r.targetId);a&&a.appendChild(e.getView())}else this._uiManager=new i.UIManager(e,r),r.customPreset?this._uiManager.buildCustomUI(r.customPreset):this._uiManager.buildDefaultUI(),this._handleVr(t.plugins),this._handleExternalCSS(r);return new Proxy(this,{get:function(e,t){return n._disabled?function(){}:e[t]}})}var t,n,a,o=e.prototype;return o.destroy=function(){this._uiManager.destroy()},o.reset=function(){this._resetErrorState()},o.setConfig=function(e,t){this._uiManager.setConfig(e,t)},o.addComponent=function(e){return this._uiManager.addComponent(e)},o.removeComponent=function(e){var t={label:"Remove_"+e.removeComponent,get:i.Components.Remove,presets:e.presets,area:e.area||e.container,replaceComponent:e.removeComponent};return this._uiManager.addComponent(t)},o.registerManager=function(e,t){this._player.registerService(e,t)},o.getManager=function(e){return this._player.getService(e)},o.hasManager=function(e){return this._player.hasService(e)},o.setLoadingSpinnerState=function(e){this.setConfig({show:e},"loading")},o._resetErrorState=function(){this.setConfig({hasError:!1},"engine")},o._handleExternalCSS=function(t){t.css&&r.Utils.Dom.loadStyleSheetAsync(t.css).then((function(){e._logger.debug("external css was loaded successfully")}),(function(){e._logger.error("external css failed to load")}))},o._handleVr=function(e){void 0===e&&(e={}),e.vr&&!e.vr.disable&&this._setStereoConfig(e.vr)},o._setStereoConfig=function(e){(e.toggleStereo||(r.Env.isMobile||r.Env.isTablet)&&!1!==e.toggleStereo)&&this.setConfig(r.Utils.Object.mergeDeep({},{vrStereoMode:!!e.startInStereo}),"vrStereo")},t=e,(n=[{key:"store",get:function(){return this._uiManager.store}}])&&fe(t.prototype,n),a&&fe(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();ge(ve,"_logger",Object(r.getLogger)("UIWrapper"));var me={PLAYLIST_LOADED:"kaltura-player-playlistloaded",PLAYLIST_ITEM_CHANGED:"kaltura-player-playlistitemchanged",PLAYLIST_ENDED:"kaltura-player-playlistended"};function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_e(r.key),r)}}function _e(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var ke=["hls","dash","progressive","image"],Ee=function(){function e(e,t,n){this._sources=e,this._config=t,this._index=n}var t,n,i,a=e.prototype;return a.updateSources=function(e){this._sources=r.Utils.Object.mergeDeep({},e)},a.updatePlugins=function(e){this._plugins=r.Utils.Object.copyDeep(e)},a.isPlayable=function(){var e=this;return!!ke.find((function(t){return e._sources&&e._sources[t]&&e._sources[t].length}))},t=e,(n=[{key:"sources",get:function(){var e=this;return ke.forEach((function(t){e._sources&&e._sources[t]&&0===e._sources[t].length&&delete e._sources[t]})),this._sources}},{key:"config",get:function(){return this._config}},{key:"plugins",get:function(){return this._plugins||{}}},{key:"index",get:function(){return this._index}}])&&be(t.prototype,n),i&&be(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ae(r.key),r)}}function Ae(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var we=function(){function e(){this._id="",this._metadata={name:"",description:""},this._poster="",this._items=[],this._activeItemIndex=-1}var t,n,i,a=e.prototype;return a.configure=function(e,t){var n=this;this._id=e.id?e.id:this._id,this._poster=e.poster?e.poster:this._poster,this._metadata=e.metadata?e.metadata:this._metadata,e.items&&(this._items=[],e.items.forEach((function(e,i){if(e.sources){var a=r.Utils.Object.mergeDeep({},t),o=e.sources.options||{};e.sources.options=r.Utils.Object.mergeDeep(a,o)}n._items.push(new Ee(e.sources,e.config,i))})))},a.updateItemSources=function(e,t){this._items[e].updateSources(t)},a.updateItemPlugins=function(e,t){this._items[e].updatePlugins(t)},a.getNext=function(e){var t=e?(this._activeItemIndex+1)%this._items.length:this._activeItemIndex+1;return this._items[t]||null},t=e,(n=[{key:"id",get:function(){return this._id}},{key:"items",get:function(){return this._items}},{key:"metadata",get:function(){return this._metadata}},{key:"poster",get:function(){return this._poster}},{key:"current",get:function(){return this._items[this._activeItemIndex]||null}},{key:"prev",get:function(){return this._items[this._activeItemIndex-1]||null}},{key:"activeItemIndex",set:function(e){this._activeItemIndex=e}}])&&Te(t.prototype,n),i&&Te(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ce(r.key),r)}}function Ce(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var xe=function(){function e(e,t){this._player=e,this._eventManager=new r.EventManager,this._playlist=new we,this._options={autoContinue:!0,loop:!1,imageDuration:5},this._countdown={duration:10,showing:!0},this._mediaInfoList=[],this._playerOptions=t,this._appPluginConfig={}}var t,n,i,a=e.prototype;return a.configure=function(e,t){e&&(this._playlist.configure(e,r.Utils.Object.getPropertyPath(this._player.sources,"options")),r.Utils.Object.mergeDeep(this._options,e.options),r.Utils.Object.mergeDeep(this._countdown,e.countdown),e.items&&e.items.find((function(e){return!!e.sources}))&&(this._mediaInfoList=e.items.map((function(e,n){return t&&t.entries&&"object"==typeof t.entries[n]?t.entries[n]:{entryId:e.sources.id}})),this._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_LOADED,{playlist:this})),this._addBindings(),this.playNext()))},a.load=function(e,t,n){var r=this._getMergedPlaylistData(e,t);this.configure(r,n)},a.reset=function(){this._eventManager.removeAll(),this._playlist=new we,this._mediaInfoList=[]},a.playNext=function(){e._logger.debug("playNext");var t=this._playlist.getNext(!0);t&&this._setItem(t)},a.playPrev=function(){e._logger.debug("playPrev");var t=this._playlist.prev;t&&this._setItem(t)},a.playItem=function(t){e._logger.debug("playItem("+t+")");var n=this._playlist.items[t];n&&this._setItem(n)},a._getMergedPlaylistData=function(e,t){var n=this;return{id:e.id,metadata:e.metadata,poster:e.poster,options:t?t.options:this._options,countdown:t?t.countdown:this.countdown,items:e.items.map((function(e,i){var a=r.Utils.Object.copyDeep(e);return["sources.dvr","sources.type"].forEach((function(e){r.Utils.Object.deletePropertyPath(a,e)})),r.Utils.Object.mergeDeep(a.sources,t&&t.items&&t.items[i]&&t.items[i].sources),Array.isArray(a.sources.poster)&&n._player.updateKalturaPoster(a.sources,e.sources,n._player.dimensions),{sources:a.sources,config:t&&t.items&&t.items[i]&&t.items[i].config}}))}},a._addBindings=function(){var e=this;this._eventManager.listen(this._player,this._player.Event.Core.PLAYBACK_ENDED,(function(){return e._onPlaybackEnded()})),this._eventManager.listen(this._player,this._player.Event.Core.CHANGE_SOURCE_STARTED,(function(){return e._onChangeSourceStarted()}))},a._onPlaybackEnded=function(){var e=this._playlist.getNext(!1);e||this._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_ENDED)),!this._playerOptions.ui.disable&&this.countdown.showing||(e&&this._options.autoContinue||this._options.loop)&&this.playNext()},a._onChangeSourceStarted=function(){this._player.isImage()&&this._player.configure({sources:{duration:this._options.imageDuration}})},a._setItem=function(t){var n=this,i=t.index;e._logger.debug("Playing item number "+i,t);var a,o={loop:!1};this._playlist.current&&(this._player._playbackStart?o.autoplay=!0:o.autoplay=!(null==(a=this._playerOptions.playback)||!a.autoplay));if(this._player.configure({playback:o}),this._playlist.activeItemIndex=i,t.isPlayable()){var s,l;this._resetProviderPluginsConfig();var u=q(t.plugins,this._player.config.plugins),c=u[0];this._appPluginConfig=u[1];var d={session:this._player.config.session,plugins:c,sources:t.sources};return this._player.setMedia(d),this._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_ITEM_CHANGED,{index:i,activeItem:t,entryId:(null==(s=this._mediaInfoList[i])?void 0:s.entryId)||(null==(l=t.sources)?void 0:l.id)})),Promise.resolve()}if(this._mediaInfoList[i]){this._resetProviderPluginsConfig();var p={sources:t.sources};return this._player.setMedia(p),this._player.loadMedia(this._mediaInfoList[i]).then((function(e){n._playlist.updateItemSources(i,e.sources),n._playlist.updateItemPlugins(i,e.plugins),n._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_ITEM_CHANGED,{index:i,activeItem:t,entryId:n._mediaInfoList[i].entryId}))}))}return Promise.reject()},a._resetProviderPluginsConfig=function(){this._player.configure({plugins:this._appPluginConfig}),this._appPluginConfig={}},a.destroy=function(){this._eventManager.destroy()},t=e,(n=[{key:"items",get:function(){return this._playlist.items}},{key:"current",get:function(){return this._playlist.current}},{key:"next",get:function(){return this._playlist.getNext(this._options.loop)}},{key:"prev",get:function(){return this._playlist.prev}},{key:"id",get:function(){return this._playlist.id}},{key:"metadata",get:function(){return this._playlist.metadata}},{key:"poster",get:function(){return this._playlist.poster}},{key:"countdown",get:function(){if(this._playlist.current&&this._playlist.current.config){var e={duration:10,showing:!0};return r.Utils.Object.mergeDeep(e,this._countdown,this._playlist.current.config.countdown),e}return this._countdown}},{key:"options",get:function(){return this._options}}])&&Se(t.prototype,n),i&&Se(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();!function(e,t,n){(t=Ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(xe,"_logger",Object(r.getLogger)("PlaylistManager"));var Ie={CAST_SESSION_START_FAILED:"kaltura-player-castsessionstartfailed",CAST_SESSION_STARTING:"kaltura-player-castsessionstarting",CAST_SESSION_STARTED:"kaltura-player-castsessionstarted",CAST_SESSION_ENDING:"kaltura-player-castsessionending",CAST_SESSION_ENDED:"kaltura-player-castsessionended",CAST_AVAILABLE:"kaltura-player-castavailable"},Pe=function(e){this.textStyle=e.textStyle,this.mediaInfo=e.getMediaInfo(),this.mediaConfig=e.getMediaConfig(),this.advertising=e.config.plugins&&e.config.plugins.ima,this.config=r.Utils.Object.mergeDeep({},e.config,{sources:{startTime:De(e)},playback:{autoplay:0===e.currentTime||!e.paused,audioLanguage:Re(r.TrackType.AUDIO,e),textLanguage:Re(r.TrackType.TEXT,e)}})};function De(e){return e.isLive()?e.isDvr()?e.duration-e.currentTime<e.config.cast.dvrThreshold||!e.currentTime?-1:e.currentTime:-1:!e.isCasting()&&!e.currentTime&&e.config.sources.startTime>-1?e.config.sources.startTime:e.currentTime}function Re(e,t){var n=t.getActiveTracks();if(n[e])return n[e].language;try{return t.config.playback[e+"Language"]}catch(e){return null}}function Le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Oe(r.key),r)}}function Oe(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var Me=function(){function e(e,t,n){this._id=e,this._friendlyName=t,this._resuming=n}var t,n,r;return t=e,(n=[{key:"deviceFriendlyName",get:function(){return this._friendlyName}},{key:"id",get:function(){return this._id}},{key:"resuming",get:function(){return this._resuming}}])&&Le(t.prototype,n),r&&Le(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Be(r.key),r)}}function Ue(e,t){return(Ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e,t,n){return(t=Be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var je=function(e){var t,n;function i(t,n,a){var o;return Fe(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(o=e.call(this)||this),"_isCastInitiator",!1),o._playerConfig={},i._logger=Object(r.getLogger)(t),o._remoteControl=a,o._castConfig=r.Utils.Object.mergeDeep({},o.constructor.defaultConfig,n),o._eventManager=new r.EventManager,i._logger.debug("Initialized"),o}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ue(t,n),i.isSupported=function(){return!0};var a,o,s,l=i.prototype;return l.loadMedia=function(e){return Promise.resolve()},l.setMedia=function(e){},l.getMediaInfo=function(){},l.getMediaConfig=function(){},l.configure=function(e){void 0===e&&(e={})},l.ready=function(){return Promise.resolve()},l.load=function(){},l.play=function(){},l.pause=function(){},l.reset=function(){},l.destroy=function(){},l.isLive=function(){return!1},l.isDvr=function(){return!1},l.seekToLiveEdge=function(){},l.getStartTimeOfDvrWindow=function(){return 0},l.getTracks=function(e){return[]},l.getActiveTracks=function(){return{audio:void 0,video:void 0,text:void 0}},l.selectTrack=function(e){},l.hideTextTrack=function(){},l.enableAdaptiveBitrate=function(){},l.isAdaptiveBitrateEnabled=function(){return!0},l.setTextDisplaySettings=function(e){},l.startCasting=function(){},l.stopCasting=function(){},l.isCasting=function(){return!0},l.isCastAvailable=function(){return!0},l.getCastSession=function(){return new Me("","")},l.isVr=function(){return!1},l.toggleVrStereoMode=function(){},l.isInVrStereoMode=function(){return!1},a=i,(o=[{key:"ads",get:function(){return null}},{key:"textStyle",get:function(){return new r.TextStyle},set:function(e){}},{key:"buffered",get:function(){return[]}},{key:"currentTime",get:function(){return 0},set:function(e){}},{key:"duration",get:function(){return 0}},{key:"liveDuration",get:function(){return NaN}},{key:"volume",get:function(){return 1},set:function(e){}},{key:"paused",get:function(){return!1}},{key:"ended",get:function(){return!1}},{key:"seeking",get:function(){return!1}},{key:"muted",get:function(){return!1},set:function(e){}},{key:"src",get:function(){return""}},{key:"poster",get:function(){return""}},{key:"playbackRate",get:function(){return 1},set:function(e){}},{key:"engineType",get:function(){return""}},{key:"streamType",get:function(){return""}},{key:"type",get:function(){return i.Type}},{key:"config",get:function(){return this._playerConfig}},{key:"isCastInitiator",get:function(){return this._isCastInitiator},set:function(e){this._isCastInitiator=e}}])&&Ne(a.prototype,o),s&&Ne(a,s),Object.defineProperty(a,"prototype",{writable:!1}),i}(r.FakeEventTarget);function He(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ve(r.key),r)}}function Ve(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}Fe(je,"defaultConfig",{}),Fe(je,"Type","BaseRemotePlayer");var Ge=function(){function e(){var e=this;!function(e,t,n){(t=Ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"_uis",[{template:function(t){return e.idleUI(t)},condition:function(e){return e.engine.isIdle}},{template:function(t){return e.errorUI(t)},condition:function(e){return e.engine.hasError}},{template:function(t){return e.adsUI(t)},condition:function(e){return e.engine.adBreak}},{template:function(t){return e.liveUI(t)},condition:function(e){return e.engine.isLive}},{template:function(t){return e.playbackUI(t)}}])}var t,n,r,a=e.prototype;return a.playbackUI=function(e){return i.Presets.playbackUI(e)},a.idleUI=function(e){return i.Presets.idleUI(e)},a.adsUI=function(e){return i.Presets.adsUI(e)},a.liveUI=function(e){return i.Presets.liveUI(e)},a.errorUI=function(e){return i.Presets.errorUI(e)},t=e,(n=[{key:"uis",get:function(){return this._uis}}])&&He(t.prototype,n),r&&He(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ke(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ze(e,t)}function ze(e,t){return(ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function We(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qe(r.key),r)}}function Ye(e,t,n){return t&&We(e.prototype,t),n&&We(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qe(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var Xe=function(){function e(e){this._player=e}return Ye(e,[{key:"player",get:function(){return this._player}}]),e}(),Qe=function(e){function t(t,n,r){var i;return(i=e.call(this,t)||this)._session=n,r&&(i._ui=r),i}return Ke(t,e),Ye(t,[{key:"ui",get:function(){return this._ui}},{key:"session",get:function(){return this._session}}]),t}(Xe),$e=function(e){function t(t,n){var r;return(r=e.call(this,t)||this)._snapshot=n,r}return Ke(t,e),Ye(t,[{key:"snapshot",get:function(){return this._snapshot}}]),t}(Xe),Je=function(e){function t(t,n){var r;return(r=e.call(this,t)||this)._available=n,r}return Ke(t,e),Ye(t,[{key:"available",get:function(){return this._available}}]),t}(Xe);var Ze=function(e){this.getPlayerSnapshot=ot.bind(e),this.getUIWrapper=st.bind(e),this.onRemoteDeviceAvailable=it.bind(e),this.onRemoteDeviceConnected=tt.bind(e),this.onRemoteDeviceDisconnected=rt.bind(e),this.onRemoteDeviceConnecting=et.bind(e),this.onRemoteDeviceDisconnecting=nt.bind(e),this.onRemoteDeviceConnectFailed=at.bind(e)};function et(){Ze._logger.debug("onRemoteDeviceConnecting"),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_STARTING))}function tt(e){var t=this;Ze._logger.debug("onRemoteDeviceConnected",e);var n=e.player,i=e.ui,a=e.session;this._eventManager.removeAll(),Object.values(r.EventType).forEach((function(e){return t._eventManager.listen(n,e,(function(e){return t.dispatchEvent(e)}))}));var o=this.config;i&&r.Utils.Object.mergeDeep(o,{ui:{customPreset:i.uis}}),this.configure({playback:{muted:this.muted,volume:this.volume}}),this._localPlayer.reset(),this._uiWrapper.destroy(),this._remotePlayer=n,this._uiWrapper=new ve(this,o),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_STARTED,{session:a}))}function nt(){Ze._logger.debug("onRemoteDeviceDisconnecting"),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_ENDING))}function rt(e){var t=this;Ze._logger.debug("onRemoteDeviceDisconnected",e);var n=e.player,i=e.snapshot;if(this._remotePlayer&&this._remotePlayer===n&&(this._eventManager.removeAll(),lt.call(this,i),i)){this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_ENDED));var a,o=this.config,s=!i.config.playback.autoplay,l=i.mediaInfo,u=i.mediaConfig;i.config.playback.autoplay=!0,ut.call(this,i.config),this._eventManager.listenOnce(this,this.Event.Core.CHANGE_SOURCE_ENDED,(function(){ct.call(t,i.config.sources)})),l?a=this.loadMedia(l):u&&(a=Promise.resolve(),this.setMedia(u)),a&&a.then((function(){t._eventManager.listenOnce(t,t.Event.Core.FIRST_PLAYING,(function(){t.textStyle=i.textStyle,ut.call(t,o),dt.call(t,i.config.playback),s&&t.pause()}))}))}}function it(e){Ze._logger.debug("onRemoteDeviceAvailable",e);var t=e.player,n=e.available;this.dispatchEvent(new r.FakeEvent(Ie.CAST_AVAILABLE,{type:t.type,available:n}))}function at(){Ze._logger.debug("onRemoteDeviceConnectFailed"),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_START_FAILED))}function ot(){var e=new Pe(this);return Ze._logger.debug("getPlayerSnapshot",e),e}function st(){return Ze._logger.debug("getUIWrapper"),this._uiWrapper}function lt(e){var t=this;this._uiWrapper.destroy();var n=this._localPlayer.config;if(n.plugins&&n.plugins.ima){var i={};if(n.cast.advertising&&n.cast.advertising.vast){if(e.config.sources.startTime>0){var a=n.plugins.ima.adTagUrl;i={adTagUrl:""},this._eventManager.listen(this,r.EventType.FIRST_PLAYING,(function(){return t.configure({plugins:{ima:{adTagUrl:a}}})}))}}else i={delayInitUntilSourceSelected:!0};r.Utils.Object.mergeDeep(n,{plugins:{ima:i}}),this._localPlayer.destroy(),this._remotePlayer=null,this._localPlayer=Object(r.loadPlayer)(n)}else this._remotePlayer=null;Object.values(r.EventType).forEach((function(e){return t._eventManager.listen(t._localPlayer,e,(function(e){return t.dispatchEvent(e)}))})),this._uiWrapper=new ve(this,this.config),this._uiWrapper.setConfig({isCastAvailable:this.isCastAvailable()},"engine")}function ut(e){var t=e.sources.startTime,n=e.playback.autoplay;this.configure({sources:{startTime:t},playback:{autoplay:n}})}function ct(e){if(e.captions.length){var t=e.captions;this.configure({sources:{captions:t}})}}function dt(e){if(e.audioLanguage){var t=this.getTracks(r.TrackType.AUDIO).find((function(t){return t.language===e.audioLanguage}));this.selectTrack(t)}if(e.textLanguage){var n=this.getTracks(r.TrackType.TEXT).find((function(t){return t.language===e.textLanguage}));this.selectTrack(n)}}function pt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Ze,"_logger",Object(r.getLogger)("RemoteControl"));var ht=function(){function e(){pt(this,"_remotePlayers",new Map)}e.register=function(t,n){"function"==typeof n?e._registry.has(t)?e._logger.debug("Remote player of type "+t+" is already registered"):(e._logger.debug("Register remote player of type "+t),e._registry.set(t,n)):e._logger.debug("remote player must be instance of BaseRemotePlayer")};var t=e.prototype;return t.load=function(t,n){var r=this;e._registry.forEach((function(i,a){e._logger.debug("Load remote player of type "+a);var o=new i(t,new Ze(n),n.config.targetId);r._remotePlayers.set(a,o)}))},t.startCasting=function(t){e._logger.debug("Start casting");var n=this._getRemotePlayer(t);return n?n.startCasting():Promise.reject()},t.isCastAvailable=function(t){var n=this._getRemotePlayer(t);return!!n&&(e._logger.debug("isCastAvailable: "+n.isCastAvailable()),n.isCastAvailable())},t.destroy=function(){var e=this._remotePlayers;Array.from(e.values()).forEach((function(e){return e.destroy()}))},t.setIsCastInitiator=function(e,t){var n=this._getRemotePlayer(e);n&&(n.isCastInitiator=t)},t._getRemotePlayer=function(e){var t=this._remotePlayers;return e&&t.get(e)?t.get(e):t.size>0?Array.from(t.values())[0]:void 0},e}();function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gt(r.key),r)}}function gt(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}pt(ht,"_registry",new Map),pt(ht,"_logger",Object(r.getLogger)("RemotePlayerManager"));var yt=function(){function e(e){this._type=e.type,this._position=e.position,this._numAds=e.numAds}var t,n,r;return e.prototype.toJSON=function(){return{type:this.type,position:this.position,numAds:this.numAds}},t=e,(n=[{key:"type",get:function(){return this._type}},{key:"position",get:function(){return this._position}},{key:"numAds",get:function(){return this._numAds}}])&&ft(t.prototype,n),r&&ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function vt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mt(r.key),r)}}function mt(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var bt=function(){function e(e,t){this._id=e,this._system=t.system,this._url=t.url,this._contentType=t.contentType,this._title=t.title,this._position=t.position,this._duration=t.duration,this._clickThroughUrl=t.clickThroughUrl,this._posterUrl=t.posterUrl,this._skipOffset=t.skipOffset,this._linear=t.linear,this._width=t.width||0,this._height=t.height||0,this._bitrate=t.bitrate||0,this._bumper=t.bumper,this._inStream=t.inStream||!1,this._vpaid=t.vpaid||!1,this._streamId=t.streamId||"",this._wrapperAdIds=t.wrapperAdIds,this._wrapperCreativeIds=t.wrapperCreativeIds,this._wrapperAdSystems=t.wrapperAdSystems}var t,n,r;return e.prototype.toJSON=function(){return{id:this.id,system:this.system,url:this.url,contentType:this.contentType,title:this.title,position:this.position,duration:this.duration,clickThroughUrl:this.clickThroughUrl,posterUrl:this.posterUrl,skipOffset:this.skipOffset,linear:this.linear,skippable:this.skippable,width:this.width,height:this.height,bitrate:this.bitrate,bumper:this.bumper,inStream:this.inStream,vpaid:this.vpaid}},t=e,(n=[{key:"id",get:function(){return this._id}},{key:"system",get:function(){return this._system}},{key:"contentType",get:function(){return this._contentType}},{key:"url",get:function(){return this._url}},{key:"title",get:function(){return this._title}},{key:"position",get:function(){return this._position}},{key:"duration",get:function(){return this._duration}},{key:"clickThroughUrl",get:function(){return this._clickThroughUrl}},{key:"posterUrl",get:function(){return this._posterUrl}},{key:"skipOffset",get:function(){return this._skipOffset}},{key:"linear",get:function(){return this._linear}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"bitrate",get:function(){return this._bitrate}},{key:"bumper",get:function(){return this._bumper}},{key:"inStream",get:function(){return this._inStream}},{key:"skippable",get:function(){return!!(this.skipOffset&&this.skipOffset>0)}},{key:"vpaid",get:function(){return this._vpaid}},{key:"streamId",get:function(){return this._streamId}},{key:"wrapperAdIds",get:function(){return this._wrapperAdIds}},{key:"wrapperCreativeIds",get:function(){return this._wrapperCreativeIds}},{key:"wrapperAdSystems",get:function(){return this._wrapperAdSystems}}])&&vt(t.prototype,n),r&&vt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function _t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kt=function(){function e(t){var n=this;_t(this,"_prebid",null),this._loadPromise=r.Utils.Object.defer(),this._loadPromise.catch((function(){return e._logger.warn("Prebid SDK failed to load")})),t?(this._config=t,this._loadPrebidSDKLib(this._config.libUrl).then((function(){n._isPrebidSDKLibLoaded()?(n._prebid=window.pbjs,n._loadPromise.resolve()):n._loadPromise.reject()})).catch((function(){n._loadPromise.reject()}))):this._loadPromise.reject()}var t=e.prototype;return t._isPrebidSDKLibLoaded=function(){return window.pbjs&&window.pbjs.que},t._loadPrebidSDKLib=function(e){return this._isPrebidSDKLibLoaded()?Promise.resolve():r.Utils.Dom.loadScriptAsync(e)},t._load=function(t){var n=this;return new Promise((function(r,i){n._loadPromise.then((function(){var a=setTimeout(i,t.timeout||4e3);n._prebid.que.push((function(){n._prebid.addAdUnits(t.adUnit),t.options&&n._prebid.setConfig(t.options),n._prebid.requestBids({bidsBackHandler:function(o){if(e._logger.debug("returned bids",o),clearTimeout(a),t.params){var s={};t.adUnit&&(s.adUnit=t.adUnit),s.params=t.params;var l=n._prebid.adServers.dfp.buildVideoUrl(s);r([{vastUrl:l}])}else try{var u=o[t.adUnit.code||Object.keys(o)[0]].bids;r(u)}catch(e){i()}}})}))})).catch(i)}))},t.load=function(e){return this._load(e||this._config)},e}();function Et(e,t){return(Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Tt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}_t(kt,"_logger",Object(r.getLogger)("PrebidManager"));var At=function(e){var t,n;function r(t){var n;return Tt(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call(this)||this),"id","AdLayoutMiddleware"),n._context=t,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Et(t,n);var i=r.prototype;return i.load=function(e){var t=this;this._context.prerollReady.then((function(){return t.callNext(e)}))},i.play=function(e){var t=this;this._context.prerollReady.then((function(){return t.callNext(e)}))},r}(r.BaseMiddleware);function wt(){return(wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xt(r.key),r)}}function Ct(e,t){return(Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function xt(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var It=function(e){var t,n;function i(t,n){var i;return(i=e.call(this)||this)._player=t,i._eventManager=new r.EventManager,i._liveEventManager=new r.EventManager,i._adsPluginControllers=n,i._prebidManager=new kt(i._player.config.advertising&&i._player.config.advertising.prebid),i._init(),i}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ct(t,n);var a,o,s,l=i.prototype;return l.isAdPlaying=function(){return this.isAdBreak()&&this._isAdPlaying},l.isAdBreak=function(){return!!this._adBreak},l.getAdBreaksLayout=function(){return this._adBreaksLayout},l.getAdBreak=function(){return this._adBreak},l.getAd=function(){return this._ad},l.skipAd=function(){var e=this._adsPluginControllers.find((function(e){return e.active}));e&&e.skipAd()},l.playAdNow=function(e){var t=this;if(this.isAdBreak())i._logger.warn("Tried to call playAdNow during an ad break");else{var n=Promise.all(e.map((function(e){return t._getPrebidAds(e)})));this._playAdBreak({position:this._player.currentTime||0,ads:e,played:!1,loadedPromise:n})}},l.getMiddleware=function(){return this._middleware?this._middleware:this._middleware=new At(this)},l._init=function(){this._initMembers(),this._addBindings()},l._initMembers=function(){this._allAdsCompleted=!0,this._adBreaksLayout=[],this._adBreak=null,this._ad=null,this._adPlayed=!1,this._snapback=0,this._adIsLoading=!1,this._isAdPlaying=!1,this._liveSeeking=!1},l._addBindings=function(){var e=this;this._eventManager.listen(this._player,r.CustomEventType.SOURCE_SELECTED,(function(){return e._handleConfiguredAdBreaks()})),this._eventManager.listen(this._player,r.AdEventType.AD_MANIFEST_LOADED,(function(t){return e._onAdManifestLoaded(t)})),this._eventManager.listen(this._player,r.AdEventType.AD_BREAK_START,(function(t){return e._onAdBreakStart(t)})),this._eventManager.listen(this._player,r.AdEventType.AD_LOADED,(function(){return e._onAdLoaded()})),this._eventManager.listen(this._player,r.AdEventType.AD_STARTED,(function(t){return e._onAdStarted(t)})),this._eventManager.listen(this._player,r.AdEventType.AD_COMPLETED,(function(){return e._isAdPlaying=!1})),this._eventManager.listen(this._player,r.AdEventType.AD_BREAK_END,(function(){return e._onAdBreakEnd()})),this._eventManager.listen(this._player,r.AdEventType.ADS_COMPLETED,(function(){return e._onAdsCompleted()})),this._eventManager.listen(this._player,r.AdEventType.AD_ERROR,(function(t){return e._onAdError(t)})),this._eventManager.listen(this._player,r.CustomEventType.PLAYER_RESET,(function(){return e._reset()})),this._eventManager.listen(this._player,r.CustomEventType.PLAYER_DESTROY,(function(){return e._destroy()})),this._eventManager.listenOnce(this._player,r.Html5EventType.ENDED,(function(){return e._onEnded()})),this._eventManager.listenOnce(this._player,r.CustomEventType.PLAYBACK_ENDED,(function(){return e._onPlaybackEnded()})),this._eventManager.listen(this._player,r.AdEventType.AD_RESUMED,(function(){return e._isAdPlaying=!0})),this._eventManager.listen(this._player,r.AdEventType.AD_PAUSED,(function(){return e._isAdPlaying=!1}))},l._handleConfiguredAdBreaks=function(){var e=this,t=this._player.config.advertising.playAdsAfterTime||this._player.config.sources.startTime;this._configAdBreaks=this._player.config.advertising.adBreaks.filter((function(e){return("number"==typeof e.every||"number"==typeof e.position||"number"==typeof e.percentage)&&e.ads.length})).map((function(n){e._validateOneTimeConfig(n);var r=n.position;0===n.percentage&&(r=0),100===n.percentage&&(r=-1),n.every&&(r=n.every);var i=e._player.isLive()?r<t:r<=t;return{position:r,percentage:n.percentage,every:n.every,ads:n.ads.slice(),played:-1<r&&i}})),this._configAdBreaks.length?(this._dispatchAdManifestLoaded(),this._handlePrebidAdConfig(),this._handleConfiguredPreroll(),this._eventManager.listenOnce(this._player,r.Html5EventType.DURATION_CHANGE,(function(){e._player.isLive()?e._eventManager.listenOnce(e._player,r.Html5EventType.SEEKING,(function(){e._pushNextAdsForLive(e._configAdBreaks,(function(t){return e._player.currentTime+t.every})),e._attachLiveSeekedHandler()})):e._handleEveryAndPercentage(),e._configAdBreaks.sort((function(e,t){return e.position-t.position})),e._configAdBreaks.some((function(e){return e.position>0}))&&e._handleConfiguredMidrolls()}))):this.prerollReady=Promise.resolve()},l._validateOneTimeConfig=function(e){"number"==typeof e.position&&("number"==typeof e.percentage&&(i._logger.warn("Validate ad break - ignore percentage "+e.percentage+" as position "+e.position+" configured"),delete e.percentage),"number"==typeof e.every&&(i._logger.warn("Validate ad break - ignore every "+e.every+" as position "+e.position+" configured"),delete e.every)),"number"==typeof e.percentage&&"number"==typeof e.every&&(i._logger.warn("Validate ad break - ignore every "+e.every+" as percentage "+e.percentage+" configured"),delete e.every)},l._dispatchAdManifestLoaded=function(){var e=this,t=Array.from(new Set(this._configAdBreaks.map((function(e){return e.every&&e.every+"s"||"number"==typeof e.percentage&&e.percentage+"%"||e.position}))));i._logger.debug(r.AdEventType.AD_MANIFEST_LOADED,t),this._player.dispatchEvent(new r.FakeEvent(r.AdEventType.AD_MANIFEST_LOADED,{adBreaksPosition:t})),this._player.hasService("timeline")&&this._player.config.advertising.showAdBreakCuePoint&&t.forEach((function(t){e._player.getService("timeline").addCuePoint(wt({time:-1!==t?t:1/0},e._player.config.advertising.adBreakCuePointStyle))}))},l._handlePrebidAdConfig=function(){var e=this;this._prebidManager&&this._configAdBreaks.filter((function(e){return!e.played})).map((function(t){var n=Promise.all(t.ads.map((function(t){return e._getPrebidAds(t)})));t.loadedPromise=n,n.then((function(e){return t.ads=e}))}))},l._getPrebidAds=function(e){var t=this;return new Promise((function(n){if(e.prebid&&t._prebidManager){var i=r.Utils.Object.mergeDeep({},e.prebid,t._player.config.advertising.prebid);t._prebidManager.load(i).then((function(t){var r=t.map((function(e){return e&&e.vastUrl}));e.url=r.concat(e.url),n(e)})).catch((function(){n(e)}))}else n(e)}))},l._handleConfiguredPreroll=function(){var e=this._configAdBreaks.filter((function(e){return 0===e.position&&!e.played})),t=this._mergeAdBreaks(e);this.prerollReady=t&&t.loadedPromise?t.loadedPromise:Promise.resolve(),t&&this._playAdBreak(t)},l._handleEveryAndPercentage=function(){var e=this;this._configAdBreaks.forEach((function(t){if(e._player.duration&&t.every)for(var n=2*t.every;n<=e._player.duration;)e._configAdBreaks.push({position:n,ads:t.ads,played:!1,loadedPromise:Promise.resolve()}),n+=t.every;else e._player.duration&&t.percentage&&!t.position&&(t.position=Math.floor(e._player.duration*t.percentage/100))}))},l._attachLiveSeekedHandler=function(){var e=this;this._eventManager.listenOnce(this._player,r.CustomEventType.FIRST_PLAYING,(function(){e._eventManager.listen(e._player,r.Html5EventType.SEEKING,(function(){e._liveSeeking=!0})),e._eventManager.listen(e._player,r.Html5EventType.SEEKED,(function(){e._liveSeeking=!1,e._pushNextAdsForLive(e._configAdBreaks,(function(t){return e._player.currentTime+t.every}))}))}))},l._pushNextAdsForLive=function(e,t){this._liveEventManager.removeAll();var n=[];e.forEach((function(e){if(![-1,0].includes(e.position)){var r=e.every,a=e.ads,o={every:r,position:t(e),ads:a,played:!1,loadedPromise:Promise.resolve()};i._logger.debug("Pushing next ad for live",o),n.push(o)}})),n.length&&(this._configAdBreaks=[].concat(n,this._configAdBreaks.filter((function(e){return-1===e.position}))))},l._handleConfiguredMidrolls=function(){var e=this;this._eventManager.listen(this._player,r.Html5EventType.TIME_UPDATE,(function(){if(!e._player.paused&&!e._liveSeeking){var t=e._configAdBreaks.filter((function(t){return!t.played&&e._player.currentTime&&t.position<=e._player.currentTime&&t.position>e._snapback}));if(t.length){var n=t[t.length-1].position,a=t.filter((function(e){return e.position===n}));if(e._player.isLive())!e._player.isDvr()||e._player.isOnLiveEdge()&&e._player.config.advertising.returnToLive?e._handleReturnToLive(a):e._pushNextAdsForLive(a,(function(t){return(e._player.isOnLiveEdge()?e._player.currentTime:t.position)+t.every}));else e._snapback=n,i._logger.debug("Set snapback value "+e._snapback),e._eventManager.listen(e._player,r.Html5EventType.SEEKED,(function(){var t=e._configAdBreaks.findIndex((function(t){return t.played&&"number"==typeof e._player.currentTime&&e._player.currentTime<t.position}));t>0&&!e._configAdBreaks[t-1].played&&(e._snapback=0,i._logger.debug("Reset snapback value"))}));var o=e._mergeAdBreaks(a);o&&e._playAdBreak(o)}}}))},l._handleReturnToLive=function(e){var t=this;this._liveEventManager.listenOnce(this._player,r.AdEventType.AD_ERROR,(function(){t._pushNextAdsForLive(e,(function(e){return(t._player.isOnLiveEdge()?t._player.currentTime:e.position)+e.every}))})),this._liveEventManager.listenOnce(this._player,r.AdEventType.AD_BREAK_END,(function(){t._player.seekToLiveEdge()}))},l._playAdBreak=function(e){var t=this._adsPluginControllers.find((function(e){return"function"==typeof e.playAdNow}));t?(e.played=!0,this._adIsLoading=!0,i._logger.debug("Playing ad break positioned in "+e.position),e.loadedPromise.then((function(){return t.playAdNow(e.ads)}))):i._logger.warn("No ads plugin registered")},l._onAdManifestLoaded=function(e){this._adBreaksLayout=Array.from(new Set(this._adBreaksLayout.concat(e.payload.adBreaksPosition))).sort(),this._allAdsCompleted=!1},l._onAdBreakStart=function(e){this._adBreak=e.payload.adBreak},l._onAdLoaded=function(){this._adIsLoading=!1},l._onAdStarted=function(e){this._ad=e.payload.ad,this._adPlayed=!0,this._isAdPlaying=!0},l._onAdBreakEnd=function(){this._adBreak=null,this._ad=null},l._onAdsCompleted=function(){this._adsPluginControllers.every((function(e){return e.done}))&&this._configAdBreaks.every((function(e){return e.played}))&&(this._allAdsCompleted=!0,i._logger.debug(r.AdEventType.ALL_ADS_COMPLETED),this.dispatchEvent(new r.FakeEvent(r.AdEventType.ALL_ADS_COMPLETED)))},l._onAdError=function(e){this._adIsLoading=!1,e.payload.severity===r.Error.Severity.CRITICAL&&(this._isAdPlaying=!1,this._adsPluginControllers.every((function(e){return e.done}))&&this._configAdBreaks.every((function(e){return e.played}))&&(this._allAdsCompleted=!0,this._adPlayed&&(i._logger.debug(r.AdEventType.ALL_ADS_COMPLETED),this.dispatchEvent(new r.FakeEvent(r.AdEventType.ALL_ADS_COMPLETED)))))},l._isBumper=function(e){return"bumper"===e.name},l._onEnded=function(){var e=this;if(!this._adIsLoading){var t=this._adsPluginControllers.find((function(t){return e._isBumper(t)})),n=this._adsPluginControllers.find((function(t){return!e._isBumper(t)&&!t.done})),r=t&&"function"==typeof t.onPlaybackEnded?function(){return t.onPlaybackEnded()}:function(){return Promise.resolve()},i=n&&"function"==typeof n.onPlaybackEnded?function(){return n.onPlaybackEnded()}:function(){return Promise.resolve()};this._adBreaksLayout.includes(-1)||this._adBreaksLayout.includes("100%")||(this._allAdsCompleted=!0),r().finally((function(){i().finally((function(){return e._handleConfiguredPostroll()}))}))}},l._onPlaybackEnded=function(){this._configAdBreaks.forEach((function(e){return e.played=!0}))},l._handleConfiguredPostroll=function(){var e=this._configAdBreaks.filter((function(e){return!e.played&&-1===e.position}));if(e.length){var t=this._mergeAdBreaks(e);t&&this._playAdBreak(t)}this._configAdBreaks.forEach((function(e){return e.played=!0}))},l._reset=function(){this._eventManager.removeAll(),this._liveEventManager.removeAll(),this._init()},l._destroy=function(){this._adsPluginControllers=[],this._eventManager.destroy(),this._liveEventManager.destroy()},l._mergeAdBreaks=function(e){if(e.length)return e.forEach((function(e){return e.played=!0})),{position:e[0].position,ads:e.reduce((function(e,t){return e.concat(t.ads)}),[]),played:!1,loadedPromise:Promise.all(e.map((function(e){return e.loadedPromise})))}},a=i,(o=[{key:"allAdsCompleted",get:function(){return this._allAdsCompleted}}])&&St(a.prototype,o),s&&St(a,s),Object.defineProperty(a,"prototype",{writable:!1}),i}(r.FakeEventTarget);!function(e,t,n){(t=xt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(It,"_logger",Object(r.getLogger)("AdsController"));var Pt=function(){function e(e){this._pluginManager=e}return e.prototype.getAdsControllers=function(){return Object.values(this._pluginManager.getAll()).filter((function(e){return"function"==typeof e.getAdsController})).map((function(e){return e.getAdsController()}))},e}();function Dt(e,t){return(Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Lt=function(e){var t,n;function r(t){var n;return Rt(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call(this)||this),"id","PluginReadinessMiddleware"),n._plugins=t,r._logger.debug("plugins readiness",n._plugins),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Dt(t,n);var i=r.prototype;return i.load=function(e){this._checkNextSettle(0,e)},i._checkNextSettle=function(e,t){e<this._plugins.length?this._checkSettle(e,t):this.callNext(t)},i._checkSettle=function(e,t){var n=this;(this._plugins[e].ready?this._plugins[e].ready:Promise.resolve()).then((function(){r._logger.debug("plugin "+n._plugins[e].name+" ready promise resolved"),n._checkNextSettle(e+1,t)})).catch((function(){r._logger.debug("plugin "+n._plugins[e].name+" ready promise rejected"),n._checkNextSettle(e+1,t)}))},i.play=function(e){this._checkNextSettle(0,e)},r}(r.BaseMiddleware);function Ot(){return(Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Mt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Rt(Lt,"_logger",Object(r.getLogger)("PluginReadinessMiddleware"));var Nt={thumbsWidth:164,thumbsHeight:92,thumbsSlices:100},Ut=/.*\/p\/\d+\/(?:[a-zA-Z]+\/\d+\/)*thumbnail\/entry_id\/\w+\/.*\d+/,Ft=function(){function e(e,t,n){var i=this;if(Mt(this,"_isUsingKalturaThumbnail",(function(){return!(!i._thumbnailConfig||!i._thumbnailConfig.thumbsSprite)})),Mt(this,"_convertKalturaThumbnailToThumbnailInfo",(function(e){if(i._thumbnailConfig){var t=i._thumbnailConfig,n=t.thumbsSprite,a=t.thumbsWidth,o=t.thumbsSlices,s=i._player.duration/o,l={x:Math.floor(e/s)*a,y:0,url:n,height:i._thumbsHeight,width:a};return new r.ThumbnailInfo(l)}})),Mt(this,"_buildKalturaThumbnailConfig",(function(e,t){var n,a=r.Utils.Object.getPropertyPath(e,"components.seekbar"),o=t.sources&&t.sources.poster,s=t.sources&&t.sources.type===r.MediaType.VOD,l=i._player.shouldAddKs(t)?null==(n=t.session)?void 0:n.ks:"",u=r.Utils.Object.mergeDeep(Nt,a);return Ot({thumbsSprite:s?i._getThumbSlicesUrl(o,l,u):""},u)})),Mt(this,"_maybeCutThumbnail",(function(e){var t=r.Utils.Object.getPropertyPath(i._player.config.sources,"seekFrom"),n=r.Utils.Object.getPropertyPath(i._player.config.sources,"clipTo"),a=e;return t&&"number"==typeof t&&(a+="/start_sec/"+t),n&&"number"==typeof n&&(a+="/end_sec/"+n),a})),Mt(this,"_getThumbSlicesUrl",(function(e,t,n){if("string"==typeof e&&Ut.test(e))try{var r=Ot({thumbnailUrl:e},n),a=oe("{{thumbnailUrl}}/width/{{thumbsWidth}}/vid_slices/{{thumbsSlices}}",r),o=i._maybeCutThumbnail(a);return t?o+"/ks/"+t:o}catch(e){return""}return""})),this._player=e,this._thumbnailConfig=this._buildKalturaThumbnailConfig(t,n),this._eventManager=new r.EventManager,this._isUsingKalturaThumbnail()){var a,o=new Image;this._eventManager.listenOnce(o,"load",(function(){i._thumbsHeight=o.naturalHeight})),o.src=(null==(a=this._thumbnailConfig)?void 0:a.thumbsSprite)||""}}var t=e.prototype;return t.destroy=function(){this._eventManager.destroy()},t.getThumbnail=function(e){return this._isUsingKalturaThumbnail()?this._convertKalturaThumbnailToThumbnailInfo(e):this._player._localPlayer.getThumbnail(e)},t.getKalturaThumbnailConfig=function(){return this._thumbnailConfig},e}();function Bt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jt=function(){function e(e){Bt(this,"_textTrack",null),this._player=e}var t=e.prototype;return t._addTextTrack=function(){this._textTrack=this._player.addTextTrack(r.TextTrack.KIND.METADATA,"CuePoints")},t._getMetadataTracks=function(){return this._player.getNativeTextTracks().filter((function(e){return e.kind===r.TextTrack.KIND.METADATA&&e.cues}))},t._createTextTrackCue=function(e){var t=e.startTime,n=e.endTime,i=e.id,a=e.metadata;return Object(r.createTextTrackCue)({startTime:t,endTime:n,id:i,type:r.TimedMetadata.TYPE.CUE_POINT,metadata:a})},t._cuesSorter=function(e,t){return e.startTime-t.startTime},t.getAllCuePoints=function(){return this._getMetadataTracks().reduce((function(e,t){return e.concat(Array.from(t.cues).map((function(e){return Object(r.createTimedMetadata)(e)})))}),[]).sort(this._cuesSorter)},t.getActiveCuePoints=function(){return this._getMetadataTracks().reduce((function(e,t){return e.concat(Array.from(t.activeCues).map((function(e){return Object(r.createTimedMetadata)(e)})))}),[]).sort(this._cuesSorter)},t._getTextTrackCueById=function(e){var t=null;return this._getMetadataTracks().some((function(n){return t=n.cues.getCueById(e)})),t},t._removeTextTrackCue=function(e){this._getMetadataTracks().forEach((function(t){try{t.removeCue(e)}catch(e){}}))},t.addCuePoints=function(e){var t=this;this._player.ready().then((function(){t._textTrack||t._addTextTrack();var n=[];e.forEach((function(e){var i,a=t._createTextTrackCue(e),o=t._getTextTrackCueById(e.id);o&&t._removeTextTrackCue(o),null==(i=t._textTrack)||i.addCue(a),n.push(Object(r.createTimedMetadata)(a))})),t._player.dispatchEvent(new r.FakeEvent(r.EventType.TIMED_METADATA_ADDED,{cues:n}))}))},t._clearAllTextTrackCues=function(){var e=this;this._getMetadataTracks().forEach((function(t){for(;t.cues.length;)e._removeTextTrackCue(t.cues[0])}))},t.reset=function(){this._clearAllTextTrackCues()},t.destroy=function(){this.reset()},e}();function Ht(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vt=function(){function e(t){var n=this;Ht(this,"_servicesRegistry",new Map),e._logger=Object(r.getLogger)("ServiceProvider"),this._eventManager=new r.EventManager,this._eventManager.listen(t,t.Event.Core.PLAYER_RESET,(function(){return n.reset()}))}var t=e.prototype;return t.register=function(t,n){this._servicesRegistry.has(t)?e._logger.debug(t+" service already exists"):(this._servicesRegistry.set(t,n),e._logger.debug(t+" service registered"))},t.get=function(e){return this._servicesRegistry.get(e)},t.has=function(e){return this._servicesRegistry.has(e)},t.reset=function(){this._servicesRegistry.forEach((function(e){return"function"==typeof e.reset&&e.reset()}))},t.destroy=function(){this._servicesRegistry.forEach((function(e){return"function"==typeof e.destroy&&e.destroy()})),this._eventManager.removeAll(),this._servicesRegistry.clear()},e}();function Gt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */zt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,o=Object.create(a.prototype),s=new I(r||[]);return i(o,"_invoke",{value:w(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="executing",f="completed",g={};function y(){}function v(){}function m(){}var b={};u(b,o,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(P([])));k&&k!==n&&r.call(k,o)&&(b=k);var E=m.prototype=y.prototype=Object.create(b);function T(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,a,o,s){var l=d(e[i],e,a);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(c).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}})}function w(t,n,r){var i=p;return function(a,o){if(i===h)throw new Error("Generator is already running");if(i===f){if("throw"===a)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var l=S(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var u=d(t,n,r);if("normal"===u.type){if(i=r.done?f:"suspendedYield",u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=f,r.method="throw",r.arg=u.arg)}}}function S(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(i,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=m,i(E,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=u(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},T(A.prototype),u(A.prototype,s,(function(){return this})),t.AsyncIterator=A,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new A(c(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(E),u(E,l,"Generator"),u(E,o,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=P,I.prototype={constructor:I,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(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},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),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Wt(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Yt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){Wt(a,r,i,o,s,"next",e)}function s(e){Wt(a,r,i,o,s,"throw",e)}o(void 0)}))}}var qt=[["widevine","com.widevine.alpha"],["playready","com.microsoft.playready"],["fairplay","com.apple.fps"]],Xt=Object(r.getLogger)("MediaCapabilities"),Qt=1,$t=0,Jt=-1;function Zt(){return(Zt=Yt(zt().mark((function e(t){var n,r,i;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Xt.debug("Starting to get media capabilities..."),e.next=4,nn(t);case 4:return r=e.sent,e.next=7,en();case 7:return i=e.sent,n=Object.assign({},r,i),Xt.debug("Finished getting media capabilities ",{mediaCapabilities:n}),e.abrupt("return",n);case 13:return e.prev=13,e.t0=e.catch(0),Xt.debug("There was a problem with getting the media capabilities, ",e.t0.message),n={isHEVCSupported:$t,isPowerEfficient:$t,isDRMSupported:$t,supportedDRMs:[]},Xt.debug("Returning media capabilities defaults ",{mediaCapabilities:n}),e.abrupt("return",n);case 19:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function en(){return tn.apply(this,arguments)}function tn(){return(tn=Yt(zt().mark((function e(){var t,n,r,i,a,o,s,l;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={isDRMSupported:Jt,supportedDRMs:[]},navigator.requestMediaKeySystemAccess){e.next=3;break}return e.abrupt("return",t);case 3:n=[{initDataTypes:["cenc"],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}],r=new Map(qt),i=Gt(r);case 6:if((a=i()).done){e.next=19;break}return o=a.value,s=o[0],l=o[1],e.prev=8,e.next=11,navigator.requestMediaKeySystemAccess(l,n);case 11:t.supportedDRMs.push(s),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(8),Xt.debug(l+" not supported ("+e.t0.name+": "+e.t0.message+").");case 17:e.next=6;break;case 19:return t.isDRMSupported=t.supportedDRMs.length>0?Qt:$t,e.abrupt("return",t);case 21:case"end":return e.stop()}}),e,null,[[8,14]])})))).apply(this,arguments)}function nn(e){return rn.apply(this,arguments)}function rn(){return(rn=Yt(zt().mark((function e(t){var n,r,i;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={isHEVCSupported:Jt,isPowerEfficient:Jt},navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo){e.next=3;break}return e.abrupt("return",n);case 3:return r={type:"media-source",video:{contentType:'video/mp4; codecs="hvc1.1.6.L150.90"',width:(null==t?void 0:t.width)||1920,height:(null==t?void 0:t.height)||1080,bitrate:(null==t?void 0:t.bitrate)||12e5,framerate:(null==t?void 0:t.framerate)||30}},e.prev=4,e.next=7,navigator.mediaCapabilities.decodingInfo(r);case 7:i=e.sent,n.isHEVCSupported=i.supported?Qt:$t,n.isPowerEfficient=i.powerEfficient?Qt:$t,e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),Xt.debug("Failed to get the media capabilities from navigator. ("+e.t0.name+": "+e.t0.message+")."),n.isHEVCSupported=Jt,n.isPowerEfficient=Jt;case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,null,[[4,12]])})))).apply(this,arguments)}var an=function(e){return Zt.apply(this,arguments)};function on(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */on=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,o=Object.create(a.prototype),s=new I(r||[]);return i(o,"_invoke",{value:w(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="executing",f="completed",g={};function y(){}function v(){}function m(){}var b={};u(b,o,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(P([])));k&&k!==n&&r.call(k,o)&&(b=k);var E=m.prototype=y.prototype=Object.create(b);function T(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,a,o,s){var l=d(e[i],e,a);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(c).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}})}function w(t,n,r){var i=p;return function(a,o){if(i===h)throw new Error("Generator is already running");if(i===f){if("throw"===a)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var l=S(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var u=d(t,n,r);if("normal"===u.type){if(i=r.done?f:"suspendedYield",u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=f,r.method="throw",r.arg=u.arg)}}}function S(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(i,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=m,i(E,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=u(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},T(A.prototype),u(A.prototype,s,(function(){return this})),t.AsyncIterator=A,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new A(c(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(E),u(E,l,"Generator"),u(E,o,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=P,I.prototype={constructor:I,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(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},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),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function sn(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function ln(){return(ln=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function un(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hn(r.key),r)}}function cn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dn(e,t){return(dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function pn(e,t,n){return(t=hn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hn(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var fn=function(e){var t,n;function o(t){var n;pn(cn(n=e.call(this)||this),"_eventManager",new r.EventManager),pn(cn(n),"_mediaInfo",null),pn(cn(n),"_remotePlayer",null),pn(cn(n),"_pluginManager",new Z),pn(cn(n),"_pluginsConfig",{}),pn(cn(n),"_reset",!0),pn(cn(n),"_firstPlay",!0),pn(cn(n),"_sourceSelected",null),pn(cn(n),"_appPluginConfig",{}),pn(cn(n),"_thumbnailManager",null),pn(cn(n),"_isVisible",!1),pn(cn(n),"_autoPaused",!1);var i=t.sources,o=t.plugins;n._configEvaluator=new pe,n._configEvaluator.evaluatePluginsConfig(o,t),n._playbackStart=!1;var s=r.Utils.Object.mergeDeep({},t);delete s.plugins,delete s.sources,n._localPlayer=Object(r.loadPlayer)(s),n._controllerProvider=new Pt(n._pluginManager),n._viewabilityManager=new R(n.config.viewability),n._uiWrapper=new ve(cn(n),r.Utils.Object.mergeDeep(t,{ui:{logger:{getLogger:r.getLogger,LogLevel:r.LogLevel}}})),n._serviceProvider=new Vt(cn(n)),n._cuepointManager=new jt(cn(n)),n._provider=new a.Provider(r.Utils.Object.mergeDeep(t.provider,{logger:{getLogger:r.getLogger,LogLevel:r.LogLevel}}),"3.18.0-canary.0-ecfabb5"),n._playlistManager=new xe(cn(n),t),Object.values(r.EventType).forEach((function(e){return n._eventManager.listen(n._localPlayer,e,(function(e){return n.dispatchEvent(e)}))})),n._addBindings();var l=r.Utils.Object.mergeDeep({},t.playlist,{items:null});return n._playlistManager.configure(l),n.configure({plugins:o}),n._playlistManager.configure({items:t.playlist&&t.playlist.items||[]}),n._localPlayer.setSources(i||{}),n._remotePlayerManager=new ht,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,dn(t,n);var l,u,c,d=o.prototype;return d.loadMedia=function(e,t){var n=this;return o._logger.debug("loadMedia",e),this._mediaInfo=e,this.reset(),this._localPlayer.loadingMedia=!0,this._uiWrapper.setLoadingSpinnerState(!0),new Promise((function(i,a){n._provider.getMediaConfig(e).then((function(e){var a=r.Utils.Object.copyDeep(e);t&&(a.sources=a.sources||{},a.sources=r.Utils.Object.mergeDeep(a.sources,t));var o=q(a.plugins,n.config.plugins);a.plugins=o[0],n._appPluginConfig=o[1],n.configure(s({sources:n.sources},a)),n.setMedia(a),i(a)}),(function(e){var t=new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.LOAD_FAILED,e);n._localPlayer.dispatchEvent(new r.FakeEvent(r.EventType.ERROR,t)),a(e)}))}))},d.setMedia=function(e){o._logger.debug("setMedia",e),this.reset(!0);var t=r.Utils.Object.copyDeep(e),n=r.Utils.Object.mergeDeep({},t.sources,this._localPlayer.sources);delete t.sources,r.Utils.Object.mergeDeep(t.session,this._localPlayer.config.session),t.plugins=t.plugins||{},Object.keys(this._pluginsConfig).forEach((function(e){t.plugins[e]=t.plugins[e]||{}})),this.configure({session:e.session}),W(n)||Y(n)?this._thumbnailManager=null:this._thumbnailManager=new Ft(this,this.config.ui,e),this.updateKalturaPoster(n,e.sources,this._localPlayer.dimensions),D(this,ln({},t,{sources:n}));var i=function(e,t){return t&&W(t)?z(e,"youtube","progressive"):t&&Y(t)?z(e,"image","image"):null}(this,n);i&&(t.playback=i),this.configure(ln({},t,{sources:n}))},d.updateKalturaPoster=function(e,t,n){var r;he(e,t,n,this.shouldAddKs()&&(null==(r=this.config)||null==(r=r.session)||r.ks))},d.shouldAddKs=function(e){var t;return!(!this.config.provider.loadThumbnailWithKs||!1!==(null==(t=e||this.config)||null==(t=t.session)?void 0:t.isAnonymous))},d.loadPlaylist=function(e,t){var n=this;return o._logger.debug("loadPlaylist",e),this._uiWrapper.setLoadingSpinnerState(!0),new Promise((function(i,a){n._provider.getPlaylistConfig(e).then((function(e){n.setPlaylist(e,t),i(e)}),(function(e){var t=new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.LOAD_FAILED,e);n._localPlayer.dispatchEvent(new r.FakeEvent(r.EventType.ERROR,t)),a(e)}))}))},d.loadPlaylistByEntryList=function(e,t){var n=this;return o._logger.debug("loadPlaylistByEntryList",e),this._uiWrapper.setLoadingSpinnerState(!0),new Promise((function(i,a){n._provider.getEntryListConfig(e).then((function(r){n.setPlaylist(r,t,e),i(r)}),(function(e){var t=new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.LOAD_FAILED,e);n._localPlayer.dispatchEvent(new r.FakeEvent(r.EventType.ERROR,t)),a(e)}))}))},d.setPlaylist=function(e,t,n){o._logger.debug("setPlaylist",e);var r={playlist:e,plugins:{}};Object.keys(this._pluginsConfig).forEach((function(e){r.plugins[e]={}})),this._configEvaluator.evaluatePluginsConfig(r.plugins,r),this._configureOrLoadPlugins(r.plugins),this._playlistManager.load(e,t,n)},d.getMediaInfo=function(){return r.Utils.Object.copyDeep(this._mediaInfo)},d.getDrmInfo=function(){return this._localPlayer.getDrmInfo()},d.getMediaConfig=function(){var e={sources:this._localPlayer.sources,plugins:this._pluginsConfig};return r.Utils.Object.copyDeep(e)},d.setSourcesMetadata=function(e){this._localPlayer.setSourcesMetadata(e)},d.configure=function(e){void 0===e&&(e={}),e=K(e);var t=r.Utils.Object.mergeDeep({},this.config,e);this._configEvaluator.evaluatePluginsConfig(e.plugins,t),this._configureOrLoadPlugins(e.plugins);var n=r.Utils.Object.mergeDeep({},e);if(delete n.plugins,n.sources){var i=n.sources;delete n.sources,this._localPlayer.configure(n),this._localPlayer.setSources(i||{})}else this._localPlayer.configure(n);e.ui&&this._uiWrapper.setConfig(t.ui),e.playlist&&this._playlistManager.configure(e.playlist)},d.ready=function(){return this._localPlayer.ready()},d.load=function(){this._localPlayer.load()},d.play=function(){this._localPlayer.play()},d.pause=function(){this._localPlayer.pause()},d.getView=function(){return this._localPlayer.getView()},d.getVideoElement=function(){return this._localPlayer.getVideoElement()},d.reset=function(e){var t;(void 0===e&&(e=!1),this._reset)||(this._reset=!0,this._firstPlay=!0,this._sourceSelected=null,this._attachEventManager&&this._attachEventManager.removeAll(),this._uiWrapper.reset(),this._resetProviderPluginsConfig(),this._pluginManager.reset(),this._cuepointManager.reset(),this._localPlayer.reset(e),null==(t=this._thumbnailManager)||t.destroy())},d.destroy=function(){var e,t=this.config.ui.targetId;this._reset=!0,this._playbackStart=!1,this._firstPlay=!0,this._uiWrapper.destroy(),this._pluginManager.destroy(),this._cuepointManager.destroy(),this._playlistManager.destroy(),this._localPlayer.destroy(),this._eventManager.destroy(),null==(e=this._thumbnailManager)||e.destroy(),this._viewabilityManager.destroy(),this._remotePlayerManager.destroy(),this._pluginsConfig={};var n=document.getElementById(t);n&&n.parentNode&&r.Utils.Dom.removeChild(n.parentNode,n)},d.isLive=function(){return this._localPlayer.isLive()},d.isOnLiveEdge=function(){return this._localPlayer.isOnLiveEdge()},d.isDvr=function(){return this._localPlayer.isDvr()},d.isUntimedImg=function(){return Y(this.sources)&&!("number"==typeof this.config.sources.duration&&this.config.sources.duration>0)},d.isImage=function(){return Y(this.sources)},d.isAudio=function(){return this._localPlayer.isAudio()},d.seekToLiveEdge=function(){this._localPlayer.seekToLiveEdge()},d.getStartTimeOfDvrWindow=function(){return this._localPlayer.getStartTimeOfDvrWindow()},d.getTracks=function(e){return this._localPlayer.getTracks(e)},d.getActiveTracks=function(){return this._localPlayer.getActiveTracks()},d.selectTrack=function(e){this._localPlayer.selectTrack(e)},d.hideTextTrack=function(){this._localPlayer.hideTextTrack()},d.showTextTrack=function(){this._localPlayer.showTextTrack()},d.enableAdaptiveBitrate=function(){this._localPlayer.enableAdaptiveBitrate()},d.isAdaptiveBitrateEnabled=function(){return this._localPlayer.isAdaptiveBitrateEnabled()},d.setTextDisplaySettings=function(e){this._localPlayer.setTextDisplaySettings(e)},d.isFullscreen=function(){return this._localPlayer.isFullscreen()},d.notifyEnterFullscreen=function(){this._localPlayer.notifyEnterFullscreen()},d.notifyExitFullscreen=function(){this._localPlayer.notifyExitFullscreen()},d.enterFullscreen=function(e){var t=e||this.config.ui.targetId;this._localPlayer.enterFullscreen(t)},d.exitFullscreen=function(){this._localPlayer.exitFullscreen()},d.enterPictureInPicture=function(){this._localPlayer.enterPictureInPicture()},d.exitPictureInPicture=function(){this._localPlayer.exitPictureInPicture()},d.isInPictureInPicture=function(){return this._localPlayer.isInPictureInPicture()},d.isPictureInPictureSupported=function(){return this._localPlayer.isPictureInPictureSupported()},d.getLogLevel=function(e){return this._localPlayer.getLogLevel(e)},d.startCasting=function(e){var t=this;return this.setIsCastInitiator(e,!0),new Promise((function(n,r){t.remotePlayerManager.startCasting(e).then(n).catch((function(){t.setIsCastInitiator(e,!1),r()}))}))},d.setIsCastInitiator=function(e,t){this._remotePlayerManager.setIsCastInitiator(e,t)},d.isCastAvailable=function(e){return this._remotePlayerManager.isCastAvailable(e)},d.getCastSession=function(){return null},d.stopCasting=function(){},d.isCasting=function(){return!1},d.isVr=function(){return this._localPlayer.isVr()},d.toggleVrStereoMode=function(){var e=this._pluginManager.get("vr");e&&"function"==typeof e.toggleVrStereoMode&&e.toggleVrStereoMode()},d.isInVrStereoMode=function(){var e=this._pluginManager.get("vr");return!(!e||"function"!=typeof e.isInStereoMode)&&e.isInStereoMode()},d.setLogLevel=function(e,t){this._localPlayer.setLogLevel(e,t)},d.getThumbnail=function(e){if(!e){if(isNaN(this.currentTime))return null;e=this.currentTime}if(e=this.isLive()?e+this.getStartTimeOfDvrWindow():e,this._thumbnailManager)return this._thumbnailManager.getThumbnail(e)},d._addBindings=function(){var e=this;this._eventManager.listen(this,r.EventType.CHANGE_SOURCE_STARTED,(function(){return e._onChangeSourceStarted()})),this._eventManager.listen(this,r.EventType.CHANGE_SOURCE_ENDED,(function(){return e._onChangeSourceEnded()})),this._eventManager.listen(this,r.EventType.PLAYER_RESET,(function(){return e._onPlayerReset()})),this._eventManager.listen(this,r.EventType.ENDED,(function(){return e._onEnded()})),this._eventManager.listen(this,r.EventType.FIRST_PLAY,(function(){return e._firstPlay=!1})),this._eventManager.listen(this,r.EventType.SOURCE_SELECTED,(function(t){return e._sourceSelected=t.payload.selectedSource[0]})),this._eventManager.listen(this,r.EventType.PLAYBACK_ENDED,(function(){return e._onPlaybackEnded()})),this._eventManager.listen(this,r.EventType.PLAYBACK_START,(function(){e._playbackStart=!0})),this._eventManager.listen(this,r.AdEventType.AD_AUTOPLAY_FAILED,(function(t){return e._onAdAutoplayFailed(t)})),this._eventManager.listen(this,r.AdEventType.AD_STARTED,(function(){return e._onAdStarted()})),this.config.playback.playAdsWithMSE&&(this._attachEventManager=new r.EventManager,this._eventManager.listen(this,r.AdEventType.AD_LOADED,(function(t){var n=t.payload.ad;n&&n.linear&&1===n.position&&!n.inStream&&e.src?(e._attachEventManager.listenOnce(e,r.AdEventType.AD_BREAK_START,(function(){return e.detachMediaSource()})),e._attachEventManager.listenOnce(e,r.AdEventType.AD_BREAK_END,(function(){return e.attachMediaSource()})),e._attachEventManager.listenOnce(e,r.AdEventType.AD_ERROR,(function(){return e.attachMediaSource()}))):e._attachEventManager.removeAll()}))),this._eventManager.listen(this,r.EventType.ERROR,(function(t){t.payload.severity===r.Error.Severity.CRITICAL&&(e._reset=!1)}))},d._onChangeSourceEnded=function(){r.Utils.Object.getPropertyPath(this.config,"ui.targetId")?this._viewabilityManager.observe(r.Utils.Dom.getElementById(this.config.ui.targetId),this._handleVisibilityChange.bind(this)):o._logger.warn("Cannot observe visibility change without config.ui.targetId")},d._onPlayerReset=function(){this._playbackStart=!1,r.Utils.Object.getPropertyPath(this.config,"ui.targetId")&&this._viewabilityManager.unObserve(r.Utils.Dom.getElementById(this.config.ui.targetId),this._handleVisibilityChange.bind(this))},d._onChangeSourceStarted=function(){this._configureOrLoadPlugins(this._pluginsConfig),this.reset(),this._pluginManager.loadMedia(),this._reset=!1},d._onEnded=function(){var e=this;setTimeout((function(){e._adsController&&!e._adsController.allAdsCompleted?e._eventManager.listenOnce(e._adsController,r.AdEventType.ALL_ADS_COMPLETED,(function(){e.dispatchEvent(new r.FakeEvent(r.EventType.PLAYBACK_ENDED))})):e.dispatchEvent(new r.FakeEvent(r.EventType.PLAYBACK_ENDED))}))},d._onPlaybackEnded=function(){this.config.playback.loop&&(this.currentTime=0,this.play())},d._onAdStarted=function(){this._firstPlay&&(this._localPlayer.posterManager.hide(),this._localPlayer.hideBlackCover())},d._onAdAutoplayFailed=function(e){this._firstPlay&&this.config.playback.autoplay&&(this._localPlayer.posterManager.show(),this.dispatchEvent(new r.FakeEvent(r.EventType.AUTOPLAY_FAILED,e.payload)))},d._configureOrLoadPlugins=function(e){var t=this;void 0===e&&(e={});var n=[],i=[],a=[];Object.keys(e).forEach((function(o){var s=t._pluginManager.get(o);if(s)s.updateConfig(e[o]),e[o]=s.getConfig();else if(t._sourceSelected)delete e[o];else{try{t._pluginManager.load(o,t,e[o])}catch(e){t.dispatchEvent(new r.FakeEvent(r.Error.Code.ERROR,e))}var l=t._pluginManager.get(o);l&&(a.push(l),e[o]=l.getConfig(),"function"==typeof l.getMiddlewareImpl&&("bumper"===l.name?n.push(l.getMiddlewareImpl()):n.unshift(l.getMiddlewareImpl())),"function"==typeof l.getUIComponents&&i.push.apply(i,l.getUIComponents()||[]),"function"==typeof l.getEngineDecorator&&t._localPlayer.registerEngineDecoratorProvider(new r.EngineDecoratorProvider(l)))}})),i.forEach((function(e){return t._uiWrapper.addComponent(e)})),this._pluginReadinessMiddleware||(this._pluginReadinessMiddleware=new Lt(a),this._localPlayer.playbackMiddleware.use(this._pluginReadinessMiddleware)),this._maybeCreateAdsController(),n.forEach((function(e){return t._localPlayer.playbackMiddleware.use(e)})),r.Utils.Object.mergeDeep(this._pluginsConfig,e)},d._maybeCreateAdsController=function(){var e=this;if(!this._adsController){var t=this._controllerProvider.getAdsControllers();t.length&&(this._adsController=new It(this,t),this._localPlayer.playbackMiddleware.use(this._adsController.getMiddleware()),this._eventManager.listen(this._adsController,r.AdEventType.ALL_ADS_COMPLETED,(function(t){e.dispatchEvent(t)})))}},d.attachMediaSource=function(){this._localPlayer.attachMediaSource()},d.detachMediaSource=function(){this._localPlayer.detachMediaSource()},d._resetProviderPluginsConfig=function(){this.configure({plugins:this._appPluginConfig}),this._appPluginConfig={}},d._handleVisibilityChange=function(e){this._isVisible=e,this.dispatchEvent(new r.FakeEvent("visibilitychange",{visible:this._isVisible})),this.config.playback.autoplay===r.AutoPlayType.IN_VIEW&&this._isVisible&&!this._playbackStart&&this._localPlayer.play({programmatic:!0}),!0===this.config.playback.autopause&&this._handleAutoPause(e)},d._handleAutoPause=function(e){var t=!this.paused||this._adsController&&this._adsController.isAdPlaying(),n=!this.isInPictureInPicture()&&this._playbackStart&&t;e?this._autoPaused&&(this.paused&&this.play(),this._autoPaused=!1):n&&(this.pause(),this._autoPaused=!0)},d.getService=function(e){return this._serviceProvider.get(e)},d.hasService=function(e){return this._serviceProvider.has(e)},d.registerService=function(e,t){this._serviceProvider.register(e,t)},d.addTextTrack=function(e,t){return this._localPlayer.addTextTrack(e,t)},d.getNativeTextTracks=function(){return this._localPlayer.getNativeTextTracks()},d.getMediaCapabilities=function(){var e,t=(e=on().mark((function e(t){return on().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",an(t));case 1:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){sn(a,r,i,o,s,"next",e)}function s(e){sn(a,r,i,o,s,"throw",e)}o(void 0)}))});return function(e){return t.apply(this,arguments)}}(),l=o,(u=[{key:"textDisplaySetting",get:function(){return this._localPlayer.textDisplaySetting}},{key:"textStyle",get:function(){return this._localPlayer.textStyle},set:function(e){this._localPlayer.textStyle=e}},{key:"buffered",get:function(){return this._localPlayer.buffered}},{key:"stats",get:function(){return this._localPlayer.stats}},{key:"currentTime",get:function(){return this._localPlayer.currentTime},set:function(e){this._localPlayer.currentTime=e}},{key:"duration",get:function(){return this._localPlayer.duration}},{key:"liveDuration",get:function(){return this._localPlayer.liveDuration}},{key:"normalizedCurrentTime",get:function(){return this.isLive()?this.currentTime-this.getStartTimeOfDvrWindow():this.currentTime},set:function(e){this.isLive()?this.currentTime=e+this.getStartTimeOfDvrWindow():this.currentTime=e}},{key:"normalizedDuration",get:function(){return this.isLive()?this.liveDuration-this.getStartTimeOfDvrWindow():this.duration}},{key:"volume",get:function(){return this._localPlayer.volume},set:function(e){this._localPlayer.volume=e}},{key:"paused",get:function(){return this._localPlayer.paused}},{key:"seeking",get:function(){return this._localPlayer.seeking}},{key:"playsinline",get:function(){return this._localPlayer.playsinline},set:function(e){this._localPlayer.playsinline=e}},{key:"muted",get:function(){return this._localPlayer.muted},set:function(e){this._localPlayer.muted=e}},{key:"src",get:function(){return this._localPlayer.src}},{key:"videoHeight",get:function(){return this._localPlayer.videoHeight}},{key:"videoWidth",get:function(){return this._localPlayer.videoWidth}},{key:"dimensions",get:function(){return this._localPlayer.dimensions},set:function(e){this._localPlayer.dimensions=e}},{key:"poster",get:function(){return this._localPlayer.poster}},{key:"ended",get:function(){return this._localPlayer.ended}},{key:"playbackRate",get:function(){return this._localPlayer.playbackRate},set:function(e){this._localPlayer.playbackRate=e}},{key:"playbackRates",get:function(){return this._localPlayer.playbackRates}},{key:"defaultPlaybackRate",get:function(){return this._localPlayer.defaultPlaybackRate}},{key:"engineType",get:function(){return this._localPlayer.engineType}},{key:"streamType",get:function(){return this._localPlayer.streamType}},{key:"env",get:function(){return this._localPlayer.env}},{key:"selectedSource",get:function(){return this._sourceSelected}},{key:"sources",get:function(){return ln({},this._localPlayer.sources)}},{key:"config",get:function(){return ln({},this._localPlayer.config,{plugins:this._pluginsConfig,sources:this._localPlayer.sources})}},{key:"hasUserInteracted",get:function(){return this._localPlayer.hasUserInteracted}},{key:"loadingMedia",set:function(e){this._localPlayer.loadingMedia=e}},{key:"ads",get:function(){return this._adsController}},{key:"plugins",get:function(){return this._pluginManager.getAll()}},{key:"provider",get:function(){return this._provider}},{key:"ui",get:function(){return this._uiWrapper}},{key:"playlist",get:function(){return this._playlistManager}},{key:"Event",get:function(){return ln({Cast:Ie,Core:r.EventType,Playlist:me,UI:i.EventType},r.EventType,{VISIBILITY_CHANGE:"visibilitychange"})}},{key:"TextStyle",get:function(){return this._localPlayer.TextStyle}},{key:"ViewabilityType",get:function(){return L}},{key:"State",get:function(){return this._localPlayer.State}},{key:"Track",get:function(){return this._localPlayer.Track}},{key:"LogLevelType",get:function(){return this._localPlayer.LogLevelType}},{key:"LogLevel",get:function(){return this._localPlayer.LogLevel}},{key:"AbrMode",get:function(){return this._localPlayer.AbrMode}},{key:"MediaType",get:function(){return this._localPlayer.MediaType}},{key:"StreamType",get:function(){return this._localPlayer.StreamType}},{key:"EngineType",get:function(){return this._localPlayer.EngineType}},{key:"Error",get:function(){return this._localPlayer.Error}},{key:"crossOrigin",get:function(){return this._localPlayer.crossOrigin},set:function(e){this._localPlayer.crossOrigin=e}},{key:"isVisible",get:function(){return this._isVisible}},{key:"viewabilityManager",get:function(){return this._viewabilityManager}},{key:"cuePointManager",get:function(){return this._cuepointManager}},{key:"remotePlayerManager",get:function(){return this._remotePlayerManager}}])&&un(l.prototype,u),c&&un(l,c),Object.defineProperty(l,"prototype",{writable:!1}),o}(r.FakeEventTarget);pn(fn,"_logger",Object(r.getLogger)("KalturaPlayer"+r.Utils.Generator.uniqueId(5)));var gn={};function yn(){return gn}function vn(e){return gn[e]?gn[e]:null}var mn=["_remotePlayer","_listeners","_uiWrapper"],bn={get:function(e,t){if("destroy"===t){var n=e.config.targetId;delete gn[n]}return t in r.FakeEventTarget.prototype||mn.includes(t)?e[t]:e._remotePlayer&&t in e._remotePlayer?e._remotePlayer[t]:e[t]},set:function(e,t,n){return e._remotePlayer&&!mn.includes(t)?t in e._remotePlayer&&(e._remotePlayer[t]=n):e[t]=n,!0}};function _n(e){!function(e){!1!==r.Utils.Object.getPropertyPath(e,"log.playerVersion")&&(Object(r.setLogLevel)(r.LogLevel.INFO),Object(r.getLogger)().log("%c @playkit-js/kaltura-player-js 3.18.0-canary.0-ecfabb5","color: #ff98f9; font-size: large"),Object(r.getLogger)().log("%c For more details see https://github.com/kaltura/kaltura-player-js","color: #ff98f9;"))}(e),B(e=K(e));var t=G(e);!function(e){var t,n=e.provider,i=null==(t=V())?void 0:t.productVersion;if(!n.partnerId||2504201===n.partnerId){var a={url:"https://analytics.kaltura.com/api_v3/index.php?service=analytics&action=trackEvent&apiVersion=3.3.0&format=1&eventType=1&partnerId=2504201&entryId=1_3bwzbc9o&&eventIndex=1&position=0",mimetype:""};a.url=function(e,t){return t&&(e+="&clientVer="+t),e}(a.url,i),a.url=x(a.url),a.url=P(a.url,i),a.url=S(a.url,r.Utils.Generator.guid()+":"+r.Utils.Generator.guid()),navigator.sendBeacon&&navigator.sendBeacon(a.url)}}(t),j(t),function(e){var t=parseFloat(H(F));isNaN(t)||r.Utils.Object.createPropertyPath(e,"sources.startTime",t)}(t),U.forEach((function(e){return Object(r.getLogger)("KalturaPlayer:Setup")[e.level](e.msg)})),function(e){!e.disableUserCache&&_.isLocalStorageAvailable()&&_.hasStorage()&&r.Utils.Object.mergeDeep(e,_.getStorageConfig())}(t);var n=function(e){var t=new fn(e),n=new Proxy(t,bn);return gn[e.targetId]=n,n}(t);return function(e){if(!e.config.disableUserCache&&_.isLocalStorageAvailable()){var t=_.getPlayerTextStyle();t&&(e.textStyle=r.Utils.Object.mergeDeep(new r.TextStyle,t))}}(n),function(e){_.isLocalStorageAvailable()&&_.attach(e)}(n),function(e,t){e.cast&&t.remotePlayerManager.load(e.cast,t)}(t,n),function(e){if(r.Env.isIOS||r.Env.isIPadOS){var t=function t(){e.removeEventListener(e.Event.UI.UI_CLICKED,t),Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!0})};e.addEventListener(e.Event.SOURCE_SELECTED,(function n(){e.removeEventListener(e.Event.SOURCE_SELECTED,n),e.addEventListener(e.Event.UI.UI_CLICKED,t)}))}}(n),n}var kn=function(){function e(){}return e.toCastTextStyle=function(t){if(window.chrome&&window.chrome.cast){var n=new window.chrome.cast.media.TextTrackStyle;return n.fontFamily=t.fontFamily,n.backgroundColor=e.rgbToHex(t.backgroundColor),n.foregroundColor=e.rgbToHex(t.fontColor),n.fontScale=Number.parseFloat(t.fontSize)/100,n}return{}},e.toPlayerTextStyle=function(t){var n=new r.TextStyle;return n.fontFamily=t.fontFamily,n.fontSize=100*t.fontScale+"%",n.fontColor=e.hexToRGB(t.foregroundColor),n.backgroundColor=e.hexToRGB(t.backgroundColor),n},e.rgbToHex=function(e){var t="#"+("0"+parseInt(e[0],10).toString(16)).slice(-2)+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2);if(e[3]){var n=e[3];n=Math.round(100*n)/100,t+=(Math.round(255*n)+65536).toString(16).substr(-2).toUpperCase()}else t+="FF";return t.toUpperCase()},e.hexToRGB=function(e){for(var t=[],n=(e=e.slice(1)).match(/.{1,2}/g),r=0;r<3;r++){var i=n&&n[r];i&&t.push(parseInt(i,16))}return t},e}();function En(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Tn(e,t)}function Tn(e,t){return(Tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var An={ACTION:"action",EVENT:"event"},wn=function(e){this.type=e},Sn=function(e){function t(t,n){var r;return(r=e.call(this,An.EVENT)||this).event=t,r.payload=n,r}return En(t,e),t}(wn),Cn=function(e){function t(t,n){var r;return(r=e.call(this,An.ACTION)||this).action=t,r.args=n,r}return En(t,e),t}(wn),xn={registerRemotePlayer:ht.register,PlayerSnapshot:Pe,RemoteControl:Ze,RemoteSession:Me,BaseRemotePlayer:je,RemoteConnectedPayload:Qe,RemoteDisconnectedPayload:$e,RemoteAvailablePayload:Je,RemotePlayerUI:Ge,CastEventType:Ie,RemotePlayerType:{CHROMECAST:"chromecast"},TextStyleConverter:kn,CustomEventMessage:Sn,CustomActionMessage:Cn,CustomMessageType:An,CustomActionType:{SKIP_AD:"skipAd"},CustomMessage:wn},In={PlaylistEventType:me},Pn="@playkit-js/kaltura-player-js",Dn="ott",Rn="3.18.0-canary.0-ecfabb5";r.Ad=bt,r.AdBreak=yt,r.BasePlugin=$,r.registerPlugin=ee}]);
60
+ function e_(){}function t_(){Qb?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(Qb=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=n_):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function n_(e,t){var n,r=this;return R((function(i){return 1==i.g?(console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),_(i,Qb.call(r,e,t),2)):p_(n=i.h)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=Qb,i.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=r_,i.return(r_.call(r,e,t)))}))}function r_(e,t){var n,r,i,a,o,s,l,c,d,p,h=this;return R((function(f){if(1==f.g){for(console.assert(h==navigator,'bad "this" for requestMediaKeySystemAccess'),n=d_(e),r=[],i=u(t),a=i.next();!a.done;a=i.next())o=a.value,s=i_(o.videoCapabilities,n),l=i_(o.audioCapabilities,n),o.videoCapabilities&&o.videoCapabilities.length&&!s.length||o.audioCapabilities&&o.audioCapabilities.length&&!l.length||((c=Object.assign({},o)).videoCapabilities=s,c.audioCapabilities=l,r.push(c));if(!r.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return _(f,Qb.call(h,e,r),2)}return p=f.h,f.return(new c_(p,n))}))}function i_(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function a_(){}function o_(){$b?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?($b=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=s_):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function s_(e){var t,n,r,i=this;return R((function(a){switch(a.g){case 1:return console.assert(i==navigator.mediaCapabilities,'bad "this" for decodingInfo'),_(a,$b.call(i,e),2);case 2:if(t=a.h,!e.keySystemConfiguration)return a.return(t);if((n=t.keySystemAccess)&&p_(n))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=$b,a.return(t);if(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=l_,n){a.B(3);break}return r=t,_(a,u_(e),4);case 4:return r.keySystemAccess=a.h,a.return(t);case 3:return a.return(l_.call(i,e))}}))}function l_(e){var t,n,r,i,a,o,s,l,u=this;return R((function(c){switch(c.g){case 1:return console.assert(u==navigator.mediaCapabilities,'bad "this" for decodingInfo'),t=null,e.keySystemConfiguration&&(n=e.keySystemConfiguration,r=n.keySystem,i=n.audio&&n.audio.encryptionScheme,a=n.video&&n.video.encryptionScheme,t=d_(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},i&&i!=t||a&&a!=t)?c.return(o):_(c,$b.call(u,e),2);case 2:if((s=c.h).keySystemAccess){s.keySystemAccess=new c_(s.keySystemAccess,t),c.B(3);break}if(!e.keySystemConfiguration){c.B(3);break}return l=s,_(c,u_(e),5);case 5:l.keySystemAccess=c.h;case 3:return c.return(s)}}))}function u_(e){var t,n;return R((function(r){if(1==r.g){var i=e.keySystemConfiguration,a=[],o=[];return i.audio&&a.push({robustness:i.audio.robustness||"",contentType:e.audio.contentType}),i.video&&o.push({robustness:i.video.robustness||"",contentType:e.video.contentType}),i={initDataTypes:i.initDataType?[i.initDataType]:[],distinctiveIdentifier:i.distinctiveIdentifier,persistentState:i.persistentState,sessionTypes:i.sessionTypes},a.length&&(i.audioCapabilities=a),o.length&&(i.videoCapabilities=o),t=i,_(r,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[t]),2)}return n=r.h,r.return(n)}))}function c_(e,t){this.h=e,this.g=t,this.keySystem=e.keySystem}function d_(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.chromecast")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function p_(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function h_(){}function f_(){t_(),o_()}Be("video/mp2t",(function(){return new Xb("video/mp2t")}),Ke),j("EmeEncryptionSchemePolyfill",e_),e_.install=t_,j("McEncryptionSchemePolyfill",a_),a_.install=o_,c_.prototype.getConfiguration=function(){var e=this.h.getConfiguration();if(e.videoCapabilities)for(var t=u(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.g;if(e.audioCapabilities)for(n=(t=u(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.g;return e},c_.prototype.createMediaKeys=function(){return this.h.createMediaKeys()},j("EncryptionSchemePolyfills",h_),h_.install=f_,void 0!==n&&n.exports&&(n.exports=h_)}.call(r,n,n,void 0),r.shaka)t[i]=r.shaka[i]}()}).call(this,n(8))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){!function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var e=function(e){for(var t=window.document,n=i(t);n;)n=i(t=n.ownerDocument);return t}(),t=[],n=null,r=null;o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.USE_MUTATION_OBSERVER=!0,o._setupCrossOriginUpdater=function(){return n||(n=function(e,n){r=e&&n?d(e,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},t.forEach((function(e){e._checkForIntersections()}))}),n},o._resetCrossOriginUpdater=function(){n=null,r=null},o.prototype.observe=function(e){if(!this._observationTargets.some((function(t){return t.element==e}))){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(e.ownerDocument),this._checkForIntersections()}},o.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter((function(t){return t.element!=e})),this._unmonitorIntersections(e.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},o.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter((function(e,t,n){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==n[t-1]}))},o.prototype._parseRootMargin=function(e){var t=(e||"0px").split(/\s+/).map((function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}}));return t[1]=t[1]||t[0],t[2]=t[2]||t[0],t[3]=t[3]||t[1],t},o.prototype._monitorIntersections=function(t){var n=t.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(t)){var r=this._checkForIntersections,a=null,o=null;this.POLL_INTERVAL?a=n.setInterval(r,this.POLL_INTERVAL):(s(n,"resize",r,!0),s(t,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(o=new n.MutationObserver(r)).observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(t),this._monitoringUnsubscribes.push((function(){var e=t.defaultView;e&&(a&&e.clearInterval(a),l(e,"resize",r,!0)),l(t,"scroll",r,!0),o&&o.disconnect()}));var u=this.root&&(this.root.ownerDocument||this.root)||e;if(t!=u){var c=i(t);c&&this._monitorIntersections(c.ownerDocument)}}},o.prototype._unmonitorIntersections=function(t){var n=this._monitoringDocuments.indexOf(t);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||e;if(!this._observationTargets.some((function(e){var n=e.element.ownerDocument;if(n==t)return!0;for(;n&&n!=r;){var a=i(n);if((n=a&&a.ownerDocument)==t)return!0}return!1}))){var a=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),a(),t!=r){var o=i(t);o&&this._unmonitorIntersections(o.ownerDocument)}}}},o.prototype._unmonitorAllIntersections=function(){var e=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var t=0;t<e.length;t++)e[t]()},o.prototype._checkForIntersections=function(){if(this.root||!n||r){var e=this._rootIsInDom(),t=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var i=r.element,o=u(i),s=this._rootContainsTarget(i),l=r.entry,c=e&&s&&this._computeTargetAndRootIntersection(i,o,t),d=null;this._rootContainsTarget(i)?n&&!this.root||(d=t):d={top:0,bottom:0,left:0,right:0,width:0,height:0};var p=r.entry=new a({time:window.performance&&performance.now&&performance.now(),target:i,boundingClientRect:o,rootBounds:d,intersectionRect:c});l?e&&s?this._hasCrossedThreshold(l,p)&&this._queuedEntries.push(p):l&&l.isIntersecting&&this._queuedEntries.push(p):this._queuedEntries.push(p)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},o.prototype._computeTargetAndRootIntersection=function(t,i,a){if("none"!=window.getComputedStyle(t).display){for(var o,s,l,c,p,f,g,y,v=i,m=h(t),b=!1;!b&&m;){var _=null,k=1==m.nodeType?window.getComputedStyle(m):{};if("none"==k.display)return null;if(m==this.root||9==m.nodeType)if(b=!0,m==this.root||m==e)n&&!this.root?!r||0==r.width&&0==r.height?(m=null,_=null,v=null):_=r:_=a;else{var E=h(m),T=E&&u(E),A=E&&this._computeTargetAndRootIntersection(E,T,a);T&&A?(m=E,_=d(T,A)):(m=null,v=null)}else{var w=m.ownerDocument;m!=w.body&&m!=w.documentElement&&"visible"!=k.overflow&&(_=u(m))}if(_&&(o=_,s=v,l=void 0,c=void 0,p=void 0,f=void 0,g=void 0,y=void 0,l=Math.max(o.top,s.top),c=Math.min(o.bottom,s.bottom),p=Math.max(o.left,s.left),f=Math.min(o.right,s.right),y=c-l,v=(g=f-p)>=0&&y>=0&&{top:l,bottom:c,left:p,right:f,width:g,height:y}||null),!v)break;m=m&&h(m)}return v}},o.prototype._getRootRect=function(){var t;if(this.root&&!f(this.root))t=u(this.root);else{var n=f(this.root)?this.root:e,r=n.documentElement,i=n.body;t={top:0,left:0,right:r.clientWidth||i.clientWidth,width:r.clientWidth||i.clientWidth,bottom:r.clientHeight||i.clientHeight,height:r.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(t)},o.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map((function(t,n){return"px"==t.unit?t.value:t.value*(n%2?e.width:e.height)/100})),n={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},o.prototype._hasCrossedThreshold=function(e,t){var n=e&&e.isIntersecting?e.intersectionRatio||0:-1,r=t.isIntersecting?t.intersectionRatio||0:-1;if(n!==r)for(var i=0;i<this.thresholds.length;i++){var a=this.thresholds[i];if(a==n||a==r||a<n!=a<r)return!0}},o.prototype._rootIsInDom=function(){return!this.root||p(e,this.root)},o.prototype._rootContainsTarget=function(t){var n=this.root&&(this.root.ownerDocument||this.root)||e;return p(n,t)&&(!this.root||n==t.ownerDocument)},o.prototype._registerInstance=function(){t.indexOf(this)<0&&t.push(this)},o.prototype._unregisterInstance=function(){var e=t.indexOf(this);-1!=e&&t.splice(e,1)},window.IntersectionObserver=o,window.IntersectionObserverEntry=a}function i(e){try{return e.defaultView&&e.defaultView.frameElement||null}catch(e){return null}}function a(e){this.time=e.time,this.target=e.target,this.rootBounds=c(e.rootBounds),this.boundingClientRect=c(e.boundingClientRect),this.intersectionRect=c(e.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!e.intersectionRect;var t=this.boundingClientRect,n=t.width*t.height,r=this.intersectionRect,i=r.width*r.height;this.intersectionRatio=n?Number((i/n).toFixed(4)):this.isIntersecting?1:0}function o(e,t){var n,r,i,a=t||{};if("function"!=typeof e)throw new Error("callback must be a function");if(a.root&&1!=a.root.nodeType&&9!=a.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,i=null,function(){i||(i=setTimeout((function(){n(),i=null}),r))}),this._callback=e,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(a.rootMargin),this.thresholds=this._initThresholds(a.threshold),this.root=a.root||null,this.rootMargin=this._rootMarginValues.map((function(e){return e.value+e.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function s(e,t,n,r){"function"==typeof e.addEventListener?e.addEventListener(t,n,r||!1):"function"==typeof e.attachEvent&&e.attachEvent("on"+t,n)}function l(e,t,n,r){"function"==typeof e.removeEventListener?e.removeEventListener(t,n,r||!1):"function"==typeof e.detachEvent&&e.detachEvent("on"+t,n)}function u(e){var t;try{t=e.getBoundingClientRect()}catch(e){}return t?(t.width&&t.height||(t={top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.right-t.left,height:t.bottom-t.top}),t):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function c(e){return!e||"x"in e?e:{top:e.top,y:e.top,bottom:e.bottom,left:e.left,x:e.left,right:e.right,width:e.width,height:e.height}}function d(e,t){var n=t.top-e.top,r=t.left-e.left;return{top:n,left:r,height:t.height,width:t.width,bottom:n+t.height,right:r+t.width}}function p(e,t){for(var n=t;n;){if(n==e)return!0;n=h(n)}return!1}function h(t){var n=t.parentNode;return 9==t.nodeType&&t!=e?i(t):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function f(e){return e&&9===e.nodeType}}()},function(e,t,n){var r=n(11),i=n(12);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:"head",singleton:!1};r(i,a);e.exports=i.locals||{}},function(e,t,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function s(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var a=e[i],l=t.base?a[0]+t.base:a[0],u=n[l]||0,c="".concat(l," ").concat(u);n[l]=u+1;var d=s(c),p={css:a[1],media:a[2],sourceMap:a[3]};-1!==d?(o[d].references++,o[d].updater(p)):o.push({identifier:c,updater:y(p,t),references:1}),r.push(c)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=a(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function p(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function h(e,t,n){var r=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,g=0;function y(e,t){var n,r,i;if(t.singleton){var a=g++;n=f||(f=u(t)),r=p.bind(null,n,a,!1),i=p.bind(null,n,a,!0)}else n=u(t),r=h.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=s(n[r]);o[i].references--}for(var a=l(e,t),u=0;u<n.length;u++){var c=s(n[u]);0===o[c].references&&(o[c].updater(),o.splice(c,1))}n=a}}}},function(e,t,n){(t=n(13)(!1)).push([e.i,".kaltura-player-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #000;\n outline: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(o=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),a=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(a).concat([i]).join("\n")}var o,s,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var a=0;a<this.length;a++){var o=this[a][0];null!=o&&(i[o]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},function(e,t,n){"use strict";n.r(t),n.d(t,"getPlayers",(function(){return yn})),n.d(t,"getPlayer",(function(){return vn})),n.d(t,"core",(function(){return r})),n.d(t,"ui",(function(){return i})),n.d(t,"providers",(function(){return a})),n.d(t,"setup",(function(){return _n})),n.d(t,"cast",(function(){return xn})),n.d(t,"playlist",(function(){return In})),n.d(t,"Ad",(function(){return bt})),n.d(t,"AdBreak",(function(){return yt})),n.d(t,"BasePlugin",(function(){return $})),n.d(t,"registerPlugin",(function(){return ee})),n.d(t,"PLAYER_TYPE",(function(){return Dn})),n.d(t,"VERSION",(function(){return Rn})),n.d(t,"PLAYER_NAME",(function(){return Pn})),n.d(t,"KALTURA_PLAYER_START_TIME_QS",(function(){return F}));n(3);var r=n(0),i=n(1),a=n(2);n(4),n(6);function o(e,t){var n=function(e){var t=document.createElement("a");return t.href=e,t.hostname},r=n(t),i=!1,a="",o="";return e&&(e.flavors&&Array.isArray(e.flavors)?(a=(i=1===e.flavors.length)&&n(e.flavors[0].url),o=e.flavors[0].url):e.result&&(i=!0,a=n(e.result.url),o=e.result.url)),i&&r!==a?o:t}function s(e,t){return void 0===t&&(t={}),r.Utils.Object.mergeDeep({},function(e,t){void 0===t&&(t={});var n={},i=r.Utils.Object.getPropertyPath(e,"sources.options.redirectExternalStreamsHandler"),a=r.Utils.Object.getPropertyPath(t,"sources.options.redirectExternalStreamsHandler");return"function"!=typeof i&&"function"!=typeof a&&r.Utils.Object.mergeDeep(n,{sources:{options:{redirectExternalStreamsHandler:o}}}),n}(e,t))}var l="Must provide initial providers config",u="Must provide target id",c="Must provide DOM element with id of: ",d="The target id provided is already in use. Id: ";function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var f,g,y,v="@playkit-js/kaltura-player-js_",m=function(){function e(){}var t,n,r;return e.isLocalStorageAvailable=function(){if("undefined"==typeof Storage)return!1;try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},e.setItem=function(t,n){e._validateKey(t);try{e._logger.debug("Sets item for key: "+t,n),localStorage.setItem(v+t,n)}catch(t){e._isQuotaExceeded(t)?e._logger.error("Quota exceeded: "+t.message):e._logger.error(t.message)}},e.getItem=function(t){e._validateKey(t);var n=null;try{return"string"==typeof(n=localStorage.getItem(v+t))?JSON.parse(n):null}catch(e){return n}},e._isQuotaExceeded=function(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t},e._validateKey=function(e){if("string"!=typeof e||0===e.length)throw new Error("Invalid key")},t=e,r=[{key:"size",get:function(){return Object.keys(localStorage).filter((function(e){return e.startsWith(v)})).length}}],(n=null)&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}f=m,g="_logger",y=Object(r.getLogger)("StorageWrapper"),(g=h(g))in f?Object.defineProperty(f,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[g]=y;var _=function(){function e(){}return e.isLocalStorageAvailable=function(){return m.isLocalStorageAvailable()},e.attach=function(t){e._logger.debug("Attach local storage");var n=new r.EventManager;n.listen(t,t.Event.UI.USER_CLICKED_MUTE,(function(){t.isCasting()||m.setItem(e.StorageKeys.MUTED,t.muted)})),n.listen(t,t.Event.UI.USER_CLICKED_UNMUTE,(function(){t.isCasting()||m.setItem(e.StorageKeys.MUTED,t.muted)})),n.listen(t,t.Event.UI.USER_SELECTED_SPEED,(function(){t.isCasting()||m.setItem(e.StorageKeys.PLAYBACK_RATE,t.playbackRate)})),n.listen(t,t.Event.UI.USER_CHANGED_VOLUME,(function(){t.isCasting()||(t.volume>0?m.setItem(e.StorageKeys.MUTED,!1):m.setItem(e.StorageKeys.MUTED,!0),m.setItem(e.StorageKeys.VOLUME,t.volume))})),n.listen(t,t.Event.UI.USER_SELECTED_AUDIO_TRACK,(function(t){var n=t.payload.audioTrack;m.setItem(e.StorageKeys.AUDIO_LANG,n.language)})),n.listen(t,t.Event.UI.USER_SELECTED_CAPTION_TRACK,(function(t){var n=t.payload.captionTrack;"off"!==n.language?(m.setItem(e.StorageKeys.TEXT_LANG,n.language),m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!0)):m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!1)}));var i=function(){n.listenOnce(t,t.Event.TEXT_TRACK_CHANGED,(function(t){var n=t.payload.selectedTextTrack;"off"!==n.language?(m.setItem(e.StorageKeys.TEXT_LANG,n.language),m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!0)):m.setItem(e.StorageKeys.CAPTIONS_DISPLAY,!1)}))};n.listen(t,t.Event.UI.USER_SHOWED_CAPTIONS,i),n.listen(t,t.Event.UI.USER_HID_CAPTIONS,i),n.listen(t,t.Event.UI.USER_SELECTED_CAPTIONS_STYLE,(function(t){try{var n=JSON.stringify(t.payload.captionsStyle);m.setItem(e.StorageKeys.TEXT_STYLE,n)}catch(t){e._logger.error(t.message)}})),n.listen(t,t.Event.PLAYER_DESTROY,(function(){return n.destroy()}))},e.getPlayerTextStyle=function(){return m.getItem(e.StorageKeys.TEXT_STYLE)},e.hasStorage=function(){var t=m.size,n=0!==t;return n?e._logger.debug("Storage found with size of ",t):e._logger.debug("No storage found"),n},e.getStorageConfig=function(){var t=e._getExistingValues(),n=e._buildStorageConfig(t);return e._logger.debug("Gets storage config",n),n},e._getExistingValues=function(){var t={};return Object.keys(e.StorageKeys).forEach((function(n){var r=e.StorageKeys[n],i=m.getItem(r);null!=i&&(t[r]=i)})),t},e._buildStorageConfig=function(e){var t=r.Utils.Object.mergeDeep({},e);return delete t.textStyle,{playback:t}},e}();b(_,"StorageKeys",{MUTED:"muted",VOLUME:"volume",AUDIO_LANG:"audioLanguage",TEXT_LANG:"textLanguage",CAPTIONS_DISPLAY:"captionsDisplay",TEXT_STYLE:"textStyle",PLAYBACK_RATE:"playbackRate"}),b(_,"_logger",Object(r.getLogger)("StorageManager"));var k="kaltura.com",E="custom_data=",T="signature=";function A(e,t){e.config.session&&e.config.session.id?function(e,t){var n=/:((?:[a-z0-9]|-)*)/i.exec(e.config.session.id);n&&n[1]&&w(t,e.config.session.id.replace(n[1],r.Utils.Generator.guid()))}(e,t):function(e){var t=r.Utils.Generator.guid(),n=r.Utils.Generator.guid();w(e,t+":"+n)}(t)}function w(e,t){e.session=e.session||{},e.session.id=t}function S(e,t,n){if(void 0===n&&(n="playSessionId="),t){var r=new RegExp(n+"((?:[a-z0-9]|-)*:(?:[a-z0-9]|-)*)","i").exec(e);r&&r[1]?e=e.replace(r[1],t):e+=I(e)+n+t}return e}function C(){var e;try{e=window.parent.document.URL}catch(t){e=document.referrer}return e}function x(e){if(-1===e.indexOf("referrer=")){var t=btoa(C().substr(0,1e3));e+=I(e)+"referrer="+t}return e}function I(e){return-1===e.indexOf("?")?"?":"&"}function P(e,t){return-1===e.indexOf("clientTag=html5:v")&&(e+=I(e)+"clientTag=html5:v"+(t||"3.18.0-canary.0-14a3ea8")),e}function D(e,t){var n;A(e,t);var i=t.sources,a=t.session&&t.session.id,o=null==(n=V())?void 0:n.productVersion;Object.values(r.StreamType).forEach((function(e){i[e]&&i[e].forEach((function(e){"string"==typeof e.url&&e.url.toLowerCase().indexOf("playmanifest/")>-1&&!e.localSource&&(e.url=S(e.url,a),e.url=x(e.url),e.url=P(e.url,o),e.url=function(e,t){var n=r.Utils.Object.getPropertyPath(t,"seekFrom"),i=r.Utils.Object.getPropertyPath(t,"clipTo");return n&&"number"==typeof n&&-1===e.indexOf("seekFrom=")&&(e+=I(e)+"seekFrom="+1e3*n),i&&"number"==typeof i&&-1===e.indexOf("clipTo=")&&(e+=I(e)+"clipTo="+1e3*i),e}(e.url,i)),e.drmData&&e.drmData.length&&e.drmData.forEach((function(e){"string"==typeof e.licenseUrl&&[k,E,T].every((function(t){return e.licenseUrl.includes(t)}))&&(e.licenseUrl=S(e.licenseUrl,a,"sessionId="),e.licenseUrl=P(e.licenseUrl,o),e.licenseUrl=x(e.licenseUrl),e.licenseUrl=function(e,t){var n=r.Utils.Object.getPropertyPath(t,"provider.uiConfId");return-1===e.indexOf("uiConfId=")&&"number"==typeof n&&(e+=I(e)+"uiConfId="+n),e}(e.licenseUrl,t))}))}))}))}n(9);var R=function(){function e(e){void 0===e&&(e={}),e.observedThresholds=e.observedThresholds||M,e.playerThreshold="number"==typeof e.playerThreshold?e.playerThreshold:N,this._config=e,this._eventManager=new r.EventManager,this._targetsObserved=new r.Utils.MultiMap;var t={threshold:e.observedThresholds.map((function(e){return e/100}))};this._observer=new window.IntersectionObserver(this._intersectionChangedHandler.bind(this),t),this._initTabVisibility()}var t=e.prototype;return t._intersectionChangedHandler=function(e){var t=this;e.forEach((function(e){t._targetsObserved.get(e.target).forEach((function(t){var n=e.intersectionRatio>=t.threshold;t.lastIntersectionRatio=e.intersectionRatio,n!==t.lastVisible&&(t.lastVisible=n,t.listener(n,L.VIEWPORT))}))}))},t._handleTabVisibilityChange=function(){var e=this;this._isTabVisible=!document[this._visibilityTabHiddenAttr],this._targetsObserved.getAll().forEach((function(t){t.lastVisible&&t.listener(e._isTabVisible,L.TAB)}))},t._initTabVisibility=function(){void 0!==document.hidden?(this._visibilityTabHiddenAttr="hidden",this._visibilityTabChangeEventName="visibilitychange"):void 0!==document.msHidden?(this._visibilityTabHiddenAttr="msHidden",this._visibilityTabChangeEventName="msvisibilitychange"):void 0!==document.webkitHidden&&(this._visibilityTabHiddenAttr="webkitHidden",this._visibilityTabChangeEventName="webkitvisibilitychange"),this._visibilityTabHiddenAttr&&this._visibilityTabChangeEventName&&(this._eventManager.listen(document,this._visibilityTabChangeEventName,this._handleTabVisibilityChange.bind(this)),this._isTabVisible=!document[this._visibilityTabHiddenAttr])},t.observe=function(e,t,n){if(this._observer){var r="number"==typeof n?n:this._config.playerThreshold,i=new O(r/100,t);if(this._targetsObserved.has(e)){var a=this._targetsObserved.get(e)[0].lastIntersectionRatio;void 0!==a&&(i.lastIntersectionRatio=a,i.listener(this._isTabVisible&&a>=i.threshold,L.VIEWPORT))}else this._observer.observe(e);this._targetsObserved.push(e,i)}},t.unObserve=function(e,t){this._observer&&(this._targetsObserved.remove(e,t),this._targetsObserved.has(e)||this._observer.unobserve(e))},t.destroy=function(){this._observer&&(this._eventManager.destroy(),this._observer.disconnect(),this._targetsObserved.clear())},e}(),L={VIEWPORT:"viewport",TAB:"tab"},O=function(e,t){this.threshold=e,this.listener=t},M=[0,10,20,30,40,50,60,70,80,90,100],N=50,U=[],F="kalturaStartTime";function B(e){if(!e)throw new Error(l);!function(e){if(!e)throw new Error(u);var t=document.getElementById(e);if(!t)throw new Error(c+e);if(t.getElementsByClassName("kaltura-player-container").length>0)throw new Error(d+e)}(e.targetId)}function j(e){r.Utils.Object.getPropertyPath(e,"ui.log")||r.Utils.Object.createPropertyPath(e,"ui.log",{}),r.Utils.Object.getPropertyPath(e,"provider.log")||r.Utils.Object.createPropertyPath(e,"provider.log",{}),r.Utils.Object.getPropertyPath(e,"log")||r.Utils.Object.createPropertyPath(e,"log",{}),e.log&&"function"==typeof e.log.handler&&(Object(r.setLogHandler)(e.log.handler),e.ui.log.handler=e.provider.log.handler=e.log.handler);var t=r.LogLevel.ERROR;!e.log||!0!==window.DEBUG_KALTURA_PLAYER&&""!==H("debugKalturaPlayer")?e.log&&e.log.level&&r.LogLevel[e.log.level]&&(t=r.LogLevel[e.log.level]):(t=r.LogLevel.DEBUG,e.log.level=r.LogLevel.DEBUG.name),e.ui.log.level=e.provider.log.level=t.name,Object(r.setLogLevel)(t)}function H(e){var t;window.URLSearchParams?t=new URLSearchParams(window.location.search).get(e):t=function(e){e=e.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search),n=location.search.indexOf(e)>-1;return null===t?n?"":null:decodeURIComponent(t[1].replace(/\+/g," "))}(e);return t}function V(){return window.__kalturaplayerdata||{}}function G(e){var t=function(e){var t=document.createElement("div");t.id=r.Utils.Generator.uniqueId(5),t.className="kaltura-player-container",t.setAttribute("tabindex","-1");var n=document.getElementById(e);return n&&t&&n.appendChild(t),t.id}(e.targetId),n={targetId:e.targetId,provider:{partnerId:e.provider.partnerId},ui:{targetId:t},plugins:{},advertising:{adBreaks:[]},viewability:{observedThresholds:M,playerThreshold:N}};if(r.Utils.Object.mergeDeep(n,e),!e.provider.ignoreServerConfig){var i=r.Utils.Object.copyDeep(V());delete i.productVersion,n=r.Utils.Object.mergeDeep({},K(i),n)}return function(e){if(r.Env.isMacOS&&r.Env.isSafari||r.Env.isIOS){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.preferNative.hls")&&r.Utils.Object.mergeDeep(e,{playback:{preferNative:{hls:!0}}})}}(n),function(e){if(r.Env.isMacOS&&r.Env.isSafari||r.Env.isIOS){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"text.useNativeTextTrack")&&r.Utils.Object.mergeDeep(e,{text:{useNativeTextTrack:!0}})}}(n),function(e){r.Utils.Object.getPropertyPath(e,"plugins.kava")||r.Utils.Object.mergeDeep(e,{plugins:{kava:{disable:!0}}}),r.Utils.Object.getPropertyPath(e,"plugins.ottAnalytics")||r.Utils.Object.mergeDeep(e,{plugins:{ottAnalytics:{}}})}(n),function(e){if(r.Env.isSmartTV){if(Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!0}),function(e){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.playAdsWithMSE")&&(e=r.Utils.Object.createPropertyPath(e,"playback.playAdsWithMSE",!0));var t=r.Utils.Object.getPropertyPath(e,"plugins.ima.disableMediaPreload"),n=r.Utils.Object.getPropertyPath(e,"plugins.bumper.disableMediaPreload");e.plugins&&e.plugins.ima&&"boolean"!=typeof t&&(e=r.Utils.Object.createPropertyPath(e,"plugins.ima.disableMediaPreload",!0));e.plugins&&e.plugins.bumper&&"boolean"!=typeof n&&(e=r.Utils.Object.createPropertyPath(e,"plugins.bumper.disableMediaPreload",!0))}(e),function(e){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.options.html5.hls.liveSyncDurationCount")&&r.Env.isSafari&&(e=r.Utils.Object.createPropertyPath(e,"playback.options.html5.hls.liveSyncDurationCount",2))}(e),e.plugins&&e.plugins.ima){var t=r.Utils.Object.getPropertyPath(e,"plugins.ima.forceReloadMediaAfterAds"),n=r.Utils.Object.getPropertyPath(e,"plugins.ima.delayInitUntilSourceSelected");"boolean"!=typeof t&&(e=r.Utils.Object.createPropertyPath(e,"plugins.ima.forceReloadMediaAfterAds",!0)),"boolean"!=typeof n&&(e=r.Utils.Object.createPropertyPath(e,"plugins.ima.delayInitUntilSourceSelected",!0))}if(e.plugins&&e.plugins.youbora)"number"!=typeof r.Utils.Object.getPropertyPath(e,"plugins.youbora.playheadMonitorInterval")&&(e=r.Utils.Object.createPropertyPath(e,"plugins.youbora.playheadMonitorInterval",2e3));"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"streaming.lowLatencyMode")&&(e=r.Utils.Object.createPropertyPath(e,"streaming.lowLatencyMode",!1))}}(n),function(e){if("Edge"===r.Env.browser.name){r.Utils.Object.getPropertyPath(e,"drm.keySystem")||(e="Windows"===r.Env.os.name?r.Utils.Object.createPropertyPath(e,"drm.keySystem",r.DrmScheme.PLAYREADY):r.Utils.Object.createPropertyPath(e,"drm.keySystem",r.DrmScheme.WIDEVINE))}}(n),function(e){if(r.Env.isIOS&&e.plugins&&e.plugins.ima&&!e.plugins.ima.disable){var t=r.Utils.Object.getPropertyPath(e,"playback.playsinline"),n=r.Utils.Object.getPropertyPath(e,"plugins.ima.disableMediaPreload");!1===t&&"boolean"!=typeof n&&r.Utils.Object.createPropertyPath(e,"plugins.ima.disableMediaPreload",!0)}}(n),function(e){if(e.plugins&&e.plugins.imadai&&!e.plugins.imadai.disable){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.options.html5.hls.autoStartLoad")&&r.Utils.Object.mergeDeep(e,{playback:{options:{html5:{hls:{autoStartLoad:!1}}}}})}}(n),function(e){var t=r.Utils.Object.getPropertyPath(e,"plugins.bumper"),n=r.Utils.Object.getPropertyPath(e,"plugins.imadai");if(t){var i={};"boolean"!=typeof t.playOnMainVideoTag&&(r.Env.isSmartTV||r.Env.isIOS&&e.playback&&!1===e.playback.playsinline)&&(i.playOnMainVideoTag=!0),n&&!n.disable&&(Array.isArray(t.position)||(i.position=[0]),"boolean"!=typeof t.disableMediaPreload&&(i.disableMediaPreload=!0)),r.Utils.Object.mergeDeep(e,{plugins:{bumper:i}})}}(n),function(e){var t=r.Utils.Object.getPropertyPath(e,"plugins.vr");if(t&&!t.disable){"boolean"!=typeof r.Utils.Object.getPropertyPath(e,"playback.inBrowserFullscreen")&&r.Utils.Object.mergeDeep(e,{playback:{inBrowserFullscreen:!0}})}}(n),function(e){if(r.Env.isIOS){var t=r.Utils.Object.getPropertyPath(e,"playback.playsinline"),n=r.Utils.Object.hasPropertyPath(e,"plugins.airplay"),i=!1!==t;n?Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!1,mutedAutoPlay:i}):"iPhone"!==r.Env.device.model||i||Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!1,mutedAutoPlay:!1})}}(n),n}function K(e){return function(){if(e.player){U.push({level:"warn",msg:"Path config.player will be deprecated soon. Please update your config structure as describe here: https://github.com/kaltura/kaltura-player-js/blob/master/docs/configuration.md"});var t=r.Utils.Object.copyDeep(e.player);delete e.player,r.Utils.Object.mergeDeep(e,t)}}(),[["duration","sources.duration"],["type","sources.type"],["dvr","sources.dvr"],["id","sources.id"],["name","metadata.name"],["metadata.poster","sources.poster"],["metadata","sources.metadata"],["logLevel","log.level"],["ui.components.fullscreen.inBrowserFullscreenForIOS","playback.inBrowserFullscreen"],["playback.enableCEA708Captions","text.enableCEA708Captions"],["playback.useNativeTextTrack","text.useNativeTextTrack"],["playback.options.html5.dash.useShakaTextTrackDisplay","text.useShakaTextTrackDisplay"],["playback.captionsTextTrack1Label","text.captionsTextTrack1Label"],["playback.captionsTextTrack1LanguageCode","text.captionsTextTrack1LanguageCode"],["playback.captionsTextTrack2Label","text.captionsTextTrack2Label"],["playback.captionsTextTrack2LanguageCode","text.captionsTextTrack2LanguageCode"],["plugins.visibility.threshold","viewability.playerThreshold"],["plugins.visibility.floating","plugins.floating"],["playback.startTime","sources.startTime"]].forEach((function(t){return function(t,n){if(r.Utils.Object.hasPropertyPath(e,t))if(U.push({level:"warn",msg:"Path config.player."+t+" will be deprecated soon. Please update your config structure as describe here: https://github.com/kaltura/kaltura-player-js/blob/master/docs/configuration.md"}),r.Utils.Object.hasPropertyPath(e,n))r.Utils.Object.deletePropertyPath(e,t);else{var i=r.Utils.Object.getPropertyPath(e,t),a=r.Utils.Object.createPropertyPath({},n,i);r.Utils.Object.mergeDeep(e,a),r.Utils.Object.deletePropertyPath(e,t)}}(t[0],t[1])})),e}function z(e,t,n){var r=e.config.playback,i=!1;return r.streamPriority.forEach((function(e){e.engine===t&&(i=!0)})),i||r.streamPriority.push({engine:t,format:n}),r}function W(e){var t=e&&e.progressive;return!(!t||!t[0]||"video/youtube"!==t[0].mimetype)}function Y(e){var t=e&&e.image;return!(!t||!t[0])}function q(e,t){var n={},i={};return r.Utils.Object.isObject(e)&&Object.entries(e).forEach((function(e){var a=e[0],o=e[1];n[a]={},i[a]={},Object.entries(o).forEach((function(e){var o=e[0],s=e[1],l=r.Utils.Object.getPropertyPath(t[a],o);n[a][o]=l||s,i[a][o]=l}))})),[n,i]}function X(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q(r.key),r)}}function Q(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var $=function(){function e(e,t,n){this.name=e,this.player=t,this.eventManager=new r.EventManager,this.logger=Object(r.getLogger)(r.Utils.String.capitlize(this.name)),this.config={},r.Utils.Object.mergeDeep(this.config,this.constructor.defaultConfig,n)}e.createPlugin=function(e,t,n){return void 0===n&&(n={}),new this(e,t,n)},e.isValid=function(){throw new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED,"isValid()")};var t,n,i,a=e.prototype;return a.getConfig=function(e){return e?r.Utils.Object.copyDeep(this.config[e]):r.Utils.Object.copyDeep(this.config)},a.updateConfig=function(e){r.Utils.Object.mergeDeep(this.config,e)},a.loadMedia=function(){},a.destroy=function(){this.eventManager.destroy()},a.reset=function(){},a.getName=function(){return this.name},a.dispatchEvent=function(e,t){this.logger.debug("Fire event: "+e,t),this.player.dispatchEvent(new r.FakeEvent(e,t))},t=e,(n=[{key:"ready",get:function(){return Promise.resolve()}}])&&X(t.prototype,n),i&&X(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function J(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){(t=Q(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}($,"defaultConfig",{});var Z=function(){function e(){J(this,"_plugins",{}),J(this,"_isDisabledPluginMap",new Map)}e.register=function(t,n){return"function"!=typeof n||n.prototype instanceof $==!1?(e._logger.error("Plugin <"+t+"> registration failed, either plugin is not an instance of BasePlugin or plugin handler is not a function"),!1):e._registry.has(t)?(e._logger.debug("Plugin <"+t+"> is already registered, do not register again"),!1):(e._registry.set(t,n),e._logger.debug("Plugin <"+t+"> has been registered successfully"),!0)},e.unRegister=function(t){e._registry.has(t)&&(e._registry.delete(t),e._logger.debug("Unregistered <"+t+"> plugin."))};var t=e.prototype;return t.load=function(t,n,i){if(void 0===i&&(i={}),!e._registry.has(t))throw e._logger.warn("Plugin <"+t+"> loading failed, plugin is not registered"),new r.Error(r.Error.Severity.RECOVERABLE,r.Error.Category.PLAYER,r.Error.Code.RUNTIME_ERROR_NOT_REGISTERED_PLUGIN,t);var a=e._registry.get(t);"boolean"==typeof i.disable&&this._isDisabledPluginMap.set(t,i.disable);var o=!!this._isDisabledPluginMap.get(t),s=!!a&&a.isValid();if(a&&s&&!o){try{this._plugins[t]=a.createPlugin(t,n,i)}catch(e){throw new r.Error(r.Error.Severity.RECOVERABLE,r.Error.Category.PLAYER,r.Error.Code.PLUGIN_LOAD_FAILED,e)}return this._isDisabledPluginMap.set(t,!1),e._logger.debug("Plugin <"+t+"> has been loaded"),!0}return e._logger.debug("Plugin <"+t+"> isn't loaded, isValid()="+s.toString()+", disabled="+o.toString()),!1},t.loadMedia=function(){var e=this;Object.keys(this._plugins).forEach((function(t){return e._plugins[t].loadMedia()}))},t.destroy=function(){var e=this;Object.keys(this._plugins).forEach((function(t){e._plugins[t].destroy(),delete e._plugins[t]}))},t.reset=function(){var e=this;Object.keys(this._plugins).forEach((function(t){return e._plugins[t].reset()}))},t.get=function(e){return this._plugins[e]},t.getAll=function(){return this._plugins},e}();J(Z,"_logger",Object(r.getLogger)("PluginManager")),J(Z,"_registry",new Map);var ee=Z.register,te={youbora:{playerVersion:"{{pVersion}}",playerName:"{{pName}}",entryId:"{{entryId}}",entryName:"{{entryName}}",entryType:"{{entryType}}",sessionId:"{{sessionId}}",uiConfId:"{{uiConfId}}"},googleAnalytics:{entryId:"{{entryId}}",entryName:"{{entryName}}",uiConfId:"{{uiConfId}}",partnerId:"{{partnerId}}"},ottAnalytics:{entryId:"{{entryId}}",ks:"{{ks}}",isAnonymous:"{{isAnonymous}}",partnerId:"{{partnerId}}",serviceUrl:"{{serviceUrl}}"},ima:{playerVersion:"{{pVersion}}",playerName:"{{pName}}"},kava:{playerVersion:"{{pVersion}}",playerName:"{{pName}}",partnerId:"{{partnerId}}",playlistId:"{{playlistId}}",entryId:"{{entryId}}",entryType:"{{entryType}}",sessionId:"{{sessionId}}",ks:"{{ks}}",uiConfId:"{{uiConfId}}",referrer:"{{referrer}}",encodedReferrer:"{{encodedReferrer}}",serviceUrl:"{{analyticsServiceUrl}}"},comscore:{playerVersion:"{{pVersion}}"},vr:{rootElement:"{{domRootElementId}}"},share:{partnerId:"{{partnerId}}",uiConfId:"{{uiConfId}}",entryId:"{{entryId}}",embedBaseUrl:"{{embedBaseUrl}}"}},ne=new RegExp("{{.*}}");function re(e,t){return(re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ie(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ae=function(e){var t,n;function i(){var t;return ie(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call(this)||this),"_ottPluginsConfig",{kava:{ks:""}}),t._config=r.Utils.Object.mergeDeep({},t._basePluginsConfig,t._ottPluginsConfig),t}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,re(t,n),i}(function(){function e(){this._basePluginsConfig=r.Utils.Object.copyDeep(te)}var t=e.prototype;return t.get=function(){return this._config},t.set=function(e){if(e){var t=function e(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var i=n[0],a=n[1];return r.Utils.Object.isObject(a)?t[i]=e(a):"string"==typeof a&&ne.test(a)?t[i]=a:t[i]=void 0,t}),{})}(e);this._config=function e(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var i=n[0],a=n[1];return r.Utils.Object.isObject(a)?t[i]=e(a):a&&(t[i]=a),t}),{})}(r.Utils.Object.mergeDeep(this._config,t))}},t.reset=function(){this._config=r.Utils.Object.copyDeep(te)},e}());var oe=function(e,t){void 0===t&&(t={});try{var n,r=e;for(var i in t){var a=void 0!==t[i]&&null!==t[i]?t[i]:"";"string"==typeof a&&a.indexOf('"')>-1&&(a=a.replace(/"/g,'\\"')),n=new RegExp("{{"+i+"}}","g"),r=r.replace(n,a)}return r}catch(e){return""}},se=Object(r.getLogger)("PluginsConfig"),le=function(e){return("number"==typeof e||"function"==typeof e||"string"==typeof e||"boolean"==typeof e||r.Utils.Object.isClassInstance(e))&&!ne.test(e.toString())},ue=function(e){return r.Utils.Object.isObject(e)&&"function"!=typeof e&&!r.Utils.Object.isClassInstance(e)},ce=function(e){return e.map((function(e){if(ue(e)){var t=de(e);return r.Utils.Object.isEmptyObject(t)?null:t}return le(e)?e:null})).filter((function(e){return null!==e}))},de=function e(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var r=n[0],i=n[1];return ue(i)?t[r]=e(i):Array.isArray(i)?t[r]=ce(i):le(i)&&(t[r]=i),t}),{})};var pe=function(){function e(){this._pluginConfigStore=new ae}return e.prototype.evaluatePluginsConfig=function(e,t){if(e){this._pluginConfigStore.set(e);var n=function(e){var t,n={pVersion:(null==(t=V())?void 0:t.productVersion)||"3.18.0-canary.0-14a3ea8",pName:"@playkit-js/kaltura-player-js"};if(e.targetId&&(n.domRootElementId=e.targetId),e.provider&&e.provider.env){n.serviceUrl=e.provider.env.serviceUrl;var i=r.Utils.Object.getPropertyPath(e,"provider.env.analyticsServiceUrl");i&&(n.analyticsServiceUrl=i+"/api_v3/index.php"),n.serviceUrl&&(n.embedBaseUrl=n.serviceUrl.replace("api_v3",""))}var a,o={referrer:C(),encodedReferrer:(a=C(),encodeURIComponent(a))};return e.provider&&r.Utils.Object.mergeDeep(o,{ks:e.provider.ks,uiConfId:e.provider.uiConfId,partnerId:e.provider.partnerId}),e.session&&r.Utils.Object.mergeDeep(o,{sessionId:e.session.id,ks:e.session.ks,isAnonymous:e.session.isAnonymous,uiConfId:e.session.uiConfId,partnerId:e.session.partnerId}),e.sources&&r.Utils.Object.mergeDeep(o,{entryId:e.sources.id,entryName:e.sources.metadata&&e.sources.metadata.name,entryType:e.sources.type}),e.playlist&&r.Utils.Object.mergeDeep(o,{playlistId:e.playlist.id}),Object.keys(o).forEach((function(e){void 0===o[e]&&delete o[e]})),r.Utils.Object.mergeDeep(n,o),n}(t),i=r.Utils.Object.mergeDeep({},this._pluginConfigStore.get(),e);!function(e,t){var n=de(t),i=de(e);i&&n&&Object.keys(e).forEach((function(t){e&&e[t]&&(e[t]=r.Utils.Object.mergeDeep({},n[t],i[t]))}))}(e,function(e){var t,n;e=(n=e)?n.replace(/\\n/g,"\\n").replace(/\\'/g,"\\'").replace(/\\"/g,'\\"').replace(/\\&/g,"\\&").replace(/\\r/g,"\\r").replace(/\\t/g,"\\t").replace(/\\b/g,"\\b").replace(/\\f/g,"\\f").replace(/[\u0000-\u0019]+/g,""):"";try{t=JSON.parse(e,(function(e){try{return JSON.parse(this[e])}catch(t){return this[e]}}))}catch(e){se.error("An error occurred while formatting config string.",e),t={}}return t}(oe(JSON.stringify(i),n)))}},e}();function he(e,t,n){var r=e.poster,i=t.poster,a=n.width,o=n.height;if("string"==typeof r&&r===i){/.*\/thumbnail\/.*(?:width|height)\/\d+\/(?:height|width)\/\d+/.test(r)&&(e.poster=function(e,t,n){var r=e.match(/width\/(\d+)/),i=e.match(/height\/(\d+)/);Array.isArray(r)&&(e=e.replace(r[1],t.toString()));Array.isArray(i)&&(e=e.replace(i[1],n.toString()));return e}(r,a,o))}else Array.isArray(r)&&(e.poster=function(e,t,n){var r=1/0,i="";return e.forEach((function(e){var a=e.width,o=e.height,s=Math.abs(a-t)+Math.abs(o-n);s<r&&(r=s,i=e.url)})),i}(r,a,o));t.poster=e.poster||""}n(10);function fe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ye(r.key),r)}}function ge(e,t,n){return(t=ye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var ve=function(){function e(e,t){var n=this;ge(this,"_disabled",!1),this._player=e;var r=t.ui;if(r.disable){this._disabled=!0;var a=document.getElementById(r.targetId);a&&a.appendChild(e.getView())}else this._uiManager=new i.UIManager(e,r),r.customPreset?this._uiManager.buildCustomUI(r.customPreset):this._uiManager.buildDefaultUI(),this._handleVr(t.plugins),this._handleExternalCSS(r);return new Proxy(this,{get:function(e,t){return n._disabled?function(){}:e[t]}})}var t,n,a,o=e.prototype;return o.destroy=function(){this._uiManager.destroy()},o.reset=function(){this._resetErrorState()},o.setConfig=function(e,t){this._uiManager.setConfig(e,t)},o.addComponent=function(e){return this._uiManager.addComponent(e)},o.removeComponent=function(e){var t={label:"Remove_"+e.removeComponent,get:i.Components.Remove,presets:e.presets,area:e.area||e.container,replaceComponent:e.removeComponent};return this._uiManager.addComponent(t)},o.registerManager=function(e,t){this._player.registerService(e,t)},o.getManager=function(e){return this._player.getService(e)},o.hasManager=function(e){return this._player.hasService(e)},o.setLoadingSpinnerState=function(e){this.setConfig({show:e},"loading")},o._resetErrorState=function(){this.setConfig({hasError:!1},"engine")},o._handleExternalCSS=function(t){t.css&&r.Utils.Dom.loadStyleSheetAsync(t.css).then((function(){e._logger.debug("external css was loaded successfully")}),(function(){e._logger.error("external css failed to load")}))},o._handleVr=function(e){void 0===e&&(e={}),e.vr&&!e.vr.disable&&this._setStereoConfig(e.vr)},o._setStereoConfig=function(e){(e.toggleStereo||(r.Env.isMobile||r.Env.isTablet)&&!1!==e.toggleStereo)&&this.setConfig(r.Utils.Object.mergeDeep({},{vrStereoMode:!!e.startInStereo}),"vrStereo")},t=e,(n=[{key:"store",get:function(){return this._uiManager.store}}])&&fe(t.prototype,n),a&&fe(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();ge(ve,"_logger",Object(r.getLogger)("UIWrapper"));var me={PLAYLIST_LOADED:"kaltura-player-playlistloaded",PLAYLIST_ITEM_CHANGED:"kaltura-player-playlistitemchanged",PLAYLIST_ENDED:"kaltura-player-playlistended"};function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_e(r.key),r)}}function _e(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var ke=["hls","dash","progressive","image"],Ee=function(){function e(e,t,n){this._sources=e,this._config=t,this._index=n}var t,n,i,a=e.prototype;return a.updateSources=function(e){this._sources=r.Utils.Object.mergeDeep({},e)},a.updatePlugins=function(e){this._plugins=r.Utils.Object.copyDeep(e)},a.isPlayable=function(){var e=this;return!!ke.find((function(t){return e._sources&&e._sources[t]&&e._sources[t].length}))},t=e,(n=[{key:"sources",get:function(){var e=this;return ke.forEach((function(t){e._sources&&e._sources[t]&&0===e._sources[t].length&&delete e._sources[t]})),this._sources}},{key:"config",get:function(){return this._config}},{key:"plugins",get:function(){return this._plugins||{}}},{key:"index",get:function(){return this._index}}])&&be(t.prototype,n),i&&be(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ae(r.key),r)}}function Ae(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var we=function(){function e(){this._id="",this._metadata={name:"",description:""},this._poster="",this._items=[],this._activeItemIndex=-1}var t,n,i,a=e.prototype;return a.configure=function(e,t){var n=this;this._id=e.id?e.id:this._id,this._poster=e.poster?e.poster:this._poster,this._metadata=e.metadata?e.metadata:this._metadata,e.items&&(this._items=[],e.items.forEach((function(e,i){if(e.sources){var a=r.Utils.Object.mergeDeep({},t),o=e.sources.options||{};e.sources.options=r.Utils.Object.mergeDeep(a,o)}n._items.push(new Ee(e.sources,e.config,i))})))},a.updateItemSources=function(e,t){this._items[e].updateSources(t)},a.updateItemPlugins=function(e,t){this._items[e].updatePlugins(t)},a.getNext=function(e){var t=e?(this._activeItemIndex+1)%this._items.length:this._activeItemIndex+1;return this._items[t]||null},t=e,(n=[{key:"id",get:function(){return this._id}},{key:"items",get:function(){return this._items}},{key:"metadata",get:function(){return this._metadata}},{key:"poster",get:function(){return this._poster}},{key:"current",get:function(){return this._items[this._activeItemIndex]||null}},{key:"prev",get:function(){return this._items[this._activeItemIndex-1]||null}},{key:"activeItemIndex",set:function(e){this._activeItemIndex=e}}])&&Te(t.prototype,n),i&&Te(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ce(r.key),r)}}function Ce(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var xe=function(){function e(e,t){this._player=e,this._eventManager=new r.EventManager,this._playlist=new we,this._options={autoContinue:!0,loop:!1,imageDuration:5},this._countdown={duration:10,showing:!0},this._mediaInfoList=[],this._playerOptions=t,this._appPluginConfig={}}var t,n,i,a=e.prototype;return a.configure=function(e,t){e&&(this._playlist.configure(e,r.Utils.Object.getPropertyPath(this._player.sources,"options")),r.Utils.Object.mergeDeep(this._options,e.options),r.Utils.Object.mergeDeep(this._countdown,e.countdown),e.items&&e.items.find((function(e){return!!e.sources}))&&(this._mediaInfoList=e.items.map((function(e,n){return t&&t.entries&&"object"==typeof t.entries[n]?t.entries[n]:{entryId:e.sources.id}})),this._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_LOADED,{playlist:this})),this._addBindings(),this.playNext()))},a.load=function(e,t,n){var r=this._getMergedPlaylistData(e,t);this.configure(r,n)},a.reset=function(){this._eventManager.removeAll(),this._playlist=new we,this._mediaInfoList=[]},a.playNext=function(){e._logger.debug("playNext");var t=this._playlist.getNext(!0);t&&this._setItem(t)},a.playPrev=function(){e._logger.debug("playPrev");var t=this._playlist.prev;t&&this._setItem(t)},a.playItem=function(t){e._logger.debug("playItem("+t+")");var n=this._playlist.items[t];n&&this._setItem(n)},a._getMergedPlaylistData=function(e,t){var n=this;return{id:e.id,metadata:e.metadata,poster:e.poster,options:t?t.options:this._options,countdown:t?t.countdown:this.countdown,items:e.items.map((function(e,i){var a=r.Utils.Object.copyDeep(e);return["sources.dvr","sources.type"].forEach((function(e){r.Utils.Object.deletePropertyPath(a,e)})),r.Utils.Object.mergeDeep(a.sources,t&&t.items&&t.items[i]&&t.items[i].sources),Array.isArray(a.sources.poster)&&n._player.updateKalturaPoster(a.sources,e.sources,n._player.dimensions),{sources:a.sources,config:t&&t.items&&t.items[i]&&t.items[i].config}}))}},a._addBindings=function(){var e=this;this._eventManager.listen(this._player,this._player.Event.Core.PLAYBACK_ENDED,(function(){return e._onPlaybackEnded()})),this._eventManager.listen(this._player,this._player.Event.Core.CHANGE_SOURCE_STARTED,(function(){return e._onChangeSourceStarted()}))},a._onPlaybackEnded=function(){var e=this._playlist.getNext(!1);e||this._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_ENDED)),!this._playerOptions.ui.disable&&this.countdown.showing||(e&&this._options.autoContinue||this._options.loop)&&this.playNext()},a._onChangeSourceStarted=function(){this._player.isImage()&&this._player.configure({sources:{duration:this._options.imageDuration}})},a._setItem=function(t){var n=this,i=t.index;e._logger.debug("Playing item number "+i,t);var a,o={loop:!1};this._playlist.current&&(this._player._playbackStart?o.autoplay=!0:o.autoplay=!(null==(a=this._playerOptions.playback)||!a.autoplay));if(this._player.configure({playback:o}),this._playlist.activeItemIndex=i,t.isPlayable()){var s,l;this._resetProviderPluginsConfig();var u=q(t.plugins,this._player.config.plugins),c=u[0];this._appPluginConfig=u[1];var d={session:this._player.config.session,plugins:c,sources:t.sources};return this._player.setMedia(d),this._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_ITEM_CHANGED,{index:i,activeItem:t,entryId:(null==(s=this._mediaInfoList[i])?void 0:s.entryId)||(null==(l=t.sources)?void 0:l.id)})),Promise.resolve()}if(this._mediaInfoList[i]){this._resetProviderPluginsConfig();var p={sources:t.sources};return this._player.setMedia(p),this._player.loadMedia(this._mediaInfoList[i]).then((function(e){n._playlist.updateItemSources(i,e.sources),n._playlist.updateItemPlugins(i,e.plugins),n._player.dispatchEvent(new r.FakeEvent(me.PLAYLIST_ITEM_CHANGED,{index:i,activeItem:t,entryId:n._mediaInfoList[i].entryId}))}))}return Promise.reject()},a._resetProviderPluginsConfig=function(){this._player.configure({plugins:this._appPluginConfig}),this._appPluginConfig={}},a.destroy=function(){this._eventManager.destroy()},t=e,(n=[{key:"items",get:function(){return this._playlist.items}},{key:"current",get:function(){return this._playlist.current}},{key:"next",get:function(){return this._playlist.getNext(this._options.loop)}},{key:"prev",get:function(){return this._playlist.prev}},{key:"id",get:function(){return this._playlist.id}},{key:"metadata",get:function(){return this._playlist.metadata}},{key:"poster",get:function(){return this._playlist.poster}},{key:"countdown",get:function(){if(this._playlist.current&&this._playlist.current.config){var e={duration:10,showing:!0};return r.Utils.Object.mergeDeep(e,this._countdown,this._playlist.current.config.countdown),e}return this._countdown}},{key:"options",get:function(){return this._options}}])&&Se(t.prototype,n),i&&Se(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();!function(e,t,n){(t=Ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(xe,"_logger",Object(r.getLogger)("PlaylistManager"));var Ie={CAST_SESSION_START_FAILED:"kaltura-player-castsessionstartfailed",CAST_SESSION_STARTING:"kaltura-player-castsessionstarting",CAST_SESSION_STARTED:"kaltura-player-castsessionstarted",CAST_SESSION_ENDING:"kaltura-player-castsessionending",CAST_SESSION_ENDED:"kaltura-player-castsessionended",CAST_AVAILABLE:"kaltura-player-castavailable"},Pe=function(e){this.textStyle=e.textStyle,this.mediaInfo=e.getMediaInfo(),this.mediaConfig=e.getMediaConfig(),this.advertising=e.config.plugins&&e.config.plugins.ima,this.config=r.Utils.Object.mergeDeep({},e.config,{sources:{startTime:De(e)},playback:{autoplay:0===e.currentTime||!e.paused,audioLanguage:Re(r.TrackType.AUDIO,e),textLanguage:Re(r.TrackType.TEXT,e)}})};function De(e){return e.isLive()?e.isDvr()?e.duration-e.currentTime<e.config.cast.dvrThreshold||!e.currentTime?-1:e.currentTime:-1:!e.isCasting()&&!e.currentTime&&e.config.sources.startTime>-1?e.config.sources.startTime:e.currentTime}function Re(e,t){var n=t.getActiveTracks();if(n[e])return n[e].language;try{return t.config.playback[e+"Language"]}catch(e){return null}}function Le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Oe(r.key),r)}}function Oe(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var Me=function(){function e(e,t,n){this._id=e,this._friendlyName=t,this._resuming=n}var t,n,r;return t=e,(n=[{key:"deviceFriendlyName",get:function(){return this._friendlyName}},{key:"id",get:function(){return this._id}},{key:"resuming",get:function(){return this._resuming}}])&&Le(t.prototype,n),r&&Le(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Be(r.key),r)}}function Ue(e,t){return(Ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e,t,n){return(t=Be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var je=function(e){var t,n;function i(t,n,a){var o;return Fe(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(o=e.call(this)||this),"_isCastInitiator",!1),o._playerConfig={},i._logger=Object(r.getLogger)(t),o._remoteControl=a,o._castConfig=r.Utils.Object.mergeDeep({},o.constructor.defaultConfig,n),o._eventManager=new r.EventManager,i._logger.debug("Initialized"),o}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ue(t,n),i.isSupported=function(){return!0};var a,o,s,l=i.prototype;return l.loadMedia=function(e){return Promise.resolve()},l.setMedia=function(e){},l.getMediaInfo=function(){},l.getMediaConfig=function(){},l.configure=function(e){void 0===e&&(e={})},l.ready=function(){return Promise.resolve()},l.load=function(){},l.play=function(){},l.pause=function(){},l.reset=function(){},l.destroy=function(){},l.isLive=function(){return!1},l.isDvr=function(){return!1},l.seekToLiveEdge=function(){},l.getStartTimeOfDvrWindow=function(){return 0},l.getTracks=function(e){return[]},l.getActiveTracks=function(){return{audio:void 0,video:void 0,text:void 0}},l.selectTrack=function(e){},l.hideTextTrack=function(){},l.enableAdaptiveBitrate=function(){},l.isAdaptiveBitrateEnabled=function(){return!0},l.setTextDisplaySettings=function(e){},l.startCasting=function(){},l.stopCasting=function(){},l.isCasting=function(){return!0},l.isCastAvailable=function(){return!0},l.getCastSession=function(){return new Me("","")},l.isVr=function(){return!1},l.toggleVrStereoMode=function(){},l.isInVrStereoMode=function(){return!1},a=i,(o=[{key:"ads",get:function(){return null}},{key:"textStyle",get:function(){return new r.TextStyle},set:function(e){}},{key:"buffered",get:function(){return[]}},{key:"currentTime",get:function(){return 0},set:function(e){}},{key:"duration",get:function(){return 0}},{key:"liveDuration",get:function(){return NaN}},{key:"volume",get:function(){return 1},set:function(e){}},{key:"paused",get:function(){return!1}},{key:"ended",get:function(){return!1}},{key:"seeking",get:function(){return!1}},{key:"muted",get:function(){return!1},set:function(e){}},{key:"src",get:function(){return""}},{key:"poster",get:function(){return""}},{key:"playbackRate",get:function(){return 1},set:function(e){}},{key:"engineType",get:function(){return""}},{key:"streamType",get:function(){return""}},{key:"type",get:function(){return i.Type}},{key:"config",get:function(){return this._playerConfig}},{key:"isCastInitiator",get:function(){return this._isCastInitiator},set:function(e){this._isCastInitiator=e}}])&&Ne(a.prototype,o),s&&Ne(a,s),Object.defineProperty(a,"prototype",{writable:!1}),i}(r.FakeEventTarget);function He(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ve(r.key),r)}}function Ve(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}Fe(je,"defaultConfig",{}),Fe(je,"Type","BaseRemotePlayer");var Ge=function(){function e(){var e=this;!function(e,t,n){(t=Ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"_uis",[{template:function(t){return e.idleUI(t)},condition:function(e){return e.engine.isIdle}},{template:function(t){return e.errorUI(t)},condition:function(e){return e.engine.hasError}},{template:function(t){return e.adsUI(t)},condition:function(e){return e.engine.adBreak}},{template:function(t){return e.liveUI(t)},condition:function(e){return e.engine.isLive}},{template:function(t){return e.playbackUI(t)}}])}var t,n,r,a=e.prototype;return a.playbackUI=function(e){return i.Presets.playbackUI(e)},a.idleUI=function(e){return i.Presets.idleUI(e)},a.adsUI=function(e){return i.Presets.adsUI(e)},a.liveUI=function(e){return i.Presets.liveUI(e)},a.errorUI=function(e){return i.Presets.errorUI(e)},t=e,(n=[{key:"uis",get:function(){return this._uis}}])&&He(t.prototype,n),r&&He(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ke(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ze(e,t)}function ze(e,t){return(ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function We(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qe(r.key),r)}}function Ye(e,t,n){return t&&We(e.prototype,t),n&&We(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qe(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var Xe=function(){function e(e){this._player=e}return Ye(e,[{key:"player",get:function(){return this._player}}]),e}(),Qe=function(e){function t(t,n,r){var i;return(i=e.call(this,t)||this)._session=n,r&&(i._ui=r),i}return Ke(t,e),Ye(t,[{key:"ui",get:function(){return this._ui}},{key:"session",get:function(){return this._session}}]),t}(Xe),$e=function(e){function t(t,n){var r;return(r=e.call(this,t)||this)._snapshot=n,r}return Ke(t,e),Ye(t,[{key:"snapshot",get:function(){return this._snapshot}}]),t}(Xe),Je=function(e){function t(t,n){var r;return(r=e.call(this,t)||this)._available=n,r}return Ke(t,e),Ye(t,[{key:"available",get:function(){return this._available}}]),t}(Xe);var Ze=function(e){this.getPlayerSnapshot=ot.bind(e),this.getUIWrapper=st.bind(e),this.onRemoteDeviceAvailable=it.bind(e),this.onRemoteDeviceConnected=tt.bind(e),this.onRemoteDeviceDisconnected=rt.bind(e),this.onRemoteDeviceConnecting=et.bind(e),this.onRemoteDeviceDisconnecting=nt.bind(e),this.onRemoteDeviceConnectFailed=at.bind(e)};function et(){Ze._logger.debug("onRemoteDeviceConnecting"),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_STARTING))}function tt(e){var t=this;Ze._logger.debug("onRemoteDeviceConnected",e);var n=e.player,i=e.ui,a=e.session;this._eventManager.removeAll(),Object.values(r.EventType).forEach((function(e){return t._eventManager.listen(n,e,(function(e){return t.dispatchEvent(e)}))}));var o=this.config;i&&r.Utils.Object.mergeDeep(o,{ui:{customPreset:i.uis}}),this.configure({playback:{muted:this.muted,volume:this.volume}}),this._localPlayer.reset(),this._uiWrapper.destroy(),this._remotePlayer=n,this._uiWrapper=new ve(this,o),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_STARTED,{session:a}))}function nt(){Ze._logger.debug("onRemoteDeviceDisconnecting"),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_ENDING))}function rt(e){var t=this;Ze._logger.debug("onRemoteDeviceDisconnected",e);var n=e.player,i=e.snapshot;if(this._remotePlayer&&this._remotePlayer===n&&(this._eventManager.removeAll(),lt.call(this,i),i)){this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_ENDED));var a,o=this.config,s=!i.config.playback.autoplay,l=i.mediaInfo,u=i.mediaConfig;i.config.playback.autoplay=!0,ut.call(this,i.config),this._eventManager.listenOnce(this,this.Event.Core.CHANGE_SOURCE_ENDED,(function(){ct.call(t,i.config.sources)})),l?a=this.loadMedia(l):u&&(a=Promise.resolve(),this.setMedia(u)),a&&a.then((function(){t._eventManager.listenOnce(t,t.Event.Core.FIRST_PLAYING,(function(){t.textStyle=i.textStyle,ut.call(t,o),dt.call(t,i.config.playback),s&&t.pause()}))}))}}function it(e){Ze._logger.debug("onRemoteDeviceAvailable",e);var t=e.player,n=e.available;this.dispatchEvent(new r.FakeEvent(Ie.CAST_AVAILABLE,{type:t.type,available:n}))}function at(){Ze._logger.debug("onRemoteDeviceConnectFailed"),this.dispatchEvent(new r.FakeEvent(Ie.CAST_SESSION_START_FAILED))}function ot(){var e=new Pe(this);return Ze._logger.debug("getPlayerSnapshot",e),e}function st(){return Ze._logger.debug("getUIWrapper"),this._uiWrapper}function lt(e){var t=this;this._uiWrapper.destroy();var n=this._localPlayer.config;if(n.plugins&&n.plugins.ima){var i={};if(n.cast.advertising&&n.cast.advertising.vast){if(e.config.sources.startTime>0){var a=n.plugins.ima.adTagUrl;i={adTagUrl:""},this._eventManager.listen(this,r.EventType.FIRST_PLAYING,(function(){return t.configure({plugins:{ima:{adTagUrl:a}}})}))}}else i={delayInitUntilSourceSelected:!0};r.Utils.Object.mergeDeep(n,{plugins:{ima:i}}),this._localPlayer.destroy(),this._remotePlayer=null,this._localPlayer=Object(r.loadPlayer)(n)}else this._remotePlayer=null;Object.values(r.EventType).forEach((function(e){return t._eventManager.listen(t._localPlayer,e,(function(e){return t.dispatchEvent(e)}))})),this._uiWrapper=new ve(this,this.config),this._uiWrapper.setConfig({isCastAvailable:this.isCastAvailable()},"engine")}function ut(e){var t=e.sources.startTime,n=e.playback.autoplay;this.configure({sources:{startTime:t},playback:{autoplay:n}})}function ct(e){if(e.captions.length){var t=e.captions;this.configure({sources:{captions:t}})}}function dt(e){if(e.audioLanguage){var t=this.getTracks(r.TrackType.AUDIO).find((function(t){return t.language===e.audioLanguage}));this.selectTrack(t)}if(e.textLanguage){var n=this.getTracks(r.TrackType.TEXT).find((function(t){return t.language===e.textLanguage}));this.selectTrack(n)}}function pt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Ze,"_logger",Object(r.getLogger)("RemoteControl"));var ht=function(){function e(){pt(this,"_remotePlayers",new Map)}e.register=function(t,n){"function"==typeof n?e._registry.has(t)?e._logger.debug("Remote player of type "+t+" is already registered"):(e._logger.debug("Register remote player of type "+t),e._registry.set(t,n)):e._logger.debug("remote player must be instance of BaseRemotePlayer")};var t=e.prototype;return t.load=function(t,n){var r=this;e._registry.forEach((function(i,a){e._logger.debug("Load remote player of type "+a);var o=new i(t,new Ze(n),n.config.targetId);r._remotePlayers.set(a,o)}))},t.startCasting=function(t){e._logger.debug("Start casting");var n=this._getRemotePlayer(t);return n?n.startCasting():Promise.reject()},t.isCastAvailable=function(t){var n=this._getRemotePlayer(t);return!!n&&(e._logger.debug("isCastAvailable: "+n.isCastAvailable()),n.isCastAvailable())},t.destroy=function(){var e=this._remotePlayers;Array.from(e.values()).forEach((function(e){return e.destroy()}))},t.setIsCastInitiator=function(e,t){var n=this._getRemotePlayer(e);n&&(n.isCastInitiator=t)},t._getRemotePlayer=function(e){var t=this._remotePlayers;return e&&t.get(e)?t.get(e):t.size>0?Array.from(t.values())[0]:void 0},e}();function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gt(r.key),r)}}function gt(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}pt(ht,"_registry",new Map),pt(ht,"_logger",Object(r.getLogger)("RemotePlayerManager"));var yt=function(){function e(e){this._type=e.type,this._position=e.position,this._numAds=e.numAds}var t,n,r;return e.prototype.toJSON=function(){return{type:this.type,position:this.position,numAds:this.numAds}},t=e,(n=[{key:"type",get:function(){return this._type}},{key:"position",get:function(){return this._position}},{key:"numAds",get:function(){return this._numAds}}])&&ft(t.prototype,n),r&&ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function vt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mt(r.key),r)}}function mt(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var bt=function(){function e(e,t){this._id=e,this._system=t.system,this._url=t.url,this._contentType=t.contentType,this._title=t.title,this._position=t.position,this._duration=t.duration,this._clickThroughUrl=t.clickThroughUrl,this._posterUrl=t.posterUrl,this._skipOffset=t.skipOffset,this._linear=t.linear,this._width=t.width||0,this._height=t.height||0,this._bitrate=t.bitrate||0,this._bumper=t.bumper,this._inStream=t.inStream||!1,this._vpaid=t.vpaid||!1,this._streamId=t.streamId||"",this._wrapperAdIds=t.wrapperAdIds,this._wrapperCreativeIds=t.wrapperCreativeIds,this._wrapperAdSystems=t.wrapperAdSystems}var t,n,r;return e.prototype.toJSON=function(){return{id:this.id,system:this.system,url:this.url,contentType:this.contentType,title:this.title,position:this.position,duration:this.duration,clickThroughUrl:this.clickThroughUrl,posterUrl:this.posterUrl,skipOffset:this.skipOffset,linear:this.linear,skippable:this.skippable,width:this.width,height:this.height,bitrate:this.bitrate,bumper:this.bumper,inStream:this.inStream,vpaid:this.vpaid}},t=e,(n=[{key:"id",get:function(){return this._id}},{key:"system",get:function(){return this._system}},{key:"contentType",get:function(){return this._contentType}},{key:"url",get:function(){return this._url}},{key:"title",get:function(){return this._title}},{key:"position",get:function(){return this._position}},{key:"duration",get:function(){return this._duration}},{key:"clickThroughUrl",get:function(){return this._clickThroughUrl}},{key:"posterUrl",get:function(){return this._posterUrl}},{key:"skipOffset",get:function(){return this._skipOffset}},{key:"linear",get:function(){return this._linear}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"bitrate",get:function(){return this._bitrate}},{key:"bumper",get:function(){return this._bumper}},{key:"inStream",get:function(){return this._inStream}},{key:"skippable",get:function(){return!!(this.skipOffset&&this.skipOffset>0)}},{key:"vpaid",get:function(){return this._vpaid}},{key:"streamId",get:function(){return this._streamId}},{key:"wrapperAdIds",get:function(){return this._wrapperAdIds}},{key:"wrapperCreativeIds",get:function(){return this._wrapperCreativeIds}},{key:"wrapperAdSystems",get:function(){return this._wrapperAdSystems}}])&&vt(t.prototype,n),r&&vt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function _t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kt=function(){function e(t){var n=this;_t(this,"_prebid",null),this._loadPromise=r.Utils.Object.defer(),this._loadPromise.catch((function(){return e._logger.warn("Prebid SDK failed to load")})),t?(this._config=t,this._loadPrebidSDKLib(this._config.libUrl).then((function(){n._isPrebidSDKLibLoaded()?(n._prebid=window.pbjs,n._loadPromise.resolve()):n._loadPromise.reject()})).catch((function(){n._loadPromise.reject()}))):this._loadPromise.reject()}var t=e.prototype;return t._isPrebidSDKLibLoaded=function(){return window.pbjs&&window.pbjs.que},t._loadPrebidSDKLib=function(e){return this._isPrebidSDKLibLoaded()?Promise.resolve():r.Utils.Dom.loadScriptAsync(e)},t._load=function(t){var n=this;return new Promise((function(r,i){n._loadPromise.then((function(){var a=setTimeout(i,t.timeout||4e3);n._prebid.que.push((function(){n._prebid.addAdUnits(t.adUnit),t.options&&n._prebid.setConfig(t.options),n._prebid.requestBids({bidsBackHandler:function(o){if(e._logger.debug("returned bids",o),clearTimeout(a),t.params){var s={};t.adUnit&&(s.adUnit=t.adUnit),s.params=t.params;var l=n._prebid.adServers.dfp.buildVideoUrl(s);r([{vastUrl:l}])}else try{var u=o[t.adUnit.code||Object.keys(o)[0]].bids;r(u)}catch(e){i()}}})}))})).catch(i)}))},t.load=function(e){return this._load(e||this._config)},e}();function Et(e,t){return(Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Tt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}_t(kt,"_logger",Object(r.getLogger)("PrebidManager"));var At=function(e){var t,n;function r(t){var n;return Tt(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call(this)||this),"id","AdLayoutMiddleware"),n._context=t,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Et(t,n);var i=r.prototype;return i.load=function(e){var t=this;this._context.prerollReady.then((function(){return t.callNext(e)}))},i.play=function(e){var t=this;this._context.prerollReady.then((function(){return t.callNext(e)}))},r}(r.BaseMiddleware);function wt(){return(wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xt(r.key),r)}}function Ct(e,t){return(Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function xt(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var It=function(e){var t,n;function i(t,n){var i;return(i=e.call(this)||this)._player=t,i._eventManager=new r.EventManager,i._liveEventManager=new r.EventManager,i._adsPluginControllers=n,i._prebidManager=new kt(i._player.config.advertising&&i._player.config.advertising.prebid),i._init(),i}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ct(t,n);var a,o,s,l=i.prototype;return l.isAdPlaying=function(){return this.isAdBreak()&&this._isAdPlaying},l.isAdBreak=function(){return!!this._adBreak},l.getAdBreaksLayout=function(){return this._adBreaksLayout},l.getAdBreak=function(){return this._adBreak},l.getAd=function(){return this._ad},l.skipAd=function(){var e=this._adsPluginControllers.find((function(e){return e.active}));e&&e.skipAd()},l.playAdNow=function(e){var t=this;if(this.isAdBreak())i._logger.warn("Tried to call playAdNow during an ad break");else{var n=Promise.all(e.map((function(e){return t._getPrebidAds(e)})));this._playAdBreak({position:this._player.currentTime||0,ads:e,played:!1,loadedPromise:n})}},l.getMiddleware=function(){return this._middleware?this._middleware:this._middleware=new At(this)},l._init=function(){this._initMembers(),this._addBindings()},l._initMembers=function(){this._allAdsCompleted=!0,this._adBreaksLayout=[],this._adBreak=null,this._ad=null,this._adPlayed=!1,this._snapback=0,this._adIsLoading=!1,this._isAdPlaying=!1,this._liveSeeking=!1},l._addBindings=function(){var e=this;this._eventManager.listen(this._player,r.CustomEventType.SOURCE_SELECTED,(function(){return e._handleConfiguredAdBreaks()})),this._eventManager.listen(this._player,r.AdEventType.AD_MANIFEST_LOADED,(function(t){return e._onAdManifestLoaded(t)})),this._eventManager.listen(this._player,r.AdEventType.AD_BREAK_START,(function(t){return e._onAdBreakStart(t)})),this._eventManager.listen(this._player,r.AdEventType.AD_LOADED,(function(){return e._onAdLoaded()})),this._eventManager.listen(this._player,r.AdEventType.AD_STARTED,(function(t){return e._onAdStarted(t)})),this._eventManager.listen(this._player,r.AdEventType.AD_COMPLETED,(function(){return e._isAdPlaying=!1})),this._eventManager.listen(this._player,r.AdEventType.AD_BREAK_END,(function(){return e._onAdBreakEnd()})),this._eventManager.listen(this._player,r.AdEventType.ADS_COMPLETED,(function(){return e._onAdsCompleted()})),this._eventManager.listen(this._player,r.AdEventType.AD_ERROR,(function(t){return e._onAdError(t)})),this._eventManager.listen(this._player,r.CustomEventType.PLAYER_RESET,(function(){return e._reset()})),this._eventManager.listen(this._player,r.CustomEventType.PLAYER_DESTROY,(function(){return e._destroy()})),this._eventManager.listenOnce(this._player,r.Html5EventType.ENDED,(function(){return e._onEnded()})),this._eventManager.listenOnce(this._player,r.CustomEventType.PLAYBACK_ENDED,(function(){return e._onPlaybackEnded()})),this._eventManager.listen(this._player,r.AdEventType.AD_RESUMED,(function(){return e._isAdPlaying=!0})),this._eventManager.listen(this._player,r.AdEventType.AD_PAUSED,(function(){return e._isAdPlaying=!1}))},l._handleConfiguredAdBreaks=function(){var e=this,t=this._player.config.advertising.playAdsAfterTime||this._player.config.sources.startTime;this._configAdBreaks=this._player.config.advertising.adBreaks.filter((function(e){return("number"==typeof e.every||"number"==typeof e.position||"number"==typeof e.percentage)&&e.ads.length})).map((function(n){e._validateOneTimeConfig(n);var r=n.position;0===n.percentage&&(r=0),100===n.percentage&&(r=-1),n.every&&(r=n.every);var i=e._player.isLive()?r<t:r<=t;return{position:r,percentage:n.percentage,every:n.every,ads:n.ads.slice(),played:-1<r&&i}})),this._configAdBreaks.length?(this._dispatchAdManifestLoaded(),this._handlePrebidAdConfig(),this._handleConfiguredPreroll(),this._eventManager.listenOnce(this._player,r.Html5EventType.DURATION_CHANGE,(function(){e._player.isLive()?e._eventManager.listenOnce(e._player,r.Html5EventType.SEEKING,(function(){e._pushNextAdsForLive(e._configAdBreaks,(function(t){return e._player.currentTime+t.every})),e._attachLiveSeekedHandler()})):e._handleEveryAndPercentage(),e._configAdBreaks.sort((function(e,t){return e.position-t.position})),e._configAdBreaks.some((function(e){return e.position>0}))&&e._handleConfiguredMidrolls()}))):this.prerollReady=Promise.resolve()},l._validateOneTimeConfig=function(e){"number"==typeof e.position&&("number"==typeof e.percentage&&(i._logger.warn("Validate ad break - ignore percentage "+e.percentage+" as position "+e.position+" configured"),delete e.percentage),"number"==typeof e.every&&(i._logger.warn("Validate ad break - ignore every "+e.every+" as position "+e.position+" configured"),delete e.every)),"number"==typeof e.percentage&&"number"==typeof e.every&&(i._logger.warn("Validate ad break - ignore every "+e.every+" as percentage "+e.percentage+" configured"),delete e.every)},l._dispatchAdManifestLoaded=function(){var e=this,t=Array.from(new Set(this._configAdBreaks.map((function(e){return e.every&&e.every+"s"||"number"==typeof e.percentage&&e.percentage+"%"||e.position}))));i._logger.debug(r.AdEventType.AD_MANIFEST_LOADED,t),this._player.dispatchEvent(new r.FakeEvent(r.AdEventType.AD_MANIFEST_LOADED,{adBreaksPosition:t})),this._player.hasService("timeline")&&this._player.config.advertising.showAdBreakCuePoint&&t.forEach((function(t){e._player.getService("timeline").addCuePoint(wt({time:-1!==t?t:1/0},e._player.config.advertising.adBreakCuePointStyle))}))},l._handlePrebidAdConfig=function(){var e=this;this._prebidManager&&this._configAdBreaks.filter((function(e){return!e.played})).map((function(t){var n=Promise.all(t.ads.map((function(t){return e._getPrebidAds(t)})));t.loadedPromise=n,n.then((function(e){return t.ads=e}))}))},l._getPrebidAds=function(e){var t=this;return new Promise((function(n){if(e.prebid&&t._prebidManager){var i=r.Utils.Object.mergeDeep({},e.prebid,t._player.config.advertising.prebid);t._prebidManager.load(i).then((function(t){var r=t.map((function(e){return e&&e.vastUrl}));e.url=r.concat(e.url),n(e)})).catch((function(){n(e)}))}else n(e)}))},l._handleConfiguredPreroll=function(){var e=this._configAdBreaks.filter((function(e){return 0===e.position&&!e.played})),t=this._mergeAdBreaks(e);this.prerollReady=t&&t.loadedPromise?t.loadedPromise:Promise.resolve(),t&&this._playAdBreak(t)},l._handleEveryAndPercentage=function(){var e=this;this._configAdBreaks.forEach((function(t){if(e._player.duration&&t.every)for(var n=2*t.every;n<=e._player.duration;)e._configAdBreaks.push({position:n,ads:t.ads,played:!1,loadedPromise:Promise.resolve()}),n+=t.every;else e._player.duration&&t.percentage&&!t.position&&(t.position=Math.floor(e._player.duration*t.percentage/100))}))},l._attachLiveSeekedHandler=function(){var e=this;this._eventManager.listenOnce(this._player,r.CustomEventType.FIRST_PLAYING,(function(){e._eventManager.listen(e._player,r.Html5EventType.SEEKING,(function(){e._liveSeeking=!0})),e._eventManager.listen(e._player,r.Html5EventType.SEEKED,(function(){e._liveSeeking=!1,e._pushNextAdsForLive(e._configAdBreaks,(function(t){return e._player.currentTime+t.every}))}))}))},l._pushNextAdsForLive=function(e,t){this._liveEventManager.removeAll();var n=[];e.forEach((function(e){if(![-1,0].includes(e.position)){var r=e.every,a=e.ads,o={every:r,position:t(e),ads:a,played:!1,loadedPromise:Promise.resolve()};i._logger.debug("Pushing next ad for live",o),n.push(o)}})),n.length&&(this._configAdBreaks=[].concat(n,this._configAdBreaks.filter((function(e){return-1===e.position}))))},l._handleConfiguredMidrolls=function(){var e=this;this._eventManager.listen(this._player,r.Html5EventType.TIME_UPDATE,(function(){if(!e._player.paused&&!e._liveSeeking){var t=e._configAdBreaks.filter((function(t){return!t.played&&e._player.currentTime&&t.position<=e._player.currentTime&&t.position>e._snapback}));if(t.length){var n=t[t.length-1].position,a=t.filter((function(e){return e.position===n}));if(e._player.isLive())!e._player.isDvr()||e._player.isOnLiveEdge()&&e._player.config.advertising.returnToLive?e._handleReturnToLive(a):e._pushNextAdsForLive(a,(function(t){return(e._player.isOnLiveEdge()?e._player.currentTime:t.position)+t.every}));else e._snapback=n,i._logger.debug("Set snapback value "+e._snapback),e._eventManager.listen(e._player,r.Html5EventType.SEEKED,(function(){var t=e._configAdBreaks.findIndex((function(t){return t.played&&"number"==typeof e._player.currentTime&&e._player.currentTime<t.position}));t>0&&!e._configAdBreaks[t-1].played&&(e._snapback=0,i._logger.debug("Reset snapback value"))}));var o=e._mergeAdBreaks(a);o&&e._playAdBreak(o)}}}))},l._handleReturnToLive=function(e){var t=this;this._liveEventManager.listenOnce(this._player,r.AdEventType.AD_ERROR,(function(){t._pushNextAdsForLive(e,(function(e){return(t._player.isOnLiveEdge()?t._player.currentTime:e.position)+e.every}))})),this._liveEventManager.listenOnce(this._player,r.AdEventType.AD_BREAK_END,(function(){t._player.seekToLiveEdge()}))},l._playAdBreak=function(e){var t=this._adsPluginControllers.find((function(e){return"function"==typeof e.playAdNow}));t?(e.played=!0,this._adIsLoading=!0,i._logger.debug("Playing ad break positioned in "+e.position),e.loadedPromise.then((function(){return t.playAdNow(e.ads)}))):i._logger.warn("No ads plugin registered")},l._onAdManifestLoaded=function(e){this._adBreaksLayout=Array.from(new Set(this._adBreaksLayout.concat(e.payload.adBreaksPosition))).sort(),this._allAdsCompleted=!1},l._onAdBreakStart=function(e){this._adBreak=e.payload.adBreak},l._onAdLoaded=function(){this._adIsLoading=!1},l._onAdStarted=function(e){this._ad=e.payload.ad,this._adPlayed=!0,this._isAdPlaying=!0},l._onAdBreakEnd=function(){this._adBreak=null,this._ad=null},l._onAdsCompleted=function(){this._adsPluginControllers.every((function(e){return e.done}))&&this._configAdBreaks.every((function(e){return e.played}))&&(this._allAdsCompleted=!0,i._logger.debug(r.AdEventType.ALL_ADS_COMPLETED),this.dispatchEvent(new r.FakeEvent(r.AdEventType.ALL_ADS_COMPLETED)))},l._onAdError=function(e){this._adIsLoading=!1,e.payload.severity===r.Error.Severity.CRITICAL&&(this._isAdPlaying=!1,this._adsPluginControllers.every((function(e){return e.done}))&&this._configAdBreaks.every((function(e){return e.played}))&&(this._allAdsCompleted=!0,this._adPlayed&&(i._logger.debug(r.AdEventType.ALL_ADS_COMPLETED),this.dispatchEvent(new r.FakeEvent(r.AdEventType.ALL_ADS_COMPLETED)))))},l._isBumper=function(e){return"bumper"===e.name},l._onEnded=function(){var e=this;if(!this._adIsLoading){var t=this._adsPluginControllers.find((function(t){return e._isBumper(t)})),n=this._adsPluginControllers.find((function(t){return!e._isBumper(t)&&!t.done})),r=t&&"function"==typeof t.onPlaybackEnded?function(){return t.onPlaybackEnded()}:function(){return Promise.resolve()},i=n&&"function"==typeof n.onPlaybackEnded?function(){return n.onPlaybackEnded()}:function(){return Promise.resolve()};this._adBreaksLayout.includes(-1)||this._adBreaksLayout.includes("100%")||(this._allAdsCompleted=!0),r().finally((function(){i().finally((function(){return e._handleConfiguredPostroll()}))}))}},l._onPlaybackEnded=function(){this._configAdBreaks.forEach((function(e){return e.played=!0}))},l._handleConfiguredPostroll=function(){var e=this._configAdBreaks.filter((function(e){return!e.played&&-1===e.position}));if(e.length){var t=this._mergeAdBreaks(e);t&&this._playAdBreak(t)}this._configAdBreaks.forEach((function(e){return e.played=!0}))},l._reset=function(){this._eventManager.removeAll(),this._liveEventManager.removeAll(),this._init()},l._destroy=function(){this._adsPluginControllers=[],this._eventManager.destroy(),this._liveEventManager.destroy()},l._mergeAdBreaks=function(e){if(e.length)return e.forEach((function(e){return e.played=!0})),{position:e[0].position,ads:e.reduce((function(e,t){return e.concat(t.ads)}),[]),played:!1,loadedPromise:Promise.all(e.map((function(e){return e.loadedPromise})))}},a=i,(o=[{key:"allAdsCompleted",get:function(){return this._allAdsCompleted}}])&&St(a.prototype,o),s&&St(a,s),Object.defineProperty(a,"prototype",{writable:!1}),i}(r.FakeEventTarget);!function(e,t,n){(t=xt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(It,"_logger",Object(r.getLogger)("AdsController"));var Pt=function(){function e(e){this._pluginManager=e}return e.prototype.getAdsControllers=function(){return Object.values(this._pluginManager.getAll()).filter((function(e){return"function"==typeof e.getAdsController})).map((function(e){return e.getAdsController()}))},e}();function Dt(e,t){return(Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Lt=function(e){var t,n;function r(t){var n;return Rt(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call(this)||this),"id","PluginReadinessMiddleware"),n._plugins=t,r._logger.debug("plugins readiness",n._plugins),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Dt(t,n);var i=r.prototype;return i.load=function(e){this._checkNextSettle(0,e)},i._checkNextSettle=function(e,t){e<this._plugins.length?this._checkSettle(e,t):this.callNext(t)},i._checkSettle=function(e,t){var n=this;(this._plugins[e].ready?this._plugins[e].ready:Promise.resolve()).then((function(){r._logger.debug("plugin "+n._plugins[e].name+" ready promise resolved"),n._checkNextSettle(e+1,t)})).catch((function(){r._logger.debug("plugin "+n._plugins[e].name+" ready promise rejected"),n._checkNextSettle(e+1,t)}))},i.play=function(e){this._checkNextSettle(0,e)},r}(r.BaseMiddleware);function Ot(){return(Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Mt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Rt(Lt,"_logger",Object(r.getLogger)("PluginReadinessMiddleware"));var Nt={thumbsWidth:164,thumbsHeight:92,thumbsSlices:100},Ut=/.*\/p\/\d+\/(?:[a-zA-Z]+\/\d+\/)*thumbnail\/entry_id\/\w+\/.*\d+/,Ft=function(){function e(e,t,n){var i=this;if(Mt(this,"_isUsingKalturaThumbnail",(function(){return!(!i._thumbnailConfig||!i._thumbnailConfig.thumbsSprite)})),Mt(this,"_convertKalturaThumbnailToThumbnailInfo",(function(e){if(i._thumbnailConfig){var t=i._thumbnailConfig,n=t.thumbsSprite,a=t.thumbsWidth,o=t.thumbsSlices,s=i._player.duration/o,l={x:Math.floor(e/s)*a,y:0,url:n,height:i._thumbsHeight,width:a};return new r.ThumbnailInfo(l)}})),Mt(this,"_buildKalturaThumbnailConfig",(function(e,t){var n,a=r.Utils.Object.getPropertyPath(e,"components.seekbar"),o=t.sources&&t.sources.poster,s=t.sources&&t.sources.type===r.MediaType.VOD,l=i._player.shouldAddKs(t)?null==(n=t.session)?void 0:n.ks:"",u=r.Utils.Object.mergeDeep(Nt,a);return Ot({thumbsSprite:s?i._getThumbSlicesUrl(o,l,u):""},u)})),Mt(this,"_maybeCutThumbnail",(function(e){var t=r.Utils.Object.getPropertyPath(i._player.config.sources,"seekFrom"),n=r.Utils.Object.getPropertyPath(i._player.config.sources,"clipTo"),a=e;return t&&"number"==typeof t&&(a+="/start_sec/"+t),n&&"number"==typeof n&&(a+="/end_sec/"+n),a})),Mt(this,"_getThumbSlicesUrl",(function(e,t,n){if("string"==typeof e&&Ut.test(e))try{var r=Ot({thumbnailUrl:e},n),a=oe("{{thumbnailUrl}}/width/{{thumbsWidth}}/vid_slices/{{thumbsSlices}}",r),o=i._maybeCutThumbnail(a);return t?o+"/ks/"+t:o}catch(e){return""}return""})),this._player=e,this._thumbnailConfig=this._buildKalturaThumbnailConfig(t,n),this._eventManager=new r.EventManager,this._isUsingKalturaThumbnail()){var a,o=new Image;this._eventManager.listenOnce(o,"load",(function(){i._thumbsHeight=o.naturalHeight})),o.src=(null==(a=this._thumbnailConfig)?void 0:a.thumbsSprite)||""}}var t=e.prototype;return t.destroy=function(){this._eventManager.destroy()},t.getThumbnail=function(e){return this._isUsingKalturaThumbnail()?this._convertKalturaThumbnailToThumbnailInfo(e):this._player._localPlayer.getThumbnail(e)},t.getKalturaThumbnailConfig=function(){return this._thumbnailConfig},e}();function Bt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jt=function(){function e(e){Bt(this,"_textTrack",null),this._player=e}var t=e.prototype;return t._addTextTrack=function(){this._textTrack=this._player.addTextTrack(r.TextTrack.KIND.METADATA,"CuePoints")},t._getMetadataTracks=function(){return this._player.getNativeTextTracks().filter((function(e){return e.kind===r.TextTrack.KIND.METADATA&&e.cues}))},t._createTextTrackCue=function(e){var t=e.startTime,n=e.endTime,i=e.id,a=e.metadata;return Object(r.createTextTrackCue)({startTime:t,endTime:n,id:i,type:r.TimedMetadata.TYPE.CUE_POINT,metadata:a})},t._cuesSorter=function(e,t){return e.startTime-t.startTime},t.getAllCuePoints=function(){return this._getMetadataTracks().reduce((function(e,t){return e.concat(Array.from(t.cues).map((function(e){return Object(r.createTimedMetadata)(e)})))}),[]).sort(this._cuesSorter)},t.getActiveCuePoints=function(){return this._getMetadataTracks().reduce((function(e,t){return e.concat(Array.from(t.activeCues).map((function(e){return Object(r.createTimedMetadata)(e)})))}),[]).sort(this._cuesSorter)},t._getTextTrackCueById=function(e){var t=null;return this._getMetadataTracks().some((function(n){return t=n.cues.getCueById(e)})),t},t._removeTextTrackCue=function(e){this._getMetadataTracks().forEach((function(t){try{t.removeCue(e)}catch(e){}}))},t.addCuePoints=function(e){var t=this;this._player.ready().then((function(){t._textTrack||t._addTextTrack();var n=[];e.forEach((function(e){var i,a=t._createTextTrackCue(e),o=t._getTextTrackCueById(e.id);o&&t._removeTextTrackCue(o),null==(i=t._textTrack)||i.addCue(a),n.push(Object(r.createTimedMetadata)(a))})),t._player.dispatchEvent(new r.FakeEvent(r.EventType.TIMED_METADATA_ADDED,{cues:n}))}))},t._clearAllTextTrackCues=function(){var e=this;this._getMetadataTracks().forEach((function(t){for(;t.cues.length;)e._removeTextTrackCue(t.cues[0])}))},t.reset=function(){this._clearAllTextTrackCues()},t.destroy=function(){this.reset()},e}();function Ht(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vt=function(){function e(t){var n=this;Ht(this,"_servicesRegistry",new Map),e._logger=Object(r.getLogger)("ServiceProvider"),this._eventManager=new r.EventManager,this._eventManager.listen(t,t.Event.Core.PLAYER_RESET,(function(){return n.reset()}))}var t=e.prototype;return t.register=function(t,n){this._servicesRegistry.has(t)?e._logger.debug(t+" service already exists"):(this._servicesRegistry.set(t,n),e._logger.debug(t+" service registered"))},t.get=function(e){return this._servicesRegistry.get(e)},t.has=function(e){return this._servicesRegistry.has(e)},t.reset=function(){this._servicesRegistry.forEach((function(e){return"function"==typeof e.reset&&e.reset()}))},t.destroy=function(){this._servicesRegistry.forEach((function(e){return"function"==typeof e.destroy&&e.destroy()})),this._eventManager.removeAll(),this._servicesRegistry.clear()},e}();function Gt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */zt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,o=Object.create(a.prototype),s=new I(r||[]);return i(o,"_invoke",{value:w(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="executing",f="completed",g={};function y(){}function v(){}function m(){}var b={};u(b,o,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(P([])));k&&k!==n&&r.call(k,o)&&(b=k);var E=m.prototype=y.prototype=Object.create(b);function T(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,a,o,s){var l=d(e[i],e,a);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(c).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}})}function w(t,n,r){var i=p;return function(a,o){if(i===h)throw new Error("Generator is already running");if(i===f){if("throw"===a)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var l=S(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var u=d(t,n,r);if("normal"===u.type){if(i=r.done?f:"suspendedYield",u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=f,r.method="throw",r.arg=u.arg)}}}function S(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(i,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=m,i(E,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=u(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},T(A.prototype),u(A.prototype,s,(function(){return this})),t.AsyncIterator=A,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new A(c(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(E),u(E,l,"Generator"),u(E,o,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=P,I.prototype={constructor:I,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(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},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),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Wt(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Yt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){Wt(a,r,i,o,s,"next",e)}function s(e){Wt(a,r,i,o,s,"throw",e)}o(void 0)}))}}var qt=[["widevine","com.widevine.alpha"],["playready","com.microsoft.playready"],["fairplay","com.apple.fps"]],Xt=Object(r.getLogger)("MediaCapabilities"),Qt=1,$t=0,Jt=-1;function Zt(){return(Zt=Yt(zt().mark((function e(t){var n,r,i;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Xt.debug("Starting to get media capabilities..."),e.next=4,nn(t);case 4:return r=e.sent,e.next=7,en();case 7:return i=e.sent,n=Object.assign({},r,i),Xt.debug("Finished getting media capabilities ",{mediaCapabilities:n}),e.abrupt("return",n);case 13:return e.prev=13,e.t0=e.catch(0),Xt.debug("There was a problem with getting the media capabilities, ",e.t0.message),n={isHEVCSupported:$t,isPowerEfficient:$t,isDRMSupported:$t,supportedDRMs:[]},Xt.debug("Returning media capabilities defaults ",{mediaCapabilities:n}),e.abrupt("return",n);case 19:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function en(){return tn.apply(this,arguments)}function tn(){return(tn=Yt(zt().mark((function e(){var t,n,r,i,a,o,s,l;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={isDRMSupported:Jt,supportedDRMs:[]},navigator.requestMediaKeySystemAccess){e.next=3;break}return e.abrupt("return",t);case 3:n=[{initDataTypes:["cenc"],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}],r=new Map(qt),i=Gt(r);case 6:if((a=i()).done){e.next=19;break}return o=a.value,s=o[0],l=o[1],e.prev=8,e.next=11,navigator.requestMediaKeySystemAccess(l,n);case 11:t.supportedDRMs.push(s),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(8),Xt.debug(l+" not supported ("+e.t0.name+": "+e.t0.message+").");case 17:e.next=6;break;case 19:return t.isDRMSupported=t.supportedDRMs.length>0?Qt:$t,e.abrupt("return",t);case 21:case"end":return e.stop()}}),e,null,[[8,14]])})))).apply(this,arguments)}function nn(e){return rn.apply(this,arguments)}function rn(){return(rn=Yt(zt().mark((function e(t){var n,r,i;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={isHEVCSupported:Jt,isPowerEfficient:Jt},navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo){e.next=3;break}return e.abrupt("return",n);case 3:return r={type:"media-source",video:{contentType:'video/mp4; codecs="hvc1.1.6.L150.90"',width:(null==t?void 0:t.width)||1920,height:(null==t?void 0:t.height)||1080,bitrate:(null==t?void 0:t.bitrate)||12e5,framerate:(null==t?void 0:t.framerate)||30}},e.prev=4,e.next=7,navigator.mediaCapabilities.decodingInfo(r);case 7:i=e.sent,n.isHEVCSupported=i.supported?Qt:$t,n.isPowerEfficient=i.powerEfficient?Qt:$t,e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),Xt.debug("Failed to get the media capabilities from navigator. ("+e.t0.name+": "+e.t0.message+")."),n.isHEVCSupported=Jt,n.isPowerEfficient=Jt;case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,null,[[4,12]])})))).apply(this,arguments)}var an=function(e){return Zt.apply(this,arguments)};function on(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */on=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,o=Object.create(a.prototype),s=new I(r||[]);return i(o,"_invoke",{value:w(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="executing",f="completed",g={};function y(){}function v(){}function m(){}var b={};u(b,o,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(P([])));k&&k!==n&&r.call(k,o)&&(b=k);var E=m.prototype=y.prototype=Object.create(b);function T(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,a,o,s){var l=d(e[i],e,a);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(c).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}})}function w(t,n,r){var i=p;return function(a,o){if(i===h)throw new Error("Generator is already running");if(i===f){if("throw"===a)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var l=S(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var u=d(t,n,r);if("normal"===u.type){if(i=r.done?f:"suspendedYield",u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=f,r.method="throw",r.arg=u.arg)}}}function S(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(i,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=m,i(E,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=u(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},T(A.prototype),u(A.prototype,s,(function(){return this})),t.AsyncIterator=A,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new A(c(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(E),u(E,l,"Generator"),u(E,o,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=P,I.prototype={constructor:I,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(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},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),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function sn(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function ln(){return(ln=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function un(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hn(r.key),r)}}function cn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dn(e,t){return(dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function pn(e,t,n){return(t=hn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hn(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var fn=function(e){var t,n;function o(t){var n;pn(cn(n=e.call(this)||this),"_eventManager",new r.EventManager),pn(cn(n),"_mediaInfo",null),pn(cn(n),"_remotePlayer",null),pn(cn(n),"_pluginManager",new Z),pn(cn(n),"_pluginsConfig",{}),pn(cn(n),"_reset",!0),pn(cn(n),"_firstPlay",!0),pn(cn(n),"_sourceSelected",null),pn(cn(n),"_appPluginConfig",{}),pn(cn(n),"_thumbnailManager",null),pn(cn(n),"_isVisible",!1),pn(cn(n),"_autoPaused",!1);var i=t.sources,o=t.plugins;n._configEvaluator=new pe,n._configEvaluator.evaluatePluginsConfig(o,t),n._playbackStart=!1;var s=r.Utils.Object.mergeDeep({},t);delete s.plugins,delete s.sources,n._localPlayer=Object(r.loadPlayer)(s),n._controllerProvider=new Pt(n._pluginManager),n._viewabilityManager=new R(n.config.viewability),n._uiWrapper=new ve(cn(n),r.Utils.Object.mergeDeep(t,{ui:{logger:{getLogger:r.getLogger,LogLevel:r.LogLevel}}})),n._serviceProvider=new Vt(cn(n)),n._cuepointManager=new jt(cn(n)),n._provider=new a.Provider(r.Utils.Object.mergeDeep(t.provider,{logger:{getLogger:r.getLogger,LogLevel:r.LogLevel}}),"3.18.0-canary.0-14a3ea8"),n._playlistManager=new xe(cn(n),t),Object.values(r.EventType).forEach((function(e){return n._eventManager.listen(n._localPlayer,e,(function(e){return n.dispatchEvent(e)}))})),n._addBindings();var l=r.Utils.Object.mergeDeep({},t.playlist,{items:null});return n._playlistManager.configure(l),n.configure({plugins:o}),n._playlistManager.configure({items:t.playlist&&t.playlist.items||[]}),n._localPlayer.setSources(i||{}),n._remotePlayerManager=new ht,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,dn(t,n);var l,u,c,d=o.prototype;return d.loadMedia=function(e,t){var n=this;return o._logger.debug("loadMedia",e),this._mediaInfo=e,this.reset(),this._localPlayer.loadingMedia=!0,this._uiWrapper.setLoadingSpinnerState(!0),new Promise((function(i,a){n._provider.getMediaConfig(e).then((function(e){var a=r.Utils.Object.copyDeep(e);t&&(a.sources=a.sources||{},a.sources=r.Utils.Object.mergeDeep(a.sources,t));var o=q(a.plugins,n.config.plugins);a.plugins=o[0],n._appPluginConfig=o[1],n.configure(s({sources:n.sources},a)),n.setMedia(a),i(a)}),(function(e){var t=new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.LOAD_FAILED,e);n._localPlayer.dispatchEvent(new r.FakeEvent(r.EventType.ERROR,t)),a(e)}))}))},d.setMedia=function(e){o._logger.debug("setMedia",e),this.reset(!0);var t=r.Utils.Object.copyDeep(e),n=r.Utils.Object.mergeDeep({},t.sources,this._localPlayer.sources);delete t.sources,r.Utils.Object.mergeDeep(t.session,this._localPlayer.config.session),t.plugins=t.plugins||{},Object.keys(this._pluginsConfig).forEach((function(e){t.plugins[e]=t.plugins[e]||{}})),this.configure({session:e.session}),W(n)||Y(n)?this._thumbnailManager=null:this._thumbnailManager=new Ft(this,this.config.ui,e),this.updateKalturaPoster(n,e.sources,this._localPlayer.dimensions),D(this,ln({},t,{sources:n}));var i=function(e,t){return t&&W(t)?z(e,"youtube","progressive"):t&&Y(t)?z(e,"image","image"):null}(this,n);i&&(t.playback=i),this.configure(ln({},t,{sources:n}))},d.updateKalturaPoster=function(e,t,n){var r;he(e,t,n,this.shouldAddKs()&&(null==(r=this.config)||null==(r=r.session)||r.ks))},d.shouldAddKs=function(e){var t;return!(!this.config.provider.loadThumbnailWithKs||!1!==(null==(t=e||this.config)||null==(t=t.session)?void 0:t.isAnonymous))},d.loadPlaylist=function(e,t){var n=this;return o._logger.debug("loadPlaylist",e),this._uiWrapper.setLoadingSpinnerState(!0),new Promise((function(i,a){n._provider.getPlaylistConfig(e).then((function(e){n.setPlaylist(e,t),i(e)}),(function(e){var t=new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.LOAD_FAILED,e);n._localPlayer.dispatchEvent(new r.FakeEvent(r.EventType.ERROR,t)),a(e)}))}))},d.loadPlaylistByEntryList=function(e,t){var n=this;return o._logger.debug("loadPlaylistByEntryList",e),this._uiWrapper.setLoadingSpinnerState(!0),new Promise((function(i,a){n._provider.getEntryListConfig(e).then((function(r){n.setPlaylist(r,t,e),i(r)}),(function(e){var t=new r.Error(r.Error.Severity.CRITICAL,r.Error.Category.PLAYER,r.Error.Code.LOAD_FAILED,e);n._localPlayer.dispatchEvent(new r.FakeEvent(r.EventType.ERROR,t)),a(e)}))}))},d.setPlaylist=function(e,t,n){o._logger.debug("setPlaylist",e);var r={playlist:e,plugins:{}};Object.keys(this._pluginsConfig).forEach((function(e){r.plugins[e]={}})),this._configEvaluator.evaluatePluginsConfig(r.plugins,r),this._configureOrLoadPlugins(r.plugins),this._playlistManager.load(e,t,n)},d.getMediaInfo=function(){return r.Utils.Object.copyDeep(this._mediaInfo)},d.getDrmInfo=function(){return this._localPlayer.getDrmInfo()},d.getMediaConfig=function(){var e={sources:this._localPlayer.sources,plugins:this._pluginsConfig};return r.Utils.Object.copyDeep(e)},d.setSourcesMetadata=function(e){this._localPlayer.setSourcesMetadata(e)},d.configure=function(e){void 0===e&&(e={}),e=K(e);var t=r.Utils.Object.mergeDeep({},this.config,e);this._configEvaluator.evaluatePluginsConfig(e.plugins,t),this._configureOrLoadPlugins(e.plugins);var n=r.Utils.Object.mergeDeep({},e);if(delete n.plugins,n.sources){var i=n.sources;delete n.sources,this._localPlayer.configure(n),this._localPlayer.setSources(i||{})}else this._localPlayer.configure(n);e.ui&&this._uiWrapper.setConfig(t.ui),e.playlist&&this._playlistManager.configure(e.playlist)},d.ready=function(){return this._localPlayer.ready()},d.load=function(){this._localPlayer.load()},d.play=function(){this._localPlayer.play()},d.pause=function(){this._localPlayer.pause()},d.getView=function(){return this._localPlayer.getView()},d.getVideoElement=function(){return this._localPlayer.getVideoElement()},d.reset=function(e){var t;(void 0===e&&(e=!1),this._reset)||(this._reset=!0,this._firstPlay=!0,this._sourceSelected=null,this._attachEventManager&&this._attachEventManager.removeAll(),this._uiWrapper.reset(),this._resetProviderPluginsConfig(),this._pluginManager.reset(),this._cuepointManager.reset(),this._localPlayer.reset(e),null==(t=this._thumbnailManager)||t.destroy())},d.destroy=function(){var e,t=this.config.ui.targetId;this._reset=!0,this._playbackStart=!1,this._firstPlay=!0,this._uiWrapper.destroy(),this._pluginManager.destroy(),this._cuepointManager.destroy(),this._playlistManager.destroy(),this._localPlayer.destroy(),this._eventManager.destroy(),null==(e=this._thumbnailManager)||e.destroy(),this._viewabilityManager.destroy(),this._remotePlayerManager.destroy(),this._pluginsConfig={};var n=document.getElementById(t);n&&n.parentNode&&r.Utils.Dom.removeChild(n.parentNode,n)},d.isLive=function(){return this._localPlayer.isLive()},d.isOnLiveEdge=function(){return this._localPlayer.isOnLiveEdge()},d.isDvr=function(){return this._localPlayer.isDvr()},d.isUntimedImg=function(){return Y(this.sources)&&!("number"==typeof this.config.sources.duration&&this.config.sources.duration>0)},d.isImage=function(){return Y(this.sources)},d.isAudio=function(){return this._localPlayer.isAudio()},d.seekToLiveEdge=function(){this._localPlayer.seekToLiveEdge()},d.getStartTimeOfDvrWindow=function(){return this._localPlayer.getStartTimeOfDvrWindow()},d.getTracks=function(e){return this._localPlayer.getTracks(e)},d.getActiveTracks=function(){return this._localPlayer.getActiveTracks()},d.selectTrack=function(e){this._localPlayer.selectTrack(e)},d.hideTextTrack=function(){this._localPlayer.hideTextTrack()},d.showTextTrack=function(){this._localPlayer.showTextTrack()},d.enableAdaptiveBitrate=function(){this._localPlayer.enableAdaptiveBitrate()},d.isAdaptiveBitrateEnabled=function(){return this._localPlayer.isAdaptiveBitrateEnabled()},d.setTextDisplaySettings=function(e){this._localPlayer.setTextDisplaySettings(e)},d.isFullscreen=function(){return this._localPlayer.isFullscreen()},d.notifyEnterFullscreen=function(){this._localPlayer.notifyEnterFullscreen()},d.notifyExitFullscreen=function(){this._localPlayer.notifyExitFullscreen()},d.enterFullscreen=function(e){var t=e||this.config.ui.targetId;this._localPlayer.enterFullscreen(t)},d.exitFullscreen=function(){this._localPlayer.exitFullscreen()},d.enterPictureInPicture=function(){this._localPlayer.enterPictureInPicture()},d.exitPictureInPicture=function(){this._localPlayer.exitPictureInPicture()},d.isInPictureInPicture=function(){return this._localPlayer.isInPictureInPicture()},d.isPictureInPictureSupported=function(){return this._localPlayer.isPictureInPictureSupported()},d.getLogLevel=function(e){return this._localPlayer.getLogLevel(e)},d.startCasting=function(e){var t=this;return this.setIsCastInitiator(e,!0),new Promise((function(n,r){t.remotePlayerManager.startCasting(e).then(n).catch((function(){t.setIsCastInitiator(e,!1),r()}))}))},d.setIsCastInitiator=function(e,t){this._remotePlayerManager.setIsCastInitiator(e,t)},d.isCastAvailable=function(e){return this._remotePlayerManager.isCastAvailable(e)},d.getCastSession=function(){return null},d.stopCasting=function(){},d.isCasting=function(){return!1},d.isVr=function(){return this._localPlayer.isVr()},d.toggleVrStereoMode=function(){var e=this._pluginManager.get("vr");e&&"function"==typeof e.toggleVrStereoMode&&e.toggleVrStereoMode()},d.isInVrStereoMode=function(){var e=this._pluginManager.get("vr");return!(!e||"function"!=typeof e.isInStereoMode)&&e.isInStereoMode()},d.setLogLevel=function(e,t){this._localPlayer.setLogLevel(e,t)},d.getThumbnail=function(e){if(!e){if(isNaN(this.currentTime))return null;e=this.currentTime}if(e=this.isLive()?e+this.getStartTimeOfDvrWindow():e,this._thumbnailManager)return this._thumbnailManager.getThumbnail(e)},d._addBindings=function(){var e=this;this._eventManager.listen(this,r.EventType.CHANGE_SOURCE_STARTED,(function(){return e._onChangeSourceStarted()})),this._eventManager.listen(this,r.EventType.CHANGE_SOURCE_ENDED,(function(){return e._onChangeSourceEnded()})),this._eventManager.listen(this,r.EventType.PLAYER_RESET,(function(){return e._onPlayerReset()})),this._eventManager.listen(this,r.EventType.ENDED,(function(){return e._onEnded()})),this._eventManager.listen(this,r.EventType.FIRST_PLAY,(function(){return e._firstPlay=!1})),this._eventManager.listen(this,r.EventType.SOURCE_SELECTED,(function(t){return e._sourceSelected=t.payload.selectedSource[0]})),this._eventManager.listen(this,r.EventType.PLAYBACK_ENDED,(function(){return e._onPlaybackEnded()})),this._eventManager.listen(this,r.EventType.PLAYBACK_START,(function(){e._playbackStart=!0})),this._eventManager.listen(this,r.AdEventType.AD_AUTOPLAY_FAILED,(function(t){return e._onAdAutoplayFailed(t)})),this._eventManager.listen(this,r.AdEventType.AD_STARTED,(function(){return e._onAdStarted()})),this.config.playback.playAdsWithMSE&&(this._attachEventManager=new r.EventManager,this._eventManager.listen(this,r.AdEventType.AD_LOADED,(function(t){var n=t.payload.ad;n&&n.linear&&1===n.position&&!n.inStream&&e.src?(e._attachEventManager.listenOnce(e,r.AdEventType.AD_BREAK_START,(function(){return e.detachMediaSource()})),e._attachEventManager.listenOnce(e,r.AdEventType.AD_BREAK_END,(function(){return e.attachMediaSource()})),e._attachEventManager.listenOnce(e,r.AdEventType.AD_ERROR,(function(){return e.attachMediaSource()}))):e._attachEventManager.removeAll()}))),this._eventManager.listen(this,r.EventType.ERROR,(function(t){t.payload.severity===r.Error.Severity.CRITICAL&&(e._reset=!1)}))},d._onChangeSourceEnded=function(){r.Utils.Object.getPropertyPath(this.config,"ui.targetId")?this._viewabilityManager.observe(r.Utils.Dom.getElementById(this.config.ui.targetId),this._handleVisibilityChange.bind(this)):o._logger.warn("Cannot observe visibility change without config.ui.targetId")},d._onPlayerReset=function(){this._playbackStart=!1,r.Utils.Object.getPropertyPath(this.config,"ui.targetId")&&this._viewabilityManager.unObserve(r.Utils.Dom.getElementById(this.config.ui.targetId),this._handleVisibilityChange.bind(this))},d._onChangeSourceStarted=function(){this._configureOrLoadPlugins(this._pluginsConfig),this.reset(),this._pluginManager.loadMedia(),this._reset=!1},d._onEnded=function(){var e=this;setTimeout((function(){e._adsController&&!e._adsController.allAdsCompleted?e._eventManager.listenOnce(e._adsController,r.AdEventType.ALL_ADS_COMPLETED,(function(){e.dispatchEvent(new r.FakeEvent(r.EventType.PLAYBACK_ENDED))})):e.dispatchEvent(new r.FakeEvent(r.EventType.PLAYBACK_ENDED))}))},d._onPlaybackEnded=function(){this.config.playback.loop&&(this.currentTime=0,this.play())},d._onAdStarted=function(){this._firstPlay&&(this._localPlayer.posterManager.hide(),this._localPlayer.hideBlackCover())},d._onAdAutoplayFailed=function(e){this._firstPlay&&this.config.playback.autoplay&&(this._localPlayer.posterManager.show(),this.dispatchEvent(new r.FakeEvent(r.EventType.AUTOPLAY_FAILED,e.payload)))},d._configureOrLoadPlugins=function(e){var t=this;void 0===e&&(e={});var n=[],i=[],a=[];Object.keys(e).forEach((function(o){var s=t._pluginManager.get(o);if(s)s.updateConfig(e[o]),e[o]=s.getConfig();else if(t._sourceSelected)delete e[o];else{try{t._pluginManager.load(o,t,e[o])}catch(e){t.dispatchEvent(new r.FakeEvent(r.Error.Code.ERROR,e))}var l=t._pluginManager.get(o);l&&(a.push(l),e[o]=l.getConfig(),"function"==typeof l.getMiddlewareImpl&&("bumper"===l.name?n.push(l.getMiddlewareImpl()):n.unshift(l.getMiddlewareImpl())),"function"==typeof l.getUIComponents&&i.push.apply(i,l.getUIComponents()||[]),"function"==typeof l.getEngineDecorator&&t._localPlayer.registerEngineDecoratorProvider(new r.EngineDecoratorProvider(l)))}})),i.forEach((function(e){return t._uiWrapper.addComponent(e)})),this._pluginReadinessMiddleware||(this._pluginReadinessMiddleware=new Lt(a),this._localPlayer.playbackMiddleware.use(this._pluginReadinessMiddleware)),this._maybeCreateAdsController(),n.forEach((function(e){return t._localPlayer.playbackMiddleware.use(e)})),r.Utils.Object.mergeDeep(this._pluginsConfig,e)},d._maybeCreateAdsController=function(){var e=this;if(!this._adsController){var t=this._controllerProvider.getAdsControllers();t.length&&(this._adsController=new It(this,t),this._localPlayer.playbackMiddleware.use(this._adsController.getMiddleware()),this._eventManager.listen(this._adsController,r.AdEventType.ALL_ADS_COMPLETED,(function(t){e.dispatchEvent(t)})))}},d.attachMediaSource=function(){this._localPlayer.attachMediaSource()},d.detachMediaSource=function(){this._localPlayer.detachMediaSource()},d._resetProviderPluginsConfig=function(){this.configure({plugins:this._appPluginConfig}),this._appPluginConfig={}},d._handleVisibilityChange=function(e){this._isVisible=e,this.dispatchEvent(new r.FakeEvent("visibilitychange",{visible:this._isVisible})),this.config.playback.autoplay===r.AutoPlayType.IN_VIEW&&this._isVisible&&!this._playbackStart&&this._localPlayer.play({programmatic:!0}),!0===this.config.playback.autopause&&this._handleAutoPause(e)},d._handleAutoPause=function(e){var t=!this.paused||this._adsController&&this._adsController.isAdPlaying(),n=!this.isInPictureInPicture()&&this._playbackStart&&t;e?this._autoPaused&&(this.paused&&this.play(),this._autoPaused=!1):n&&(this.pause(),this._autoPaused=!0)},d.getService=function(e){return this._serviceProvider.get(e)},d.hasService=function(e){return this._serviceProvider.has(e)},d.registerService=function(e,t){this._serviceProvider.register(e,t)},d.addTextTrack=function(e,t){return this._localPlayer.addTextTrack(e,t)},d.getNativeTextTracks=function(){return this._localPlayer.getNativeTextTracks()},d.getMediaCapabilities=function(){var e,t=(e=on().mark((function e(t){return on().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",an(t));case 1:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){sn(a,r,i,o,s,"next",e)}function s(e){sn(a,r,i,o,s,"throw",e)}o(void 0)}))});return function(e){return t.apply(this,arguments)}}(),l=o,(u=[{key:"textDisplaySetting",get:function(){return this._localPlayer.textDisplaySetting}},{key:"textStyle",get:function(){return this._localPlayer.textStyle},set:function(e){this._localPlayer.textStyle=e}},{key:"buffered",get:function(){return this._localPlayer.buffered}},{key:"stats",get:function(){return this._localPlayer.stats}},{key:"currentTime",get:function(){return this._localPlayer.currentTime},set:function(e){this._localPlayer.currentTime=e}},{key:"duration",get:function(){return this._localPlayer.duration}},{key:"liveDuration",get:function(){return this._localPlayer.liveDuration}},{key:"normalizedCurrentTime",get:function(){return this.isLive()?this.currentTime-this.getStartTimeOfDvrWindow():this.currentTime},set:function(e){this.isLive()?this.currentTime=e+this.getStartTimeOfDvrWindow():this.currentTime=e}},{key:"normalizedDuration",get:function(){return this.isLive()?this.liveDuration-this.getStartTimeOfDvrWindow():this.duration}},{key:"volume",get:function(){return this._localPlayer.volume},set:function(e){this._localPlayer.volume=e}},{key:"paused",get:function(){return this._localPlayer.paused}},{key:"seeking",get:function(){return this._localPlayer.seeking}},{key:"playsinline",get:function(){return this._localPlayer.playsinline},set:function(e){this._localPlayer.playsinline=e}},{key:"muted",get:function(){return this._localPlayer.muted},set:function(e){this._localPlayer.muted=e}},{key:"src",get:function(){return this._localPlayer.src}},{key:"videoHeight",get:function(){return this._localPlayer.videoHeight}},{key:"videoWidth",get:function(){return this._localPlayer.videoWidth}},{key:"dimensions",get:function(){return this._localPlayer.dimensions},set:function(e){this._localPlayer.dimensions=e}},{key:"poster",get:function(){return this._localPlayer.poster}},{key:"ended",get:function(){return this._localPlayer.ended}},{key:"playbackRate",get:function(){return this._localPlayer.playbackRate},set:function(e){this._localPlayer.playbackRate=e}},{key:"playbackRates",get:function(){return this._localPlayer.playbackRates}},{key:"defaultPlaybackRate",get:function(){return this._localPlayer.defaultPlaybackRate}},{key:"engineType",get:function(){return this._localPlayer.engineType}},{key:"streamType",get:function(){return this._localPlayer.streamType}},{key:"env",get:function(){return this._localPlayer.env}},{key:"selectedSource",get:function(){return this._sourceSelected}},{key:"sources",get:function(){return ln({},this._localPlayer.sources)}},{key:"config",get:function(){return ln({},this._localPlayer.config,{plugins:this._pluginsConfig,sources:this._localPlayer.sources})}},{key:"hasUserInteracted",get:function(){return this._localPlayer.hasUserInteracted}},{key:"loadingMedia",set:function(e){this._localPlayer.loadingMedia=e}},{key:"ads",get:function(){return this._adsController}},{key:"plugins",get:function(){return this._pluginManager.getAll()}},{key:"provider",get:function(){return this._provider}},{key:"ui",get:function(){return this._uiWrapper}},{key:"playlist",get:function(){return this._playlistManager}},{key:"Event",get:function(){return ln({Cast:Ie,Core:r.EventType,Playlist:me,UI:i.EventType},r.EventType,{VISIBILITY_CHANGE:"visibilitychange"})}},{key:"TextStyle",get:function(){return this._localPlayer.TextStyle}},{key:"ViewabilityType",get:function(){return L}},{key:"State",get:function(){return this._localPlayer.State}},{key:"Track",get:function(){return this._localPlayer.Track}},{key:"LogLevelType",get:function(){return this._localPlayer.LogLevelType}},{key:"LogLevel",get:function(){return this._localPlayer.LogLevel}},{key:"AbrMode",get:function(){return this._localPlayer.AbrMode}},{key:"MediaType",get:function(){return this._localPlayer.MediaType}},{key:"StreamType",get:function(){return this._localPlayer.StreamType}},{key:"EngineType",get:function(){return this._localPlayer.EngineType}},{key:"Error",get:function(){return this._localPlayer.Error}},{key:"crossOrigin",get:function(){return this._localPlayer.crossOrigin},set:function(e){this._localPlayer.crossOrigin=e}},{key:"isVisible",get:function(){return this._isVisible}},{key:"viewabilityManager",get:function(){return this._viewabilityManager}},{key:"cuePointManager",get:function(){return this._cuepointManager}},{key:"remotePlayerManager",get:function(){return this._remotePlayerManager}}])&&un(l.prototype,u),c&&un(l,c),Object.defineProperty(l,"prototype",{writable:!1}),o}(r.FakeEventTarget);pn(fn,"_logger",Object(r.getLogger)("KalturaPlayer"+r.Utils.Generator.uniqueId(5)));var gn={};function yn(){return gn}function vn(e){return gn[e]?gn[e]:null}var mn=["_remotePlayer","_listeners","_uiWrapper"],bn={get:function(e,t){if("destroy"===t){var n=e.config.targetId;delete gn[n]}return t in r.FakeEventTarget.prototype||mn.includes(t)?e[t]:e._remotePlayer&&t in e._remotePlayer?e._remotePlayer[t]:e[t]},set:function(e,t,n){return e._remotePlayer&&!mn.includes(t)?t in e._remotePlayer&&(e._remotePlayer[t]=n):e[t]=n,!0}};function _n(e){!function(e){!1!==r.Utils.Object.getPropertyPath(e,"log.playerVersion")&&(Object(r.setLogLevel)(r.LogLevel.INFO),Object(r.getLogger)().log("%c @playkit-js/kaltura-player-js 3.18.0-canary.0-14a3ea8","color: #ff98f9; font-size: large"),Object(r.getLogger)().log("%c For more details see https://github.com/kaltura/kaltura-player-js","color: #ff98f9;"))}(e),B(e=K(e));var t=G(e);!function(e){var t,n=e.provider,i=null==(t=V())?void 0:t.productVersion;if(!n.partnerId||2504201===n.partnerId){var a={url:"https://analytics.kaltura.com/api_v3/index.php?service=analytics&action=trackEvent&apiVersion=3.3.0&format=1&eventType=1&partnerId=2504201&entryId=1_3bwzbc9o&&eventIndex=1&position=0",mimetype:""};a.url=function(e,t){return t&&(e+="&clientVer="+t),e}(a.url,i),a.url=x(a.url),a.url=P(a.url,i),a.url=S(a.url,r.Utils.Generator.guid()+":"+r.Utils.Generator.guid()),navigator.sendBeacon&&navigator.sendBeacon(a.url)}}(t),j(t),function(e){var t=parseFloat(H(F));isNaN(t)||r.Utils.Object.createPropertyPath(e,"sources.startTime",t)}(t),U.forEach((function(e){return Object(r.getLogger)("KalturaPlayer:Setup")[e.level](e.msg)})),function(e){!e.disableUserCache&&_.isLocalStorageAvailable()&&_.hasStorage()&&r.Utils.Object.mergeDeep(e,_.getStorageConfig())}(t);var n=function(e){var t=new fn(e),n=new Proxy(t,bn);return gn[e.targetId]=n,n}(t);return function(e){if(!e.config.disableUserCache&&_.isLocalStorageAvailable()){var t=_.getPlayerTextStyle();t&&(e.textStyle=r.Utils.Object.mergeDeep(new r.TextStyle,t))}}(n),function(e){_.isLocalStorageAvailable()&&_.attach(e)}(n),function(e,t){e.cast&&t.remotePlayerManager.load(e.cast,t)}(t,n),function(e){if(r.Env.isIOS||r.Env.isIPadOS){var t=function t(){e.removeEventListener(e.Event.UI.UI_CLICKED,t),Object(r.setCapabilities)(r.EngineType.HTML5,{autoplay:!0})};e.addEventListener(e.Event.SOURCE_SELECTED,(function n(){e.removeEventListener(e.Event.SOURCE_SELECTED,n),e.addEventListener(e.Event.UI.UI_CLICKED,t)}))}}(n),n}var kn=function(){function e(){}return e.toCastTextStyle=function(t){if(window.chrome&&window.chrome.cast){var n=new window.chrome.cast.media.TextTrackStyle;return n.fontFamily=t.fontFamily,n.backgroundColor=e.rgbToHex(t.backgroundColor),n.foregroundColor=e.rgbToHex(t.fontColor),n.fontScale=Number.parseFloat(t.fontSize)/100,n}return{}},e.toPlayerTextStyle=function(t){var n=new r.TextStyle;return n.fontFamily=t.fontFamily,n.fontSize=100*t.fontScale+"%",n.fontColor=e.hexToRGB(t.foregroundColor),n.backgroundColor=e.hexToRGB(t.backgroundColor),n},e.rgbToHex=function(e){var t="#"+("0"+parseInt(e[0],10).toString(16)).slice(-2)+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2);if(e[3]){var n=e[3];n=Math.round(100*n)/100,t+=(Math.round(255*n)+65536).toString(16).substr(-2).toUpperCase()}else t+="FF";return t.toUpperCase()},e.hexToRGB=function(e){for(var t=[],n=(e=e.slice(1)).match(/.{1,2}/g),r=0;r<3;r++){var i=n&&n[r];i&&t.push(parseInt(i,16))}return t},e}();function En(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Tn(e,t)}function Tn(e,t){return(Tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var An={ACTION:"action",EVENT:"event"},wn=function(e){this.type=e},Sn=function(e){function t(t,n){var r;return(r=e.call(this,An.EVENT)||this).event=t,r.payload=n,r}return En(t,e),t}(wn),Cn=function(e){function t(t,n){var r;return(r=e.call(this,An.ACTION)||this).action=t,r.args=n,r}return En(t,e),t}(wn),xn={registerRemotePlayer:ht.register,PlayerSnapshot:Pe,RemoteControl:Ze,RemoteSession:Me,BaseRemotePlayer:je,RemoteConnectedPayload:Qe,RemoteDisconnectedPayload:$e,RemoteAvailablePayload:Je,RemotePlayerUI:Ge,CastEventType:Ie,RemotePlayerType:{CHROMECAST:"chromecast"},TextStyleConverter:kn,CustomEventMessage:Sn,CustomActionMessage:Cn,CustomMessageType:An,CustomActionType:{SKIP_AD:"skipAd"},CustomMessage:wn},In={PlaylistEventType:me},Pn="@playkit-js/kaltura-player-js",Dn="ott",Rn="3.18.0-canary.0-14a3ea8";r.Ad=bt,r.AdBreak=yt,r.BasePlugin=$,r.registerPlugin=ee}]);
61
61
  //# sourceMappingURL=kaltura-tv-player.cjs.js.map