@viewlift/player-backup 2.0.123-backup → 2.0.125-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.
Files changed (46) hide show
  1. package/cjs/{autoNextVideo-bf75ce72.js → autoNextVideo-cbfacb45.js} +1 -1
  2. package/cjs/bundle.css +2 -2
  3. package/cjs/{features-1948bd33.js → features-4de2f52c.js} +1 -1
  4. package/cjs/generic-909c9456.js +1 -0
  5. package/cjs/{index-0b0e69a1.js → index-474789cb.js} +1 -1
  6. package/cjs/index.js +1 -1
  7. package/cjs/{multicamv2-84959d9f.js → multicamv2-27c3f73a.js} +1 -1
  8. package/cjs/{multicamv2-86fc2c98.js → multicamv2-56faa9f9.js} +1 -1
  9. package/cjs/{nextEpisodeButton-d3a4230d.js → nextEpisodeButton-8f9a642b.js} +1 -1
  10. package/cjs/{playlist-e614b574.js → playlist-aebef789.js} +1 -1
  11. package/cjs/{series-ff885888.js → series-eb47d2e2.js} +1 -1
  12. package/cjs/{series-v2-5023ef80.js → series-v2-70276266.js} +1 -1
  13. package/cjs/{series-v2-093961e8.js → series-v2-ca71fc94.js} +1 -1
  14. package/cjs/{skin-b1bfde8c.js → skin-13b2b37f.js} +1 -1
  15. package/cjs/{skin-f0c3354a.js → skin-24540f94.js} +1 -1
  16. package/cjs/{skin-f6442d47.js → skin-246500f1.js} +1 -1
  17. package/cjs/{skin-391fe49c.js → skin-4ac1e649.js} +1 -1
  18. package/cjs/{skin-41c6a18e.js → skin-bcefbf5a.js} +1 -1
  19. package/cjs/{skin-0d4790b3.js → skin-beda7dcb.js} +1 -1
  20. package/cjs/{skin-93d77c5e.js → skin-cf131c0d.js} +1 -1
  21. package/cjs/{videoSelector-43f6ac8d.js → videoSelector-1fb965ae.js} +1 -1
  22. package/cjs/{videoSelector-a3a8b9fa.js → videoSelector-c23e4692.js} +1 -1
  23. package/esm/{autoNextVideo-2e736edd.js → autoNextVideo-5a9a6fc4.js} +1 -1
  24. package/esm/bundle.css +2 -2
  25. package/esm/{features-f5e1f6d8.js → features-ec10bdba.js} +1 -1
  26. package/esm/{generic-93db3bbb.js → generic-fe88b855.js} +1 -1
  27. package/esm/{index-11b0bf34.js → index-d2ca2551.js} +1 -1
  28. package/esm/index.js +1 -1
  29. package/esm/{multicamv2-0fed2b37.js → multicamv2-2380caa7.js} +1 -1
  30. package/esm/{multicamv2-93598643.js → multicamv2-e5079a74.js} +1 -1
  31. package/esm/{nextEpisodeButton-5954075c.js → nextEpisodeButton-e1f4af77.js} +1 -1
  32. package/esm/{playlist-50110784.js → playlist-00b1419e.js} +1 -1
  33. package/esm/{series-f4732ee4.js → series-0121f5b4.js} +1 -1
  34. package/esm/{series-v2-49bf1379.js → series-v2-5f206910.js} +1 -1
  35. package/esm/{series-v2-f376e2c7.js → series-v2-d01d040c.js} +1 -1
  36. package/esm/{skin-088df88e.js → skin-2e556072.js} +1 -1
  37. package/esm/{skin-2799020a.js → skin-3f7a8576.js} +1 -1
  38. package/esm/{skin-7c0c3e8f.js → skin-4318c5f4.js} +1 -1
  39. package/esm/{skin-5356247b.js → skin-6d7d61a3.js} +1 -1
  40. package/esm/{skin-42981ba7.js → skin-a20deb25.js} +1 -1
  41. package/esm/{skin-88fcb96a.js → skin-ba56799a.js} +1 -1
  42. package/esm/{skin-e024d9b3.js → skin-e50f83dd.js} +1 -1
  43. package/esm/{videoSelector-f2197644.js → videoSelector-0a789e77.js} +1 -1
  44. package/esm/{videoSelector-12a6dc79.js → videoSelector-4d6cd6e0.js} +1 -1
  45. package/package.json +1 -1
  46. package/cjs/generic-adf27555.js +0 -1
