@viewlift/player-backup 2.0.265-backup → 2.0.267-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-286a72f2.js → autoNextVideo-36253961.js} +1 -1
- package/cjs/bundle.css +202 -202
- package/cjs/{features-9fcbe89d.js → features-ffba769c.js} +1 -1
- package/cjs/{generic-87933502.js → generic-ab11c314.js} +1 -1
- package/cjs/{index-ec92d4e3.js → index-560b6ac7.js} +1 -1
- package/cjs/{index-1b1f220d.js → index-91b0df2d.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-8f8a6ca4.js → multicamv2-cb0553dc.js} +1 -1
- package/cjs/{multicamv2-9c5cfb7c.js → multicamv2-f62e0f62.js} +1 -1
- package/cjs/{nextEpisodeButton-416a7b7d.js → nextEpisodeButton-63ffe0cc.js} +1 -1
- package/cjs/{playlist-b84c4881.js → playlist-211965a0.js} +1 -1
- package/cjs/{series-f15deefd.js → series-2d223933.js} +1 -1
- package/cjs/{series-v2-ef6ad058.js → series-v2-53ed855b.js} +1 -1
- package/cjs/{series-v2-153582ab.js → series-v2-bf23e5ec.js} +1 -1
- package/cjs/{skin-7291d01d.js → skin-14ccdc11.js} +1 -1
- package/cjs/{skin-da292ff2.js → skin-18695fd9.js} +1 -1
- package/cjs/{skin-228ba96b.js → skin-46e3a604.js} +1 -1
- package/cjs/{skin-ac1ab4b6.js → skin-4bc06df1.js} +1 -1
- package/cjs/{skin-e7f83ec7.js → skin-4fdbfd6f.js} +1 -1
- package/cjs/{skin-39c77833.js → skin-510ea00e.js} +1 -1
- package/cjs/{skin-d4460618.js → skin-53064901.js} +1 -1
- package/cjs/{skin-ea8c5b0e.js → skin-6c21d8c4.js} +1 -1
- package/cjs/{skin-796b64fe.js → skin-9a9c0389.js} +1 -1
- package/cjs/{skin-2320b400.js → skin-ba2703ee.js} +1 -1
- package/cjs/{util-d3734cd9.js → util-d5d6be52.js} +1 -1
- package/cjs/{videoSelector-796d5fbe.js → videoSelector-1aa8c583.js} +1 -1
- package/cjs/{videoSelector-095d614f.js → videoSelector-9c4e1e19.js} +1 -1
- package/esm/apis/index.d.ts +4 -4
- package/esm/{autoNextVideo-f34ed8ed.js → autoNextVideo-339e22f2.js} +1 -1
- package/esm/bundle.css +202 -202
- package/esm/{features-2820ac47.js → features-c72ae89c.js} +1 -1
- package/esm/generic-d0aff29a.js +1 -0
- package/esm/helpers/token.d.ts +2 -1
- package/esm/{index-241b2666.js → index-02b8d099.js} +1 -1
- package/esm/{index-4fb2c3f6.js → index-4deb36c0.js} +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-ef3c32dd.js → multicamv2-4f8256a0.js} +1 -1
- package/esm/{multicamv2-21eda7f7.js → multicamv2-662c0d2f.js} +1 -1
- package/esm/{nextEpisodeButton-0f62efa9.js → nextEpisodeButton-80231a34.js} +1 -1
- package/esm/{playlist-61356e83.js → playlist-18e57c5b.js} +1 -1
- package/esm/series-0489e640.js +1 -0
- package/esm/{series-v2-79ebc051.js → series-v2-68980943.js} +1 -1
- package/esm/{series-v2-31654dc0.js → series-v2-f5e9fe85.js} +1 -1
- package/esm/{skin-13a1ba23.js → skin-46def1ff.js} +1 -1
- package/esm/{skin-48a8afa9.js → skin-55407572.js} +1 -1
- package/esm/{skin-626d8784.js → skin-69d995eb.js} +1 -1
- package/esm/{skin-9e9f4e79.js → skin-723f92fc.js} +1 -1
- package/esm/{skin-63ce846c.js → skin-77e91bfe.js} +1 -1
- package/esm/{skin-d559c89f.js → skin-8148a83e.js} +1 -1
- package/esm/{skin-a7c4274e.js → skin-827cdaa7.js} +1 -1
- package/esm/{skin-d66cb2d0.js → skin-a91c741d.js} +1 -1
- package/esm/{skin-ccfcc5cc.js → skin-b2069077.js} +1 -1
- package/esm/{skin-d30e0e38.js → skin-f29bf51c.js} +1 -1
- package/esm/{util-335174b2.js → util-4e885161.js} +1 -1
- package/esm/{videoSelector-96962ea8.js → videoSelector-37e8c6a6.js} +1 -1
- package/esm/{videoSelector-7707e0e2.js → videoSelector-469d11b7.js} +1 -1
- package/package.json +2 -1
- package/esm/generic-62a2101a.js +0 -1
- package/esm/series-9823330d.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("axios"),i=require("./skin-c97f0eea.js"),l=require("./browser-77c57718.js"),a=require("md5"),d=require("js-cookie"),u=require("./captions-80f6eb66.js"),s=require("@babel/runtime/helpers/typeof"),c=require("@babel/runtime/helpers/toConsumableArray"),v=require("@babel/runtime/helpers/slicedToArray"),m=require("@viewlift/comscore/index.js");function p(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function f(e,n){p("event",e,n)}var g={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function y(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?h(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):h(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var w={name:"@viewlift/player",version:"2.1.29",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant"},dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/comscore":"^1.0.11",axios:"^1.2.3",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=w.version;var I,E=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":P.get()+"".concat(null==g?void 0:g.getVideoDetails)},T=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:E(),params:y({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":w.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},b=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:P.get()+g.getLinearChannelDetails,params:y(y(y(y(y({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},_=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,M();case 2:return o=e.sent,e.abrupt("return",r({url:P.get()+"".concat(null==g?void 0:g.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:y({},n),params:y({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),S=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:P.get()+"".concat(null==g?void 0:g.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},O=function(e){var n=e.videoId;return r({method:"GET",url:P.get()+"".concat(null==g?void 0:g.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},P=(I=null==g?void 0:g.apiBaseUrl,{set:function(e){e&&(I=e)},get:function(){return I}}),D=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},A=null;function L(){return{set:function(e){e&&(A=e)},get:function(){return A}}}var k,C,F,R,j,V,x,N=function(){var e=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),o=P.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),W=null,M=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"))||!D(n)){e.next=6;break}return W||(W=N().then(function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&L().set(i),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){W=null})),e.abrupt("return",W);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),B=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},U=(V=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;V.set(t,(V.get(t)||0)+1)},get:function(e){return V.get(e)},clear:function(){V.clear()}}),H=function(e){C=e},G=function(){return C},q=function(){return k},Y=function(e){F=e},Q=function(e){if(R){var n=R.get(e);Y(n+1)}},z=(x=0,{set:function(e){e>=0&&(x=e)},get:function(){return x}});function K(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 X(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?K(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):K(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var J=0,$=null,Z=function(){var e,n,t,o,r,i,l,a=G();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.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==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(r=a.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ne(){return $||window.sessionStorage.getItem("uid")}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,M();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(o=JSON.parse(atob(n.split(".")[1])))||!o.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==o?void 0:o.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function re(e){return e?String(e):""}window.initialise=function(e){window.sid=ee(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,o,r,i=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,f(i?"FAILED_TO_START":"DROPPED_STREAM",X({pfm:window.platform,uid:ne(),vid:Z(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:n===i?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n,t){e.one("play",tryCatch(function(){var o,r,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),f("PLAY",X({pfm:window.platform,uid:ne(),vid:Z(),videoPosition:Math.floor(e.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(i=r.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",X({"Video ID":Z(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var r,i,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&J<4)J++,f("BUFFERING",X({pfm:window.platform,uid:ne(),vid:Z(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,f("FIRST_FRAME",X({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:Z()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,r,i,l;f("AD_REQUEST",X({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:Z(),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}),f("AD_IMPRESSION",X({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Z()},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(J=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),r=0;r<o.length;r++){var i=o.start(r),l=o.end(r);if(ie(n,i,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ie=function(e,n,t){return e>=n&&e<=t},le=function(){var e,n=G(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};window.fireEvent=function(){var e=n(t.mark(function e(n){var o,i,l,a,d,u,s,c,v,m,p,f,h,y,w,I,E,T,b,_,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return E=e.sent,T=B(E),b=null==T?void 0:T.site,_=null==T?void 0:T.siteId,e.t0=X,e.t1=X,e.t2=X({aid:b,cid:_,pfm:window.platform},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=ne(),e.t5=Z(),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?re(n.adPosition):"",e.next=26,te();case 26: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!==(m=le())&&void 0!==m?m:null,e.t28=null!=b?b:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f||null===(h=f.beacon)||void 0===h?void 0:h.params,e.t33=(0,e.t0)(e.t31,e.t32),S=[e.t33],r({url:(null===(y=window)||void 0===y||null===(w=y.customData)||void 0===w||null===(I=w.beacon)||void 0===I?void 0:I.url)||P.get()+g.getBeaconUrl,method:"post",headers:{Authorization:E},contentType:"application/x-www-form-urlencoded",dataType:"text",data:S}).catch(function(e){console.error(e)});case 44: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 ae=function(){var e=z.get();return e>=0?e+1:1},de=function(){var e,n,t,o=q(),r=G(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=z.get(),a=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===i});return a>=0?a+1:1};function ue(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 se(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ue(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var ce=a,ve=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},me=function(e){var n=pe(e,"video.tags",[]),t=pe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},pe=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},fe=function(){var e,n,t,o,r,l,a,u,s,c,v,m,p,f,g,h,y,w,I,E,T,b,_,S,O,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,A=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return P;var L=(null==A?void 0:A.siteName)||(null==A?void 0:A.site)||"",k=(null==A?void 0:A.contentType)||"video",C=(null==A||null===(t=A[k])||void 0===t?void 0:t.metadata)||(null==A||null===(o=A[k])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.metadata),F=i.getPlayer(D);if(!P.includes("VIEWLIFT_"))return P;var R,j=window.getComputedStyle(document.getElementById(D),null),V=Math.trunc(j.getPropertyValue("height").slice(0,-2)),x=Math.trunc(j.getPropertyValue("width").slice(0,-2)),N="linearchannel"===k?null==A||null===(l=A.linearchannel)||void 0===l||null===(a=l.channels)||void 0===a||null===(u=a.find(function(e){return(null==e?void 0:e.id)===(null==A?void 0:A.channelId)}))||void 0===u||null===(s=u.content)||void 0===s?void 0:s.id:pe(A,"video.gist.id",""),W="linearchannel"===k?null==A||null===(c=A.linearchannel)||void 0===c||null===(v=c.channels)||void 0===v||null===(m=v.find(function(e){return(null==e?void 0:e.id)===(null==A?void 0:A.channelId)}))||void 0===m?void 0:m.title:pe(A,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),M=null,B=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",function(e){M=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var U=d.get("us_privacy")||d.get("usprivacy"),H=void 0!==U?U:"1YNN",G=null!==(p=null===(f=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===f?void 0:f.fwIdentifier)&&void 0!==p?p:null,q=se(se({},ge(C)),{},{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:ve(x,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(g=window)||void 0===g?void 0:g.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:pe(A,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:pe(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:pe(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==F||null===(h=F.options_)||void 0===h?void 0:h.autoplay)||1,VIEWLIFT_MUTE:(null==F||null===(y=F.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:me(A),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(pe(A,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+pe(A,"video.gist.permalink","")),VIEWLIFT_CONSENT:d.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:pe(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"==L||"usanetwork"==L?"":pe(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(_=b.site)||void 0===_?void 0:_.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:G?ce(G):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*pe(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:pe(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:W,VIEWLIFT_CONTENT_SERIES_TITLE:pe(A,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:pe(A,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:de(),VIEWLIFT_SEASON_NUMBER:ae(),VIEWLIFT_CONTENT_TAGS:me(A),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:M||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var Y in q){var Q=new RegExp(Y,"g");P=P.replace(Q,q[Y])}return P},ge=function(e){var n,t,o,r,i,a,d,u,s,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var m=(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,p=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return m||p?(l.isMobile()?m?c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||""}):p&&(c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||""})):m?c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||""}):p&&(c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||""})),m?c=se(se({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||""}):p&&(c=se(se({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||""})),c=l.isMobile()?se(se({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||""}):se(se({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||""})):(c=se(se({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||""}),c=l.isMobile()?se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||""}):se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||""})),c=se(se({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:v.get("VIEWLIFT_NIELSEN_APP_ID")||pe(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s?void 0:s.analytics,"nielsen.id")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},he=function(e,n){var t,o,r,i,a,d,u,s,c,v,m,p,f,g=(null==e?void 0:e.contentType)||"video",h=null==e||null===(t=e[g])||void 0===t?void 0:t.drmEnabled,y=null==e||null===(o=e[g])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,w=null==e||null===(i=e[g])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,I=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var E=(null==e||null===(m=e[g])||void 0===m||null===(p=m.streamingInfo)||void 0===p||null===(f=p.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return we(w);if(h){var T=Ie(y,n);return T.src=fe(T.src,n,e),T}if("Safari"!==l.detectBrowser()&&E)return ye(y);if(I){var b=we(y);return b.src=fe(b.src,n,e),b}if(null!=y&&y.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(y);return _.src=fe(_.src,n,e),_}return null},ye=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},we=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ie=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,d=e.playReady,u=l.detectBrowser();if(i.getPlayer(n),"Safari"===u){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&i(e),i(null,t)})}}}}}(r);return Ee(n),s}var c,v={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(Ee(n),v.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==d?void 0:d.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==d?void 0:d.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==d?void 0:d.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==d?void 0:d.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==d?void 0:d.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var Ee=function(e){var n=i.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==l.detectBrowser()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Te=function(e,n){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},be=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var _e=!1,Se=function(e,n,t){var o=fe(n,e,t),r=i.getPlayer(e);if(n&&window.google){if("function"!=typeof r.ima&&"object"!==s(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,l=i.getPlayer(e);if(null!==l.el_){_e=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),_e&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};var Oe,Pe=(Oe=!0,{enable:function(){Oe=!0},disable:function(){Oe=!1},get enabled(){return Oe}}),De="ssai-breakStart",Ae="ssai-adImpression",Le="ssai-firstQuartile",ke="ssai-midpoint",Ce="ssai-thirdQuartile",Fe="ssai-complete",Re="ssai-breakEnd",je={breakStart:De,impression:Ae,firstQuartile:Le,midpoint:ke,thirdQuartile:Ce,complete:Fe,breakEnd:Re};function Ve(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i.getPlayer(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=je[o];r&&t.trigger(r,n)}function xe(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 Ne(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):xe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var We,Me=(We={},{get:function(){return We},set:function(e){We=e}});function Be(e,n){var t,o,r,l,a,d,u,s,c,v,p,f,g,h,y,w,I=null==e?void 0:e.playerId,E=i.getPlayer(I);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var T=G(),b=(null==T||null===(o=T.video)||void 0===o?void 0:o.metadata)||[],_=(null==b?void 0:b.length)&&b.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=_)&&void 0!==r&&r.length){var S=_.map(function(e){return e.value});_=null==S?void 0:S.join(",")}m.destroyComscoreTag();var O,P,D,A=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,L=Array.isArray(null==A?void 0:A.category)?null==A||null===(a=A.category)||void 0===a?void 0:a.join(","):(null==A?void 0:A.category)||null,k=Ne(Ne(Ne({},null==T?void 0:T.video),null==T?void 0:T.linearchannel),{},{siteName:(null==T?void 0:T.site)||null,programId:(null==A?void 0:A.videotmsid)||null,programTitle:(null==A?void 0:A.lcProgrammeName)||null,episodeId:(null==A?void 0:A.videotmsid)||null,seasonNumber:(null==T||null===(d=T.video)||void 0===d||null===(u=d.series)||void 0===u?void 0:u.seasonNumber)||(null==A||null===(s=A.seriesDetails)||void 0===s?void 0:s.season)||null,episodeNumber:(null==T||null===(c=T.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.episodeNumber)||(null==A||null===(p=A.seriesDetails)||void 0===p?void 0:p.episode)||null,episodeTitle:(null==A?void 0:A.lcSubTitle)||null,isCompleteEpisode:!!(null!=T&&null!==(f=T.video)&&void 0!==f&&f.series||null!=A&&null!==(g=A.seriesDetails)&&void 0!==g&&g.episode),genre:_||L,comscoreConfig:{implementationId:(null==e||null===(h=e.comscore)||void 0===h?void 0:h.implementationId)||null,projectId:(null==e||null===(y=e.comscore)||void 0===y?void 0:y.projectId)||null}});if(null!=k&&null!==(w=k.streamingInfo)&&void 0!==w&&w.isLiveStream?k.contentType="LIVE":k.contentType="LONG_FORM_ON_DEMAND",null==k||!k.network){var C,F=(null==k?void 0:k.metadata)||[],R=null==F||null===(C=F.find(function(e){return"network"===e.name}))||void 0===C?void 0:C.value;k.network=R||null}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===(P=O.gist)||void 0===P?void 0:P.title),"_").concat(k.genre)),null!=A&&A.airDate&&(k.publishDate=A.airDate),null!=k&&k.runtime&&"function"==typeof E.duration&&(k.runtime=1e3*Math.ceil(E.duration()));var j=m.formulateComscorePayload(k,E);console.log("comscoreOptions player data",j),m.createComscoreStreamingTag(Ne({playerName:"Video.js"},j)),m.setComscorePlayerInstance(E)}}function Ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function He(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ue(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function Ge(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return qe(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?qe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function qe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var Ye,Qe=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),ze=(Ye=null,{set:function(e){Ye=e},get position(){return Ye}});function Ke(e,n){return Xe.apply(this,arguments)}function Xe(){return(Xe=n(t.mark(function e(n,o){var r,l,a,d,u,s,c,m,p,f,g,h,y,w,I,E,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i.getPlayer(n),a=he(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(r=o[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=fe(s,n,o),c=$e(s),m=v(c,2),p=m[0],f=m[1],g=Je(f)||{},s=new URL(s.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach(function(e){var n=v(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(He({adsParams:He({},p)},g))});case 14:return h=e.sent,e.next=17,h.json();case 17:return y=e.sent,w="https://"+new URL(s).hostname,I=y.trackingUrl,E=y.manifestUrl,T=w+I,b=w+E,Qe.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 Je(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=v(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function $e(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ge((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=v(t.value,2),l=i[0],a=i[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){r.e(e)}finally{r.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var m=v(c[s],2),p=m[0],f=m[1];if(p.startsWith("ads."))d[p.replace(/^ads\./,"")]=f;else u[p]=f}return[d,u]}var Ze,en,nn,tn=new Map;function on(e,n){return rn.apply(this,arguments)}function rn(){return rn=n(t.mark(function e(o,r){var l,a,d,u,s,v,m,p,f,g,h,y,w,I,E,T,b,_,S,O,P,D,A,L,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,r,l,a){var d,u,s=i.getPlayer(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<A&&D.clear(),A=e;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[r])||void 0===u?void 0:u.adId)||c;Math.floor(s.currentTime());var m,p=Ge(t);try{var f=function(){var t,i,d,u=m.value,c=u.eventType,p=u.beaconUrls,f=u.startTimeInSeconds,g=u.startTime,h=u.durationInSeconds,y=f||0,w=p,I=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,E="".concat(y,"_").concat(c),T=tn.get("pod-".concat(l))||[];if(console.warn(e,y,"map:",c,"condition1:",e>=y,"map:",tn),e>=y&&!T.includes(E)){T.push(E),tn.set("pod-".concat(l),T);try{L(c,n,w,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,n)}if("breakEnd"==c){var b=ze.position;ze.set(null),setTimeout(function(){null!=b&&(s.currentTime(b),a())},500)}if("function"==typeof I)try{var _,S={eventType:c,startTimeInSeconds:f,startTime:g,durationInSeconds:h,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[r],adIndex:r};I({adsData:S}),Ve(o,S)}catch(e){console.error("Error when calling ads callback:",e)}var O=Me.get();if(O&&0!==Object.keys(O).length){var P=O.formulateComscoreAdPayload,A=O.startComscoreAdTracking,k=O.finishComscoreAdTracking,C=O.endComscoreAdTracking,F="".concat(y,"_").concat(v,"_").concat(c);if(!D.has(F))if(D.set(F,!0),"impression"===c){var R,j=Qe.get();A(P(He(He({},null==n||null===(R=n.ads)||void 0===R?void 0:R[r]),{},{trackingUrl:j})))}else"complete"===c?k():"breakEnd"===c&&C()}}};for(p.s();!(m=p.n()).done;)f()}catch(e){p.e(e)}finally{p.f()}}},L=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)})})},P=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},tn.clear(),ze.set(r),f=Qe.get(),(g=i.getPlayer(o)).one("loadeddata",function(){f&&O(f)}),h=new Map,y=new Map,w=-1,I=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,E=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,T=(null==g||null===(u=g.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,b=(null==g||null===(s=g.el())||void 0===s||null===(v=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,_=(null==g||null===(m=g.el())||void 0===m||null===(p=m.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,S=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(o);var r=[],i=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==i||null===(e=i.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return He(He({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},O=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,v,m,p,f,g,O,D,A,L,C,F,R,j,V,x,N,W,M,B;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",x),0===e.button&&R()},V=function(e){},j=function(){var e,n=g.currentTime(),t=null,o=Ge(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,h.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){g.currentTime(t+2.2)},100))},R=function(){var e,n=g.currentTime(),t=null,o=Ge(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,d=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>i)&&!h.has(i)||n>=i&&n<=d)&&(t=i,h.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){g.currentTime(t+.4)},100))},s=!1,e.next=7,fetch(n);case 7:return v=e.sent,e.next=10,v.json();case 10:m=e.sent,p=m.avails,f=[],g=i.getPlayer(o),O=g.controlBar.progressControl,D=O.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),p.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(s=!0),f.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:S(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&r&&(g.currentTime(r),j()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f,"function"==typeof(F=(null===(A=window)||void 0===A||null===(L=A.customData)||void 0===L||null===(C=L.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&F(f)),console.log(f,"data"),f.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=g.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",D.appendChild(i)}}),g._timeUpdateHandler&&g.off("timeupdate",g._timeUpdateHandler),g._timeUpdateHandler=i.throttle(function(){var e=g.currentTime();if(e!==w){w=e;for(var n=!1,t=function(){var t=f[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){var d;e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&h.set(r,!0),Pe.disable(),I&&I.classList.add("vjs-hidden"),b&&(b.style.pointerEvents="none",b.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,v=0,m=0;m<l.length;m++){var p,g=null==l||null===(p=l[m])||void 0===p?void 0:p.durationInSeconds;if(u<s+g){v=m;break}s+=g}l[v];var w=Math.max(0,i-u),S=Math.round(w);N.style.display="block",B.textContent="".concat(v+1," of ").concat(l.length," • ").concat(P(S));var D=[];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)});D.push.apply(D,c(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&D.push.apply(D,c(null==t?void 0:t.podSlotImpressionBeacon)),k(e,t,D,v,o,j),"break"}y.delete(r)},o=0;o<f.length;o++){if("break"===t())break}n||(N.style.display="none",O.el().classList.remove("hide-progress-bar"),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),I&&I.classList.remove("vjs-hidden"),b&&(b.style.pointerEvents="auto",b.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),Pe.enable())}},1e3),g.on("timeupdate",g._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Pe.enabled&&"ArrowRight"==e.key&&(R(),gn(o,10),e.stopPropagation())}),O.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",x))}),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()}),(N=document.createElement("div")).className="ssai-ad-container",(W=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",W.append(M),(B=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",N.append(W),N.append(B),g.el().appendChild(N);case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=new Map,A=-1;case 21:case"end":return e.stop()}},e)})),rn.apply(this,arguments)}function ln(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 an(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)?an(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function an(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 dn(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 un(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):dn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var sn={},cn=(null===(Ze=window)||void 0===Ze||null===(en=Ze.location)||void 0===en||null===(nn=en.search)||void 0===nn?void 0:nn.includes("debug=true"))||!1,vn=null;function mn(e){return pn.apply(this,arguments)}function pn(){return pn=n(t.mark(function e(o){var r,l,a,d,u,s,v,m,p,f,g,h,y,w,I,E,T,b,_,S,O,P,D,A,L,k,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,r,l){var a,d,u=i.getPlayer(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[r])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,m=ln(t);try{for(m.s();!(v=m.n()).done;){var p,f,g,h=v.value,y=h.eventType,w=h.beaconUrls,I=h.startTimeInSeconds,E=h.startTime,T=h.durationInSeconds,b=(h.eventId,I||s),_=w,S=(null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f||null===(g=f.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(y),P="pod-".concat(s);A.has(P)||A.set(P,new Set);var D=A.get(P);if(cn&&console.warn(e,b,"map:",y,"condition1:",e>=b,"map:",A),e>=b&&e<=b+L&&!D.has(O)){D.add(O);try{k(y,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof S)try{var C,F={eventType:y,startTimeInSeconds:I,startTime:E,durationInSeconds:T,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[r],adIndex:r};S({adsData:F}),Ve(o,F)}catch(e){console.error("Error when calling ads callback:",e)}var R=Me.get();if(R&&0!==Object.keys(R).length){var j=R.formulateComscoreAdPayload,V=R.startComscoreAdTracking,x=R.finishComscoreAdTracking,N=R.endComscoreAdTracking;if("impression"===y){var W,M=Qe.get();V(j(un(un({},null==n||null===(W=n.ads)||void 0===W?void 0:W[r]),{},{trackingUrl:M})))}else"complete"===y?x():"breakEnd"===y&&N()}}}}catch(e){m.e(e)}finally{m.f()}}},k=function(e,n,t,o){var r,i,l;"breakEnd"===e&&(null===(r=sn)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=sn)||void 0===i?void 0:i.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(cn&&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)})}))},g=function(){vn&&clearInterval(vn)},p=Qe.get(),(f=i.getPlayer(o)).one("loadeddata",function(){g(),vn=setInterval(function(){p&&!f.paused()&&D(p)},2e3)}),f.on("dispose",function(){g()}),h=new Map,y=new Map,w=-1,I=null,E=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,T=(null==f||null===(a=f.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,b=(null==f||null===(d=f.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==f||null===(u=f.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,S=(null==f||null===(v=f.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,O=!1,P=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(o);var r=[],i=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==i||null===(e=i.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return un(un({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},D=function(){var e=n(t.mark(function e(n){var r,l,a,d,u,s,v,m,p,f;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),I&&l.searchParams.append("nextToken",I),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,I=s,v=[],m=i.getPlayer(o),p=m.controlBar.progressControl,f=p.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){v.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:P(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),cn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",v),null!=v&&v.length&&(window.adsQueueList=v),v.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=m.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",f.appendChild(i)}}),m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=i.throttle(function(){var e=m.currentTime();if(e!==w){w=e;for(var n=function(){var n=v[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,l=o+r;if(e>=o-1.2&&e<=l+1.2){var a;O=!!(e>=o&&e<=l&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>l&&h.set(o,!0),Pe.disable(),E&&E.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")),p.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,m=0;m<i.length;m++){var f,g=null==i||null===(f=i[m])||void 0===f?void 0:f.durationInSeconds;if(d<u+g){s=m;break}u+=g}setTimeout(function(){sn.totalAds=null==i?void 0:i.length,sn.currentAdIndex=s},1e3);var w=[];return null==i||i.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});w.push.apply(w,c(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&w.push.apply(w,c(null==n?void 0:n.podSlotImpressionBeacon)),C(e,n,w,s),"break"}y.delete(o)},t=0;t<v.length;t++){if("break"===n())break}O||(sn={},p.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),E&&E.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Pe.enable())}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),A=new Map,L=2.5;case 22:case"end":return e.stop()}},e)})),pn.apply(this,arguments)}function fn(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 gn=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},hn=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},yn=function(e){return!!o.getPlayer("".concat(e))},wn=function(){var e=n(t.mark(function e(o,r){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,M();case 3:return a=e.sent,d=i.getPlayer(o),e.abrupt("return",new Promise(function(e,i){b(r,a).then(function(){var i=n(t.mark(function n(i){var a,u,s,c,v,m,p,f;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(m=null==i?void 0:i.data,window.sid=ee(),m.contentType="linearchannel",m.channelId=null==r?void 0:r.channelId,p=(null==m||null===(a=m.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(v=c.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,f=he(m,o),!p){n.next=11;break}return n.next=9,Ke(o,m);case 9:f=n.sent,l=!0;case 11:H(m),f&&l?(Tn(o,f),p&&mn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:m})})):(Me.get()&&0!==Object.keys(Me.get()).length&&Be({playerId:o,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:m}));case 13:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){i({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),In=function(){var e=n(t.mark(function e(o,r,l){var a,d,s,c,v,m,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return c=e.sent,(q()||null)&&Q(r),v=0,m=0,p=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(s=d.watchHistory)&&void 0!==s&&s.enable&&S(r,c).then(function(e){var n,t,o,r,i,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),v=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(m=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(p=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))}),e.abrupt("return",new Promise(function(e,l){T(r,c).then(function(){var r=n(t.mark(function n(r){var a,d,s,c,f,g,h,y,w,I,E,T,b,_,S,O,P,D,A,L,k,C,F,R,j,V,x,N,W,M,B,U,G,q,Y,Q,z,K;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(O=null==r?void 0:r.data,P=(null==O?void 0:O.contentType)||"video",D=(null==O||null===(a=O[P])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(s=d.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(f=c.adsConfig)||void 0===f?void 0:f.vodAdSticherProvider)||!1,A=(null==O||null===(g=O.video)||void 0===g||null===(h=g.streamingInfo)||void 0===h?void 0:h.isLiveStream)||!1,H(r.data),(L=(null==O||null===(y=O.ads)||void 0===y||null===(w=y.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(E=I.web)||void 0===E?void 0:E.active)&&(null==O||null===(T=O.ads)||void 0===T||null===(b=T.preRoll)||void 0===b||null===(_=b.adTags)||void 0===_||null===(S=_.web)||void 0===S?void 0:S.url))&&Se(o,L,O),k=he(O,o),!D){n.next=12;break}return n.next=11,Ke(o,O);case 11:k=n.sent;case 12:k?(U=(null==O||null===(C=O.video)||void 0===C||null===(F=C.gist)||void 0===F?void 0:F.videoImageUrl)||(null==O||null===(R=O.video)||void 0===R||null===(j=R.gist)||void 0===j||null===(V=j.imageGist)||void 0===V?void 0:V.r16x9),(G=i.getPlayer(o)).poster(U),Tn(o,k),D&&on(o,p),G.on("loadstart",function(){A&&e({status:!0,msg:"Video Loaded",response:O})}),G.on("loadeddata",function(){be(),e({status:!0,msg:"Video Loaded",response:O})}),G.one("play",function(){v&&!D&&m<95&&setTimeout(function(){G.currentTime(v)},0)}),G.one("error",function(){var e;l({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==O||null===(x=O.video)||void 0===x||null===(N=x.contentDetails)||void 0===N||null===(W=N.closedCaptions)||void 0===W?void 0:W.length)>0||(null==O||null===(M=O.video)||void 0===M||null===(B=M.closedCaptions)||void 0===B?void 0:B.length)>0?(K=(null==O||null===(Y=O.video)||void 0===Y||null===(Q=Y.contentDetails)||void 0===Q?void 0:Q.closedCaptions)||(null==O||null===(z=O.video)||void 0===z?void 0:z.closedCaptions),q=K.filter(function(e){return"VTT"===e.format}),u.addCaptions(o,q)):u.removeCaptions(o)):(Te(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){bn(e,o,l,r)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),En=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()},Tn=function(e,n){var t=i.getPlayer(e);t&&t.src(n)},bn=function(n,t,o,r){var i,l,a,d,u,s,c=null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);yn(t)&&Te(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?fn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):fn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))};exports.authenticateLC=wn,exports.baseUrlManager=P,exports.clearError=be,exports.comscoreInstanceManager=Me,exports.createIdxMapping=function(e){R=new Map,e.map(function(e,n){R.set(e.id,n)})},exports.createSeriesWatchMap=function(e,n){var t=new Map;O({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),j=t}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},exports.dispose=function(e){var n=i.getPlayer(e),t=(Me.get()||{}).destroyComscoreTag;if(En(),t&&t(),i.clearEventListeners(),window.onresize=null,n)n.dispose();else{var o=document.getElementById(e);o&&o.remove()}},exports.getCurrentSeries=q,exports.getCurrentVideo=G,exports.getDecodedToken=B,exports.getEntitlementData=function(e,n,t,o){var i,l;return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},exports.getEpisodeNumber=de,exports.getLinearChannelDetails=b,exports.getSGAIEnabledSource=Ke,exports.getSeasonNumber=ae,exports.getSeriesDetails=function(e,n){var t,o,i=B(n),l=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):r({url:P.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},exports.getSeriesWatchHistory=O,exports.getSeriesWatchMap=function(){return j},exports.getSource=he,exports.getSsaiEvents=function(e){var n=i.getPlayer(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(De,e)},adImpression:function(e){return t(Ae,e)},adFirstQuartile:function(e){return t(Le,e)},adMidpoint:function(e){return t(ke,e)},adThirdQuartile:function(e){return t(Ce,e)},adComplete:function(e){return t(Fe,e)},adBreakEnd:function(e){return t(Re,e)}}},exports.getToken=M,exports.getUpdatedClusterSource=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},exports.getUserId=ne,exports.getVideoDetails=T,exports.getVideoIdx=function(){return F},exports.getVideoInfo=S,exports.handleError=Te,exports.initialiseAdvertisement=Se,exports.initialiseComscoreStreamingTracking=Be,exports.initialiseKeyboardEvents=function(e,n){var t,o,r,l=i.getPlayer(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,i,u,s,c,v,m,p;if(Pe.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var f=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(f)&&(t.preventDefault(),null==d||d.focus()),f){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||hn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(u=i.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(p=m.adsConfig)&&void 0!==p&&p.vodAdClientSideTracking)return;g||gn(e,10)}}},!0)},exports.initiateErrorHandling=bn,exports.inititateBeacon=function(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){null!=n&&n.userId&&($=n.userId);var t=i.getPlayer(e);window.initialise(t,null==n?void 0:n.analyticsCb),window.firstFrame(t,null==n?void 0:n.analyticsCb,null==n?void 0:n.analyticsEventParams),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}},exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=yn,exports.isTokenExpired=D,exports.load=In,exports.loadVideo=Tn,exports.loadVideoInstantly=function(e,n,t){var o=i.getPlayer(e);return o.src(n),new Promise(function(e,n){var r=0;o.one("loadedmetadata",function(){clearTimeout(r),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){r=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=L,exports.rewind=hn,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],p("js",new Date),p("config",e)},exports.saveWatchHistory=_,exports.seasonIdxManager=z,exports.setCurrentSeries=function(e){k=e},exports.setCurrentVideo=H,exports.setVideoIdx=Y,exports.setVideoIdxById=Q,exports.setupAdvertisementMarkers=on,exports.setupAdvertisementMarkersForLinear=mn,exports.skip=gn,exports.token_authentication_enabled=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},exports.trackMap=tn,exports.videoReplayTracker=U;
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("axios"),i=require("./skin-c97f0eea.js"),l=require("./browser-77c57718.js"),a=require("md5"),d=require("js-cookie"),u=require("./captions-80f6eb66.js"),s=require("@babel/runtime/helpers/typeof"),c=require("@babel/runtime/helpers/toConsumableArray"),v=require("@babel/runtime/helpers/slicedToArray"),p=require("@viewlift/comscore/index.js");function m(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function f(e,n){m("event",e,n)}var g={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function y(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?h(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):h(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var w={name:"@viewlift/player",version:"2.1.32",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant"},dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/comscore":"^1.0.11",axios:"^1.2.3",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=w.version;var I,E=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":P.get()+"".concat(null==g?void 0:g.getVideoDetails)},T=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:E(),params:y({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":w.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},b=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:P.get()+g.getLinearChannelDetails,params:y(y(y(y(y({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},_=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,M();case 2:return o=e.sent,e.abrupt("return",r({url:P.get()+"".concat(null==g?void 0:g.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:y({},n),params:y({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),S=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:P.get()+"".concat(null==g?void 0:g.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},O=function(e){var n=e.videoId;return r({method:"GET",url:P.get()+"".concat(null==g?void 0:g.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},P=(I=null==g?void 0:g.apiBaseUrl,{set:function(e){e&&(I=e)},get:function(){return I}}),D=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},A=null;function L(){return{set:function(e){e&&(A=e)},get:function(){return A}}}var k,C,F,R,j,V,x,N=function(){var e=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),o=P.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),W=null,M=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"))||!D(n)){e.next=6;break}return W||(W=N().then(function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&L().set(i),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){W=null})),e.abrupt("return",W);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),B=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},U=(V=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;V.set(t,(V.get(t)||0)+1)},get:function(e){return V.get(e)},clear:function(){V.clear()}}),H=function(e){C=e},G=function(){return C},q=function(){return k},Y=function(e){F=e},Q=function(e){if(R){var n=R.get(e);Y(n+1)}},z=(x=0,{set:function(e){e>=0&&(x=e)},get:function(){return x}});function K(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 X(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?K(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):K(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var J=0,$=null,Z=function(){var e,n,t,o,r,i,l,a=G();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.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==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(r=a.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ne(){return $||window.sessionStorage.getItem("uid")}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,M();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(o=JSON.parse(atob(n.split(".")[1])))||!o.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==o?void 0:o.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function re(e){return e?String(e):""}window.initialise=function(e){window.sid=ee(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,o,r,i=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,f(i?"FAILED_TO_START":"DROPPED_STREAM",X({pfm:window.platform,uid:ne(),vid:Z(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:n===i?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n,t){e.one("play",tryCatch(function(){var o,r,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),f("PLAY",X({pfm:window.platform,uid:ne(),vid:Z(),videoPosition:Math.floor(e.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(i=r.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",X({"Video ID":Z(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var r,i,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&J<4)J++,f("BUFFERING",X({pfm:window.platform,uid:ne(),vid:Z(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,f("FIRST_FRAME",X({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:Z()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,r,i,l;f("AD_REQUEST",X({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:Z(),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}),f("AD_IMPRESSION",X({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Z()},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(J=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),r=0;r<o.length;r++){var i=o.start(r),l=o.end(r);if(ie(n,i,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ie=function(e,n,t){return e>=n&&e<=t},le=function(){var e,n=G(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};window.fireEvent=function(){var e=n(t.mark(function e(n){var o,i,l,a,d,u,s,c,v,p,m,f,h,y,w,I,E,T,b,_,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return E=e.sent,T=B(E),b=null==T?void 0:T.site,_=null==T?void 0:T.siteId,e.t0=X,e.t1=X,e.t2=X({aid:b,cid:_,pfm:window.platform},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=ne(),e.t5=Z(),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?re(n.adPosition):"",e.next=26,te();case 26: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!==(p=le())&&void 0!==p?p:null,e.t28=null!=b?b: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===(f=m.customData)||void 0===f||null===(h=f.beacon)||void 0===h?void 0:h.params,e.t33=(0,e.t0)(e.t31,e.t32),S=[e.t33],r({url:(null===(y=window)||void 0===y||null===(w=y.customData)||void 0===w||null===(I=w.beacon)||void 0===I?void 0:I.url)||P.get()+g.getBeaconUrl,method:"post",headers:{Authorization:E},contentType:"application/x-www-form-urlencoded",dataType:"text",data:S}).catch(function(e){console.error(e)});case 44: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 ae=function(){var e=z.get();return e>=0?e+1:1},de=function(){var e,n,t,o=q(),r=G(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=z.get(),a=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===i});return a>=0?a+1:1};function ue(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 se(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ue(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var ce=a,ve=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},pe=function(e){var n=me(e,"video.tags",[]),t=me(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},me=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},fe=function(){var e,n,t,o,r,l,a,u,s,c,v,p,m,f,g,h,y,w,I,E,T,b,_,S,O,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,A=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return P;var L=(null==A?void 0:A.siteName)||(null==A?void 0:A.site)||"",k=(null==A?void 0:A.contentType)||"video",C=(null==A||null===(t=A[k])||void 0===t?void 0:t.metadata)||(null==A||null===(o=A[k])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.metadata),F=i.getPlayer(D);if(!P.includes("VIEWLIFT_"))return P;var R,j=window.getComputedStyle(document.getElementById(D),null),V=Math.trunc(j.getPropertyValue("height").slice(0,-2)),x=Math.trunc(j.getPropertyValue("width").slice(0,-2)),N="linearchannel"===k?null==A||null===(l=A.linearchannel)||void 0===l||null===(a=l.channels)||void 0===a||null===(u=a.find(function(e){return(null==e?void 0:e.id)===(null==A?void 0:A.channelId)}))||void 0===u||null===(s=u.content)||void 0===s?void 0:s.id:me(A,"video.gist.id",""),W="linearchannel"===k?null==A||null===(c=A.linearchannel)||void 0===c||null===(v=c.channels)||void 0===v||null===(p=v.find(function(e){return(null==e?void 0:e.id)===(null==A?void 0:A.channelId)}))||void 0===p?void 0:p.title:me(A,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),M=null,B=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",function(e){M=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var U=d.get("us_privacy")||d.get("usprivacy"),H=void 0!==U?U:"1YNN",G=null!==(m=null===(f=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===f?void 0:f.fwIdentifier)&&void 0!==m?m:null,q=se(se({},ge(C)),{},{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:ve(x,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(g=window)||void 0===g?void 0:g.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:me(A,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:me(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:me(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==F||null===(h=F.options_)||void 0===h?void 0:h.autoplay)||1,VIEWLIFT_MUTE:(null==F||null===(y=F.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:pe(A),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(me(A,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+me(A,"video.gist.permalink","")),VIEWLIFT_CONSENT:d.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:me(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"==L||"usanetwork"==L?"":me(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(_=b.site)||void 0===_?void 0:_.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:G?ce(G):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*me(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:me(A,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:W,VIEWLIFT_CONTENT_SERIES_TITLE:me(A,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:me(A,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:de(),VIEWLIFT_SEASON_NUMBER:ae(),VIEWLIFT_CONTENT_TAGS:pe(A),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:M||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var Y in q){var Q=new RegExp(Y,"g");P=P.replace(Q,q[Y])}return P},ge=function(e){var n,t,o,r,i,a,d,u,s,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var p=(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,m=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return p||m?(l.isMobile()?p?c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||""}):m&&(c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||""})):p?c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||""}):m&&(c=se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||""})),p?c=se(se({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||""}):m&&(c=se(se({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||""})),c=l.isMobile()?se(se({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||""}):se(se({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||""})):(c=se(se({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||""}),c=l.isMobile()?se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||""}):se(se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||""})),c=se(se({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:me(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s?void 0:s.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},he=function(e,n){var t,o,r,i,a,d,u,s,c,v,p,m,f,g=(null==e?void 0:e.contentType)||"video",h=null==e||null===(t=e[g])||void 0===t?void 0:t.drmEnabled,y=null==e||null===(o=e[g])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,w=null==e||null===(i=e[g])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,I=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var E=(null==e||null===(p=e[g])||void 0===p||null===(m=p.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return we(w);if(h){var T=Ie(y,n);return T.src=fe(T.src,n,e),T}if("Safari"!==l.detectBrowser()&&E)return ye(y);if(I){var b=we(y);return b.src=fe(b.src,n,e),b}if(null!=y&&y.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(y);return _.src=fe(_.src,n,e),_}return null},ye=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},we=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ie=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,d=e.playReady,u=l.detectBrowser();if(i.getPlayer(n),"Safari"===u){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&i(e),i(null,t)})}}}}}(r);return Ee(n),s}var c,v={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(Ee(n),v.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==d?void 0:d.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==d?void 0:d.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==d?void 0:d.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==d?void 0:d.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==d?void 0:d.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var Ee=function(e){var n=i.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==l.detectBrowser()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Te=function(e,n){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},be=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var _e=!1,Se=function(e,n,t){var o=fe(n,e,t),r=i.getPlayer(e);if(n&&window.google){if("function"!=typeof r.ima&&"object"!==s(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,l=i.getPlayer(e);if(null!==l.el_){_e=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),_e&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};var Oe,Pe=(Oe=!0,{enable:function(){Oe=!0},disable:function(){Oe=!1},get enabled(){return Oe}}),De="ssai-breakStart",Ae="ssai-adImpression",Le="ssai-firstQuartile",ke="ssai-midpoint",Ce="ssai-thirdQuartile",Fe="ssai-complete",Re="ssai-breakEnd",je={breakStart:De,impression:Ae,firstQuartile:Le,midpoint:ke,thirdQuartile:Ce,complete:Fe,breakEnd:Re};function Ve(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i.getPlayer(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=je[o];r&&t.trigger(r,n)}function xe(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 Ne(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):xe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var We,Me=(We={},{get:function(){return We},set:function(e){We=e}});function Be(e,n){var t,o,r,l,a,d,u,s,c,v,m,f,g,h,y,w,I=null==e?void 0:e.playerId,E=i.getPlayer(I);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var T=G(),b=(null==T||null===(o=T.video)||void 0===o?void 0:o.metadata)||[],_=(null==b?void 0:b.length)&&b.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=_)&&void 0!==r&&r.length){var S=_.map(function(e){return e.value});_=null==S?void 0:S.join(",")}p.destroyComscoreTag();var O,P,D,A=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,L=Array.isArray(null==A?void 0:A.category)?null==A||null===(a=A.category)||void 0===a?void 0:a.join(","):(null==A?void 0:A.category)||null,k=Ne(Ne(Ne({},null==T?void 0:T.video),null==T?void 0:T.linearchannel),{},{siteName:(null==T?void 0:T.site)||null,programId:(null==A?void 0:A.videotmsid)||null,programTitle:(null==A?void 0:A.lcProgrammeName)||null,episodeId:(null==A?void 0:A.videotmsid)||null,seasonNumber:(null==T||null===(d=T.video)||void 0===d||null===(u=d.series)||void 0===u?void 0:u.seasonNumber)||(null==A||null===(s=A.seriesDetails)||void 0===s?void 0:s.season)||null,episodeNumber:(null==T||null===(c=T.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.episodeNumber)||(null==A||null===(m=A.seriesDetails)||void 0===m?void 0:m.episode)||null,episodeTitle:(null==A?void 0:A.lcSubTitle)||null,isCompleteEpisode:!!(null!=T&&null!==(f=T.video)&&void 0!==f&&f.series||null!=A&&null!==(g=A.seriesDetails)&&void 0!==g&&g.episode),genre:_||L,comscoreConfig:{implementationId:(null==e||null===(h=e.comscore)||void 0===h?void 0:h.implementationId)||null,projectId:(null==e||null===(y=e.comscore)||void 0===y?void 0:y.projectId)||null}});if(null!=k&&null!==(w=k.streamingInfo)&&void 0!==w&&w.isLiveStream?k.contentType="LIVE":k.contentType="LONG_FORM_ON_DEMAND",null==k||!k.network){var C,F=(null==k?void 0:k.metadata)||[],R=null==F||null===(C=F.find(function(e){return"network"===e.name}))||void 0===C?void 0:C.value;k.network=R||null}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===(P=O.gist)||void 0===P?void 0:P.title),"_").concat(k.genre)),null!=A&&A.airDate&&(k.publishDate=A.airDate),null!=k&&k.runtime&&"function"==typeof E.duration&&(k.runtime=1e3*Math.ceil(E.duration()));var j=p.formulateComscorePayload(k,E);console.log("comscoreOptions player data",j),p.createComscoreStreamingTag(Ne({playerName:"Video.js"},j)),p.setComscorePlayerInstance(E)}}function Ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function He(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ue(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function Ge(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return qe(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?qe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function qe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var Ye,Qe=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),ze=(Ye=null,{set:function(e){Ye=e},get position(){return Ye}});function Ke(e,n){return Xe.apply(this,arguments)}function Xe(){return(Xe=n(t.mark(function e(n,o){var r,l,a,d,u,s,c,p,m,f,g,h,y,w,I,E,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i.getPlayer(n),a=he(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(r=o[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=fe(s,n,o),c=$e(s),p=v(c,2),m=p[0],f=p[1],g=Je(f)||{},s=new URL(s.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach(function(e){var n=v(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(He({adsParams:He({},m)},g))});case 14:return h=e.sent,e.next=17,h.json();case 17:return y=e.sent,w="https://"+new URL(s).hostname,I=y.trackingUrl,E=y.manifestUrl,T=w+I,b=w+E,Qe.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 Je(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=v(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function $e(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ge((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=v(t.value,2),l=i[0],a=i[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){r.e(e)}finally{r.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var p=v(c[s],2),m=p[0],f=p[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=f;else u[m]=f}return[d,u]}var Ze,en,nn,tn=new Map;function on(e,n){return rn.apply(this,arguments)}function rn(){return rn=n(t.mark(function e(o,r){var l,a,d,u,s,v,p,m,f,g,h,y,w,I,E,T,b,_,S,O,P,D,A,L,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,r,l,a){var d,u,s=i.getPlayer(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<A&&D.clear(),A=e;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[r])||void 0===u?void 0:u.adId)||c;Math.floor(s.currentTime());var p,m=Ge(t);try{var f=function(){var t,i,d,u=p.value,c=u.eventType,m=u.beaconUrls,f=u.startTimeInSeconds,g=u.startTime,h=u.durationInSeconds,y=f||0,w=m,I=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,E="".concat(y,"_").concat(c),T=tn.get("pod-".concat(l))||[];if(console.warn(e,y,"map:",c,"condition1:",e>=y,"map:",tn),e>=y&&!T.includes(E)){T.push(E),tn.set("pod-".concat(l),T);try{L(c,n,w,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,n)}if("breakEnd"==c){var b=ze.position;ze.set(null),setTimeout(function(){null!=b&&(s.currentTime(b),a())},500)}if("function"==typeof I)try{var _,S={eventType:c,startTimeInSeconds:f,startTime:g,durationInSeconds:h,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[r],adIndex:r};I({adsData:S}),Ve(o,S)}catch(e){console.error("Error when calling ads callback:",e)}var O=Me.get();if(O&&0!==Object.keys(O).length){var P=O.formulateComscoreAdPayload,A=O.startComscoreAdTracking,k=O.finishComscoreAdTracking,C=O.endComscoreAdTracking,F="".concat(y,"_").concat(v,"_").concat(c);if(!D.has(F))if(D.set(F,!0),"impression"===c){var R,j=Qe.get();A(P(He(He({},null==n||null===(R=n.ads)||void 0===R?void 0:R[r]),{},{trackingUrl:j})))}else"complete"===c?k():"breakEnd"===c&&C()}}};for(m.s();!(p=m.n()).done;)f()}catch(e){m.e(e)}finally{m.f()}}},L=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)})})},P=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},tn.clear(),ze.set(r),f=Qe.get(),(g=i.getPlayer(o)).one("loadeddata",function(){f&&O(f)}),h=new Map,y=new Map,w=-1,I=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,E=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,T=(null==g||null===(u=g.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,b=(null==g||null===(s=g.el())||void 0===s||null===(v=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,_=(null==g||null===(p=g.el())||void 0===p||null===(m=p.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,S=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(o);var r=[],i=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==i||null===(e=i.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return He(He({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},O=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,v,p,m,f,g,O,D,A,L,C,F,R,j,V,x,N,W,M,B;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",x),0===e.button&&R()},V=function(e){},j=function(){var e,n=g.currentTime(),t=null,o=Ge(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,h.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){g.currentTime(t+2.2)},100))},R=function(){var e,n=g.currentTime(),t=null,o=Ge(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,d=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>i)&&!h.has(i)||n>=i&&n<=d)&&(t=i,h.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){g.currentTime(t+.4)},100))},s=!1,e.next=7,fetch(n);case 7:return v=e.sent,e.next=10,v.json();case 10:p=e.sent,m=p.avails,f=[],g=i.getPlayer(o),O=g.controlBar.progressControl,D=O.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),m.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),f.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:S(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&r&&(g.currentTime(r),j()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f,"function"==typeof(F=(null===(A=window)||void 0===A||null===(L=A.customData)||void 0===L||null===(C=L.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&F(f)),console.log(f,"data"),f.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=g.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",D.appendChild(i)}}),g._timeUpdateHandler&&g.off("timeupdate",g._timeUpdateHandler),g._timeUpdateHandler=i.throttle(function(){var e=g.currentTime();if(e!==w){w=e;for(var n=!1,t=function(){var t=f[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){var d;e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&h.set(r,!0),Pe.disable(),I&&I.classList.add("vjs-hidden"),b&&(b.style.pointerEvents="none",b.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,v=0,p=0;p<l.length;p++){var m,g=null==l||null===(m=l[p])||void 0===m?void 0:m.durationInSeconds;if(u<s+g){v=p;break}s+=g}l[v];var w=Math.max(0,i-u),S=Math.round(w);N.style.display="block",B.textContent="".concat(v+1," of ").concat(l.length," • ").concat(P(S));var D=[];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)});D.push.apply(D,c(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&D.push.apply(D,c(null==t?void 0:t.podSlotImpressionBeacon)),k(e,t,D,v,o,j),"break"}y.delete(r)},o=0;o<f.length;o++){if("break"===t())break}n||(N.style.display="none",O.el().classList.remove("hide-progress-bar"),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),I&&I.classList.remove("vjs-hidden"),b&&(b.style.pointerEvents="auto",b.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),Pe.enable())}},1e3),g.on("timeupdate",g._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Pe.enabled&&"ArrowRight"==e.key&&(R(),gn(o,10),e.stopPropagation())}),O.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",x))}),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()}),(N=document.createElement("div")).className="ssai-ad-container",(W=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",W.append(M),(B=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",N.append(W),N.append(B),g.el().appendChild(N);case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=new Map,A=-1;case 21:case"end":return e.stop()}},e)})),rn.apply(this,arguments)}function ln(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 an(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)?an(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function an(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 dn(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 un(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):dn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var sn={},cn=(null===(Ze=window)||void 0===Ze||null===(en=Ze.location)||void 0===en||null===(nn=en.search)||void 0===nn?void 0:nn.includes("debug=true"))||!1,vn=null;function pn(e){return mn.apply(this,arguments)}function mn(){return mn=n(t.mark(function e(o){var r,l,a,d,u,s,v,p,m,f,g,h,y,w,I,E,T,b,_,S,O,P,D,A,L,k,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,r,l){var a,d,u=i.getPlayer(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[r])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,p=ln(t);try{for(p.s();!(v=p.n()).done;){var m,f,g,h=v.value,y=h.eventType,w=h.beaconUrls,I=h.startTimeInSeconds,E=h.startTime,T=h.durationInSeconds,b=(h.eventId,I||s),_=w,S=(null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(g=f.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(y),P="pod-".concat(s);A.has(P)||A.set(P,new Set);var D=A.get(P);if(cn&&console.warn(e,b,"map:",y,"condition1:",e>=b,"map:",A),e>=b&&e<=b+L&&!D.has(O)){D.add(O);try{k(y,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof S)try{var C,F={eventType:y,startTimeInSeconds:I,startTime:E,durationInSeconds:T,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[r],adIndex:r};S({adsData:F}),Ve(o,F)}catch(e){console.error("Error when calling ads callback:",e)}var R=Me.get();if(R&&0!==Object.keys(R).length){var j=R.formulateComscoreAdPayload,V=R.startComscoreAdTracking,x=R.finishComscoreAdTracking,N=R.endComscoreAdTracking;if("impression"===y){var W,M=Qe.get();V(j(un(un({},null==n||null===(W=n.ads)||void 0===W?void 0:W[r]),{},{trackingUrl:M})))}else"complete"===y?x():"breakEnd"===y&&N()}}}}catch(e){p.e(e)}finally{p.f()}}},k=function(e,n,t,o){var r,i,l;"breakEnd"===e&&(null===(r=sn)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=sn)||void 0===i?void 0:i.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(cn&&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)})}))},g=function(){vn&&clearInterval(vn)},m=Qe.get(),(f=i.getPlayer(o)).one("loadeddata",function(){g(),vn=setInterval(function(){m&&!f.paused()&&D(m)},2e3)}),f.on("dispose",function(){g()}),h=new Map,y=new Map,w=-1,I=null,E=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,T=(null==f||null===(a=f.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,b=(null==f||null===(d=f.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==f||null===(u=f.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,S=(null==f||null===(v=f.el())||void 0===v||null===(p=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,O=!1,P=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(o);var r=[],i=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==i||null===(e=i.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return un(un({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},D=function(){var e=n(t.mark(function e(n){var r,l,a,d,u,s,v,p,m,f;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),I&&l.searchParams.append("nextToken",I),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,I=s,v=[],p=i.getPlayer(o),m=p.controlBar.progressControl,f=m.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){v.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:P(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),cn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",v),null!=v&&v.length&&(window.adsQueueList=v),v.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 r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",f.appendChild(i)}}),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=i.throttle(function(){var e=p.currentTime();if(e!==w){w=e;for(var n=function(){var n=v[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,l=o+r;if(e>=o-1.2&&e<=l+1.2){var a;O=!!(e>=o&&e<=l&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>l&&h.set(o,!0),Pe.disable(),E&&E.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")),m.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,p=0;p<i.length;p++){var f,g=null==i||null===(f=i[p])||void 0===f?void 0:f.durationInSeconds;if(d<u+g){s=p;break}u+=g}setTimeout(function(){sn.totalAds=null==i?void 0:i.length,sn.currentAdIndex=s},1e3);var w=[];return null==i||i.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});w.push.apply(w,c(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&w.push.apply(w,c(null==n?void 0:n.podSlotImpressionBeacon)),C(e,n,w,s),"break"}y.delete(o)},t=0;t<v.length;t++){if("break"===n())break}O||(sn={},m.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),E&&E.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Pe.enable())}},1e3),p.on("timeupdate",p._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),A=new Map,L=2.5;case 22:case"end":return e.stop()}},e)})),mn.apply(this,arguments)}function fn(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 gn=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},hn=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},yn=function(e){return!!o.getPlayer("".concat(e))},wn=function(){var e=n(t.mark(function e(o,r){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,M();case 3:return a=e.sent,d=i.getPlayer(o),e.abrupt("return",new Promise(function(e,i){b(r,a).then(function(){var i=n(t.mark(function n(i){var a,u,s,c,v,p,m,f;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(p=null==i?void 0:i.data,window.sid=ee(),p.contentType="linearchannel",p.channelId=null==r?void 0:r.channelId,m=(null==p||null===(a=p.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(v=c.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,f=he(p,o),!m){n.next=11;break}return n.next=9,Ke(o,p);case 9:f=n.sent,l=!0;case 11:H(p),f&&l?(Tn(o,f),m&&pn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:p})})):(Me.get()&&0!==Object.keys(Me.get()).length&&Be({playerId:o,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:p}));case 13:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){i({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),In=function(){var e=n(t.mark(function e(o,r,l){var a,d,s,c,v,p,m;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return c=e.sent,(q()||null)&&Q(r),v=0,p=0,m=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(s=d.watchHistory)&&void 0!==s&&s.enable&&S(r,c).then(function(e){var n,t,o,r,i,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),v=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(p=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(m=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))}),e.abrupt("return",new Promise(function(e,l){T(r,c).then(function(){var r=n(t.mark(function n(r){var a,d,s,c,f,g,h,y,w,I,E,T,b,_,S,O,P,D,A,L,k,C,F,R,j,V,x,N,W,M,B,U,G,q,Y,Q,z,K;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(O=null==r?void 0:r.data,P=(null==O?void 0:O.contentType)||"video",D=(null==O||null===(a=O[P])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(s=d.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(f=c.adsConfig)||void 0===f?void 0:f.vodAdSticherProvider)||!1,A=(null==O||null===(g=O.video)||void 0===g||null===(h=g.streamingInfo)||void 0===h?void 0:h.isLiveStream)||!1,H(r.data),(L=(null==O||null===(y=O.ads)||void 0===y||null===(w=y.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(E=I.web)||void 0===E?void 0:E.active)&&(null==O||null===(T=O.ads)||void 0===T||null===(b=T.preRoll)||void 0===b||null===(_=b.adTags)||void 0===_||null===(S=_.web)||void 0===S?void 0:S.url))&&Se(o,L,O),k=he(O,o),!D){n.next=12;break}return n.next=11,Ke(o,O);case 11:k=n.sent;case 12:k?(U=(null==O||null===(C=O.video)||void 0===C||null===(F=C.gist)||void 0===F?void 0:F.videoImageUrl)||(null==O||null===(R=O.video)||void 0===R||null===(j=R.gist)||void 0===j||null===(V=j.imageGist)||void 0===V?void 0:V.r16x9),(G=i.getPlayer(o)).poster(U),Tn(o,k),D&&on(o,m),G.on("loadstart",function(){A&&e({status:!0,msg:"Video Loaded",response:O})}),G.on("loadeddata",function(){be(),e({status:!0,msg:"Video Loaded",response:O})}),G.one("play",function(){v&&!D&&p<95&&setTimeout(function(){G.currentTime(v)},0)}),G.one("error",function(){var e;l({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==O||null===(x=O.video)||void 0===x||null===(N=x.contentDetails)||void 0===N||null===(W=N.closedCaptions)||void 0===W?void 0:W.length)>0||(null==O||null===(M=O.video)||void 0===M||null===(B=M.closedCaptions)||void 0===B?void 0:B.length)>0?(K=(null==O||null===(Y=O.video)||void 0===Y||null===(Q=Y.contentDetails)||void 0===Q?void 0:Q.closedCaptions)||(null==O||null===(z=O.video)||void 0===z?void 0:z.closedCaptions),q=K.filter(function(e){return"VTT"===e.format}),u.addCaptions(o,q)):u.removeCaptions(o)):(Te(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){bn(e,o,l,r)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),En=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()},Tn=function(e,n){var t=i.getPlayer(e);t&&t.src(n)},bn=function(n,t,o,r){var i,l,a,d,u,s,c=null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);yn(t)&&Te(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?fn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):fn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))};exports.authenticateLC=wn,exports.baseUrlManager=P,exports.clearError=be,exports.comscoreInstanceManager=Me,exports.createIdxMapping=function(e){R=new Map,e.map(function(e,n){R.set(e.id,n)})},exports.createSeriesWatchMap=function(e,n){var t=new Map;O({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),j=t}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},exports.dispose=function(e){var n=i.getPlayer(e),t=(Me.get()||{}).destroyComscoreTag;if(En(),t&&t(),i.clearEventListeners(),window.onresize=null,n)n.dispose();else{var o=document.getElementById(e);o&&o.remove()}},exports.getCurrentSeries=q,exports.getCurrentVideo=G,exports.getDecodedToken=B,exports.getEntitlementData=function(e,n,t,o){var i,l;return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},exports.getEpisodeNumber=de,exports.getLinearChannelDetails=b,exports.getSGAIEnabledSource=Ke,exports.getSeasonNumber=ae,exports.getSeriesDetails=function(e,n){var t,o,i=B(n),l=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):r({url:P.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},exports.getSeriesWatchHistory=O,exports.getSeriesWatchMap=function(){return j},exports.getSource=he,exports.getSsaiEvents=function(e){var n=i.getPlayer(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(De,e)},adImpression:function(e){return t(Ae,e)},adFirstQuartile:function(e){return t(Le,e)},adMidpoint:function(e){return t(ke,e)},adThirdQuartile:function(e){return t(Ce,e)},adComplete:function(e){return t(Fe,e)},adBreakEnd:function(e){return t(Re,e)}}},exports.getToken=M,exports.getUpdatedClusterSource=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},exports.getUserId=ne,exports.getVideoDetails=T,exports.getVideoIdx=function(){return F},exports.getVideoInfo=S,exports.handleError=Te,exports.initialiseAdvertisement=Se,exports.initialiseComscoreStreamingTracking=Be,exports.initialiseKeyboardEvents=function(e,n){var t,o,r,l=i.getPlayer(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,i,u,s,c,v,p,m;if(Pe.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var f=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(f)&&(t.preventDefault(),null==d||d.focus()),f){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||hn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(u=i.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(p=v.appcmsMain)&&void 0!==p&&null!==(m=p.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||gn(e,10)}}},!0)},exports.initiateErrorHandling=bn,exports.inititateBeacon=function(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){null!=n&&n.userId&&($=n.userId);var t=i.getPlayer(e);window.initialise(t,null==n?void 0:n.analyticsCb),window.firstFrame(t,null==n?void 0:n.analyticsCb,null==n?void 0:n.analyticsEventParams),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}},exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=yn,exports.isTokenExpired=D,exports.load=In,exports.loadVideo=Tn,exports.loadVideoInstantly=function(e,n,t){var o=i.getPlayer(e);return o.src(n),new Promise(function(e,n){var r=0;o.one("loadedmetadata",function(){clearTimeout(r),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){r=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=L,exports.rewind=hn,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)},exports.saveWatchHistory=_,exports.seasonIdxManager=z,exports.setCurrentSeries=function(e){k=e},exports.setCurrentVideo=H,exports.setUserId=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},exports.setVideoIdx=Y,exports.setVideoIdxById=Q,exports.setupAdvertisementMarkers=on,exports.setupAdvertisementMarkersForLinear=pn,exports.skip=gn,exports.token_authentication_enabled=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},exports.trackMap=tn,exports.videoReplayTracker=U;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./index-
|
|
1
|
+
"use strict";require("./index-91b0df2d.js");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("./skin-c97f0eea.js"),n=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/slicedToArray"),a=require("./generic-ab11c314.js");function u(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 o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s="my-player";function l(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 c(){return(c=e(t.mark(function e(r){var n,a,u,o,s,l,c,p,d,f,m,b,g,v,h,x,y,w,k,E,j,N,T,A;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,f=[],m=0;m<l;m++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,m*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),f.push({uri:v,duration:r.duration}),r._tiles=f;return e.abrupt("return",f);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=[],E=0;E<y*w;E++)k.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(T=N.appcmsMain)||void 0===T||null===(A=T.images)||void 0===A?void 0:A.placeholderCover,duration:r.duration});return e.abrupt("return",k);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function p(e,t){return d.apply(this,arguments)}function d(){return(d=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=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",l(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.getPlayer(s);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,l=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),p=t[l];p&&!p.loading&&(p.loading=!0,function(e){return c.apply(this,arguments)}(p).then(function(e){var t=e[p.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),p.loading=!1,p.src=t.uri}))}}function m(e){return b.apply(this,arguments)}function b(){return(b=e(t.mark(function e(a){var u,s,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},a.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),a=i(r,2),s=a[0]*a[1],l=e.duration,c=0;c<s;c++){var p,d=Math.round((t*s+c)*l);u[d]=o(o({},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)})}}),s=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r.throttle(function(e){return f(e,u,s)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r.throttle(function(e){return f(e,u,s)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var g=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 v(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function h(e,t){return x.apply(this,arguments)}function x(){return(x=e(t.mark(function e(n,u){var o,l,c,p,d,f,m,b,g,h,x,k,E,j,N,T,A,O,I,S,P,M,R,q,$,B,D,L,C,U,X,_,F,W,z,G,V,H,J,K,Q,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,fe,me;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=u,o=r.getPlayer(u),l=n.split("/"),c=l.findIndex(function(e){return"dash"===e.toLowerCase()}),p=v(-1!==c?l.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,h=new DOMParser,x=h.parseFromString(g,"application/xml"),k=(null==o?void 0:o.duration())||(null===(d=a.getCurrentVideo())||void 0===d||null===(f=d.video)||void 0===f?void 0:f.runtime),E=(null==x||null===(m=x.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||p+"/",j=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<j.length)){e.next=72;break}if(("image"!==(T=j[N]).getAttribute("contentType")||"image/png"!==T.getAttribute("mimeType"))&&"image/jpeg"!==T.getAttribute("mimeType")){e.next=69;break}if(O=T.getElementsByTagName("SegmentTemplate")[0],I=null===(A=O.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!O||!I){e.next=48;break}if(M=I.getElementsByTagName("S"),R=parseInt(null===(S=M[0])||void 0===S?void 0:S.getAttribute("t")),q=parseInt(null===(P=M[0])||void 0===P?void 0:P.getAttribute("d")),$=T.getElementsByTagName("Representation")[0],B=$.getElementsByTagName("EssentialProperty")[0],D=B.getAttribute("value"),L=null==D?void 0:D.split("x"),C=i(L,2),U=C[0],X=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?q/_:q)/(U*X),W=$.getAttribute("id"),z=Math.round(k/F),G=Math.ceil(z/(U*X)),V=O.getAttribute("media"),parseInt(O.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*q).replace("$RepresentationID$",W)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(Q=T.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],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=Q.getAttribute("id"),se=Math.round(k/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],fe=y(ce),N=0;N<le;N++)me=fe?w(fe,N+pe):ce,de.push({duration:ue,layout:Z,uri:E+me.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 y(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function w(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 k(){return(k=e(t.mark(function e(n){var i,a,u,o,s,l,c,d,f,b,v,x,y,w,k,E;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r.getPlayer(n),c=l.currentSource(),d=c.src,d=null!==(i=d)&&void 0!==i&&i.includes("blob")?null===(a=window)||void 0===a||null===(u=a.player)||void 0===u?void 0:u.getSource():d,null===(o=d)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,p(d,n);case 6:if(!((null==(f=e.sent)?void 0:f.length)>0)){e.next=17;break}return b=(null==f?void 0:f[0])||null,v=b.uri,x=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,g(x,v);case 12:return y=e.sent,e.next=15,m(y);case 15:w=e.sent,l.thumbnails(w);case 17:e.next=28;break;case 19:if(null===(s=d)||void 0===s||!s.includes("mpd")){e.next=28;break}return e.next=22,h(d,n);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,m(k);case 26:E=e.sent,l.thumbnails(E);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.initiateTrickplay=function(e){return k.apply(this,arguments)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t,n,o,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./skin-c97f0eea.js"),a=require("./generic-
|
|
1
|
+
"use strict";var e,t,n,o,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./skin-c97f0eea.js"),a=require("./generic-ab11c314.js"),r=require("./autoNextVideo-36253961.js"),d=require("./icons-eb807ef0.js"),s=require("@babel/runtime/helpers/typeof"),u=require("video.js"),c=[],v=!1,m=function(e,t){var n=l.getPlayer(e),o=Math.floor(n.currentTime());if(Math.floor(n.duration())!=o){n.pause(e);var i=a.getVideoIdx();r.switchToNext(i,e,c)}};e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===s(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},o=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},u.registerPlugin("thumbnails",function(i){var l,a,r,d,s,u,c,v;function m(){document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",m),v()}a=t({},e,i),d=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=d.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),l.appendChild(r),r.src=a[0].src,r.className="vjs-thumbnail",t(r.style,a[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),u=d.duration(),d.on("durationchange",function(e){u=d.duration()}),d.on("loadedmetadata",function(e){u=d.duration()}),(s=d.controlBar.progressControl).el().appendChild(l),c=function(e){var i,d,c,v,m,p,f,g,h,y;for(d in c=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=o(s.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),v=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,v-=o(s.el()).getBoundingClientRect().left+h,i=Math.floor((v-s.el().offsetLeft)/s.width()*u),a)i>d&&(c=Math.max(c,d));(m=a[c]).src&&r.src!=m.src&&(r.src=m.src),m.style&&r.style!=m.style&&t(r.style,m.style),v+(g=function(e,t){var o;return t?parseFloat(t):"auto"!==(o=n(e)("clip"))&&"inherit"!==o&&4===(o=o.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(o[1])-parseFloat(o[3]):0}(r,m.width||a[0].width)/2)>f?v-=v+g-f:v<g&&(v=g),l.style.left=v+"px"},s.on("mousemove",c),s.on("touchmove",c),s.on("pointerdown",function(e){document.addEventListener("pointermove",c),document.addEventListener("pointerup",m)}),v=function(e){l.style.left="-1000px"},s.on("mouseout",v),s.on("touchcancel",v),s.on("touchend",v),d.on("userinactive",v)}),exports.addNextEpPreview=function(e,t){var n;if(v=!1,null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var o;c=[];var r=a.getCurrentSeries();null==r||r.map(function(e){var t;return(t=c).push.apply(t,i(e.episodes))}),null==t||null===(o=t.series)||void 0===o||o.cb}else{var s,u;c=(null==t||null===(s=t.relatedVideos)||void 0===s?void 0:s.content)||[],null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var p=l.getPlayer(e);p.on("timeupdate",function(){var e,t;if(!v){var n=Math.floor(p.currentTime()),o=p.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&a.getVideoIdx()<=(null===(t=c)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}});var f,g=c.filter(function(e,t){return t==a.getVideoIdx()});if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,y,x,A,w,E,C,b,N,B,L,P;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var I=null===(y=document.getElementsByClassName("next-ep-title"))||void 0===y?void 0:y[0],j=null===(x=document.getElementsByClassName("next-ep-img"))||void 0===x?void 0:x[0],k=null===(A=document.getElementsByClassName("next-ep-content"))||void 0===A?void 0:A[0],T=null===(w=g[0])||void 0===w?void 0:w.title;(null===(E=T)||void 0===E?void 0:E.length)>60&&(T=T.substr(0,60)+"..."),I.textContent="".concat(T),j.src=(null===(C=g[0])||void 0===C||null===(b=C.gist)||void 0===b||null===(N=b.imageGist)||void 0===N?void 0:N.r16x9)||(null==g||null===(B=g[0])||void 0===B?void 0:B.img)||(null===(L=window)||void 0===L||null===(P=L.customData)||void 0===P?void 0:P.fallbackImage),k.onclick=function(){return m(e)}}else{var q,O,S,V,M,F,X,R,D=document.createElement("div");D.className="next-ep-preview",D.style.visibility="hidden",document.getElementById(e).append(D);var G=document.createElement("div");G.className="next-heading-wrapper";var H=document.createElement("div");H.className="next-ep-header",H.textContent="Next up";var Q=document.createElement("div");Q.className="next-ep-close",Q.onclick=function(){D.style.visibility="hidden",v=!0},Q.appendChild(l.parseSvgString(d.crossIconSvg())),G.append(H),G.append(Q);var U=null===(q=g[0])||void 0===q?void 0:q.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(O=g[0])||void 0===O||null===(S=O.gist)||void 0===S||null===(V=S.imageGist)||void 0===V?void 0:V.r16x9)||(null==g||null===(M=g[0])||void 0===M?void 0:M.img)||(null===(F=window)||void 0===F||null===(X=F.customData)||void 0===X?void 0:X.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(R=U)||void 0===R?void 0:R.length)>60&&(U=U.substr(0,60)+"..."),Y.textContent="".concat(U);var _=document.createElement("div");_.className="next-ep-content",_.append(W),_.append(Y),_.onclick=l.debounce(function(){null==D||D.remove(),v=!0,m(e)},400),D.append(G),D.append(_)}},exports.addTVProviderImage=function(e,t){var n=l.getPlayer(e),o=null==t?void 0:t.tvProviderLogoUrl;if(o){var i=document.createElement("div");i.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(o),a.alt="Provider Image",i.append(a),n.el().appendChild(i),n.on("useractive",function(){i.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||i.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"})}};
|