@viewlift/player-backup 2.0.242-backup → 2.0.244-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-fa25e36c.js → autoNextVideo-927cbfff.js} +1 -1
- package/cjs/bundle.css +527 -527
- package/cjs/{features-9d595ecd.js → features-a217b7f7.js} +1 -1
- package/cjs/generic-bc6a9ff6.js +1 -0
- package/cjs/{index-b5245fb0.js → index-240c7ca3.js} +1 -1
- package/cjs/{index-f8cb99fc.js → index-4b29a85a.js} +1 -1
- package/cjs/{index-a0c54c57.js → index-933adb79.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-80a70fe1.js → multicamv2-4d00cf1b.js} +1 -1
- package/cjs/{multicamv2-41b6300c.js → multicamv2-f1afde06.js} +1 -1
- package/cjs/{nextEpisodeButton-b2003b41.js → nextEpisodeButton-9624e32f.js} +1 -1
- package/cjs/{playlist-2da32614.js → playlist-e8cb9647.js} +1 -1
- package/cjs/{series-9e02fa24.js → series-23c1f0e1.js} +1 -1
- package/cjs/{series-v2-c74340cd.js → series-v2-7fea6a11.js} +1 -1
- package/cjs/{series-v2-0d6b2ed5.js → series-v2-f2425a71.js} +1 -1
- package/cjs/{skin-0edcebc6.js → skin-1700f3c5.js} +1 -1
- package/cjs/{skin-76b830fa.js → skin-3b0bfe77.js} +1 -1
- package/cjs/{skin-e6846b88.js → skin-4c83dd18.js} +1 -1
- package/cjs/{skin-6a5ff9b3.js → skin-5eda4f77.js} +1 -1
- package/cjs/{skin-10f659ae.js → skin-6f44537f.js} +1 -1
- package/cjs/{skin-b20205e1.js → skin-96cd6ec1.js} +1 -1
- package/cjs/{skin-aad2cdf9.js → skin-a3119cd9.js} +1 -1
- package/cjs/skin-ac1ab4b6.js +1 -0
- package/cjs/{skin-5c8601cd.js → skin-acb02671.js} +1 -1
- package/cjs/{skin-a59d5fce.js → skin-d1573cf2.js} +1 -1
- package/cjs/{util-dfb4690b.js → util-cf290925.js} +1 -1
- package/cjs/{videoSelector-c93d578e.js → videoSelector-0ad34d77.js} +1 -1
- package/cjs/{videoSelector-9fbef43b.js → videoSelector-e1e49ea7.js} +1 -1
- package/esm/{autoNextVideo-6665cb5d.js → autoNextVideo-1adeb55b.js} +1 -1
- package/esm/bundle.css +527 -527
- package/esm/{features-4d9dadd2.js → features-ad65c13d.js} +1 -1
- package/esm/generic-9e843157.js +1 -0
- package/esm/{index-4bae6ced.js → index-2d1f69b7.js} +1 -1
- package/esm/{index-9cdd702f.js → index-593646ba.js} +1 -1
- package/esm/{index-96f340db.js → index-b4fe58a0.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-979d3f2d.js → multicamv2-364c1bc5.js} +1 -1
- package/esm/{multicamv2-95376416.js → multicamv2-95c7b09b.js} +1 -1
- package/esm/{nextEpisodeButton-b1437651.js → nextEpisodeButton-e0b23e8f.js} +1 -1
- package/esm/{playlist-68518b08.js → playlist-f01e0c3c.js} +1 -1
- package/esm/{series-34dc376f.js → series-db2fe917.js} +1 -1
- package/esm/{series-v2-2dda1334.js → series-v2-a4bc1261.js} +1 -1
- package/esm/{series-v2-1051863c.js → series-v2-aad35690.js} +1 -1
- package/esm/skin-13a1ba23.js +1 -0
- package/esm/{skin-a5f3acf1.js → skin-13ec90ed.js} +1 -1
- package/esm/{skin-12828f94.js → skin-24c51d09.js} +1 -1
- package/esm/{skin-20255c93.js → skin-471523ff.js} +1 -1
- package/esm/{skin-ad9414e7.js → skin-7642fe4e.js} +1 -1
- package/esm/{skin-f7f65061.js → skin-880d8ae9.js} +1 -1
- package/esm/{skin-f7ba3e13.js → skin-91e1542e.js} +1 -1
- package/esm/{skin-52b2f4cb.js → skin-bcb42169.js} +1 -1
- package/esm/{skin-917a0e13.js → skin-cde24ab0.js} +1 -1
- package/esm/{skin-1ae76a5a.js → skin-df1fdca5.js} +1 -1
- package/esm/{util-04403c7d.js → util-f327531b.js} +1 -1
- package/esm/utilities/beacon.d.ts +1 -1
- package/esm/{videoSelector-890252dc.js → videoSelector-bd421b39.js} +1 -1
- package/esm/{videoSelector-c76d989d.js → videoSelector-f3603262.js} +1 -1
- package/package.json +2 -2
- package/cjs/generic-247ee476.js +0 -1
- package/cjs/skin-38de8257.js +0 -1
- package/esm/generic-55f5ab62.js +0 -1
- package/esm/skin-fbab87d5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-bc6a9ff6.js"),s=require("./resolution-f9dcc1b4.js"),u=require("./skin-f5e18b89.js"),d=require("./localisation-56e0a999.js"),c=require("./player_instance-fcf6a8fb.js");function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?h(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function p(e){var t=v();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}exports.addBigMuteButton=function(e,t){Promise.resolve().then((function(){return require("./index-4905764c.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("MuteButton",n),o.addChild("MuteButton",g({playerId:e},t))}))},exports.addCaptionButton=function(e,t){Promise.resolve().then((function(){return require("./caption-settings-d1eb3bf6.js")})).then((function(r){var n,o,l,a,s=r.default,u=c.getPlayer(e);i.registerComponent("captionSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),u&&u.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},u.controlBar.children().length-3)}))},exports.addDBClickFullScreen=function(e){var t=c.getPlayer(e).el(),r=0,n=c.getPlayer(e);n.addChild("fullscreenToggle");var o=function(){var e,r=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];r&&r.click()};n.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;n.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),n=e-r;if(n<300&&n>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}r=e})),window._multiplayer_dbTapHandler=o},exports.addMulticamSelector=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-f1afde06.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addMulticamSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-4d00cf1b.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then((function(){return require("./nextEpisodeButton-9624e32f.js")})).then((function(n){var o=n.default,l=c.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)}))},exports.addOutputtingOverlay=function(e,t){var r=c.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then((function(){return require("./playlist-e8cb9647.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},exports.addResolutionModule=function(e,t,r){Promise.resolve().then((function(){return require("./resolution-v2-e42e0101.js")})).then((function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=c.getPlayer(e),a=s.getRenditions(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:a},l.controlBar.children().length-4))}))},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=p(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-rewind-button");var a=u.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then((function(){return require("./series-23c1f0e1.js")})).then((function(n){var o=n.seriesModule,l=c.getPlayer(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",(function(){t[e]&&n.handleSeasonChange(t[e],e,l,r)}))},u=0;u<a.length;u++)s(u)}))},exports.addSeriesSelectorV2=function(e,t){Promise.resolve().then((function(){return require("./series-v2-f2425a71.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",g({playerId:e},t),o.controlBar.children().length-3)}))},exports.addSeriesSelectorV2_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then((function(){return require("./series-v2-7fea6a11.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",g({playerId:e},t),o.controlBar.children().length-3)}))},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then((function(){return require("./settings-icon-b43f4406.js")})).then((function(r){var n,o,l,a,s=r.default,u=c.getPlayer(e);i.registerComponent("settingsSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),u&&u.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},u.controlBar.children().length-3)}))},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=p(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-skip-button");var a=u.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=p(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=d.getLocalisation("slowMoText")||"Slow Mo",n}return r(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},exports.addStartFromBeginningButton=function(e,t){Promise.resolve().then((function(){return require("./start-begin-btn-5739a6c0.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("startFromBeginingButton",n);var l=o.getChild("controlBar").addChild("startFromBeginingButton",g({playerId:e},t),o.controlBar.children().findIndex((function(e){return"PlayToggle"===e.name_})));o.startFromBeginningButton=l}))},exports.addVideoSelector=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-e1e49ea7.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},exports.addVideoSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-0ad34d77.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},exports.addWatchLiveButton=function(e,t){Promise.resolve().then((function(){return require("./watch-live-btn-822534d1.js")})).then((function(r){var n=r.default,o=c.getPlayer(e);i.registerComponent("watchLiveButton",n);var l=o.getChild("controlBar").addChild("watchLiveButton",g({playerId:e},t),o.controlBar.children().findIndex((function(e){return"PlayToggle"===e.name_}))+1);o.watchLiveButton=l}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("axios"),i=require("./player_instance-fcf6a8fb.js"),l=require("js-cookie"),a=require("./currentVideoInfo-31d70bec.js"),d=require("./captions-dbc83a75.js"),u=require("@babel/runtime/helpers/typeof"),s=require("./skin-f5e18b89.js"),c=require("@babel/runtime/helpers/toConsumableArray"),v=require("@babel/runtime/helpers/slicedToArray"),m=require("@viewlift/comscore/index.js");function f(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function p(e,n){f("event",e,n)}var g={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function y(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?h(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):h(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var w={name:"@viewlift/player",version:"2.1.21",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/comscore":"^1.0.5",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=w.version;var I,E=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":P.get()+"".concat(null==g?void 0:g.getVideoDetails)},T=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:E(),params:y({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":w.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},b=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:P.get()+g.getLinearChannelDetails,params:y(y(y(y(y({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},S=function(){var e=n(t.mark((function e(n){var o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return o=e.sent,e.abrupt("return",r({url:P.get()+"".concat(null==g?void 0:g.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:y({},n),params:y({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),_=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:P.get()+"".concat(null==g?void 0:g.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},O=function(e){var n=e.videoId;return r({method:"GET",url:P.get()+"".concat(null==g?void 0:g.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},P=(I=null==g?void 0:g.apiBaseUrl,{set:function(e){e&&(I=e)},get:function(){return I}}),A=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},D=null;function L(){return{set:function(e){e&&(D=e)},get:function(){return D}}}var k=function(){var e=n(t.mark((function e(){var n,o,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),o=P.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),C=null,F=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!A(n)){e.next=6;break}return C||(C=k().then((function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&L().set(i),r||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){C=null}))),e.abrupt("return",C);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function j(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function V(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?j(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):j(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var x=function(){var e,n,t,o,r,i,l,d=a.getCurrentVideo();return"linearchannel"===((null==d?void 0:d.contentType)||"video")?null==d||null===(e=d.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==d?void 0:d.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==d||null===(r=d.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==d||null===(l=d.video)||void 0===l?void 0:l.id)||(null==d?void 0:d.id)};function N(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function W(){return B.apply(this,arguments)}function B(){return(B=n(t.mark((function e(){var n,o,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:if(n=e.sent,o=R(n),!(r=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",r);case 9:return r=N(),window.sessionStorage.setItem("uid",r),e.abrupt("return",r);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(){return U.apply(this,arguments)}function U(){return(U=n(t.mark((function e(){var n,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=N(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,o,r,i=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,p(i?"FAILED_TO_START":"DROPPED_STREAM",V({pfm:window.platform,uid:W(),vid:x(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:n===i?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e,n,t){e.one("play",tryCatch((function(){var o,r,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null}),100),p("PLAY",V({pfm:window.platform,uid:W(),vid:x(),videoPosition:Math.floor(e.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(i=r.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",V({"Video ID":x(),watchTime:Math.floor(e.currentTime())},t))})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var r,i,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&bufferingFireCount<4)bufferingFireCount++,p("BUFFERING",V({pfm:window.platform,uid:W(),vid:x(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",V({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:W(),vid:x()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var n,t,o,r,i,l;p("AD_REQUEST",V({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:W(),vid:x(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",V({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:W(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:x()},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var n=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(bufferingFireCount=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),r=0;r<o.length;r++){var i=o.start(r),l=o.end(r);if(H(n,i,l)){var a=Math.round(t-l);if(isFinite(a))return a}}}))()};var H=function(e,n,t){return e>=n&&e<=t};window.fireEvent=function(){var e=n(t.mark((function e(n){var o,i,l,d,u,s,c,v,m,f,p,h,y,w,I,E,T,b,S,_,O;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return T=e.sent,b=R(T),S=null==b?void 0:b.site,_=null==b?void 0:b.siteId,e.t0=V,e.t1=V,e.t2=V({aid:S,cid:_,pfm:window.platform},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,W();case 12:return e.t4=e.sent,e.t5=x(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(d=n.videoPosition)&&void 0!==d?d:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?(L=n.adPosition)?String(L):"":"",e.next=28,M();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(u=n.ttFirstFrame)&&void 0!==u?u:null,e.t23=null!==(s=n.bitrate)&&void 0!==s?s:null,e.t24=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t25=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t26=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t27=null!==(t=void 0,A=void 0,D=void 0,A=a.getCurrentVideo(),D=(null==A?void 0:A.contentType)||"video",f=(null==A||null===(t=A[D])||void 0===t?void 0:t.network)||null)&&void 0!==f?f:null,e.t28=null!=S?S:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(p=window)||void 0===p||null===(h=p.customData)||void 0===h||null===(y=h.beacon)||void 0===y?void 0:y.params,e.t33=(0,e.t0)(e.t31,e.t32),O=[e.t33],r({url:(null===(w=window)||void 0===w||null===(I=w.customData)||void 0===I||null===(E=I.beacon)||void 0===E?void 0:E.url)||P.get()+g.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:O}).catch((function(e){console.error(e)}));case 46:case"end":return e.stop()}var t,A,D,L}),e)})));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var G=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},q=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},Q=function(){var e=a.seasonIdxManager.get();return e>=0?e+1:1},Y=function(){var e,n,t,o=a.getCurrentSeries(),r=a.getCurrentVideo(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=a.seasonIdxManager.get(),d=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===i}));return d>=0?d+1:1};function z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function K(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?z(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):z(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var X=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},J=function(e){var n=$(e,"video.tags",[]),t=$(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},$=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},Z=function(){var n,t,o,r,a,d,u,s,c,v,m,f,p,g,h,y,w,I,E,T,b,S,_,O,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",A=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return P;var L=(null==D?void 0:D.siteName)||(null==D?void 0:D.site)||"",k=(null==D?void 0:D.contentType)||"video",C=(null==D||null===(o=D[k])||void 0===o?void 0:o.metadata)||(null==D||null===(r=D[k])||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.metadata),F=i.getPlayer(A);if(!P.includes("VIEWLIFT_"))return P;var R,j=window.getComputedStyle(document.getElementById(A),null),V=Math.trunc(j.getPropertyValue("height").slice(0,-2)),x=Math.trunc(j.getPropertyValue("width").slice(0,-2)),N="linearchannel"===k?null==D||null===(d=D.linearchannel)||void 0===d||null===(u=d.channels)||void 0===u||null===(s=u.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:$(D,"video.gist.id",""),W="linearchannel"===k?null==D||null===(v=D.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(f=m.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===f?void 0:f.title:$(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",(function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]})));var U=K(K({},ee(C)),{},(S={VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:X(x,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:$(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:$(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:$(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==F||null===(g=F.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==F||null===(h=F.options_)||void 0===h?void 0:h.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:J(D),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI($(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+$(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:$(null===(y=window)||void 0===y||null===(w=y.app_data)||void 0===w||null===(I=w.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==L||"usanetwork"==L?"":$(null===(E=window)||void 0===E||null===(T=E.app_data)||void 0===T||null===(b=T.site)||void 0===b?void 0:b.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*$(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:$(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:W,VIEWLIFT_CONTENT_SERIES_TITLE:$(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:$(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Y(),VIEWLIFT_SEASON_NUMBER:Q(),VIEWLIFT_CONTENT_TAGS:J(D),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(S,"VIEWLIFT_LAT",""),e(S,"VIEWLIFT_APP_BUNDLE",""),e(S,"VIEWLIFT_ATT_CONSENT",""),S),null===(_=window)||void 0===_||null===(O=_.customData)||void 0===O?void 0:O.macros);for(var H in U){var G=new RegExp(H,"g");P=P.replace(G,U[H])}return P},ee=function(e){var n,t,o,r,i,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){d.set(e.name,e.value)})));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(q()?u?a=K(K({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=K(K({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=K(K({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=K(K({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=K(K({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=K(K({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=q()?K(K({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):K(K({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=K(K({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=q()?K(K({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):K(K({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=K(K({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:d.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},ne=function(e,n){var t,o,r,i,l,a,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,h=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,y=null==e||null===(i=e[p])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.audioAssets,w=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var I=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=y&&y.hls)return oe(y);if(g){var E=re(h,n);return E.src=Z(E.src,n,e),E}if("Safari"!==G()&&I)return te(h);if(w){var T=oe(h);return T.src=Z(T.src,n,e),T}if(null!=h&&h.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(h);return b.src=Z(b.src,n,e),b}return null},te=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},oe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},re=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=G();if(i.getPlayer(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,n,t){console.log(e),e&&i(e),i(null,t)}))}}}}}(r);return ie(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(ie(n),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var ie=function(e){var n=i.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==G()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},le=function(e,n){if(Promise.resolve().then((function(){return require("./error-26d5a3c3.js")})).then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},ae=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var de=!1,ue=function(e,n,t){var o=Z(n,e,t),r=i.getPlayer(e);if(n&&window.google){if("function"!=typeof r.ima&&"object"!==u(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,l=i.getPlayer(e);if(null!==l.el_){de=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),de&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout((function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()}),1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,(function(){s&&l.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),l.one("ads-manager",(function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})),n.addEventListener(google.ima.AdEvent.Type.LOADED,(function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})}))})),l.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o)}};var se,ce=(se=!0,{enable:function(){se=!0},disable:function(){se=!1},get enabled(){return se}}),ve="ssai-breakStart",me="ssai-adImpression",fe="ssai-firstQuartile",pe="ssai-midpoint",ge="ssai-thirdQuartile",he="ssai-complete",ye="ssai-breakEnd",we={breakStart:ve,impression:me,firstQuartile:fe,midpoint:pe,thirdQuartile:ge,complete:he,breakEnd:ye};function Ie(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i.getPlayer(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=we[o];r&&t.trigger(r,n)}function Ee(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ee(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var be,Se=(be=null,{get:function(){return be},set:function(e){be=e}});function _e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Oe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):_e(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Pe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Ae(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ae(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Ae(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var De,Le=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),ke=(De=null,{set:function(e){De=e},get position(){return De}});function Ce(e,n){return Fe.apply(this,arguments)}function Fe(){return(Fe=n(t.mark((function e(n,o){var r,l,a,d,u,s,c,m,f,p,g,h,y,w,I,E,T,b;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.getPlayer(n),a=ne(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(r=o[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=Z(s,n,o),c=je(s),m=v(c,2),f=m[0],p=m[1],g=Re(p)||{},s=new URL(s.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=v(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)})),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Oe({adsParams:Oe({},f)},g))});case 14:return h=e.sent,e.next=17,h.json();case 17:return y=e.sent,w="https://"+new URL(s).hostname,I=y.trackingUrl,E=y.manifestUrl,T=w+I,b=w+E,Le.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),a.src=b,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}}),e,null,[[11,29]])})))).apply(this,arguments)}function Re(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(e){var n=v(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]})))||{}}function je(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Pe((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=v(t.value,2),l=i[0],a=i[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){r.e(e)}finally{r.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var m=v(c[s],2),f=m[0],p=m[1];if(f.startsWith("ads."))d[f.replace(/^ads\./,"")]=p;else u[f]=p}return[d,u]}var Ve,xe,Ne,We,Be=(Ve=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),Ve=Array.isArray(e)?c(e):Ve},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",Ve),c(Ve)}}),Me=new Map;function Ue(e,n){return He.apply(this,arguments)}function He(){return He=n(t.mark((function e(o,r){var l,a,d,u,v,m,f,p,g,h,y,w,I,E,T,b,S,_,O,P,A,D,L,k,C,F;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,r,l,a){var d,u,s=i.getPlayer(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[r])||void 0===u?void 0:u.adId)||c;e<k&&L.clear(),k=e,Math.floor(s.currentTime());var m,f=Pe(t);try{var p=function(){var t,i,l,d=m.value,u=d.eventType,f=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,y=p||c,w=f,I=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(l=i.ads)||void 0===l?void 0:l.adEventHandler)||null,E="".concat(v,"_").concat(u),T="pod-".concat(c);Me.has(T)||Me.set(T,new Set);var b=Me.get(T);if(console.warn(e,y,"map:",u,"condition1:",e>=y,"map:",Me),e>=y&&e<=y+D){if(!b.has(E)){b.add(E);try{C(u,n,w,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var S=ke.position;ke.set(null),setTimeout((function(){null!=S&&(s.currentTime(S),a())}),500)}if("function"==typeof I)try{var _,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[r],pod:n,adIndex:r};I({adsData:O}),Ie(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var P=Se.get();if(P&&0!==Object.keys(P).length){var A=P.formulateComscoreAdPayload,k=P.startComscoreAdTracking,F=P.finishComscoreAdTracking,R=P.endComscoreAdTracking,j="".concat(c,"_").concat(v,"_").concat(u);if(!L.has(j))if(L.set(j,!0),"impression"===u){var V,x=Le.get();k(A(Oe(Oe({},null==n||null===(V=n.ads)||void 0===V?void 0:V[r]),{},{trackingUrl:x})))}else"complete"===u?F():"breakEnd"===u&&R()}}};for(f.s();!(m=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}},C=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Me.clear(),ke.set(r),g=Le.get(),(h=i.getPlayer(o)).one("loadeddata",(function(){g&&P(g)})),y=new Map,w=new Map,I=-1,E=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==h||null===(d=h.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==h||null===(u=h.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==h||null===(v=h.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===m?void 0:m[0])||null,_=(null==h||null===(f=h.el())||void 0===f||null===(p=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(o);var r=[],i=null==o?void 0:o.find((function(e){return"breakEnd"===(null==e?void 0:e.eventType)})),l=(null==i||null===(e=i.beaconUrls)||void 0===e?void 0:e.find((function(e){return e.includes("videoView")})))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter((function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)})),u=(null==d?void 0:d.some((function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some((function(e){return e.includes("videoView")}))})))||!1;if(!u&&l){var s=null==d?void 0:d.map((function(e){return Oe(Oe({},e),{},{eventType:"videoView",beaconUrls:[l]})}));null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},P=function(){var e=n(t.mark((function e(n){var l,a,d,u,v,m,f,p,g,h,P,D,L,k,C,R,j,V,x,N,W,B,M,U;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N=function(e){document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",N),0===e.button&&j()},x=function(e){},V=function(){var e,n=h.currentTime(),t=null,o=Pe(g);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){h.currentTime(t+2.2)}),100))},j=function(){var e,n=h.currentTime(),t=null,o=Pe(g);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,d=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>i)&&!y.has(i)||n>=i&&n<=d)&&(t=i,y.set(i,!0),w.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){h.currentTime(t-.4)}),100))},v=!1,e.next=7,fetch(n);case 7:return m=e.sent,e.next=10,m.json();case 10:f=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",f),p=f.avails,g=[],h=i.getPlayer(o),P=h.controlBar.progressControl,D=P.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),p.map((function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(v=!0),g.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})})),!v&&r&&(h.currentTime(r),V()),null!=g&&g.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",g),window.adsQueueList=g,"function"==typeof(R=(null===(L=window)||void 0===L||null===(k=L.customData)||void 0===k||null===(C=k.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&(null==g?void 0:g.length)>0&&R(g)),console.log(g,"data"),g.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",D.appendChild(i)}})),h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=s.throttle((function(){var e=h.currentTime();if(e!==I){I=e;for(var n=!1,t=function(){var t=g[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-4&&e<=a+4){var d;e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&y.set(r,!0),ce.disable(),E&&E.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),P.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,v=0,m=0;m<l.length;m++){var f,p=null==l||null===(f=l[m])||void 0===f?void 0:f.durationInSeconds;if(u<s+p){v=m;break}s+=p}l[v];var h=Math.max(0,i-u),I=Math.round(h);W.style.display="block",U.textContent="".concat(v+1," of ").concat(l.length," • ").concat(A(I));var O=[];return null==l||l.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));O.push.apply(O,c(n))})),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,c(null==t?void 0:t.podSlotImpressionBeacon)),F(e,t,O,v,0,V),"break"}w.delete(r)},o=0;o<g.length;o++){if("break"===t())break}n||(W.style.display="none",P.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),E&&E.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),ce.enable())}}),1e3),h.on("timeupdate",h._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",(function(e){ce.enabled&&"ArrowRight"==e.key&&(j(),en(o,10),e.stopPropagation())})),P.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",x),document.addEventListener("pointerup",N))})),null===(d=document)||void 0===d||null===(u=d.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach((function(e){return null==e?void 0:e.remove()})),(W=document.createElement("div")).className="ssai-ad-container",(B=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",B.append(M),(U=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",W.append(B),W.append(U),h.el().appendChild(W);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),D=1.5,L=new Map,k=-1;case 21:case"end":return e.stop()}}),e)}))),He.apply(this,arguments)}function Ge(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return qe(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?qe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function qe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ye(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Qe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ze={},Ke=(null===(xe=window)||void 0===xe||null===(Ne=xe.location)||void 0===Ne||null===(We=Ne.search)||void 0===We?void 0:We.includes("debug=true"))||!1,Xe=null;function Je(e){return $e.apply(this,arguments)}function $e(){return $e=n(t.mark((function e(o){var r,l,a,d,u,v,m,f,p,g,h,y,w,I,E,T,b,S,_,O,P,A,D,L,k,C,F;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,r,l){var a,d,u=i.getPlayer(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[r])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,m=Ge(t);try{for(m.s();!(v=m.n()).done;){var f,p,g,h=v.value,y=h.eventType,w=h.beaconUrls,I=h.startTimeInSeconds,E=h.startTime,T=h.durationInSeconds,b=(h.eventId,I||s),S=w,_=(null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(y),P="pod-".concat(s);L.has(P)||L.set(P,new Set);var A=L.get(P);if(Ke&&console.warn(e,b,"map:",y,"condition1:",e>=b,"map:",L),e>=b&&e<=b+k&&!A.has(O)){A.add(O);try{C(y,n,S,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof _)try{var D,F={eventType:y,startTimeInSeconds:I,startTime:E,durationInSeconds:T,ad:null==n||null===(D=n.ads)||void 0===D?void 0:D[r],pod:n,adIndex:r};_({adsData:F}),Ie(o,F)}catch(e){console.error("Error when calling ads callback:",e)}var R=Se.get();if(R&&0!==Object.keys(R).length){var j=R.formulateComscoreAdPayload,V=R.startComscoreAdTracking,x=R.finishComscoreAdTracking,N=R.endComscoreAdTracking;if("impression"===y){var W,B=Le.get();V(j(Ye(Ye({},null==n||null===(W=n.ads)||void 0===W?void 0:W[r]),{},{trackingUrl:B})))}else"complete"===y?x():"breakEnd"===y&&N()}}}}catch(e){m.e(e)}finally{m.f()}}},C=function(e,n,t,o){var r,i,l;"breakEnd"===e&&(null===(r=ze)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=ze)||void 0===i?void 0:i.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(Ke&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))})))},h=function(){Xe&&clearInterval(Xe)},p=Le.get(),(g=i.getPlayer(o)).one("loadeddata",(function(){h(),Xe=setInterval((function(){p&&!g.paused()&&D(p)}),2e3)})),g.on("dispose",(function(){h()})),y=new Map,w=new Map,I=-1,E=null,T=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==g||null===(a=g.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==g||null===(u=g.el())||void 0===u||null===(v=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,O=(null==g||null===(m=g.el())||void 0===m||null===(f=m.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,P=!1,A=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(o);var r=[],i=null==o?void 0:o.find((function(e){return"breakEnd"===(null==e?void 0:e.eventType)})),l=(null==i||null===(e=i.beaconUrls)||void 0===e?void 0:e.find((function(e){return e.includes("videoView")})))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter((function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)})),u=(null==d?void 0:d.some((function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some((function(e){return e.includes("videoView")}))})))||!1;if(!u&&l){var s=null==d?void 0:d.map((function(e){return Ye(Ye({},e),{},{eventType:"videoView",beaconUrls:[l]})}));null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},D=function(){var e=n(t.mark((function e(n){var r,l,a,d,u,v,m,f,p,g,h,D,L,k;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),E&&l.searchParams.append("nextToken",E),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:d=e.sent,u=d.avails,v=d.nextToken||null,E=v,m=[],f=i.getPlayer(o),p=f.controlBar.progressControl,g=p.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),u.map((function(e,n){m.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})})),Ke&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),null!=m&&m.length&&(window.adsQueueList=m,"function"==typeof(k=(null===(h=window)||void 0===h||null===(D=h.customData)||void 0===D||null===(L=D.ads)||void 0===L?void 0:L.onAdBreaksLoaded)||null)&&(null==m?void 0:m.length)>0&&k(m)),m.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=f.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",g.appendChild(i)}})),f._timeUpdateHandler&&f.off("timeupdate",f._timeUpdateHandler),f._timeUpdateHandler=s.throttle((function(){var e=f.currentTime();if(e!==I){I=e;for(var n=function(){var n=m[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,l=o+r;if(e>=o-1.2&&e<=l+1.2){var a;P=!!(e>=o&&e<=l&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>l&&y.set(o,!0),ce.disable(),T&&T.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),p.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,v=0;v<i.length;v++){var f,g=null==i||null===(f=i[v])||void 0===f?void 0:f.durationInSeconds;if(d<u+g){s=v;break}u+=g}setTimeout((function(){ze.totalAds=null==i?void 0:i.length,ze.currentAdIndex=s}),1e3);var h=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));h.push.apply(h,c(n))})),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&h.push.apply(h,c(null==n?void 0:n.podSlotImpressionBeacon)),F(e,n,h,s),"break"}w.delete(o)},t=0;t<m.length;t++){if("break"===n())break}P||(ze={},p.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),ce.enable())}}),1e3),f.on("timeupdate",f._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),L=new Map,k=2.5;case 22:case"end":return e.stop()}}),e)}))),$e.apply(this,arguments)}function Ze(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var en=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},nn=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},tn=function(e){return!!o.getPlayer("".concat(e))},on=function(){var e=n(t.mark((function e(o,r){var l,d,u,s=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=s.length>2&&void 0!==s[2]&&s[2],e.next=3,F();case 3:return d=e.sent,u=i.getPlayer(o),e.abrupt("return",new Promise((function(e,i){var s=(null==r?void 0:r.programs)||[];null==r||delete r.programs,b(r,d).then(function(){var i=n(t.mark((function n(i){var d,c,v,m,f,p,g,h;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(d=null==i?void 0:i.data,window.sid=N(),d.contentType="linearchannel",d.channelId=null==r?void 0:r.channelId,a.setCurrentVideo(d),a.setCurrentEpgPrograms(s),!l){n.next=16;break}if(g=(null==d||null===(c=d.linearchannel)||void 0===c?void 0:c.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(f=m.appcmsMain)||void 0===f||null===(p=f.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,h=ne(d,o),!g){n.next=13;break}return n.next=12,Ce(o,d);case 12:h=n.sent;case 13:h&&(an(o,h),g&&Je(o),u.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:d})}))),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:d});case 17:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){i({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),rn=function(){var e=n(t.mark((function e(o,r,l){var u,s,c,v,m,f,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return v=e.sent,(a.getCurrentSeries()||null)&&a.setVideoIdxById(r),m=0,f=0,p=null,null!==(u=window)&&void 0!==u&&u.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(c=s.watchHistory)&&void 0!==c&&c.enable&&_(r,v).then((function(e){var n,t,o,r,i,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),m=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(f=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(p=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})),e.abrupt("return",new Promise((function(e,l){T(r,v).then(function(){var r=n(t.mark((function n(r){var u,s,c,v,g,h,y,w,I,E,T,b,S,_,O,P,A,D,L,k,C,F,R,j,V,x,N,W,B,M,U,H,G,q,Q,Y,z,K;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(P=null==r?void 0:r.data,A=(null==P?void 0:P.contentType)||"video",D=(null==P||null===(u=P[A])||void 0===u?void 0:u.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v||null===(g=v.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,L=(null==P||null===(h=P.video)||void 0===h||null===(y=h.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,a.setCurrentVideo(r.data),(k=(null==P||null===(w=P.ads)||void 0===w||null===(I=w.preRoll)||void 0===I||null===(E=I.adTags)||void 0===E||null===(T=E.web)||void 0===T?void 0:T.active)&&(null==P||null===(b=P.ads)||void 0===b||null===(S=b.preRoll)||void 0===S||null===(_=S.adTags)||void 0===_||null===(O=_.web)||void 0===O?void 0:O.url))&&ue(o,k,P),C=ne(P,o),!D){n.next=12;break}return n.next=11,Ce(o,P);case 11:C=n.sent;case 12:C?(H=(null==P||null===(F=P.video)||void 0===F||null===(R=F.gist)||void 0===R?void 0:R.videoImageUrl)||(null==P||null===(j=P.video)||void 0===j||null===(V=j.gist)||void 0===V||null===(x=V.imageGist)||void 0===x?void 0:x.r16x9),(G=i.getPlayer(o)).poster(H),an(o,C),D&&Ue(o,p),G.on("loadstart",(function(){L&&e({status:!0,msg:"Video Loaded",response:P})})),G.on("loadeddata",(function(){ae(),e({status:!0,msg:"Video Loaded",response:P})})),G.one("play",(function(){m&&!D&&f<95&&setTimeout((function(){G.currentTime(m)}),0)})),G.one("error",(function(){var e;l({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==P||null===(N=P.video)||void 0===N||null===(W=N.contentDetails)||void 0===W||null===(B=W.closedCaptions)||void 0===B?void 0:B.length)>0||(null==P||null===(M=P.video)||void 0===M||null===(U=M.closedCaptions)||void 0===U?void 0:U.length)>0?(K=(null==P||null===(Q=P.video)||void 0===Q||null===(Y=Q.contentDetails)||void 0===Y?void 0:Y.closedCaptions)||(null==P||null===(z=P.video)||void 0===z?void 0:z.closedCaptions),q=K.filter((function(e){return"VTT"===e.format})),d.addCaptions(o,q)):d.removeCaptions(o)):(le(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}}),n)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){dn(e,o,l,r)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),ln=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},an=function(e,n){var t=i.getPlayer(e);t&&t.src(n)},dn=function(n,t,o,r){var i,l,a,d,u,s,c=null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);tn(t)&&le(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ze(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))};exports.adsQueuePointManager=Be,exports.authenticateLC=on,exports.baseUrlManager=P,exports.clearError=ae,exports.comscoreInstanceManager=Se,exports.createSeriesWatchMap=function(e,n){var t=new Map;O({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),a.setSeriesWatchMap(t)})).catch((function(e){return console.log(e)}))},exports.detectBrowser=G,exports.disableControls=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},exports.dispose=function(e){var n=(Se.get()||{}).destroyComscoreTag,t=i.getPlayer(e);if(ln(),"function"==typeof n&&n(),s.clearEventListeners(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},exports.getDecodedToken=R,exports.getEntitlementData=function(e,n,t,o){var i,l;return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},exports.getEpisodeNumber=Y,exports.getLinearChannelDetails=b,exports.getSGAIEnabledSource=Ce,exports.getSeasonNumber=Q,exports.getSeriesDetails=function(e,n){var t,o,i=R(n),l=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):r({url:P.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},exports.getSeriesWatchHistory=O,exports.getSource=ne,exports.getSsaiEvents=function(e){var n=i.getPlayer(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(ve,e)},adImpression:function(e){return t(me,e)},adFirstQuartile:function(e){return t(fe,e)},adMidpoint:function(e){return t(pe,e)},adThirdQuartile:function(e){return t(ge,e)},adComplete:function(e){return t(he,e)},adBreakEnd:function(e){return t(ye,e)}}},exports.getToken=F,exports.getUpdatedClusterSource=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},exports.getUserId=W,exports.getVideoDetails=T,exports.getVideoInfo=_,exports.handleError=le,exports.initialiseAdvertisement=ue,exports.initialiseComscoreStreamingTracking=function(e,n){var t,o,r,l,d,u,s,c,v,f,p,g,h,y,w,I,E=null==e?void 0:e.playerId,T=i.getPlayer(E);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var b=a.getCurrentVideo(),S=(null==b||null===(o=b.video)||void 0===o?void 0:o.metadata)||[],_=(null==S?void 0:S.length)&&S.filter((function(e){return"advertisingGenre"===e.name}));if(null!==(r=_)&&void 0!==r&&r.length){var O=_.map((function(e){return e.value}));_=null==O?void 0:O.join(",")}m.destroyComscoreTag();var P,A,D,L=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,k=Array.isArray(null==L?void 0:L.category)?null==L||null===(d=L.category)||void 0===d?void 0:d.join(","):(null==L?void 0:L.category)||null,C=Te(Te(Te({},null==b?void 0:b.video),null==b?void 0:b.linearchannel),{},{programId:(null==L?void 0:L.videotmsid)||null,programTitle:(null==L?void 0:L.lcProgrammeName)||null,episodeId:(null==L?void 0:L.videotmsid)||null,seasonNumber:(null==b||null===(u=b.video)||void 0===u||null===(s=u.series)||void 0===s?void 0:s.seasonNumber)||(null==L||null===(c=L.seriesDetails)||void 0===c?void 0:c.season)||null,episodeNumber:(null==b||null===(v=b.video)||void 0===v||null===(f=v.series)||void 0===f?void 0:f.episodeNumber)||(null==L||null===(p=L.seriesDetails)||void 0===p?void 0:p.episode)||null,episodeTitle:(null==L?void 0:L.lcSubTitle)||null,isCompleteEpisode:!!(null!=b&&null!==(g=b.video)&&void 0!==g&&g.series||null!=L&&null!==(h=L.seriesDetails)&&void 0!==h&&h.episode),genre:_||k,comscoreConfig:{implementationId:(null==e||null===(y=e.comscore)||void 0===y?void 0:y.implementationId)||null,projectId:(null==e||null===(w=e.comscore)||void 0===w?void 0:w.projectId)||null}});if(null!=C&&null!==(I=C.streamingInfo)&&void 0!==I&&I.isLiveStream?C.contentType="LIVE":C.contentType="LONG_FORM_ON_DEMAND",null==C||!C.network){var F,R=(null==C?void 0:C.metadata)||[],j=null==R||null===(F=R.find((function(e){return"network"===e.name})))||void 0===F?void 0:F.value;C.network=j||null}C.siteName=null==C?void 0:C.network,null!=C&&C.network&&null!=C&&C.genre&&(C.customGenre="".concat(C.network,"_").concat((null==C?void 0:C.programTitle)||(P=C,null!=P&&P.series?null==P||null===(D=P.series)||void 0===D?void 0:D.title:null==P||null===(A=P.gist)||void 0===A?void 0:A.title),"_").concat(C.genre)),null!=L&&L.airDate&&(C.publishDate=L.airDate),null!=C&&C.runtime&&(C.runtime=1e3*((null==C?void 0:C.runtime)||0));var V=m.formulateComscorePayload(C,T);console.log("comscoreOptions player data",V),m.createComscoreStreamingTag(Te({playerName:"Video.js"},V)),m.setComscorePlayerInstance(T)}},exports.initialiseKeyboardEvents=function(e,n){var t,o,r,l=i.getPlayer(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",(function(t){var o,r,i,u,s,c,v,m,f;if(ce.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||nn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(u=i.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;g||en(e,10)}}}),!0)},exports.initiateErrorHandling=dn,exports.inititateBeacon=function(e,n,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var o=i.getPlayer(e);window.initialise(o,n),window.firstFrame(o,n,t),o.on("loadedmetadata",(function(){window.endFirstFrame(o)}))}},exports.isBehindLive=function(e){var n,t=i.getPlayer(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null},exports.isMobile=q,exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=tn,exports.isTokenExpired=A,exports.load=rn,exports.loadVideo=an,exports.loadVideoInstantly=function(e,n,t){var o=i.getPlayer(e);return o.src(n),new Promise((function(e,n){var r=0;o.one("loadedmetadata",(function(){clearTimeout(r),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){r=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=L,exports.rewind=nn,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],f("js",new Date),f("config",e)},exports.saveWatchHistory=S,exports.setupAdvertisementMarkers=Ue,exports.setupAdvertisementMarkersForLinear=Je,exports.skip=en,exports.token_authentication_enabled=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},exports.trackMap=Me;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t,n,o,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./player_instance-fcf6a8fb.js"),r=require("./currentVideoInfo-31d70bec.js"),a=require("./autoNextVideo-
|
|
1
|
+
"use strict";var e,t,n,o,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./player_instance-fcf6a8fb.js"),r=require("./currentVideoInfo-31d70bec.js"),a=require("./autoNextVideo-927cbfff.js"),d=require("./icons-2609dbe4.js"),s=require("./skin-f5e18b89.js"),u=require("@babel/runtime/helpers/typeof"),c=require("video.js"),v=[],m=!1,p=function(e,t){var n=l.getPlayer(e),o=Math.floor(n.currentTime());if(Math.floor(n.duration())!=o){n.pause(e);var i=r.getVideoIdx();a.switchToNext(i,e,v)}};e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===u(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},o=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},c.registerPlugin("thumbnails",(function(i){var l,r,a,d,s,u,c,v;function m(){document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",m),v()}r=t({},e,i),d=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=d.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),l.appendChild(a),a.src=r[0].src,a.className="vjs-thumbnail",t(a.style,r[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),u=d.duration(),d.on("durationchange",(function(e){u=d.duration()})),d.on("loadedmetadata",(function(e){u=d.duration()})),(s=d.controlBar.progressControl).el().appendChild(l),c=function(e){var i,d,c,v,m,p,f,g,h,y;for(d in c=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=o(s.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),v=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,v-=o(s.el()).getBoundingClientRect().left+h,i=Math.floor((v-s.el().offsetLeft)/s.width()*u),r)i>d&&(c=Math.max(c,d));(m=r[c]).src&&a.src!=m.src&&(a.src=m.src),m.style&&a.style!=m.style&&t(a.style,m.style),v+(g=function(e,t){var o;return t?parseFloat(t):"auto"!==(o=n(e)("clip"))&&"inherit"!==o&&4===(o=o.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(o[1])-parseFloat(o[3]):0}(a,m.width||r[0].width)/2)>f?v-=v+g-f:v<g&&(v=g),l.style.left=v+"px"},s.on("mousemove",c),s.on("touchmove",c),s.on("pointerdown",(function(e){document.addEventListener("pointermove",c),document.addEventListener("pointerup",m)})),v=function(e){l.style.left="-1000px"},s.on("mouseout",v),s.on("touchcancel",v),s.on("touchend",v),d.on("userinactive",v)})),exports.addNextEpPreview=function(e,t){var n;if(m=!1,null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var o;v=[];var a=r.getCurrentSeries();null==a||a.map((function(e){var t;return(t=v).push.apply(t,i(e.episodes))})),null==t||null===(o=t.series)||void 0===o||o.cb}else{var u,c;v=(null==t||null===(u=t.relatedVideos)||void 0===u?void 0:u.content)||[],null==t||null===(c=t.relatedVideos)||void 0===c||c.cb}var f=l.getPlayer(e);f.on("timeupdate",(function(){var e,t;if(!m){var n=Math.floor(f.currentTime()),o=f.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&r.getVideoIdx()<=(null===(t=v)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}}));var g,h=v.filter((function(e,t){return t==r.getVideoIdx()}));if((null==h?void 0:h.length)>0)if(null!==(g=document.getElementsByClassName("next-ep-preview"))&&void 0!==g&&g[0]){var y,x,A,w,E,C,b,N,B,L,P,I;(null===(y=document.getElementsByClassName("next-ep-preview"))||void 0===y?void 0:y[0]).style.visibility="hidden";var j=null===(x=document.getElementsByClassName("next-ep-title"))||void 0===x?void 0:x[0],k=null===(A=document.getElementsByClassName("next-ep-img"))||void 0===A?void 0:A[0],q=null===(w=document.getElementsByClassName("next-ep-content"))||void 0===w?void 0:w[0],T=null===(E=h[0])||void 0===E?void 0:E.title;(null===(C=T)||void 0===C?void 0:C.length)>60&&(T=T.substr(0,60)+"..."),j.textContent="".concat(T),k.src=(null===(b=h[0])||void 0===b||null===(N=b.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null==h||null===(L=h[0])||void 0===L?void 0:L.img)||(null===(P=window)||void 0===P||null===(I=P.customData)||void 0===I?void 0:I.fallbackImage),q.onclick=function(){return p(e)}}else{var V,O,S,M,X,F,R,D,G=document.createElement("div");G.className="next-ep-preview",G.style.visibility="hidden",document.getElementById(e).append(G);var H=document.createElement("div");H.className="next-heading-wrapper";var _=document.createElement("div");_.className="next-ep-header",_.textContent="Next up";var K=document.createElement("div");K.className="next-ep-close",K.onclick=function(){G.style.visibility="hidden",m=!0},K.appendChild(s.parseSvgString(d.crossIconSvg())),H.append(_),H.append(K);var Q=null===(V=h[0])||void 0===V?void 0:V.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(O=h[0])||void 0===O||null===(S=O.gist)||void 0===S||null===(M=S.imageGist)||void 0===M?void 0:M.r16x9)||(null==h||null===(X=h[0])||void 0===X?void 0:X.img)||(null===(F=window)||void 0===F||null===(R=F.customData)||void 0===R?void 0:R.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(D=Q)||void 0===D?void 0:D.length)>60&&(Q=Q.substr(0,60)+"..."),W.textContent="".concat(Q);var Y=document.createElement("div");Y.className="next-ep-content",Y.append(U),Y.append(W),Y.onclick=s.debounce((function(){null==G||G.remove(),m=!0,p(e)}),400),G.append(H),G.append(Y)}},exports.addTVProviderImage=function(e,t){var n=l.getPlayer(e),o=null==t?void 0:t.tvProviderLogoUrl;if(o){var i=document.createElement("div");i.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(o),r.alt="Provider Image",i.append(r),n.el().appendChild(i),n.on("useractive",(function(){i.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||i.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-247ee476.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),i=require("video.js"),r=require("./util-dfb4690b.js"),l=require("./captions-dbc83a75.js"),a=require("./resolution-f9dcc1b4.js"),u=require("./skin-f5e18b89.js"),s=require("./player_instance-fcf6a8fb.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),m=require("@babel/runtime/helpers/toConsumableArray"),g=require("@babel/runtime/helpers/slicedToArray"),y=function(e){return new Promise((function(n,t){if(h(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},h=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},b=function(e,n,t){var o=s.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},w=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},k=function(){var n=t(o.mark((function n(t){var r,l,a,u,d;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=s.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(i),(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}}),n,null,[[2,7]])})));return function(e){return n.apply(this,arguments)}}(),S=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var I=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),y("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var n=t(o.mark((function n(){return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then((function(n){e.comscoreInstanceManager.set(n)}));case 2:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),D=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=t(o.mark((function e(){var n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-ec94e5f4.js")}));case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),C=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:I,loadEMELibrary:D,loadMuxPlugin:P,loadDvrSeekbar:E,loadContribDash:T,loadComscorePlugin:O});function j(e){return x.apply(this,arguments)}function x(){return(x=t(o.mark((function n(t){var i,r,l;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null==t?void 0:t.airplay)||!1,n.next=3,I();case 3:i&&"Safari"==e.detectBrowser()?Promise.resolve().then((function(){return C})).then((function(e){e.importAirplay()})):(l=(null===(r=document)||void 0===r?void 0:r.getElementById(null==t?void 0:t.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function L(e){return R.apply(this,arguments)}function R(){return(R=t(o.mark((function e(n){var t,i,r,l,a,u;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=s.getPlayer(n.playerId),e.next=3,O();case 3:u.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,n){return N.apply(this,arguments)}function N(){return(N=t(o.mark((function n(t,i){var r,l,a,u,s,d,c,v,p,f,m,g,y,h;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return p=(null==i?void 0:i.contentType)||"video",f=null==i||null===(r=i[p])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[p])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,m=(null==i||null===(u=i[p])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,g=(null==t||null===(c=t.comscore)||void 0===c?void 0:c.enable)||!1,y=!(null==t||null===(v=t.analytics)||void 0===v||!v.muxKey),n.prev=7,n.next=10,Promise.allSettled([f?"Safari"==e.detectBrowser()?D():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?T():D():"Safari"!=e.detectBrowser()&&m?T():null,g?L(t):null,y?P():null,k(t)]);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(7),console.log("Error",n.t0);case 15:case"end":return n.stop()}}),n,null,[[7,12]])})))).apply(this,arguments)}function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function V(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?M(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):M(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var B=new Set,_=null,H=function(n,t,o,i){var r,l,a,u,s,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(r=n[f])||void 0===r?void 0:r.id)||"Null",p["c3.cm.contentType"]=Y(n),p[null==o||null===(l=o.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=W(n),p["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),p.DRMEnabled=(null===(s=n[f])||void 0===s?void 0:s.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[o.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=G(n),p["c3.cm.genreList"]=U(n),p["c3.cm.genre"]=q(n),p["c3.cm.channel"]=F(n,i);var m=X(c.getCurrentSeries(),n);return p=V(V({},p),m)},q=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},U=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},F=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find((function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)})))||void 0===o?void 0:o.title)||"NULL"},W=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},G=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},K=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Y=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var J,z,X=function(n,t){var o,i,r,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(r=n[s-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Q=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},$=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var e=t(o.mark((function e(n,t){var i,r,l,a,u,d,v,p,f,m,g,y;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==t?void 0:t.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,u=i.enable,d=i.appName,p=(v=t||{}).token,f=v.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(m=s.getPlayer(n),"function"==typeof(g=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(y=e.sent){e.next=13;break}return e.abrupt("return");case 13:m.ready((function(){var e=m.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Q(t.keySystem);g("contentInfo",{DRMEnabled:o})}else g("contentInfo",{DRMEnabled:"None"})})),n||g("contentInfo",{DRMEnabled:"None"})})),m.on("loadstart",(function(){var e,n;_&&_!==m.currentSrc()&&g("playbackEnded"),g("setPlayer",m),B.clear(),_=m.currentSrc();var o=$(m.currentType()),i=c.getCurrentVideo(),r=H(i,m,y,f);r[null==y||null===(e=y.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",r[null==y||null===(n=y.Constants)||void 0===n?void 0:n.ASSET_NAME]=K(i,t),r.authToken=p||"NULL",r.streamType=o,r.D2CType=l||"NONE",r.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",r["c3.cm.affiliate"]=a||"NULL",ee.setData(r),g("contentInfo",r)})),m.on("loadedmetadata",(function(){var e,n=m.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})})),m.on("play",(function(){B.has(m.currentSrc())||(B.add(m.currentSrc()),g("playbackStarted",null))})),m.on("ended",(function(){B.has(m.currentSrc())&&B.delete(m.currentSrc()),g("playbackEnded")})),m.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:m,adsLoader:null==e?void 0:e.adsLoader})})),m.on("dispose",(function(){null==B||B.clear(),g("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),ee=(J={},{setData:function(e){J=V(V({},J),e)},getData:function(){return J}}),ne=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-e6846b88.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-aad2cdf9.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-6a5ff9b3.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-0edcebc6.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-10f659ae.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-b20205e1.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t?Promise.resolve().then((function(){return require("./skin-a59d5fce.js")})).then((function(t){t.initialiseSkin(e,n)})):"news_live"==t?Promise.resolve().then((function(){return require("./skin-76b830fa.js")})).then((function(t){t.initialiseSkin(e,n)})):"mini"==t&&Promise.resolve().then((function(){return require("./skin-5c8601cd.js")})).then((function(t){t.initialiseSkin(e,n)}))};function te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function oe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?te(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):te(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var ie=[],re=0,le=null;function ae(){console.log("Cleaning up watch history data"),z=null,ie=[],re=0,le=null}function ue(n,t,o){var i,r,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,c=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var p=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==t||null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,m=Math.floor(n.currentTime()),g=s?100:Math.floor(c/v*100),y={};f?de(y={completed:s,watchedTime:m,watchedPercentage:g},d,t.siteOwner):(y=oe(oe({videoId:z,watchedTime:m,watchedPercentage:g,doneWatching:s,profileId:d},le&&{seriesId:le}),p&&{originalObjectId:p}),e.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),re=c+o}function se(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function de(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=se(i),l=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return oe(oe({},e),{},n({},t,u[t]))}),{}),d=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z}));d<0?r.push(oe(oe({content:s},e),{},{addedDate:l,updateDate:l})):r[d]=oe(oe(oe({},r[d]),e),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function ce(e,n,t){var o=se(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var ve=!1,pe=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ve){var l=fe(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ve=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function fe(e,n,t){if(Array.isArray(e))return e.map((function(e){return fe(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=fe(e[i],n,t)})),o}return e}function me(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ge(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ge(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function ge(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function ye(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function he(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ye(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var be=function(n,t,o,i){var r,a,u,d,p,f=i.res,m=i.sres,g=s.getPlayer(n),y=(null==f?void 0:f.contentType)||"video",h=(null==f||null===(r=f[y])||void 0===r?void 0:r.drmEnabled)||!1,w=(null==f||null===(a=f[y])||void 0===a||null===(u=a.streamingInfo)||void 0===u?void 0:u.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),g&&(g.on("loadstart",(function(){w?o.resolve({status:!0,msg:"Video Loaded",response:f}):o.resolve(he({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))})),g.on("loadeddata",(function(){var o,i,r,a=l.getCaptions(n);if(null==a||a.map((function(e){return l.disableCaptions(n,e.id)})),k&&"Safari"===e.detectBrowser())try{var u;null==g||null===(u=g.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==g||!g.muted())&&b(n,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,m=he(he({},t),f);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(le=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ie=[],re=0,z=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",ae),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());ie.includes(re)||(e!=re||e<l?e>re&&(re=e+l):(ie.push(e),ue(a,n,l)))}})),a.one("ended",(function(){ue(a,n,l,!0)})))}(n,m,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=g&&g.mux){var y,h,w,S,I,O,D=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),P=null==D?void 0:D.gist,E={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==P?void 0:P.id,video_title:null==P?void 0:P.title,video_series:null==D||null===(S=D.series)||void 0===S?void 0:S.title,video_stream_type:null!=D&&null!==(I=D.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==t||null===(O=t.analytics)||void 0===O?void 0:O.userId};g.mux({debug:!1,data:E})}})),g.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];g.trigger("subtitlechanged",n)})),g.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),g.tech_.on("retryplaylist",(function(){w&&pe(f,n)})),g.on("error",(function(){var t,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?pe(f,n):(e.handleError(n,(null==g||null===(t=g.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))})),g.one("play",(function(){var e,n,o,i,r;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){g.currentTime(p)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){g.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0);if(null!=g&&g.dvrSeekbar)try{g.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),g.on("volumechange",(function(){var e=100*g.volume().toFixed(2);g.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),g.on("chromecastDisconnected",(function(){if(w){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}})),g.one("loadeddata",(function(){var n,t=(null==g||null===(n=g.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(g.dash)){var o,i,r,l=null==g||null===(o=g.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),u=me(t);try{for(u.s();!(r=u.n()).done;){var s=r.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=me(t);try{for(c.s();!(d=c.n()).done;){var p,f,m,y=d.value;if(("Chrome"==e.detectBrowser()||"Edge"==e.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!h))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))g.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function we(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function ke(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function Se(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Ie(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,u=i.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?a?f.playFromBeginningHandler(t,n):l?f.playLiveOrResumeHandler(t,r):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,u=a.watchLive;a.resume;var s=a.startFromBegining,d=i;if(r&&null!=r&&r.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var m=f.getCurrentProgramThumbnail(n);m&&(p.style.backgroundImage="url(".concat(m,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=De(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),Oe("watch-live-resume-btn",u,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),Oe("watch-begining-btn",s,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(s,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(s,t),o=t,function(e,n){Se(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=we(o,i,Math.min(r/n*100,99.5));u.appendChild(s)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function Oe(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function De(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ee(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Pe(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var Te=function(r,a,d,c){var v,p,f,m,g,y,h,b,w,k,I,O,D,P,E,T,C,j,x,L,R,N,M,V,B,_,H,q,U,F,W,G,K,Y,J,z,X,Q=a.res,$=void 0===Q?null:Q,te=a.sres,oe=void 0===te?null:te,ie=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],re=(null===(v=$)||void 0===v?void 0:v.contentType)||"video",le=u.impolicy16x9(null===(p=$)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=$)||void 0===g||null===(y=g[re])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=$)||void 0===w||null===(k=w[re])||void 0===k||null===(I=k.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ue=(null===(O=$)||void 0===O||null===(D=O[re])||void 0===D||null===(P=D.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,se=(null===(E=$)||void 0===E||null===(T=E.ads)||void 0===T||null===(C=T.preRoll)||void 0===C||null===(j=C.adTags)||void 0===j||null===(x=j.web)||void 0===x?void 0:x.active)&&(null===(L=$)||void 0===L||null===(R=L.ads)||void 0===R||null===(N=R.preRoll)||void 0===N||null===(M=N.adTags)||void 0===M||null===(V=M.web)||void 0===V?void 0:V.url);$=Ee(Ee({},$),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(B=d.customData)||void 0===B?void 0:B.ads)||{},ce=(null===(_=$)||void 0===_||null===(H=_[re])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==de?void 0:de.vodAdSticherProvider)||!1,ve=(null==d?void 0:d.latency)||6,pe=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var fe=(z={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==pe?void 0:pe.pictureInPictureToggle)||!1},playbackRates:null!=pe&&pe.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:ae},n(z,"autoplay",null==d?void 0:d.autoplay),n(z,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!se),n(z,"loop",(null==d?void 0:d.loop)||!1),n(z,"audioPosterMode",null==d?void 0:d.audioPosterMode),n(z,"html5",Ee(Ee({dash:Ee(Ee(Ee({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(q=d.debugConfig)||void 0===q?void 0:q.enable)&&{debug:!0,logLevel:null!=d&&null!==(U=d.debugConfig)&&void 0!==U&&U.logLevel?null==d||null===(F=d.debugConfig)||void 0===F?void 0:F.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ve},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:Ee(Ee({},(null==d?void 0:d.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==d?void 0:d.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0},additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}})}}}),vhs:Ee(Ee(Ee({},(null==d?void 0:d.initialBandwidth)&&{bandwidth:d.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==d||!d.initialBandwidth},(null==d||null===(W=d.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(G=null==d?void 0:d.enableLowInitialPlaylist)&&void 0!==G&&G}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(K=d.debugConfig)||void 0===K?void 0:K.enable)||!1,nativeTextTracks:"Safari"==e.detectBrowser()},0==(null==d||null===(Y=d.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(J=d.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(z,"poster",le),n(z,"techOrder",ie),n(z,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(r),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),l=function(e,n,t){var o,i,r,l,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,S;f.isDrmEnabled=!0;var I=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var D=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=D}var P=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=P;var E=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=E;var T=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=T;var C=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=C,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}($,e,i);return Ee(Ee({},l),{},{convivaMetaData:Ee({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},ee.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,l,a=s.getPlayer(r),u=(null==a?void 0:a.currentSource())||{};!(null===(n=$)||void 0===n||null===(t=n[re])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),z);if(!i.getPlayers()[r]){null!=d&&d.debugConfig&&null!=d&&null!==(X=d.debugConfig)&&void 0!==X&&X.enable&&i.log.level("debug");var me=i(r,fe,function(){var n=t(o.mark((function n(){var t,a,u,s,v,p,f,m,g,y,h,b,w,k,I,O,D,P,E,T,C;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,A(d,$);case 5:if(w=null===(t=$)||void 0===t||null===(a=t[re])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(Ee({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:$}:{response:$})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Ie(r,Ee(Ee({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(r,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),Z(r,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),ae&&S(r,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,se,$),k=e.getSource($,r),console.log(k),null!=d&&d.nearestClusterUrl&&(k=e.getUpdatedClusterSource(k,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(r,$);case 20:k=n.sent;case 21:k?e.loadVideo(r,k):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:$}),e.handleError(r,"Incompatible / Missing Source")),((null===(p=$)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=$)||void 0===y||null===(h=y[re])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(C=(null===(O=$)||void 0===O||null===(D=O[re])||void 0===D||null===(P=D.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(E=$)||void 0===E||null===(T=E[re])||void 0===T?void 0:T.closedCaptions),I=C.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),l.addCaptions(r,I)),null!=d&&d.disableControls?e.disableControls(r):ne(r,Ee(Ee(Ee({},d),fe),{},{liveVideo:ue,isDvrEnabled:ae,res:$,sres:oe})),be(r,Ee(Ee(Ee({},d),fe),{},{liveVideo:ue}),c,{res:$,sres:oe});case 25:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())}};function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function je(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ce(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var xe=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=Le(e);Te(i,{res:r},e,{resolve:t,reject:o})},Le=function(n){var t,o,i,r,l,a,u,s,d,c,v,p,f,g=null==n?void 0:n.streamingInfo,y=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,h=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,b=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.url)||null,w=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,I=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],O=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,D=null==n?void 0:n.token,P=e.getDecodedToken(D);null==P||P.site;var E=null==P?void 0:P.siteId,T=(null==n||null===(p=n.customData)||void 0===p||null===(f=p.comscore)||void 0===f?void 0:f.video)||null,C=je(je({id:"".concat(E,"_external")},!h&&{directPlaybackUrl:null==y?void 0:y.url}),{},{video:je(je(je(je(je({drmEnabled:h,streamingInfo:je(je({videoAssets:je(je({},S&&{drmProvider:S}),{},{widevine:null==y?void 0:y.widevine,fairPlay:null==y?void 0:y.fairPlay,playReady:null==y?void 0:y.playReady})},(null==g?void 0:g.isDvrEnabled)&&{isLiveStream:!0}),(null==T?void 0:T.isLiveStream)&&{isLiveStream:null==T?void 0:T.isLiveStream})},O&&{isSSAIEnabled:O}),{},{metadata:I,liveDetails:{isDvrEnabled:null==g?void 0:g.isDvrEnabled},gist:je(je(je({},w&&{videoImageUrl:w}),(null==T?void 0:T.videoId)&&{id:null==T?void 0:T.videoId}),(null==T?void 0:T.videoTitle)&&{title:null==T?void 0:T.videoTitle}),contentDetails:je({},(null==k?void 0:k.length)>0&&{closedCaptions:m(k)})},(null==T?void 0:T.runtime)&&{runtime:null==T?void 0:T.runtime}),(null==T?void 0:T.publishDate)&&{publishDate:null==T?void 0:T.publishDate}),(null==T?void 0:T.platform)&&{platform:null==T?void 0:T.platform}),(null==T?void 0:T.series)&&{series:null==T?void 0:T.series}),ads:{preRoll:{adTags:{web:je(je({},b&&{active:!0}),b&&{url:b})}}}});return T&&(null!=T&&T.isDvrEnabled&&(C.video.liveDetails=je(je({},C.video.liveDetails),{},{isDvrEnabled:null==T?void 0:T.isDvrEnabled})),null!=T&&T.metadata&&(C.video.metadata=[].concat(m(C.video.metadata),m(null==T?void 0:T.metadata)))),C},Re=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),i=o>0&&t>4?o:0,r=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[r>0&&i>0?r:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Ae=function(e){var n,t=g(e,8),o=t[0],i=t[1],r=t[2],l=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):i>=1?" ".concat(i," month"):r>=1?" ".concat(r," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n),console.log("Time left:",n)};function Ne(e,n,t,o){if(e){var i=function(){var i=e-Date.now();if(i/1e3<=0)return clearInterval(r),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var l=Re(i,e);null==n||n([].concat(m(l),[o]))};i();var r=setInterval(i,1e3);return r}}var Me,Ve=function(e,n,t){var o,i,r,l,a,u,s,c,v,p=null==n||null===(o=n.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.errorCode,f=(null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null,m=Date.now(),g=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,y=m-(null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate);if(m-g<0?v=d.getLocalisation("eventNotStarted")||f||"Game starts in":(y>0||"VIDEO_NOT_EXISTS"==p)&&(v=d.getLocalisation("eventEnded")||f||"Game has ended"),document.getElementsByClassName("error-container")[0]){var h=document.getElementsByClassName("error-message")[0];h&&(h.textContent="".concat(v));var b=document.getElementsByClassName("error-timer-message")[0];b&&Ne(Math.abs(g),Ae,t,b)}else{var w=document.getElementById(e).parentElement;if(w){var k=document.createElement("div");k.className="error-container";var S=document.createElement("div");S.className="error-message";var I=document.createElement("div");I.className="error-timer-message",S.textContent="".concat(v),k.appendChild(S),k.appendChild(I),w.append(k),Ne(Math.abs(g),Ae,t,I)}}};function Be(e,n){return _e.apply(this,arguments)}function _e(){return(_e=t(o.mark((function n(t,i){var r,l,a,u,s,d,v,p,f;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:p=n.sent,f=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,p,f).then((function(n){var o,i,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(null==n?void 0:n.data);var f,m=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.enable&&!v)if((null===(f=t.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var g,y,h,b=ce((null===(g=t.watchHistory)||void 0===g?void 0:g.profileId)||"",s,null==t?void 0:t.siteOwner);if(b&&b.length)t.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;m.contentType="video",Te(d,{res:m},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then((function(e){var n,o,i,r,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,m.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Te(d,{res:m},t,{resolve:a,reject:u})}));else Te(d,{res:m},t,{resolve:a,reject:u})})).catch((function(n){var o,i,r=(null==t||null===(o=t.event)||void 0===o?void 0:o.showScheduleTimer)||!1,l=(null==t||null===(i=t.event)||void 0===i?void 0:i.onCountdownComplete)||null;r&&Ve(d,n,l),e.initiateErrorHandling(n,d,u,s)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function He(e,n){return qe.apply(this,arguments)}function qe(){return(qe=t(o.mark((function n(t,i){var r,l,a,u,s,d,c,v;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Te(d,{res:n},t,{resolve:a,reject:u})})).catch((function(n){e.initiateErrorHandling(n,d,u,videoId)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function Ue(e,n){return Fe.apply(this,arguments)}function Fe(){return(Fe=t(o.mark((function n(t,i){var r,l,a,u,s,d,v;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==t||null===(r=t.series)||void 0===r?void 0:r.id,e.getSeriesDetails(v,u).then((function(n){var o,i,r,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(o=p[0])||void 0===o||null===(i=o.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(f,u).then((function(e){var n,o,i;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Te(s,{res:null==e?void 0:e.data,sres:d},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,s,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,s,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function We(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ge(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?We(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:r.onTimeUpdate,getVideoDuration:r.getVideoDuration,onVideoEnded:r.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(o.mark((function t(i,r){var l,a,s,c,v,p,f,m,g,h,b,w,k,S,I,O,D,P,E,T,C,x,L,R,A;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(k=(null==n?void 0:n.videoSourceUrl)||!1,S=null==n?void 0:n.asat,I=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,D=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,P=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,E=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",E),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),E&&!e.isTokenExpired(E)){t.next=16;break}return r({status:!1,msg:"".concat(E?"Token is expired !":"Missing Authorization Token"),response:{token:E}}),t.abrupt("return");case 16:Me=JSON.parse(atob(E.split(".")[1]));case 17:return window.siteName=null===(s=Me)||void 0===s?void 0:s.site,window.siteId=null===(c=Me)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Me)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Me)||void 0===p?void 0:p.site)||null,n.userId=(null===(f=Me)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=Me)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,T=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,C=(null==n||null===(h=n.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==n?void 0:n.errors)&&(window.customErrors=x),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=35,j(n);case 35:C&&y("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then((function(){return e.runGtag(C)})).catch((function(e){})),(L=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(T)))&&L.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(A={directPlaybackUrl:k,id:R="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?e.getVideoDetails(R,E).then((function(e){var t=(null==e?void 0:e.data)||{};Te(T,{res:Ge(Ge({},t),A)},n,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,T,r,R)})):Te(T,{res:A},n,{resolve:i,reject:r})):P?xe(n,{resolve:i,reject:r}):D?Ue(n,{resolve:i,reject:r}):I?He(n,{resolve:i,reject:r}):Be(n,{resolve:i,reject:r});case 39:case"end":return t.stop()}}),t)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:r.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:e.getSource,setVolume:b,getVolume:w,disableControls:e.disableControls,setPlaybackSpeed:r.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:r.playerEvents,onReplay:r.onReplay,isBehindLive:e.isBehindLive}},exports.initiateMarker=function(e){var n=s.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),r=t.end(t.length-1)-i;ke(),Se(r).forEach((function(e){var n=e.id,t=e.title,i=e.time,l=we(n,t,Math.min(i/r*100,99.5));o.appendChild(l)}))}},exports.removeMarkers=ke;
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-bc6a9ff6.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),i=require("video.js"),r=require("./util-cf290925.js"),l=require("./captions-dbc83a75.js"),a=require("./resolution-f9dcc1b4.js"),u=require("./skin-f5e18b89.js"),s=require("./player_instance-fcf6a8fb.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),m=require("@babel/runtime/helpers/toConsumableArray"),g=require("@babel/runtime/helpers/slicedToArray"),y=function(e){return new Promise((function(n,t){if(h(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},h=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},b=function(e,n,t){var o=s.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},w=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},k=function(){var n=t(o.mark((function n(t){var r,l,a,u,d;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=s.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(i),(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}}),n,null,[[2,7]])})));return function(e){return n.apply(this,arguments)}}(),S=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var I=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),y("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var n=t(o.mark((function n(){return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then((function(n){e.comscoreInstanceManager.set(n)}));case 2:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),D=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=t(o.mark((function e(){var n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=t(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-ec94e5f4.js")}));case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),C=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:I,loadEMELibrary:D,loadMuxPlugin:P,loadDvrSeekbar:E,loadContribDash:T,loadComscorePlugin:O});function j(e){return x.apply(this,arguments)}function x(){return(x=t(o.mark((function n(t){var i,r,l;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null==t?void 0:t.airplay)||!1,n.next=3,I();case 3:i&&"Safari"==e.detectBrowser()?Promise.resolve().then((function(){return C})).then((function(e){e.importAirplay()})):(l=(null===(r=document)||void 0===r?void 0:r.getElementById(null==t?void 0:t.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function L(e){return R.apply(this,arguments)}function R(){return(R=t(o.mark((function e(n){var t,i,r,l,a,u;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=s.getPlayer(n.playerId),e.next=3,O();case 3:u.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,n){return N.apply(this,arguments)}function N(){return(N=t(o.mark((function n(t,i){var r,l,a,u,s,d,c,v,p,f,m,g,y,h;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return p=(null==i?void 0:i.contentType)||"video",f=null==i||null===(r=i[p])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[p])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,m=(null==i||null===(u=i[p])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,g=(null==t||null===(c=t.comscore)||void 0===c?void 0:c.enable)||!1,y=!(null==t||null===(v=t.analytics)||void 0===v||!v.muxKey),n.prev=7,n.next=10,Promise.allSettled([f?"Safari"==e.detectBrowser()?D():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?T():D():"Safari"!=e.detectBrowser()&&m?T():null,g?L(t):null,y?P():null,k(t)]);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(7),console.log("Error",n.t0);case 15:case"end":return n.stop()}}),n,null,[[7,12]])})))).apply(this,arguments)}function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function V(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?M(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):M(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var B=new Set,_=null,H=function(n,t,o,i){var r,l,a,u,s,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(r=n[f])||void 0===r?void 0:r.id)||"Null",p["c3.cm.contentType"]=Y(n),p[null==o||null===(l=o.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=W(n),p["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),p.DRMEnabled=(null===(s=n[f])||void 0===s?void 0:s.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[o.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=G(n),p["c3.cm.genreList"]=U(n),p["c3.cm.genre"]=q(n),p["c3.cm.channel"]=F(n,i);var m=X(c.getCurrentSeries(),n);return p=V(V({},p),m)},q=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},U=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},F=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find((function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)})))||void 0===o?void 0:o.title)||"NULL"},W=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},G=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},K=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Y=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var J,z,X=function(n,t){var o,i,r,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(r=n[s-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Q=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},$=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var e=t(o.mark((function e(n,t){var i,r,l,a,u,d,v,p,f,m,g,y;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==t?void 0:t.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,u=i.enable,d=i.appName,p=(v=t||{}).token,f=v.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(m=s.getPlayer(n),"function"==typeof(g=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(y=e.sent){e.next=13;break}return e.abrupt("return");case 13:m.ready((function(){var e=m.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Q(t.keySystem);g("contentInfo",{DRMEnabled:o})}else g("contentInfo",{DRMEnabled:"None"})})),n||g("contentInfo",{DRMEnabled:"None"})})),m.on("loadstart",(function(){var e,n;_&&_!==m.currentSrc()&&g("playbackEnded"),g("setPlayer",m),B.clear(),_=m.currentSrc();var o=$(m.currentType()),i=c.getCurrentVideo(),r=H(i,m,y,f);r[null==y||null===(e=y.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",r[null==y||null===(n=y.Constants)||void 0===n?void 0:n.ASSET_NAME]=K(i,t),r.authToken=p||"NULL",r.streamType=o,r.D2CType=l||"NONE",r.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",r["c3.cm.affiliate"]=a||"NULL",ee.setData(r),g("contentInfo",r)})),m.on("loadedmetadata",(function(){var e,n=m.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})})),m.on("play",(function(){B.has(m.currentSrc())||(B.add(m.currentSrc()),g("playbackStarted",null))})),m.on("ended",(function(){B.has(m.currentSrc())&&B.delete(m.currentSrc()),g("playbackEnded")})),m.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:m,adsLoader:null==e?void 0:e.adsLoader})})),m.on("dispose",(function(){null==B||B.clear(),g("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),ee=(J={},{setData:function(e){J=V(V({},J),e)},getData:function(){return J}}),ne=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-4c83dd18.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-a3119cd9.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-5eda4f77.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-1700f3c5.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-6f44537f.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-96cd6ec1.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t?Promise.resolve().then((function(){return require("./skin-d1573cf2.js")})).then((function(t){t.initialiseSkin(e,n)})):"news_live"==t?Promise.resolve().then((function(){return require("./skin-3b0bfe77.js")})).then((function(t){t.initialiseSkin(e,n)})):"mini"==t&&Promise.resolve().then((function(){return require("./skin-acb02671.js")})).then((function(t){t.initialiseSkin(e,n)}))};function te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function oe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?te(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):te(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var ie=[],re=0,le=null;function ae(){console.log("Cleaning up watch history data"),z=null,ie=[],re=0,le=null}function ue(n,t,o){var i,r,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,c=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var p=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==t||null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,m=Math.floor(n.currentTime()),g=s?100:Math.floor(c/v*100),y={};f?de(y={completed:s,watchedTime:m,watchedPercentage:g},d,t.siteOwner):(y=oe(oe({videoId:z,watchedTime:m,watchedPercentage:g,doneWatching:s,profileId:d},le&&{seriesId:le}),p&&{originalObjectId:p}),e.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),re=c+o}function se(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function de(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=se(i),l=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return oe(oe({},e),{},n({},t,u[t]))}),{}),d=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z}));d<0?r.push(oe(oe({content:s},e),{},{addedDate:l,updateDate:l})):r[d]=oe(oe(oe({},r[d]),e),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function ce(e,n,t){var o=se(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var ve=!1,pe=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ve){var l=fe(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ve=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function fe(e,n,t){if(Array.isArray(e))return e.map((function(e){return fe(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=fe(e[i],n,t)})),o}return e}function me(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ge(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ge(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function ge(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function ye(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function he(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ye(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var be=function(n,t,o,i){var r,a,u,d,p,f=i.res,m=i.sres,g=s.getPlayer(n),y=(null==f?void 0:f.contentType)||"video",h=(null==f||null===(r=f[y])||void 0===r?void 0:r.drmEnabled)||!1,w=(null==f||null===(a=f[y])||void 0===a||null===(u=a.streamingInfo)||void 0===u?void 0:u.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),g&&(g.on("loadstart",(function(){w?o.resolve({status:!0,msg:"Video Loaded",response:f}):o.resolve(he({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))})),g.on("loadeddata",(function(){var o,i,r,a=l.getCaptions(n);if(null==a||a.map((function(e){return l.disableCaptions(n,e.id)})),k&&"Safari"===e.detectBrowser())try{var u;null==g||null===(u=g.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==g||!g.muted())&&b(n,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,m=he(he({},t),f);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(le=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ie=[],re=0,z=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",ae),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());ie.includes(re)||(e!=re||e<l?e>re&&(re=e+l):(ie.push(e),ue(a,n,l)))}})),a.one("ended",(function(){ue(a,n,l,!0)})))}(n,m,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=g&&g.mux){var y,h,w,S,I,O,D=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),P=null==D?void 0:D.gist,E={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==P?void 0:P.id,video_title:null==P?void 0:P.title,video_series:null==D||null===(S=D.series)||void 0===S?void 0:S.title,video_stream_type:null!=D&&null!==(I=D.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==t||null===(O=t.analytics)||void 0===O?void 0:O.userId};g.mux({debug:!1,data:E})}})),g.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];g.trigger("subtitlechanged",n)})),g.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),g.tech_.on("retryplaylist",(function(){w&&pe(f,n)})),g.on("error",(function(){var t,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?pe(f,n):(e.handleError(n,(null==g||null===(t=g.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))})),g.one("play",(function(){var e,n,o,i,r;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){g.currentTime(p)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){g.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0);if(null!=g&&g.dvrSeekbar)try{g.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),g.on("volumechange",(function(){var e=100*g.volume().toFixed(2);g.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),g.on("chromecastDisconnected",(function(){if(w){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}})),g.one("loadeddata",(function(){var n,t=(null==g||null===(n=g.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(g.dash)){var o,i,r,l=null==g||null===(o=g.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),u=me(t);try{for(u.s();!(r=u.n()).done;){var s=r.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=me(t);try{for(c.s();!(d=c.n()).done;){var p,f,m,y=d.value;if(("Chrome"==e.detectBrowser()||"Edge"==e.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!h))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))g.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function we(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function ke(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function Se(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Ie(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,u=i.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?a?f.playFromBeginningHandler(t,n):l?f.playLiveOrResumeHandler(t,r):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,u=a.watchLive;a.resume;var s=a.startFromBegining,d=i;if(r&&null!=r&&r.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var m=f.getCurrentProgramThumbnail(n);m&&(p.style.backgroundImage="url(".concat(m,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=De(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),Oe("watch-live-resume-btn",u,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),Oe("watch-begining-btn",s,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(s,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(s,t),o=t,function(e,n){Se(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=we(o,i,Math.min(r/n*100,99.5));u.appendChild(s)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function Oe(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function De(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ee(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Pe(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var Te=function(r,a,d,c){var v,p,f,m,g,y,h,b,w,k,I,O,D,P,E,T,C,j,x,L,R,N,M,V,B,_,H,q,U,F,W,G,K,Y,J,z,X,Q=a.res,$=void 0===Q?null:Q,te=a.sres,oe=void 0===te?null:te,ie=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],re=(null===(v=$)||void 0===v?void 0:v.contentType)||"video",le=u.impolicy16x9(null===(p=$)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=$)||void 0===g||null===(y=g[re])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=$)||void 0===w||null===(k=w[re])||void 0===k||null===(I=k.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ue=(null===(O=$)||void 0===O||null===(D=O[re])||void 0===D||null===(P=D.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,se=(null===(E=$)||void 0===E||null===(T=E.ads)||void 0===T||null===(C=T.preRoll)||void 0===C||null===(j=C.adTags)||void 0===j||null===(x=j.web)||void 0===x?void 0:x.active)&&(null===(L=$)||void 0===L||null===(R=L.ads)||void 0===R||null===(N=R.preRoll)||void 0===N||null===(M=N.adTags)||void 0===M||null===(V=M.web)||void 0===V?void 0:V.url);$=Ee(Ee({},$),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(B=d.customData)||void 0===B?void 0:B.ads)||{},ce=(null===(_=$)||void 0===_||null===(H=_[re])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==de?void 0:de.vodAdSticherProvider)||!1,ve=(null==d?void 0:d.latency)||6,pe=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var fe=(z={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==pe?void 0:pe.pictureInPictureToggle)||!1},playbackRates:null!=pe&&pe.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:ae},n(z,"autoplay",null==d?void 0:d.autoplay),n(z,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!se),n(z,"loop",(null==d?void 0:d.loop)||!1),n(z,"audioPosterMode",null==d?void 0:d.audioPosterMode),n(z,"html5",Ee(Ee({dash:Ee(Ee(Ee({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(q=d.debugConfig)||void 0===q?void 0:q.enable)&&{debug:!0,logLevel:null!=d&&null!==(U=d.debugConfig)&&void 0!==U&&U.logLevel?null==d||null===(F=d.debugConfig)||void 0===F?void 0:F.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ve},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:Ee(Ee({},(null==d?void 0:d.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==d?void 0:d.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0},additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}})}}}),vhs:Ee(Ee(Ee({},(null==d?void 0:d.initialBandwidth)&&{bandwidth:d.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==d||!d.initialBandwidth},(null==d||null===(W=d.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(G=null==d?void 0:d.enableLowInitialPlaylist)&&void 0!==G&&G}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(K=d.debugConfig)||void 0===K?void 0:K.enable)||!1,nativeTextTracks:"Safari"==e.detectBrowser()},0==(null==d||null===(Y=d.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(J=d.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(z,"poster",le),n(z,"techOrder",ie),n(z,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(r),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),l=function(e,n,t){var o,i,r,l,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,S;f.isDrmEnabled=!0;var I=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var D=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=D}var P=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=P;var E=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=E;var T=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=T;var C=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=C,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}($,e,i);return Ee(Ee({},l),{},{convivaMetaData:Ee({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},ee.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,l,a=s.getPlayer(r),u=(null==a?void 0:a.currentSource())||{};!(null===(n=$)||void 0===n||null===(t=n[re])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),z);if(!i.getPlayers()[r]){null!=d&&d.debugConfig&&null!=d&&null!==(X=d.debugConfig)&&void 0!==X&&X.enable&&i.log.level("debug");var me=i(r,fe,function(){var n=t(o.mark((function n(){var t,a,u,s,v,p,f,m,g,y,h,b,w,k,I,O,D,P,E,T,C;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,A(d,$);case 5:if(w=null===(t=$)||void 0===t||null===(a=t[re])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(Ee({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:$}:{response:$})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Ie(r,Ee(Ee({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(r,null==d?void 0:d.analyticsCb,null==d?void 0:d.analyticsEventParams),Z(r,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),ae&&S(r,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,se,$),k=e.getSource($,r),console.log(k),null!=d&&d.nearestClusterUrl&&(k=e.getUpdatedClusterSource(k,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(r,$);case 20:k=n.sent;case 21:k?e.loadVideo(r,k):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:$}),e.handleError(r,"Incompatible / Missing Source")),((null===(p=$)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=$)||void 0===y||null===(h=y[re])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(C=(null===(O=$)||void 0===O||null===(D=O[re])||void 0===D||null===(P=D.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(E=$)||void 0===E||null===(T=E[re])||void 0===T?void 0:T.closedCaptions),I=C.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),l.addCaptions(r,I)),null!=d&&d.disableControls?e.disableControls(r):ne(r,Ee(Ee(Ee({},d),fe),{},{liveVideo:ue,isDvrEnabled:ae,res:$,sres:oe})),be(r,Ee(Ee(Ee({},d),fe),{},{liveVideo:ue}),c,{res:$,sres:oe});case 25:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())}};function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function je(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ce(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var xe=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=Le(e);Te(i,{res:r},e,{resolve:t,reject:o})},Le=function(n){var t,o,i,r,l,a,u,s,d,c,v,p,f,g=null==n?void 0:n.streamingInfo,y=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,h=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,b=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.url)||null,w=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,I=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],O=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,D=null==n?void 0:n.token,P=e.getDecodedToken(D);null==P||P.site;var E=null==P?void 0:P.siteId,T=(null==n||null===(p=n.customData)||void 0===p||null===(f=p.comscore)||void 0===f?void 0:f.video)||null,C=je(je({id:"".concat(E,"_external")},!h&&{directPlaybackUrl:null==y?void 0:y.url}),{},{video:je(je(je(je(je({drmEnabled:h,streamingInfo:je(je({videoAssets:je(je({},S&&{drmProvider:S}),{},{widevine:null==y?void 0:y.widevine,fairPlay:null==y?void 0:y.fairPlay,playReady:null==y?void 0:y.playReady})},(null==g?void 0:g.isDvrEnabled)&&{isLiveStream:!0}),(null==T?void 0:T.isLiveStream)&&{isLiveStream:null==T?void 0:T.isLiveStream})},O&&{isSSAIEnabled:O}),{},{metadata:I,liveDetails:{isDvrEnabled:null==g?void 0:g.isDvrEnabled},gist:je(je(je({},w&&{videoImageUrl:w}),(null==T?void 0:T.videoId)&&{id:null==T?void 0:T.videoId}),(null==T?void 0:T.videoTitle)&&{title:null==T?void 0:T.videoTitle}),contentDetails:je({},(null==k?void 0:k.length)>0&&{closedCaptions:m(k)})},(null==T?void 0:T.runtime)&&{runtime:null==T?void 0:T.runtime}),(null==T?void 0:T.publishDate)&&{publishDate:null==T?void 0:T.publishDate}),(null==T?void 0:T.platform)&&{platform:null==T?void 0:T.platform}),(null==T?void 0:T.series)&&{series:null==T?void 0:T.series}),ads:{preRoll:{adTags:{web:je(je({},b&&{active:!0}),b&&{url:b})}}}});return T&&(null!=T&&T.isDvrEnabled&&(C.video.liveDetails=je(je({},C.video.liveDetails),{},{isDvrEnabled:null==T?void 0:T.isDvrEnabled})),null!=T&&T.metadata&&(C.video.metadata=[].concat(m(C.video.metadata),m(null==T?void 0:T.metadata)))),C},Re=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),i=o>0&&t>4?o:0,r=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[r>0&&i>0?r:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Ae=function(e){var n,t=g(e,8),o=t[0],i=t[1],r=t[2],l=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):i>=1?" ".concat(i," month"):r>=1?" ".concat(r," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n),console.log("Time left:",n)};function Ne(e,n,t,o){if(e){var i=function(){var i=e-Date.now();if(i/1e3<=0)return clearInterval(r),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var l=Re(i,e);null==n||n([].concat(m(l),[o]))};i();var r=setInterval(i,1e3);return r}}var Me,Ve=function(e,n,t){var o,i,r,l,a,u,s,c,v,p=null==n||null===(o=n.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.errorCode,f=(null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null,m=Date.now(),g=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,y=m-(null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate);if(m-g<0?v=d.getLocalisation("eventNotStarted")||f||"Game starts in":(y>0||"VIDEO_NOT_EXISTS"==p)&&(v=d.getLocalisation("eventEnded")||f||"Game has ended"),document.getElementsByClassName("error-container")[0]){var h=document.getElementsByClassName("error-message")[0];h&&(h.textContent="".concat(v));var b=document.getElementsByClassName("error-timer-message")[0];b&&Ne(Math.abs(g),Ae,t,b)}else{var w=document.getElementById(e).parentElement;if(w){var k=document.createElement("div");k.className="error-container";var S=document.createElement("div");S.className="error-message";var I=document.createElement("div");I.className="error-timer-message",S.textContent="".concat(v),k.appendChild(S),k.appendChild(I),w.append(k),Ne(Math.abs(g),Ae,t,I)}}};function Be(e,n){return _e.apply(this,arguments)}function _e(){return(_e=t(o.mark((function n(t,i){var r,l,a,u,s,d,v,p,f;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:p=n.sent,f=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,p,f).then((function(n){var o,i,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(null==n?void 0:n.data);var f,m=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.enable&&!v)if((null===(f=t.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var g,y,h,b=ce((null===(g=t.watchHistory)||void 0===g?void 0:g.profileId)||"",s,null==t?void 0:t.siteOwner);if(b&&b.length)t.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;m.contentType="video",Te(d,{res:m},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then((function(e){var n,o,i,r,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,m.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Te(d,{res:m},t,{resolve:a,reject:u})}));else Te(d,{res:m},t,{resolve:a,reject:u})})).catch((function(n){var o,i,r=(null==t||null===(o=t.event)||void 0===o?void 0:o.showScheduleTimer)||!1,l=(null==t||null===(i=t.event)||void 0===i?void 0:i.onCountdownComplete)||null;r&&Ve(d,n,l),e.initiateErrorHandling(n,d,u,s)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function He(e,n){return qe.apply(this,arguments)}function qe(){return(qe=t(o.mark((function n(t,i){var r,l,a,u,s,d,c,v;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Te(d,{res:n},t,{resolve:a,reject:u})})).catch((function(n){e.initiateErrorHandling(n,d,u,videoId)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function Ue(e,n){return Fe.apply(this,arguments)}function Fe(){return(Fe=t(o.mark((function n(t,i){var r,l,a,u,s,d,v;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==t||null===(r=t.series)||void 0===r?void 0:r.id,e.getSeriesDetails(v,u).then((function(n){var o,i,r,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(o=p[0])||void 0===o||null===(i=o.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(f,u).then((function(e){var n,o,i;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Te(s,{res:null==e?void 0:e.data,sres:d},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,s,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,s,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function We(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ge(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?We(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:r.onTimeUpdate,getVideoDuration:r.getVideoDuration,onVideoEnded:r.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(o.mark((function t(i,r){var l,a,s,c,v,p,f,m,g,h,b,w,k,S,I,O,D,P,E,T,C,x,L,R,A;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(k=(null==n?void 0:n.videoSourceUrl)||!1,S=null==n?void 0:n.asat,I=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,D=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,P=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,E=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",E),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),E&&!e.isTokenExpired(E)){t.next=16;break}return r({status:!1,msg:"".concat(E?"Token is expired !":"Missing Authorization Token"),response:{token:E}}),t.abrupt("return");case 16:Me=JSON.parse(atob(E.split(".")[1]));case 17:return window.siteName=null===(s=Me)||void 0===s?void 0:s.site,window.siteId=null===(c=Me)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Me)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Me)||void 0===p?void 0:p.site)||null,n.userId=(null===(f=Me)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=Me)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,T=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,C=(null==n||null===(h=n.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==n?void 0:n.errors)&&(window.customErrors=x),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=35,j(n);case 35:C&&y("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then((function(){return e.runGtag(C)})).catch((function(e){})),(L=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(T)))&&L.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(A={directPlaybackUrl:k,id:R="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?e.getVideoDetails(R,E).then((function(e){var t=(null==e?void 0:e.data)||{};Te(T,{res:Ge(Ge({},t),A)},n,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,T,r,R)})):Te(T,{res:A},n,{resolve:i,reject:r})):P?xe(n,{resolve:i,reject:r}):D?Ue(n,{resolve:i,reject:r}):I?He(n,{resolve:i,reject:r}):Be(n,{resolve:i,reject:r});case 39:case"end":return t.stop()}}),t)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:r.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:e.getSource,setVolume:b,getVolume:w,disableControls:e.disableControls,setPlaybackSpeed:r.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:r.playerEvents,onReplay:r.onReplay,isBehindLive:e.isBehindLive}},exports.initiateMarker=function(e){var n=s.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),r=t.end(t.length-1)-i;ke(),Se(r).forEach((function(e){var n=e.id,t=e.title,i=e.time,l=we(n,t,Math.min(i/r*100,99.5));o.appendChild(l)}))}},exports.removeMarkers=ke;
|