@@ -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"),a=require("js-cookie"),l=require("ua-parser-js"),u=require("./captions-bf891620.js"),s=require("./skin-63ae6607.js"),d=require("@babel/runtime/helpers/toConsumableArray"),c=require("@babel/runtime/helpers/slicedToArray");function v(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function p(e,n){v("event",e,n)}var f={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 m(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function g(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?m(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var I={name:"@viewlift/player",version:"2.0.56",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",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","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"}};window.vl_player_version=I.version;var y,E=function(e,n){var t,o,i,a,l,u,s,d;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:null!==(l=window)&&void 0!==l&&null!==(u=l.customData)&&void 0!==u&&u.overrideEntitlementBaseUrl?(null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d?void 0:d.overrideEntitlementBaseUrl)+"/video/status":_.get()+"".concat(null==f?void 0:f.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":I.version,"x-player-name":"videojs"},withCredentials:!0})},h=function(e,n){var t,o,i,a;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:_.get()+f.getLinearChannelDetails,params:g(g(g(g(g({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(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===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},T=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,W();case 2:return o=e.sent,e.abrupt("return",r({url:_.get()+"".concat(null==f?void 0:f.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:g({},n),params:g({},(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)}}(),b=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:_.get()+"".concat(null==f?void 0:f.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})},w=function(e){var n=e.videoId;return r({method:"GET",url:_.get()+"".concat(null==f?void 0:f.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},_=(y=null==f?void 0:f.apiBaseUrl,{set:function(e){e&&(y=e)},get:function(){return y}}),S=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},O=null;function P(){return{set:function(e){e&&(O=e)},get:function(){return O}}}var A,D,L,C,R,x,V=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=P().get(),o=_.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)}}(),k=null,W=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"))||!S(n)){e.next=6;break}return k||(k=V().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&&P().set(i),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){k=null})),e.abrupt("return",k);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},N=function(e){D=e},j=function(){return D},U=function(){return A},M=function(e){L=e},B=function(e){if(C){var n=C.get(e);M(n+1)}},H=(x=0,{set:function(e){e>=0&&(x=e)},get:function(){return x}});function G(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 q(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?G(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Y=function(){var e,n,t,o,r,i,a,l=j();return"linearchannel"===((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.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==l?void 0:l.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==l||null===(r=l.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)};function Q(){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 z(){var e=window.sessionStorage.getItem("uid");return e||(e=Q(),window.sessionStorage.setItem("uid",e),e)}function X(){return K.apply(this,arguments)}function K(){return(K=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,W();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 J(e){return e?String(e):""}var $=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};var Z=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"},ee=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},ne=function(){var e=H.get();return e>=0?e+1:1},te=function(){var e,n,t,o=U(),r=j(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=H.get(),l=null==o||null===(n=o[a])||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 l>=0?l+1:1};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 re(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):oe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}window._deviceInfo=l.UAParser(navigator.userAgent);var ie=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ae=function(e){var n=le(e,"video.tags",[]),t=le(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},le=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},ue=function(){var n,t,o,r,l,u,s,d,c,v,p,f,m,g,I,y,E,h,T,b,w,_,S,O,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",A=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return P;var L=(null==D?void 0:D.siteName)||"",C=(null==D?void 0:D.contentType)||"video",R=(null==D||null===(o=D[C])||void 0===o?void 0:o.metadata)||(null==D||null===(r=D[C])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),x=i.getPlayer(A);if(!P.includes("VIEWLIFT_"))return P;var V,k=window.getComputedStyle(document.getElementById(A),null),W=Math.trunc(k.getPropertyValue("height").slice(0,-2)),F=Math.trunc(k.getPropertyValue("width").slice(0,-2)),N="linearchannel"===C?null==D||null===(u=D.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(d=s.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===d||null===(c=d.content)||void 0===c?void 0:c.id:le(D,"video.gist.id",""),j="linearchannel"===C?null==D||null===(v=D.linearchannel)||void 0===v||null===(p=v.channels)||void 0===p||null===(f=p.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===f?void 0:f.title:le(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,M=null;"function"==typeof window.__gpp&&(null===(V=window)||void 0===V||V.__gpp("ping",function(e){U=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var B=re(re({},se(R)),{},(_={VIEWLIFT_WIDTH:F,VIEWLIFT_HEIGHT:W,VIEWLIFT_SIZE:ie(F,W),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===(m=window)||void 0===m?void 0:m.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:le(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:le(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:le(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==x||null===(g=x.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==x||null===(I=x.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ae(D),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(le(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+le(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:le(null===(y=window)||void 0===y||null===(E=y.app_data)||void 0===E||null===(h=E.site)||void 0===h?void 0:h.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==L||"usanetwork"==L?"":le(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(w=b.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*le(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:le(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:j,VIEWLIFT_CONTENT_SERIES_TITLE:le(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:le(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:te(),VIEWLIFT_SEASON_NUMBER:ne(),VIEWLIFT_CONTENT_TAGS:ae(D),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(_,"VIEWLIFT_LAT",""),e(_,"VIEWLIFT_APP_BUNDLE",""),e(_,"VIEWLIFT_ATT_CONSENT",""),_),null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var H in B){var G=new RegExp(H,"g");P=P.replace(G,B[H])}return P},se=function(e){var n,t,o,r,i,a,l={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){u.set(e.name,e.value)}));var s=(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,d=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return s||d?(ee()?s?l=re(re({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):d&&(l=re(re({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?l=re(re({},l),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):d&&(l=re(re({},l),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?l=re(re({},l),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):d&&(l=re(re({},l),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),l=ee()?re(re({},l),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):re(re({},l),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(l=re(re({},l),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),l=ee()?re(re({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):re(re({},l),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),l=re(re({},l),{},{VIEWLIFT_AFID:u.get("afid")})},de=function(e,n){var t,o,r,i,a,l,u,s,d,c,v,p,f,m=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[m])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[m])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,y=null==e||null===(i=e[m])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,E=(null==e||null===(l=e[m])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(d=e[m])||void 0===d||null===(c=d.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[m])||void 0===v||null===(p=v.streamingInfo)||void 0===p||null===(f=p.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=y&&y.hls)return ve(y);if(g){var T=pe(I,n);return T.src=ue(T.src,n,e),T}if("Safari"!==Z()&&h)return ce(I);if(E){var b=ve(I);return b.src=ue(b.src,n,e),b}if(null!=I&&I.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return w.src=ue(w.src,n,e),w}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},pe=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,u=Z();if(i.getPlayer(n),"Safari"===u){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,function(e,n,t){console.log(e),e&&i(e),i(null,t)})}}}}}(r);return fe(n),s}var d,c={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(d=window)||void 0===d?void 0:d.siteName)?(fe(n),c.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.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==l?void 0:l.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:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var fe=function(e){var n=i.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==Z()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},me=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 Ie=!1,ye=function(e,n,t){var o=ue(n,e,t),r=i.getPlayer(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,a=i.getPlayer(e);if(null!==a.el_){Ie=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Ie&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout(function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()},1e3));var u=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&u.hasAttribute("controls")&&u.removeAttribute("controls");var s="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,s="touchend"),a.one(s,function(){d&&a.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;a.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),a.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})})}),a.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};var Ee,he=(Ee=!0,{enable:function(){Ee=!0},disable:function(){Ee=!1},get enabled(){return Ee}}),Te="ssai-breakStart",be="ssai-adImpression",we="ssai-firstQuartile",_e="ssai-midpoint",Se="ssai-thirdQuartile",Oe="ssai-complete",Pe="ssai-breakEnd",Ae={breakStart:Te,impression:be,firstQuartile:we,midpoint:_e,thirdQuartile:Se,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 Ce(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}function Re(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 xe(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)?xe(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,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function xe(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 Ve,ke=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),We=(Ve=null,{set:function(e){Ve=e},get position(){return Ve}});function Fe(e,n){return Ne.apply(this,arguments)}function Ne(){return(Ne=n(t.mark(function e(n,o){var r,a,l,u,s,d,v,p,f,m,g,I,y,E;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i.getPlayer(n),r=de(o,n),a=r.src,l=a.replace("/dash/","/session/").replace("/master/","/session/"),l=ue(l,n,o),u=je(l),s=c(u,2),d=s[0],v=s[1],l=new URL(l.split("?")[0]),Object.keys(v).length>0&&Object.entries(v).forEach(function(e){var n=c(e,2),t=n[0],o=n[1];l.searchParams.set(t,o)}),e.prev=8,e.next=11,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:Ce({},d)})});case 11:return p=e.sent,e.next=14,p.json();case 14:return f=e.sent,m="https://"+new URL(l).hostname,g=f.trackingUrl,I=f.manifestUrl,y=m+g,E=m+I,ke.set(y),console.log("%c TRACKING URL","background: #bdf369; color: #000",y),r.src=E,e.abrupt("return",r);case 26:return e.prev=26,e.t0=e.catch(8),e.abrupt("return",r);case 29:case"end":return e.stop()}},e,null,[[8,26]])}))).apply(this,arguments)}function je(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Re((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=c(t.value,2),a=i[0],l=i[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},s={},d=0,v=Object.entries(n);d<v.length;d++){var p=c(v[d],2),f=p[0],m=p[1];if(f.startsWith("ads."))u[f.replace(/^ads\./,"")]=m;else s[f]=m}return[u,s]}var Ue,Me=(Ue=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),Ue=Array.isArray(e)?d(e):Ue},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",Ue),d(Ue)}});function Be(){return Be=n(t.mark(function e(o,r){var a,l,u,c,v,p,f,m,g,I,y,E,h,T,b,w,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:_=function(e,n,t,r,a,l){var u=i.getPlayer(o);if(!u.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(u.currentTime());var s,d=Re(t);try{var c=function(){var t,i,d,c=s.value,v=c.eventType,p=c.beaconUrls,f=c.startTimeInSeconds,m=c.startTime,g=c.durationInSeconds,I=f||0,y=p,E=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,h="".concat(I,"_").concat(v),T=b.get("pod-".concat(a))||[];if(console.warn(e,I,"map:",v,"condition1:",e>=I,"map:",b),e>=I&&!T.includes(h)){T.push(h),b.set("pod-".concat(a),T);try{w(v,n,y,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var _=We.position;We.set(null),setTimeout(function(){null!=_&&(u.currentTime(_),l())},500)}if("function"==typeof E)try{var S,O={eventType:v,startTimeInSeconds:f,startTime:m,durationInSeconds:g,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[r],adIndex:r};E({adsData:O}),De(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}};for(d.s();!(s=d.n()).done;)c()}catch(e){d.e(e)}finally{d.f()}}},w=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)})})},T=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},We.set(r),v=ke.get(),(p=i.getPlayer(o)).one("loadeddata",function(){v&&h(v)}),f=new Map,m=new Map,g=-1,I=(null===(a=document)||void 0===a||null===(l=a.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,y=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("videoSelector"))||null,E=(null==p||null===(c=p.controlBar)||void 0===c?void 0:c.getChild("seriesV2"))||null,h=function(){var e=n(t.mark(function e(n){var a,l,u,c,v,p,h,b,w,S,O,P,A,D,L,C,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return A=function(e){document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",A),0===e.button&&S()},P=function(e){},O=function(){var e,n=h.currentTime(),t=null,o=Re(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(i+a));n>=i&&n<=l&&(t=l,f.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))},S=function(){var e,n=h.currentTime(),t=null,o=Re(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,u=Math.floor(i+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>u||n>i)&&!f.has(i)||n>=i&&n<=u)&&(t=i,f.set(i,!0),m.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))},l=!1,e.next=7,fetch(n);case 7:return u=e.sent,e.next=10,u.json();case 10:c=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",c),v=c.avails,p=[],h=i.getPlayer(o),b=h.controlBar.progressControl,w=b.seekBar.el(),v.map(function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(l=!0),p.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:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===r?void 0:r[0])||[]})}),!l&&r&&(h.currentTime(r),O()),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p),console.log(p,"data"),p.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",w.appendChild(i)}}),h.on("timeupdate",s.throttle(function(){var e=h.currentTime();if(e!==g){g=e;for(var n=!1,t=function(){var t=p[o],r=t.startTimeInSeconds,i=t.durationInSeconds,a=t.ads,l=r+i;if(e>=r-1.2&&e<=l+1.2){e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&f.set(r,!0),he.disable(),I&&I.classList.add("vjs-hidden"),y&&(y.el().style.pointerEvents="none",y.el().classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),b.el().style.visibility="hidden";for(var u=e-r,s=0,c=0,v=0;v<a.length;v++){var g,h=null==a||null===(g=a[v])||void 0===g?void 0:g.durationInSeconds;if(u<s+h){c=v;break}s+=h}a[c];var w=Math.max(0,i-u),S=Math.round(w);D.style.display="block",R.textContent="".concat(c+1," of ").concat(a.length," • ").concat(T(S));var P=[];return null==a||a.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});P.push.apply(P,d(n))}),Array.isArray(a)&&0==(null==a?void 0:a.length)&&P.push(null==t?void 0:t.podSlotImpressionBeacon),_(e,t,P,c,o,O),"break"}m.delete(r)},o=0;o<p.length;o++){if("break"===t())break}n||(D.style.display="none",b.el().style.visibility="visible",y&&(y.el().style.pointerEvents="auto",y.el().classList.remove("vjs-hidden")),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),I&&I.classList.remove("vjs-hidden"),he.enable())}},1e3)),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){he.enabled&&"ArrowRight"==e.key&&(S(),Ge(o,10),e.stopPropagation())}),b.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",P),document.addEventListener("pointerup",A))}),(D=document.createElement("div")).className="ssai-ad-container",(L=document.createElement("div")).className="sponsored-adbox",(C=document.createElement("div")).className="sponsored-text",C.textContent="Sponsored Ad",L.append(C),(R=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",D.append(L),D.append(R),h.el().appendChild(D);case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),b=new Map;case 16:case"end":return e.stop()}},e)})),Be.apply(this,arguments)}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}var Ge=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},qe=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},Ye=function(e){return!!o.getPlayer("".concat(e))},Qe=function(){var e=n(t.mark(function e(n,o){var r,a,l,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>2&&void 0!==u[2]&&u[2],e.next=3,W();case 3:return a=e.sent,l=i.getPlayer(n),e.abrupt("return",new Promise(function(e,t){h(o,a).then(function(t){var i=null==t?void 0:t.data;window.sid=Q(),i.contentType="linearchannel",i.channelId=null==o?void 0:o.channelId;var a=de(i,n);N(i),a&&r?(Ke(n,a),l.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:i})})):e({status:!0,msg:"Feed authenticated",response:i})}).catch(function(e){t({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)}}(),ze=function(){var e=n(t.mark(function e(o,r,a){var l,s,d,c,v,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return c=e.sent,(U()||null)&&B(r),v=0,p=0,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(d=s.watchHistory)&&void 0!==d&&d.enable&&b(r,c).then(function(e){var n,t,o,r,i,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),v=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,p=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||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,a){E(r,c).then(function(){var r=n(t.mark(function n(r){var l,s,d,c,f,m,g,I,y,E,h,T,b,w,_,S,O,P,A,D,L,C,R,x,V,k,W,F,j,U,M,B,H,G,q,Y,Q,z;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(S=null==r?void 0:r.data,O=(null==S?void 0:S.contentType)||"video",P=(null==S||null===(l=S[O])||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(c=d.appcmsMain)||void 0===c||null===(f=c.adsConfig)||void 0===f?void 0:f.vodAdSticherProvider)||!1,A=(null==S||null===(m=S.video)||void 0===m||null===(g=m.streamingInfo)||void 0===g?void 0:g.isLiveStream)||!1,N(r.data),(D=(null==S||null===(I=S.ads)||void 0===I||null===(y=I.preRoll)||void 0===y||null===(E=y.adTags)||void 0===E||null===(h=E.web)||void 0===h?void 0:h.active)&&(null==S||null===(T=S.ads)||void 0===T||null===(b=T.preRoll)||void 0===b||null===(w=b.adTags)||void 0===w||null===(_=w.web)||void 0===_?void 0:_.url))&&ye(o,D,S),L=de(S,o),!P){n.next=12;break}return n.next=11,Fe(o,S);case 11:L=n.sent;case 12:L?(B=(null==S||null===(C=S.video)||void 0===C||null===(R=C.gist)||void 0===R?void 0:R.videoImageUrl)||(null==S||null===(x=S.video)||void 0===x||null===(V=x.gist)||void 0===V||null===(k=V.imageGist)||void 0===k?void 0:k.r16x9),(H=i.getPlayer(o)).poster(B),Ke(o,L),H.on("loadstart",function(){A&&e({status:!0,msg:"Video Loaded",response:S})}),H.on("loadeddata",function(){ge(),e({status:!0,msg:"Video Loaded",response:S})}),H.one("play",function(){v&&p<95&&setTimeout(function(){H.currentTime(v)},0)}),H.one("error",function(){var e;a({status:!1,msg:(null==H||null===(e=H.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==S||null===(W=S.video)||void 0===W||null===(F=W.contentDetails)||void 0===F||null===(j=F.closedCaptions)||void 0===j?void 0:j.length)>0||(null==S||null===(U=S.video)||void 0===U||null===(M=U.closedCaptions)||void 0===M?void 0:M.length)>0?(z=(null==S||null===(q=S.video)||void 0===q||null===(Y=q.contentDetails)||void 0===Y?void 0:Y.closedCaptions)||(null==S||null===(Q=S.video)||void 0===Q?void 0:Q.closedCaptions),G=z.filter(function(e){return"VTT"===e.format}),u.addCaptions(o,G)):u.removeCaptions(o)):(me(o,"Incompatible Source, only hls,mp4,drm content is allowed"),a("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){Je(e,o,a,r)})}));case 9:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Xe=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()},Ke=function(e,n){var t=i.getPlayer(e);t&&t.src(n)},Je=function(n,t,o,r){var i,a,l,u,s,d,c=null==n||null===(i=n.response)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(u=l.data)||void 0===u?void 0:u.errorMessage)||(null==n?void 0:n.message);Ye(t)&&me(t,(null===(s=window)||void 0===s?void 0:s.customErrors)&&(null===(d=window)||void 0===d?void 0:d.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?He(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):He(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))};exports.adsQueuePointManager=Me,exports.authenticateLC=Qe,exports.baseUrlManager=_,exports.clearError=ge,exports.createIdxMapping=function(e){C=new Map,e.map(function(e,n){C.set(e.id,n)})},exports.createSeriesWatchMap=function(e,n){var t=new Map;w({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),R=t}).catch(function(e){return console.log(e)})},exports.detectBrowser=Z,exports.disableControls=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},exports.dispose=function(e){var n=i.getPlayer(e);if(Xe(),s.clearEventListeners(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},exports.getCurrentSeries=U,exports.getCurrentVideo=j,exports.getDecodedToken=F,exports.getEntitlementData=function(e,n,t,o){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},withCredentials:!0})},exports.getEpisodeNumber=te,exports.getLinearChannelDetails=h,exports.getSGAIEnabledSource=Fe,exports.getSeasonNumber=ne,exports.getSeriesDetails=function(e,n){var t,o,i=F(n),a=(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:_.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return R},exports.getSource=de,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(Te,e)},adImpression:function(e){return t(be,e)},adFirstQuartile:function(e){return t(we,e)},adMidpoint:function(e){return t(_e,e)},adThirdQuartile:function(e){return t(Se,e)},adComplete:function(e){return t(Oe,e)},adBreakEnd:function(e){return t(Pe,e)}}},exports.getToken=W,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=z,exports.getVideoDetails=E,exports.getVideoIdx=function(){return L},exports.getVideoInfo=b,exports.handleError=me,exports.initialiseAdvertisement=ye,exports.initialiseKeyboardEvents=function(e,n){var t,o,r,a=i.getPlayer(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,u=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,i,s,d,c,v,p,f;if(he.enabled&&"input"!=t.target.localName){var m=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(m)&&(t.preventDefault(),null==u||u.focus()),m){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.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||qe(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(s=i.appcmsMain)||void 0===s||null===(d=s.adsConfig)||void 0===d?void 0:d.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(p=v.appcmsMain)&&void 0!==p&&null!==(f=p.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;g||Ge(e,10)}}},!0)},exports.initiateErrorHandling=Je,exports.inititateBeacon=function(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&function(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=Q(),u="WEBSITE",s=null,d=0,c=null,v=0,m=0,g=!1,I=[],y=i.getPlayer(e);if(y){var E,h,T,b,w=$(function(){for(var e=y.currentTime(),n=y.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0}),S=function(){var e=n(t.mark(function e(n){var o,i,s,d,c,v,p,m,g,I,y;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return g=e.sent,I=F(g),e.t0=q,e.t1=q,e.t2=null==I?void 0:I.site,e.t3=null==I?void 0:I.siteId,e.t4=u,e.t5=z(),e.t6=Y(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11="production",e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?J(n.adPosition):"",e.next=25,X();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=l,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(s=n.bitrate)&&void 0!==s?s:null,e.t25=null!==(d=n.resHeight)&&void 0!==d?d:null,e.t26=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t27=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==a||null===(p=a.beacon)||void 0===p?void 0:p.params,e.t32=(0,e.t0)(e.t30,e.t31),y=[e.t32],r({url:(null==a||null===(m=a.beacon)||void 0===m?void 0:m.url)||_.get()+f.getBeaconUrl,method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:y}).catch(function(e){return console.error(e)});case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),O=function(e){if(!y.paused()&&y.readyState()>2)return clearInterval(s),clearInterval(c),e;var n,t=e+.1;return+t.toFixed(2)>=5&&m<4&&g?(m++,p("BUFFERING",q({pfm:u,uid:z(),vid:Y(),videoPosition:Math.floor(y.currentTime)},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),S({eventName:"BUFFERING",videoPosition:Math.floor(y.currentTime),isAdEvent:!1}),0):t};E=Math.floor(y.currentTime),y.on("error",function(){var e,n=Math.floor(y.currentTime);clearInterval(s);var t=E===n?"FAILED_TO_START":"DROPPED_STREAM";p(t,q({pfm:u,uid:z(),vid:Y(),videoPosition:n},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),S({eventName:t,videoPosition:n,isAdEvent:!1})}),h=!1,y.on("waiting",$(function(){g&&(h=!0,clearInterval(s),s=setInterval(function(){h&&!y.paused()?v=O(v):clearInterval(s)},100))})),y.on("playing",$(function(){h=!1,clearInterval(s)})),T=function(e){var n,t,o,r=q({videoPosition:Math.floor(y.currentTime),isAdEvent:!0,bufferHealth:w(),pfm:u,uid:z(),vid:Y(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==a||null===(o=a.beacon)||void 0===o?void 0:o.params);p(e,q({},r)),S(q({eventName:e,adPosition:1},r))},y.on("adstart",function(){T("AD_REQUEST"),T("AD_IMPRESSION")}),y.on("adskip",function(){d=0}),y.on("adend",function(){d=0}),y.on("timeupdate",function(){var e,n,t,o,r=Math.floor(y.currentTime());if(console.log(r,I),r>=30&&r%30==0&&!I.includes(r)){var i,a=null===(i=y.el().getElementsByTagName("video"))||void 0===i?void 0:i[0];m=0,I.push(r),S({eventName:"PING",videoPosition:r,isAdEvent:!1,duration:30,resHeight:(null==a?void 0:a.videoHeight)||null,resWidth:(null==a?void 0:a.videoWidth)||null,bufferHealth:w(),bitrate:Math.round((null==y||null===(e=y.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)})}}),b=$(function(){var e;d=0,c=setInterval(function(){d=O(d)},100),p("PLAY",q({pfm:u,uid:z(),vid:Y(),videoPosition:Math.floor(y.currentTime)},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),S({eventName:"PLAY",videoPosition:Math.floor(y.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":Y(),watchTime:Math.floor(y.currentTime)})}),y.one("play",b),y.on("loadeddata",function(){y.one("timeupdate",function(){var e;clearInterval(c),clearInterval(s),v=d||0,p("FIRST_FRAME",q({pfm:u,uid:z(),vid:Y(),videoPosition:Math.floor(y.currentTime),ttFirstFrame:d,bufferHealth:w()},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),S({eventName:"FIRST_FRAME",videoPosition:Math.floor(y.currentTime),isAdEvent:!1,ttFirstFrame:d,bufferHealth:w()}),g=!0,d=0})})}else console.error("Videojs: Player instance not found.")}(e,o,a)},exports.isMobile=ee,exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=Ye,exports.isTokenExpired=S,exports.load=ze,exports.loadVideo=Ke,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=P,exports.rewind=qe,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],v("js",new Date),v("config",e)},exports.saveWatchHistory=T,exports.seasonIdxManager=H,exports.setCurrentSeries=function(e){A=e},exports.setCurrentVideo=N,exports.setVideoIdx=M,exports.setVideoIdxById=B,exports.setupAdvertisementMarkers=function(e,n){return Be.apply(this,arguments)},exports.skip=Ge,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};