@viewlift/player-backup 2.0.240-backup → 2.0.241-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-9cd98676.js → autoNextVideo-7f16164c.js} +1 -1
- package/cjs/bundle.css +607 -607
- package/cjs/{features-f26dbcd7.js → features-44b8a90b.js} +1 -1
- package/cjs/{generic-d6ae73a3.js → generic-cd7bfeec.js} +1 -1
- package/cjs/{index-d138bd43.js → index-306542d1.js} +1 -1
- package/cjs/{index-c865c5a1.js → index-cae0151c.js} +1 -1
- package/cjs/{index-4ff569c8.js → index-da9488ba.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-5a6cb302.js → multicamv2-b698f6ba.js} +1 -1
- package/cjs/{multicamv2-094ce99d.js → multicamv2-ce4415df.js} +1 -1
- package/cjs/{nextEpisodeButton-b119b802.js → nextEpisodeButton-04ddeaf0.js} +1 -1
- package/cjs/{playlist-72b4651e.js → playlist-e5ac9f9e.js} +1 -1
- package/cjs/{series-14b3bd4d.js → series-46f1eb1a.js} +1 -1
- package/cjs/{series-v2-81954dc2.js → series-v2-30b4c175.js} +1 -1
- package/cjs/{series-v2-9a86446b.js → series-v2-493096ca.js} +1 -1
- package/cjs/{skin-f8d3748a.js → skin-140e356d.js} +1 -1
- package/cjs/{skin-d8e9b4ea.js → skin-3157e8f7.js} +1 -1
- package/cjs/{skin-10f47edd.js → skin-77a80f2b.js} +1 -1
- package/cjs/{skin-52d826a5.js → skin-7e6afef9.js} +1 -1
- package/cjs/{skin-02b10bf9.js → skin-be71be04.js} +1 -1
- package/cjs/{skin-1f67ed5d.js → skin-c8d5b348.js} +1 -1
- package/cjs/{skin-90bd15b9.js → skin-d1d31338.js} +1 -1
- package/cjs/{skin-4bd776ca.js → skin-d2c5f153.js} +1 -1
- package/cjs/{skin-b104f055.js → skin-f0f852fd.js} +1 -1
- package/cjs/{util-2f7e946f.js → util-a0a1fe3d.js} +1 -1
- package/cjs/{videoSelector-f0e15efa.js → videoSelector-57bb8148.js} +1 -1
- package/cjs/{videoSelector-c2d2e165.js → videoSelector-97256b71.js} +1 -1
- package/esm/{autoNextVideo-713363c7.js → autoNextVideo-780b39c1.js} +1 -1
- package/esm/bundle.css +607 -607
- package/esm/{features-f5b262d4.js → features-03b82c68.js} +1 -1
- package/esm/{generic-b8f82318.js → generic-191f638a.js} +1 -1
- package/esm/{index-3ce340c7.js → index-51647446.js} +1 -1
- package/esm/{index-ccfffa68.js → index-c3d1f8c9.js} +1 -1
- package/esm/{index-78c34379.js → index-eeb8e410.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-5915dbc0.js → multicamv2-1ae4ccc1.js} +1 -1
- package/esm/{multicamv2-d52c6237.js → multicamv2-402ed25d.js} +1 -1
- package/esm/{nextEpisodeButton-b8339f57.js → nextEpisodeButton-596dfaaf.js} +1 -1
- package/esm/{playlist-890f6d87.js → playlist-3308feca.js} +1 -1
- package/esm/{series-bd9d023a.js → series-d3123564.js} +1 -1
- package/esm/{series-v2-b87b0b98.js → series-v2-e9beb242.js} +1 -1
- package/esm/{series-v2-b0058b32.js → series-v2-ebf85da7.js} +1 -1
- package/esm/{skin-72789ef0.js → skin-0f50a6fe.js} +1 -1
- package/esm/{skin-7402f5ff.js → skin-42546070.js} +1 -1
- package/esm/{skin-ef4237a6.js → skin-627c7279.js} +1 -1
- package/esm/{skin-f590186e.js → skin-a2636fa8.js} +1 -1
- package/esm/{skin-8f036626.js → skin-a99899c7.js} +1 -1
- package/esm/{skin-621da67a.js → skin-bb171a22.js} +1 -1
- package/esm/{skin-f944c79b.js → skin-c7763cef.js} +1 -1
- package/esm/{skin-d40c8cce.js → skin-c9216fbe.js} +1 -1
- package/esm/{skin-dfa8b1b1.js → skin-f3829590.js} +1 -1
- package/esm/{util-dea5eafa.js → util-bd381a06.js} +1 -1
- package/esm/{videoSelector-41f7a28b.js → videoSelector-0f129080.js} +1 -1
- package/esm/{videoSelector-4a5e430b.js → videoSelector-4a4ca12d.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as a,z as s}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as a,z as s}from"./generic-191f638a.js";import{g as c}from"./resolution-62be852a.js";import{p as d}from"./skin-65765793.js";import{g as u}from"./localisation-0bf399a1.js";import{g as p}from"./player_instance-34118a5b.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u("slowMoText")||"Slow Mo",r}return n(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)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=d(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=d(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-v2-6446fe47.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=p(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))})},b=function(e,t,n){import("./nextEpisodeButton-596dfaaf.js").then(function(r){var o=r.default,l=p(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)})},j=function(e,t,n){import("./series-d3123564.js").then(function(r){var o=r.seriesModule,l=p(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]&&r.handleSeasonChange(t[e],e,l,n)})},c=0;c<a.length;c++)s(c)})},k=function(e,t){import("./videoSelector-4a4ca12d.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},I=function(e,t){import("./caption-settings-3a5e2e2d.js").then(function(n){var r,o,l,a,s=n.default,c=p(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.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(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},S=function(e,t){import("./settings-icon-7d9e5221.js").then(function(n){var r,o,l,a,s=n.default,c=p(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.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(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},w=function(e,t){import("./playlist-3308feca.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},E=function(e,t){import("./series-v2-ebf85da7.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},O=function(e,t){import("./multicamv2-402ed25d.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},M=function(e,t){var n=p(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=p(e).el(),n=0,r=p(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e}),window._multiplayer_dbTapHandler=o},x=function(e,t){import("./videoSelector-0f129080.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},L=function(e,t){import("./series-v2-e9beb242.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},_=function(e,t){import("./multicamv2-1ae4ccc1.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},D=function(e,t){import("./index-2ab55f4b.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("MuteButton",r),o.addChild("MuteButton",h({playerId:e},t))})},N=function(e,t){import("./start-begin-btn-16534825.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("startFromBeginingButton",r);var l=o.getChild("controlBar").addChild("startFromBeginingButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_}));o.startFromBeginningButton=l})},T=function(e,t){import("./watch-live-btn-ddcfab89.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("watchLiveButton",r);var l=o.getChild("controlBar").addChild("watchLiveButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_})+1);o.watchLiveButton=l})};export{B as a,j as b,b as c,y as d,C as e,S as f,I as g,M as h,g as i,x as j,_ as k,w as l,L as m,P as n,k as o,E as p,O as q,N as r,T as s,D as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"js-cookie";import{a,e as d,g as u,h as s,s as c,i as v,d as f}from"./currentVideoInfo-0b234e55.js";import{a as m,r as p}from"./captions-78bd2908.js";import g from"@babel/runtime/helpers/typeof";import{t as h,c as w}from"./skin-65765793.js";import I from"@babel/runtime/helpers/toConsumableArray";import E from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as y,formulateComscorePayload as T,createComscoreStreamingTag as b,setComscorePlayerInstance as _}from"@viewlift/comscore/index.js";function S(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function O(e){window.dataLayer=window.dataLayer||[],S("js",new Date),S("config",e)}function A(e,n){S("event",e,n)}var D={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 L(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 P(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?L(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var k={name:"@viewlift/player",version:"2.1.19",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.2",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=k.version;var F,R=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":U.get()+"".concat(null==D?void 0:D.getVideoDetails)},C=function(e,n){var t,o,r,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})}):i({url:R(),params:P({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":k.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})},j=function(e,n){var t,o,r,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})}):i({url:U.get()+D.getLinearChannelDetails,params:P(P(P(P(P({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===(r=window)||void 0===r||null===(l=r.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}})},N=function(e,n){var t,o,r=K(n),l=(null==r?void 0:r.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})}):i({url:U.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},V=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,z();case 2:return o=e.sent,e.abrupt("return",i({url:U.get()+"".concat(null==D?void 0:D.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:P({},n),params:P({},(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)}}(),W=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:U.get()+"".concat(null==D?void 0:D.getVideoInfoV2,"/").concat(r,"/").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})},B=function(e){var n=e.videoId;return i({method:"GET",url:U.get()+"".concat(null==D?void 0:D.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},U=(F=null==D?void 0:D.apiBaseUrl,{set:function(e){e&&(F=e)},get:function(){return F}}),M=function(e,n,t,o){var r,l;return i({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},x=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},H=null;function G(){return{set:function(e){e&&(H=e)},get:function(){return H}}}var Q=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=G().get(),o=U.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);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)}}(),Y=null,z=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"))||!x(n)){e.next=6;break}return Y||(Y=Q().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&G().set(r),i||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){Y=null})),e.abrupt("return",Y);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),q=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},K=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function X(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 J(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?X(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):X(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $=function(){var e,n,t,o,i,r,l,d=a();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===(i=d.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==d||null===(l=d.video)||void 0===l?void 0:l.id)||(null==d?void 0:d.id)};function Z(){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 ee(){return ne.apply(this,arguments)}function ne(){return(ne=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:if(n=e.sent,o=K(n),!(i=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",i);case 9:return i=Z(),window.sessionStorage.setItem("uid",i),e.abrupt("return",i);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function te(){return oe.apply(this,arguments)}function oe(){return(oe=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,z();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)}function ie(e){return e?String(e):""}window.initialise=function(e){window.sid=Z(),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,i,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,A(r?"FAILED_TO_START":"DROPPED_STREAM",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,o,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),A("PLAY",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":$(),watchTime:Math.floor(e.currentTime())})}))},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 i,r,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++,A("BUFFERING",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.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,A("FIRST_FRAME",J({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$()},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,i,r,l;A("AD_REQUEST",J({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$(),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}),A("AD_IMPRESSION",J({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:$()},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.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(),i=0;i<o.length;i++){var r=o.start(i),l=o.end(i);if(re(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var re=function(e,n,t){return e>=n&&e<=t},le=function(){var e,n=a(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function ae(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,r,l,a,d,u,s,c,v,f,m,p,g,h,w,I,E,y,T,b,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return E=e.sent,y=K(E),T=null==y?void 0:y.site,b=null==y?void 0:y.siteId,e.t0=J,e.t1=J,e.t2=J({aid:T,cid:b,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,ee();case 12:return e.t4=e.sent,e.t5=$(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a: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?ie(n.adPosition):"",e.next=28,te();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(f=le())&&void 0!==f?f:null,e.t28=null!=T?T: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===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),_=[e.t33],i({url:(null===(h=window)||void 0===h||null===(w=h.customData)||void 0===w||null===(I=w.beacon)||void 0===I?void 0:I.url)||U.get()+D.getBeaconUrl,method:"post",headers:{Authorization:E},contentType:"application/x-www-form-urlencoded",dataType:"text",data:_}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},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 de=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"},ue=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},se=function(e,n){var t=new Map;B({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),s(t)}).catch(function(e){return console.log(e)})},ce=function(){var e=d.get();return e>=0?e+1:1},ve=function(){var e,n,t,o=u(),i=a(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=d.get(),s=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)===r});return s>=0?s+1:1};function fe(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 me(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):fe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ge=function(e){var n=he(e,"video.tags",[]),t=he(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},he=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},we=function(){var n,t,o,i,a,d,u,s,c,v,f,m,p,g,h,w,I,E,y,T,b,_,S,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return A;var P=(null==L?void 0:L.siteName)||(null==L?void 0:L.site)||"",k=(null==L?void 0:L.contentType)||"video",F=(null==L||null===(o=L[k])||void 0===o?void 0:o.metadata)||(null==L||null===(i=L[k])||void 0===i||null===(a=i.gist)||void 0===a?void 0:a.metadata),R=r(D);if(!A.includes("VIEWLIFT_"))return A;var C,j=window.getComputedStyle(document.getElementById(D),null),N=Math.trunc(j.getPropertyValue("height").slice(0,-2)),V=Math.trunc(j.getPropertyValue("width").slice(0,-2)),W="linearchannel"===k?null==L||null===(d=L.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==L?void 0:L.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:he(L,"video.gist.id",""),B="linearchannel"===k?null==L||null===(v=L.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(m=f.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===m?void 0:m.title:he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,M=null;"function"==typeof window.__gpp&&(null===(C=window)||void 0===C||C.__gpp("ping",function(e){U=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var x=me(me({},Ie(F)),{},(_={VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:N,VIEWLIFT_SIZE:pe(V,N),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:he(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(g=R.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(h=R.options_)||void 0===h?void 0:h.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ge(L),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+he(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:he(null===(w=window)||void 0===w||null===(I=w.app_data)||void 0===I||null===(E=I.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P?"":he(null===(y=window)||void 0===y||null===(T=y.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*he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:B,VIEWLIFT_CONTENT_SERIES_TITLE:he(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:he(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:ge(L),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(_,"VIEWLIFT_LAT",""),e(_,"VIEWLIFT_APP_BUNDLE",""),e(_,"VIEWLIFT_ATT_CONSENT",""),_),null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var H in x){var G=new RegExp(H,"g");A=A.replace(G,x[H])}return A},Ie=function(e){var n,t,o,i,r,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===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(ue()?u?a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=ue()?me(me({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=ue()?me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=me(me({},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")||""})},Ee=function(e,n){var t,o,i,r,l,a,d,u,s,c,v,f,m,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===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,w=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,I=(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 E=(null==e||null===(v=e[p])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(m=f.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return Te(w);if(g){var y=be(h,n);return y.src=we(y.src,n,e),y}if("Safari"!==de()&&E)return ye(h);if(I){var T=Te(h);return T.src=we(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=we(b.src,n,e),b}return null},ye=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Te=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},be=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=de();if(r(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 i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,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,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return _e(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(_e(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 _e=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==de()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Se=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 i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Oe=function(e,n){if(import("./error-2395864b.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 i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},Ae=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var De=!1,Le=function(e,n,t){var o=we(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==g(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(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===(i=o.ads)||void 0===i?void 0:i.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)}};function Pe(e,n){var t,o,i,l=r(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===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o,i,r,u,s,c,v,f,m;if(Fe.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||An(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(u=r.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!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||On(e,10)}}},!0)}var ke,Fe=(ke=!0,{enable:function(){ke=!0},disable:function(){ke=!1},get enabled(){return ke}}),Re="ssai-breakStart",Ce="ssai-adImpression",je="ssai-firstQuartile",Ne="ssai-midpoint",Ve="ssai-thirdQuartile",We="ssai-complete",Be="ssai-breakEnd",Ue={breakStart:Re,impression:Ce,firstQuartile:je,midpoint:Ne,thirdQuartile:Ve,complete:We,breakEnd:Be};function Me(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=Ue[o];i&&t.trigger(i,n)}function xe(e){var n=r(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(Re,e)},adImpression:function(e){return t(Ce,e)},adFirstQuartile:function(e){return t(je,e)},adMidpoint:function(e){return t(Ne,e)},adThirdQuartile:function(e){return t(Ve,e)},adComplete:function(e){return t(We,e)},adBreakEnd:function(e){return t(Be,e)}}}function He(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(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?He(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):He(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Qe,Ye=(Qe=null,{get:function(){return Qe},set:function(e){Qe=e}});function ze(e,n){var t,o,i,l,d,u,s,c,v,f,m,p,g=null==e?void 0:e.playerId,h=r(g);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var w=a(),I=(null==w||null===(o=w.video)||void 0===o?void 0:o.metadata)||[],E=(null==I?void 0:I.length)&&I.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=E)&&void 0!==i&&i.length){var S=E.map(function(e){return e.value});E=null==S?void 0:S.join(",")}y();var O,A,D,L=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,P=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,k=Ge(Ge(Ge({},null==w?void 0:w.video),null==w?void 0:w.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==L||null===(u=L.seriesDetails)||void 0===u?void 0:u.season)||null,episodeNumber:(null==L||null===(s=L.seriesDetails)||void 0===s?void 0:s.episode)||null,episodeTitle:(null==L?void 0:L.lcSubTitle)||null,isCompleteEpisode:!!(null!=w&&null!==(c=w.video)&&void 0!==c&&c.series||null!=L&&null!==(v=L.seriesDetails)&&void 0!==v&&v.episode),genre:E||P,comscoreConfig:{implementationId:(null==e||null===(f=e.comscore)||void 0===f?void 0:f.implementationId)||null,projectId:(null==e||null===(m=e.comscore)||void 0===m?void 0:m.projectId)||null}});if(null!=k&&null!==(p=k.streamingInfo)&&void 0!==p&&p.isLiveStream?k.contentType="LIVE":k.contentType="LONG_FORM_ON_DEMAND",null==k||!k.network){var F,R=(null==k?void 0:k.metadata)||[],C=null==R||null===(F=R.find(function(e){return"network"===e.name}))||void 0===F?void 0:F.value;k.network=C||null}k.siteName=null==k?void 0:k.network,null!=k&&k.network&&null!=k&&k.genre&&(k.customGenre="".concat(k.network,"_").concat((null==k?void 0:k.programTitle)||(O=k,null!=O&&O.series?null==O||null===(D=O.series)||void 0===D?void 0:D.title:null==O||null===(A=O.gist)||void 0===A?void 0:A.title),"_").concat(k.genre)),null!=L&&L.airDate&&(k.publishDate=L.airDate);var j=T(k,h);console.log("comscoreOptions player data",j),b(Ge({playerName:"Video.js"},j)),_(h)}}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 Ke(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}function Xe(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 Je(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)?Je(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 Je(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 $e,Ze=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),en=($e=null,{set:function(e){$e=e},get position(){return $e}});function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=n(t.mark(function e(n,o){var i,l,a,d,u,s,c,v,f,m,p,g,h,w,I,y,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=Ee(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[u])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=we(s,n,o),c=rn(s),v=E(c,2),f=v[0],m=v[1],p=on(m)||{},s=new URL(s.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var n=E(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(Ke({adsParams:Ke({},f)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return h=e.sent,w="https://"+new URL(s).hostname,I=h.trackingUrl,y=h.manifestUrl,T=w+I,b=w+y,Ze.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 on(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=E(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function rn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=Xe((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=E(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=E(c[s],2),f=v[0],m=v[1];if(f.startsWith("ads."))d[f.replace(/^ads\./,"")]=m;else u[f]=m}return[d,u]}var ln,an,dn,un,sn=(ln=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),ln=Array.isArray(e)?I(e):ln},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",ln),I(ln)}}),cn=new Map;function vn(e,n){return fn.apply(this,arguments)}function fn(){return fn=n(t.mark(function e(o,i){var l,a,d,u,s,c,v,f,m,p,g,w,E,y,T,b,_,S,O,A,D,L,P,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,i,l,a){var d,u,s=r(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[i])||void 0===u?void 0:u.adId)||c;Math.floor(s.currentTime());var f,m=Xe(t);try{var p=function(){var t,r,l,d=f.value,u=d.eventType,m=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,w=p||c,I=m,E=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.adEventHandler)||null,y="".concat(v,"_").concat(u),T="pod-".concat(c);cn.has(T)||cn.set(T,new Set);var b=cn.get(T);if(console.warn(e,w,"map:",u,"condition1:",e>=w,"map:",cn),e>=w&&e<=w+L){if(!b.has(y)){b.add(y);try{P(u,n,I,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var _=en.position;en.set(null),setTimeout(function(){null!=_&&(s.currentTime(_),a())},500)}if("function"==typeof E)try{var S,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[i],pod:n,adIndex:i};E({adsData:O}),Me(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var A=Ye.get();if(A&&0!==Object.keys(A).length){var D=A.formulateComscoreAdPayload,k=A.startComscoreAdTracking,F=A.finishComscoreAdTracking,R=A.endComscoreAdTracking;if("impression"===u){var C,j=Ze.get();k(D(Ke(Ke({},null==n||null===(C=n.ads)||void 0===C?void 0:C[i]),{},{trackingUrl:j})))}else"complete"===u?F():"breakEnd"===u&&R()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},P=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)})})},D=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},cn.clear(),en.set(i),m=Ze.get(),(p=r(o)).one("loadeddata",function(){m&&A(m)}),g=new Map,w=new Map,E=-1,y=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,_=(null==p||null===(s=p.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[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 I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.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 Ke(Ke({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},A=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,c,v,f,m,p,A,L,P,F,R,C,j,N,V,W,B,U,M,x;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return W=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",W),0===e.button&&j()},V=function(e){},N=function(){var e,n=p.currentTime(),t=null,o=Xe(m);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,g.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){p.currentTime(t+2.2)},100))},j=function(){var e,n=p.currentTime(),t=null,o=Xe(m);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!g.has(r)||n>=r&&n<=d)&&(t=r,g.set(r,!0),w.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){p.currentTime(t-.4)},100))},s=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),f=v.avails,m=[],p=r(o),A=p.controlBar.progressControl,L=A.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),f.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&&(s=!0),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:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&i&&(p.currentTime(i),N()),null!=m&&m.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),window.adsQueueList=m,"function"==typeof(C=(null===(P=window)||void 0===P||null===(F=P.customData)||void 0===F||null===(R=F.ads)||void 0===R?void 0:R.onAdBreaksLoaded)||null)&&(null==m?void 0:m.length)>0&&C(m)),console.log(m,"data"),m.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",L.appendChild(r)}}),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=h(function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=m[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-2&&e<=a+2){var d;e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&g.set(i,!0),Fe.disable(),y&&y.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.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")),A.el().classList.add("hide-progress-bar");for(var u=e-i,s=0,c=0,v=0;v<l.length;v++){var f,p=null==l||null===(f=l[v])||void 0===f?void 0:f.durationInSeconds;if(u<s+p){c=v;break}s+=p}l[c];var h=Math.max(0,r-u),E=Math.round(h);B.style.display="block",x.textContent="".concat(c+1," of ").concat(l.length," • ").concat(D(E));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,I(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,I(null==t?void 0:t.podSlotImpressionBeacon)),k(e,t,O,c,0,N),"break"}w.delete(i)},o=0;o<m.length;o++){if("break"===t())break}n||(B.style.display="none",A.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")),y&&y.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Fe.enable())}},1e3),p.on("timeupdate",p._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Fe.enabled&&"ArrowRight"==e.key&&(j(),On(o,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",W))}),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()}),(B=document.createElement("div")).className="ssai-ad-container",(U=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",U.append(M),(x=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",B.append(U),B.append(x),p.el().appendChild(B);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=3;case 19:case"end":return e.stop()}},e)})),fn.apply(this,arguments)}function mn(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 pn(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)?pn(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 pn(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 gn(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 hn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):gn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var wn={},In=(null===(an=window)||void 0===an||null===(dn=an.location)||void 0===dn||null===(un=dn.search)||void 0===un?void 0:un.includes("debug=true"))||!1,En=null;function yn(e){return Tn.apply(this,arguments)}function Tn(){return Tn=n(t.mark(function e(o){var i,l,a,d,u,s,c,v,f,m,p,g,w,E,y,T,b,_,S,O,A,D,L,P,k,F,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:R=function(e,n,t,i,l){var a,d,u=r(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[i])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,f=mn(t);try{for(f.s();!(v=f.n()).done;){var m,p,g,h=v.value,w=h.eventType,I=h.beaconUrls,E=h.startTimeInSeconds,y=h.startTime,T=h.durationInSeconds,b=(h.eventId,E||s),_=I,S=(null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(w),A="pod-".concat(s);P.has(A)||P.set(A,new Set);var D=P.get(A);if(In&&console.warn(e,b,"map:",w,"condition1:",e>=b,"map:",P),e>=b&&e<=b+k&&!D.has(O)){D.add(O);try{F(w,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,w,n)}if("function"==typeof S)try{var L,R={eventType:w,startTimeInSeconds:E,startTime:y,durationInSeconds:T,ad:null==n||null===(L=n.ads)||void 0===L?void 0:L[i],pod:n,adIndex:i};S({adsData:R}),Me(o,R)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){f.e(e)}finally{f.f()}}},F=function(e,n,t,o){var i,r,l;"breakEnd"===e&&(null===(i=wn)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(r=wn)||void 0===r?void 0:r.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(In&&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)})}))},p=function(){En&&clearInterval(En)},f=Ze.get(),(m=r(o)).one("loadeddata",function(){p(),En=setInterval(function(){f&&!m.paused()&&L(f)},2e3)}),m.on("dispose",function(){p()}),g=new Map,w=new Map,E=-1,y=null,T=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==m||null===(a=m.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,_=(null==m||null===(d=m.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==m||null===(u=m.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==m||null===(c=m.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,D=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 I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.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 hn(hn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},L=function(){var e=n(t.mark(function e(n){var i,l,a,d,u,s,c,v,f,m,p,L,P,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),y&&l.searchParams.append("nextToken",y),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,s=d.nextToken||null,y=s,c=[],v=r(o),f=v.controlBar.progressControl,m=f.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){c.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:D(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),In&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c,"function"==typeof(k=(null===(p=window)||void 0===p||null===(L=p.customData)||void 0===L||null===(P=L.ads)||void 0===P?void 0:P.onAdBreaksLoaded)||null)&&(null==c?void 0:c.length)>0&&k(c)),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",m.appendChild(r)}}),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=h(function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&g.set(o,!0),Fe.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.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")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,v=0;v<r.length;v++){var m,p=null==r||null===(m=r[v])||void 0===m?void 0:m.durationInSeconds;if(d<u+p){s=v;break}u+=p}setTimeout(function(){wn.totalAds=null==r?void 0:r.length,wn.currentAdIndex=s},1e3);var h=[];return null==r||r.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,I(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&h.push.apply(h,I(null==n?void 0:n.podSlotImpressionBeacon)),R(e,n,h,s),"break"}w.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(wn={},f.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Fe.enable())}},1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),Tn.apply(this,arguments)}function bn(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 _n=function(e){o(e).play()},Sn=function(e){o(e).pause()},On=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},An=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Dn=function(e){return!!o.getPlayer("".concat(e))},Ln=function(e){return o(e).paused()},Pn=function(){var e=n(t.mark(function e(o,i){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,z();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise(function(e,r){var u=(null==i?void 0:i.programs)||[];null==i||delete i.programs,j(i,a).then(function(){var r=n(t.mark(function n(r){var a,s,v,m,p,g,h,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null==r?void 0:r.data,window.sid=Z(),a.contentType="linearchannel",a.channelId=null==i?void 0:i.channelId,c(a),f(u),!l){n.next=16;break}if(h=(null==a||null===(s=a.linearchannel)||void 0===s?void 0:s.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(p=m.appcmsMain)||void 0===p||null===(g=p.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,w=Ee(a,o),!h){n.next=13;break}return n.next=12,nn(o,a);case 12:w=n.sent;case 13:w&&(jn(o,w),h&&yn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:a});case 17:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){r({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)}}(),kn=function(){var e=n(t.mark(function e(o,i,l){var a,d,s,f,g,h,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return f=e.sent,(u()||null)&&v(i),g=0,h=0,w=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(s=d.watchHistory)&&void 0!==s&&s.enable&&W(i,f).then(function(e){var n,t,o,i,r,l,a;(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(null==e?void 0:e.data)),g=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(w=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).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))}),e.abrupt("return",new Promise(function(e,l){C(i,f).then(function(){var i=n(t.mark(function n(i){var a,d,u,s,v,f,I,E,y,T,b,_,S,O,A,D,L,P,k,F,R,C,j,N,V,W,B,U,M,x,H,G,Q,Y,z,q,K,X;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==i?void 0:i.data,L=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(a=D[L])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(v=s.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==D||null===(f=D.video)||void 0===f||null===(I=f.streamingInfo)||void 0===I?void 0:I.isLiveStream)||!1,c(i.data),(F=(null==D||null===(E=D.ads)||void 0===E||null===(y=E.preRoll)||void 0===y||null===(T=y.adTags)||void 0===T||null===(b=T.web)||void 0===b?void 0:b.active)&&(null==D||null===(_=D.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(O=S.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Le(o,F,D),R=Ee(D,o),!P){n.next=12;break}return n.next=11,nn(o,D);case 11:R=n.sent;case 12:R?(G=(null==D||null===(C=D.video)||void 0===C||null===(j=C.gist)||void 0===j?void 0:j.videoImageUrl)||(null==D||null===(N=D.video)||void 0===N||null===(V=N.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(Q=r(o)).poster(G),jn(o,R),P&&vn(o,w),Q.on("loadstart",function(){k&&e({status:!0,msg:"Video Loaded",response:D})}),Q.on("loadeddata",function(){Ae(),e({status:!0,msg:"Video Loaded",response:D})}),Q.one("play",function(){g&&!P&&h<95&&setTimeout(function(){Q.currentTime(g)},0)}),Q.one("error",function(){var e;l({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(B=D.video)||void 0===B||null===(U=B.contentDetails)||void 0===U||null===(M=U.closedCaptions)||void 0===M?void 0:M.length)>0||(null==D||null===(x=D.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==D||null===(z=D.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==D||null===(K=D.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter(function(e){return"VTT"===e.format}),m(o,Y)):p(o)):(Oe(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 i.apply(this,arguments)}}()).catch(function(e){Nn(e,o,l,i)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Fn=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Rn=function(e){var n=(Ye.get()||{}).destroyComscoreTag,t=r(e);if(Cn(),"function"==typeof n&&n(),w(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},Cn=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()},jn=function(e,n){var t=r(e);t&&t.src(n)},Nn=function(n,t,o,i){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.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);Dn(t)&&Oe(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?bn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):bn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Vn=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 i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")},Wn=function(e){var n,t=r(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{_n as A,Sn as B,An as C,Dn as D,kn as E,Pn as F,Rn as G,M as H,sn as I,xe as J,Wn as K,U as L,q as M,G as N,x as O,O as P,cn as Q,Pe as R,ue as S,Ln as T,yn as U,vn as V,B as W,ve as a,ce as b,Ye as c,de as d,Ee as e,Ae as f,ee as g,Oe as h,ze as i,Vn as j,ae as k,jn as l,Le as m,Se as n,nn as o,K as p,C as q,W as r,V as s,Nn as t,z as u,j as v,N as w,se as x,Fn as y,On as z};
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"js-cookie";import{a,e as d,g as u,h as s,s as c,i as v,d as f}from"./currentVideoInfo-0b234e55.js";import{a as m,r as p}from"./captions-78bd2908.js";import g from"@babel/runtime/helpers/typeof";import{t as h,c as w}from"./skin-65765793.js";import I from"@babel/runtime/helpers/toConsumableArray";import E from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as y,formulateComscorePayload as T,createComscoreStreamingTag as b,setComscorePlayerInstance as _}from"@viewlift/comscore/index.js";function S(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function O(e){window.dataLayer=window.dataLayer||[],S("js",new Date),S("config",e)}function A(e,n){S("event",e,n)}var D={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 L(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 P(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?L(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var k={name:"@viewlift/player",version:"2.1.19",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.2",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=k.version;var F,R=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":U.get()+"".concat(null==D?void 0:D.getVideoDetails)},C=function(e,n){var t,o,r,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})}):i({url:R(),params:P({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":k.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})},j=function(e,n){var t,o,r,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})}):i({url:U.get()+D.getLinearChannelDetails,params:P(P(P(P(P({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===(r=window)||void 0===r||null===(l=r.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}})},N=function(e,n){var t,o,r=K(n),l=(null==r?void 0:r.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})}):i({url:U.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},V=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,z();case 2:return o=e.sent,e.abrupt("return",i({url:U.get()+"".concat(null==D?void 0:D.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:P({},n),params:P({},(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)}}(),W=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:U.get()+"".concat(null==D?void 0:D.getVideoInfoV2,"/").concat(r,"/").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})},B=function(e){var n=e.videoId;return i({method:"GET",url:U.get()+"".concat(null==D?void 0:D.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},U=(F=null==D?void 0:D.apiBaseUrl,{set:function(e){e&&(F=e)},get:function(){return F}}),M=function(e,n,t,o){var r,l;return i({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},x=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},H=null;function G(){return{set:function(e){e&&(H=e)},get:function(){return H}}}var Q=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=G().get(),o=U.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);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)}}(),Y=null,z=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"))||!x(n)){e.next=6;break}return Y||(Y=Q().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&G().set(r),i||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){Y=null})),e.abrupt("return",Y);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),q=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},K=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function X(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 J(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?X(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):X(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $=function(){var e,n,t,o,i,r,l,d=a();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===(i=d.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==d||null===(l=d.video)||void 0===l?void 0:l.id)||(null==d?void 0:d.id)};function Z(){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 ee(){return ne.apply(this,arguments)}function ne(){return(ne=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:if(n=e.sent,o=K(n),!(i=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",i);case 9:return i=Z(),window.sessionStorage.setItem("uid",i),e.abrupt("return",i);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function te(){return oe.apply(this,arguments)}function oe(){return(oe=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,z();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)}function ie(e){return e?String(e):""}window.initialise=function(e){window.sid=Z(),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,i,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,A(r?"FAILED_TO_START":"DROPPED_STREAM",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,o,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),A("PLAY",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":$(),watchTime:Math.floor(e.currentTime())})}))},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 i,r,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++,A("BUFFERING",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.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,A("FIRST_FRAME",J({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$()},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,i,r,l;A("AD_REQUEST",J({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$(),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}),A("AD_IMPRESSION",J({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:$()},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.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(),i=0;i<o.length;i++){var r=o.start(i),l=o.end(i);if(re(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var re=function(e,n,t){return e>=n&&e<=t},le=function(){var e,n=a(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function ae(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,r,l,a,d,u,s,c,v,f,m,p,g,h,w,I,E,y,T,b,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return E=e.sent,y=K(E),T=null==y?void 0:y.site,b=null==y?void 0:y.siteId,e.t0=J,e.t1=J,e.t2=J({aid:T,cid:b,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,ee();case 12:return e.t4=e.sent,e.t5=$(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a: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?ie(n.adPosition):"",e.next=28,te();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(f=le())&&void 0!==f?f:null,e.t28=null!=T?T: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===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),_=[e.t33],i({url:(null===(h=window)||void 0===h||null===(w=h.customData)||void 0===w||null===(I=w.beacon)||void 0===I?void 0:I.url)||U.get()+D.getBeaconUrl,method:"post",headers:{Authorization:E},contentType:"application/x-www-form-urlencoded",dataType:"text",data:_}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},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 de=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"},ue=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},se=function(e,n){var t=new Map;B({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),s(t)}).catch(function(e){return console.log(e)})},ce=function(){var e=d.get();return e>=0?e+1:1},ve=function(){var e,n,t,o=u(),i=a(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=d.get(),s=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)===r});return s>=0?s+1:1};function fe(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 me(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):fe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ge=function(e){var n=he(e,"video.tags",[]),t=he(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},he=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},we=function(){var n,t,o,i,a,d,u,s,c,v,f,m,p,g,h,w,I,E,y,T,b,_,S,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return A;var P=(null==L?void 0:L.siteName)||(null==L?void 0:L.site)||"",k=(null==L?void 0:L.contentType)||"video",F=(null==L||null===(o=L[k])||void 0===o?void 0:o.metadata)||(null==L||null===(i=L[k])||void 0===i||null===(a=i.gist)||void 0===a?void 0:a.metadata),R=r(D);if(!A.includes("VIEWLIFT_"))return A;var C,j=window.getComputedStyle(document.getElementById(D),null),N=Math.trunc(j.getPropertyValue("height").slice(0,-2)),V=Math.trunc(j.getPropertyValue("width").slice(0,-2)),W="linearchannel"===k?null==L||null===(d=L.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==L?void 0:L.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:he(L,"video.gist.id",""),B="linearchannel"===k?null==L||null===(v=L.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(m=f.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===m?void 0:m.title:he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,M=null;"function"==typeof window.__gpp&&(null===(C=window)||void 0===C||C.__gpp("ping",function(e){U=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var x=me(me({},Ie(F)),{},(_={VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:N,VIEWLIFT_SIZE:pe(V,N),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:he(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(g=R.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(h=R.options_)||void 0===h?void 0:h.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ge(L),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+he(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:he(null===(w=window)||void 0===w||null===(I=w.app_data)||void 0===I||null===(E=I.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P?"":he(null===(y=window)||void 0===y||null===(T=y.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*he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:B,VIEWLIFT_CONTENT_SERIES_TITLE:he(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:he(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:ge(L),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(_,"VIEWLIFT_LAT",""),e(_,"VIEWLIFT_APP_BUNDLE",""),e(_,"VIEWLIFT_ATT_CONSENT",""),_),null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var H in x){var G=new RegExp(H,"g");A=A.replace(G,x[H])}return A},Ie=function(e){var n,t,o,i,r,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===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(ue()?u?a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=ue()?me(me({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=ue()?me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=me(me({},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")||""})},Ee=function(e,n){var t,o,i,r,l,a,d,u,s,c,v,f,m,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===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,w=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,I=(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 E=(null==e||null===(v=e[p])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(m=f.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return Te(w);if(g){var y=be(h,n);return y.src=we(y.src,n,e),y}if("Safari"!==de()&&E)return ye(h);if(I){var T=Te(h);return T.src=we(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=we(b.src,n,e),b}return null},ye=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Te=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},be=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=de();if(r(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 i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,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,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return _e(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(_e(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 _e=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==de()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Se=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 i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Oe=function(e,n){if(import("./error-2395864b.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 i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},Ae=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var De=!1,Le=function(e,n,t){var o=we(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==g(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(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===(i=o.ads)||void 0===i?void 0:i.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)}};function Pe(e,n){var t,o,i,l=r(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===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o,i,r,u,s,c,v,f,m;if(Fe.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||An(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(u=r.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!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||On(e,10)}}},!0)}var ke,Fe=(ke=!0,{enable:function(){ke=!0},disable:function(){ke=!1},get enabled(){return ke}}),Re="ssai-breakStart",Ce="ssai-adImpression",je="ssai-firstQuartile",Ne="ssai-midpoint",Ve="ssai-thirdQuartile",We="ssai-complete",Be="ssai-breakEnd",Ue={breakStart:Re,impression:Ce,firstQuartile:je,midpoint:Ne,thirdQuartile:Ve,complete:We,breakEnd:Be};function Me(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=Ue[o];i&&t.trigger(i,n)}function xe(e){var n=r(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(Re,e)},adImpression:function(e){return t(Ce,e)},adFirstQuartile:function(e){return t(je,e)},adMidpoint:function(e){return t(Ne,e)},adThirdQuartile:function(e){return t(Ve,e)},adComplete:function(e){return t(We,e)},adBreakEnd:function(e){return t(Be,e)}}}function He(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(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?He(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):He(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Qe,Ye=(Qe=null,{get:function(){return Qe},set:function(e){Qe=e}});function ze(e,n){var t,o,i,l,d,u,s,c,v,f,m,p,g=null==e?void 0:e.playerId,h=r(g);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var w=a(),I=(null==w||null===(o=w.video)||void 0===o?void 0:o.metadata)||[],E=(null==I?void 0:I.length)&&I.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=E)&&void 0!==i&&i.length){var S=E.map(function(e){return e.value});E=null==S?void 0:S.join(",")}y();var O,A,D,L=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,P=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,k=Ge(Ge(Ge({},null==w?void 0:w.video),null==w?void 0:w.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==L||null===(u=L.seriesDetails)||void 0===u?void 0:u.season)||null,episodeNumber:(null==L||null===(s=L.seriesDetails)||void 0===s?void 0:s.episode)||null,episodeTitle:(null==L?void 0:L.lcSubTitle)||null,isCompleteEpisode:!!(null!=w&&null!==(c=w.video)&&void 0!==c&&c.series||null!=L&&null!==(v=L.seriesDetails)&&void 0!==v&&v.episode),genre:E||P,comscoreConfig:{implementationId:(null==e||null===(f=e.comscore)||void 0===f?void 0:f.implementationId)||null,projectId:(null==e||null===(m=e.comscore)||void 0===m?void 0:m.projectId)||null}});if(null!=k&&null!==(p=k.streamingInfo)&&void 0!==p&&p.isLiveStream?k.contentType="LIVE":k.contentType="LONG_FORM_ON_DEMAND",null==k||!k.network){var F,R=(null==k?void 0:k.metadata)||[],C=null==R||null===(F=R.find(function(e){return"network"===e.name}))||void 0===F?void 0:F.value;k.network=C||null}k.siteName=null==k?void 0:k.network,null!=k&&k.network&&null!=k&&k.genre&&(k.customGenre="".concat(k.network,"_").concat((null==k?void 0:k.programTitle)||(O=k,null!=O&&O.series?null==O||null===(D=O.series)||void 0===D?void 0:D.title:null==O||null===(A=O.gist)||void 0===A?void 0:A.title),"_").concat(k.genre)),null!=L&&L.airDate&&(k.publishDate=L.airDate);var j=T(k,h);console.log("comscoreOptions player data",j),b(Ge({playerName:"Video.js"},j)),_(h)}}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 Ke(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}function Xe(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 Je(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)?Je(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 Je(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 $e,Ze=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),en=($e=null,{set:function(e){$e=e},get position(){return $e}});function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=n(t.mark(function e(n,o){var i,l,a,d,u,s,c,v,f,m,p,g,h,w,I,y,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=Ee(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[u])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=we(s,n,o),c=rn(s),v=E(c,2),f=v[0],m=v[1],p=on(m)||{},s=new URL(s.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var n=E(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(Ke({adsParams:Ke({},f)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return h=e.sent,w="https://"+new URL(s).hostname,I=h.trackingUrl,y=h.manifestUrl,T=w+I,b=w+y,Ze.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 on(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=E(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function rn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=Xe((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=E(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=E(c[s],2),f=v[0],m=v[1];if(f.startsWith("ads."))d[f.replace(/^ads\./,"")]=m;else u[f]=m}return[d,u]}var ln,an,dn,un,sn=(ln=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),ln=Array.isArray(e)?I(e):ln},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",ln),I(ln)}}),cn=new Map;function vn(e,n){return fn.apply(this,arguments)}function fn(){return fn=n(t.mark(function e(o,i){var l,a,d,u,s,c,v,f,m,p,g,w,E,y,T,b,_,S,O,A,D,L,P,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,i,l,a){var d,u,s=r(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[i])||void 0===u?void 0:u.adId)||c;Math.floor(s.currentTime());var f,m=Xe(t);try{var p=function(){var t,r,l,d=f.value,u=d.eventType,m=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,w=p||c,I=m,E=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.adEventHandler)||null,y="".concat(v,"_").concat(u),T="pod-".concat(c);cn.has(T)||cn.set(T,new Set);var b=cn.get(T);if(console.warn(e,w,"map:",u,"condition1:",e>=w,"map:",cn),e>=w&&e<=w+L){if(!b.has(y)){b.add(y);try{P(u,n,I,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var _=en.position;en.set(null),setTimeout(function(){null!=_&&(s.currentTime(_),a())},500)}if("function"==typeof E)try{var S,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[i],pod:n,adIndex:i};E({adsData:O}),Me(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var A=Ye.get();if(A&&0!==Object.keys(A).length){var D=A.formulateComscoreAdPayload,k=A.startComscoreAdTracking,F=A.finishComscoreAdTracking,R=A.endComscoreAdTracking;if("impression"===u){var C,j=Ze.get();k(D(Ke(Ke({},null==n||null===(C=n.ads)||void 0===C?void 0:C[i]),{},{trackingUrl:j})))}else"complete"===u?F():"breakEnd"===u&&R()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},P=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)})})},D=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},cn.clear(),en.set(i),m=Ze.get(),(p=r(o)).one("loadeddata",function(){m&&A(m)}),g=new Map,w=new Map,E=-1,y=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,_=(null==p||null===(s=p.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[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 I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.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 Ke(Ke({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},A=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,c,v,f,m,p,A,L,P,F,R,C,j,N,V,W,B,U,M,x;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return W=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",W),0===e.button&&j()},V=function(e){},N=function(){var e,n=p.currentTime(),t=null,o=Xe(m);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,g.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){p.currentTime(t+2.2)},100))},j=function(){var e,n=p.currentTime(),t=null,o=Xe(m);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!g.has(r)||n>=r&&n<=d)&&(t=r,g.set(r,!0),w.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){p.currentTime(t-.4)},100))},s=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),f=v.avails,m=[],p=r(o),A=p.controlBar.progressControl,L=A.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),f.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&&(s=!0),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:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&i&&(p.currentTime(i),N()),null!=m&&m.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),window.adsQueueList=m,"function"==typeof(C=(null===(P=window)||void 0===P||null===(F=P.customData)||void 0===F||null===(R=F.ads)||void 0===R?void 0:R.onAdBreaksLoaded)||null)&&(null==m?void 0:m.length)>0&&C(m)),console.log(m,"data"),m.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",L.appendChild(r)}}),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=h(function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=m[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-4&&e<=a+4){var d;e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&g.set(i,!0),Fe.disable(),y&&y.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.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")),A.el().classList.add("hide-progress-bar");for(var u=e-i,s=0,c=0,v=0;v<l.length;v++){var f,p=null==l||null===(f=l[v])||void 0===f?void 0:f.durationInSeconds;if(u<s+p){c=v;break}s+=p}l[c];var h=Math.max(0,r-u),E=Math.round(h);B.style.display="block",x.textContent="".concat(c+1," of ").concat(l.length," • ").concat(D(E));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,I(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,I(null==t?void 0:t.podSlotImpressionBeacon)),k(e,t,O,c,0,N),"break"}w.delete(i)},o=0;o<m.length;o++){if("break"===t())break}n||(B.style.display="none",A.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")),y&&y.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Fe.enable())}},1e3),p.on("timeupdate",p._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Fe.enabled&&"ArrowRight"==e.key&&(j(),On(o,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",W))}),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()}),(B=document.createElement("div")).className="ssai-ad-container",(U=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",U.append(M),(x=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",B.append(U),B.append(x),p.el().appendChild(B);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=3.5;case 19:case"end":return e.stop()}},e)})),fn.apply(this,arguments)}function mn(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 pn(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)?pn(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 pn(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 gn(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 hn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):gn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var wn={},In=(null===(an=window)||void 0===an||null===(dn=an.location)||void 0===dn||null===(un=dn.search)||void 0===un?void 0:un.includes("debug=true"))||!1,En=null;function yn(e){return Tn.apply(this,arguments)}function Tn(){return Tn=n(t.mark(function e(o){var i,l,a,d,u,s,c,v,f,m,p,g,w,E,y,T,b,_,S,O,A,D,L,P,k,F,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:R=function(e,n,t,i,l){var a,d,u=r(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[i])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,f=mn(t);try{for(f.s();!(v=f.n()).done;){var m,p,g,h=v.value,w=h.eventType,I=h.beaconUrls,E=h.startTimeInSeconds,y=h.startTime,T=h.durationInSeconds,b=(h.eventId,E||s),_=I,S=(null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(w),A="pod-".concat(s);P.has(A)||P.set(A,new Set);var D=P.get(A);if(In&&console.warn(e,b,"map:",w,"condition1:",e>=b,"map:",P),e>=b&&e<=b+k&&!D.has(O)){D.add(O);try{F(w,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,w,n)}if("function"==typeof S)try{var L,R={eventType:w,startTimeInSeconds:E,startTime:y,durationInSeconds:T,ad:null==n||null===(L=n.ads)||void 0===L?void 0:L[i],pod:n,adIndex:i};S({adsData:R}),Me(o,R)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){f.e(e)}finally{f.f()}}},F=function(e,n,t,o){var i,r,l;"breakEnd"===e&&(null===(i=wn)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(r=wn)||void 0===r?void 0:r.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(In&&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)})}))},p=function(){En&&clearInterval(En)},f=Ze.get(),(m=r(o)).one("loadeddata",function(){p(),En=setInterval(function(){f&&!m.paused()&&L(f)},2e3)}),m.on("dispose",function(){p()}),g=new Map,w=new Map,E=-1,y=null,T=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==m||null===(a=m.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,_=(null==m||null===(d=m.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==m||null===(u=m.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==m||null===(c=m.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,D=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 I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.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 hn(hn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},L=function(){var e=n(t.mark(function e(n){var i,l,a,d,u,s,c,v,f,m,p,L,P,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),y&&l.searchParams.append("nextToken",y),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,s=d.nextToken||null,y=s,c=[],v=r(o),f=v.controlBar.progressControl,m=f.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){c.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:D(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),In&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c,"function"==typeof(k=(null===(p=window)||void 0===p||null===(L=p.customData)||void 0===L||null===(P=L.ads)||void 0===P?void 0:P.onAdBreaksLoaded)||null)&&(null==c?void 0:c.length)>0&&k(c)),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",m.appendChild(r)}}),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=h(function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&g.set(o,!0),Fe.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.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")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,v=0;v<r.length;v++){var m,p=null==r||null===(m=r[v])||void 0===m?void 0:m.durationInSeconds;if(d<u+p){s=v;break}u+=p}setTimeout(function(){wn.totalAds=null==r?void 0:r.length,wn.currentAdIndex=s},1e3);var h=[];return null==r||r.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,I(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&h.push.apply(h,I(null==n?void 0:n.podSlotImpressionBeacon)),R(e,n,h,s),"break"}w.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(wn={},f.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Fe.enable())}},1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),Tn.apply(this,arguments)}function bn(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 _n=function(e){o(e).play()},Sn=function(e){o(e).pause()},On=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},An=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Dn=function(e){return!!o.getPlayer("".concat(e))},Ln=function(e){return o(e).paused()},Pn=function(){var e=n(t.mark(function e(o,i){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,z();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise(function(e,r){var u=(null==i?void 0:i.programs)||[];null==i||delete i.programs,j(i,a).then(function(){var r=n(t.mark(function n(r){var a,s,v,m,p,g,h,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null==r?void 0:r.data,window.sid=Z(),a.contentType="linearchannel",a.channelId=null==i?void 0:i.channelId,c(a),f(u),!l){n.next=16;break}if(h=(null==a||null===(s=a.linearchannel)||void 0===s?void 0:s.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(p=m.appcmsMain)||void 0===p||null===(g=p.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,w=Ee(a,o),!h){n.next=13;break}return n.next=12,nn(o,a);case 12:w=n.sent;case 13:w&&(jn(o,w),h&&yn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:a});case 17:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){r({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)}}(),kn=function(){var e=n(t.mark(function e(o,i,l){var a,d,s,f,g,h,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return f=e.sent,(u()||null)&&v(i),g=0,h=0,w=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(s=d.watchHistory)&&void 0!==s&&s.enable&&W(i,f).then(function(e){var n,t,o,i,r,l,a;(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(null==e?void 0:e.data)),g=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(w=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).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))}),e.abrupt("return",new Promise(function(e,l){C(i,f).then(function(){var i=n(t.mark(function n(i){var a,d,u,s,v,f,I,E,y,T,b,_,S,O,A,D,L,P,k,F,R,C,j,N,V,W,B,U,M,x,H,G,Q,Y,z,q,K,X;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==i?void 0:i.data,L=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(a=D[L])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(v=s.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==D||null===(f=D.video)||void 0===f||null===(I=f.streamingInfo)||void 0===I?void 0:I.isLiveStream)||!1,c(i.data),(F=(null==D||null===(E=D.ads)||void 0===E||null===(y=E.preRoll)||void 0===y||null===(T=y.adTags)||void 0===T||null===(b=T.web)||void 0===b?void 0:b.active)&&(null==D||null===(_=D.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(O=S.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Le(o,F,D),R=Ee(D,o),!P){n.next=12;break}return n.next=11,nn(o,D);case 11:R=n.sent;case 12:R?(G=(null==D||null===(C=D.video)||void 0===C||null===(j=C.gist)||void 0===j?void 0:j.videoImageUrl)||(null==D||null===(N=D.video)||void 0===N||null===(V=N.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(Q=r(o)).poster(G),jn(o,R),P&&vn(o,w),Q.on("loadstart",function(){k&&e({status:!0,msg:"Video Loaded",response:D})}),Q.on("loadeddata",function(){Ae(),e({status:!0,msg:"Video Loaded",response:D})}),Q.one("play",function(){g&&!P&&h<95&&setTimeout(function(){Q.currentTime(g)},0)}),Q.one("error",function(){var e;l({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(B=D.video)||void 0===B||null===(U=B.contentDetails)||void 0===U||null===(M=U.closedCaptions)||void 0===M?void 0:M.length)>0||(null==D||null===(x=D.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==D||null===(z=D.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==D||null===(K=D.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter(function(e){return"VTT"===e.format}),m(o,Y)):p(o)):(Oe(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 i.apply(this,arguments)}}()).catch(function(e){Nn(e,o,l,i)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Fn=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Rn=function(e){var n=(Ye.get()||{}).destroyComscoreTag,t=r(e);if(Cn(),"function"==typeof n&&n(),w(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},Cn=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()},jn=function(e,n){var t=r(e);t&&t.src(n)},Nn=function(n,t,o,i){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.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);Dn(t)&&Oe(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?bn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):bn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Vn=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 i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")},Wn=function(e){var n,t=r(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{_n as A,Sn as B,An as C,Dn as D,kn as E,Pn as F,Rn as G,M as H,sn as I,xe as J,Wn as K,U as L,q as M,G as N,x as O,O as P,cn as Q,Pe as R,ue as S,Ln as T,yn as U,vn as V,B as W,ve as a,ce as b,Ye as c,de as d,Ee as e,Ae as f,ee as g,Oe as h,ze as i,Vn as j,ae as k,jn as l,Le as m,Se as n,nn as o,K as p,C as q,W as r,V as s,Nn as t,z as u,j as v,N as w,se as x,Fn as y,On as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-c3d1f8c9.js";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{g as r}from"./player_instance-34118a5b.js";import n from"@babel/runtime/helpers/defineProperty";import i from"@babel/runtime/helpers/slicedToArray";import{a}from"./currentVideoInfo-0b234e55.js";import{t as u}from"./skin-65765793.js";function o(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 s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="my-player";function c(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function p(){return(p=e(t.mark(function e(r){var n,a,u,o,s,l,c,p,d,m,f,b,g,v,h,x,y,w,k,j,E,N,A,I;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return a=e.sent,e.next=11,createImageBitmap(a);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=i(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,m=[],f=0;f<l;f++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,f*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),m.push({uri:v,duration:r.duration}),r._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=i(h,2),y=x[0],w=x[1],k=[],j=0;j<y*w;j++)k.push({uri:null===(E=window)||void 0===E||null===(N=E.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(I=A.images)||void 0===I?void 0:I.placeholderCover,duration:r.duration});return e.abrupt("return",k);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return(m=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",c(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function f(e,t,n){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=r(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),n),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then(function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri}))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark(function e(r){var a,o,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={},r.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),u=i(r,2),o=u[0]*u[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);a[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},n(p,"left","-60px"),n(p,"border","1px solid transparent"),n(p,"borderRadius","4px"),p)})}}),o=Object.keys(a).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",u(function(e){return f(e,a,o)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",u(function(e){return f(e,a,o)},500))}),e.abrupt("return",a);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=function(){var r=e(t.mark(function e(r,n){var a,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return a=e.sent,e.next=5,a.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=i(t,2),n=r[0],a=r[1];n&&a&&(l[n.trim().toLowerCase()]=a.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark(function e(n,u){var o,s,c,p,d,m,f,b,g,v,x,y,j,E,N,A,I,T,O,S,M,P,R,$,B,L,D,U,C,X,_,q,F,W,z,G,V,H,J,K,Q,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,me,fe;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u,o=r(u),s=n.split("/"),c=s.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=a())||void 0===d||null===(m=d.video)||void 0===m?void 0:m.runtime),j=(null==x||null===(f=x.querySelector("MPD > BaseURL"))||void 0===f?void 0:f.textContent)||p+"/",E=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<E.length)){e.next=72;break}if(("image"!==(A=E[N]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(T=A.getElementsByTagName("SegmentTemplate")[0],O=null===(I=T.getElementsByTagName("SegmentTimeline"))||void 0===I?void 0:I[0],!T||!O){e.next=48;break}if(P=O.getElementsByTagName("S"),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("t")),$=parseInt(null===(M=P[0])||void 0===M?void 0:M.getAttribute("d")),B=A.getElementsByTagName("Representation")[0],L=B.getElementsByTagName("EssentialProperty")[0],D=L.getAttribute("value"),U=null==D?void 0:D.split("x"),C=i(U,2),X=C[0],_=C[1],!T){e.next=46;break}if(T.getAttribute("media"),q=T.getAttribute("timescale"),F=(q?$/q:$)/(X*_),W=B.getAttribute("id"),z=Math.round(y/F),G=Math.ceil(z/(X*_)),V=T.getAttribute("media"),parseInt(T.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],N=0;N<G;N++)K="/"==(J=V)[0]?new URL(p).origin:p+"/",H.push({duration:F,layout:D,uri:K+J.replace("$Time$",R+N*$).replace("$RepresentationID$",W)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(Q=A.getElementsByTagName("Representation")[0],Y=Q.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=i(ee,2),re=te[0],ne=te[1],!T){e.next=69;break}if(T.getAttribute("media"),ie=T.getAttribute("duration"),ae=T.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=Q.getAttribute("id"),se=Math.round(y/ue),le=Math.ceil(se/(re*ne)),ce=T.getAttribute("media"),pe=parseInt(T.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],me=w(ce),N=0;N<le;N++)fe=me?k(me,N+pe):ce,de.push({duration:ue,layout:Z,uri:j+fe.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function w(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function j(e){return E.apply(this,arguments)}function E(){return(E=e(t.mark(function e(n){var i,a,u,o,s,l,c,p,m,f,g,h,y,w,k,j;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r(n),c=l.currentSource(),p=c.src,p=null!==(i=p)&&void 0!==i&&i.includes("blob")?null===(a=window)||void 0===a||null===(u=a.player)||void 0===u?void 0:u.getSource():p,null===(o=p)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,d(p,n);case 6:if(!((null==(m=e.sent)?void 0:m.length)>0)){e.next=17;break}return f=(null==m?void 0:m[0])||null,g=f.uri,h=p.substring(0,p.lastIndexOf("/"))+"/",e.next=12,v(h,g);case 12:return y=e.sent,e.next=15,b(y);case 15:w=e.sent,l.thumbnails(w);case 17:e.next=28;break;case 19:if(null===(s=p)||void 0===s||!s.includes("mpd")){e.next=28;break}return e.next=22,x(p,n);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,b(k);case 26:j=e.sent,l.thumbnails(j);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}export{j as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as o}from"./currentVideoInfo-0b234e55.js";import{s as i}from"./autoNextVideo-
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as o}from"./currentVideoInfo-0b234e55.js";import{s as i}from"./autoNextVideo-780b39c1.js";import{e as l}from"./icons-37daa6b3.js";import{p as a,d as r}from"./skin-65765793.js";import s from"@babel/runtime/helpers/typeof";import d from"video.js";var c,u,m,v,p=[],f=!1,g=function(i,s){var d;if(f=!1,null!=s&&null!==(d=s.series)&&void 0!==d&&d.enable){var c;p=[];var u=o();null==u||u.map(function(t){var n;return(n=p).push.apply(n,e(t.episodes))}),null==s||null===(c=s.series)||void 0===c||c.cb}else{var m,v;p=(null==s||null===(m=s.relatedVideos)||void 0===m?void 0:m.content)||[],null==s||null===(v=s.relatedVideos)||void 0===v||v.cb}var g=t(i);g.on("timeupdate",function(){var e,t;if(!f){var o=Math.floor(g.currentTime()),i=g.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-o<=10&&n()<=(null===(t=p)||void 0===t?void 0:t.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}});var y,A=p.filter(function(e,t){return t==n()});if((null==A?void 0:A.length)>0)if(null!==(y=document.getElementsByClassName("next-ep-preview"))&&void 0!==y&&y[0]){var x,w,E,b,C,N,B,L,j,k,P,I;(null===(x=document.getElementsByClassName("next-ep-preview"))||void 0===x?void 0:x[0]).style.visibility="hidden";var O=null===(w=document.getElementsByClassName("next-ep-title"))||void 0===w?void 0:w[0],M=null===(E=document.getElementsByClassName("next-ep-img"))||void 0===E?void 0:E[0],T=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],X=null===(C=A[0])||void 0===C?void 0:C.title;(null===(N=X)||void 0===N?void 0:N.length)>60&&(X=X.substr(0,60)+"..."),O.textContent="".concat(X),M.src=(null===(B=A[0])||void 0===B||null===(L=B.gist)||void 0===L||null===(j=L.imageGist)||void 0===j?void 0:j.r16x9)||(null==A||null===(k=A[0])||void 0===k?void 0:k.img)||(null===(P=window)||void 0===P||null===(I=P.customData)||void 0===I?void 0:I.fallbackImage),T.onclick=function(){return h(i)}}else{var F,R,V,D,G,S,H,_,K=document.createElement("div");K.className="next-ep-preview",K.style.visibility="hidden",document.getElementById(i).append(K);var Q=document.createElement("div");Q.className="next-heading-wrapper";var U=document.createElement("div");U.className="next-ep-header",U.textContent="Next up";var W=document.createElement("div");W.className="next-ep-close",W.onclick=function(){K.style.visibility="hidden",f=!0},W.appendChild(a(l())),Q.append(U),Q.append(W);var Y=null===(F=A[0])||void 0===F?void 0:F.title,q=document.createElement("img");q.className="next-ep-img",q.src=(null===(R=A[0])||void 0===R||null===(V=R.gist)||void 0===V||null===(D=V.imageGist)||void 0===D?void 0:D.r16x9)||(null==A||null===(G=A[0])||void 0===G?void 0:G.img)||(null===(S=window)||void 0===S||null===(H=S.customData)||void 0===H?void 0:H.fallbackImage);var z=document.createElement("div");z.className="next-ep-title",(null===(_=Y)||void 0===_?void 0:_.length)>60&&(Y=Y.substr(0,60)+"..."),z.textContent="".concat(Y);var J=document.createElement("div");J.className="next-ep-content",J.append(q),J.append(z),J.onclick=r(function(){null==K||K.remove(),f=!0,h(i)},400),K.append(Q),K.append(J)}},h=function(e,o){var l=t(e),a=Math.floor(l.currentTime());if(Math.floor(l.duration())!=a){l.pause(e);var r=n();i(r,e,p)}};function y(e,n){var o=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var l=document.createElement("div");l.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",l.append(a),o.el().appendChild(l),o.on("useractive",function(){l.classList.remove("vjs-fade")}),o.on("userinactive",function(){o.paused()||l.classList.add("vjs-fade")}),o.on("fullscreenchange",function(){o.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}c={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=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"===s(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",function(e){var t,n,o,i,l,a,r,s;function d(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",d),s()}n=u({},c,e),i=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=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",o=document.createElement("img"),t.appendChild(o),o.src=n[0].src,o.className="vjs-thumbnail",u(o.style,n[0].style),o.style.left||o.style.right||(o.onload=function(){o.style.left=-o.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",function(e){a=i.duration()}),i.on("loadedmetadata",function(e){a=i.duration()}),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,s,d,c,p,f,g,h,y;for(r in s=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=v(l.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),d=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d-=v(l.el()).getBoundingClientRect().left+h,i=Math.floor((d-l.el().offsetLeft)/l.width()*a),n)i>r&&(s=Math.max(s,r));(c=n[s]).src&&o.src!=c.src&&(o.src=c.src),c.style&&o.style!=c.style&&u(o.style,c.style),d+(g=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(o,c.width||n[0].width)/2)>f?d-=d+g-f:d<g&&(d=g),t.style.left=d+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",d)}),s=function(e){t.style.left="-1000px"},l.on("mouseout",s),l.on("touchcancel",s),l.on("touchend",s),i.on("userinactive",s)});export{g as a,y as b};
|