@viewlift/player-backup 1.0.148-backup → 1.0.149-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-7d9c13ee.js → autoNextVideo-797dbf91.js} +1 -1
- package/cjs/{caption-settings-9c1b3488.js → caption-settings-0214c4e9.js} +1 -1
- package/cjs/{features-6e2b6252.js → features-5bbe66de.js} +1 -1
- package/cjs/index-64eea579.js +1 -0
- package/cjs/index-854ddef8.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{keyboardShortcuts-d16b1345.js → keyboardShortcuts-f7537952.js} +1 -1
- package/cjs/{multicamv2-54391b10.js → multicamv2-0fd2b151.js} +1 -1
- package/cjs/{multicamv2-afe52901.js → multicamv2-23c2dfab.js} +1 -1
- package/cjs/{nextEpisodeButton-98837bff.js → nextEpisodeButton-33638c49.js} +1 -1
- package/cjs/{playlist-41b29748.js → playlist-a1e556ba.js} +1 -1
- package/cjs/{series-2c4f8dcc.js → series-8808ae48.js} +1 -1
- package/cjs/{series-v2-eb852fad.js → series-v2-917f4210.js} +1 -1
- package/cjs/{series-v2-d2b9551d.js → series-v2-c721c0d7.js} +1 -1
- package/cjs/{settings-icon-08bd6ca1.js → settings-icon-408d8874.js} +1 -1
- package/cjs/{skin-837aff67.js → skin-09220897.js} +1 -1
- package/cjs/{skin-a7a7560c.js → skin-0935643c.js} +1 -1
- package/cjs/{skin-0823db1a.js → skin-a265cb5e.js} +1 -1
- package/cjs/{skin-2e89029c.js → skin-aec6c1da.js} +1 -1
- package/cjs/{skin-7ff32c17.js → skin-c55ad5f7.js} +1 -1
- package/cjs/{skin-0f1bc86a.js → skin-eb7a8b1d.js} +1 -1
- package/cjs/{videoSelector-a4c12e0a.js → videoSelector-c9942e1d.js} +1 -1
- package/cjs/{videoSelector-be348ea0.js → videoSelector-e724388a.js} +1 -1
- package/esm/{autoNextVideo-1ce21853.js → autoNextVideo-319be4bd.js} +1 -1
- package/esm/{caption-settings-34436257.js → caption-settings-b490d024.js} +1 -1
- package/esm/{features-ade57cc3.js → features-c7b9d344.js} +1 -1
- package/esm/{index-769809d7.js → index-090a5245.js} +1 -1
- package/esm/index-22f5f333.js +1 -0
- package/esm/index.js +1 -1
- package/esm/{keyboardShortcuts-1960f3cd.js → keyboardShortcuts-f3e00811.js} +1 -1
- package/esm/{multicamv2-402ecef7.js → multicamv2-3d5a7db6.js} +1 -1
- package/esm/{multicamv2-55a92ab0.js → multicamv2-480e3341.js} +1 -1
- package/esm/{nextEpisodeButton-12ec8cc2.js → nextEpisodeButton-a9d6f983.js} +1 -1
- package/esm/{playlist-23a3297f.js → playlist-57207df1.js} +1 -1
- package/esm/{series-6167a239.js → series-9ddec07d.js} +1 -1
- package/esm/{series-v2-050748d0.js → series-v2-ea50099c.js} +1 -1
- package/esm/{series-v2-1a219e38.js → series-v2-f244ecc7.js} +1 -1
- package/esm/{settings-icon-6eb387fc.js → settings-icon-272cded6.js} +1 -1
- package/esm/{skin-3a674901.js → skin-39389aee.js} +1 -1
- package/esm/{skin-af3b54f1.js → skin-41b5bd29.js} +1 -1
- package/esm/{skin-26ebf184.js → skin-996b4e20.js} +1 -1
- package/esm/{skin-09e914e0.js → skin-9e74d2f7.js} +1 -1
- package/esm/{skin-617e7646.js → skin-b44a261a.js} +1 -1
- package/esm/{skin-b21836b3.js → skin-d5e9a6b6.js} +1 -1
- package/esm/{videoSelector-35526c6f.js → videoSelector-015ce257.js} +1 -1
- package/esm/{videoSelector-03b95953.js → videoSelector-ec941a1b.js} +1 -1
- package/package.json +1 -1
- package/cjs/index-132e25bf.js +0 -1
- package/cjs/index-42f92d7c.js +0 -1
- package/esm/index-7765e9ea.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t,c as s,d as o,e as i}from"./features-
|
|
1
|
+
import{a as e,b as t,c as s,d as o,e as i}from"./features-c7b9d344.js";import{i as n}from"./keyboardShortcuts-f3e00811.js";import{S as l,M as r,a,N as d,b as m,R as u}from"./icons-79ad4d7d.js";import{g as p,a as c,c as v}from"./index-22f5f333.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"@babel/runtime/helpers/inherits";import"video.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";function b(b,f){p(b).addClass("skin_default"),n(b,f),import("./skin-71be210e.js").then((function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){0==t.liveVideo&&0==t.liveui&&o(e,"default",m());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&i(e,"default",u())}(b,f),function(o,i){var n=p(o),r=(null==i?void 0:i.sres)||null;n.on("loadeddata",(function(){e(o,"default",l()),r&&import("./nextEpisodeButton-a9d6f983.js").then((function(e){e.initaliseFunctionality(i.sres.seasons,c())}))})),n.one("loadedmetadata",(function(){var e;r&&(t(o,null==i||null===(e=i.sres)||void 0===e?void 0:e.seasons,i),s(i.sres,i.res,o))}))}(b,f),function(e,t){var s,o,i=p(e),n=document.getElementsByClassName("vjs-current-time")[0],l=document.getElementsByClassName("vjs-duration")[0],m=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(n&&(n.style.display="none"),l&&(l.style.display="none"),m&&(m.style.display="none"));null===(s=i.controlBar.getChild("FullscreenToggle"))||void 0===s||null===(s=s.el())||void 0===s||s.appendChild(v(r(window.controlsColor))),null===(o=i.controlBar.getChild("FullscreenToggle"))||void 0===o||null===(o=o.el())||void 0===o||o.appendChild(v(a(window.controlsColor)));var u=i.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(v(d()));var c=document.createElement("div");c.classList.add("caption-header"),u.querySelector(".vjs-menu-content").insertBefore(c,u.querySelector(".vjs-menu-item"))}(b,f)}export{b as initialiseSkin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import i from"@babel/runtime/helpers/inherits";import a from"video.js";import{E as l,f as r}from"./icons-79ad4d7d.js";import{u as d,v as s,w as c,l as m,x as p,H as u,n as v,z as h}from"./index-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import i from"@babel/runtime/helpers/inherits";import a from"video.js";import{E as l,f as r}from"./icons-79ad4d7d.js";import{u as d,v as s,w as c,l as m,x as p,H as u,n as v,z as h}from"./index-22f5f333.js";import{a as f}from"./autoNextVideo-319be4bd.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b=function(){return!!e})()}var y=a.getComponent("Component"),C=function(){function C(t){var i,a,l,r,d,s,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,C),r=this,s=[t,c],d=n(d=C),(l=o(r,b()?Reflect.construct(d,s||[],n(r).constructor):d.apply(r,s))).playerId=c.playerId,l.seriesData=c.sres,l.videos=c.related.content,l.cb=(null==c||null===(i=c.related)||void 0===i?void 0:i.cb)||null,l.autoNext=(null==c||null===(a=c.related)||void 0===a?void 0:a.autoNext)||!1,l.currentVideoData=c.res,l.initialiseStructure(),l.loadCSS(),l.autoNext&&(h(0),f({playerId:l.playerId,content:l.videos,cb:l.cb})),l}return i(C,y),t(C,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(l())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-8e258d45.js").then((function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(d(),o.classList.remove("hidden"),t.classList.add("open"),o.style.right="0px",s(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"),o.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),a.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),c(this.playerId,o)}}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(r())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px"};for(var l=a.dom.createEl("div",{className:"video-selector-title",innerHTML:m("relatedVideoTitle")||"Recommended"}),d=a.dom.createEl("div",{className:"video-selector-content"}),s=a.dom.createEl("div",{className:"video-container"}),c=function(e){var o,n,i,l=a.dom.createEl("div",{className:"video -".concat(e)}),r=a.dom.createEl("div",{className:"recommended -".concat(e)});r.setAttribute("video-idx",e),r.onclick=function(){h(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";u(e),v(t.playerId,t.videos[e].id).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var c=document.createElement("img");c.className="related-thumbnail-image",c.src="".concat((null==t||null===(o=t.videos)||void 0===o||null===(o=o[e])||void 0===o?void 0:o.img)||(null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n?void 0:n.fallbackImage)),c.alt="No Thumbnail Available",r.append(c);var m=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(i=t.videos[e])||void 0===i?void 0:i.title)||"")});a.dom.appendContent(l,r),a.dom.appendContent(l,m),a.dom.appendContent(s,l),a.dom.appendContent(d,s)},f=0;f<this.videos.length;f++)c(f);a.dom.appendContent(n,i),a.dom.appendContent(n,l),a.dom.appendContent(e,n),a.dom.appendContent(e,d),p(this.playerId,e)}}])}();export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import i from"@babel/runtime/helpers/inherits";import a from"video.js";import{e as r,f as l}from"./icons-79ad4d7d.js";import{u as d,v as s,w as c,l as m,x as u,y as p,n as v,z as h}from"./index-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import i from"@babel/runtime/helpers/inherits";import a from"video.js";import{e as r,f as l}from"./icons-79ad4d7d.js";import{u as d,v as s,w as c,l as m,x as u,y as p,n as v,z as h}from"./index-22f5f333.js";import{a as f}from"./autoNextVideo-319be4bd.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b=function(){return!!e})()}var y=a.getComponent("Component"),C=function(){function C(t){var i,a,r,l,d,s,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,C),l=this,s=[t,c],d=n(d=C),(r=o(l,b()?Reflect.construct(d,s||[],n(l).constructor):d.apply(l,s))).playerId=c.playerId,r.seriesData=c.sres,r.videos=c.related.content,r.cb=(null==c||null===(i=c.related)||void 0===i?void 0:i.cb)||null,r.autoNext=(null==c||null===(a=c.related)||void 0===a?void 0:a.autoNext)||!1,r.currentVideoData=c.res,r.initialiseStructure(),r.loadCSS(),r.autoNext&&(h(0),f({playerId:r.playerId,content:r.videos,cb:r.cb})),r}return i(C,y),t(C,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-538a2e27.js").then((function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(d(),o.classList.remove("hidden"),t.classList.add("open"),s(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"))};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),a.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),c(this.playerId,o)}}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(l())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open")};for(var r=a.dom.createEl("div",{className:"video-selector-title",innerHTML:m("relatedVideoTitle")||"Recommended"}),d=a.dom.createEl("div",{className:"video-selector-content"}),s=a.dom.createEl("div",{className:"video-container"}),c=function(e){var o,n,i,r=a.dom.createEl("div",{className:"video -".concat(e)}),l=a.dom.createEl("div",{className:"recommended -".concat(e)});l.setAttribute("video-idx",e),l.onclick=function(){h(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";p(e),v(t.playerId,t.videos[e].id).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var c=document.createElement("img");c.className="related-thumbnail-image",c.src="".concat((null==t||null===(o=t.videos)||void 0===o||null===(o=o[e])||void 0===o?void 0:o.img)||(null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n?void 0:n.fallbackImage)),c.alt="No Thumbnail Available",l.append(c);var m=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(i=t.videos[e])||void 0===i?void 0:i.title)||"")});a.dom.appendContent(r,l),a.dom.appendContent(r,m),a.dom.appendContent(s,r),a.dom.appendContent(d,s)},f=0;f<this.videos.length;f++)c(f);a.dom.appendContent(n,r),a.dom.appendContent(n,i),a.dom.appendContent(e,n),a.dom.appendContent(e,d),u(this.playerId,e)}}])}();export{C as default};
|
package/package.json
CHANGED
package/cjs/index-132e25bf.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),i=require("axios"),o=require("video.js"),r=require("js-cookie"),l=require("ua-parser-js"),a=require("@babel/runtime/helpers/typeof"),d=require("@babel/runtime/helpers/toConsumableArray"),u=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/createClass"),c=require("@babel/runtime/helpers/possibleConstructorReturn"),v=require("@babel/runtime/helpers/getPrototypeOf"),m=require("@babel/runtime/helpers/inherits"),p={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"};function f(){var e;null===(e=window)||void 0===e||null===(e=e.dataLayer)||void 0===e||e.push(arguments)}function h(e,n){f("event",e,n)}var g=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},w=null;function y(){return{set:function(e){e&&(w=e)},get:function(){return w}}}var I,E,b,T,O,_,S=function(){var e=n(t.mark((function e(){var n,i,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=y().get(),i=getBaseUrl(),e.prev=2,e.next=5,axios({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return o=e.sent,e.abrupt("return",o);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)}}(),D=null,k=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"))||!g(n)){e.next=6;break}return D||(D=S().then((function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&y().set(r),o||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){D=null}))),e.abrupt("return",D);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},C=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){E=e},R=function(){return E},A=function(){return I},L=function(e){b=e},F=function(){return O},N=function(e){if(T){var n=T.get(e);L(n+1)}},V=(_=0,{set:function(e){e>=0&&(_=e)},get:function(){return _}}),j=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))};function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function W(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?B(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var H=function(){var e,n,t,i=R();return"linearchannel"==((null==i?void 0:i.contentType)||"video")?null==i||null===(e=i.linearchannel)||void 0===e||null===(e=e.channels)||void 0===e||null===(e=e.find((function(e){return(null==e?void 0:e.id)===(null==i?void 0:i.channelId)})))||void 0===e||null===(e=e.content)||void 0===e?void 0:e.id:(null==i||null===(n=i.video)||void 0===n||null===(n=n.gist)||void 0===n?void 0:n.id)||(null==i||null===(t=i.video)||void 0===t?void 0:t.id)};function M(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function U(){var e=window.sessionStorage.getItem("uid");return e||(e=M(),window.sessionStorage.setItem("uid",e),e)}function q(){return z.apply(this,arguments)}function z(){return z=n(t.mark((function e(){var n,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),z.apply(this,arguments)}window.initialise=function(e){window.sid=M(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,i=Math.floor(e.currentTime());h(i?"FAILED_TO_START":"DROPPED_STREAM",W({pfm:window.platform,uid:U(),vid:H(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.beacon)||void 0===t?void 0:t.params)),fireEvent({eventName:n===i?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),h("PLAY",W({pfm:window.platform,uid:U(),vid:H(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var n;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(n=n.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t;if(n.el_){var i,o=e+.1;if(+o.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(t=t.className)&&void 0!==t&&t.includes("vjs-waiting"))h("BUFFERING",W({pfm:window.platform,uid:U(),vid:H(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(i=i.customData)||void 0===i||null===(i=i.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return o}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,h("FIRST_FRAME",W({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:U(),vid:H()},null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.beacon)||void 0===n?void 0:n.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;h("AD_REQUEST",W({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:U(),vid:H(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),h("AD_IMPRESSION",W({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:U(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:H()},null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.beacon)||void 0===t?void 0:t.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)&&(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(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(G(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}}))()};var G=function(e,n,t){return e>=n&&e<=t};function K(e){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=j(e);window.initialise(n),window.firstFrame(n),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=n(t.mark((function e(n){var o,r,l,a,d,u,s,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k();case 2:return a=e.sent,d=C(a),u=null==d?void 0:d.site,s=null==d?void 0:d.siteId,e.t0=W,e.t1=W,e.t2=W({aid:u,cid:s,pfm:window.platform},null===(o=window)||void 0===o||null===(o=o.customData)||void 0===o||null===(o=o.beacon)||void 0===o?void 0:o.params),e.t3={},e.t4=U(),e.t5=H(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=n.videoPosition,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:"",e.t17=!0===n.isAdEvent?(t=n.adPosition)?String(t):"":"",e.next=26,q();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=n.ttFirstFrame,e.t23=n.bitrate,e.t24=n.resHeight,e.t25=n.resWidth,e.t26=n.bufferHealth,e.t27={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:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(r=window)||void 0===r||null===(r=r.customData)||void 0===r||null===(r=r.beacon)||void 0===r?void 0:r.params,e.t31=(0,e.t0)(e.t29,e.t30),c=[e.t31],i({url:(null===(l=window)||void 0===l||null===(l=l.customData)||void 0===l||null===(l=l.beacon)||void 0===l?void 0:l.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:a},contentType:"application/x-www-form-urlencoded",dataType:"text",data:c}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var t}),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}}};function Y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function J(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Y(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var $={name:"@viewlift/player8",version:"1.0.110",main:"dist/bundle.cjs.js",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","video.js":"^8.21.1","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=$.version;var Q,X=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(t=t.customData)&&void 0!==t&&t.overrideEntitlementResponse?new Promise((function(e,n){var t;return e({data:null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t?void 0:t.overrideEntitlementResponse})})):i({url:null!==(r=window)&&void 0!==r&&null!==(r=r.customData)&&void 0!==r&&r.overrideEntitlementBaseUrl?(null===(l=window)||void 0===l||null===(l=l.customData)||void 0===l?void 0:l.overrideEntitlementBaseUrl)+"/video/status":oe.get()+"".concat(null==p?void 0:p.getVideoDetails),params:J({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(o=window)||void 0===o||null===(o=o.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":$.version},withCredentials:!0})},Z=function(e,n){var t,o;return null!==(t=window)&&void 0!==t&&null!==(t=t.customData)&&void 0!==t&&t.overrideEntitlementResponse?new Promise((function(e,n){var t;return e({data:null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t?void 0:t.overrideEntitlementResponse})})):i({url:oe.get()+p.getLinearChannelDetails,params:J(J(J(J(J({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===(o=window)||void 0===o||null===(o=o.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:n}})},ee=function(e,n){var t,o=C(n),r=(null==o?void 0:o.site)||null;return null!==(t=window)&&void 0!==t&&null!==(t=t.customData)&&void 0!==t&&t.seriesData?new Promise((function(e,n){var t;return e({data:null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t?void 0:t.seriesData})})):i({url:oe.get()+"/v3/content/series/".concat(e),params:{site:r},method:"GET",headers:{Authorization:n}})},ne=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,getToken();case 2:return o=e.sent,e.abrupt("return",i({url:oe.get()+"".concat(null==p?void 0:p.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:J({},n),params:J({},(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)}}(),te=function(e,n){var t,o=window.contentType;return i({method:"GET",url:oe.get()+"".concat(null==p?void 0:p.getVideoInfoV2,"/").concat(o,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(t=t.watchHistory)||void 0===t?void 0:t.xApiKey},timeout:15e3})},ie=function(e){var n=e.videoId;return i({method:"GET",url:oe.get()+"".concat(null==p?void 0:p.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},oe=(Q=null==p?void 0:p.apiBaseUrl,{set:function(e){e&&(Q=e)},get:function(){return Q}}),re=function(e,n,t){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:n},withCredentials:!0})},le=function(e,n){var t=new Map;ie({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),O=t})).catch((function(e){return console.log(e)}))},ae=function(){var e=V.get();return e>=0?e+1:1},de=function(){var e,n,t=A(),i=R(),o=null==i||null===(e=i.video)||void 0===e?void 0:e.id,r=V.get(),l=null==t||null===(n=t[r])||void 0===n||null===(n=n.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===o}));return l>=0?l+1:1};function ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function se(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ue(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var ce=new Set,ve=function(e,n,t){var i,o,r,l,a,d,u,s,c,v={};v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.ASSET_NAME]=fe(e),v["c3.cm.id"]=(null==e||null===(o=e.linearchannel)||void 0===o?void 0:o.id)||(null==e||null===(r=e.video)||void 0===r?void 0:r.id)||"",v["c3.cm.contentType"]=he(e),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==t||null===(d=t.Constants)||void 0===d?void 0:d.VIEWER_ID]="undefined"===U()?"NA":U(),v["c3.cm.categoryType"]=me(e),v[null==t||null===(u=t.Constants)||void 0===u?void 0:u.PLAYER_NAME]="VL_WEB_PLAYER",v["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"}}(),v.encoding="",v.screenResolution="",v.DRMEnabled=(null==e||null===(s=e.video)||void 0===s?void 0:s.drmEnabled)||(null==e||null===(c=e.linearchannel)||void 0===c?void 0:c.drmEnabled)||"None",v.subscriberType="",v.DAIStream=pe();var m=ge(A(),e);return v=se(se({},v),m)},me=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(n=n.categories)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.title)||"Null";var n},pe=function(e){var n,t=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[t])||void 0===n||null===(n=n.liveDetails)||void 0===n?void 0:n.isDvrEnabled)||!1;return i?"YES":"NO"},fe=function(e){var n,t,i=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[i])||void 0===n||null===(n=n.gist)||void 0===n?void 0:n.title)||" Null",r=(null==e||null===(t=e[i])||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.id)||" Null";return"[".concat(r,"] ").concat(o)},he=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ge=function(e,n){var t,i,o={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n)return o;var r=ae(),l=de();return o["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(t=t.series)||void 0===t?void 0:t.title)||"Null",o["c3.cm.seasonNumber"]=(null==r?void 0:r.toString())||"Null",o["c3.cm.showTitle"]=(null==e||null===(i=e[r-1])||void 0===i||null===(i=i.episodes)||void 0===i||null===(i=i[l-1])||void 0===i?void 0:i.title)||"Null",o["c3.cm.episodeNumber"]=(null==r?void 0:r.toString())||"Null",o},we=function(){var e=n(t.mark((function e(n,i){var o,r,l,a,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=i&&null!==(o=i.convivaConfig)&&void 0!==o&&o.enable){e.next=2;break}return e.abrupt("return");case 2:if(l=j(n),"function"==typeof(a=null==i||null===(r=i.convivaConfig)||void 0===r?void 0:r.trackConvivaPlayerEvent)){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,a("getConvivaObject");case 8:if(d=e.sent){e.next=11;break}return e.abrupt("return");case 11:a("setPlayer",l),l.on("loadstart",(function(){a("playbackEnded");var e=R(),n=ve(e,l,d);n.authToken=(null==i?void 0:i.token)||"NA",a("contentInfo",n)})),l.on("play",(function(){ce.has(l.currentSrc())||(ce.add(l.currentSrc()),a("playbackStarted",null))})),l.on("ended",(function(){ce.has(l.currentSrc())&&ce.delete(l.currentSrc()),a("playbackEnded")}));case 15:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),ye=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 i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},Ie=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Ee=function(){var e;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgentData)||void 0===e?void 0:e.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"},be=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},Te=function(e){return new Promise((function(n,t){if(Oe(e))t("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},Oe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},_e=function(){var e=n(t.mark((function e(n){var i,r,l,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=j(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return a=e.sent,e.prev=6,e.next=9,Te("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,a.default(o),e.finish(14);case 17:null!==(l=window)&&void 0!==l&&l.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==Ee()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),Se=function(e,n){var t=j(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,i=this.el(),r=o.dom.getPointerPosition(i,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var l=window.cast&&window.cast.framework&&window.cast.framework.CastSession,a=null===(t=window)||void 0===t||null===(t=t.cast)||void 0===t||null===(t=t.framework)||void 0===t||null===(t=t.CastContext)||void 0===t||null===(t=t.getInstance())||void 0===t?void 0:t.S;if(console.log(l),l&&"CONNECTED"===a){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),u=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=u*r,d.seek()}}))};function De(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ke(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?De(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}window._deviceInfo=l(navigator.userAgent);var Pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},Ce=function(e){var n=xe(e,"video.tags",[]),t=xe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},xe=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},Re=function(){var e,n,t,i,o,l,a,d,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s=arguments.length>1?arguments[1]:void 0,c=arguments.length>2?arguments[2]:void 0,v=(null==c?void 0:c.contentType)||"video",m=null==c||null===(e=c[v])||void 0===e?void 0:e.metadata,p=j(s);if(!u.includes("VIEWLIFT_"))return u;var f=window.getComputedStyle(document.getElementById(s),null),h=Math.trunc(f.getPropertyValue("height").slice(0,-2)),g=Math.trunc(f.getPropertyValue("width").slice(0,-2)),w="linearchannel"===v?null==c||null===(n=c.linearchannel)||void 0===n||null===(n=n.channels)||void 0===n||null===(n=n.find((function(e){return(null==e?void 0:e.id)===(null==c?void 0:c.channelId)})))||void 0===n||null===(n=n.content)||void 0===n?void 0:n.id:xe(c,"video.gist.id",""),y=ke(ke({},Ae(m)),{},{VIEWLIFT_WIDTH:g,VIEWLIFT_HEIGHT:h,VIEWLIFT_SIZE:Pe(g,h),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===(t=window)||void 0===t?void 0:t.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:xe(c,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:xe(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:xe(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==p||null===(i=p.options_)||void 0===i?void 0:i.autoplay)||1,VIEWLIFT_MUTE:(null==p||null===(o=p.options_)||void 0===o?void 0:o.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:Ce(c),VIEWLIFT_MEDIA_ID:w,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(xe(c,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:w,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+xe(c,"video.gist.permalink","")),VIEWLIFT_CONSENT:r.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:xe(null===(l=window)||void 0===l||null===(l=l.app_data)||void 0===l||null===(l=l.site)||void 0===l?void 0:l.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:xe(null===(a=window)||void 0===a||null===(a=a.app_data)||void 0===a||null===(a=a.site)||void 0===a?void 0:a.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*xe(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:xe(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:w,VIEWLIFT_CONTENT_TITLE:xe(c,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:xe(c,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:xe(c,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:de(),VIEWLIFT_SEASON_NUMBER:ae(),VIEWLIFT_CONTENT_TAGS:Ce(c)},null===(d=window)||void 0===d||null===(d=d.customData)||void 0===d?void 0:d.macros);for(var I in y){var E=new RegExp(I,"g");u=u.replace(E,y[I])}return u},Ae=function(e){var n,t,i={},o=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){o.set(e.name,e.value)})));var r=(null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.subscription)||void 0===n?void 0:n.SVOD)||!1,l=(null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.subscription)||void 0===t?void 0:t.TVE)||!1;return r||l?(be()?r?i=ke(ke({},i),{},{VIEWLIFT_CSID:o.get("csid.mweb.dtc")||""}):l&&(i=ke(ke({},i),{},{VIEWLIFT_CSID:o.get("csid.mweb.tve")||""})):r?i=ke(ke({},i),{},{VIEWLIFT_CSID:o.get("csid.web.dtc")||""}):l&&(i=ke(ke({},i),{},{VIEWLIFT_CSID:o.get("csid.web.tve")||""})),r?i=ke(ke({},i),{},{VIEWLIFT_SFID:o.get("sfid.dtc")||""}):l&&(i=ke(ke({},i),{},{VIEWLIFT_SFID:o.get("sfid.tve")||""})),i=be()?ke(ke({},i),{},{VIEWLIFT_PROF:o.get("prof.mweb")||""}):ke(ke({},i),{},{VIEWLIFT_PROF:o.get("prof.web")||""})):(i=ke(ke({},i),{},{VIEWLIFT_SFID:o.get("sfid.dtc")||""}),i=be()?ke(ke({},i),{},{VIEWLIFT_CSID:o.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:o.get("prof.mweb")||""}):ke(ke({},i),{},{VIEWLIFT_CSID:o.get("csid.web.dtc")||"",VIEWLIFT_PROF:o.get("prof.web")||""})),i},Le=function(e,n){var t,i,o,r,l,a,d=(null==e?void 0:e.contentType)||"video",u=null==e||null===(t=e[d])||void 0===t?void 0:t.drmEnabled,s=null==e||null===(i=e[d])||void 0===i||null===(i=i.streamingInfo)||void 0===i?void 0:i.videoAssets,c=null==e||null===(o=e[d])||void 0===o||null===(o=o.streamingInfo)||void 0===o?void 0:o.audioAssets,v=(null==e||null===(r=e[d])||void 0===r||null===(r=r.streamingInfo)||void 0===r||null===(r=r.videoAssets)||void 0===r?void 0:r.hls)||!1;null==e||null===(l=e[d])||void 0===l||null===(l=l.liveDetails)||void 0===l||l.isDvrEnabled;var m=(null==e||null===(a=e[d])||void 0===a||null===(a=a.streamingInfo)||void 0===a||null===(a=a.videoAssets)||void 0===a?void 0:a.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=c&&c.hls)return Ne(c);if(u){var p=Ve(s,n);return p.src=Re(p.src,n,e),p}if("Safari"!==Ee()&&m)return Fe(s);if(v){var f=Ne(s);return f.src=Re(f.src,n,e),f}if(null!=s&&s.mpeg){var h=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(s);return h.src=Re(h.src,n,e),h}return null},Fe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Ne=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ve=function(e,n){var t=e.fairPlay,i=e.widevine,r=e.playReady,l=Ee();if(j(n),"Safari"===l){var a=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};console.log("🔐 Requesting FairPlay Certificate...",i),o.xhr(i,(function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);return Be(n),a}var d={src:i.url,type:"application/dash+xml"};return Be(n),d.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},d};var je,Be=function(e){var n=j(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==Ee()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},We=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}};function He(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Me(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?He(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):He(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var Ue=[],qe=0,ze=null;function Ge(n,t,i){var o,r,l,a,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(o=t.watchHistory)||void 0===o||o.apiVersion;var s=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,c=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,p=(null==t||null===(d=t.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,f=Math.floor(n.currentTime()),h=u?100:Math.floor(c/v*100),g={};p?function(n,t,i){var o=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(i),r=Ke(o),l=(new Date).getTime(),a=R(),d=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return Me(Me({},n),{},e({},t,d[t]))}),{}),s=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===je}));s<0?r.push(Me(Me({content:u},n),{},{addedDate:l,updateDate:l})):r[s]=Me(Me(Me({},r[s]),n),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(r))}(g={completed:u,watchedTime:f,watchedPercentage:h},s,t.siteOwner):(g=Me(Me({videoId:je,watchedTime:f,watchedPercentage:h,doneWatching:u,profileId:s},ze&&{seriesId:ze}),m&&{originalObjectId:m}),ne(g).then((function(e){})).catch((function(e){}))),qe=c+i}function Ke(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ye(e,n,t){var i=Ke(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var Je=function(e,n,t){var i=j(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var o=parseFloat(n)/100;i.volume(o),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,"'")})},$e=function(e){var n=j(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Qe=function(e,n){var t;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(t=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.style)||void 0===t||t.setProperty("display","flex"));for(var i=j(e).textTracks(),o=0;o<i.length;o++){var r=i[o];"subtitles"!==r.kind&&"captions"!==r.kind||r.id!=n||(r.mode="showing")}},Xe=function(e,n){for(var t=j(e).textTracks(),i=0;i<t.length;i++){var o=t[i];"subtitles"!==o.kind&&"captions"!==o.kind||o.id!==n||(o.mode="hidden")}},Ze=function(e){var n,t=j(e);return(null==t||null===(n=t.textTracks())||void 0===n?void 0:n.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},en=function(e){var n=j(e);n.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,n.removeRemoteTextTrack(e)}))},nn=function(e,n){var t=j(e);t.remoteTextTracks().tracks_.map((function(e){t.removeRemoteTextTrack(e)})),n.map((function(e){t.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},tn=!1,on=function(e,n,t){var i=Re(n,e,t),o=j(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i=j(e);if(null!==i.el_){tn=!0;var o={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),tn&&null!==i.el_&&("function"==typeof i.ima?i.ima(o):setTimeout((function(){i.ima.setContentWithAdTag(null,n,!0),i.ima.requestAds()}),1e3));var r=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&r.hasAttribute("controls")&&r.removeAttribute("controls");var l="click",a=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(a=!0,l="touchend"),i.one(l,(function(){a&&i.ima.initializeAdDisplayContainer()}));var d=(null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.ads)||void 0===t?void 0:t.adEventHandler)||null;i.one("ads-ad-started",(function(){d&&d({status:"STARTED",msg:"Advertisement Started"})})),i.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){d&&d({status:"ENDED",msg:"Advertisement Ended"})}))})),i.on("adserror",(function(e){d&&d({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}},rn=["live","carousel","V2","defaultV2","multiplayer","minimalist","VL_ONE"],ln=function(e){var n=(new DOMParser).parseFromString(e,"image/svg+xml");return null==n?void 0:n.querySelector("svg")},an=function(e){d(document.querySelectorAll("[video-idx]")).map((function(n){var t=n.getAttribute("video-idx");n.style.border=t==e?"2px solid white":"none"}))},dn=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},un="",sn=function(e,n){var t;if(n){var i=document.getElementById(e),o=null===(t=window.getComputedStyle(i,null))||void 0===t?void 0:t.height;n.style.height!==o&&(n.style.height="".concat(o))}};function cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var vn=function(e){o(e).play()},mn=function(e){o(e).pause()},pn=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},fn=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},hn=function(e){return!!o.getPlayer("".concat(e))},gn=function(){var e=n(t.mark((function e(n,i){var o,r,l,a=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.length>2&&void 0!==a[2]&&a[2],e.next=3,k();case 3:return r=e.sent,l=j(n),e.abrupt("return",new Promise((function(e,t){Z(i,r).then((function(t){var r=null==t?void 0:t.data;window.sid=M(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=Le(r,n);x(r),a&&o?(bn(n,a),l.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).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)}}(),wn=function(){var e=n(t.mark((function e(n,i,o){var r,l,a,d,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k();case 2:return a=e.sent,(A()||null)&&N(i),d=0,u=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(l=l.watchHistory)&&void 0!==l&&l.enable&&te(i,a).then((function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(n=n.watchHistory)&&void 0!==n&&n.cb&&(null===(t=window)||void 0===t||null===(t=t.watchHistory)||void 0===t||t.cb(null==e?void 0:e.data)),d=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,u=(null==e||null===(o=e.data)||void 0===o?void 0:o.watchedPercentage)||null})).catch((function(e){var n,t;null!==(n=window)&&void 0!==n&&null!==(n=n.watchHistory)&&void 0!==n&&n.cb&&(null===(t=window)||void 0===t||null===(t=t.watchHistory)||void 0===t||t.cb(e))})),e.abrupt("return",new Promise((function(e,t){X(i,a).then((function(i){var o,r,l,a=null==i?void 0:i.data,s=(null==a||null===(o=a.video)||void 0===o||null===(o=o.streamingInfo)||void 0===o?void 0:o.isLiveStream)||!1;x(i.data);var c=(null==a||null===(r=a.ads)||void 0===r||null===(r=r.preRoll)||void 0===r||null===(r=r.adTags)||void 0===r||null===(r=r.web)||void 0===r?void 0:r.active)&&(null==a||null===(l=a.ads)||void 0===l||null===(l=l.preRoll)||void 0===l||null===(l=l.adTags)||void 0===l||null===(l=l.web)||void 0===l?void 0:l.url);c&&on(n,c,a);var v=Le(a,n);if(v){var m,p,f,h,g,w,y,I=(null==a||null===(m=a.video)||void 0===m||null===(m=m.gist)||void 0===m?void 0:m.videoImageUrl)||(null==a||null===(p=a.video)||void 0===p||null===(p=p.gist)||void 0===p||null===(p=p.imageGist)||void 0===p?void 0:p.r16x9),E=j(n);if(E.poster(I),bn(n,v),E.on("loadstart",(function(){s&&e({status:!0,msg:"Video Loaded",response:a})})),E.on("loadeddata",(function(){Ie(),e({status:!0,msg:"Video Loaded",response:a})})),E.one("play",(function(){d&&u<95&&setTimeout((function(){E.currentTime(d)}),0)})),E.one("error",(function(){var e;t({status:!1,msg:(null==E||null===(e=E.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==a||null===(f=a.video)||void 0===f||null===(f=f.contentDetails)||void 0===f||null===(f=f.closedCaptions)||void 0===f?void 0:f.length)>0||(null==a||null===(h=a.video)||void 0===h||null===(h=h.closedCaptions)||void 0===h?void 0:h.length)>0)g=((null==a||null===(w=a.video)||void 0===w||null===(w=w.contentDetails)||void 0===w?void 0:w.closedCaptions)||(null==a||null===(y=a.video)||void 0===y?void 0:y.closedCaptions)).filter((function(e){return"VTT"===e.format})),nn(n,g);else en(n)}else ye(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){Tn(e,n,t,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),yn=function(e,n,t){var i=j(e);return i.src(n),new Promise((function(e,n){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},In=function(e){var n=j(e);if(En(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},En=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},bn=function(e,n){var t=j(e);t&&t.src(n)},Tn=function(n,t,i,o){var r,l,a,d,u=null==n||null===(r=n.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.errorCode,s=(null==n||null===(l=n.response)||void 0===l||null===(l=l.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message);hn(t)&&ye(t,(null===(a=window)||void 0===a?void 0:a.customErrors)&&(null===(d=window)||void 0===d?void 0:d.customErrors[u])||"".concat(s)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):cn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({status:!1,response:n,msg:"".concat(s)},o&&{videoId:o}))},On=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},_n=!1,Sn=function(e,n){var t,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(t=t.streamingInfo)||void 0===t?void 0:t.secondaryVideoAssets)||null)&&!_n){var o=Dn(e,"videoAssets","secondaryVideoAssets"),r=Le(o,n);return r&&bn(n,r),_n=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Dn(e,n,t){if(Array.isArray(e))return e.map((function(e){return Dn(e,n,t)}));if(null!==e&&"object"===a(e)){var i={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=Dn(e[o],n,t)})),i}return e}function kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Pn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):kn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var Cn=function(e,n,t,i){var o,r=i.res,l=i.sres,a=j(e),d=(null==r?void 0:r.contentType)||"video",u=(null==r||null===(o=r[d])||void 0===o||null===(o=o.streamingInfo)||void 0===o?void 0:o.isLiveStream)||!1;x(r),a&&(a.on("loadstart",(function(){u?t.resolve({status:!0,msg:"Video Loaded",response:r}):t.resolve(Pn({status:!0,msg:"Player Initialised"},l?{seriesResponse:l,response:r}:{response:r}))})),a.on("loadeddata",(function(){var t,i,o;(null==a||!a.muted())&&Je(e,sessionStorage.getItem("volume")||"100");var l=R();if(Ie(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var d,u=Pn(Pn({},n),r);!function(e,n,t){var i,o,r;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(ze=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Ue=[],qe=0,je=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=j(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());Ue.includes(qe)||(e==qe?(Ue.push(e),Ge(a,n,l)):e>qe&&(qe=e+l))})),a.one("ended",(function(){Ge(a,n,l,!0)})))}(e,u,null==l||null===(d=l.video)||void 0===d||null===(d=d.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(o=n.analytics)&&void 0!==o&&o.muxKey&&null!=a&&a.mux){var s,c,v,m,p,f,h=(null===(s=R())||void 0===s?void 0:s.video)||(null==r?void 0:r.video),g=null==h?void 0:h.gist,w={env_key:null==n||null===(c=n.analytics)||void 0===c?void 0:c.muxKey,player_name:"vl-web-player",player_version:null===(v=window)||void 0===v?void 0:v.vl_player_version,video_id:null==g?void 0:g.id,video_title:null==g?void 0:g.title,video_series:null==h||null===(m=h.series)||void 0===m?void 0:m.title,video_stream_type:null!=h&&null!==(p=h.streamingInfo)&&void 0!==p&&p.isLiveStream?"live":"video",viewer_user_id:null==n||null===(f=n.analytics)||void 0===f?void 0:f.userId};a.mux({debug:!1,data:w})}})),a.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];a.trigger("subtitlechanged",n)})),a.on("subtitlechanged",(function(e,n){var t,i,o=window.cast&&window.cast.framework&&window.cast.framework.CastSession,r=null===(t=window)||void 0===t||null===(t=t.cast)||void 0===t||null===(t=t.framework)||void 0===t||null===(t=t.CastContext)||void 0===t||null===(t=t.getInstance())||void 0===t?void 0:t.S,l=null===(i=window)||void 0===i||null===(i=i.cast)||void 0===i||null===(i=i.framework)||void 0===i||null===(i=i.CastContext)||void 0===i||null===(i=i.getInstance())||void 0===i?void 0:i.getCurrentSession();if(o&&"CONNECTED"===r){var a,d=l.getMediaSession(),u=d.media.tracks.filter((function(e){return"TEXT"==e.type}));a=n?new chrome.cast.media.EditTracksInfoRequest([u[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(a)}})),a.tech_.on("retryplaylist",(function(){u&&Sn(r,e)})),a.on("error",(function(){var n,i;(console.log("ERROR",a.error(),a.error().code),4===a.error().code&&u)?Sn(r,e):(ye(e,(null==a||null===(n=a.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==a||null===(i=a.error())||void 0===i?void 0:i.message)||"Some error occured",response:r}))})),a.one("play",(function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,i=null===(t=R())||void 0===t||null===(t=t.video)||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.id,o=F(),r=(null==o?void 0:o.get(i))||{t:0,p:0},l=r.t,d=r.p;l&&d<95&&setTimeout((function(){a.currentTime(l)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){a.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0)})),a.on("volumechange",(function(){var e=100*a.volume().toFixed(2);a.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),a.on("chromecastDisconnected",(function(){if(u){a.currentSource();for(var e=a.textTracks(),n=e.length-1;n>=0;n--)a.removeRemoteTextTrack(e[n])}})))},xn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-837aff67.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-7ff32c17.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-0823db1a.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-0f1bc86a.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-2e89029c.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-a7a7560c.js")})).then((function(t){t.initialiseSkin(e,n)}))},Rn=function(e,n,t){var i=j(e);i?n>=0&&n<=i.duration()?(t({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),i.currentTime(n)):t({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):t("Cannot find player with id: '".concat(e,"'"))},An=function(e,n){var t=j(e);if(!t)return"Cannot find player with id: '".concat(e,"'");try{return t.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(e){return"Error: ".concat(e)}},Ln=function(e,n){var t=j(e);t?t.on("timeupdate",(function(){return n(t.currentTime())})):n("Cannot find player with id: '".concat(e,"'"))},Fn=function(e,n){var t=j(e);t?t.on("ended",(function(){return n(!0)})):n("Cannot find player with id: '".concat(e,"'"))},Nn=function(e){var n=j(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")},Vn=function(e){var n,t=j(e),i=[];if((null==t||null===(n=t.tech_)||void 0===n?void 0:n.vhs)||!1){var o,r=null==t||null===(o=t.tech_)||void 0===o||null===(o=o.vhs)||void 0===o?void 0:o.representations();(null==r?void 0:r.length)>0&&(i=null==r?void 0:r.sort((function(e,n){return(null==e?void 0:e.height)==(null==n?void 0:n.height)?(null==n?void 0:n.bandwidth)-(null==e?void 0:e.bandwidth):(null==n?void 0:n.height)-(null==e?void 0:e.height)})))}else{var l,a=null==t||null===(l=t.dash)||void 0===l||null===(l=l.mediaPlayer)||void 0===l?void 0:l.getBitrateInfoListFor("video");(null==a?void 0:a.length)>0&&(i=null==a?void 0:a.sort((function(e,n){return n.height-e.height})))}return i};function jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jn=function(){return!!e})()}var Bn=o.getComponent("Component"),Wn=function(){function n(t){var i,r,l,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(this,n),r=this,a=[t,s],l=v(l=n),i=c(r,jn()?Reflect.construct(l,a||[],v(r).constructor):l.apply(r,a)),e(i,"masterRenditions",[]),e(i,"addCustomFont",(function(e){var n=o.dom.createEl("div",{className:"font hideCustomFonts"}),t=o.dom.createEl("p",{className:"customFontHeading",innerHTML:"Font Size"});o.dom.appendContent(n,t);var r=o.dom.createEl("div",{className:"font-options"});r.style.fontSize="12px",i.fontSizeOptions.map((function(e,n){var t=o.dom.createEl("div",{className:"options",innerHTML:'<div class="radio-item" >\n <input class=opt'.concat(n,' type="radio" id=').concat(e,' name="item" />\n <label class="radio-btn-lable" for=').concat(e,">").concat(e,"pt</label>\n </div>")});t.addEventListener("click",(function(e){var n=e.target.id;i.changeFontSize(n)})),o.dom.appendContent(r,t)})),o.dom.appendContent(n,r),o.dom.appendContent(e,n)})),e(i,"resetRenditions",(function(){d(document.getElementsByClassName("rendition")).map((function(e){o.dom.removeClass(e,"selected")}))})),i.playerId=null==s?void 0:s.playerId,i.skin=null==s?void 0:s.skin,i.icon=null==s?void 0:s.icon,i.masterRenditions=[],i.fontSizeOptions=[10,12,14],i.createRenditions(s.renditions),window.height=null,i}return m(n,Bn),s(n,[{key:"toggleContentOnHover",value:function(e,n){var t=o.dom.$(".setting-icon",e);t.addEventListener("mouseover",(function(){o.dom.removeClass(n,"resolution_hidden")})),n.addEventListener("mouseover",(function(){o.dom.removeClass(n,"resolution_hidden")})),t.addEventListener("mouseout",(function(){o.dom.addClass(n,"resolution_hidden")})),n.addEventListener("mouseout",(function(){o.dom.addClass(n,"resolution_hidden")}))}},{key:"changeFontSize",value:function(e){var n=o.dom.$(".renditions",this.contentEl()),t=o.dom.$(".font-options",this.contentEl());n.style.fontSize="".concat(e,"px"),t.style.fontSize="".concat(e,"px")}},{key:"createRenditions",value:function(e){var n=this,t=this.el(),i=o.dom.$(".setting-icon",this.el()),r=ln(this.icon);if(i.append(r),"live"===this.skin){var l=document.createTextNode(" Settings");i.appendChild(l)}var a=o.dom.createEl("div",{className:"content resolution_hidden"}),d=o.dom.createEl("div",{innerHTML:"Quality",className:"title"}),u=o.dom.createEl("div",{className:"resolution"});o.dom.appendContent(u,d),this.toggleContentOnHover(t,a);var s=o.dom.createEl("div",{className:"renditions"});this.player_.tech_.vhs?(e.map((function(e,t){var i,r,l=o.dom.createEl("div",{className:"relative"}),a=(((null==e||null===(i=e.playlist)||void 0===i?void 0:i.attributes["AVERAGE-BANDWIDTH"])||(null==e||null===(r=e.playlist)||void 0===r?void 0:r.attributes.BANDWIDTH))/1048576).toFixed(1),d="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");d="".concat(e.height,"p @ ").concat(a,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");var u=o.dom.createEl("p",{innerHTML:d,className:"rendition",res:e.height,bandwidth:e.bandwidth});o.dom.appendContent(l,u),o.dom.appendContent(s,l),u.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(n.resetRenditions(),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,Hn(n.playerId,e.target),o.dom.addClass(u,"selected"))}))})),this.addAutoRendition("nondrm",s),"Safari"!=Ee()&&this.addDynamicSwitchIfAuto()):(e.map((function(e,t){var i=o.dom.createEl("div",{className:"relative"}),r=(e.bitrate/1e6).toFixed(1),l="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");window.enableResolutionsBitrate&&(l="".concat(e.height,"p @ ").concat(r,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":""));var a=o.dom.createEl("p",{innerHTML:l,className:"rendition",res:e.height,qualityIndex:e.qualityIndex});o.dom.appendContent(i,a),o.dom.appendContent(s,i),a.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(n.resetRenditions(),window.height=e.target.res,window.selectedVideo=e.target.video,window.qualityIndex=e.target.qualityIndex,Hn(n.playerId,e.target),o.dom.addClass(a,"selected"))}))})),this.addAutoRendition("drm",s)),o.dom.appendContent(u,s),o.dom.appendContent(a,u),o.dom.appendContent(t,a)}},{key:"addDynamicSwitchIfAuto",value:function(){for(var e,n=this.player_.textTracks(),t=0;t<n.length;t++)"segment-metadata"===n[t].label&&(e=n[t]);var i=null;e&&e.on("cuechange",(function(){var n,t=e.activeCues[0];if(console.log((null==t||null===(n=t.value)||void 0===n||null===(n=n.resolution)||void 0===n?void 0:n.height)+"p"),t&&document.querySelector(".auto.selected")){var o,r,l,a;if(null!=t&&null!==(o=t.value)&&void 0!==o&&null!==(o=o.resolution)&&void 0!==o&&o.height&&i!==(null==t||null===(r=t.value)||void 0===r||null===(r=r.resolution)||void 0===r?void 0:r.height))document.querySelector(".auto.selected").textContent="Auto ".concat(null==t||null===(a=t.value)||void 0===a||null===(a=a.resolution)||void 0===a?void 0:a.height,"p");i=null==t||null===(l=t.value)||void 0===l||null===(l=l.resolution)||void 0===l?void 0:l.height}}))}},{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"container"}),n=o.dom.createEl("div",{className:"setting-icon"});return o.dom.appendContent(e,n),e}},{key:"addAutoRendition",value:function(e,n){var t=this;if("nondrm"==e){var i,r,l=null===(i=this.player_)||void 0===i||null===(i=i.tech_)||void 0===i?void 0:i.vhs.selectPlaylist().attributes.RESOLUTION.height,a=null===(r=this.player_)||void 0===r||null===(r=r.tech_)||void 0===r?void 0:r.vhs.selectPlaylist().attributes.BANDWIDTH,d=o.dom.createEl("div",{className:"relative"}),u=o.dom.createEl("p",{innerHTML:"Auto ".concat(l,"p"),className:"rendition auto selected",bandwidth:a,res:l});u.addEventListener("click",(function(e){window.height!==e.target.res&&(t.resetRenditions(),o.dom.addClass(u,"selected"),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,Hn(t.playerId,null,!0))})),o.dom.appendContent(d,u),o.dom.appendContent(n,d)}else{var s=o.dom.createEl("div",{className:"relative"}),c=o.dom.createEl("p",{innerHTML:"Auto",className:"rendition selected",qualityIndex:"auto"});c.addEventListener("click",(function(e){t.resetRenditions(),o.dom.addClass(c,"selected"),window.qualityIndex=e.target.qualityIndex,window.selectedVideo=e.target.video,Hn(t.playerId,null,!0)})),o.dom.appendContent(s,c),o.dom.appendContent(n,s)}}}])}(),Hn=function(e,n,t){var i,r=j(e),l=null==n?void 0:n.bandwidth;if((null==r||null===(i=r.tech_)||void 0===i?void 0:i.vhs)||!1){r.tech_.vhs.representations().forEach((function(e){t||e.bandwidth===l?e.enabled(!0):e.enabled(!1)})),r.handleTechPlaying_();var a=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(a)}),100);var d=o.dom.$(".content");d&&o.dom.addClass(d,"resolution_hidden")}else{var u=null==n?void 0:n.qualityIndex;if(t){var s;null==r||null===(s=r.dash)||void 0===s||null===(s=s.mediaPlayer)||void 0===s||s.resetSettings()}else{var c,v;null==r||null===(c=r.dash)||void 0===c||null===(c=c.mediaPlayer)||void 0===c||c.updateSettings({streaming:{abr:{autoSwitchBitrate:!1}}}),null==r||null===(v=r.dash)||void 0===v||null===(v=v.mediaPlayer)||void 0===v||v.setQualityFor("video",u,!0);var m=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(m)}),100);var p=o.dom.$(".content");p&&o.dom.addClass(p,"resolution_hidden")}}},Mn=Object.freeze({__proto__:null,default:Wn,playSelectedResolution:Hn});var Un,qn=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Te("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)}}(),zn=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Gn=function(){var e=n(t.mark((function e(){var n;return t.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(o),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)}}(),Kn=Object.freeze({__proto__:null,importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Te("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},loadAdsLibrary:qn,loadEMELibrary:zn,loadMuxPlugin:Gn}),Yn={};function Jn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function $n(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Jn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var Qn=function(i,r,l,a){var d,u,s,c,v,m,p,f,h,g,w,y=r.res,I=void 0===y?null:y,E=r.sres,b=void 0===E?null:E;null===(d=window)||void 0===d||null===(d=d.cast)||void 0===d||null===(d=d.framework)||void 0===d||null===(d=d.CastContext)||void 0===d||null===(d=d.getInstance())||void 0===d||d.S;var T=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],O=(null===(u=I)||void 0===u?void 0:u.contentType)||"video",_=dn(null===(s=I)||void 0===s||null===(s=s[O])||void 0===s||null===(s=s.gist)||void 0===s?void 0:s.videoImageUrl)||dn(null===(c=I)||void 0===c||null===(c=c[O])||void 0===c||null===(c=c.gist)||void 0===c||null===(c=c.imageGist)||void 0===c?void 0:c.r16x9),S=(null===(v=I)||void 0===v||null===(v=v[O])||void 0===v||null===(v=v.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,D=(null===(m=I)||void 0===m||null===(m=m[O])||void 0===m||null===(m=m.streamingInfo)||void 0===m?void 0:m.isLiveStream)||!1,k=(null===(p=I)||void 0===p||null===(p=p.ads)||void 0===p||null===(p=p.preRoll)||void 0===p||null===(p=p.adTags)||void 0===p||null===(p=p.web)||void 0===p?void 0:p.active)&&(null===(f=I)||void 0===f||null===(f=f.ads)||void 0===f||null===(f=f.preRoll)||void 0===f||null===(f=f.adTags)||void 0===f||null===(f=f.web)||void 0===f?void 0:f.url);I=$n($n({},I),{},{audioAssetSource:null==l?void 0:l.audioAssetSource});var P=e(e(e(e(e(e(e(e({enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==l.skin,liveui:S},"autoplay",null==l?void 0:l.autoplay),"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!k),"loop",(null==l?void 0:l.loop)||!1),"audioPosterMode",null==l?void 0:l.audioPosterMode),"html5",$n($n({vhs:$n($n({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==l||null===(h=l.customData)||void 0===h?void 0:h.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==l||null===(g=l.customData)||void 0===g?void 0:g.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(w=l.customData)||void 0===w?void 0:w.nativeVideoTracks)&&{nativeVideoTracks:!1})),"poster",_),"techOrder",T),"chromecast",{requestCustomDataFn:function(e){var n=j(i),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var i,o,r,l,a,d=(null==e?void 0:e.contentType)||"video",u={};if(e&&null!=e&&e[d]&&null!=e&&e[d].drmEnabled){u.isDrmEnabled=!0;var s=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;u.licenseUrl=s;var c=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];u.licenseToken=c}var v=(null==e||null===(i=e[d])||void 0===i||null===(i=i.gist)||void 0===i?void 0:i.contentType)||"VIDEO";u.contentType=v;var m=null==e||null===(o=e[d])||void 0===o||null===(o=o.gist)||void 0===o?void 0:o.runtime;u.duration=m;var p=null==e||null===(r=e[d])||void 0===r||null===(r=r.gist)||void 0===r?void 0:r.title;u.mediaTitle=p;var f=null==e||null===(l=e[d])||void 0===l||null===(l=l.gist)||void 0===l?void 0:l.videoImageUrl;return u.mediaImage=f,u.subTitles=t,u.DVR=(null==e||null===(a=e[d])||void 0===a||null===(a=a.liveDetails)||void 0===a?void 0:a.isDvrEnabled)||!1,console.log(u),u}(I,e,t)}});if(!o.getPlayers()[i])var C=o(i,P,function(){var e=n(t.mark((function e(){var n,r,d,u,s,c,v,m,p,f,h,g,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(C),console.log(o.VERSION),console.log(o.getPlugins()),e.next=5,_e(l);case 5:if(null!=l&&null!==(n=l.analytics)&&void 0!==n&&n.muxKey&&Gn(),D&&a.resolve($n({status:!0,msg:"Player Initialised"},b?{seriesResponse:b,response:I}:{response:I})),K(i),we(i,l),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),v=null===(r=I)||void 0===r||null===(r=r[O])||void 0===r?void 0:r.drmEnabled,m=null===(d=I)||void 0===d||null===(d=d[O])||void 0===d||null===(d=d.liveDetails)||void 0===d?void 0:d.startOverTime,!v){e.next=15;break}return e.next=15,zn();case 15:S&&Se(i,m),!k||null!=l&&null!==(u=l.customData)&&void 0!==u&&u.disableAds||on(i,k,I),p=Le(I,i),console.log(p),null!=l&&l.nearestClusterUrl&&(p=We(p,l.nearestClusterUrl)),p?bn(i,p):(a.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:I}),ye(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(s=I)||void 0===s||null===(s=s[O])||void 0===s||null===(s=s.contentDetails)||void 0===s||null===(s=s.closedCaptions)||void 0===s?void 0:s.length)>0||(null===(c=I)||void 0===c||null===(c=c[O])||void 0===c||null===(c=c.closedCaptions)||void 0===c?void 0:c.length)>0)&&(w=(null===(h=I)||void 0===h||null===(h=h[O])||void 0===h||null===(h=h.contentDetails)||void 0===h?void 0:h.closedCaptions)||(null===(g=I)||void 0===g||null===(g=g[O])||void 0===g?void 0:g.closedCaptions),f=w.filter((function(e){return"VTT"===e.format})),nn(i,f)),null!=l&&l.disableControls?On(i):xn(i,$n($n($n({},l),P),{},{liveVideo:D,isDvrEnabled:S,res:I,sres:b})),Cn(i,$n($n($n({},l),P),{},{liveVideo:D}),a,{res:I,sres:b});case 24:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};exports.VLPlayerCore=function(){return{loadVideoInstantly:yn,onTimeUpdate:Ln,getVideoDuration:Nn,onVideoEnded:Fn,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(t.mark((function n(i,o){var r,l,a,d,u,s,c,v,m,p,h,w,E,b,T,O,_,S,D,k,C,R,A,L,F,N,j;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!hn(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(h=(null==e?void 0:e.videoSourceUrl)||!1,w=null==e?void 0:e.asat,E=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,window.videoId=b,O=null==e?void 0:e.token,!P(e)){n.next=15;break}if(y().set(null==e?void 0:e.refreshToken),O&&!g(O)){n.next=14;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 14:Un=JSON.parse(atob(O.split(".")[1]));case 15:return e.isAnonymousUser=!(null===(a=Un)||void 0===a||!a.anonymousId),e.siteOwner=(null===(d=Un)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Un)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(s=Un)||void 0===s?void 0:s.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",O),_=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,S=null==e?void 0:e.airplay,D=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,(k=null==e?void 0:e.errors)&&(window.customErrors=k),window.customData=null==e?void 0:e.customData,B=null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation,Yn=B,oe.set(e.apiBaseUrl),null!=e&&e.skin&&(t=e.skin,rn.includes(t))||(e.skin="VL_ONE"),n.next=33,qn();case 33:S&&"Safari"==Ee()&&Promise.resolve().then((function(){return Kn})).then((function(e){e.importAirplay()})),D&&Te("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then((function(){return e=D,window.dataLayer=window.dataLayer||[],f("js",new Date),void f("config",e);var e})).catch((function(e){})),(C=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(_)))&&C.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h?(A={directPlaybackUrl:h,id:R="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?X(R,O).then((function(n){Qn(_,{res:$n($n({},n),A)},e,{resolve:i,reject:o})})).catch((function(e){Tn(e,_,o,R)})):Qn(_,{res:A},e,{resolve:i,reject:o})):T?(F=sessionStorage.getItem("season-idx")||0,V.set(parseInt(F)),N=null==e||null===(L=e.series)||void 0===L?void 0:L.id,ee(N,O).then((function(n){var t,r=n.data,l=n.data.seasons;I=l;var a=b||(null==l||null===(t=l[0])||void 0===t||null===(t=t.episodes)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.id);le(N,O),X(a,O).then((function(n){var t;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(t=t.video)||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.contentType,x(n.data),Qn(_,{res:null==n?void 0:n.data,sres:r},e,{resolve:i,reject:o})})).catch((function(e){Tn(e,_,o,b)}))})).catch((function(e){Tn(e,_,o)}))):E?(j=null==e?void 0:e.epg,Z(j,O).then((function(n){var t=null==n?void 0:n.data;t.contentType="linearchannel",t.channelId=null==j?void 0:j.channelId,Qn(_,{res:t},e,{resolve:i,reject:o})})).catch((function(e){Tn(e,_,o,b)}))):X(b,O).then((function(n){var t,r;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(t=t.video)||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.contentType,x(null==n?void 0:n.data);var l,a=null==n?void 0:n.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(r=e.watchHistory)&&void 0!==r&&r.enable)if((null===(l=e.watchHistory)||void 0===l?void 0:l.saveOffline)||!1){var d,u,s,c=Ye((null===(d=e.watchHistory)||void 0===d?void 0:d.profileId)||"",b,null==e?void 0:e.siteOwner);if(c&&c.length)e.watchHistoryResumeTime=(null===(u=c[0])||void 0===u?void 0:u.watchedTime)||null,e.watchedPercentage=(null===(s=c[0])||void 0===s?void 0:s.watchedPercentage)||null;a.contentType="video",Qn(_,{res:a},e,{resolve:i,reject:o})}else te(b,O).then((function(n){var t,r,l,d;null!==(t=window)&&void 0!==t&&null!==(t=t.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(r=r.watchHistory)||void 0===r||r.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(l=n.data)||void 0===l?void 0:l.watchedTime)||null,e.watchedPercentage=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedPercentage)||null,a.contentType="video",Qn(_,{res:a},e,{resolve:i,reject:o})})).catch((function(n){var t,r;null!==(t=window)&&void 0!==t&&null!==(t=t.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(r=r.watchHistory)||void 0===r||r.cb(n)),Qn(_,{res:a},e,{resolve:i,reject:o})}));else Qn(_,{res:a},e,{resolve:i,reject:o})})).catch((function(e){Tn(e,_,o,b)}));case 38:case"end":return n.stop()}var t,B}),n)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:Vn,skip:pn,getPlayer:j,play:vn,pause:mn,detectBrowser:Ee,rewind:fn,loadVideo:bn,seekToTimeStamp:Rn,isPlayerInitialised:hn,load:wn,authenticateLC:gn,dispose:In,enableCaptions:Qe,disableCaptions:Xe,getCaptions:Ze,playSelectedResolution:Hn,getSource:Le,setVolume:Je,getVolume:$e,disableControls:On,setPlaybackSpeed:An,getEntitlementData:re}},exports.closeOpenDrawers=function(){var e=d(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var n;null==e||null===(n=e.childNodes)||void 0===n||null===(n=n[0])||void 0===n||n.click()}))},exports.createIconMarkup=function(e){return ln(e)},exports.createIdxMapping=function(e){T=new Map,e.map((function(e,n){T.set(e.id,n)}))},exports.detectBrowser=Ee,exports.detectOrientationChange=function(e,n){var t,i=function(){return function(e,n){var t=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",i=document.getElementById(e);if(i&&un!==t){var o=window.getComputedStyle(i,null).getPropertyValue("height");n&&(n.style.height="".concat(o)),un=t}}(e,n)};window._orientationChangeHandler=i;window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout((function(){i()}),100)}))},exports.disableCaptions=Xe,exports.enableCaptions=Qe,exports.getCaptions=Ze,exports.getCurrentSeries=A,exports.getCurrentVideo=R,exports.getLocalisation=function(e){var n;return(null===(n=Yn)||void 0===n?void 0:n[e])||""},exports.getPlayer=j,exports.getRenditions=Vn,exports.getSeriesWatchHistory=ie,exports.getSeriesWatchMap=F,exports.getVideoIdx=function(){return b},exports.handleDrawerResizing=function(e,n){var t,i=j(e),o=j(e).el(),r=new ResizeObserver((function(){var i;null!==(i=n.classList)&&void 0!==i&&i.contains("hidden")||(t&&clearTimeout(t),t=setTimeout((function(){sn(e,n)}),300))}));r.observe(o),i.on("dispose",(function(){r.disconnect()})),i.on("fullscreenchange",(function(){setTimeout((function(){sn(e,n)}),50)}))},exports.highlightVideo=function(e,n){if(n){var t,i=j(n);if(null!=i&&null!==(t=i.el())&&void 0!==t&&null!==(t=t.classList)&&void 0!==t&&t.contains("skin_defaultv2"))return void an(e)}var o=d(document.querySelectorAll("[video-idx]"));console.log(o),o.map((function(n){var t=n.parentNode,i=n.getAttribute("video-idx");t.style.background=i==e?"gray":"none"}))},exports.highlightVideo_DEFAULTV2_TEMP=an,exports.isMobile=be,exports.isPaused=function(e){return o(e).paused()},exports.load=wn,exports.onVideoEnded=Fn,exports.parseHtmlString=function(e){var n=(new DOMParser).parseFromString(e,"text/html");return null==n?void 0:n.querySelector("body")},exports.parseSvgString=ln,exports.pause=mn,exports.play=vn,exports.playSelectedResolution=Hn,exports.removeCaptions=en,exports.resolution=Mn,exports.rewind=fn,exports.seasonIdxManager=V,exports.setCurrentVideo=x,exports.setUpdatedElHeight=sn,exports.setVideoIdx=L,exports.setVideoIdxById=N,exports.skip=pn;
|
package/cjs/index-42f92d7c.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./index-132e25bf.js"),a=require("./autoNextVideo-7d9c13ee.js"),l=require("@babel/runtime/helpers/typeof"),u=require("video.js"),s=require("@babel/runtime/helpers/asyncToGenerator"),c=require("@babel/runtime/regenerator"),d=require("@babel/runtime/helpers/defineProperty"),p=require("@babel/runtime/helpers/slicedToArray"),m=[],v=function(e,t){var n=o.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=o.getVideoIdx();a._switchToNext(i,e,m)}};function f(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function g(e){return h.apply(this,arguments)}function h(){return(h=s(c.mark((function e(t){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=p(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return y.apply(this,arguments)}function y(){return(y=s(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",f(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function b(e){return w.apply(this,arguments)}function w(){return w=s(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return g(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:d(d(d({left:"-60px",height:"85px",width:"130px"},"left","-60px"),"border","1px solid transparent"),"borderRadius","4px")}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)}))),w.apply(this,arguments)}e={0:{src:"example-thumbnail.png"}},t=function(){var e,n,r,i,o;for(r in n=(e=Array.prototype.slice.call(arguments)).shift()||{},e)for(o in i=e[r])i.hasOwnProperty(o)&&("object"===l(i[o])?n[o]=t(n[o],i[o]):n[o]=i[o]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},r=function(e){return"HTML"!==e.nodeName&&"static"===n(e)("position")?r(e.offsetParent):e},u.registerPlugin("thumbnails",(function(i){var o,a,l,u,s,c,d,p;function m(){document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",m),p()}a=t({},e,i),u=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=u.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(o=document.createElement("div")).className="vjs-thumbnail-holder",l=document.createElement("img"),o.appendChild(l),l.src=a[0].src,l.className="vjs-thumbnail",t(l.style,a[0].style),l.style.left||l.style.right||(l.onload=function(){l.style.left=-l.naturalWidth/2+"px"}),c=u.duration(),u.on("durationchange",(function(e){c=u.duration()})),u.on("loadedmetadata",(function(e){c=u.duration()})),(s=u.controlBar.progressControl).el().appendChild(o),d=function(e){var i,u,d,p,m,v,f,g,h,x;for(u in d=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=r(s.el()).getBoundingClientRect()).width||x.right)+h,v=e.pageX,e.changedTouches&&(v=e.changedTouches[0].pageX),p=v||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,p-=r(s.el()).getBoundingClientRect().left+h,i=Math.floor((p-s.el().offsetLeft)/s.width()*c),a)i>u&&(d=Math.max(d,u));(m=a[d]).src&&l.src!=m.src&&(l.src=m.src),m.style&&l.style!=m.style&&t(l.style,m.style),p+(g=function(e,t){var r;return t?parseFloat(t):"auto"!==(r=n(e)("clip"))&&"inherit"!==r&&4===(r=r.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(r[1])-parseFloat(r[3]):0}(l,m.width||a[0].width)/2)>f?p-=p+g-f:p<g&&(p=g),o.style.left=p+"px"},s.on("mousemove",d),s.on("touchmove",d),s.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",d),document.addEventListener("pointerup",m)})),p=function(e){o.style.left="-1000px"},s.on("mouseout",p),s.on("touchcancel",p),s.on("touchend",p),u.on("userinactive",p)}));var E=function(){var e=s(c.mark((function e(t,n){var r,i,o,a;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,console.log("TRICKPLAYDEBUG manifestText",i),o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=p(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function C(e){return T.apply(this,arguments)}function T(){return(T=s(c.mark((function e(t){var n,r,i,a,l,u,s,d,p,m,v,f,g,h,x,y,b,w,E,C,T;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return i=e.sent,e.next=7,i.text();case 7:a=e.sent,l=new DOMParser,u=l.parseFromString(a,"application/xml"),s=null===(r=o.getCurrentVideo())||void 0===r||null===(r=r.video)||void 0===r?void 0:r.runtime,d=u.getElementsByTagName("AdaptationSet"),p=0;case 13:if(!(p<d.length)){e.next=34;break}if("image"!==(m=d[p]).getAttribute("contentType")||"image/png"!==m.getAttribute("mimeType")){e.next=31;break}if(v=m.getElementsByTagName("SegmentTemplate")[0],f=m.getElementsByTagName("Representation")[0],g=f.getElementsByTagName("EssentialProperty")[0],h=g.getAttribute("value"),!v){e.next=31;break}for(v.getAttribute("media"),x=v.getAttribute("duration"),y=v.getAttribute("timescale"),b=x/y,w=Math.round(s/b),E=Math.ceil(w/9),C=v.getAttribute("media"),T=[],p=0;p<E;p++)T.push({duration:b,layout:h,uri:n+"/"+C.replace("$Number$",p)});return e.abrupt("return",T);case 31:p++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function N(){return(N=s(c.mark((function e(t){var n,r,i,a,l,u,s,d,p,m,v;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.getPlayer(t),r=n.currentSource(),null==(i=r.src)||!i.includes("m3u8")){e.next=21;break}return e.next=5,x(i);case 5:if(a=e.sent,console.log("TRICKPLAYDEBUG res",a),!((null==a?void 0:a.length)>0)){e.next=19;break}return l=(null==a?void 0:a[0])||null,u=l.uri,s=i.substring(0,i.lastIndexOf("/"))+"/",console.log("TRICKPLAYDEBUG masterURI",s),e.next=13,E(s,u);case 13:return d=e.sent,console.log("TRICKPLAYDEBUG imageStreams",d),e.next=17,b(d);case 17:p=e.sent,n.thumbnails(p);case 19:e.next=30;break;case 21:if(null==i||!i.includes("mpd")){e.next=30;break}return e.next=24,C(i);case 24:if(!((null==(m=e.sent)?void 0:m.length)>0)){e.next=30;break}return e.next=28,b(m);case 28:v=e.sent,n.thumbnails(v);case 30:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.addNextEpPreview=function(e,t){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r;m=[];var a=o.getCurrentSeries();null==a||a.map((function(e){var t;return(t=m).push.apply(t,i(e.episodes))})),null==t||null===(r=t.series)||void 0===r||r.cb}else{var l,u;m=(null==t||null===(l=t.relatedVideos)||void 0===l?void 0:l.content)||[],null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=o.getPlayer(e);s.on("timeupdate",(function(){var e,t,n=Math.floor(s.currentTime()),r=s.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&o.getVideoIdx()<=(null===(t=m)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var c,d=m.filter((function(e,t){return t==o.getVideoIdx()}));if((null==d?void 0:d.length)>0)if(null!==(c=document.getElementsByClassName("next-ep-preview"))&&void 0!==c&&c[0]){var p,f,g,h,x,y,b,w,E;(null===(p=document.getElementsByClassName("next-ep-preview"))||void 0===p?void 0:p[0]).style.visibility="hidden";var C=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],T=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],N=null===(h=document.getElementsByClassName("next-ep-content"))||void 0===h?void 0:h[0],k=null===(x=d[0])||void 0===x?void 0:x.title;(null===(y=k)||void 0===y?void 0:y.length)>60&&(k=k.substr(0,60)+"..."),C.textContent="".concat(k),T.src=(null===(b=d[0])||void 0===b||null===(b=b.gist)||void 0===b||null===(b=b.imageGist)||void 0===b?void 0:b.r16x9)||(null==d||null===(w=d[0])||void 0===w?void 0:w.img)||(null===(E=window)||void 0===E||null===(E=E.customData)||void 0===E?void 0:E.fallbackImage),N.onclick=function(){return v(e)}}else{var I,P,L,A,B,M=document.createElement("div");M.className="next-ep-preview",M.style.visibility="hidden",document.getElementById(e).append(M);var R=document.createElement("div");R.className="next-ep-header",R.textContent="Next up";var S=null===(I=d[0])||void 0===I?void 0:I.title,O=document.createElement("img");O.className="next-ep-img",O.src=(null===(P=d[0])||void 0===P||null===(P=P.gist)||void 0===P||null===(P=P.imageGist)||void 0===P?void 0:P.r16x9)||(null==d||null===(L=d[0])||void 0===L?void 0:L.img)||(null===(A=window)||void 0===A||null===(A=A.customData)||void 0===A?void 0:A.fallbackImage);var U=document.createElement("div");U.className="next-ep-title",(null===(B=S)||void 0===B?void 0:B.length)>60&&(S=S.substr(0,60)+"..."),U.textContent="".concat(S);var j=document.createElement("div");j.className="next-ep-content",j.append(O),j.append(U),j.onclick=function(){return v(e)},M.append(R),M.append(j)}},exports.addTVProviderImage=function(e,t){var n=o.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var i=document.createElement("div");i.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(r),a.alt="Provider Image",i.append(a),n.el().appendChild(i),n.on("useractive",(function(){i.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||i.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}},exports.initiateTrickplay=function(e){return N.apply(this,arguments)};
|
package/esm/index-7765e9ea.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"axios";import o from"video.js";import r from"js-cookie";import l from"ua-parser-js";import a from"@babel/runtime/helpers/typeof";import d from"@babel/runtime/helpers/toConsumableArray";import u from"@babel/runtime/helpers/classCallCheck";import s from"@babel/runtime/helpers/createClass";import c from"@babel/runtime/helpers/possibleConstructorReturn";import v from"@babel/runtime/helpers/getPrototypeOf";import m from"@babel/runtime/helpers/inherits";var p={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"};function f(){var e;null===(e=window)||void 0===e||null===(e=e.dataLayer)||void 0===e||e.push(arguments)}function h(e,n){f("event",e,n)}var g=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},w=null;function y(){return{set:function(e){e&&(w=e)},get:function(){return w}}}var I,E,b,T,O,_,k=function(){var e=n(t.mark((function e(){var n,i,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=y().get(),i=getBaseUrl(),e.prev=2,e.next=5,axios({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return o=e.sent,e.abrupt("return",o);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)}}(),D=null,S=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"))||!g(n)){e.next=6;break}return D||(D=k().then((function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&y().set(r),o||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){D=null}))),e.abrupt("return",D);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},C=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},R=function(e){E=e},A=function(){return E},L=function(){return I},F=function(){return b},N=function(e){b=e},j=function(){return O},x=function(e){T=new Map,e.map((function(e,n){T.set(e.id,n)}))},V=function(e){if(T){var n=T.get(e);N(n+1)}},B=(_=0,{set:function(e){e>=0&&(_=e)},get:function(){return _}}),W=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))};function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function M(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?H(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):H(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var U=function(){var e,n,t,i=A();return"linearchannel"==((null==i?void 0:i.contentType)||"video")?null==i||null===(e=i.linearchannel)||void 0===e||null===(e=e.channels)||void 0===e||null===(e=e.find((function(e){return(null==e?void 0:e.id)===(null==i?void 0:i.channelId)})))||void 0===e||null===(e=e.content)||void 0===e?void 0:e.id:(null==i||null===(n=i.video)||void 0===n||null===(n=n.gist)||void 0===n?void 0:n.id)||(null==i||null===(t=i.video)||void 0===t?void 0:t.id)};function z(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function G(){var e=window.sessionStorage.getItem("uid");return e||(e=z(),window.sessionStorage.setItem("uid",e),e)}function q(){return K.apply(this,arguments)}function K(){return K=n(t.mark((function e(){var n,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),K.apply(this,arguments)}window.initialise=function(e){window.sid=z(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,i=Math.floor(e.currentTime());h(i?"FAILED_TO_START":"DROPPED_STREAM",M({pfm:window.platform,uid:G(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.beacon)||void 0===t?void 0:t.params)),fireEvent({eventName:n===i?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),h("PLAY",M({pfm:window.platform,uid:G(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var n;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(n=n.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t;if(n.el_){var i,o=e+.1;if(+o.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(t=t.className)&&void 0!==t&&t.includes("vjs-waiting"))h("BUFFERING",M({pfm:window.platform,uid:G(),vid:U(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(i=i.customData)||void 0===i||null===(i=i.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return o}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,h("FIRST_FRAME",M({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:G(),vid:U()},null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.beacon)||void 0===n?void 0:n.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;h("AD_REQUEST",M({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:G(),vid:U(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),h("AD_IMPRESSION",M({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:G(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.beacon)||void 0===t?void 0:t.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)&&(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(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Y(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}}))()};var Y=function(e,n,t){return e>=n&&e<=t};function J(e){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=W(e);window.initialise(n),window.firstFrame(n),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=n(t.mark((function e(n){var o,r,l,a,d,u,s,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:return a=e.sent,d=C(a),u=null==d?void 0:d.site,s=null==d?void 0:d.siteId,e.t0=M,e.t1=M,e.t2=M({aid:u,cid:s,pfm:window.platform},null===(o=window)||void 0===o||null===(o=o.customData)||void 0===o||null===(o=o.beacon)||void 0===o?void 0:o.params),e.t3={},e.t4=G(),e.t5=U(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=n.videoPosition,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:"",e.t17=!0===n.isAdEvent?(t=n.adPosition)?String(t):"":"",e.next=26,q();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=n.ttFirstFrame,e.t23=n.bitrate,e.t24=n.resHeight,e.t25=n.resWidth,e.t26=n.bufferHealth,e.t27={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:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(r=window)||void 0===r||null===(r=r.customData)||void 0===r||null===(r=r.beacon)||void 0===r?void 0:r.params,e.t31=(0,e.t0)(e.t29,e.t30),c=[e.t31],i({url:(null===(l=window)||void 0===l||null===(l=l.customData)||void 0===l||null===(l=l.beacon)||void 0===l?void 0:l.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:a},contentType:"application/x-www-form-urlencoded",dataType:"text",data:c}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var t}),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}}};function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Q(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var X={name:"@viewlift/player8",version:"1.0.110",main:"dist/bundle.cjs.js",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","video.js":"^8.21.1","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=X.version;var Z,ee=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(t=t.customData)&&void 0!==t&&t.overrideEntitlementResponse?new Promise((function(e,n){var t;return e({data:null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t?void 0:t.overrideEntitlementResponse})})):i({url:null!==(r=window)&&void 0!==r&&null!==(r=r.customData)&&void 0!==r&&r.overrideEntitlementBaseUrl?(null===(l=window)||void 0===l||null===(l=l.customData)||void 0===l?void 0:l.overrideEntitlementBaseUrl)+"/video/status":le.get()+"".concat(null==p?void 0:p.getVideoDetails),params:Q({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(o=window)||void 0===o||null===(o=o.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":X.version},withCredentials:!0})},ne=function(e,n){var t,o;return null!==(t=window)&&void 0!==t&&null!==(t=t.customData)&&void 0!==t&&t.overrideEntitlementResponse?new Promise((function(e,n){var t;return e({data:null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t?void 0:t.overrideEntitlementResponse})})):i({url:le.get()+p.getLinearChannelDetails,params:Q(Q(Q(Q(Q({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===(o=window)||void 0===o||null===(o=o.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:n}})},te=function(e,n){var t,o=C(n),r=(null==o?void 0:o.site)||null;return null!==(t=window)&&void 0!==t&&null!==(t=t.customData)&&void 0!==t&&t.seriesData?new Promise((function(e,n){var t;return e({data:null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t?void 0:t.seriesData})})):i({url:le.get()+"/v3/content/series/".concat(e),params:{site:r},method:"GET",headers:{Authorization:n}})},ie=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,getToken();case 2:return o=e.sent,e.abrupt("return",i({url:le.get()+"".concat(null==p?void 0:p.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Q({},n),params:Q({},(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)}}(),oe=function(e,n){var t,o=window.contentType;return i({method:"GET",url:le.get()+"".concat(null==p?void 0:p.getVideoInfoV2,"/").concat(o,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(t=t.watchHistory)||void 0===t?void 0:t.xApiKey},timeout:15e3})},re=function(e){var n=e.videoId;return i({method:"GET",url:le.get()+"".concat(null==p?void 0:p.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},le=(Z=null==p?void 0:p.apiBaseUrl,{set:function(e){e&&(Z=e)},get:function(){return Z}}),ae=function(e,n,t){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:n},withCredentials:!0})},de=function(e,n){var t=new Map;re({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),O=t})).catch((function(e){return console.log(e)}))},ue=function(){var e=B.get();return e>=0?e+1:1},se=function(){var e,n,t=L(),i=A(),o=null==i||null===(e=i.video)||void 0===e?void 0:e.id,r=B.get(),l=null==t||null===(n=t[r])||void 0===n||null===(n=n.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===o}));return l>=0?l+1:1};function ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ve(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ce(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var me=new Set,pe=function(e,n,t){var i,o,r,l,a,d,u,s,c,v={};v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.ASSET_NAME]=ge(e),v["c3.cm.id"]=(null==e||null===(o=e.linearchannel)||void 0===o?void 0:o.id)||(null==e||null===(r=e.video)||void 0===r?void 0:r.id)||"",v["c3.cm.contentType"]=we(e),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==t||null===(d=t.Constants)||void 0===d?void 0:d.VIEWER_ID]="undefined"===G()?"NA":G(),v["c3.cm.categoryType"]=fe(e),v[null==t||null===(u=t.Constants)||void 0===u?void 0:u.PLAYER_NAME]="VL_WEB_PLAYER",v["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"}}(),v.encoding="",v.screenResolution="",v.DRMEnabled=(null==e||null===(s=e.video)||void 0===s?void 0:s.drmEnabled)||(null==e||null===(c=e.linearchannel)||void 0===c?void 0:c.drmEnabled)||"None",v.subscriberType="",v.DAIStream=he();var m=ye(L(),e);return v=ve(ve({},v),m)},fe=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(n=n.categories)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.title)||"Null";var n},he=function(e){var n,t=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[t])||void 0===n||null===(n=n.liveDetails)||void 0===n?void 0:n.isDvrEnabled)||!1;return i?"YES":"NO"},ge=function(e){var n,t,i=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[i])||void 0===n||null===(n=n.gist)||void 0===n?void 0:n.title)||" Null",r=(null==e||null===(t=e[i])||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.id)||" Null";return"[".concat(r,"] ").concat(o)},we=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ye=function(e,n){var t,i,o={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n)return o;var r=ue(),l=se();return o["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(t=t.series)||void 0===t?void 0:t.title)||"Null",o["c3.cm.seasonNumber"]=(null==r?void 0:r.toString())||"Null",o["c3.cm.showTitle"]=(null==e||null===(i=e[r-1])||void 0===i||null===(i=i.episodes)||void 0===i||null===(i=i[l-1])||void 0===i?void 0:i.title)||"Null",o["c3.cm.episodeNumber"]=(null==r?void 0:r.toString())||"Null",o},Ie=function(){var e=n(t.mark((function e(n,i){var o,r,l,a,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=i&&null!==(o=i.convivaConfig)&&void 0!==o&&o.enable){e.next=2;break}return e.abrupt("return");case 2:if(l=W(n),"function"==typeof(a=null==i||null===(r=i.convivaConfig)||void 0===r?void 0:r.trackConvivaPlayerEvent)){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,a("getConvivaObject");case 8:if(d=e.sent){e.next=11;break}return e.abrupt("return");case 11:a("setPlayer",l),l.on("loadstart",(function(){a("playbackEnded");var e=A(),n=pe(e,l,d);n.authToken=(null==i?void 0:i.token)||"NA",a("contentInfo",n)})),l.on("play",(function(){me.has(l.currentSrc())||(me.add(l.currentSrc()),a("playbackStarted",null))})),l.on("ended",(function(){me.has(l.currentSrc())&&me.delete(l.currentSrc()),a("playbackEnded")}));case 15:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Ee=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},be=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Te=function(){var e;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgentData)||void 0===e?void 0:e.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"},Oe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},_e=function(e){return new Promise((function(n,t){if(ke(e))t("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},ke=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},De=function(){var e=n(t.mark((function e(n){var i,r,l,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=W(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return a=e.sent,e.prev=6,e.next=9,_e("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,a.default(o),e.finish(14);case 17:null!==(l=window)&&void 0!==l&&l.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==Te()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),Se=function(e,n){var t=W(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,i=this.el(),r=o.dom.getPointerPosition(i,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var l=window.cast&&window.cast.framework&&window.cast.framework.CastSession,a=null===(t=window)||void 0===t||null===(t=t.cast)||void 0===t||null===(t=t.framework)||void 0===t||null===(t=t.CastContext)||void 0===t||null===(t=t.getInstance())||void 0===t?void 0:t.S;if(console.log(l),l&&"CONNECTED"===a){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),u=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=u*r,d.seek()}}))};function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ce(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Pe(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}window._deviceInfo=l(navigator.userAgent);var Re=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 i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},Fe=function(){var e,n,t,i,o,l,a,d,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s=arguments.length>1?arguments[1]:void 0,c=arguments.length>2?arguments[2]:void 0,v=(null==c?void 0:c.contentType)||"video",m=null==c||null===(e=c[v])||void 0===e?void 0:e.metadata,p=W(s);if(!u.includes("VIEWLIFT_"))return u;var f=window.getComputedStyle(document.getElementById(s),null),h=Math.trunc(f.getPropertyValue("height").slice(0,-2)),g=Math.trunc(f.getPropertyValue("width").slice(0,-2)),w="linearchannel"===v?null==c||null===(n=c.linearchannel)||void 0===n||null===(n=n.channels)||void 0===n||null===(n=n.find((function(e){return(null==e?void 0:e.id)===(null==c?void 0:c.channelId)})))||void 0===n||null===(n=n.content)||void 0===n?void 0:n.id:Le(c,"video.gist.id",""),y=Ce(Ce({},Ne(m)),{},{VIEWLIFT_WIDTH:g,VIEWLIFT_HEIGHT:h,VIEWLIFT_SIZE:Re(g,h),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===(t=window)||void 0===t?void 0:t.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Le(c,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Le(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Le(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==p||null===(i=p.options_)||void 0===i?void 0:i.autoplay)||1,VIEWLIFT_MUTE:(null==p||null===(o=p.options_)||void 0===o?void 0:o.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:Ae(c),VIEWLIFT_MEDIA_ID:w,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Le(c,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:w,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+Le(c,"video.gist.permalink","")),VIEWLIFT_CONSENT:r.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Le(null===(l=window)||void 0===l||null===(l=l.app_data)||void 0===l||null===(l=l.site)||void 0===l?void 0:l.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:Le(null===(a=window)||void 0===a||null===(a=a.app_data)||void 0===a||null===(a=a.site)||void 0===a?void 0:a.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Le(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Le(c,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:w,VIEWLIFT_CONTENT_TITLE:Le(c,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:Le(c,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Le(c,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:se(),VIEWLIFT_SEASON_NUMBER:ue(),VIEWLIFT_CONTENT_TAGS:Ae(c)},null===(d=window)||void 0===d||null===(d=d.customData)||void 0===d?void 0:d.macros);for(var I in y){var E=new RegExp(I,"g");u=u.replace(E,y[I])}return u},Ne=function(e){var n,t,i={},o=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){o.set(e.name,e.value)})));var r=(null===(n=window)||void 0===n||null===(n=n.customData)||void 0===n||null===(n=n.subscription)||void 0===n?void 0:n.SVOD)||!1,l=(null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.subscription)||void 0===t?void 0:t.TVE)||!1;return r||l?(Oe()?r?i=Ce(Ce({},i),{},{VIEWLIFT_CSID:o.get("csid.mweb.dtc")||""}):l&&(i=Ce(Ce({},i),{},{VIEWLIFT_CSID:o.get("csid.mweb.tve")||""})):r?i=Ce(Ce({},i),{},{VIEWLIFT_CSID:o.get("csid.web.dtc")||""}):l&&(i=Ce(Ce({},i),{},{VIEWLIFT_CSID:o.get("csid.web.tve")||""})),r?i=Ce(Ce({},i),{},{VIEWLIFT_SFID:o.get("sfid.dtc")||""}):l&&(i=Ce(Ce({},i),{},{VIEWLIFT_SFID:o.get("sfid.tve")||""})),i=Oe()?Ce(Ce({},i),{},{VIEWLIFT_PROF:o.get("prof.mweb")||""}):Ce(Ce({},i),{},{VIEWLIFT_PROF:o.get("prof.web")||""})):(i=Ce(Ce({},i),{},{VIEWLIFT_SFID:o.get("sfid.dtc")||""}),i=Oe()?Ce(Ce({},i),{},{VIEWLIFT_CSID:o.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:o.get("prof.mweb")||""}):Ce(Ce({},i),{},{VIEWLIFT_CSID:o.get("csid.web.dtc")||"",VIEWLIFT_PROF:o.get("prof.web")||""})),i},je=function(e,n){var t,i,o,r,l,a,d=(null==e?void 0:e.contentType)||"video",u=null==e||null===(t=e[d])||void 0===t?void 0:t.drmEnabled,s=null==e||null===(i=e[d])||void 0===i||null===(i=i.streamingInfo)||void 0===i?void 0:i.videoAssets,c=null==e||null===(o=e[d])||void 0===o||null===(o=o.streamingInfo)||void 0===o?void 0:o.audioAssets,v=(null==e||null===(r=e[d])||void 0===r||null===(r=r.streamingInfo)||void 0===r||null===(r=r.videoAssets)||void 0===r?void 0:r.hls)||!1;null==e||null===(l=e[d])||void 0===l||null===(l=l.liveDetails)||void 0===l||l.isDvrEnabled;var m=(null==e||null===(a=e[d])||void 0===a||null===(a=a.streamingInfo)||void 0===a||null===(a=a.videoAssets)||void 0===a?void 0:a.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=c&&c.hls)return Ve(c);if(u){var p=Be(s,n);return p.src=Fe(p.src,n,e),p}if("Safari"!==Te()&&m)return xe(s);if(v){var f=Ve(s);return f.src=Fe(f.src,n,e),f}if(null!=s&&s.mpeg){var h=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(s);return h.src=Fe(h.src,n,e),h}return null},xe=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},Be=function(e,n){var t=e.fairPlay,i=e.widevine,r=e.playReady,l=Te();if(W(n),"Safari"===l){var a=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};console.log("🔐 Requesting FairPlay Certificate...",i),o.xhr(i,(function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);return He(n),a}var d={src:i.url,type:"application/dash+xml"};return He(n),d.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},d};var We,He=function(e){var n=W(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==Te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Me=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}};function Ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ze(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ue(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var Ge=[],qe=0,Ke=null;function Ye(n,t,i){var o,r,l,a,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(o=t.watchHistory)||void 0===o||o.apiVersion;var s=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,c=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,p=(null==t||null===(d=t.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,f=Math.floor(n.currentTime()),h=u?100:Math.floor(c/v*100),g={};p?function(n,t,i){var o=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(i),r=Je(o),l=(new Date).getTime(),a=A(),d=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return ze(ze({},n),{},e({},t,d[t]))}),{}),s=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===We}));s<0?r.push(ze(ze({content:u},n),{},{addedDate:l,updateDate:l})):r[s]=ze(ze(ze({},r[s]),n),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(r))}(g={completed:u,watchedTime:f,watchedPercentage:h},s,t.siteOwner):(g=ze(ze({videoId:We,watchedTime:f,watchedPercentage:h,doneWatching:u,profileId:s},Ke&&{seriesId:Ke}),m&&{originalObjectId:m}),ie(g).then((function(e){})).catch((function(e){}))),qe=c+i}function Je(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function $e(e,n,t){var i=Je(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var Qe=function(e,n,t){var i=W(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var o=parseFloat(n)/100;i.volume(o),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,"'")})},Xe=function(e){var n=W(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ze=function(e,n){var t;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(t=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.style)||void 0===t||t.setProperty("display","flex"));for(var i=W(e).textTracks(),o=0;o<i.length;o++){var r=i[o];"subtitles"!==r.kind&&"captions"!==r.kind||r.id!=n||(r.mode="showing")}},en=function(e,n){for(var t=W(e).textTracks(),i=0;i<t.length;i++){var o=t[i];"subtitles"!==o.kind&&"captions"!==o.kind||o.id!==n||(o.mode="hidden")}},nn=function(e){var n,t=W(e);return(null==t||null===(n=t.textTracks())||void 0===n?void 0:n.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},tn=function(e){var n=W(e);n.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,n.removeRemoteTextTrack(e)}))},on=function(e,n){var t=W(e);t.remoteTextTracks().tracks_.map((function(e){t.removeRemoteTextTrack(e)})),n.map((function(e){t.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},rn=!1,ln=function(e,n,t){var i=Fe(n,e,t),o=W(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i=W(e);if(null!==i.el_){rn=!0;var o={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),rn&&null!==i.el_&&("function"==typeof i.ima?i.ima(o):setTimeout((function(){i.ima.setContentWithAdTag(null,n,!0),i.ima.requestAds()}),1e3));var r=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&r.hasAttribute("controls")&&r.removeAttribute("controls");var l="click",a=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(a=!0,l="touchend"),i.one(l,(function(){a&&i.ima.initializeAdDisplayContainer()}));var d=(null===(t=window)||void 0===t||null===(t=t.customData)||void 0===t||null===(t=t.ads)||void 0===t?void 0:t.adEventHandler)||null;i.one("ads-ad-started",(function(){d&&d({status:"STARTED",msg:"Advertisement Started"})})),i.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){d&&d({status:"ENDED",msg:"Advertisement Ended"})}))})),i.on("adserror",(function(e){d&&d({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}},an=["live","carousel","V2","defaultV2","multiplayer","minimalist","VL_ONE"],dn=function(e){var n=(new DOMParser).parseFromString(e,"text/html");return null==n?void 0:n.querySelector("body")},un=function(e){var n=(new DOMParser).parseFromString(e,"image/svg+xml");return null==n?void 0:n.querySelector("svg")},sn=function(e){return un(e)},cn=function(e,n){if(n){var t,i=W(n);if(null!=i&&null!==(t=i.el())&&void 0!==t&&null!==(t=t.classList)&&void 0!==t&&t.contains("skin_defaultv2"))return void vn(e)}var o=d(document.querySelectorAll("[video-idx]"));console.log(o),o.map((function(n){var t=n.parentNode,i=n.getAttribute("video-idx");t.style.background=i==e?"gray":"none"}))},vn=function(e){d(document.querySelectorAll("[video-idx]")).map((function(n){var t=n.getAttribute("video-idx");n.style.border=t==e?"2px solid white":"none"}))},mn=function(){var e=d(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var n;null==e||null===(n=e.childNodes)||void 0===n||null===(n=n[0])||void 0===n||n.click()}))},pn=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},fn="",hn=function(e,n){var t,i=function(){return function(e,n){var t=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",i=document.getElementById(e);if(i&&fn!==t){var o=window.getComputedStyle(i,null).getPropertyValue("height");n&&(n.style.height="".concat(o)),fn=t}}(e,n)};window._orientationChangeHandler=i;window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout((function(){i()}),100)}))},gn=function(e,n){var t,i=W(e),o=W(e).el(),r=new ResizeObserver((function(){var i;null!==(i=n.classList)&&void 0!==i&&i.contains("hidden")||(t&&clearTimeout(t),t=setTimeout((function(){wn(e,n)}),300))}));r.observe(o),i.on("dispose",(function(){r.disconnect()})),i.on("fullscreenchange",(function(){setTimeout((function(){wn(e,n)}),50)}))},wn=function(e,n){var t;if(n){var i=document.getElementById(e),o=null===(t=window.getComputedStyle(i,null))||void 0===t?void 0:t.height;n.style.height!==o&&(n.style.height="".concat(o))}};function yn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var In=function(e){o(e).play()},En=function(e){o(e).pause()},bn=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Tn=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},On=function(e){return!!o.getPlayer("".concat(e))},_n=function(e){return o(e).paused()},kn=function(){var e=n(t.mark((function e(n,i){var o,r,l,a=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.length>2&&void 0!==a[2]&&a[2],e.next=3,S();case 3:return r=e.sent,l=W(n),e.abrupt("return",new Promise((function(e,t){ne(i,r).then((function(t){var r=null==t?void 0:t.data;window.sid=z(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=je(r,n);R(r),a&&o?(Rn(n,a),l.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).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)}}(),Dn=function(){var e=n(t.mark((function e(n,i,o){var r,l,a,d,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:return a=e.sent,(L()||null)&&V(i),d=0,u=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(l=l.watchHistory)&&void 0!==l&&l.enable&&oe(i,a).then((function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(n=n.watchHistory)&&void 0!==n&&n.cb&&(null===(t=window)||void 0===t||null===(t=t.watchHistory)||void 0===t||t.cb(null==e?void 0:e.data)),d=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,u=(null==e||null===(o=e.data)||void 0===o?void 0:o.watchedPercentage)||null})).catch((function(e){var n,t;null!==(n=window)&&void 0!==n&&null!==(n=n.watchHistory)&&void 0!==n&&n.cb&&(null===(t=window)||void 0===t||null===(t=t.watchHistory)||void 0===t||t.cb(e))})),e.abrupt("return",new Promise((function(e,t){ee(i,a).then((function(i){var o,r,l,a=null==i?void 0:i.data,s=(null==a||null===(o=a.video)||void 0===o||null===(o=o.streamingInfo)||void 0===o?void 0:o.isLiveStream)||!1;R(i.data);var c=(null==a||null===(r=a.ads)||void 0===r||null===(r=r.preRoll)||void 0===r||null===(r=r.adTags)||void 0===r||null===(r=r.web)||void 0===r?void 0:r.active)&&(null==a||null===(l=a.ads)||void 0===l||null===(l=l.preRoll)||void 0===l||null===(l=l.adTags)||void 0===l||null===(l=l.web)||void 0===l?void 0:l.url);c&&ln(n,c,a);var v=je(a,n);if(v){var m,p,f,h,g,w,y,I=(null==a||null===(m=a.video)||void 0===m||null===(m=m.gist)||void 0===m?void 0:m.videoImageUrl)||(null==a||null===(p=a.video)||void 0===p||null===(p=p.gist)||void 0===p||null===(p=p.imageGist)||void 0===p?void 0:p.r16x9),E=W(n);if(E.poster(I),Rn(n,v),E.on("loadstart",(function(){s&&e({status:!0,msg:"Video Loaded",response:a})})),E.on("loadeddata",(function(){be(),e({status:!0,msg:"Video Loaded",response:a})})),E.one("play",(function(){d&&u<95&&setTimeout((function(){E.currentTime(d)}),0)})),E.one("error",(function(){var e;t({status:!1,msg:(null==E||null===(e=E.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==a||null===(f=a.video)||void 0===f||null===(f=f.contentDetails)||void 0===f||null===(f=f.closedCaptions)||void 0===f?void 0:f.length)>0||(null==a||null===(h=a.video)||void 0===h||null===(h=h.closedCaptions)||void 0===h?void 0:h.length)>0)g=((null==a||null===(w=a.video)||void 0===w||null===(w=w.contentDetails)||void 0===w?void 0:w.closedCaptions)||(null==a||null===(y=a.video)||void 0===y?void 0:y.closedCaptions)).filter((function(e){return"VTT"===e.format})),on(n,g);else tn(n)}else Ee(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){An(e,n,t,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Sn=function(e,n,t){var i=W(e);return i.src(n),new Promise((function(e,n){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Pn=function(e){var n=W(e);if(Cn(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Cn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Rn=function(e,n){var t=W(e);t&&t.src(n)},An=function(n,t,i,o){var r,l,a,d,u=null==n||null===(r=n.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.errorCode,s=(null==n||null===(l=n.response)||void 0===l||null===(l=l.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message);On(t)&&Ee(t,(null===(a=window)||void 0===a?void 0:a.customErrors)&&(null===(d=window)||void 0===d?void 0:d.customErrors[u])||"".concat(s)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):yn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({status:!1,response:n,msg:"".concat(s)},o&&{videoId:o}))},Ln=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},Fn=!1,Nn=function(e,n){var t,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(t=t.streamingInfo)||void 0===t?void 0:t.secondaryVideoAssets)||null)&&!Fn){var o=jn(e,"videoAssets","secondaryVideoAssets"),r=je(o,n);return r&&Rn(n,r),Fn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function jn(e,n,t){if(Array.isArray(e))return e.map((function(e){return jn(e,n,t)}));if(null!==e&&"object"===a(e)){var i={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=jn(e[o],n,t)})),i}return e}function xn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Vn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?xn(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):xn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var Bn=function(e,n,t,i){var o,r=i.res,l=i.sres,a=W(e),d=(null==r?void 0:r.contentType)||"video",u=(null==r||null===(o=r[d])||void 0===o||null===(o=o.streamingInfo)||void 0===o?void 0:o.isLiveStream)||!1;R(r),a&&(a.on("loadstart",(function(){u?t.resolve({status:!0,msg:"Video Loaded",response:r}):t.resolve(Vn({status:!0,msg:"Player Initialised"},l?{seriesResponse:l,response:r}:{response:r}))})),a.on("loadeddata",(function(){var t,i,o;(null==a||!a.muted())&&Qe(e,sessionStorage.getItem("volume")||"100");var l=A();if(be(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var d,u=Vn(Vn({},n),r);!function(e,n,t){var i,o,r;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(Ke=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Ge=[],qe=0,We=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=W(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());Ge.includes(qe)||(e==qe?(Ge.push(e),Ye(a,n,l)):e>qe&&(qe=e+l))})),a.one("ended",(function(){Ye(a,n,l,!0)})))}(e,u,null==l||null===(d=l.video)||void 0===d||null===(d=d.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(o=n.analytics)&&void 0!==o&&o.muxKey&&null!=a&&a.mux){var s,c,v,m,p,f,h=(null===(s=A())||void 0===s?void 0:s.video)||(null==r?void 0:r.video),g=null==h?void 0:h.gist,w={env_key:null==n||null===(c=n.analytics)||void 0===c?void 0:c.muxKey,player_name:"vl-web-player",player_version:null===(v=window)||void 0===v?void 0:v.vl_player_version,video_id:null==g?void 0:g.id,video_title:null==g?void 0:g.title,video_series:null==h||null===(m=h.series)||void 0===m?void 0:m.title,video_stream_type:null!=h&&null!==(p=h.streamingInfo)&&void 0!==p&&p.isLiveStream?"live":"video",viewer_user_id:null==n||null===(f=n.analytics)||void 0===f?void 0:f.userId};a.mux({debug:!1,data:w})}})),a.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];a.trigger("subtitlechanged",n)})),a.on("subtitlechanged",(function(e,n){var t,i,o=window.cast&&window.cast.framework&&window.cast.framework.CastSession,r=null===(t=window)||void 0===t||null===(t=t.cast)||void 0===t||null===(t=t.framework)||void 0===t||null===(t=t.CastContext)||void 0===t||null===(t=t.getInstance())||void 0===t?void 0:t.S,l=null===(i=window)||void 0===i||null===(i=i.cast)||void 0===i||null===(i=i.framework)||void 0===i||null===(i=i.CastContext)||void 0===i||null===(i=i.getInstance())||void 0===i?void 0:i.getCurrentSession();if(o&&"CONNECTED"===r){var a,d=l.getMediaSession(),u=d.media.tracks.filter((function(e){return"TEXT"==e.type}));a=n?new chrome.cast.media.EditTracksInfoRequest([u[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(a)}})),a.tech_.on("retryplaylist",(function(){u&&Nn(r,e)})),a.on("error",(function(){var n,i;(console.log("ERROR",a.error(),a.error().code),4===a.error().code&&u)?Nn(r,e):(Ee(e,(null==a||null===(n=a.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==a||null===(i=a.error())||void 0===i?void 0:i.message)||"Some error occured",response:r}))})),a.one("play",(function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,i=null===(t=A())||void 0===t||null===(t=t.video)||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.id,o=j(),r=(null==o?void 0:o.get(i))||{t:0,p:0},l=r.t,d=r.p;l&&d<95&&setTimeout((function(){a.currentTime(l)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){a.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0)})),a.on("volumechange",(function(){var e=100*a.volume().toFixed(2);a.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),a.on("chromecastDisconnected",(function(){if(u){a.currentSource();for(var e=a.textTracks(),n=e.length-1;n>=0;n--)a.removeRemoteTextTrack(e[n])}})))},Wn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-b21836b3.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-3a674901.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-617e7646.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-09e914e0.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-af3b54f1.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-26ebf184.js").then((function(t){t.initialiseSkin(e,n)}))},Hn=function(e,n,t){var i=W(e);i?n>=0&&n<=i.duration()?(t({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),i.currentTime(n)):t({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):t("Cannot find player with id: '".concat(e,"'"))},Mn=function(e,n){var t=W(e);if(!t)return"Cannot find player with id: '".concat(e,"'");try{return t.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(e){return"Error: ".concat(e)}},Un=function(e,n){var t=W(e);t?t.on("timeupdate",(function(){return n(t.currentTime())})):n("Cannot find player with id: '".concat(e,"'"))},zn=function(e,n){var t=W(e);t?t.on("ended",(function(){return n(!0)})):n("Cannot find player with id: '".concat(e,"'"))},Gn=function(e){var n=W(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")},qn=function(e){var n,t=W(e),i=[];if((null==t||null===(n=t.tech_)||void 0===n?void 0:n.vhs)||!1){var o,r=null==t||null===(o=t.tech_)||void 0===o||null===(o=o.vhs)||void 0===o?void 0:o.representations();(null==r?void 0:r.length)>0&&(i=null==r?void 0:r.sort((function(e,n){return(null==e?void 0:e.height)==(null==n?void 0:n.height)?(null==n?void 0:n.bandwidth)-(null==e?void 0:e.bandwidth):(null==n?void 0:n.height)-(null==e?void 0:e.height)})))}else{var l,a=null==t||null===(l=t.dash)||void 0===l||null===(l=l.mediaPlayer)||void 0===l?void 0:l.getBitrateInfoListFor("video");(null==a?void 0:a.length)>0&&(i=null==a?void 0:a.sort((function(e,n){return n.height-e.height})))}return i};function Kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kn=function(){return!!e})()}var Yn=o.getComponent("Component"),Jn=function(){function n(t){var i,r,l,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(this,n),r=this,a=[t,s],l=v(l=n),i=c(r,Kn()?Reflect.construct(l,a||[],v(r).constructor):l.apply(r,a)),e(i,"masterRenditions",[]),e(i,"addCustomFont",(function(e){var n=o.dom.createEl("div",{className:"font hideCustomFonts"}),t=o.dom.createEl("p",{className:"customFontHeading",innerHTML:"Font Size"});o.dom.appendContent(n,t);var r=o.dom.createEl("div",{className:"font-options"});r.style.fontSize="12px",i.fontSizeOptions.map((function(e,n){var t=o.dom.createEl("div",{className:"options",innerHTML:'<div class="radio-item" >\n <input class=opt'.concat(n,' type="radio" id=').concat(e,' name="item" />\n <label class="radio-btn-lable" for=').concat(e,">").concat(e,"pt</label>\n </div>")});t.addEventListener("click",(function(e){var n=e.target.id;i.changeFontSize(n)})),o.dom.appendContent(r,t)})),o.dom.appendContent(n,r),o.dom.appendContent(e,n)})),e(i,"resetRenditions",(function(){d(document.getElementsByClassName("rendition")).map((function(e){o.dom.removeClass(e,"selected")}))})),i.playerId=null==s?void 0:s.playerId,i.skin=null==s?void 0:s.skin,i.icon=null==s?void 0:s.icon,i.masterRenditions=[],i.fontSizeOptions=[10,12,14],i.createRenditions(s.renditions),window.height=null,i}return m(n,Yn),s(n,[{key:"toggleContentOnHover",value:function(e,n){var t=o.dom.$(".setting-icon",e);t.addEventListener("mouseover",(function(){o.dom.removeClass(n,"resolution_hidden")})),n.addEventListener("mouseover",(function(){o.dom.removeClass(n,"resolution_hidden")})),t.addEventListener("mouseout",(function(){o.dom.addClass(n,"resolution_hidden")})),n.addEventListener("mouseout",(function(){o.dom.addClass(n,"resolution_hidden")}))}},{key:"changeFontSize",value:function(e){var n=o.dom.$(".renditions",this.contentEl()),t=o.dom.$(".font-options",this.contentEl());n.style.fontSize="".concat(e,"px"),t.style.fontSize="".concat(e,"px")}},{key:"createRenditions",value:function(e){var n=this,t=this.el(),i=o.dom.$(".setting-icon",this.el()),r=un(this.icon);if(i.append(r),"live"===this.skin){var l=document.createTextNode(" Settings");i.appendChild(l)}var a=o.dom.createEl("div",{className:"content resolution_hidden"}),d=o.dom.createEl("div",{innerHTML:"Quality",className:"title"}),u=o.dom.createEl("div",{className:"resolution"});o.dom.appendContent(u,d),this.toggleContentOnHover(t,a);var s=o.dom.createEl("div",{className:"renditions"});this.player_.tech_.vhs?(e.map((function(e,t){var i,r,l=o.dom.createEl("div",{className:"relative"}),a=(((null==e||null===(i=e.playlist)||void 0===i?void 0:i.attributes["AVERAGE-BANDWIDTH"])||(null==e||null===(r=e.playlist)||void 0===r?void 0:r.attributes.BANDWIDTH))/1048576).toFixed(1),d="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");d="".concat(e.height,"p @ ").concat(a,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");var u=o.dom.createEl("p",{innerHTML:d,className:"rendition",res:e.height,bandwidth:e.bandwidth});o.dom.appendContent(l,u),o.dom.appendContent(s,l),u.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(n.resetRenditions(),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,$n(n.playerId,e.target),o.dom.addClass(u,"selected"))}))})),this.addAutoRendition("nondrm",s),"Safari"!=Te()&&this.addDynamicSwitchIfAuto()):(e.map((function(e,t){var i=o.dom.createEl("div",{className:"relative"}),r=(e.bitrate/1e6).toFixed(1),l="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");window.enableResolutionsBitrate&&(l="".concat(e.height,"p @ ").concat(r,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":""));var a=o.dom.createEl("p",{innerHTML:l,className:"rendition",res:e.height,qualityIndex:e.qualityIndex});o.dom.appendContent(i,a),o.dom.appendContent(s,i),a.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(n.resetRenditions(),window.height=e.target.res,window.selectedVideo=e.target.video,window.qualityIndex=e.target.qualityIndex,$n(n.playerId,e.target),o.dom.addClass(a,"selected"))}))})),this.addAutoRendition("drm",s)),o.dom.appendContent(u,s),o.dom.appendContent(a,u),o.dom.appendContent(t,a)}},{key:"addDynamicSwitchIfAuto",value:function(){for(var e,n=this.player_.textTracks(),t=0;t<n.length;t++)"segment-metadata"===n[t].label&&(e=n[t]);var i=null;e&&e.on("cuechange",(function(){var n,t=e.activeCues[0];if(console.log((null==t||null===(n=t.value)||void 0===n||null===(n=n.resolution)||void 0===n?void 0:n.height)+"p"),t&&document.querySelector(".auto.selected")){var o,r,l,a;if(null!=t&&null!==(o=t.value)&&void 0!==o&&null!==(o=o.resolution)&&void 0!==o&&o.height&&i!==(null==t||null===(r=t.value)||void 0===r||null===(r=r.resolution)||void 0===r?void 0:r.height))document.querySelector(".auto.selected").textContent="Auto ".concat(null==t||null===(a=t.value)||void 0===a||null===(a=a.resolution)||void 0===a?void 0:a.height,"p");i=null==t||null===(l=t.value)||void 0===l||null===(l=l.resolution)||void 0===l?void 0:l.height}}))}},{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"container"}),n=o.dom.createEl("div",{className:"setting-icon"});return o.dom.appendContent(e,n),e}},{key:"addAutoRendition",value:function(e,n){var t=this;if("nondrm"==e){var i,r,l=null===(i=this.player_)||void 0===i||null===(i=i.tech_)||void 0===i?void 0:i.vhs.selectPlaylist().attributes.RESOLUTION.height,a=null===(r=this.player_)||void 0===r||null===(r=r.tech_)||void 0===r?void 0:r.vhs.selectPlaylist().attributes.BANDWIDTH,d=o.dom.createEl("div",{className:"relative"}),u=o.dom.createEl("p",{innerHTML:"Auto ".concat(l,"p"),className:"rendition auto selected",bandwidth:a,res:l});u.addEventListener("click",(function(e){window.height!==e.target.res&&(t.resetRenditions(),o.dom.addClass(u,"selected"),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,$n(t.playerId,null,!0))})),o.dom.appendContent(d,u),o.dom.appendContent(n,d)}else{var s=o.dom.createEl("div",{className:"relative"}),c=o.dom.createEl("p",{innerHTML:"Auto",className:"rendition selected",qualityIndex:"auto"});c.addEventListener("click",(function(e){t.resetRenditions(),o.dom.addClass(c,"selected"),window.qualityIndex=e.target.qualityIndex,window.selectedVideo=e.target.video,$n(t.playerId,null,!0)})),o.dom.appendContent(s,c),o.dom.appendContent(n,s)}}}])}(),$n=function(e,n,t){var i,r=W(e),l=null==n?void 0:n.bandwidth;if((null==r||null===(i=r.tech_)||void 0===i?void 0:i.vhs)||!1){r.tech_.vhs.representations().forEach((function(e){t||e.bandwidth===l?e.enabled(!0):e.enabled(!1)})),r.handleTechPlaying_();var a=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(a)}),100);var d=o.dom.$(".content");d&&o.dom.addClass(d,"resolution_hidden")}else{var u=null==n?void 0:n.qualityIndex;if(t){var s;null==r||null===(s=r.dash)||void 0===s||null===(s=s.mediaPlayer)||void 0===s||s.resetSettings()}else{var c,v;null==r||null===(c=r.dash)||void 0===c||null===(c=c.mediaPlayer)||void 0===c||c.updateSettings({streaming:{abr:{autoSwitchBitrate:!1}}}),null==r||null===(v=r.dash)||void 0===v||null===(v=v.mediaPlayer)||void 0===v||v.setQualityFor("video",u,!0);var m=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(m)}),100);var p=o.dom.$(".content");p&&o.dom.addClass(p,"resolution_hidden")}}},Qn=Object.freeze({__proto__:null,default:Jn,playSelectedResolution:$n});var Xn,Zn=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),_e("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)}}(),et=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),nt=function(){var e=n(t.mark((function e(){var n;return t.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(o),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)}}(),tt=Object.freeze({__proto__:null,importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){_e("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},loadAdsLibrary:Zn,loadEMELibrary:et,loadMuxPlugin:nt}),it={},ot=function(e){var n;return(null===(n=it)||void 0===n?void 0:n[e])||""};function rt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function lt(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):rt(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var at=function(i,r,l,a){var d,u,s,c,v,m,p,f,h,g,w,y=r.res,I=void 0===y?null:y,E=r.sres,b=void 0===E?null:E;null===(d=window)||void 0===d||null===(d=d.cast)||void 0===d||null===(d=d.framework)||void 0===d||null===(d=d.CastContext)||void 0===d||null===(d=d.getInstance())||void 0===d||d.S;var T=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],O=(null===(u=I)||void 0===u?void 0:u.contentType)||"video",_=pn(null===(s=I)||void 0===s||null===(s=s[O])||void 0===s||null===(s=s.gist)||void 0===s?void 0:s.videoImageUrl)||pn(null===(c=I)||void 0===c||null===(c=c[O])||void 0===c||null===(c=c.gist)||void 0===c||null===(c=c.imageGist)||void 0===c?void 0:c.r16x9),k=(null===(v=I)||void 0===v||null===(v=v[O])||void 0===v||null===(v=v.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,D=(null===(m=I)||void 0===m||null===(m=m[O])||void 0===m||null===(m=m.streamingInfo)||void 0===m?void 0:m.isLiveStream)||!1,S=(null===(p=I)||void 0===p||null===(p=p.ads)||void 0===p||null===(p=p.preRoll)||void 0===p||null===(p=p.adTags)||void 0===p||null===(p=p.web)||void 0===p?void 0:p.active)&&(null===(f=I)||void 0===f||null===(f=f.ads)||void 0===f||null===(f=f.preRoll)||void 0===f||null===(f=f.adTags)||void 0===f||null===(f=f.web)||void 0===f?void 0:f.url);I=lt(lt({},I),{},{audioAssetSource:null==l?void 0:l.audioAssetSource});var P=e(e(e(e(e(e(e(e({enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==l.skin,liveui:k},"autoplay",null==l?void 0:l.autoplay),"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!S),"loop",(null==l?void 0:l.loop)||!1),"audioPosterMode",null==l?void 0:l.audioPosterMode),"html5",lt(lt({vhs:lt(lt({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==l||null===(h=l.customData)||void 0===h?void 0:h.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==l||null===(g=l.customData)||void 0===g?void 0:g.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(w=l.customData)||void 0===w?void 0:w.nativeVideoTracks)&&{nativeVideoTracks:!1})),"poster",_),"techOrder",T),"chromecast",{requestCustomDataFn:function(e){var n=W(i),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var i,o,r,l,a,d=(null==e?void 0:e.contentType)||"video",u={};if(e&&null!=e&&e[d]&&null!=e&&e[d].drmEnabled){u.isDrmEnabled=!0;var s=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;u.licenseUrl=s;var c=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];u.licenseToken=c}var v=(null==e||null===(i=e[d])||void 0===i||null===(i=i.gist)||void 0===i?void 0:i.contentType)||"VIDEO";u.contentType=v;var m=null==e||null===(o=e[d])||void 0===o||null===(o=o.gist)||void 0===o?void 0:o.runtime;u.duration=m;var p=null==e||null===(r=e[d])||void 0===r||null===(r=r.gist)||void 0===r?void 0:r.title;u.mediaTitle=p;var f=null==e||null===(l=e[d])||void 0===l||null===(l=l.gist)||void 0===l?void 0:l.videoImageUrl;return u.mediaImage=f,u.subTitles=t,u.DVR=(null==e||null===(a=e[d])||void 0===a||null===(a=a.liveDetails)||void 0===a?void 0:a.isDvrEnabled)||!1,console.log(u),u}(I,e,t)}});if(!o.getPlayers()[i])var C=o(i,P,function(){var e=n(t.mark((function e(){var n,r,d,u,s,c,v,m,p,f,h,g,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(C),console.log(o.VERSION),console.log(o.getPlugins()),e.next=5,De(l);case 5:if(null!=l&&null!==(n=l.analytics)&&void 0!==n&&n.muxKey&&nt(),D&&a.resolve(lt({status:!0,msg:"Player Initialised"},b?{seriesResponse:b,response:I}:{response:I})),J(i),Ie(i,l),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),v=null===(r=I)||void 0===r||null===(r=r[O])||void 0===r?void 0:r.drmEnabled,m=null===(d=I)||void 0===d||null===(d=d[O])||void 0===d||null===(d=d.liveDetails)||void 0===d?void 0:d.startOverTime,!v){e.next=15;break}return e.next=15,et();case 15:k&&Se(i,m),!S||null!=l&&null!==(u=l.customData)&&void 0!==u&&u.disableAds||ln(i,S,I),p=je(I,i),console.log(p),null!=l&&l.nearestClusterUrl&&(p=Me(p,l.nearestClusterUrl)),p?Rn(i,p):(a.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:I}),Ee(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(s=I)||void 0===s||null===(s=s[O])||void 0===s||null===(s=s.contentDetails)||void 0===s||null===(s=s.closedCaptions)||void 0===s?void 0:s.length)>0||(null===(c=I)||void 0===c||null===(c=c[O])||void 0===c||null===(c=c.closedCaptions)||void 0===c?void 0:c.length)>0)&&(w=(null===(h=I)||void 0===h||null===(h=h[O])||void 0===h||null===(h=h.contentDetails)||void 0===h?void 0:h.closedCaptions)||(null===(g=I)||void 0===g||null===(g=g[O])||void 0===g?void 0:g.closedCaptions),f=w.filter((function(e){return"VTT"===e.format})),on(i,f)),null!=l&&l.disableControls?Ln(i):Wn(i,lt(lt(lt({},l),P),{},{liveVideo:D,isDvrEnabled:k,res:I,sres:b})),Bn(i,lt(lt(lt({},l),P),{},{liveVideo:D}),a,{res:I,sres:b});case 24:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function dt(){return{loadVideoInstantly:Sn,onTimeUpdate:Un,getVideoDuration:Gn,onVideoEnded:zn,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(t.mark((function n(i,o){var r,l,a,d,u,s,c,v,m,p,h,w,E,b,T,O,_,k,D,S,C,A,L,F,N,j,x;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!On(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(h=(null==e?void 0:e.videoSourceUrl)||!1,w=null==e?void 0:e.asat,E=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,window.videoId=b,O=null==e?void 0:e.token,!P(e)){n.next=15;break}if(y().set(null==e?void 0:e.refreshToken),O&&!g(O)){n.next=14;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 14:Xn=JSON.parse(atob(O.split(".")[1]));case 15:return e.isAnonymousUser=!(null===(a=Xn)||void 0===a||!a.anonymousId),e.siteOwner=(null===(d=Xn)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Xn)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(s=Xn)||void 0===s?void 0:s.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",O),_=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,k=null==e?void 0:e.airplay,D=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,(S=null==e?void 0:e.errors)&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,V=null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation,it=V,le.set(e.apiBaseUrl),null!=e&&e.skin&&(t=e.skin,an.includes(t))||(e.skin="VL_ONE"),n.next=33,Zn();case 33:k&&"Safari"==Te()&&Promise.resolve().then((function(){return tt})).then((function(e){e.importAirplay()})),D&&_e("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then((function(){return e=D,window.dataLayer=window.dataLayer||[],f("js",new Date),void f("config",e);var e})).catch((function(e){})),(C=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(_)))&&C.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h?(L={directPlaybackUrl:h,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?ee(A,O).then((function(n){at(_,{res:lt(lt({},n),L)},e,{resolve:i,reject:o})})).catch((function(e){An(e,_,o,A)})):at(_,{res:L},e,{resolve:i,reject:o})):T?(N=sessionStorage.getItem("season-idx")||0,B.set(parseInt(N)),j=null==e||null===(F=e.series)||void 0===F?void 0:F.id,te(j,O).then((function(n){var t,r=n.data,l=n.data.seasons;I=l;var a=b||(null==l||null===(t=l[0])||void 0===t||null===(t=t.episodes)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.id);de(j,O),ee(a,O).then((function(n){var t;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(t=t.video)||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.contentType,R(n.data),at(_,{res:null==n?void 0:n.data,sres:r},e,{resolve:i,reject:o})})).catch((function(e){An(e,_,o,b)}))})).catch((function(e){An(e,_,o)}))):E?(x=null==e?void 0:e.epg,ne(x,O).then((function(n){var t=null==n?void 0:n.data;t.contentType="linearchannel",t.channelId=null==x?void 0:x.channelId,at(_,{res:t},e,{resolve:i,reject:o})})).catch((function(e){An(e,_,o,b)}))):ee(b,O).then((function(n){var t,r;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(t=t.video)||void 0===t||null===(t=t.gist)||void 0===t?void 0:t.contentType,R(null==n?void 0:n.data);var l,a=null==n?void 0:n.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(r=e.watchHistory)&&void 0!==r&&r.enable)if((null===(l=e.watchHistory)||void 0===l?void 0:l.saveOffline)||!1){var d,u,s,c=$e((null===(d=e.watchHistory)||void 0===d?void 0:d.profileId)||"",b,null==e?void 0:e.siteOwner);if(c&&c.length)e.watchHistoryResumeTime=(null===(u=c[0])||void 0===u?void 0:u.watchedTime)||null,e.watchedPercentage=(null===(s=c[0])||void 0===s?void 0:s.watchedPercentage)||null;a.contentType="video",at(_,{res:a},e,{resolve:i,reject:o})}else oe(b,O).then((function(n){var t,r,l,d;null!==(t=window)&&void 0!==t&&null!==(t=t.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(r=r.watchHistory)||void 0===r||r.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(l=n.data)||void 0===l?void 0:l.watchedTime)||null,e.watchedPercentage=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedPercentage)||null,a.contentType="video",at(_,{res:a},e,{resolve:i,reject:o})})).catch((function(n){var t,r;null!==(t=window)&&void 0!==t&&null!==(t=t.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(r=r.watchHistory)||void 0===r||r.cb(n)),at(_,{res:a},e,{resolve:i,reject:o})}));else at(_,{res:a},e,{resolve:i,reject:o})})).catch((function(e){An(e,_,o,b)}));case 38:case"end":return n.stop()}var t,V}),n)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:qn,skip:bn,getPlayer:W,play:In,pause:En,detectBrowser:Te,rewind:Tn,loadVideo:Rn,seekToTimeStamp:Hn,isPlayerInitialised:On,load:Dn,authenticateLC:kn,dispose:Pn,enableCaptions:Ze,disableCaptions:en,getCaptions:nn,playSelectedResolution:$n,getSource:je,setVolume:Qe,getVolume:Xe,disableControls:Ln,setPlaybackSpeed:Mn,getEntitlementData:ae}}export{en as A,Ze as B,$n as C,j as D,x as E,V as F,B as G,vn as H,zn as I,_n as J,Qn as K,dt as V,A as a,En as b,sn as c,qn as d,nn as e,Te as f,W as g,Tn as h,Oe as i,F as j,L as k,ot as l,un as m,Dn as n,R as o,In as p,dn as q,tn as r,bn as s,re as t,mn as u,wn as v,hn as w,gn as x,cn as y,N as z};
|