@viewlift/player-backup 2.0.258-backup → 2.0.260-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-1c6abafe.js → autoNextVideo-e42fc428.js} +1 -1
- package/cjs/bundle.css +500 -500
- package/cjs/{features-25da73a6.js → features-cd48b2b6.js} +1 -1
- package/cjs/{generic-939a3e97.js → generic-f04cb45e.js} +1 -1
- package/cjs/{index-04b27b15.js → index-1736603c.js} +1 -1
- package/cjs/{index-e4393a77.js → index-5bdf1cfd.js} +1 -1
- package/cjs/index-eafb9077.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-ee975960.js → multicamv2-4d7833f1.js} +1 -1
- package/cjs/{multicamv2-138af789.js → multicamv2-825cb17d.js} +1 -1
- package/cjs/{nextEpisodeButton-2ba4aa6f.js → nextEpisodeButton-056dd4d9.js} +1 -1
- package/cjs/{playlist-9710ef70.js → playlist-4932e799.js} +1 -1
- package/cjs/{series-602d1f2c.js → series-c3a14f61.js} +1 -1
- package/cjs/{series-v2-f67606dc.js → series-v2-1d193d93.js} +1 -1
- package/cjs/{series-v2-0fe2e1c3.js → series-v2-57b1c5b8.js} +1 -1
- package/cjs/{skin-7afce973.js → skin-066dceed.js} +1 -1
- package/cjs/{skin-46d92899.js → skin-3ea04cef.js} +1 -1
- package/cjs/{skin-56e72a1b.js → skin-77549792.js} +1 -1
- package/cjs/{skin-334830ee.js → skin-80fd2d0c.js} +1 -1
- package/cjs/{skin-f55aefe8.js → skin-969cc371.js} +1 -1
- package/cjs/{skin-cea29f97.js → skin-add44dae.js} +1 -1
- package/cjs/{skin-14f83052.js → skin-c1af6004.js} +1 -1
- package/cjs/{skin-5493ce5f.js → skin-cfc775a4.js} +1 -1
- package/cjs/{skin-08a270c1.js → skin-e54f3fd3.js} +1 -1
- package/cjs/{util-233dec09.js → util-7186e89f.js} +1 -1
- package/cjs/{videoSelector-dcbb1d54.js → videoSelector-5f1cf380.js} +1 -1
- package/cjs/{videoSelector-2d51c4d2.js → videoSelector-810471f8.js} +1 -1
- package/esm/{autoNextVideo-15f76d85.js → autoNextVideo-7323cf5f.js} +1 -1
- package/esm/bundle.css +500 -500
- package/esm/{features-ab6f492e.js → features-f634dd8c.js} +1 -1
- package/esm/{generic-2f9efcf1.js → generic-7505da7f.js} +1 -1
- package/esm/helpers/secondary-switching.d.ts +1 -1
- package/esm/{index-7304e60f.js → index-04f28499.js} +1 -1
- package/esm/index-3860a02a.js +1 -0
- package/esm/{index-b507b376.js → index-aee2840d.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-9166cf23.js → multicamv2-b2a07ed1.js} +1 -1
- package/esm/{multicamv2-a8db4d7f.js → multicamv2-d19801a7.js} +1 -1
- package/esm/{nextEpisodeButton-2a75ce5c.js → nextEpisodeButton-29cc11c2.js} +1 -1
- package/esm/{playlist-78ea48cc.js → playlist-2b356158.js} +1 -1
- package/esm/{series-c0b5c787.js → series-dee1a2af.js} +1 -1
- package/esm/{series-v2-8e5ff7c1.js → series-v2-b13de828.js} +1 -1
- package/esm/{series-v2-1263db01.js → series-v2-f7307228.js} +1 -1
- package/esm/skin-5a424471.js +1 -0
- package/esm/{skin-032174d9.js → skin-61229ce9.js} +1 -1
- package/esm/{skin-066d481a.js → skin-6cf385ed.js} +1 -1
- package/{cjs/skin-861125f0.js → esm/skin-8db4ed62.js} +1 -1
- package/esm/{skin-e9914c42.js → skin-a2b5e469.js} +1 -1
- package/esm/{skin-74d07b0b.js → skin-aeae977d.js} +1 -1
- package/esm/{skin-d8ab9efc.js → skin-b3357b0d.js} +1 -1
- package/esm/skin-d656e076.js +1 -0
- package/esm/{skin-01da91f0.js → skin-f21ef5ec.js} +1 -1
- package/esm/{util-5b3b1f9c.js → util-a420b997.js} +1 -1
- package/esm/utilities/managers.d.ts +4 -0
- package/esm/{videoSelector-c8e01367.js → videoSelector-0bea276f.js} +1 -1
- package/esm/{videoSelector-cf7538bf.js → videoSelector-40c30c18.js} +1 -1
- package/package.json +1 -1
- package/cjs/autoNextVideo-7423bae2.js +0 -1
- package/cjs/autoNextVideo-cb31894f.js +0 -1
- package/cjs/features-258a9a64.js +0 -1
- package/cjs/features-b6127bee.js +0 -1
- package/cjs/generic-29d5b2ec.js +0 -1
- package/cjs/generic-743174bb.js +0 -1
- package/cjs/index-20de6bc7.js +0 -1
- package/cjs/index-2b05c277.js +0 -1
- package/cjs/index-5b18b394.js +0 -1
- package/cjs/index-64db4d74.js +0 -1
- package/cjs/index-67289ebc.js +0 -1
- package/cjs/index-67e8cb8e.js +0 -1
- package/cjs/index-73a1b75f.js +0 -1
- package/cjs/index-8047cfe4.js +0 -1
- package/cjs/index-99c100ab.js +0 -1
- package/cjs/index-afff893e.js +0 -1
- package/cjs/index-c51fccda.js +0 -1
- package/cjs/index-e5d7c072.js +0 -1
- package/cjs/multicamv2-3f9ffd46.js +0 -1
- package/cjs/multicamv2-4a67a1c7.js +0 -1
- package/cjs/multicamv2-574b49ad.js +0 -1
- package/cjs/multicamv2-92e2b919.js +0 -1
- package/cjs/nextEpisodeButton-10a8c935.js +0 -1
- package/cjs/nextEpisodeButton-6aebdc8a.js +0 -1
- package/cjs/playlist-a6c55be5.js +0 -1
- package/cjs/playlist-d6f8e3b6.js +0 -1
- package/cjs/series-ab2fb794.js +0 -1
- package/cjs/series-c3138dfb.js +0 -1
- package/cjs/series-v2-04bb2f24.js +0 -1
- package/cjs/series-v2-3578532c.js +0 -1
- package/cjs/series-v2-693bc5cc.js +0 -1
- package/cjs/series-v2-8694c212.js +0 -1
- package/cjs/skin-02df14d4.js +0 -1
- package/cjs/skin-29a5361a.js +0 -1
- package/cjs/skin-31d84d3e.js +0 -1
- package/cjs/skin-3d6f28e9.js +0 -1
- package/cjs/skin-5e4b3ad1.js +0 -1
- package/cjs/skin-6e922e32.js +0 -1
- package/cjs/skin-7e40bdaa.js +0 -1
- package/cjs/skin-84cac674.js +0 -1
- package/cjs/skin-98b66c5d.js +0 -1
- package/cjs/skin-9d420b99.js +0 -1
- package/cjs/skin-ab226d57.js +0 -1
- package/cjs/skin-ae3ca001.js +0 -1
- package/cjs/skin-ae526505.js +0 -1
- package/cjs/skin-af838b06.js +0 -1
- package/cjs/skin-b671419f.js +0 -1
- package/cjs/skin-bac14ade.js +0 -1
- package/cjs/skin-bf73e43b.js +0 -1
- package/cjs/skin-c2d7c6d3.js +0 -1
- package/cjs/skin-cfa023f1.js +0 -1
- package/cjs/skin-d5a8b61b.js +0 -1
- package/cjs/skin-dbeec98f.js +0 -1
- package/cjs/skin-eac05283.js +0 -1
- package/cjs/util-4769ed5b.js +0 -1
- package/cjs/util-fbe3d806.js +0 -1
- package/cjs/videoSelector-29fbaa66.js +0 -1
- package/cjs/videoSelector-9d841083.js +0 -1
- package/cjs/videoSelector-a122278c.js +0 -1
- package/cjs/videoSelector-eddf015c.js +0 -1
- package/cjs/videojs-dash5.es-8bc4e9b4.js +0 -1
- package/cjs/videojs-dash5.es-f9629f7f.js +0 -1
- package/esm/autoNextVideo-281e802c.js +0 -1
- package/esm/autoNextVideo-f6a502c9.js +0 -1
- package/esm/features-c3e53ffd.js +0 -1
- package/esm/features-d7440f39.js +0 -1
- package/esm/generic-1697c09f.js +0 -1
- package/esm/generic-205dfe5c.js +0 -1
- package/esm/index-13b7c455.js +0 -1
- package/esm/index-1d1f438d.js +0 -1
- package/esm/index-403dd12e.js +0 -1
- package/esm/index-433697e2.js +0 -1
- package/esm/index-62e1ef44.js +0 -1
- package/esm/index-a3bbcba7.js +0 -1
- package/esm/index-c880c052.js +0 -1
- package/esm/index-cf927b34.js +0 -1
- package/esm/index-e1345c4e.js +0 -1
- package/esm/index-e796a94f.js +0 -1
- package/esm/index-ebda7269.js +0 -1
- package/esm/index-f2d0aa7c.js +0 -1
- package/esm/multicamv2-051519e5.js +0 -1
- package/esm/multicamv2-e247f9b6.js +0 -1
- package/esm/multicamv2-e85ff8d3.js +0 -1
- package/esm/multicamv2-f8c068cb.js +0 -1
- package/esm/nextEpisodeButton-a6ef9e2a.js +0 -1
- package/esm/nextEpisodeButton-e79ba9ea.js +0 -1
- package/esm/playlist-3b568899.js +0 -1
- package/esm/playlist-b9595b14.js +0 -1
- package/esm/series-9dcc32b9.js +0 -1
- package/esm/series-c73c97f1.js +0 -1
- package/esm/series-v2-10742435.js +0 -1
- package/esm/series-v2-52212b58.js +0 -1
- package/esm/series-v2-647dcbf9.js +0 -1
- package/esm/series-v2-b5cece98.js +0 -1
- package/esm/skin-017721f3.js +0 -1
- package/esm/skin-072ed58b.js +0 -1
- package/esm/skin-0ca780ee.js +0 -1
- package/esm/skin-0f0bb3f9.js +0 -1
- package/esm/skin-130e5b01.js +0 -1
- package/esm/skin-1629e49c.js +0 -1
- package/esm/skin-1a12c6ed.js +0 -1
- package/esm/skin-258904b8.js +0 -1
- package/esm/skin-35e4ade3.js +0 -1
- package/esm/skin-3628bdf0.js +0 -1
- package/esm/skin-3e6fd83b.js +0 -1
- package/esm/skin-4ad0fccc.js +0 -1
- package/esm/skin-4cc51263.js +0 -1
- package/esm/skin-508bd0e2.js +0 -1
- package/esm/skin-5ca6263c.js +0 -1
- package/esm/skin-7c5ac76d.js +0 -1
- package/esm/skin-b3e77849.js +0 -1
- package/esm/skin-b8e87cdb.js +0 -1
- package/esm/skin-c05be60d.js +0 -1
- package/esm/skin-c4422587.js +0 -1
- package/esm/skin-c906e1c0.js +0 -1
- package/esm/skin-cb4566f3.js +0 -1
- package/esm/skin-cc9878af.js +0 -1
- package/esm/skin-e8919754.js +0 -1
- package/esm/skin-f5b2d1cc.js +0 -1
- package/esm/skin-f9988297.js +0 -1
- package/esm/util-90b9fbc3.js +0 -1
- package/esm/util-b1ec6897.js +0 -1
- package/esm/videoSelector-0c6d2d43.js +0 -1
- package/esm/videoSelector-3c635dc2.js +0 -1
- package/esm/videoSelector-9d611c93.js +0 -1
- package/esm/videoSelector-b8f21092.js +0 -1
- package/esm/videojs-dash5.es-600b6231.js +0 -1
- package/esm/videojs-dash5.es-bc6f319d.js +0 -1
package/cjs/generic-29d5b2ec.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("axios"),i=require("./player_instance-fcf6a8fb.js"),l=require("md5"),a=require("js-cookie"),d=require("./currentVideoInfo-5802821b.js"),u=require("./captions-68e263dd.js"),s=require("@babel/runtime/helpers/typeof"),c=require("./skin-eeec7a85.js"),v=require("@babel/runtime/helpers/toConsumableArray"),f=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 g(e,n){p("event",e,n)}var h={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 y(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 w(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?y(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var E={name:"@viewlift/player",version:"2.1.23",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/sse":"^0.0.3","@viewlift/comscore":"^1.0.9",axios:"^1.2.3",md5:"^2.3.0","broadcast-channel":"^7.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","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=E.version;var I,T=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":A.get()+"".concat(null==h?void 0:h.getVideoDetails)},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:T(),params:w({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":E.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})},S=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:A.get()+h.getLinearChannelDetails,params:w(w(w(w(w({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,F();case 2:return o=e.sent,e.abrupt("return",r({url:A.get()+"".concat(null==h?void 0:h.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:w({},n),params:w({},(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)}}(),O=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:A.get()+"".concat(null==h?void 0:h.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})},P=function(e){var n=e.videoId;return r({method:"GET",url:A.get()+"".concat(null==h?void 0:h.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},A=(I=null==h?void 0:h.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},L=null;function k(){return{set:function(e){e&&(L=e)},get:function(){return L}}}var C=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=k().get(),o=A.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)}}(),R=null,F=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!D(n)){e.next=6;break}return R||(R=C().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&&k().set(i),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){R=null})),e.abrupt("return",R);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),j=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function V(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 N(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?V(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):V(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var x=0,W=null,M=!1,U=function(){var e,n,t,o,r,i,l,a=d.getCurrentVideo();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 B(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function H(){return G.apply(this,arguments)}function G(){return(G=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:if(n=e.sent,o=j(n),!(r=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",r);case 9:return r=B(),window.sessionStorage.setItem("uid",r),e.abrupt("return",r);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function q(){return Q.apply(this,arguments)}function Q(){return(Q=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Y(e){return e?String(e):""}window.initialise=function(e){window.sid=B(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e),z(e),K(e)};var z=function(e){e.on("play",function(){"pause"!==W||e.scrubbing()||(W="play",g("RESUME",{pfm:window.platform,uid:H(),vid:U(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"RESUME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))}),e.on("pause",function(){setTimeout(function(){M||(W="pause",g("PAUSE",{pfm:window.platform,uid:H(),vid:U(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"PAUSE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))},50)})},K=function(e){if(e){var n=0,t=0,o=0,r=0;e.on("timeupdate",i),e.on("seeking",function(){if(M)return;M=!0,e.off("timeupdate",i),e.one("seeked",l)}),e.on("seeked",l)}function i(){n=t,t=Math.floor(e.currentTime()),n<t&&(r=n,n=t)}function l(){var n,t;o=Math.floor(e.currentTime());var l=Math.floor(o-r);if(0!==l&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")){var a=l>0?"SEEK_FORWARD":"SEEK_BACKWARD";g(a,{pfm:window.platform,uid:H(),vid:U(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:a,videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}r=Math.floor(e.currentTime()),setTimeout(function(){M=!1},50),e.on("timeupdate",i)}};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,g(i?"FAILED_TO_START":"DROPPED_STREAM",N({pfm:window.platform,uid:H(),vid:U(),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),W="play",g("PLAY",N({pfm:window.platform,uid:H(),vid:U(),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",N({"Video ID":U(),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")&&x<4)x++,g("BUFFERING",N({pfm:window.platform,uid:H(),vid:U(),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,g("FIRST_FRAME",N({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:H(),vid:U()},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;g("AD_REQUEST",N({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:H(),vid:U(),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}),g("AD_IMPRESSION",N({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:H(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},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)&&(x=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(X(n,i,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var X=function(e,n,t){return e>=n&&e<=t},J=function(){var e,n=d.getCurrentVideo(),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,f,m,p,g,y,w,E,I,T,b,S,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return I=e.sent,T=j(I),b=null==T?void 0:T.site,S=null==T?void 0:T.siteId,e.t0=N,e.t1=N,e.t2=N({aid:b,cid:S,pfm:window.platform},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,H();case 12:return e.t4=e.sent,e.t5=U(),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?Y(n.adPosition):"",e.next=28,q();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(f=J())&&void 0!==f?f: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===(p=m.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),_=[e.t33],r({url:(null===(y=window)||void 0===y||null===(w=y.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||A.get()+h.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:_}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var $=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},Z=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},ee=function(){var e=d.seasonIdxManager.get();return e>=0?e+1:1},ne=function(){var e,n,t,o=d.getCurrentSeries(),r=d.getCurrentVideo(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=d.seasonIdxManager.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 te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function oe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?te(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):te(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var re=l,ie=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},le=function(e){var n=ae(e,"video.tags",[]),t=ae(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},ae=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},de=function(){var n,t,o,r,l,d,u,s,c,v,f,m,p,g,h,y,w,E,I,T,b,S,_,O,P,A,D=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,k=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return D;var C=(null==k?void 0:k.siteName)||(null==k?void 0:k.site)||"",R=(null==k?void 0:k.contentType)||"video",F=(null==k||null===(o=k[R])||void 0===o?void 0:o.metadata)||(null==k||null===(r=k[R])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),j=i.getPlayer(L);if(!D.includes("VIEWLIFT_"))return D;var V,N=window.getComputedStyle(document.getElementById(L),null),x=Math.trunc(N.getPropertyValue("height").slice(0,-2)),W=Math.trunc(N.getPropertyValue("width").slice(0,-2)),M="linearchannel"===R?null==k||null===(d=k.linearchannel)||void 0===d||null===(u=d.channels)||void 0===u||null===(s=u.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:ae(k,"video.gist.id",""),U="linearchannel"===R?null==k||null===(v=k.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(m=f.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===m?void 0:m.title:ae(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,H=null;"function"==typeof window.__gpp&&(null===(V=window)||void 0===V||V.__gpp("ping",function(e){B=null==e?void 0:e.gppString,H=null==e?void 0:e.sectionList[0]}));var G=a.get("us_privacy")||a.get("usprivacy"),q=void 0!==G?G:"1YNN",Q=null!==(p=null===(g=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===g?void 0:g.fwIdentifier)&&void 0!==p?p:null,Y=oe(oe({},ue(F)),{},(O={VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:x,VIEWLIFT_SIZE:ie(W,x),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===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ae(k,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==j||null===(y=j.options_)||void 0===y?void 0:y.autoplay)||1,VIEWLIFT_MUTE:(null==j||null===(w=j.options_)||void 0===w?void 0:w.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==C||"usanetwork"==C?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:le(k),VIEWLIFT_MEDIA_ID:M,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ae(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:M,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ae(k,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ae(null===(E=window)||void 0===E||null===(I=E.app_data)||void 0===I||null===(T=I.site)||void 0===T?void 0:T.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==C||"usanetwork"==C?"":ae(null===(b=window)||void 0===b||null===(S=b.app_data)||void 0===S||null===(_=S.site)||void 0===_?void 0:_.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:q,VIEWLIFT_TVE_PROVIDER:Q?re(Q):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:M,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:ae(k,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ae(k,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ne(),VIEWLIFT_SEASON_NUMBER:ee(),VIEWLIFT_CONTENT_TAGS:le(k),VIEWLIFT_GPP_SID:H||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(O,"VIEWLIFT_LAT",""),e(O,"VIEWLIFT_APP_BUNDLE",""),e(O,"VIEWLIFT_ATT_CONSENT",""),O),null===(P=window)||void 0===P||null===(A=P.customData)||void 0===A?void 0:A.macros);for(var z in Y){var K=new RegExp(z,"g");D=D.replace(K,Y[z])}return D},ue=function(e){var n,t,o,r,i,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(Z()?u?a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=oe(oe({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=oe(oe({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=Z()?oe(oe({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):oe(oe({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=oe(oe({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=Z()?oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=oe(oe({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:d.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},se=function(e,n){var t,o,r,i,l,a,d,u,s,c,v,f,m,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,h=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,y=null==e||null===(i=e[p])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.audioAssets,w=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[p])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(m=f.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=y&&y.hls)return ve(y);if(g){var I=fe(h,n);return I.src=de(I.src,n,e),I}if("Safari"!==$()&&E)return ce(h);if(w){var T=ve(h);return T.src=de(T.src,n,e),T}if(null!=h&&h.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(h);return b.src=de(b.src,n,e),b}return null},ce=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ve=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},fe=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=$();if(i.getPlayer(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&i(e),i(null,t)})}}}}}(r);return me(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(me(n),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var me=function(e){var n=i.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==$()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},pe=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)}}},ge=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var he=!1,ye=function(e,n,t){var o=de(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_){he=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),he&&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 we,Ee=(we=!0,{enable:function(){we=!0},disable:function(){we=!1},get enabled(){return we}}),Ie="ssai-breakStart",Te="ssai-adImpression",be="ssai-firstQuartile",Se="ssai-midpoint",_e="ssai-thirdQuartile",Oe="ssai-complete",Pe="ssai-breakEnd",Ae={breakStart:Ie,impression:Te,firstQuartile:be,midpoint:Se,thirdQuartile:_e,complete:Oe,breakEnd:Pe};function De(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=Ae[o];r&&t.trigger(r,n)}function Le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ke(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Le(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Ce,Re=(Ce=null,{get:function(){return Ce},set:function(e){Ce=e}});function Fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function je(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Fe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function Ve(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 Ne(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)?Ne(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 Ne(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 xe,We=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),Me=(xe=null,{set:function(e){xe=e},get position(){return xe}});function Ue(e,n){return Be.apply(this,arguments)}function Be(){return(Be=n(t.mark(function e(n,o){var r,l,a,d,u,s,c,v,m,p,g,h,y,w,E,I,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i.getPlayer(n),a=se(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=de(s,n,o),c=Ge(s),v=f(c,2),m=v[0],p=v[1],g=He(p)||{},s=new URL(s.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach(function(e){var n=f(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(je({adsParams:je({},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,E=y.trackingUrl,I=y.manifestUrl,T=w+E,b=w+I,We.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 He(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=f(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function Ge(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ve((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=f(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 v=f(c[s],2),m=v[0],p=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=p;else u[m]=p}return[d,u]}var qe,Qe,Ye,ze,Ke=(qe=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),qe=Array.isArray(e)?v(e):qe},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",qe),v(qe)}}),Xe=new Map;function Je(e,n){return $e.apply(this,arguments)}function $e(){return $e=n(t.mark(function e(o,r){var l,a,d,u,s,f,m,p,g,h,y,w,E,I,T,b,S,_,O,P,A,D,L,k,C,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:R=function(e,n,t,r,l,a){var d,u,s=i.getPlayer(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[r])||void 0===u?void 0:u.adId)||c;e<k&&L.clear(),k=e,Math.floor(s.currentTime());var f,m=Ve(t);try{var p=function(){var t,i,l,d=f.value,u=d.eventType,m=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,y=p||c,w=m,E=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(l=i.ads)||void 0===l?void 0:l.adEventHandler)||null,I="".concat(v,"_").concat(u),T="pod-".concat(c);Xe.has(T)||Xe.set(T,new Set);var b=Xe.get(T);if(console.warn(e,y,"map:",u,"condition1:",e>=y,"map:",Xe),e>=y&&e<=y+D){if(!b.has(I)){b.add(I);try{C(u,n,w,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var S=Me.position;Me.set(null),setTimeout(function(){null!=S&&(s.currentTime(S),a())},500)}if("function"==typeof E)try{var _,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[r],pod:n,adIndex:r};E({adsData:O}),De(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var P=Re.get();if(P&&0!==Object.keys(P).length){var A=P.formulateComscoreAdPayload,k=P.startComscoreAdTracking,R=P.finishComscoreAdTracking,F=P.endComscoreAdTracking,j="".concat(y,"_").concat(v,"_").concat(u);if(!L.has(j))if(L.set(j,!0),"impression"===u){var V,N=We.get();k(A(je(je({},null==n||null===(V=n.ads)||void 0===V?void 0:V[r]),{},{trackingUrl:N})))}else"complete"===u?R():"breakEnd"===u&&F()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},C=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Xe.clear(),Me.set(r),g=We.get(),(h=i.getPlayer(o)).one("loadeddata",function(){g&&P(g)}),y=new Map,w=new Map,E=-1,I=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==h||null===(d=h.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==h||null===(u=h.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==h||null===(s=h.el())||void 0===s||null===(f=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===f?void 0:f[0])||null,_=(null==h||null===(m=h.el())||void 0===m||null===(p=m.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return v(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 je(je({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},P=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,f,m,p,g,h,P,D,L,k,C,F,j,V,N,x,W,M,U,B;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e){document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",x),0===e.button&&j()},N=function(e){},V=function(){var e,n=h.currentTime(),t=null,o=Ve(g);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},j=function(){var e,n=h.currentTime(),t=null,o=Ve(g);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,d=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>i)&&!y.has(i)||n>=i&&n<=d)&&(t=i,y.set(i,!0),w.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){h.currentTime(t-.4)},100))},s=!1,e.next=7,fetch(n);case 7:return f=e.sent,e.next=10,f.json();case 10:m=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",m),p=m.avails,g=[],h=i.getPlayer(o),P=h.controlBar.progressControl,D=P.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),p.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(s=!0),g.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&r&&(h.currentTime(r),V()),null!=g&&g.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",g),window.adsQueueList=g,"function"==typeof(F=(null===(L=window)||void 0===L||null===(k=L.customData)||void 0===k||null===(C=k.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&(null==g?void 0:g.length)>0&&F(g)),console.log(g,"data"),g.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",D.appendChild(i)}}),h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=c.throttle(function(){var e=h.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=g[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-4&&e<=a+4){var d;e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&y.set(r,!0),Ee.disable(),I&&I.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),P.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,c=0,f=0;f<l.length;f++){var m,p=null==l||null===(m=l[f])||void 0===m?void 0:m.durationInSeconds;if(u<s+p){c=f;break}s+=p}l[c];var h=Math.max(0,i-u),E=Math.round(h);W.style.display="block",B.textContent="".concat(c+1," of ").concat(l.length," • ").concat(A(E));var O=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,v(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,v(null==t?void 0:t.podSlotImpressionBeacon)),R(e,t,O,c,0,V),"break"}w.delete(r)},o=0;o<g.length;o++){if("break"===t())break}n||(W.style.display="none",P.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),I&&I.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),Ee.enable())}},1e3),h.on("timeupdate",h._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Ee.enabled&&"ArrowRight"==e.key&&(j(),sn(o,10),e.stopPropagation())}),P.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",N),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()}),(W=document.createElement("div")).className="ssai-ad-container",(M=document.createElement("div")).className="sponsored-adbox",(U=document.createElement("div")).className="sponsored-text",U.textContent="Sponsored Ad",M.append(U),(B=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",W.append(M),W.append(B),h.el().appendChild(W);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=1.5,L=new Map,k=-1;case 21:case"end":return e.stop()}},e)})),$e.apply(this,arguments)}function Ze(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 en(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)?en(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 en(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 nn(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 tn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):nn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var on={},rn=(null===(Qe=window)||void 0===Qe||null===(Ye=Qe.location)||void 0===Ye||null===(ze=Ye.search)||void 0===ze?void 0:ze.includes("debug=true"))||!1,ln=null;function an(e){return dn.apply(this,arguments)}function dn(){return dn=n(t.mark(function e(o){var r,l,a,d,u,s,f,m,p,g,h,y,w,E,I,T,b,S,_,O,P,A,D,L,k,C,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:R=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,f=Ze(t);try{for(f.s();!(v=f.n()).done;){var m,p,g,h=v.value,y=h.eventType,w=h.beaconUrls,E=h.startTimeInSeconds,I=h.startTime,T=h.durationInSeconds,b=(h.eventId,E||s),S=w,_=(null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(y),P="pod-".concat(s);L.has(P)||L.set(P,new Set);var A=L.get(P);if(rn&&console.warn(e,b,"map:",y,"condition1:",e>=b,"map:",L),e>=b&&e<=b+k&&!A.has(O)){A.add(O);try{C(y,n,S,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof _)try{var D,R={eventType:y,startTimeInSeconds:E,startTime:I,durationInSeconds:T,ad:null==n||null===(D=n.ads)||void 0===D?void 0:D[r],pod:n,adIndex:r};_({adsData:R}),De(o,R)}catch(e){console.error("Error when calling ads callback:",e)}var F=Re.get();if(F&&0!==Object.keys(F).length){var j=F.formulateComscoreAdPayload,V=F.startComscoreAdTracking,N=F.finishComscoreAdTracking,x=F.endComscoreAdTracking;if("impression"===y){var W,M=We.get();V(j(tn(tn({},null==n||null===(W=n.ads)||void 0===W?void 0:W[r]),{},{trackingUrl:M})))}else"complete"===y?N():"breakEnd"===y&&x()}}}}catch(e){f.e(e)}finally{f.f()}}},C=function(e,n,t,o){var r,i,l;"breakEnd"===e&&(null===(r=on)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=on)||void 0===i?void 0:i.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(rn&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},h=function(){ln&&clearInterval(ln)},p=We.get(),(g=i.getPlayer(o)).one("loadeddata",function(){h(),ln=setInterval(function(){p&&!g.paused()&&D(p)},2e3)}),g.on("dispose",function(){h()}),y=new Map,w=new Map,E=-1,I=null,T=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==g||null===(a=g.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==g||null===(u=g.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==g||null===(f=g.el())||void 0===f||null===(m=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,P=!1,A=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return v(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 tn(tn({},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,f,m,p,g,h,D,L,k;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,f=[],m=i.getPlayer(o),p=m.controlBar.progressControl,g=p.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){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:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),rn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),null!=f&&f.length&&(window.adsQueueList=f,"function"==typeof(k=(null===(h=window)||void 0===h||null===(D=h.customData)||void 0===D||null===(L=D.ads)||void 0===L?void 0:L.onAdBreaksLoaded)||null)&&(null==f?void 0:f.length)>0&&k(f)),f.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",g.appendChild(i)}}),m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=c.throttle(function(){var e=m.currentTime();if(e!==E){E=e;for(var n=function(){var n=f[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,l=o+r;if(e>=o-1.2&&e<=l+1.2){var a;P=!!(e>=o&&e<=l&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>l&&y.set(o,!0),Ee.disable(),T&&T.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),p.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,c=0;c<i.length;c++){var m,g=null==i||null===(m=i[c])||void 0===m?void 0:m.durationInSeconds;if(d<u+g){s=c;break}u+=g}setTimeout(function(){on.totalAds=null==i?void 0:i.length,on.currentAdIndex=s},1e3);var h=[];return null==i||i.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});h.push.apply(h,v(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&h.push.apply(h,v(null==n?void 0:n.podSlotImpressionBeacon)),R(e,n,h,s),"break"}w.delete(o)},t=0;t<f.length;t++){if("break"===n())break}P||(on={},p.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Ee.enable())}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),dn.apply(this,arguments)}function un(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 sn=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},cn=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},vn=function(e){return!!o.getPlayer("".concat(e))},fn=function(){var e=n(t.mark(function e(o,r){var l,a,u,s=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=s.length>2&&void 0!==s[2]&&s[2],e.next=3,F();case 3:return a=e.sent,u=i.getPlayer(o),e.abrupt("return",new Promise(function(e,i){var s=(null==r?void 0:r.programs)||[];null==r||delete r.programs,S(r,a).then(function(){var i=n(t.mark(function n(i){var a,c,v,f,m,p,g,h;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null==i?void 0:i.data,window.sid=B(),a.contentType="linearchannel",a.channelId=null==r?void 0:r.channelId,d.setCurrentVideo(a),d.setCurrentEpgPrograms(s),!l){n.next=16;break}if(g=(null==a||null===(c=a.linearchannel)||void 0===c?void 0:c.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(v=window)||void 0===v||null===(f=v.app_data)||void 0===f||null===(m=f.appcmsMain)||void 0===m||null===(p=m.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,h=se(a,o),!g){n.next=13;break}return n.next=12,Ue(o,a);case 12:h=n.sent;case 13:h&&(gn(o,h),g&&an(o),u.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:a});case 17:case"end":return n.stop()}},n)}));return function(e){return 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)}}(),mn=function(){var e=n(t.mark(function e(o,r,l){var a,s,c,v,f,m,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return v=e.sent,(d.getCurrentSeries()||null)&&d.setVideoIdxById(r),f=0,m=0,p=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(c=s.watchHistory)&&void 0!==c&&c.enable&&O(r,v).then(function(e){var n,t,o,r,i,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),f=(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){b(r,v).then(function(){var r=n(t.mark(function n(r){var a,s,c,v,g,h,y,w,E,I,T,b,S,_,O,P,A,D,L,k,C,R,F,j,V,N,x,W,M,U,B,H,G,q,Q,Y,z,K;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(P=null==r?void 0:r.data,A=(null==P?void 0:P.contentType)||"video",D=(null==P||null===(a=P[A])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v||null===(g=v.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,L=(null==P||null===(h=P.video)||void 0===h||null===(y=h.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,d.setCurrentVideo(r.data),(k=(null==P||null===(w=P.ads)||void 0===w||null===(E=w.preRoll)||void 0===E||null===(I=E.adTags)||void 0===I||null===(T=I.web)||void 0===T?void 0:T.active)&&(null==P||null===(b=P.ads)||void 0===b||null===(S=b.preRoll)||void 0===S||null===(_=S.adTags)||void 0===_||null===(O=_.web)||void 0===O?void 0:O.url))&&ye(o,k,P),C=se(P,o),!D){n.next=12;break}return n.next=11,Ue(o,P);case 11:C=n.sent;case 12:C?(H=(null==P||null===(R=P.video)||void 0===R||null===(F=R.gist)||void 0===F?void 0:F.videoImageUrl)||(null==P||null===(j=P.video)||void 0===j||null===(V=j.gist)||void 0===V||null===(N=V.imageGist)||void 0===N?void 0:N.r16x9),(G=i.getPlayer(o)).poster(H),gn(o,C),D&&Je(o,p),G.on("loadstart",function(){L&&e({status:!0,msg:"Video Loaded",response:P})}),G.on("loadeddata",function(){ge(),e({status:!0,msg:"Video Loaded",response:P})}),G.one("play",function(){f&&!D&&m<95&&setTimeout(function(){G.currentTime(f)},0)}),G.one("error",function(){var e;l({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==P||null===(x=P.video)||void 0===x||null===(W=x.contentDetails)||void 0===W||null===(M=W.closedCaptions)||void 0===M?void 0:M.length)>0||(null==P||null===(U=P.video)||void 0===U||null===(B=U.closedCaptions)||void 0===B?void 0:B.length)>0?(K=(null==P||null===(Q=P.video)||void 0===Q||null===(Y=Q.contentDetails)||void 0===Y?void 0:Y.closedCaptions)||(null==P||null===(z=P.video)||void 0===z?void 0:z.closedCaptions),q=K.filter(function(e){return"VTT"===e.format}),u.addCaptions(o,q)):u.removeCaptions(o)):(pe(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){hn(e,o,l,r)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),pn=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()},gn=function(e,n){var t=i.getPlayer(e);t&&t.src(n)},hn=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);vn(t)&&pe(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?un(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):un(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))};exports.adsQueuePointManager=Ke,exports.authenticateLC=fn,exports.baseUrlManager=A,exports.clearError=ge,exports.comscoreInstanceManager=Re,exports.createSeriesWatchMap=function(e,n){var t=new Map;P({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),d.setSeriesWatchMap(t)}).catch(function(e){return console.log(e)})},exports.detectBrowser=$,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=(Re.get()||{}).destroyComscoreTag,t=i.getPlayer(e);if(pn(),"function"==typeof n&&n(),c.clearEventListeners(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},exports.getDecodedToken=j,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=ne,exports.getLinearChannelDetails=S,exports.getSGAIEnabledSource=Ue,exports.getSeasonNumber=ee,exports.getSeriesDetails=function(e,n){var t,o,i=j(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:A.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},exports.getSeriesWatchHistory=P,exports.getSource=se,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(Ie,e)},adImpression:function(e){return t(Te,e)},adFirstQuartile:function(e){return t(be,e)},adMidpoint:function(e){return t(Se,e)},adThirdQuartile:function(e){return t(_e,e)},adComplete:function(e){return t(Oe,e)},adBreakEnd:function(e){return t(Pe,e)}}},exports.getToken=F,exports.getUpdatedClusterSource=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},exports.getUserId=H,exports.getVideoDetails=b,exports.getVideoInfo=O,exports.handleError=pe,exports.initialiseAdvertisement=ye,exports.initialiseComscoreStreamingTracking=function(e,n){var t,o,r,l,a,u,s,c,v,f,p,g,h,y,w,E,I=null==e?void 0:e.playerId,T=i.getPlayer(I);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var b=d.getCurrentVideo(),S=(null==b||null===(o=b.video)||void 0===o?void 0:o.metadata)||[],_=(null==S?void 0:S.length)&&S.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=_)&&void 0!==r&&r.length){var O=_.map(function(e){return e.value});_=null==O?void 0:O.join(",")}m.destroyComscoreTag();var P,A,D,L=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,k=Array.isArray(null==L?void 0:L.category)?null==L||null===(a=L.category)||void 0===a?void 0:a.join(","):(null==L?void 0:L.category)||null,C=ke(ke(ke({},null==b?void 0:b.video),null==b?void 0:b.linearchannel),{},{siteName:(null==b?void 0:b.site)||null,programId:(null==L?void 0:L.videotmsid)||null,programTitle:(null==L?void 0:L.lcProgrammeName)||null,episodeId:(null==L?void 0:L.videotmsid)||null,seasonNumber:(null==b||null===(u=b.video)||void 0===u||null===(s=u.series)||void 0===s?void 0:s.seasonNumber)||(null==L||null===(c=L.seriesDetails)||void 0===c?void 0:c.season)||null,episodeNumber:(null==b||null===(v=b.video)||void 0===v||null===(f=v.series)||void 0===f?void 0:f.episodeNumber)||(null==L||null===(p=L.seriesDetails)||void 0===p?void 0:p.episode)||null,episodeTitle:(null==L?void 0:L.lcSubTitle)||null,isCompleteEpisode:!!(null!=b&&null!==(g=b.video)&&void 0!==g&&g.series||null!=L&&null!==(h=L.seriesDetails)&&void 0!==h&&h.episode),genre:_||k,comscoreConfig:{implementationId:(null==e||null===(y=e.comscore)||void 0===y?void 0:y.implementationId)||null,projectId:(null==e||null===(w=e.comscore)||void 0===w?void 0:w.projectId)||null}});if(null!=C&&null!==(E=C.streamingInfo)&&void 0!==E&&E.isLiveStream?C.contentType="LIVE":C.contentType="LONG_FORM_ON_DEMAND",null==C||!C.network){var R,F=(null==C?void 0:C.metadata)||[],j=null==F||null===(R=F.find(function(e){return"network"===e.name}))||void 0===R?void 0:R.value;C.network=j||null}null!=C&&C.network&&null!=C&&C.genre&&(C.customGenre="".concat(C.network,"_").concat((null==C?void 0:C.programTitle)||(P=C,null!=P&&P.series?null==P||null===(D=P.series)||void 0===D?void 0:D.title:null==P||null===(A=P.gist)||void 0===A?void 0:A.title),"_").concat(C.genre)),null!=L&&L.airDate&&(C.publishDate=L.airDate),null!=C&&C.runtime&&(C.runtime=1e3*((null==C?void 0:C.runtime)||0));var V=m.formulateComscorePayload(C,T);console.log("comscoreOptions player data",V),m.createComscoreStreamingTag(ke({playerName:"Video.js"},V)),m.setComscorePlayerInstance(T)}},exports.initialiseKeyboardEvents=function(e,n){var t,o,r,l=i.getPlayer(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,i,u,s,c,v,f,m;if(Ee.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||cn(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!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||sn(e,10)}}},!0)},exports.initiateErrorHandling=hn,exports.inititateBeacon=function(e,n,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var o=i.getPlayer(e);window.initialise(o,n),window.firstFrame(o,n,t),o.on("loadedmetadata",function(){window.endFirstFrame(o)})}},exports.isBehindLive=function(e){var n,t=i.getPlayer(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null},exports.isMobile=Z,exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=vn,exports.isTokenExpired=D,exports.load=mn,exports.loadVideo=gn,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=k,exports.rewind=cn,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],p("js",new Date),p("config",e)},exports.saveWatchHistory=_,exports.setupAdvertisementMarkers=Je,exports.setupAdvertisementMarkersForLinear=an,exports.skip=sn,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=Xe;
|
package/cjs/generic-743174bb.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("axios"),i=require("./player_instance-fcf6a8fb.js"),l=require("md5"),a=require("js-cookie"),d=require("./currentVideoInfo-5802821b.js"),u=require("./captions-68e263dd.js"),s=require("@babel/runtime/helpers/typeof"),c=require("./skin-eeec7a85.js"),v=require("@babel/runtime/helpers/toConsumableArray"),f=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 g(e,n){p("event",e,n)}var h={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 y(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 w(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?y(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var E={name:"@viewlift/player",version:"2.1.23",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/sse":"^0.0.3","@viewlift/comscore":"^1.0.8",axios:"^1.2.3",md5:"^2.3.0","broadcast-channel":"^7.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","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=E.version;var I,T=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":A.get()+"".concat(null==h?void 0:h.getVideoDetails)},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:T(),params:w({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":E.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})},S=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:A.get()+h.getLinearChannelDetails,params:w(w(w(w(w({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,F();case 2:return o=e.sent,e.abrupt("return",r({url:A.get()+"".concat(null==h?void 0:h.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:w({},n),params:w({},(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)}}(),O=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:A.get()+"".concat(null==h?void 0:h.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})},P=function(e){var n=e.videoId;return r({method:"GET",url:A.get()+"".concat(null==h?void 0:h.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},A=(I=null==h?void 0:h.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},L=null;function k(){return{set:function(e){e&&(L=e)},get:function(){return L}}}var C=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=k().get(),o=A.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)}}(),R=null,F=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!D(n)){e.next=6;break}return R||(R=C().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&&k().set(i),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){R=null})),e.abrupt("return",R);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),j=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function V(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 N(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?V(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):V(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var x=0,W=null,M=!1,U=function(){var e,n,t,o,r,i,l,a=d.getCurrentVideo();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 B(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function H(){return G.apply(this,arguments)}function G(){return(G=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:if(n=e.sent,o=j(n),!(r=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",r);case 9:return r=B(),window.sessionStorage.setItem("uid",r),e.abrupt("return",r);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function q(){return Q.apply(this,arguments)}function Q(){return(Q=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Y(e){return e?String(e):""}window.initialise=function(e){window.sid=B(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e),z(e),K(e)};var z=function(e){e.on("play",function(){"pause"!==W||e.scrubbing()||(W="play",g("RESUME",{pfm:window.platform,uid:H(),vid:U(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"RESUME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))}),e.on("pause",function(){setTimeout(function(){M||(W="pause",g("PAUSE",{pfm:window.platform,uid:H(),vid:U(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"PAUSE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))},50)})},K=function(e){if(e){var n=0,t=0,o=0,r=0;e.on("timeupdate",i),e.on("seeking",function(){if(M)return;M=!0,e.off("timeupdate",i),e.one("seeked",l)}),e.on("seeked",l)}function i(){n=t,t=Math.floor(e.currentTime()),n<t&&(r=n,n=t)}function l(){var n,t;o=Math.floor(e.currentTime());var l=Math.floor(o-r);if(0!==l&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")){var a=l>0?"SEEK_FORWARD":"SEEK_BACKWARD";g(a,{pfm:window.platform,uid:H(),vid:U(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:a,videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}r=Math.floor(e.currentTime()),setTimeout(function(){M=!1},50),e.on("timeupdate",i)}};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,g(i?"FAILED_TO_START":"DROPPED_STREAM",N({pfm:window.platform,uid:H(),vid:U(),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),W="play",g("PLAY",N({pfm:window.platform,uid:H(),vid:U(),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",N({"Video ID":U(),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")&&x<4)x++,g("BUFFERING",N({pfm:window.platform,uid:H(),vid:U(),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,g("FIRST_FRAME",N({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:H(),vid:U()},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;g("AD_REQUEST",N({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:H(),vid:U(),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}),g("AD_IMPRESSION",N({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:H(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},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)&&(x=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(X(n,i,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var X=function(e,n,t){return e>=n&&e<=t},J=function(){var e,n=d.getCurrentVideo(),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,f,m,p,g,y,w,E,I,T,b,S,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return I=e.sent,T=j(I),b=null==T?void 0:T.site,S=null==T?void 0:T.siteId,e.t0=N,e.t1=N,e.t2=N({aid:b,cid:S,pfm:window.platform},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,H();case 12:return e.t4=e.sent,e.t5=U(),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?Y(n.adPosition):"",e.next=28,q();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(f=J())&&void 0!==f?f: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===(p=m.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),_=[e.t33],r({url:(null===(y=window)||void 0===y||null===(w=y.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||A.get()+h.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:_}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var $=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},Z=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},ee=function(){var e=d.seasonIdxManager.get();return e>=0?e+1:1},ne=function(){var e,n,t,o=d.getCurrentSeries(),r=d.getCurrentVideo(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=d.seasonIdxManager.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 te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function oe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?te(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):te(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var re=l,ie=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},le=function(e){var n=ae(e,"video.tags",[]),t=ae(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},ae=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},de=function(){var n,t,o,r,l,d,u,s,c,v,f,m,p,g,h,y,w,E,I,T,b,S,_,O,P,A,D=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,k=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return D;var C=(null==k?void 0:k.siteName)||(null==k?void 0:k.site)||"",R=(null==k?void 0:k.contentType)||"video",F=(null==k||null===(o=k[R])||void 0===o?void 0:o.metadata)||(null==k||null===(r=k[R])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),j=i.getPlayer(L);if(!D.includes("VIEWLIFT_"))return D;var V,N=window.getComputedStyle(document.getElementById(L),null),x=Math.trunc(N.getPropertyValue("height").slice(0,-2)),W=Math.trunc(N.getPropertyValue("width").slice(0,-2)),M="linearchannel"===R?null==k||null===(d=k.linearchannel)||void 0===d||null===(u=d.channels)||void 0===u||null===(s=u.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:ae(k,"video.gist.id",""),U="linearchannel"===R?null==k||null===(v=k.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(m=f.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===m?void 0:m.title:ae(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,H=null;"function"==typeof window.__gpp&&(null===(V=window)||void 0===V||V.__gpp("ping",function(e){B=null==e?void 0:e.gppString,H=null==e?void 0:e.sectionList[0]}));var G=a.get("us_privacy")||a.get("usprivacy"),q=void 0!==G?G:"1YNN",Q=null!==(p=null===(g=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===g?void 0:g.fwIdentifier)&&void 0!==p?p:null,Y=oe(oe({},ue(F)),{},(O={VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:x,VIEWLIFT_SIZE:ie(W,x),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===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ae(k,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==j||null===(y=j.options_)||void 0===y?void 0:y.autoplay)||1,VIEWLIFT_MUTE:(null==j||null===(w=j.options_)||void 0===w?void 0:w.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==C||"usanetwork"==C?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:le(k),VIEWLIFT_MEDIA_ID:M,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ae(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:M,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ae(k,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ae(null===(E=window)||void 0===E||null===(I=E.app_data)||void 0===I||null===(T=I.site)||void 0===T?void 0:T.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==C||"usanetwork"==C?"":ae(null===(b=window)||void 0===b||null===(S=b.app_data)||void 0===S||null===(_=S.site)||void 0===_?void 0:_.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:q,VIEWLIFT_TVE_PROVIDER:Q?re(Q):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ae(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:M,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:ae(k,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ae(k,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ne(),VIEWLIFT_SEASON_NUMBER:ee(),VIEWLIFT_CONTENT_TAGS:le(k),VIEWLIFT_GPP_SID:H||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(O,"VIEWLIFT_LAT",""),e(O,"VIEWLIFT_APP_BUNDLE",""),e(O,"VIEWLIFT_ATT_CONSENT",""),O),null===(P=window)||void 0===P||null===(A=P.customData)||void 0===A?void 0:A.macros);for(var z in Y){var K=new RegExp(z,"g");D=D.replace(K,Y[z])}return D},ue=function(e){var n,t,o,r,i,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(Z()?u?a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=oe(oe({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=oe(oe({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=Z()?oe(oe({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):oe(oe({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=oe(oe({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=Z()?oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):oe(oe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=oe(oe({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:d.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},se=function(e,n){var t,o,r,i,l,a,d,u,s,c,v,f,m,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,h=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,y=null==e||null===(i=e[p])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.audioAssets,w=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[p])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(m=f.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=y&&y.hls)return ve(y);if(g){var I=fe(h,n);return I.src=de(I.src,n,e),I}if("Safari"!==$()&&E)return ce(h);if(w){var T=ve(h);return T.src=de(T.src,n,e),T}if(null!=h&&h.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(h);return b.src=de(b.src,n,e),b}return null},ce=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ve=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},fe=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=$();if(i.getPlayer(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&i(e),i(null,t)})}}}}}(r);return me(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(me(n),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var me=function(e){var n=i.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==$()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},pe=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)}}},ge=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var he=!1,ye=function(e,n,t){var o=de(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_){he=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),he&&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 we,Ee=(we=!0,{enable:function(){we=!0},disable:function(){we=!1},get enabled(){return we}}),Ie="ssai-breakStart",Te="ssai-adImpression",be="ssai-firstQuartile",Se="ssai-midpoint",_e="ssai-thirdQuartile",Oe="ssai-complete",Pe="ssai-breakEnd",Ae={breakStart:Ie,impression:Te,firstQuartile:be,midpoint:Se,thirdQuartile:_e,complete:Oe,breakEnd:Pe};function De(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=Ae[o];r&&t.trigger(r,n)}function Le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ke(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Le(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Ce,Re=(Ce=null,{get:function(){return Ce},set:function(e){Ce=e}});function Fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function je(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Fe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function Ve(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 Ne(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)?Ne(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 Ne(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 xe,We=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),Me=(xe=null,{set:function(e){xe=e},get position(){return xe}});function Ue(e,n){return Be.apply(this,arguments)}function Be(){return(Be=n(t.mark(function e(n,o){var r,l,a,d,u,s,c,v,m,p,g,h,y,w,E,I,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i.getPlayer(n),a=se(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=de(s,n,o),c=Ge(s),v=f(c,2),m=v[0],p=v[1],g=He(p)||{},s=new URL(s.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach(function(e){var n=f(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(je({adsParams:je({},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,E=y.trackingUrl,I=y.manifestUrl,T=w+E,b=w+I,We.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 He(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=f(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function Ge(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ve((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=f(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 v=f(c[s],2),m=v[0],p=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=p;else u[m]=p}return[d,u]}var qe,Qe,Ye,ze,Ke=(qe=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),qe=Array.isArray(e)?v(e):qe},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",qe),v(qe)}}),Xe=new Map;function Je(e,n){return $e.apply(this,arguments)}function $e(){return $e=n(t.mark(function e(o,r){var l,a,d,u,s,f,m,p,g,h,y,w,E,I,T,b,S,_,O,P,A,D,L,k,C,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:R=function(e,n,t,r,l,a){var d,u,s=i.getPlayer(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[r])||void 0===u?void 0:u.adId)||c;e<k&&L.clear(),k=e,Math.floor(s.currentTime());var f,m=Ve(t);try{var p=function(){var t,i,l,d=f.value,u=d.eventType,m=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,y=p||c,w=m,E=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(l=i.ads)||void 0===l?void 0:l.adEventHandler)||null,I="".concat(v,"_").concat(u),T="pod-".concat(c);Xe.has(T)||Xe.set(T,new Set);var b=Xe.get(T);if(console.warn(e,y,"map:",u,"condition1:",e>=y,"map:",Xe),e>=y&&e<=y+D){if(!b.has(I)){b.add(I);try{C(u,n,w,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var S=Me.position;Me.set(null),setTimeout(function(){null!=S&&(s.currentTime(S),a())},500)}if("function"==typeof E)try{var _,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[r],pod:n,adIndex:r};E({adsData:O}),De(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var P=Re.get();if(P&&0!==Object.keys(P).length){var A=P.formulateComscoreAdPayload,k=P.startComscoreAdTracking,R=P.finishComscoreAdTracking,F=P.endComscoreAdTracking,j="".concat(y,"_").concat(v,"_").concat(u);if(!L.has(j))if(L.set(j,!0),"impression"===u){var V,N=We.get();k(A(je(je({},null==n||null===(V=n.ads)||void 0===V?void 0:V[r]),{},{trackingUrl:N})))}else"complete"===u?R():"breakEnd"===u&&F()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},C=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Xe.clear(),Me.set(r),g=We.get(),(h=i.getPlayer(o)).one("loadeddata",function(){g&&P(g)}),y=new Map,w=new Map,E=-1,I=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==h||null===(d=h.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==h||null===(u=h.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==h||null===(s=h.el())||void 0===s||null===(f=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===f?void 0:f[0])||null,_=(null==h||null===(m=h.el())||void 0===m||null===(p=m.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return v(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 je(je({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},P=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,f,m,p,g,h,P,D,L,k,C,F,j,V,N,x,W,M,U,B;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e){document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",x),0===e.button&&j()},N=function(e){},V=function(){var e,n=h.currentTime(),t=null,o=Ve(g);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},j=function(){var e,n=h.currentTime(),t=null,o=Ve(g);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,d=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>i)&&!y.has(i)||n>=i&&n<=d)&&(t=i,y.set(i,!0),w.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){h.currentTime(t-.4)},100))},s=!1,e.next=7,fetch(n);case 7:return f=e.sent,e.next=10,f.json();case 10:m=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",m),p=m.avails,g=[],h=i.getPlayer(o),P=h.controlBar.progressControl,D=P.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),p.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(s=!0),g.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&r&&(h.currentTime(r),V()),null!=g&&g.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",g),window.adsQueueList=g,"function"==typeof(F=(null===(L=window)||void 0===L||null===(k=L.customData)||void 0===k||null===(C=k.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&(null==g?void 0:g.length)>0&&F(g)),console.log(g,"data"),g.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",D.appendChild(i)}}),h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=c.throttle(function(){var e=h.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=g[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-4&&e<=a+4){var d;e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&y.set(r,!0),Ee.disable(),I&&I.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),P.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,c=0,f=0;f<l.length;f++){var m,p=null==l||null===(m=l[f])||void 0===m?void 0:m.durationInSeconds;if(u<s+p){c=f;break}s+=p}l[c];var h=Math.max(0,i-u),E=Math.round(h);W.style.display="block",B.textContent="".concat(c+1," of ").concat(l.length," • ").concat(A(E));var O=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,v(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,v(null==t?void 0:t.podSlotImpressionBeacon)),R(e,t,O,c,0,V),"break"}w.delete(r)},o=0;o<g.length;o++){if("break"===t())break}n||(W.style.display="none",P.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),I&&I.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),Ee.enable())}},1e3),h.on("timeupdate",h._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Ee.enabled&&"ArrowRight"==e.key&&(j(),sn(o,10),e.stopPropagation())}),P.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",N),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()}),(W=document.createElement("div")).className="ssai-ad-container",(M=document.createElement("div")).className="sponsored-adbox",(U=document.createElement("div")).className="sponsored-text",U.textContent="Sponsored Ad",M.append(U),(B=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",W.append(M),W.append(B),h.el().appendChild(W);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=1.5,L=new Map,k=-1;case 21:case"end":return e.stop()}},e)})),$e.apply(this,arguments)}function Ze(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 en(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)?en(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 en(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 nn(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 tn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):nn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var on={},rn=(null===(Qe=window)||void 0===Qe||null===(Ye=Qe.location)||void 0===Ye||null===(ze=Ye.search)||void 0===ze?void 0:ze.includes("debug=true"))||!1,ln=null;function an(e){return dn.apply(this,arguments)}function dn(){return dn=n(t.mark(function e(o){var r,l,a,d,u,s,f,m,p,g,h,y,w,E,I,T,b,S,_,O,P,A,D,L,k,C,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:R=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,f=Ze(t);try{for(f.s();!(v=f.n()).done;){var m,p,g,h=v.value,y=h.eventType,w=h.beaconUrls,E=h.startTimeInSeconds,I=h.startTime,T=h.durationInSeconds,b=(h.eventId,E||s),S=w,_=(null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(y),P="pod-".concat(s);L.has(P)||L.set(P,new Set);var A=L.get(P);if(rn&&console.warn(e,b,"map:",y,"condition1:",e>=b,"map:",L),e>=b&&e<=b+k&&!A.has(O)){A.add(O);try{C(y,n,S,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof _)try{var D,R={eventType:y,startTimeInSeconds:E,startTime:I,durationInSeconds:T,ad:null==n||null===(D=n.ads)||void 0===D?void 0:D[r],pod:n,adIndex:r};_({adsData:R}),De(o,R)}catch(e){console.error("Error when calling ads callback:",e)}var F=Re.get();if(F&&0!==Object.keys(F).length){var j=F.formulateComscoreAdPayload,V=F.startComscoreAdTracking,N=F.finishComscoreAdTracking,x=F.endComscoreAdTracking;if("impression"===y){var W,M=We.get();V(j(tn(tn({},null==n||null===(W=n.ads)||void 0===W?void 0:W[r]),{},{trackingUrl:M})))}else"complete"===y?N():"breakEnd"===y&&x()}}}}catch(e){f.e(e)}finally{f.f()}}},C=function(e,n,t,o){var r,i,l;"breakEnd"===e&&(null===(r=on)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=on)||void 0===i?void 0:i.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(rn&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},h=function(){ln&&clearInterval(ln)},p=We.get(),(g=i.getPlayer(o)).one("loadeddata",function(){h(),ln=setInterval(function(){p&&!g.paused()&&D(p)},2e3)}),g.on("dispose",function(){h()}),y=new Map,w=new Map,E=-1,I=null,T=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==g||null===(a=g.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==g||null===(u=g.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==g||null===(f=g.el())||void 0===f||null===(m=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,P=!1,A=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return v(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 tn(tn({},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,f,m,p,g,h,D,L,k;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,f=[],m=i.getPlayer(o),p=m.controlBar.progressControl,g=p.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){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:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),rn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),null!=f&&f.length&&(window.adsQueueList=f,"function"==typeof(k=(null===(h=window)||void 0===h||null===(D=h.customData)||void 0===D||null===(L=D.ads)||void 0===L?void 0:L.onAdBreaksLoaded)||null)&&(null==f?void 0:f.length)>0&&k(f)),f.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",g.appendChild(i)}}),m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=c.throttle(function(){var e=m.currentTime();if(e!==E){E=e;for(var n=function(){var n=f[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,l=o+r;if(e>=o-1.2&&e<=l+1.2){var a;P=!!(e>=o&&e<=l&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>l&&y.set(o,!0),Ee.disable(),T&&T.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),p.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,c=0;c<i.length;c++){var m,g=null==i||null===(m=i[c])||void 0===m?void 0:m.durationInSeconds;if(d<u+g){s=c;break}u+=g}setTimeout(function(){on.totalAds=null==i?void 0:i.length,on.currentAdIndex=s},1e3);var h=[];return null==i||i.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});h.push.apply(h,v(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&h.push.apply(h,v(null==n?void 0:n.podSlotImpressionBeacon)),R(e,n,h,s),"break"}w.delete(o)},t=0;t<f.length;t++){if("break"===n())break}P||(on={},p.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Ee.enable())}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),dn.apply(this,arguments)}function un(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 sn=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},cn=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},vn=function(e){return!!o.getPlayer("".concat(e))},fn=function(){var e=n(t.mark(function e(o,r){var l,a,u,s=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=s.length>2&&void 0!==s[2]&&s[2],e.next=3,F();case 3:return a=e.sent,u=i.getPlayer(o),e.abrupt("return",new Promise(function(e,i){var s=(null==r?void 0:r.programs)||[];null==r||delete r.programs,S(r,a).then(function(){var i=n(t.mark(function n(i){var a,c,v,f,m,p,g,h;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null==i?void 0:i.data,window.sid=B(),a.contentType="linearchannel",a.channelId=null==r?void 0:r.channelId,d.setCurrentVideo(a),d.setCurrentEpgPrograms(s),!l){n.next=16;break}if(g=(null==a||null===(c=a.linearchannel)||void 0===c?void 0:c.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(v=window)||void 0===v||null===(f=v.app_data)||void 0===f||null===(m=f.appcmsMain)||void 0===m||null===(p=m.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,h=se(a,o),!g){n.next=13;break}return n.next=12,Ue(o,a);case 12:h=n.sent;case 13:h&&(gn(o,h),g&&an(o),u.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:a});case 17:case"end":return n.stop()}},n)}));return function(e){return 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)}}(),mn=function(){var e=n(t.mark(function e(o,r,l){var a,s,c,v,f,m,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return v=e.sent,(d.getCurrentSeries()||null)&&d.setVideoIdxById(r),f=0,m=0,p=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(c=s.watchHistory)&&void 0!==c&&c.enable&&O(r,v).then(function(e){var n,t,o,r,i,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),f=(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){b(r,v).then(function(){var r=n(t.mark(function n(r){var a,s,c,v,g,h,y,w,E,I,T,b,S,_,O,P,A,D,L,k,C,R,F,j,V,N,x,W,M,U,B,H,G,q,Q,Y,z,K;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(P=null==r?void 0:r.data,A=(null==P?void 0:P.contentType)||"video",D=(null==P||null===(a=P[A])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v||null===(g=v.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,L=(null==P||null===(h=P.video)||void 0===h||null===(y=h.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,d.setCurrentVideo(r.data),(k=(null==P||null===(w=P.ads)||void 0===w||null===(E=w.preRoll)||void 0===E||null===(I=E.adTags)||void 0===I||null===(T=I.web)||void 0===T?void 0:T.active)&&(null==P||null===(b=P.ads)||void 0===b||null===(S=b.preRoll)||void 0===S||null===(_=S.adTags)||void 0===_||null===(O=_.web)||void 0===O?void 0:O.url))&&ye(o,k,P),C=se(P,o),!D){n.next=12;break}return n.next=11,Ue(o,P);case 11:C=n.sent;case 12:C?(H=(null==P||null===(R=P.video)||void 0===R||null===(F=R.gist)||void 0===F?void 0:F.videoImageUrl)||(null==P||null===(j=P.video)||void 0===j||null===(V=j.gist)||void 0===V||null===(N=V.imageGist)||void 0===N?void 0:N.r16x9),(G=i.getPlayer(o)).poster(H),gn(o,C),D&&Je(o,p),G.on("loadstart",function(){L&&e({status:!0,msg:"Video Loaded",response:P})}),G.on("loadeddata",function(){ge(),e({status:!0,msg:"Video Loaded",response:P})}),G.one("play",function(){f&&!D&&m<95&&setTimeout(function(){G.currentTime(f)},0)}),G.one("error",function(){var e;l({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==P||null===(x=P.video)||void 0===x||null===(W=x.contentDetails)||void 0===W||null===(M=W.closedCaptions)||void 0===M?void 0:M.length)>0||(null==P||null===(U=P.video)||void 0===U||null===(B=U.closedCaptions)||void 0===B?void 0:B.length)>0?(K=(null==P||null===(Q=P.video)||void 0===Q||null===(Y=Q.contentDetails)||void 0===Y?void 0:Y.closedCaptions)||(null==P||null===(z=P.video)||void 0===z?void 0:z.closedCaptions),q=K.filter(function(e){return"VTT"===e.format}),u.addCaptions(o,q)):u.removeCaptions(o)):(pe(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){hn(e,o,l,r)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),pn=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()},gn=function(e,n){var t=i.getPlayer(e);t&&t.src(n)},hn=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);vn(t)&&pe(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?un(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):un(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))};exports.adsQueuePointManager=Ke,exports.authenticateLC=fn,exports.baseUrlManager=A,exports.clearError=ge,exports.comscoreInstanceManager=Re,exports.createSeriesWatchMap=function(e,n){var t=new Map;P({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),d.setSeriesWatchMap(t)}).catch(function(e){return console.log(e)})},exports.detectBrowser=$,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=(Re.get()||{}).destroyComscoreTag,t=i.getPlayer(e);if(pn(),"function"==typeof n&&n(),c.clearEventListeners(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},exports.getDecodedToken=j,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=ne,exports.getLinearChannelDetails=S,exports.getSGAIEnabledSource=Ue,exports.getSeasonNumber=ee,exports.getSeriesDetails=function(e,n){var t,o,i=j(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:A.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},exports.getSeriesWatchHistory=P,exports.getSource=se,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(Ie,e)},adImpression:function(e){return t(Te,e)},adFirstQuartile:function(e){return t(be,e)},adMidpoint:function(e){return t(Se,e)},adThirdQuartile:function(e){return t(_e,e)},adComplete:function(e){return t(Oe,e)},adBreakEnd:function(e){return t(Pe,e)}}},exports.getToken=F,exports.getUpdatedClusterSource=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},exports.getUserId=H,exports.getVideoDetails=b,exports.getVideoInfo=O,exports.handleError=pe,exports.initialiseAdvertisement=ye,exports.initialiseComscoreStreamingTracking=function(e,n){var t,o,r,l,a,u,s,c,v,f,p,g,h,y,w,E,I=null==e?void 0:e.playerId,T=i.getPlayer(I);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var b=d.getCurrentVideo(),S=(null==b||null===(o=b.video)||void 0===o?void 0:o.metadata)||[],_=(null==S?void 0:S.length)&&S.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=_)&&void 0!==r&&r.length){var O=_.map(function(e){return e.value});_=null==O?void 0:O.join(",")}m.destroyComscoreTag();var P,A,D,L=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,k=Array.isArray(null==L?void 0:L.category)?null==L||null===(a=L.category)||void 0===a?void 0:a.join(","):(null==L?void 0:L.category)||null,C=ke(ke(ke({},null==b?void 0:b.video),null==b?void 0:b.linearchannel),{},{siteName:(null==b?void 0:b.site)||null,programId:(null==L?void 0:L.videotmsid)||null,programTitle:(null==L?void 0:L.lcProgrammeName)||null,episodeId:(null==L?void 0:L.videotmsid)||null,seasonNumber:(null==b||null===(u=b.video)||void 0===u||null===(s=u.series)||void 0===s?void 0:s.seasonNumber)||(null==L||null===(c=L.seriesDetails)||void 0===c?void 0:c.season)||null,episodeNumber:(null==b||null===(v=b.video)||void 0===v||null===(f=v.series)||void 0===f?void 0:f.episodeNumber)||(null==L||null===(p=L.seriesDetails)||void 0===p?void 0:p.episode)||null,episodeTitle:(null==L?void 0:L.lcSubTitle)||null,isCompleteEpisode:!!(null!=b&&null!==(g=b.video)&&void 0!==g&&g.series||null!=L&&null!==(h=L.seriesDetails)&&void 0!==h&&h.episode),genre:_||k,comscoreConfig:{implementationId:(null==e||null===(y=e.comscore)||void 0===y?void 0:y.implementationId)||null,projectId:(null==e||null===(w=e.comscore)||void 0===w?void 0:w.projectId)||null}});if(null!=C&&null!==(E=C.streamingInfo)&&void 0!==E&&E.isLiveStream?C.contentType="LIVE":C.contentType="LONG_FORM_ON_DEMAND",null==C||!C.network){var R,F=(null==C?void 0:C.metadata)||[],j=null==F||null===(R=F.find(function(e){return"network"===e.name}))||void 0===R?void 0:R.value;C.network=j||null}null!=C&&C.network&&null!=C&&C.genre&&(C.customGenre="".concat(C.network,"_").concat((null==C?void 0:C.programTitle)||(P=C,null!=P&&P.series?null==P||null===(D=P.series)||void 0===D?void 0:D.title:null==P||null===(A=P.gist)||void 0===A?void 0:A.title),"_").concat(C.genre)),null!=L&&L.airDate&&(C.publishDate=L.airDate),null!=C&&C.runtime&&(C.runtime=1e3*((null==C?void 0:C.runtime)||0));var V=m.formulateComscorePayload(C,T);console.log("comscoreOptions player data",V),m.createComscoreStreamingTag(ke({playerName:"Video.js"},V)),m.setComscorePlayerInstance(T)}},exports.initialiseKeyboardEvents=function(e,n){var t,o,r,l=i.getPlayer(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,i,u,s,c,v,f,m;if(Ee.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||cn(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!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||sn(e,10)}}},!0)},exports.initiateErrorHandling=hn,exports.inititateBeacon=function(e,n,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var o=i.getPlayer(e);window.initialise(o,n),window.firstFrame(o,n,t),o.on("loadedmetadata",function(){window.endFirstFrame(o)})}},exports.isBehindLive=function(e){var n,t=i.getPlayer(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null},exports.isMobile=Z,exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=vn,exports.isTokenExpired=D,exports.load=mn,exports.loadVideo=gn,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=k,exports.rewind=cn,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],p("js",new Date),p("config",e)},exports.saveWatchHistory=_,exports.setupAdvertisementMarkers=Je,exports.setupAdvertisementMarkersForLinear=an,exports.skip=sn,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=Xe;
|
package/cjs/index-20de6bc7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-939a3e97.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),i=require("video.js"),l=require("./util-4769ed5b.js"),r=require("./captions-68e263dd.js"),a=require("./resolution-9c4872ec.js"),u=require("./skin-eeec7a85.js"),s=require("./player_instance-fcf6a8fb.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-5802821b.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),m=require("./helper-dbf2fb22.js"),f=require("@babel/runtime/helpers/toConsumableArray"),g=require("@babel/runtime/helpers/slicedToArray"),h=require("@viewlift/sse"),y=function(e){return new Promise(function(n,t){if(b(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},b=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},w=function(e,n,t){var o=s.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},k=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},S=function(){var n=t(o.mark(function n(t){var l,r,a,u,d;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=s.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(i),(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}},n,null,[[2,7]])}));return function(e){return n.apply(this,arguments)}}(),I=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,l,r,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(l=o.framework)||void 0===l||null===(r=l.CastContext)||void 0===r||null===(a=r.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}})};var E=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),y("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),T=function(){var n=t(o.mark(function n(){return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),D=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=t(o.mark(function e(){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),O=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-84cce26a.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),P=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-75637b78.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),j=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(i)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(i)})},loadAdsLibrary:E,loadEMELibrary:D,loadMuxPlugin:C,loadDvrSeekbar:O,loadContribDash:P,loadComscorePlugin:T});function x(e){return L.apply(this,arguments)}function L(){return(L=t(o.mark(function n(t){var i,l,r;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null==t?void 0:t.airplay)||!1,n.next=3,E();case 3:i&&"Safari"==e.detectBrowser()?Promise.resolve().then(function(){return j}).then(function(e){e.importAirplay()}):(r=(null===(l=document)||void 0===l?void 0:l.getElementById(null==t?void 0:t.playerId))||null)&&r.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function A(e){return N.apply(this,arguments)}function N(){return(N=t(o.mark(function e(n){var t,i,l,r,a,u,d,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=s.getPlayer(n.playerId),e.next=3,T();case 3:c.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,applicationName:(null==n||null===(l=n.comscore)||void 0===l?void 0:l.applicationName)||(null===(r=window)||void 0===r?void 0:r.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function R(e,n){return M.apply(this,arguments)}function M(){return(M=t(o.mark(function n(t,i){var l,r,a,u,s,d,c,v,p,m,f,g,h,y;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=(null==i?void 0:i.contentType)||"video",m=null==i||null===(l=i[p])||void 0===l?void 0:l.drmEnabled,null==i||null===(r=i[p])||void 0===r||null===(a=r.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,f=(null==i||null===(u=i[p])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,g=(null==t||null===(c=t.comscore)||void 0===c?void 0:c.enable)||!1,h=!(null==t||null===(v=t.analytics)||void 0===v||!v.muxKey),n.prev=7,n.next=10,Promise.allSettled([m?"Safari"==e.detectBrowser()?D():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?P():D():"Safari"!=e.detectBrowser()&&f?P():null,g?A(t):null,h?C():null,S(t)]);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(7),console.log("Error",n.t0);case 15:case"end":return n.stop()}},n,null,[[7,12]])}))).apply(this,arguments)}function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function V(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?B(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):B(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var _=new Set,H=null,U=function(n,t,o,i){var l,r,a,u,s,d,v,p={},m=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(l=n[m])||void 0===l?void 0:l.id)||"Null",p["c3.cm.contentType"]=J(n),p[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==n||!n.linearchannel),p[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=W(n),p["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),p.DRMEnabled=(null===(s=n[m])||void 0===s?void 0:s.drmEnabled)||"None",p.DAIStream=null!==(d=n[m])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[o.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=K(n),p["c3.cm.genreList"]=F(n),p["c3.cm.genre"]=q(n),p["c3.cm.channel"]=G(n,i);var f=Q(c.getCurrentSeries(),n);return p=V(V({},p),f)},q=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},F=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},G=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===o?void 0:o.title)||"NULL"},W=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},K=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Y=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var z,X,Q=function(n,t){var o,i,l,r,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(l=n[s-1])||void 0===l||null===(r=l.episodes)||void 0===r||null===(a=r[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},$=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Z=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ee=function(){var e=t(o.mark(function e(n,t){var i,l,r,a,u,d,v,p,m,f,g,h;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==t?void 0:t.convivaConfig)||{},l=i.trackConvivaPlayerEvent,r=i.paymentHandler,a=i.tveProvider,u=i.enable,d=i.appName,p=(v=t||{}).token,m=v.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(f=s.getPlayer(n),"function"==typeof(g=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(h=e.sent){e.next=13;break}return e.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=$(t.keySystem);g("contentInfo",{DRMEnabled:o})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var e,n;H&&H!==f.currentSrc()&&g("playbackEnded"),g("setPlayer",f),_.clear(),H=f.currentSrc();var o=Z(f.currentType()),i=c.getCurrentVideo(),l=U(i,f,h,m);l[null==h||null===(e=h.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",l[null==h||null===(n=h.Constants)||void 0===n?void 0:n.ASSET_NAME]=Y(i,t),l.authToken=p||"NULL",l.streamType=o,l.D2CType=r||"NONE",l.subscriberType=a?"MVPD":"FREE"!==r?"D2C":"FREE",l["c3.cm.affiliate"]=a||"NULL",ne.setData(l),g("contentInfo",l)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),f.on("play",function(){_.has(f.currentSrc())||(_.add(f.currentSrc()),g("playbackStarted",null))}),f.on("ended",function(){_.has(f.currentSrc())&&_.delete(f.currentSrc()),g("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==_||_.clear(),g("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),ne=(z={},{setData:function(e){z=V(V({},z),e)},getData:function(){return z}}),te=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-5e4b3ad1.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-ab226d57.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-02df14d4.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-eac05283.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-98b66c5d.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-7afce973.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-334830ee.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-6e922e32.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-af838b06.js")}).then(function(t){t.initialiseSkin(e,n)})};function oe(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 ie(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):oe(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var le=[],re=0,ae=null;function ue(){console.log("Cleaning up watch history data"),X=null,le=[],re=0,ae=null}function se(t,o,i){var l,r,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(l=o.watchHistory)||void 0===l||l.apiVersion;var v=null==o||null===(r=o.watchHistory)||void 0===r?void 0:r.profileId,p=Math.floor(t.currentTime()),m=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var f=(null==o||null===(u=o.video)||void 0===u?void 0:u.originalObjectId)||null,g=(null==o||null===(s=o.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,h=Math.floor(t.currentTime()),y=d?100:Math.floor(p/m*100),b={};g?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=de(i),r=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return ie(ie({},e),{},n({},t,u[t]))},{}),d=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===X});d<0?l.push(ie(ie({content:s},e),{},{addedDate:r,updateDate:r})):l[d]=ie(ie(ie({},l[d]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(b={completed:d,watchedTime:h,watchedPercentage:y},v,o.siteOwner):(b=ie(ie({videoId:X,watchedTime:h,watchedPercentage:y,doneWatching:d,profileId:v},ae&&{seriesId:ae}),f&&{originalObjectId:f}),e.saveWatchHistory(b).then(function(e){}).catch(function(e){})),re=p+i}function de(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ce(e,n,t){var o=de(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var ve=!1,pe=function(n,t){var o,i,l=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[l])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ve){var r=me(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(r,t);return a&&e.loadVideo(t,a),ve=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function me(e,n,t){if(Array.isArray(e))return e.map(function(e){return me(e,n,t)});if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=me(e[i],n,t)}),o}return e}function fe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ge(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ge(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function ge(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ye(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?he(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):he(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var be=function(n,t,o,i){var l,a,u,d,p,m=i.res,f=i.sres,g=s.getPlayer(n),h=(null==m?void 0:m.contentType)||"video",y=(null==m||null===(l=m[h])||void 0===l?void 0:l.drmEnabled)||!1,b=(null==m||null===(a=m[h])||void 0===a||null===(u=a.streamingInfo)||void 0===u?void 0:u.isLiveStream)||!1,k=(null==m||null===(d=m[h])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(m),c.videoReplayTracker.set(m),g&&(g.on("loadstart",function(){b?o.resolve({status:!0,msg:"Video Loaded",response:m}):o.resolve(ye({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:m}:{response:m}))}),g.on("loadeddata",function(){var o,i,l,a=r.getCaptions(n);if(null==a||a.map(function(e){return r.disableCaptions(n,e.id)}),k&&"Safari"===e.detectBrowser())try{var u;null==g||null===(u=g.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==g||!g.muted())&&w(n,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,f=ye(ye({},t),m);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ae=null==n||null===(i=n.series)||void 0===i?void 0:i.id),le=[],re=0,X=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",ue),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());le.includes(re)||(e!=re||e<r?e>re&&(re=e+r):(le.push(e),se(a,n,r)))}}),a.one("ended",function(){se(a,n,r,!0)}))}(n,f,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=g&&g.mux){var h,y,b,S,I,E,T=(null===(h=c.getCurrentVideo())||void 0===h?void 0:h.video)||(null==m?void 0:m.video),D=null==T?void 0:T.gist,C={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==D?void 0:D.id,video_title:null==D?void 0:D.title,video_series:null==T||null===(S=T.series)||void 0===S?void 0:S.title,video_stream_type:null!=T&&null!==(I=T.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==t||null===(E=t.analytics)||void 0===E?void 0:E.userId};g.mux({debug:!1,data:C})}}),g.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];g.trigger("subtitlechanged",n)}),g.on("subtitlechanged",function(e,n){var t,o,i,l,r,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,m=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var f,g=m.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}}),g.tech_.on("retryplaylist",function(){b&&pe(m,n)}),g.on("error",function(){var t,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&b)?pe(m,n):(e.handleError(n,(null==g||null===(t=g.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:m}))}),g.one("play",function(){var e,n,o,i,l;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var r,a,u,s=null===(r=c.getCurrentVideo())||void 0===r||null===(a=r.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,m=v.p;p&&m<95&&setTimeout(function(){g.currentTime(p)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){g.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=g&&g.dvrSeekbar)try{g.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),g.on("volumechange",function(){var e=100*g.volume().toFixed(2);g.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),g.on("chromecastDisconnected",function(){if(b){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}}),g.one("loadeddata",function(){var n,t=(null==g||null===(n=g.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==v(g.dash)){var o,i,l,r=null==g||null===(o=g.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==r?void 0:r.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),u=fe(t);try{for(u.s();!(l=u.n()).done;){var s=l.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=fe(t);try{for(c.s();!(d=c.n()).done;){var p,m,f,h=d.value;if(("Chrome"==e.detectBrowser()||"Edge"==e.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(m=p.userAgent)&&void 0!==m&&m.includes("Macintosh")||!y))&&null!=h&&null!==(f=h.label)&&void 0!==f&&f.includes("5.1"))g.audioTracks().removeTrack(h);else{if("main"==h.kind){h.enabled=!0;break}h.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function we(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function ke(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function Se(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter(function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n}).map(function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}})}function Ie(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var r=i.playLive,a=i.playFromBegining,u=i.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",function(){m.checkDvrStartOverEnabled(n)?a?m.playFromBeginningHandler(t,n):r?m.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,l=n.epg,r=o.buttonConfig,a=void 0===r?{}:r,u=a.watchLive;a.resume;var s=a.startFromBegining,d=i;if(l&&null!=l&&l.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!m.getWatchedTime(d),f=document.querySelector(".vjs-dvr-btn-overlay");f||((f=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=m.getCurrentProgramThumbnail(n);g&&(f.style.backgroundImage="url(".concat(g,")"),f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="cover");f.innerHTML=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,l=t.startFromBegining,r=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(r,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}(o,v),f.style.display="flex",e.el().appendChild(f),m.pauseAndHideControl(e),Ee("watch-live-resume-btn",u,function(){m.showControl(e,f),m.playLiveOrResumeHandler(e,d)}),Ee("watch-begining-btn",s,function(){m.showControl(e,f),m.playFromBeginningHandler(e,n)})}(t,n),m.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):m.removeDvrStartOver(t)}),t.one("loadedmetadata",function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",function(){i=!0}),e.on("seeked",function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}m.saveWatchedTime(s,o),m.getProgramStartTime(e,n),m.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})}),e.on("timeupdate",function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(m.saveWatchedTime(s,t),o=t,function(e,n){Se(n).forEach(function(t){var o=t.id,i=t.title,l=t.time,r=document.getElementById(o);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=we(o,i,Math.min(l/n*100,99.5));u.appendChild(s)}})}(e,a))}})}(t,n)})}else console.warn("Player instance is required to initialize start over.")}function Ee(e,n,t){var o,i,l=document.getElementById(e);l&&(i=n,(o=l)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),l.addEventListener("click",t))}function Te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function De(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Te(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Ce=function(l,a,d,c){var v,p,m,f,g,h,y,b,w,k,S,E,T,D,C,O,P,j,x,L,A,N,M,B,V,_,H,U,q,F,G,W,K,Y,J,z,X,Q=a.res,$=void 0===Q?null:Q,Z=a.sres,oe=void 0===Z?null:Z,ie=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],le=(null===(v=$)||void 0===v?void 0:v.contentType)||"video",re=u.impolicy16x9(null===(p=$)||void 0===p||null===(m=p[le])||void 0===m||null===(f=m.gist)||void 0===f?void 0:f.videoImageUrl)||u.impolicy16x9(null===(g=$)||void 0===g||null===(h=g[le])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=$)||void 0===w||null===(k=w[le])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ue=(null===(E=$)||void 0===E||null===(T=E[le])||void 0===T||null===(D=T.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,se=(null===(C=$)||void 0===C||null===(O=C.ads)||void 0===O||null===(P=O.preRoll)||void 0===P||null===(j=P.adTags)||void 0===j||null===(x=j.web)||void 0===x?void 0:x.active)&&(null===(L=$)||void 0===L||null===(A=L.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(M=N.adTags)||void 0===M||null===(B=M.web)||void 0===B?void 0:B.url);$=De(De({},$),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(V=d.customData)||void 0===V?void 0:V.ads)||{},ce=(null===(_=$)||void 0===_||null===(H=_[le])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==de?void 0:de.vodAdSticherProvider)||!1,ve=(null==d?void 0:d.latency)||6,pe=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var me=(z={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==pe?void 0:pe.pictureInPictureToggle)||!1},playbackRates:null!=pe&&pe.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:ae},n(z,"autoplay",null==d?void 0:d.autoplay),n(z,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!se),n(z,"loop",(null==d?void 0:d.loop)||!1),n(z,"audioPosterMode",null==d?void 0:d.audioPosterMode),n(z,"html5",De(De({dash:De(De(De({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(U=d.debugConfig)||void 0===U?void 0:U.enable)&&{debug:!0,logLevel:null!=d&&null!==(q=d.debugConfig)&&void 0!==q&&q.logLevel?null==d||null===(F=d.debugConfig)||void 0===F?void 0:F.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ve},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:De(De({},(null==d?void 0:d.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==d?void 0:d.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0},additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}})}}}),vhs:De(De(De({},(null==d?void 0:d.initialBandwidth)&&{bandwidth:d.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==d||!d.initialBandwidth},(null==d||null===(G=d.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(W=null==d?void 0:d.enableLowInitialPlaylist)&&void 0!==W&&W}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(K=d.debugConfig)||void 0===K?void 0:K.enable)||!1,nativeTextTracks:"Safari"==e.detectBrowser()},0==(null==d||null===(Y=d.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(J=d.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(z,"poster",re),n(z,"techOrder",ie),n(z,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(l),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),r=function(e,n,t){var o,i,l,r,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var f,g,h,y,b,w,k,S;m.isDrmEnabled=!0;var I=(null==n||null===(f=n.keySystems)||void 0===f?void 0:f["com.widevine.alpha"])||null,E=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);m.licenseUrl=E;var T=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);m.licenseToken=T}var D=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=D;var C=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;m.duration=C;var O=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;m.mediaTitle=O;var P=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=P,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}($,e,i);return De(De({},r),{},{convivaMetaData:De({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},ne.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,r,a=s.getPlayer(l),u=(null==a?void 0:a.currentSource())||{};!(null===(n=$)||void 0===n||null===(t=n[le])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(r=u.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),z);if(!i.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(X=d.debugConfig)&&void 0!==X&&X.enable&&i.log.level("debug");var fe=i(l,me,function(){var n=t(o.mark(function n(){var t,a,u,s,v,p,m,f,g,h,y,b,w,k,S,E,T,D,C,O,P;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(fe),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,R(d,$);case 5:if(w=null===(t=$)||void 0===t||null===(a=t[le])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(De({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:$}:{response:$})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Ie(l,De(De({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(l,null==d?void 0:d.analyticsCb,null==d?void 0:d.analyticsEventParams),ee(l,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),ae&&I(l,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(l,se,$),k=e.getSource($,l),console.log(k),null!=d&&d.nearestClusterUrl&&(k=e.getUpdatedClusterSource(k,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(l,$);case 20:k=n.sent;case 21:k?e.loadVideo(l,k):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:$}),e.handleError(l,"Incompatible / Missing Source")),((null===(p=$)||void 0===p||null===(m=p[le])||void 0===m||null===(f=m.contentDetails)||void 0===f||null===(g=f.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=$)||void 0===h||null===(y=h[le])||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0)&&(P=(null===(E=$)||void 0===E||null===(T=E[le])||void 0===T||null===(D=T.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=$)||void 0===C||null===(O=C[le])||void 0===O?void 0:O.closedCaptions),S=P.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),r.addCaptions(l,S)),null!=d&&d.disableControls?e.disableControls(l):te(l,De(De(De({},d),me),{},{liveVideo:ue,isDvrEnabled:ae,res:$,sres:oe})),be(l,De(De(De({},d),me),{},{liveVideo:ue}),c,{res:$,sres:oe});case 25:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function Oe(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 Pe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Oe(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var je,xe=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Le(e);Ce(i,{res:l},e,{resolve:t,reject:o})},Le=function(n){var t,o,i,l,r,a,u,s,d,c,v,p,m,g=null==n?void 0:n.streamingInfo,h=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,y=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,b=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(l=i.ads)||void 0===l?void 0:l.url)||null,w=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,I=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],E=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,T=null==n?void 0:n.token,D=e.getDecodedToken(T);null==D||D.site;var C=null==D?void 0:D.siteId,O=(null==n||null===(p=n.customData)||void 0===p||null===(m=p.comscore)||void 0===m?void 0:m.video)||null,P=Pe(Pe({id:"".concat(C,"_external")},!y&&{directPlaybackUrl:null==h?void 0:h.url}),{},{video:Pe(Pe(Pe(Pe(Pe({drmEnabled:y,streamingInfo:Pe(Pe({videoAssets:Pe(Pe({},S&&{drmProvider:S}),{},{widevine:null==h?void 0:h.widevine,fairPlay:null==h?void 0:h.fairPlay,playReady:null==h?void 0:h.playReady})},(null==g?void 0:g.isDvrEnabled)&&{isLiveStream:!0}),(null==O?void 0:O.isLiveStream)&&{isLiveStream:null==O?void 0:O.isLiveStream})},E&&{isSSAIEnabled:E}),{},{metadata:I,liveDetails:{isDvrEnabled:null==g?void 0:g.isDvrEnabled},gist:Pe(Pe(Pe({},w&&{videoImageUrl:w}),(null==O?void 0:O.videoId)&&{id:null==O?void 0:O.videoId}),(null==O?void 0:O.videoTitle)&&{title:null==O?void 0:O.videoTitle}),contentDetails:Pe({},(null==k?void 0:k.length)>0&&{closedCaptions:f(k)})},(null==O?void 0:O.runtime)&&{runtime:null==O?void 0:O.runtime}),(null==O?void 0:O.publishDate)&&{publishDate:null==O?void 0:O.publishDate}),(null==O?void 0:O.platform)&&{platform:null==O?void 0:O.platform}),(null==O?void 0:O.series)&&{series:null==O?void 0:O.series}),ads:{preRoll:{adTags:{web:Pe(Pe({},b&&{active:!0}),b&&{url:b})}}}});return O&&(null!=O&&O.isDvrEnabled&&(P.video.liveDetails=Pe(Pe({},P.video.liveDetails),{},{isDvrEnabled:null==O?void 0:O.isDvrEnabled})),null!=O&&O.metadata&&(P.video.metadata=[].concat(f(P.video.metadata),f(null==O?void 0:O.metadata)))),P},Ae=null,Ne=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),i=o>0&&t>4?o:0,l=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[l>0&&i>0?l:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Re=function(e){var n,t=g(e,8),o=t[0],i=t[1],l=t[2],r=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):i>=1?" ".concat(i," month"):l>=1?" ".concat(l," week"):r>=1?" ".concat(r," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n)},Me=(je={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return je},set:function(e){je={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function Be(e,n,t,o){if(e){var i=function(){var e,i,r=null===(e=Me.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(i=Me.get())||void 0===i?void 0:i.scheduleEndTimeMs,u=Date.now();if(u-a>0){var s=document.getElementsByClassName("error-message")[0];return s&&(s.textContent=d.getLocalisation("eventEnded")||"Game has ended",o.textContent=""),clearInterval(l),void(null==t||t())}var c=r-u;if(c/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var v=Ne(c,r);null==n||n([].concat(f(v),[o]))};i();var l=setInterval(i,1e3);return l}}var Ve=function(e,n,t){var o,i,l,r,a,u,s,c,v=null==n||null===(o=n.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.errorCode,p=(null==n||null===(l=n.response)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.errorMessage)||(null==n?void 0:n.message)||null;Me.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,endDateTime:null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate}),function(e,n,t,o){var i,l,r=Date.now(),a=null===(i=Me.get())||void 0===i?void 0:i.scheduleStartTimeMs,u=null===(l=Me.get())||void 0===l?void 0:l.scheduleEndTimeMs,s=function(e,n,t,o){var i;e<0?i=d.getLocalisation("eventNotStarted")||o||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(i=d.getLocalisation("eventEnded")||o||"Game has ended");return i||o}(r-a,r-u,n,t);if(document.getElementsByClassName("error-container")[0]){var c=document.getElementsByClassName("error-message")[0];c&&(c.textContent="".concat(s));var v=document.getElementsByClassName("error-timer-message")[0];v&&Be(Math.abs(a),Re,o,v)}else{var p=document.getElementById(e).parentElement;if(p){var m=document.createElement("div");m.className="error-container";var f=document.createElement("div");f.className="error-message";var g=document.createElement("div");g.className="error-timer-message",f.textContent="".concat(s),m.appendChild(f),m.appendChild(g),p.append(m),Be(Math.abs(a),Re,o,g)}}}(e,v,p,t)};function _e(n,t){var o=t.scheduleEndDate,i=t.scheduleStartDate;Me.set({startDateTime:i,endDateTime:o}),Ae&&clearInterval(Ae),Ae=setInterval(function(){var t,o=Date.now(),i=null===(t=Me.get())||void 0===t?void 0:t.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",i),i&&o>i){var l;console.log("Game ended");var r=s.getPlayer(n);if(e.isPlayerInitialised(n)&&r){var a;r.dispose(),console.log("Player disposed");var u=null===(a=document.getElementsByClassName("vl-container"))||void 0===a?void 0:a[0],c=document.createElement("video");c.id=n,c.className="video-js",c.style.width="100%",c.style.height="100%",u&&u.appendChild(c)}var v=d.getLocalisation("eventEnded")||"Game has ended",p=null===(l=document.getElementsByClassName("error-container"))||void 0===l?void 0:l[0];if(p){var m=p.querySelector(".error-message");m&&(m.textContent=v)}else{var f=document.getElementById(n),g=null==f?void 0:f.parentElement;if(g){(p=document.createElement("div")).className="error-container";var h=document.createElement("div");h.className="error-message",h.textContent=v,p.appendChild(h),g.append(p)}}clearInterval(Ae)}},1e3)}function He(e,n){return Ue.apply(this,arguments)}function Ue(){return(Ue=t(o.mark(function n(t,i){var l,r,a,u,s,d,v,p,m;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:p=n.sent,m=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.isSSAIEnabled),e.getVideoDetails(s,p,m).then(function(n){var o,i,l,r,m,f,g,h,y,b;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(i=o.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.contentType,c.setCurrentVideo(null==n?void 0:n.data);var w=null==n||null===(r=n.data)||void 0===r||null===(m=r.video)||void 0===m||null===(f=m.gist)||void 0===f?void 0:f.scheduleEndDate,k=null==n||null===(g=n.data)||void 0===g||null===(h=g.video)||void 0===h||null===(y=h.gist)||void 0===y?void 0:y.scheduleStartDate;_e(d,{scheduleEndDate:w,scheduleStartDate:k});var S,I=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(b=t.watchHistory)&&void 0!==b&&b.enable&&!v)if((null===(S=t.watchHistory)||void 0===S?void 0:S.saveOffline)||!1){var E,T,D,C=ce((null===(E=t.watchHistory)||void 0===E?void 0:E.profileId)||"",s,null==t?void 0:t.siteOwner);if(C&&C.length)t.watchHistoryResumeTime=(null===(T=C[0])||void 0===T?void 0:T.watchedTime)||null,t.watchedPercentage=(null===(D=C[0])||void 0===D?void 0:D.watchedPercentage)||null;I.contentType="video",Ce(d,{res:I},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then(function(e){var n,o,i,l,r,a;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,I.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Ce(d,{res:I},t,{resolve:a,reject:u})});else Ce(d,{res:I},t,{resolve:a,reject:u})}).catch(function(n){var o,i,l=(null==t||null===(o=t.event)||void 0===o?void 0:o.showScheduleTimer)||!1,r=(null==t||null===(i=t.event)||void 0===i?void 0:i.onCountdownComplete)||null;l&&Ve(d,n,r),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function qe(e,n){return Fe.apply(this,arguments)}function Fe(){return(Fe=t(o.mark(function n(t,i){var l,r,a,u,s,d,c,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Ce(d,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ge(e,n){return We.apply(this,arguments)}function We(){return(We=t(o.mark(function n(t,i){var l,r,a,u,s,d,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==t||null===(l=t.series)||void 0===l?void 0:l.id,e.getSeriesDetails(v,u).then(function(n){var o,i,l,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var m=videoId||(null==p||null===(o=p[0])||void 0===o||null===(i=o.episodes)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(m,u).then(function(e){var n,o,i;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Ce(s,{res:null==e?void 0:e.data,sres:d},t,{resolve:r,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}var Ke,Ye=function(n){var t=n.site,o=n.sseBaseUrl,i=n.sseEndpoint;return h.createSSETransport({site:t,sseBaseUrl:o,getToken:e.getToken,sseEndpoint:i,onOpen:function(e){var n=e.userId,t=e.endpoint;console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,o,i,l,r,a,u,s,d;if(console.log("SSE Message:",e),(null===(n=c.getCurrentVideo())||void 0===n||null===(t=n.video)||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.id)===(null==e||null===(i=e.payload)||void 0===i?void 0:i.id)&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var v=1e3*(null==e||null===(l=e.payload)||void 0===l||null===(r=l.states)||void 0===r||null===(a=r.live)||void 0===a?void 0:a.startDateTime),p=1e3*(null==e||null===(u=e.payload)||void 0===u||null===(s=u.states)||void 0===s||null===(d=s.end)||void 0===d?void 0:d.endDateTime);v&&p&&(console.log("Setting schedule timer",v,p),Me.set({startDateTime:v,endDateTime:p}))}},onReconnectAttempt:function(e){console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){console.error("SSE Error:",e,n)},onClose:function(){console.log("SSE Closed")}})},Je=function(e){var n=e.enable,t=e.site,o=e.sseBaseUrl,i=e.sseEndpoint;if(n){var l=Ye({site:t,sseBaseUrl:o,sseEndpoint:i});return l._sseBaseUrl=o,l._site=t,l._sseEndpoint=i,l}};function ze(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Xe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ze(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(o.mark(function t(i,l){var r,a,s,c,v,p,m,f,g,h,b,w,k,S,I,E,T,D,C,O,P,j,L,A,N,R,M,B,V,_;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(T=(null==n?void 0:n.videoSourceUrl)||!1,D=null==n?void 0:n.asat,C=(null==n||null===(r=n.epg)||void 0===r?void 0:r.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,j=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,L=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",L),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),L&&!e.isTokenExpired(L)){t.next=16;break}return l({status:!1,msg:"".concat(L?"Token is expired !":"Missing Authorization Token"),response:{token:L}}),t.abrupt("return");case 16:Ke=JSON.parse(atob(L.split(".")[1]));case 17:return window.siteName=null===(s=Ke)||void 0===s?void 0:s.site,window.siteId=null===(c=Ke)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Ke)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Ke)||void 0===p?void 0:p.site)||null,n.userId=(null===(m=Ke)||void 0===m?void 0:m.userId)||null,window.sessionStorage.setItem("uid",null===(f=Ke)||void 0===f?void 0:f.userId),window.watchHistory=n.watchHistory||null,A=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,N=(null==n||null===(h=n.analytics)||void 0===h?void 0:h.gaId)||null,(R=null==n?void 0:n.errors)&&(window.customErrors=R),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=35,x(n);case 35:N&&y("https://www.googletagmanager.com/gtag/js?id=".concat(N)).then(function(){return e.runGtag(N)}).catch(function(e){}),(M=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(A)))&&M.addEventListener("contextmenu",function(e){return e.preventDefault()}),(B=Je({enable:null==n||null===(k=n.sse)||void 0===k?void 0:k.enable,site:null==n||null===(S=n.sse)||void 0===S?void 0:S.siteName,sseBaseUrl:null==n||null===(I=n.sse)||void 0===I?void 0:I.sseBaseUrl,sseEndpoint:null==n||null===(E=n.sse)||void 0===E?void 0:E.sseEndpoint}))&&!B.isConnectionActive()&&B.connect(),T?(_={directPlaybackUrl:T,id:V="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},D?e.getVideoDetails(V,L).then(function(e){var t=(null==e?void 0:e.data)||{};Ce(A,{res:Xe(Xe({},t),_)},n,{resolve:i,reject:l})}).catch(function(n){e.initiateErrorHandling(n,A,l,V)}):Ce(A,{res:_},n,{resolve:i,reject:l})):j?xe(n,{resolve:i,reject:l}):P?Ge(n,{resolve:i,reject:l}):C?qe(n,{resolve:i,reject:l}):He(n,{resolve:i,reject:l});case 41:case"end":return t.stop()}},t)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:r.enableCaptions,disableCaptions:r.disableCaptions,getCaptions:r.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:e.getSource,setVolume:w,getVolume:k,disableControls:e.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay,isBehindLive:e.isBehindLive}},exports.initiateMarker=function(e){var n=s.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;ke(),Se(l).forEach(function(e){var n=e.id,t=e.title,i=e.time,r=we(n,t,Math.min(i/l*100,99.5));o.appendChild(r)})}},exports.removeMarkers=ke;
|
package/cjs/index-2b05c277.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("./index-67e8cb8e.js");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("./player_instance-fcf6a8fb.js"),n=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/slicedToArray"),a=require("./currentVideoInfo-5802821b.js"),u=require("./skin-eeec7a85.js");function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="my-player";function c(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function p(){return(p=e(t.mark(function e(r){var n,a,u,o,s,l,c,p,d,f,m,b,g,v,h,x,y,w,k,j,E,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=[],j=0;j<y*w;j++)k.push({uri:null===(E=window)||void 0===E||null===(N=E.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 d(e,t){return f.apply(this,arguments)}function f(){return(f=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",c(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function m(e,t,n){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=r.getPlayer(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),n),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then(function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri}))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark(function e(r){var a,o,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={},r.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),u=i(r,2),o=u[0]*u[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);a[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},n(p,"left","-60px"),n(p,"border","1px solid transparent"),n(p,"borderRadius","4px"),p)})}}),o=Object.keys(a).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",u.throttle(function(e){return m(e,a,o)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",u.throttle(function(e){return m(e,a,o)},500))}),e.abrupt("return",a);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=function(){var r=e(t.mark(function e(r,n){var a,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return a=e.sent,e.next=5,a.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=i(t,2),n=r[0],a=r[1];n&&a&&(l[n.trim().toLowerCase()]=a.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark(function e(n,u){var o,s,c,p,d,f,m,b,g,v,x,y,j,E,N,T,A,I,O,S,P,M,q,R,$,B,L,D,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 l=u,o=r.getPlayer(u),s=n.split("/"),c=s.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=a.getCurrentVideo())||void 0===d||null===(f=d.video)||void 0===f?void 0:f.runtime),j=(null==x||null===(m=x.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||p+"/",E=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<E.length)){e.next=72;break}if(("image"!==(T=E[N]).getAttribute("contentType")||"image/png"!==T.getAttribute("mimeType"))&&"image/jpeg"!==T.getAttribute("mimeType")){e.next=69;break}if(I=T.getElementsByTagName("SegmentTemplate")[0],O=null===(A=I.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!I||!O){e.next=48;break}if(M=O.getElementsByTagName("S"),q=parseInt(null===(S=M[0])||void 0===S?void 0:S.getAttribute("t")),R=parseInt(null===(P=M[0])||void 0===P?void 0:P.getAttribute("d")),$=T.getElementsByTagName("Representation")[0],B=$.getElementsByTagName("EssentialProperty")[0],L=B.getAttribute("value"),D=null==L?void 0:L.split("x"),C=i(D,2),U=C[0],X=C[1],!I){e.next=46;break}if(I.getAttribute("media"),_=I.getAttribute("timescale"),F=(_?R/_:R)/(U*X),W=$.getAttribute("id"),z=Math.round(y/F),G=Math.ceil(z/(U*X)),V=I.getAttribute("media"),parseInt(I.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:L,uri:K+J.replace("$Time$",q+N*R).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],!I){e.next=69;break}if(I.getAttribute("media"),ie=I.getAttribute("duration"),ae=I.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=Q.getAttribute("id"),se=Math.round(y/ue),le=Math.ceil(se/(re*ne)),ce=I.getAttribute("media"),pe=parseInt(I.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],fe=w(ce),N=0;N<le;N++)me=fe?k(fe,N+pe):ce,de.push({duration:ue,layout:Z,uri:j+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 w(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function j(){return(j=e(t.mark(function e(n){var i,a,u,o,s,l,c,p,f,m,g,h,y,w,k,j;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r.getPlayer(n),c=l.currentSource(),p=c.src,p=null!==(i=p)&&void 0!==i&&i.includes("blob")?null===(a=window)||void 0===a||null===(u=a.player)||void 0===u?void 0:u.getSource():p,null===(o=p)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,d(p,n);case 6:if(!((null==(f=e.sent)?void 0:f.length)>0)){e.next=17;break}return m=(null==f?void 0:f[0])||null,g=m.uri,h=p.substring(0,p.lastIndexOf("/"))+"/",e.next=12,v(h,g);case 12:return y=e.sent,e.next=15,b(y);case 15:w=e.sent,l.thumbnails(w);case 17:e.next=28;break;case 19:if(null===(s=p)||void 0===s||!s.includes("mpd")){e.next=28;break}return e.next=22,x(p,n);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,b(k);case 26:j=e.sent,l.thumbnails(j);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.initiateTrickplay=function(e){return j.apply(this,arguments)};
|
package/cjs/index-5b18b394.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,t,n,o,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./player_instance-fcf6a8fb.js"),r=require("./currentVideoInfo-5802821b.js"),a=require("./autoNextVideo-1c6abafe.js"),d=require("./icons-2609dbe4.js"),s=require("./skin-eeec7a85.js"),u=require("@babel/runtime/helpers/typeof"),c=require("video.js"),v=[],m=!1,p=function(e,t){var n=l.getPlayer(e),o=Math.floor(n.currentTime());if(Math.floor(n.duration())!=o){n.pause(e);var i=r.getVideoIdx();a.switchToNext(i,e,v)}};e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===u(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},o=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},c.registerPlugin("thumbnails",function(i){var l,r,a,d,s,u,c,v;function m(){document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",m),v()}r=t({},e,i),d=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=d.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),l.appendChild(a),a.src=r[0].src,a.className="vjs-thumbnail",t(a.style,r[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),u=d.duration(),d.on("durationchange",function(e){u=d.duration()}),d.on("loadedmetadata",function(e){u=d.duration()}),(s=d.controlBar.progressControl).el().appendChild(l),c=function(e){var i,d,c,v,m,p,f,g,h,y;for(d in c=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=o(s.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),v=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,v-=o(s.el()).getBoundingClientRect().left+h,i=Math.floor((v-s.el().offsetLeft)/s.width()*u),r)i>d&&(c=Math.max(c,d));(m=r[c]).src&&a.src!=m.src&&(a.src=m.src),m.style&&a.style!=m.style&&t(a.style,m.style),v+(g=function(e,t){var o;return t?parseFloat(t):"auto"!==(o=n(e)("clip"))&&"inherit"!==o&&4===(o=o.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(o[1])-parseFloat(o[3]):0}(a,m.width||r[0].width)/2)>f?v-=v+g-f:v<g&&(v=g),l.style.left=v+"px"},s.on("mousemove",c),s.on("touchmove",c),s.on("pointerdown",function(e){document.addEventListener("pointermove",c),document.addEventListener("pointerup",m)}),v=function(e){l.style.left="-1000px"},s.on("mouseout",v),s.on("touchcancel",v),s.on("touchend",v),d.on("userinactive",v)}),exports.addNextEpPreview=function(e,t){var n;if(m=!1,null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var o;v=[];var a=r.getCurrentSeries();null==a||a.map(function(e){var t;return(t=v).push.apply(t,i(e.episodes))}),null==t||null===(o=t.series)||void 0===o||o.cb}else{var u,c;v=(null==t||null===(u=t.relatedVideos)||void 0===u?void 0:u.content)||[],null==t||null===(c=t.relatedVideos)||void 0===c||c.cb}var f=l.getPlayer(e);f.on("timeupdate",function(){var e,t;if(!m){var n=Math.floor(f.currentTime()),o=f.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&r.getVideoIdx()<=(null===(t=v)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}});var g,h=v.filter(function(e,t){return t==r.getVideoIdx()});if((null==h?void 0:h.length)>0)if(null!==(g=document.getElementsByClassName("next-ep-preview"))&&void 0!==g&&g[0]){var y,x,A,w,E,C,b,N,B,L,P,I;(null===(y=document.getElementsByClassName("next-ep-preview"))||void 0===y?void 0:y[0]).style.visibility="hidden";var j=null===(x=document.getElementsByClassName("next-ep-title"))||void 0===x?void 0:x[0],k=null===(A=document.getElementsByClassName("next-ep-img"))||void 0===A?void 0:A[0],q=null===(w=document.getElementsByClassName("next-ep-content"))||void 0===w?void 0:w[0],T=null===(E=h[0])||void 0===E?void 0:E.title;(null===(C=T)||void 0===C?void 0:C.length)>60&&(T=T.substr(0,60)+"..."),j.textContent="".concat(T),k.src=(null===(b=h[0])||void 0===b||null===(N=b.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null==h||null===(L=h[0])||void 0===L?void 0:L.img)||(null===(P=window)||void 0===P||null===(I=P.customData)||void 0===I?void 0:I.fallbackImage),q.onclick=function(){return p(e)}}else{var V,O,S,M,X,F,R,D,G=document.createElement("div");G.className="next-ep-preview",G.style.visibility="hidden",document.getElementById(e).append(G);var H=document.createElement("div");H.className="next-heading-wrapper";var _=document.createElement("div");_.className="next-ep-header",_.textContent="Next up";var K=document.createElement("div");K.className="next-ep-close",K.onclick=function(){G.style.visibility="hidden",m=!0},K.appendChild(s.parseSvgString(d.crossIconSvg())),H.append(_),H.append(K);var Q=null===(V=h[0])||void 0===V?void 0:V.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(O=h[0])||void 0===O||null===(S=O.gist)||void 0===S||null===(M=S.imageGist)||void 0===M?void 0:M.r16x9)||(null==h||null===(X=h[0])||void 0===X?void 0:X.img)||(null===(F=window)||void 0===F||null===(R=F.customData)||void 0===R?void 0:R.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(D=Q)||void 0===D?void 0:D.length)>60&&(Q=Q.substr(0,60)+"..."),W.textContent="".concat(Q);var Y=document.createElement("div");Y.className="next-ep-content",Y.append(U),Y.append(W),Y.onclick=s.debounce(function(){null==G||G.remove(),m=!0,p(e)},400),G.append(H),G.append(Y)}},exports.addTVProviderImage=function(e,t){var n=l.getPlayer(e),o=null==t?void 0:t.tvProviderLogoUrl;if(o){var i=document.createElement("div");i.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(o),r.alt="Provider Image",i.append(r),n.el().appendChild(i),n.on("useractive",function(){i.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||i.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"})}};
|