@viewlift/player-backup 2.0.175-backup → 2.0.177-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/cjs/{autoNextVideo-cbbc8600.js → autoNextVideo-2085c497.js} +1 -1
  2. package/cjs/bundle.css +6 -6
  3. package/cjs/{features-66fdfb7d.js → features-a73e5a86.js} +1 -1
  4. package/cjs/generic-61792002.js +1 -0
  5. package/cjs/index-2dcf677b.js +1 -0
  6. package/cjs/{index-1828d598.js → index-cffe2d41.js} +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/{multicamv2-47bfaaeb.js → multicamv2-544f03f0.js} +1 -1
  9. package/cjs/{multicamv2-97fb9bf6.js → multicamv2-864c5b70.js} +1 -1
  10. package/cjs/{nextEpisodeButton-8c4a09c4.js → nextEpisodeButton-48d3552a.js} +1 -1
  11. package/cjs/{playlist-9718fe08.js → playlist-08274536.js} +1 -1
  12. package/cjs/{series-76abcdc5.js → series-1f5de79f.js} +1 -1
  13. package/cjs/{series-v2-a89972fc.js → series-v2-5fa17e42.js} +1 -1
  14. package/cjs/{series-v2-7ac4e549.js → series-v2-d8ea49db.js} +1 -1
  15. package/cjs/{skin-a3c43246.js → skin-0ea8fc5a.js} +1 -1
  16. package/cjs/{skin-9c589b70.js → skin-2e8f08b9.js} +1 -1
  17. package/cjs/{skin-456d3608.js → skin-48475e60.js} +1 -1
  18. package/cjs/{skin-8e706000.js → skin-6626094d.js} +1 -1
  19. package/cjs/{skin-e373caf2.js → skin-764adc22.js} +1 -1
  20. package/cjs/{skin-e207640c.js → skin-da915d8c.js} +1 -1
  21. package/cjs/{skin-d926f18c.js → skin-f858aecb.js} +1 -1
  22. package/cjs/{util-f6d9c275.js → util-671b0bcf.js} +1 -1
  23. package/cjs/{videoSelector-e05bf371.js → videoSelector-7d1d3f8a.js} +1 -1
  24. package/cjs/{videoSelector-a6e4e1a4.js → videoSelector-ed36a28d.js} +1 -1
  25. package/esm/{autoNextVideo-0ddc8aa3.js → autoNextVideo-a7610b13.js} +1 -1
  26. package/esm/bundle.css +6 -6
  27. package/esm/{features-040e62a8.js → features-d501d205.js} +1 -1
  28. package/esm/generic-b3cb59a6.js +1 -0
  29. package/esm/index-1d0c78b9.js +1 -0
  30. package/esm/{index-32c60973.js → index-23e8568d.js} +1 -1
  31. package/esm/index.js +1 -1
  32. package/esm/{multicamv2-ecf54a7e.js → multicamv2-3388f3a6.js} +1 -1
  33. package/esm/{multicamv2-694d2012.js → multicamv2-cb1564c5.js} +1 -1
  34. package/esm/{nextEpisodeButton-cfd4d127.js → nextEpisodeButton-1662c917.js} +1 -1
  35. package/esm/{playlist-016a2bf3.js → playlist-f4355fad.js} +1 -1
  36. package/esm/plugins/comscore_dist/index.min.d.ts +10 -10
  37. package/esm/{series-ef5669ac.js → series-7b60bec2.js} +1 -1
  38. package/esm/{series-v2-4efe0fc6.js → series-v2-0a86d417.js} +1 -1
  39. package/esm/{series-v2-c94aa96f.js → series-v2-c0be9e78.js} +1 -1
  40. package/esm/{skin-85e50abf.js → skin-0c88b0ea.js} +1 -1
  41. package/esm/{skin-4299ad2c.js → skin-1bc59f9a.js} +1 -1
  42. package/esm/{skin-96414187.js → skin-55eae6d3.js} +1 -1
  43. package/esm/{skin-adeae61e.js → skin-95af97fb.js} +1 -1
  44. package/esm/{skin-5f6c98f5.js → skin-d8e1c7dc.js} +1 -1
  45. package/esm/{skin-80e4f5d5.js → skin-da0c5ace.js} +1 -1
  46. package/esm/{skin-556e3651.js → skin-f5cf4088.js} +1 -1
  47. package/esm/{util-086c3bd1.js → util-2cff93e3.js} +1 -1
  48. package/esm/{videoSelector-59b93075.js → videoSelector-300977a9.js} +1 -1
  49. package/esm/{videoSelector-cf3f6b1a.js → videoSelector-cb712785.js} +1 -1
  50. package/package.json +1 -1
  51. package/cjs/generic-deee5106.js +0 -1
  52. package/cjs/index-dfea481b.js +0 -1
  53. package/esm/generic-bd28bc10.js +0 -1
  54. package/esm/index-1c1a0ec1.js +0 -1
package/esm/bundle.css CHANGED
@@ -1,9 +1,5 @@
1
1
 
2
2
 
3
-
4
-
5
-
6
-
7
3
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
8
4
  height: 0.7em;
9
5
  position: absolute;
@@ -224,6 +220,10 @@
224
220
  }
225
221
 
226
222
 
223
+
224
+
225
+
226
+
227
227
  /* CSS for videojs-dvr-seekbar */
228
228
 
229
229
  .video-js.vjs-dvr-seekbar {
@@ -399,6 +399,8 @@
399
399
 
400
400
 
401
401
 
402
+
403
+
402
404
  .video-js .multicamera-parent.default{
403
405
  height: 345px;
404
406
  position: absolute;
@@ -478,8 +480,6 @@
478
480
  }
479
481
 
480
482
 
481
-
482
-
483
483
  /* nextep */
484
484
  .next-ep-preview{
485
485
  position: absolute;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{A as a,x as s}from"./generic-bd28bc10.js";import{g as c}from"./resolution-1c59b0f3.js";import{p as d}from"./skin-d5091b86.js";import{g as u}from"./localisation-0bf399a1.js";import{g as m}from"./player_instance-34118a5b.js";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=d(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=d(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-v2-9ed4268f.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=m(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-cfd4d127.js").then((function(r){var o=r.default,l=m(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t,n){import("./series-ef5669ac.js").then((function(r){var o=r.seriesModule,l=m(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},c=0;c<a.length;c++)s(c)}))},k=function(e,t){import("./videoSelector-59b93075.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},S=function(e,t){import("./caption-settings-34414f59.js").then((function(n){var r,o,l,a,s=n.default,c=m(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},w=function(e,t){import("./settings-icon-4708c41d.js").then((function(n){var r,o,l,a,s=n.default,c=m(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},I=function(e,t){import("./playlist-016a2bf3.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},E=function(e,t){import("./series-v2-4efe0fc6.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},O=function(e,t){import("./multicamv2-ecf54a7e.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},M=function(e,t){var n=m(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=m(e).el(),n=0,r=m(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o},x=function(e,t){import("./videoSelector-cf3f6b1a.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},L=function(e,t){import("./series-v2-c94aa96f.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},_=function(e,t){import("./multicamv2-694d2012.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},N=function(e,t){import("./start-begin-btn-1e096fec.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("startFromBeginingButton",r);var l=o.getChild("controlBar").addChild("startFromBeginingButton",h({playerId:e},t),o.controlBar.children().findIndex((function(e){return"PlayToggle"===e.name_})));o.startFromBeginningButton=l}))},T=function(e,t){import("./watch-live-btn-5419f3a7.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("watchLiveButton",r);var l=o.getChild("controlBar").addChild("watchLiveButton",h({playerId:e},t),o.controlBar.children().findIndex((function(e){return"PlayToggle"===e.name_}))+1);o.watchLiveButton=l}))};export{B as a,j as b,b as c,y as d,C as e,w as f,S as g,M as h,g as i,x as j,_ as k,I as l,L as m,P as n,k as o,E as p,O as q,N as r,T as s};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{A as a,x as s}from"./generic-b3cb59a6.js";import{g as c}from"./resolution-1c59b0f3.js";import{p as d}from"./skin-d5091b86.js";import{g as u}from"./localisation-0bf399a1.js";import{g as m}from"./player_instance-34118a5b.js";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=d(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=d(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-v2-9ed4268f.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=m(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-1662c917.js").then((function(r){var o=r.default,l=m(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t,n){import("./series-7b60bec2.js").then((function(r){var o=r.seriesModule,l=m(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},c=0;c<a.length;c++)s(c)}))},k=function(e,t){import("./videoSelector-300977a9.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},S=function(e,t){import("./caption-settings-34414f59.js").then((function(n){var r,o,l,a,s=n.default,c=m(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},w=function(e,t){import("./settings-icon-4708c41d.js").then((function(n){var r,o,l,a,s=n.default,c=m(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},I=function(e,t){import("./playlist-f4355fad.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},E=function(e,t){import("./series-v2-0a86d417.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},O=function(e,t){import("./multicamv2-3388f3a6.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},M=function(e,t){var n=m(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=m(e).el(),n=0,r=m(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o},x=function(e,t){import("./videoSelector-cb712785.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},L=function(e,t){import("./series-v2-c0be9e78.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},_=function(e,t){import("./multicamv2-cb1564c5.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},N=function(e,t){import("./start-begin-btn-1e096fec.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("startFromBeginingButton",r);var l=o.getChild("controlBar").addChild("startFromBeginingButton",h({playerId:e},t),o.controlBar.children().findIndex((function(e){return"PlayToggle"===e.name_})));o.startFromBeginningButton=l}))},T=function(e,t){import("./watch-live-btn-5419f3a7.js").then((function(n){var r=n.default,o=m(e);i.registerComponent("watchLiveButton",r);var l=o.getChild("controlBar").addChild("watchLiveButton",h({playerId:e},t),o.controlBar.children().findIndex((function(e){return"PlayToggle"===e.name_}))+1);o.watchLiveButton=l}))};export{B as a,j as b,b as c,y as d,C as e,w as f,S as g,M as h,g as i,x as j,_ as k,I as l,L as m,P as n,k as o,E as p,O as q,N as r,T as s};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"js-cookie";import{a,e as d,g as s,h as u,s as c,i as v,d as m}from"./currentVideoInfo-a8a254c2.js";import{a as f,r as p}from"./captions-f507e8ee.js";import{t as g,c as I}from"./skin-d5091b86.js";import E from"@babel/runtime/helpers/toConsumableArray";import w from"@babel/runtime/helpers/slicedToArray";function h(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function y(e){window.dataLayer=window.dataLayer||[],h("js",new Date),h("config",e)}function _(e,n){h("event",e,n)}var T={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function b(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function S(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?b(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var O={name:"@viewlift/player",version:"2.0.61",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=O.version;var A,C=function(e,n){var t,o,r,l,a,d,s,u;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.overrideEntitlementBaseUrl)+"/video/status":F.get()+"".concat(null==T?void 0:T.getVideoDetails),params:S({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":O.version,"x-player-name":"videojs"},withCredentials:!0})},L=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):i({url:F.get()+T.getLinearChannelDetails,params:S(S(S(S(S({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},R=function(e,n){var t,o,r=H(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):i({url:F.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},P=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,B();case 2:return o=e.sent,e.abrupt("return",i({url:F.get()+"".concat(null==T?void 0:T.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:S({},n),params:S({},(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)}}(),D=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:F.get()+"".concat(null==T?void 0:T.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},k=function(e){var n=e.videoId;return i({method:"GET",url:F.get()+"".concat(null==T?void 0:T.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},F=(A=null==T?void 0:T.apiBaseUrl,{set:function(e){e&&(A=e)},get:function(){return A}}),N=function(e,n,t,o){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},M=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},V=null;function j(){return{set:function(e){e&&(V=e)},get:function(){return V}}}var W=function(){var e=n(t.mark((function e(){var n,o,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=j().get(),o=F.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),U=null,B=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"))||!M(n)){e.next=6;break}return U||(U=W().then((function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&j().set(r),i||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){U=null}))),e.abrupt("return",U);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},H=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function G(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?G(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Y=100,z=function(){var e,n,t,o,i,r,l,d=a();return"linearchannel"===((null==d?void 0:d.contentType)||"video")?null==d||null===(e=d.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==d?void 0:d.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==d||null===(i=d.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==d||null===(l=d.video)||void 0===l?void 0:l.id)||(null==d?void 0:d.id)};function q(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function K(){var e=window.sessionStorage.getItem("uid");return e||(e=q(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=n(t.mark((function e(){var n,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(e){return e?String(e):""}var Z=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function ee(e,o){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=q(),d="production",s="WEBSITE",u=null,c=0,v=null,m=0,f=0,p=!1,g=[],I=r(e);if(I){var E=function(){var e,n,t,o;return Math.round((null==I||null===(e=I.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)},w=Z((function(){for(var e=I.currentTime(),n=I.buffered(),t=0;t<n.length;t++){var o=n.start(t),i=n.end(t);if(e>=o&&e<=i)return Math.round(i-e)}return 0})),h=function(){var e=n(t.mark((function e(n){var o,r,u,c,v,m,f,p,g,I,E;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return g=e.sent,I=H(g),e.t0=Q,e.t1=Q,e.t2=null==I?void 0:I.site,e.t3=null==I?void 0:I.siteId,e.t4=s,e.t5=K(),e.t6=z(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11=d,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?$(n.adPosition):"",e.next=25,X();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=a,e.t23=null!==(r=n.ttFirstFrame)&&void 0!==r?r:null,e.t24=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t25=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t26=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t27=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==l||null===(f=l.beacon)||void 0===f?void 0:f.params,e.t32=(0,e.t0)(e.t30,e.t31),E=[e.t32],i({url:(null==l||null===(p=l.beacon)||void 0===p?void 0:p.url)||F.get()+T.getBeaconUrl,method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:E}).catch((function(e){return console.error(e)}));case 41:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),y=function(e){if(!I.paused()&&I.readyState()>2)return clearInterval(u),clearInterval(v),e;var n,t=e+.1;return+t.toFixed(2)>=5&&f<4&&p?(f++,_("BUFFERING",Q({pfm:s,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime)},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),h({eventName:"BUFFERING",videoPosition:Math.floor(I.currentTime),isAdEvent:!1}),0):t},b=function(){var e=Math.floor(I.currentTime);I.on("error",(function(){var n,t=Math.floor(I.currentTime);clearInterval(u);var o=e===t?"FAILED_TO_START":"DROPPED_STREAM";_(o,Q({pfm:s,uid:K(),vid:z(),videoPosition:t},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),h({eventName:o,videoPosition:t,isAdEvent:!1})}))},S=function(){var e=Z((function(){var e;c=0,v=setInterval((function(){c=y(c)}),Y),_("PLAY",Q({pfm:s,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime)},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),h({eventName:"PLAY",videoPosition:Math.floor(I.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":z(),watchTime:Math.floor(I.currentTime)})}));I.one("play",e)},O=function(){I.one("timeupdate",(function(){var e;clearInterval(v),clearInterval(u),m=c||0,_("FIRST_FRAME",Q({pfm:s,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime),ttFirstFrame:c,bufferHealth:w()},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),h({eventName:"FIRST_FRAME",videoPosition:Math.floor(I.currentTime),isAdEvent:!1,ttFirstFrame:c,bufferHealth:w()}),p=!0,c=0}))},A=function(){var e=!1;I.on("waiting",Z((function(){p&&(e=!0,clearInterval(u),u=setInterval((function(){e&&!I.paused()?m=y(m):clearInterval(u)}),Y))}))),I.on("playing",Z((function(){e=!1,clearInterval(u)})))},C=function(){var e=function(e){var n,t,o,i=Q({videoPosition:Math.floor(I.currentTime),isAdEvent:!0,bufferHealth:w(),pfm:s,uid:K(),vid:z(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==l||null===(o=l.beacon)||void 0===o?void 0:o.params);_(e,Q({},i)),h(Q({eventName:e,adPosition:1},i))};I.on("adstart",(function(){e("AD_REQUEST"),e("AD_IMPRESSION")})),I.on("adskip",(function(){c=0})),I.on("adend",(function(){c=0}))},L=function(){I.on("timeupdate",(function(){var e=Math.floor(I.currentTime());if(e>=30&&e%30==0&&!g.includes(e)){var n,t=null===(n=I.el().getElementsByTagName("video"))||void 0===n?void 0:n[0];f=0,g.push(e),h({eventName:"PING",videoPosition:e,isAdEvent:!1,duration:30,resHeight:(null==t?void 0:t.videoHeight)||null,resWidth:(null==t?void 0:t.videoWidth)||null,bufferHealth:w(),bitrate:E()})}}))};b(),A(),C(),L(),S(),I.on("loadeddata",O)}else console.error("Videojs: Player instance not found.")}function ne(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&ee(e,n,t)}var te=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},oe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},ie=function(e,n){var t=new Map;k({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),u(t)})).catch((function(e){return console.log(e)}))},re=function(){var e=d.get();return e>=0?e+1:1},le=function(){var e,n,t,o=s(),i=a(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=d.get(),u=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===r}));return u>=0?u+1:1};function ae(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function de(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ae(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var se=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ue=function(e){var n=ce(e,"video.tags",[]),t=ce(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},ce=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},ve=function(){var n,t,o,i,a,d,s,u,c,v,m,f,p,g,I,E,w,h,y,_,T,b,S,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",C=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return A;var R=(null==L?void 0:L.siteName)||"",P=(null==L?void 0:L.contentType)||"video",D=(null==L||null===(o=L[P])||void 0===o?void 0:o.metadata)||(null==L||null===(i=L[P])||void 0===i||null===(a=i.gist)||void 0===a?void 0:a.metadata),k=r(C);if(!A.includes("VIEWLIFT_"))return A;var F,N=window.getComputedStyle(document.getElementById(C),null),M=Math.trunc(N.getPropertyValue("height").slice(0,-2)),V=Math.trunc(N.getPropertyValue("width").slice(0,-2)),j="linearchannel"===P?null==L||null===(d=L.linearchannel)||void 0===d||null===(s=d.channels)||void 0===s||null===(u=s.find((function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)})))||void 0===u||null===(c=u.content)||void 0===c?void 0:c.id:ce(L,"video.gist.id",""),W="linearchannel"===P?null==L||null===(v=L.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(f=m.find((function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)})))||void 0===f?void 0:f.title:ce(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,B=null;"function"==typeof window.__gpp&&(null===(F=window)||void 0===F||F.__gpp("ping",(function(e){U=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]})));var x=de(de({},me(D)),{},(b={VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:M,VIEWLIFT_SIZE:se(V,M),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ce(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==k||null===(g=k.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==k||null===(I=k.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==R||"usanetwork"==R?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ue(L),VIEWLIFT_MEDIA_ID:j,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ce(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:j,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ce(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ce(null===(E=window)||void 0===E||null===(w=E.app_data)||void 0===w||null===(h=w.site)||void 0===h?void 0:h.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==R||"usanetwork"==R?"":ce(null===(y=window)||void 0===y||null===(_=y.app_data)||void 0===_||null===(T=_.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:j,VIEWLIFT_CONTENT_TITLE:W,VIEWLIFT_CONTENT_SERIES_TITLE:ce(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ce(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:le(),VIEWLIFT_SEASON_NUMBER:re(),VIEWLIFT_CONTENT_TAGS:ue(L),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(b,"VIEWLIFT_LAT",""),e(b,"VIEWLIFT_APP_BUNDLE",""),e(b,"VIEWLIFT_ATT_CONSENT",""),b),null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var H in x){var G=new RegExp(H,"g");A=A.replace(G,x[H])}return A},me=function(e){var n,t,o,i,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){d.set(e.name,e.value)})));var s=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,u=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return s||u?(oe()?s?a=de(de({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):u&&(a=de(de({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):s?a=de(de({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):u&&(a=de(de({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),s?a=de(de({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):u&&(a=de(de({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=oe()?de(de({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):de(de({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=de(de({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=oe()?de(de({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):de(de({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=de(de({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"VIEWLIFT_NIELSEN_APP_ID",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"VIEWLIFT_CHANNEL",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||"VIEWLIFT_GRACE_NOTE_ID"})},fe=function(e,n){var t,o,i,r,l,a,d,s,u,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[p])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,E=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,w=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(s=d.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(u=e[p])||void 0===u||null===(c=u.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return ge(E);if(g){var y=Ie(I,n);return y.src=ve(y.src,n,e),y}if("Safari"!==te()&&h)return pe(I);if(w){var _=ge(I);return _.src=ve(_.src,n,e),_}if(null!=I&&I.mpeg){var T=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return T.src=ve(T.src,n,e),T}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ge=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ie=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=te();if(r(n),"Safari"===d){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(i);return Ee(n),s}var u,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(Ee(n),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var Ee=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},we=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},he=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},ye=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var _e=!1,Te=function(e,n,t){var o=ve(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima)return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){_e=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),_e&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout((function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()}),1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var s="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,s="touchend"),l.one(s,(function(){u&&l.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),l.one("ads-manager",(function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})),n.addEventListener(google.ima.AdEvent.Type.LOADED,(function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})}))})),l.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o)}};function be(e,n){var t,o,i,l=r(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",(function(t){var o,i,r,s,u,c,v,m,f;if(Oe.enabled&&"input"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||pn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(s=r.appcmsMain)||void 0===s||null===(u=s.adsConfig)||void 0===u?void 0:u.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;g||fn(e,10)}}}),!0)}var Se,Oe=(Se=!0,{enable:function(){Se=!0},disable:function(){Se=!1},get enabled(){return Se}}),Ae="ssai-breakStart",Ce="ssai-adImpression",Le="ssai-firstQuartile",Re="ssai-midpoint",Pe="ssai-thirdQuartile",De="ssai-complete",ke="ssai-breakEnd",Fe={breakStart:Ae,impression:Ce,firstQuartile:Le,midpoint:Re,thirdQuartile:Pe,complete:De,breakEnd:ke};function Ne(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=Fe[o];i&&t.trigger(i,n)}function Me(e){var n=r(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Ae,e)},adImpression:function(e){return t(Ce,e)},adFirstQuartile:function(e){return t(Le,e)},adMidpoint:function(e){return t(Re,e)},adThirdQuartile:function(e){return t(Pe,e)},adComplete:function(e){return t(De,e)},adBreakEnd:function(e){return t(ke,e)}}}function Ve(e){var n,t,o,i,r=e.isLive,l=e.startTimeInSeconds;return r?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==l?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:l===("function"==typeof(null===(t=null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.comscorePlayerInstance)||void 0===t?void 0:t.getDuration)&&(null===(i=null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o?void 0:o.comscorePlayerInstance)||void 0===i?void 0:i.getDuration()))?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function je(){var e,n,t,o,i,r,l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef)&&!window.analytics)return console.log("is StreamingAnalytics started Initialised?",function(){var e;return!!(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef)||(console.warn("[Comscore] Tag not initialized."),!1)}()),void console.warn("[Comscore] Tag not initialized or analytics missing.");var a=window.analytics,d=null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.tagRef;null===(t=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===t||(t.mode="ad"),d.notifyPause();var s=new a.StreamingAnalytics.AdvertisementMetadata;s.setMediaType(Ve({isLive:null===(i=null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o?void 0:o.contentOptions)||void 0===i?void 0:i.isLive,startTimeInSeconds:null==l?void 0:l.startTimeInSeconds})),s.setUniqueId(l.id||"ad-001"),s.setLength(1e3*parseInt(l.durationMs,10)||0),s.setTitle(l.title||"Advertisement"),s.setServerCampaignId(l.campaignId),s.setRelatedContentMetadata(null===(r=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===r?void 0:r.contentMetadata),s.setDeliveryType(a.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),s.setPlacementId(l.placementId);var u={cs_ad_tu:null==l?void 0:l.trackingUrl,ns_st_ami:null==l?void 0:l.creativeId};s.addCustomLabels(u),d.setMetadata(s),d.notifyPlay(),console.log("[Comscore] Ad started:",l)}function We(){var e,n;(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef)&&((null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.tagRef).notifyPause(),console.log("[Comscore] Ad Finished. Resumed content playback."))}function Ue(){var e,n,t,o,i;if(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef){var r=null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.tagRef;r.notifyPause(),r.notifyEnd(),null===(t=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===t||(t.mode="content"),(null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o?void 0:o.contentMetadata)&&(r.setMetadata(null===(i=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===i?void 0:i.contentMetadata),r.notifyPlay()),console.log("[Comscore] Ad ended. Resumed content playback.")}}function Be(e){return{id:null==e?void 0:e.adId,adTitle:null==e?void 0:e.adTitle,adDuration:(null==e?void 0:e.durationInSeconds)||0,startTimeInSeconds:(null==e?void 0:e.startTimeInSeconds)||0,campaignId:null==e?void 0:e.campaignId,placementId:null==e?void 0:e.placementId,trackingUrl:null==e?void 0:e.trackingUrl}}function xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function He(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):xe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Ge(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Qe(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Qe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Qe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}window.__COMSCORE__||(window.__COMSCORE__={tagRef:null,contentMetadata:null,playerInstance:null,mode:"content",cleanupFns:[],contentOptions:null}),o.registerPlugin("comscore",(function(e){console.log(this),console.log("hello form comscore plugin",e);var n=e||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;new Promise((function(t,o){var i=document.createElement("script");i.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",i.async=!0,document.head.appendChild(i),i.onload=function(){!function(e){var n=e.publisherId,t=e.persistentLabels;if(!window.ns_||!window.ns_.analytics)throw new Error("Comscore library not loaded or analytics reference missing");var o=window.ns_.analytics;o.PlatformApi.setPlatformAPI(o.PlatformApi.PlatformApis.WebBrowser);var i=new o.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==t?void 0:t.userConsent)||"",cs_fpid:(null==t?void 0:t.userId)||""}});o.configuration.addClient(i),o.configuration.enableFirstPartyCookie(),o.configuration.enableImplementationValidationMode(),o.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=o}({publisherId:e||"40813950"})},i.onerror=function(e){o("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}));var Ye,ze=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),qe=(Ye=null,{set:function(e){Ye=e},get position(){return Ye}});function Ke(e,n){return Xe.apply(this,arguments)}function Xe(){return(Xe=n(t.mark((function e(n,o){var i,l,a,d,s,u,c,v,m,f,p,g,I,E,h,y,_,T;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=fe(o,n),d=a.src,s=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[s])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,u=d.replace("/dash/","/session/").replace("/master/","/session/"),u=ve(u,n,o),c=$e(u),v=w(c,2),m=v[0],f=v[1],p=Je(f)||{},u=new URL(u.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach((function(e){var n=w(e,2),t=n[0],o=n[1];u.searchParams.set(t,o)})),e.prev=11,e.next=14,fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(He({adsParams:He({},m)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return I=e.sent,E="https://"+new URL(u).hostname,h=I.trackingUrl,y=I.manifestUrl,_=E+h,T=E+y,ze.set(_),console.log("%c TRACKING URL","background: #bdf369; color: #000",_),a.src=T,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}}),e,null,[[11,29]])})))).apply(this,arguments)}function Je(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(e){var n=w(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]})))||{}}function $e(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=Ge((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=w(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},s={},u=0,c=Object.entries(n);u<c.length;u++){var v=w(c[u],2),m=v[0],f=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=f;else s[m]=f}return[d,s]}var Ze,en=(Ze=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),Ze=Array.isArray(e)?E(e):Ze},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",Ze),E(Ze)}}),nn=new Map;function tn(e,n){return on.apply(this,arguments)}function on(){return on=n(t.mark((function e(o,i){var l,a,d,s,u,c,v,m,f,p,I,w,h,y,_,T,b,S,O,A,C,L;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:L=function(e,n,t,i,l,a){var d=r(o);if(!d.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(d.currentTime());var s,u=Ge(t);try{var c=function(){var t,r,u,c=s.value,v=c.eventType,m=c.beaconUrls,f=c.startTimeInSeconds,p=c.startTime,g=c.durationInSeconds,I=f||0,E=m,w=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(u=r.ads)||void 0===u?void 0:u.adEventHandler)||null,h="".concat(I,"_").concat(v),y=nn.get("pod-".concat(l))||[];if(console.warn(e,I,"map:",v,"condition1:",e>=I,"map:",nn),e>=I&&!y.includes(h)){y.push(h),nn.set("pod-".concat(l),y);try{C(v,n,E,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var _=qe.position;qe.set(null),setTimeout((function(){null!=_&&(d.currentTime(_),a())}),500)}if("function"==typeof w)try{var T,b={eventType:v,startTimeInSeconds:f,startTime:p,durationInSeconds:g,ad:null==n||null===(T=n.ads)||void 0===T?void 0:T[i],adIndex:i};w({adsData:b}),Ne(o,b)}catch(e){console.error("Error when calling ads callback:",e)}if("impression"===v){var S,O=ze.get();je(Be(He(He({},null==n||null===(S=n.ads)||void 0===S?void 0:S[i]),{},{trackingUrl:O})))}else"complete"===v?We():"breakEnd"===v&&Ue()}};for(u.s();!(s=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},C=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},nn.clear(),qe.set(i),f=ze.get(),(p=r(o)).one("loadeddata",(function(){f&&O(f)})),I=new Map,w=new Map,h=-1,y=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,_=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,T=(null==p||null===(s=p.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,b=(null==p||null===(u=p.el())||void 0===u||null===(c=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,O=function(){var e=n(t.mark((function e(n){var l,a,d,s,u,c,v,m,f,p,O,C,R,P,D,k,F,N,M,V;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=function(e){document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",k),0===e.button&&R()},D=function(e){},P=function(){var e,n=p.currentTime(),t=null,o=Ge(f);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,I.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){p.currentTime(t+2.2)}),100))},R=function(){var e,n=p.currentTime(),t=null,o=Ge(f);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!I.has(r)||n>=r&&n<=d)&&(t=r,I.set(r,!0),w.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){p.currentTime(t+.4)}),100))},u=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),m=v.avails,f=[],p=r(o),O=p.controlBar.progressControl,C=O.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),m.map((function(e,n){var t,o,i;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(u=!0),f.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(i=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===i?void 0:i[0])||[]})})),!u&&i&&(p.currentTime(i),P()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f),console.log(f,"data"),f.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",C.appendChild(r)}})),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=g((function(){var e=p.currentTime();if(e!==h){h=e;for(var n=!1,t=function(){var t=f[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-1.2&&e<=a+1.2){e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&I.set(i,!0),Oe.disable(),y&&y.classList.add("vjs-hidden"),b&&(b.style.pointerEvents="none",b.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var d=e-i,s=0,u=0,c=0;c<l.length;c++){var v,m=null==l||null===(v=l[c])||void 0===v?void 0:v.durationInSeconds;if(d<s+m){u=c;break}s+=m}l[u];var p=Math.max(0,r-d),g=Math.round(p);F.style.display="block",V.textContent="".concat(u+1," of ").concat(l.length," • ").concat(A(g));var h=[];return null==l||l.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));h.push.apply(h,E(n))})),Array.isArray(l)&&0==(null==l?void 0:l.length)&&h.push(null==t?void 0:t.podSlotImpressionBeacon),L(e,t,h,u,o,P),"break"}w.delete(i)},o=0;o<f.length;o++){if("break"===t())break}n||(F.style.display="none",O.el().classList.remove("hide-progress-bar"),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),y&&y.classList.remove("vjs-hidden"),b&&(b.style.pointerEvents="auto",b.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Oe.enable())}}),1e3),p.on("timeupdate",p._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",(function(e){Oe.enabled&&"ArrowRight"==e.key&&(R(),fn(o,10),e.stopPropagation())})),O.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",D),document.addEventListener("pointerup",k))})),null===(d=document)||void 0===d||null===(s=d.querySelectorAll(".ssai-ad-container"))||void 0===s||s.forEach((function(e){return null==e?void 0:e.remove()})),(F=document.createElement("div")).className="ssai-ad-container",(N=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",N.append(M),(V=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",F.append(N),F.append(V),p.el().appendChild(F);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}}),e)}))),on.apply(this,arguments)}function rn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ln(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ln(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function ln(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var an={},dn=null;function sn(e){return un.apply(this,arguments)}function un(){return un=n(t.mark((function e(o){var i,l,a,d,s,u,c,v,m,f,p,I,w,h,y,_,T,b,S,O,A,C,L,R,P,D,k;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,i,l){var a=r(o);if(!a.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(a.currentTime());var d,s=rn(t);try{for(s.s();!(d=s.n()).done;){var u,c,v,m=d.value,f=m.eventType,p=m.beaconUrls,g=m.startTimeInSeconds,I=m.startTime,E=m.durationInSeconds,w=g||0,h=p,y=(null===(u=window)||void 0===u||null===(c=u.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,_="".concat(w,"_").concat(f),T=R.get("pod-".concat(l))||[];if(console.warn(e,w,"map:",f,"condition1:",e>=w,"map:",R),e>=w&&e<=w+P&&!T.includes(_)){T.push(_),R.set("pod-".concat(l),T);try{D(f,n,h,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,f,n)}if("function"==typeof y)try{var b,S={eventType:f,startTimeInSeconds:g,startTime:I,durationInSeconds:E,ad:null==n||null===(b=n.ads)||void 0===b?void 0:b[i],adIndex:i};y({adsData:S}),Ne(o,S)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){s.e(e)}finally{s.f()}}},D=function(e,n,t,o){var i,r;"breakEnd"!==e||(null===(i=an)||void 0===i?void 0:i.currentAdIndex)+1==(null===(r=an)||void 0===r?void 0:r.totalAds)?(console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))):console.log("SKIPPED FROM FIRING")},p=function(){dn&&clearInterval(dn)},m=ze.get(),(f=r(o)).one("loadeddata",(function(){p(),dn=setInterval((function(){m&&!f.paused()&&L(m)}),2e3)})),f.on("dispose",(function(){p()})),I=new Map,w=new Map,h=-1,y=null,_=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,T=(null==f||null===(a=f.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,b=(null==f||null===(d=f.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==f||null===(s=f.el())||void 0===s||null===(u=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===u?void 0:u[0])||null,O=(null==f||null===(c=f.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==e?void 0:e.length))return E(n);for(var t,o,i,r,l=[],a=(i=(null===(t=e[0])||void 0===t?void 0:t.trackingEvents)||[],r=(null===(o=e[e.length-1])||void 0===o?void 0:o.trackingEvents)||[],0===e.length?[]:1===e.length?i:[].concat(E(i),E(r))),d=null==a?void 0:a.filter((function(e){return["breakStart","breakEnd"].includes(null==e?void 0:e.eventType)})),s=function(){var e,t,o=null===(e=n[u])||void 0===e||null===(t=e.beaconUrls)||void 0===t?void 0:t[0],i=(null==d?void 0:d.filter((function(e){var n;return(null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n[0])==o})))||null;i?console.log("EVENT ALREADY PRESENT",i,n[u]):l.push(n[u])},u=0;u<(null==n?void 0:n.length);u++)s();return l},L=function(){var e=n(t.mark((function e(n){var i,l,a,d,s,u,c,v,m,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),y&&l.searchParams.append("nextToken",y),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:d=e.sent,s=d.avails,u=d.nextToken||null,y=u,c=[],v=r(o),m=v.controlBar.progressControl,f=m.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),s.map((function(e,n){c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:C(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})})),console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c),c.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",f.appendChild(r)}})),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=g((function(){var e=v.currentTime();if(e!==h){h=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&I.set(o,!0),Oe.disable(),_&&_.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),m.el().classList.add("hide-progress-bar");for(var d=e-o,s=0,u=0,v=0;v<r.length;v++){var f,p=null==r||null===(f=r[v])||void 0===f?void 0:f.durationInSeconds;if(d<s+p){u=v;break}s+=p}setTimeout((function(){an.totalAds=null==r?void 0:r.length,an.currentAdIndex=u}),1e3);var g=[];return null==r||r.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));g.push.apply(g,E(n))})),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&g.push(null==n?void 0:n.podSlotImpressionBeacon),k(e,n,g,u,t),"break"}w.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(an={},m.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&_.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Oe.enable())}}),1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),R=new Map,P=2.5;case 22:case"end":return e.stop()}}),e)}))),un.apply(this,arguments)}function cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var vn=function(e){o(e).play()},mn=function(e){o(e).pause()},fn=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},pn=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},gn=function(e){return!!o.getPlayer("".concat(e))},In=function(e){return o(e).paused()},En=function(){var e=n(t.mark((function e(o,i){var l,a,d,s=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=s.length>2&&void 0!==s[2]&&s[2],e.next=3,B();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise((function(e,r){var s=(null==i?void 0:i.programs)||[];null==i||delete i.programs,L(i,a).then(function(){var r=n(t.mark((function n(r){var a,u,v,f,p,g,I,E;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(g=null==r?void 0:r.data,window.sid=q(),g.contentType="linearchannel",g.channelId=null==i?void 0:i.channelId,I=(null==g||null===(a=g.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(v=u.app_data)||void 0===v||null===(f=v.appcmsMain)||void 0===f||null===(p=f.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,E=fe(g,o),!I){n.next=11;break}return n.next=9,Ke(o,g);case 9:E=n.sent,l=!0;case 11:c(g),m(s),sessionStorage.setItem("program_switched",!0),E&&l?(Tn(o,E),I&&sn(o),d.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:g})}))):e({status:!0,msg:"Feed authenticated",response:g});case 15:case"end":return n.stop()}}),n)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){r({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),wn=function(){var e=n(t.mark((function e(o,i,l){var a,d,u,m,g,I,E;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return m=e.sent,(s()||null)&&v(i),g=0,I=0,E=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(u=d.watchHistory)&&void 0!==u&&u.enable&&D(i,m).then((function(e){var n,t,o,i,r,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),g=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(I=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(E=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})),e.abrupt("return",new Promise((function(e,l){C(i,m).then(function(){var i=n(t.mark((function n(i){var a,d,s,u,v,m,w,h,y,_,T,b,S,O,A,C,L,R,P,D,k,F,N,M,V,j,W,U,B,x,H,G,Q,Y,z,q,K,X;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(C=null==i?void 0:i.data,L=(null==C?void 0:C.contentType)||"video",R=(null==C||null===(a=C[L])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(s=d.app_data)||void 0===s||null===(u=s.appcmsMain)||void 0===u||null===(v=u.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,P=(null==C||null===(m=C.video)||void 0===m||null===(w=m.streamingInfo)||void 0===w?void 0:w.isLiveStream)||!1,c(i.data),(D=(null==C||null===(h=C.ads)||void 0===h||null===(y=h.preRoll)||void 0===y||null===(_=y.adTags)||void 0===_||null===(T=_.web)||void 0===T?void 0:T.active)&&(null==C||null===(b=C.ads)||void 0===b||null===(S=b.preRoll)||void 0===S||null===(O=S.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Te(o,D,C),k=fe(C,o),!R){n.next=12;break}return n.next=11,Ke(o,C);case 11:k=n.sent;case 12:k?(G=(null==C||null===(F=C.video)||void 0===F||null===(N=F.gist)||void 0===N?void 0:N.videoImageUrl)||(null==C||null===(M=C.video)||void 0===M||null===(V=M.gist)||void 0===V||null===(j=V.imageGist)||void 0===j?void 0:j.r16x9),(Q=r(o)).poster(G),Tn(o,k),R&&tn(o,E),Q.on("loadstart",(function(){P&&e({status:!0,msg:"Video Loaded",response:C})})),Q.on("loadeddata",(function(){ye(),e({status:!0,msg:"Video Loaded",response:C})})),Q.one("play",(function(){g&&!R&&I<95&&setTimeout((function(){Q.currentTime(g)}),0)})),Q.one("error",(function(){var e;l({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==C||null===(W=C.video)||void 0===W||null===(U=W.contentDetails)||void 0===U||null===(B=U.closedCaptions)||void 0===B?void 0:B.length)>0||(null==C||null===(x=C.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==C||null===(z=C.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==C||null===(K=C.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter((function(e){return"VTT"===e.format})),f(o,Y)):p(o)):(he(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){bn(e,o,l,i)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),hn=function(e,n,t){var o=r(e);return o.src(n),new Promise((function(e,n){var i=0;o.one("loadedmetadata",(function(){clearTimeout(i),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){i=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},yn=function(e){var n=r(e);if(_n(),function(){var e,n,t,o,i,r,l,a,d,s;if(null===(n=null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.comscoreCleanupFns)||void 0===n||n.forEach((function(e){return e()})),null===(t=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===t||(t.comscoreCleanupFns=[]),console.log("comscoreTag",null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o?void 0:o.tagRef),null===(i=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===i?void 0:i.tagRef){try{null===(r=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===r||r.tagRef.notifyEnd()}catch(e){}null===(l=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===l||(l.tagRef=null),null===(a=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===a||(a.comscorePlayerInstance=null),null===(d=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===d||(d.contentMetadata=null),null===(s=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===s||(s.mode="content"),console.log("[Comscore] Streaming Tag destroyed.")}}(),I(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},_n=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Tn=function(e,n){var t=r(e);t&&t.src(n)},bn=function(n,t,o,i){var r,l,a,d,s,u,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);gn(t)&&he(t,(null===(s=window)||void 0===s?void 0:s.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):cn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Sn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{pn as A,gn as B,wn as C,En as D,yn as E,N as F,en as G,Me as H,F as I,x as J,j as K,M as L,y as M,nn as N,be as O,oe as P,In as Q,sn as R,tn as S,k as T,le as a,re as b,fe as c,te as d,ye as e,Sn as f,K as g,he as h,ne as i,Te as j,we as k,Tn as l,Ke as m,H as n,C as o,D as p,bn as q,B as r,P as s,L as t,R as u,ie as v,hn as w,fn as x,vn as y,mn as z};
@@ -0,0 +1 @@
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import o from"@babel/runtime/regenerator";import"axios";import{d as i,g as t,a as l,b as r,s as a,c as d,l as s,e as u,h as c,f as v,i as p,j as f,k as m,m as w,n as g,o as y,p as b,q as h,r as O,t as _,u as C,v as I,w as S,x as k,y as E,z as T,A as P,B as j,C as D,D as R,E as A,F as M,G as N,H as x,I as L,J as V,K as B,L as F,M as U}from"./generic-b3cb59a6.js";import{g as H}from"./player_instance-34118a5b.js";import z from"video.js";import{o as G,g as W,a as q,s as K,b as J,p as Y,c as X}from"./util-2cff93e3.js";import{g as Q,d as $,a as Z,e as ee}from"./captions-f507e8ee.js";import{g as ne,p as oe}from"./resolution-1c59b0f3.js";import{i as ie,a as te}from"./skin-d5091b86.js";import{s as le}from"./localisation-0bf399a1.js";import{g as re,a as ae,s as de,v as se,b as ue,c as ce,d as ve,e as pe,f as fe}from"./currentVideoInfo-a8a254c2.js";import me from"@babel/runtime/helpers/typeof";import{s as we,w as ge}from"./icons-37daa6b3.js";import{c as ye,p as be,a as he,h as Oe,r as _e,g as Ce,b as Ie,d as Se,s as ke,e as Ee,f as Te}from"./helper-349e076f.js";import Pe from"@babel/runtime/helpers/toConsumableArray";var je=function(e){return new Promise((function(n,o){if(De(e))o("".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){o("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},De=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Re=function(e,n,o){var i=H(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var t=parseFloat(n)/100;i.volume(t),o&&o({status:!0,msg:"Volume set to ".concat(n,"%")})}else o&&o({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else o({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ae=function(e){var n=H(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Me=function(){var e=n(o.mark((function e(n){var t,l,r,a,d;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=H(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,je("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(z),(d=z.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.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"==i()?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,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),Ne=function(e,n){var o=H(e);o&&n&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(n){var o,i,t,l,r,a=this.el(),d=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(o=window)||void 0===o||null===(i=o.cast)||void 0===i||null===(t=i.framework)||void 0===t||null===(l=t.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(s),s&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*d,c.seek()}}))};var xe=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),je("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)}}(),Le=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve().then((function(){return Un}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=n(o.mark((function e(){var n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(z),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)}}(),Fe=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-08c7635e.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),He=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){je("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},loadAdsLibrary:xe,loadEMELibrary:Ve,loadMuxPlugin:Be,loadDvrSeekbar:Fe,loadContribDash:Ue,loadComscorePlugin:Le});function ze(e){return Ge.apply(this,arguments)}function Ge(){return(Ge=n(o.mark((function e(n){var t;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,xe();case 3:t&&"Safari"==i()&&Promise.resolve().then((function(){return He})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(e){return qe.apply(this,arguments)}function qe(){return(qe=n(o.mark((function e(n){var i,t,l,r,a,d;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=H(n.playerId),e.next=3,Le();case 3:d.comscore({publisherId:null==n||null===(i=n.comscore)||void 0===i?void 0:i.publishedId,endpoint:null==n||null===(t=n.comscore)||void 0===t?void 0:t.endpoint,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ke(e,n){return Je.apply(this,arguments)}function Je(){return(Je=n(o.mark((function e(n,t){var l,r,a,d,s,u,c,v,p,f,m,w;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==t?void 0:t.contentType)||"video",p=null==t||null===(l=t[v])||void 0===l?void 0:l.drmEnabled,null==t||null===(r=t[v])||void 0===r||null===(a=r.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==t||null===(d=t[v])||void 0===d||null===(s=d.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,e.prev=6,We(n),e.next=10,Promise.allSettled([p?"Safari"==i()?Ve():"caliente"!=(null===(w=window)||void 0===w?void 0:w.siteName)?Ue():Ve():"Safari"!=i()&&f?Ue():null,m?Me(n):null,Me(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("Error",e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function Ye(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function Xe(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?Ye(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ye(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var Qe=new Set,$e=null,Ze=function(e,n,o){var i,l,r,a,d,s,u,c={},v=(null==e?void 0:e.contentType)||"video";c["c3.cm.id"]=(null===(i=e[v])||void 0===i?void 0:i.id)||"Null",c["c3.cm.contentType"]=an(e),c[null==o||null===(l=o.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==e||!e.linearchannel),c[null==o||null===(r=o.Constants)||void 0===r?void 0:r.STREAM_URL]=n.currentSrc(),c[null==o||null===(a=o.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===t()?"NULL":t(),c["c3.cm.categoryType"]=tn(e),c["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"}}(),c.DRMEnabled=(null===(d=e[v])||void 0===d?void 0:d.drmEnabled)||"None",c.DAIStream=null!==(s=e[v])&&void 0!==s&&null!==(u=s.gist)&&void 0!==u&&u.isSSAIEnabled?"YES":"NO",c[o.Constants.DEFAULT_RESOURCE]="AKAMAI",c["c3.cm.brand"]="NULL",c.CDVREnabled=ln(e),c["c3.cm.genreList"]=nn(e),c["c3.cm.genre"]=en(e),c["c3.cm.channel"]=on(e);var p=un(re(),e);return c=Xe(Xe({},c),p)},en=function(e){var n,o,i,t=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[t])||void 0===n||null===(o=n.gist)||void 0===o||null===(i=o.primaryCategory)||void 0===i?void 0:i.title)||"Null"},nn=function(e){var n,o=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[o])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},on=function(e){var n,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null==e||null===(n=e[i])||void 0===n||null===(o=n.channels[0])||void 0===o?void 0:o.title)||"NULL"},tn=function(e){return(null==e?void 0:e.contentType)||"null"},ln=function(e){var n,o,i=(null==e?void 0:e.contentType)||"video",t=(null==e||null===(n=e[i])||void 0===n||null===(o=n.liveDetails)||void 0===o?void 0:o.isDvrEnabled)||!1;return t?"YES":"NO"},rn=function(e,n){var o,i,t=(n||{}).epg;if(t&&null!=t&&t.enable&&null!=t&&t.programTitle)return t.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(o=e[l])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.title)||"Null";return"".concat(r)},an=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var dn,sn,un=function(e,n){var o,i,t,a,d,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var u=r(),c=l();return s["c3.cm.seriesName"]=(null==n||null===(o=n.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(t=e[u-1])||void 0===t||null===(a=t.episodes)||void 0===a||null===(d=a[c-1])||void 0===d?void 0:d.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},cn=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},vn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},pn=function(){var e=n(o.mark((function e(n,i){var t,l,r,a,d,s,u,c,v,p;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(null==i?void 0:i.convivaConfig)||{},l=t.trackConvivaPlayerEvent,r=t.paymentHandler,a=t.tveProvider,d=t.enable,s=t.appName,u=(i||{}).token,d){e.next=4;break}return e.abrupt("return");case 4:if(c=H(n),"function"==typeof(v=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready((function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var o=e.target;if(o&&o.keySystem){var i=cn(o.keySystem);v("contentInfo",{DRMEnabled:i})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),c.on("loadstart",(function(){var e,n;$e&&$e!==c.currentSrc()&&v("playbackEnded"),v("setPlayer",c),Qe.clear(),$e=c.currentSrc();var o=vn(c.currentType()),t=ae(),l=Ze(t,c,p);l[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",l[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=rn(t,i),l.authToken=u||"NULL",l.streamType=o,l.D2CType=r||"NONE",l.subscriberType=a||(r?"D2C":"FREE"),l["c3.cm.affiliate"]=a||"NULL",fn.setData(l),v("contentInfo",l)})),c.on("loadedmetadata",(function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),c.on("play",(function(){Qe.has(c.currentSrc())||(Qe.add(c.currentSrc()),v("playbackStarted",null))})),c.on("ended",(function(){Qe.has(c.currentSrc())&&Qe.delete(c.currentSrc()),v("playbackEnded")})),c.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})})),c.on("dispose",(function(){null==Qe||Qe.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,o){return e.apply(this,arguments)}}(),fn=(dn={},{setData:function(e){dn=Xe(Xe({},dn),e)},getData:function(){return dn}}),mn=function(e,n){var o=null==n?void 0:n.skin;"default"==o?import("./skin-1bc59f9a.js").then((function(o){o.initialiseSkin(e,n)})):"carousel"==o?import("./skin-0c88b0ea.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==o?import("./skin-f5cf4088.js").then((function(o){o.initialiseSkin(e,n)})):"multiplayer"==o?import("./skin-d8e1c7dc.js").then((function(o){o.initialiseSkin(e,n)})):"minimalist"==o?import("./skin-95af97fb.js").then((function(o){o.initaliseSkin(e,n)})):"VL_ONE"==o?import("./skin-55eae6d3.js").then((function(o){o.initialiseSkin(e,n)})):"news"==o&&import("./skin-da0c5ace.js").then((function(o){o.initialiseSkin(e,n)}))};function wn(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function gn(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?wn(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):wn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var yn=[],bn=0,hn=null;function On(){console.log("Cleaning up watch history data"),sn=null,yn=[],bn=0,hn=null}function _n(e,n,o){var i,t,l,r,d,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(i=n.watchHistory)||void 0===i||i.apiVersion;var u=null==n||null===(t=n.watchHistory)||void 0===t?void 0:t.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(r=n.video)||void 0===r?void 0:r.originalObjectId)||null,f=(null==n||null===(d=n.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,m=Math.floor(e.currentTime()),w=s?100:Math.floor(c/v*100),g={};f?In(g={completed:s,watchedTime:m,watchedPercentage:w},u,n.siteOwner):(g=gn(gn({videoId:sn,watchedTime:m,watchedPercentage:w,doneWatching:s,profileId:u},hn&&{seriesId:hn}),p&&{originalObjectId:p}),a(g).then((function(e){})).catch((function(e){}))),bn=c+o}function Cn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function In(n,o,i){var t=o?"watchhistory-data-".concat(o):"watchhistory-data-guest-".concat(i),l=Cn(t),r=(new Date).getTime(),a=ae(),d=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,o){return gn(gn({},n),{},e({},o,d[o]))}),{}),u=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===sn}));u<0?l.push(gn(gn({content:s},n),{},{addedDate:r,updateDate:r})):l[u]=gn(gn(gn({},l[u]),n),{},{updateDate:r}),localStorage.setItem("".concat(t),JSON.stringify(l))}function Sn(e,n,o){var i=Cn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(o)),t=[];return i&&Array.isArray(i)&&(t=i.filter((function(e){var o;return(null==e||null===(o=e.content)||void 0===o?void 0:o.id)===n}))),t}var kn=!1,En=function(e,n){var o,i,t=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(o=e[t])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!kn){var l=Tn(e,"videoAssets","secondaryVideoAssets"),r=d(l,n);return r&&s(n,r),kn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Tn(e,n,o){if(Array.isArray(e))return e.map((function(e){return Tn(e,n,o)}));if(null!==e&&"object"===me(e)){var i={};return Object.keys(e).forEach((function(t){t===n&&void 0!==e[o]?i[t]=e[o]:t===o&&void 0!==e[n]?i[t]=e[n]:i[t]=Tn(e[t],n,o)})),i}return e}function Pn(e){var n=e.publisherId,o=e.persistentLabels;if(!window.ns_||!window.ns_.analytics)throw new Error("Comscore library not loaded or analytics reference missing");var i=window.ns_.analytics;i.PlatformApi.setPlatformAPI(i.PlatformApi.PlatformApis.WebBrowser);var t=new i.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==o?void 0:o.userConsent)||"",cs_fpid:(null==o?void 0:o.userId)||""}});return i.configuration.addClient(t),i.configuration.enableFirstPartyCookie(),i.configuration.enableImplementationValidationMode(),i.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=i,i}function jn(){var e,n,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.analytics){var t=window.analytics,l=new t.StreamingAnalytics;null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e||(e.tagRef=l),null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n||(n.contentOptions=i),i.implementationId&&l.setImplementationId(i.implementationId),i.projectId&&l.setProjectId(i.projectId),l.setMediaPlayerName(i.playerName||"Video.js"),l.setMediaPlayerVersion(i.playerVersion||"8.x"),l.createPlaybackSession(),i.isDvr&&l.setDVRWindowLength((null==i?void 0:i.dvrWindowLength)||0);var r=new t.StreamingAnalytics.ContentMetadata;return r.setMediaType(t.StreamingAnalytics.ContentMetadata.ContentType[i.contentType||"LONG_FORM_ON_DEMAND"]),r.setUniqueId(i.uniqueId),r.setLength((null==i?void 0:i.isLive)?0:i.duration||0),r.setStationTitle(i.stationTitle),r.setPublisherName(i.publisherName),r.setProgramTitle(i.programTitle),r.setDateOfDigitalAiring(i.digitalAirdate.year,i.digitalAirdate.month,i.digitalAirdate.day),r.setDateOfTvAiring(i.tvAiring.year,i.tvAiring.month,i.tvAiring.day),r.carryTvAdvertisementLoad(i.isDaiAds?"1":null),r.setEpisodeTitle(null==i?void 0:i.contentTitle),r.setEpisodeSeasonNumber(i.seasonNumber),r.setEpisodeNumber(i.episodeNumber),r.setProgramId(i.programId),r.setEpisodeId(i.episodeId),r.setGenreName(i.contentGenre),r.setDictionaryClassificationC3(i.brand||"null"),r.setDictionaryClassificationC4(i.platform||"null"),r.setDictionaryClassificationC6(i.genre||"null"),r.classifyAsCompleteEpisode(i.completeEpisode?"1":null),l.setMetadata(r),null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o||(o.contentMetadata=r),l.notifyPlay(),console.log("[Comscore] StreamingAnalytics initialized for:",i.programTitle),l}console.error("[Comscore] analytics SDK not found.")}window.__COMSCORE__||(window.__COMSCORE__={tagRef:null,contentMetadata:null,playerInstance:null,mode:"content",cleanupFns:[],contentOptions:null});var Dn=!1;function Rn(e){var n,o,i,t;if(e)if(null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.tagRef){var l=null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o?void 0:o.tagRef;null===(i=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===i||(i.comscorePlayerInstance=e);var r=function(){var e;return"content"===(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.mode)&&(null==l?void 0:l.notifyPlay())},a=function(){var e;return"content"===(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.mode)&&(null==l?void 0:l.notifyPause())},d=function(){var e;return"content"===(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.mode)&&(null==l?void 0:l.notifyEnd())},s=function(){return null==l?void 0:l.notifySeekStart()},u=function(){null==l||l.notifyBufferStart(),function(){var e,n;Dn||(Dn=!0,null===(n=null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.comscorePlayerInstance)||void 0===n||n.any(["playing","timeupdate"],(function(){var e,n,o,i,t,l;Dn=!1,(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef)&&"content"===(null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.mode)&&(null===(i=null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o?void 0:o.tagRef)||void 0===i||i.notifyBufferStop(),null===(l=null===(t=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===t?void 0:t.tagRef)||void 0===l||l.notifyPlay())})))}()};e.on("play",r),e.on("pause",a),e.on("ended",d),e.on("seeking",s),e.on("waiting",u),e.on("timeupdate",(function(){var n,o;if(null===(o=null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.contentOptions)||void 0===o?void 0:o.isLive)return l.startFromPosition(0);l.startFromPosition&&"function"==typeof e.currentTime&&l.startFromPosition(1e3*e.currentTime())})),null===(t=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===t||t.comscoreCleanupFns.push((function(){e.off("play",r),e.off("pause",a),e.off("ended",d),e.off("seeking",s),e.off("waiting",u)})),console.log("[Comscore] Player events attached.")}else console.warn("[Comscore] Tag not initialized. Call initializeComscoreTag() first.");else console.warn("[Comscore] No player instance provided.")}function An(){var e;return!!(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef)||(console.warn("[Comscore] Tag not initialized."),!1)}function Mn(e){var n,o,i,t,l=e.isLive,r=e.startTimeInSeconds;return l?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==r?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:r===("function"==typeof(null===(o=null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.comscorePlayerInstance)||void 0===o?void 0:o.getDuration)&&(null===(t=null===(i=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===i?void 0:i.comscorePlayerInstance)||void 0===t?void 0:t.getDuration()))?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function Nn(){var e,n,o,i,t,l,r,a,d,s;if(null===(n=null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.comscoreCleanupFns)||void 0===n||n.forEach((function(e){return e()})),null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o||(o.comscoreCleanupFns=[]),console.log("comscoreTag",null===(i=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===i?void 0:i.tagRef),null===(t=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===t?void 0:t.tagRef){try{null===(l=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===l||l.tagRef.notifyEnd()}catch(e){}null===(r=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===r||(r.tagRef=null),null===(a=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===a||(a.comscorePlayerInstance=null),null===(d=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===d||(d.contentMetadata=null),null===(s=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===s||(s.mode="content"),console.log("[Comscore] Streaming Tag destroyed.")}}function xn(e){var n,o,i,t,l,r,a,d,s={ContentType:(null==e?void 0:e.contentType)||"LONG_FORM_ON_DEMAND",uniqueId:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id,duration:(null==e?void 0:e.runtime)||0,stationTitle:null==e?void 0:e.siteName,publisherName:null==e?void 0:e.network,programTitle:(null==e?void 0:e.programTitle)||Ln(e),programId:(null==e?void 0:e.programId)||Vn(e),episodeId:(null==e?void 0:e.episodeId)||(null===(o=null==e?void 0:e.gist)||void 0===o?void 0:o.id),contentTitle:null===(i=null==e?void 0:e.gist)||void 0===i?void 0:i.title,isLive:null===(t=null==e?void 0:e.streamingInfo)||void 0===t?void 0:t.isLiveStream,brand:null==e?void 0:e.network,seasonNumber:(null==e?void 0:e.seasonNumber)||Fn(null==e?void 0:e.episodeDisplayAttribute).season,episodeNumber:(null==e?void 0:e.episodeNumber)||Fn(null==e?void 0:e.episodeDisplayAttribute).episode,platform:(null==e?void 0:e.platform)||"browser",genre:(null==e?void 0:e.genre)||"null",completeEpisode:(null==e?void 0:e.isCompleteEpisode)||!0,digitalAirdate:Bn(null==e?void 0:e.publishDate),tvAiring:Bn(null==e?void 0:e.publishDate),contentGenre:null==e?void 0:e.genre,isDaiAds:!!(null==e?void 0:e.isDaiAds),isDvr:(null===(l=null==e?void 0:e.streamInfo)||void 0===l?void 0:l.isDvr)||!1,dvrWindowLength:(null===(r=null==e?void 0:e.streamInfo)||void 0===r?void 0:r.isDvr)&&(null===(a=null==e?void 0:e.streamInfo)||void 0===a?void 0:a.dvrWindowLength)||0,implementationId:null===(d=null==e?void 0:e.comscoreConfig)||void 0===d?void 0:d.implementationId};return"LINEARCHANNEL"===(null==e?void 0:e.contentType)&&(s.ContentType="LIVE"),s}function Ln(e){var n,o;return(null==e?void 0:e.series)?null===(o=null==e?void 0:e.series)||void 0===o?void 0:o.title:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.title}function Vn(e){var n,o;return(null==e?void 0:e.series)?null===(o=null==e?void 0:e.series)||void 0===o?void 0:o.id:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id}function Bn(e){var n;return{year:(n=isNaN(Number(e))?new Date(e):new Date(1e3*Number(e))).getFullYear(),month:n.getMonth()+1,day:n.getDate()}}function Fn(e){if(!e)return{season:null,episode:null};var n=e.match(/S(\d+)\s*E(\d+)/i);return n?{season:Number(n[1]),episode:Number(n[2])}:{season:null,episode:null}}!function(e){e.registerPlugin("comscore",(function(e){console.log(this),console.log("hello form comscore plugin",e);var n=e||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;new Promise((function(o,i){var t=document.createElement("script");t.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",t.async=!0,document.head.appendChild(t),t.onload=function(){Pn({publisherId:e||"40813950"})},t.onerror=function(e){i("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}))}(z);var Un=Object.freeze({__proto__:null,createComscoreStreamingTag:jn,destroyComscoreTag:Nn,endComscoreAdTracking:function(){var e,n,o,i,t;if(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef){var l=null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.tagRef;l.notifyPause(),l.notifyEnd(),null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o||(o.mode="content"),(null===(i=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===i?void 0:i.contentMetadata)&&(l.setMetadata(null===(t=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===t?void 0:t.contentMetadata),l.notifyPlay()),console.log("[Comscore] Ad ended. Resumed content playback.")}},finishComscoreAdTracking:function(){var e,n;(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef)&&((null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.tagRef).notifyPause(),console.log("[Comscore] Ad Finished. Resumed content playback."))},formulateComscoreAdPayload:function(e){return{id:null==e?void 0:e.adId,adTitle:null==e?void 0:e.adTitle,adDuration:(null==e?void 0:e.durationInSeconds)||0,startTimeInSeconds:(null==e?void 0:e.startTimeInSeconds)||0,campaignId:null==e?void 0:e.campaignId,placementId:null==e?void 0:e.placementId,trackingUrl:null==e?void 0:e.trackingUrl}},formulateComscorePayload:xn,getComscoreTagInstance:function(){var e;return null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef},setComscorePlayerInstance:Rn,startComscoreAdTracking:function(){var e,n,o,i,t,l,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!(null===(e=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===e?void 0:e.tagRef)&&!window.analytics)return console.log("is StreamingAnalytics started Initialised?",An()),void console.warn("[Comscore] Tag not initialized or analytics missing.");var a=window.analytics,d=null===(n=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===n?void 0:n.tagRef;null===(o=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===o||(o.mode="ad"),d.notifyPause();var s=new a.StreamingAnalytics.AdvertisementMetadata;s.setMediaType(Mn({isLive:null===(t=null===(i=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===i?void 0:i.contentOptions)||void 0===t?void 0:t.isLive,startTimeInSeconds:null==r?void 0:r.startTimeInSeconds})),s.setUniqueId(r.id||"ad-001"),s.setLength(1e3*parseInt(r.durationMs,10)||0),s.setTitle(r.title||"Advertisement"),s.setServerCampaignId(r.campaignId),s.setRelatedContentMetadata(null===(l=null===window||void 0===window?void 0:window.__COMSCORE__)||void 0===l?void 0:l.contentMetadata),s.setDeliveryType(a.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),s.setPlacementId(r.placementId);var u={cs_ad_tu:null==r?void 0:r.trackingUrl,ns_st_ami:null==r?void 0:r.creativeId};s.addCustomLabels(u),d.setMetadata(s),d.notifyPlay(),console.log("[Comscore] Ad started:",r)}});function Hn(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function zn(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?Hn(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Hn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}function Gn(e,n){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,n){if(e){if("string"==typeof e)return Wn(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Wn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){o&&(e=o);var i=0,t=function(){};return{s:t,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==o.return||o.return()}finally{if(a)throw l}}}}function Wn(e,n){(null==n||n>e.length)&&(n=e.length);for(var o=0,i=Array(n);o<n;o++)i[o]=e[o];return i}function qn(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function Kn(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?qn(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):qn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var Jn=function(e,n,o,t){var l,r,a,d,s,v=t.res,p=t.sres,f=H(e),m=(null==v?void 0:v.contentType)||"video",w=(null==v||null===(l=v[m])||void 0===l?void 0:l.drmEnabled)||!1,g=(null==v||null===(r=v[m])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,y=(null==v||null===(d=v[m])||void 0===d||null===(s=d.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;de(v),se.set(v),f&&(f.on("loadstart",(function(){g?o.resolve({status:!0,msg:"Video Loaded",response:v}):o.resolve(Kn({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:v}:{response:v}))})),f.on("loadeddata",(function(){var o,t,l,r=Q(e);if(null==r||r.map((function(n){return $(e,n.id)})),y&&"Safari"===i())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&Re(e,sessionStorage.getItem("volume")||"100");var d=ae();if(function(e,n){var o,i,t,l,r,a,d,s,u,c,v,p=null==e?void 0:e.playerId,f=H(p),m=null==n?void 0:n.siteName;if(null!=e&&null!==(o=e.comscore)&&void 0!==o&&o.enable){var w=ae(),g=(null==w||null===(i=w.video)||void 0===i?void 0:i.metadata)||[],y=(null==g?void 0:g.length)&&g.filter((function(e){return"advertisingGenre"===e.name}));if(null!==(t=y)&&void 0!==t&&t.length){var b=y.map((function(e){return e.value}));y=null==b?void 0:b.join(",")}Nn();var h=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,O=Array.isArray(null==h?void 0:h.category)?null==h||null===(r=h.category)||void 0===r?void 0:r.join(","):(null==h?void 0:h.category)||null,_=zn(zn({},null==w?void 0:w.video),{},{siteName:m,programId:(null==h?void 0:h.videotmsid)||null,programTitle:(null==h?void 0:h.lcProgrammeName)||null,episodeId:(null==h?void 0:h.videotmsid)||null,seasonNumber:(null==h||null===(a=h.seriesDetails)||void 0===a?void 0:a.season)||null,episodeNumber:(null==h||null===(d=h.seriesDetails)||void 0===d?void 0:d.episode)||null,isCompleteEpisode:!!(null!=w&&null!==(s=w.video)&&void 0!==s&&s.series||null!=h&&null!==(u=h.seriesDetails)&&void 0!==u&&u.episode),genre:y||O,comscoreConfig:{implementationId:(null==e||null===(c=e.comscore)||void 0===c?void 0:c.implementationId)||null,projectId:(null==e||null===(v=e.comscore)||void 0===v?void 0:v.projectId)||null}});null!=h&&h.airDate&&(_.publishDate=h.airDate);var C=xn(_);console.log("comscoreOptions player data",C),jn(zn({playerName:"Video.js"},C)),Rn(f)}}(n,v),u(),null!=n&&n.watchHistory&&null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.enable&&(!n.isAnonymousUser||null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.saveOffline)){var s,c,p=Kn(Kn({},n),v);!function(e,n,o){var i,t,l;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(hn=null==n||null===(t=n.series)||void 0===t?void 0:t.id),yn=[],bn=0,sn=o;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=H(e);a&&(a.on("dispose",On),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());yn.includes(bn)||(e!=bn||e<r?e>bn&&(bn=e+r):(yn.push(e),_n(a,n,r)))}})),a.one("ended",(function(){_n(a,n,r,!0)})))}(e,p,null==d||null===(s=d.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=f&&f.mux){var m,w,g,b,h,O,_=(null===(m=ae())||void 0===m?void 0:m.video)||(null==v?void 0:v.video),C=null==_?void 0:_.gist,I={env_key:null==n||null===(w=n.analytics)||void 0===w?void 0:w.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==C?void 0:C.id,video_title:null==C?void 0:C.title,video_series:null==_||null===(b=_.series)||void 0===b?void 0:b.title,video_stream_type:null!=_&&null!==(h=_.streamingInfo)&&void 0!==h&&h.isLiveStream?"live":"video",viewer_user_id:null==n||null===(O=n.analytics)||void 0===O?void 0:O.userId};f.mux({debug:!1,data:I})}})),f.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];f.trigger("subtitlechanged",n)})),f.on("subtitlechanged",(function(e,n){var o,i,t,l,r,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(o=window)||void 0===o||null===(i=o.cast)||void 0===i||null===(t=i.framework)||void 0===t||null===(l=t.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,w=f.getMediaSession(),g=w.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(m)}})),f.tech_.on("retryplaylist",(function(){g&&En(v,e)})),f.on("error",(function(){var n,i;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&g)?En(v,e):(c(e,(null==f||null===(n=f.error())||void 0===n?void 0:n.message)||"Some error occured"),o.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured",response:v}))})),f.one("play",(function(){var e,o,i,t,l;if(null===(e=window)||void 0===e||null===(o=e.app_data)||void 0===o||null===(i=o.appcmsMain)||void 0===i||null===(t=i.adsConfig)||void 0===t||!t.vodAdClientSideTracking){if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable){var r,a,d,s=null===(r=ae())||void 0===r||null===(a=r.video)||void 0===a||null===(d=a.gist)||void 0===d?void 0:d.id,u=ue(),c=(null==u?void 0:u.get(s))||{t:0,p:0},v=c.t,p=c.p;v&&p<95&&setTimeout((function(){f.currentTime(v)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){if(g){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}})),f.one("loadeddata",(function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var o=(e.language||e.language||"").toUpperCase(),i=(n.language||n.label||"").toUpperCase();return o<i?-1:o>i?1:0})),"object"==me(f.dash)){var o,t,l,r=null==f||null===(o=f.dash)||void 0===o||null===(t=o.mediaPlayer)||void 0===t?void 0:t.getTracksFor("audio"),a=null==r?void 0:r.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),d=Gn(n);try{for(d.s();!(l=d.n()).done;){var s=l.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){d.e(e)}finally{d.f()}}else{var u,c=Gn(n);try{for(c.s();!(u=c.n()).done;){var v,p,m,g=u.value;if(("Chrome"==i()||"Edge"==i()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!w))&&null!=g&&null!==(m=g.label)&&void 0!==m&&m.includes("5.1"))f.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function Yn(e){var n=H(e),o=n.seekable(),i=n.controlBar.progressControl.seekBar.el();if(o&&o.length>0){var t=o.start(0),l=o.end(o.length-1)-t;Qn(),$n(l).forEach((function(e){var n=e.id,o=e.title,t=e.time,r=Xn(n,o,Math.min(t/l*100,99.5));i.appendChild(r)}))}}function Xn(e,n,o){var i=document.createElement("div");return i.className="vjs-seekbar-program-marker",i.id=e,i.style.title=n,i.style.left="".concat(o,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="4px",i.style.backgroundColor="#000000",i.style.left="".concat(o,"%"),i.style.pointerEvents="none",i}function Qn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function $n(e){var n=(new Date).getTime(),o=new Date(n-1e3*e).getTime();return(ce()||[]).filter((function(e){var i=new Date(e.formatted_startdate).getTime();return i>=o&&i<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-o;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Zn(e,n){var o=H(e);if(o){var i=n.dvrConfig,t=void 0===i?{}:i,l=n.videoId;n.epg;var r=t.playLive,a=t.playFromBegining,d=t.programs;ve(d),o.on("loadeddata",(function(){ye(n)?a?be(o,n):r?he(o,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.dvrConfig,i=void 0===o?{}:o,t=n.videoId,l=n.epg,r=i.buttonConfig,a=void 0===r?{}:r,d=a.watchLive;a.resume;var s=a.startFromBegining,u=t;if(l&&null!=l&&l.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));u="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!Ce(u),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Ie(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=no(i,v),p.style.display="flex",e.el().appendChild(p),Se(e),eo("watch-live-resume-btn",d,(function(){Te(e,p),he(e,u)})),eo("watch-begining-btn",s,(function(){Te(e,p),be(e,n)}))}(o,n),Oe({player:o,showWatchLive:!0,showStartOver:!0})):_e(o)})),o.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var o=n.videoId,i=e.currentTime(),t=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,d=JSON.parse(sessionStorage.getItem("epgConfig")),s=o,u=!0;if(d&&null!=d&&d.enable){var c;u=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==d?void 0:d.programId),s=null==d?void 0:d.programId}e.on("seeking",(function(){t=!0})),e.on("seeked",(function(){t=!1,i=e.currentTime();var o=JSON.parse(sessionStorage.getItem("epgConfig"));if(o&&null!=o&&o.enable){if(!u||sessionStorage.getItem("program_switched"))return;s="".concat(null==o?void 0:o.programId,"-").concat(null==o?void 0:o.channelId)}ke(s,i),Ee(e,n),Oe({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!t){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!u||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var o=e.currentTime();Math.abs(o-i)>=20&&(ke(s,o),i=o,function(e,n){$n(n).forEach((function(o){var i=o.id,t=o.title,l=o.time,r=document.getElementById(i);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var d=e.controlBar.progressControl.seekBar.el(),s=Xn(i,t,Math.min(l/n*100,99.5));d.appendChild(s)}}))}(e,a))}}))}(o,n)}))}else console.warn("Player instance is required to initialize start over.")}function eo(e,n,o){var i,t,l=document.getElementById(e);l&&(t=n,(i=l)&&(i.style.color="".concat((null==t?void 0:t.textColor)||"#000"),i.style.backgroundColor="".concat((null==t?void 0:t.backGroundColor)||"#DCF95B")),l.addEventListener("click",o))}function no(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=(null==e?void 0:e.buttonConfig)||{},i=o.watchLive,t=o.resume,l=o.startFromBegining,r=n?(null==t?void 0:t.text)||"Resume":(null==i?void 0:i.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(ge()," ").concat(r,"</button>"),d='<button id="watch-begining-btn">'.concat(we()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(d,"</div>")}function oo(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function io(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?oo(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):oo(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var to=function(t,l,r,a){var u,g,y,b,h,O,_,C,I,S,k,E,T,P,j,D,R,A,M,N,x,L,V,B,F,U,G,W,q,K,J,Y,X,Q,$,ee,ne,oe,te,le,re=l.res,ae=void 0===re?null:re,de=l.sres,se=void 0===de?null:de,ue=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],ce=(null===(u=ae)||void 0===u?void 0:u.contentType)||"video",ve=ie(null===(g=ae)||void 0===g||null===(y=g[ce])||void 0===y||null===(b=y.gist)||void 0===b?void 0:b.videoImageUrl)||ie(null===(h=ae)||void 0===h||null===(O=h[ce])||void 0===O||null===(_=O.gist)||void 0===_||null===(C=_.imageGist)||void 0===C?void 0:C.r16x9),pe=(null===(I=ae)||void 0===I||null===(S=I[ce])||void 0===S||null===(k=S.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,fe=(null===(E=ae)||void 0===E||null===(T=E[ce])||void 0===T||null===(P=T.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,me=(null===(j=ae)||void 0===j||null===(D=j.ads)||void 0===D||null===(R=D.preRoll)||void 0===R||null===(A=R.adTags)||void 0===A||null===(M=A.web)||void 0===M?void 0:M.active)&&(null===(N=ae)||void 0===N||null===(x=N.ads)||void 0===x||null===(L=x.preRoll)||void 0===L||null===(V=L.adTags)||void 0===V||null===(B=V.web)||void 0===B?void 0:B.url),we=(null===(F=ae=io(io({},ae),{},{audioAssetSource:null==r?void 0:r.audioAssetSource}))||void 0===F||null===(U=F[ce])||void 0===U?void 0:U.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(G=window)||void 0===G||null===(W=G.app_data)||void 0===W||null===(q=W.appcmsMain)||void 0===q||null===(K=q.adsConfig)||void 0===K?void 0:K.vodAdSticherProvider)||!1,ge=(null==r?void 0:r.latency)||6,ye=(null==r?void 0:r.skin_settings)||{};null==r||r.dvrConfig;var be=(te={enableSmoothSeeking:!0,controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ye?void 0:ye.pictureInPictureToggle)||!1},playbackRates:null!=ye&&ye.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==r.skin,liveui:pe},e(te,"autoplay",null==r?void 0:r.autoplay),e(te,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!me),e(te,"loop",(null==r?void 0:r.loop)||!1),e(te,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(te,"html5",io(io({dash:io(io(io({},!z.browser.IS_SAFARI&&{useTTML:!0}),(null==r?void 0:r.debugConfig)&&(null==r||null===(J=r.debugConfig)||void 0===J?void 0:J.enable)&&{debug:!0,logLevel:null!=r&&null!==(Y=r.debugConfig)&&void 0!==Y&&Y.logLevel?null==r||null===(X=r.debugConfig)||void 0===X?void 0:X.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ge},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:io(io({liveRangeSafeTimeDelta:ge,useDevicePixelRatio:!0,experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==r||null===(Q=r.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==r?void 0:r.enableLowInitialPlaylist)||void 0===$||$}),debug:(null==r?void 0:r.debugConfig)&&(null==r||null===(ee=r.debugConfig)||void 0===ee?void 0:ee.enable)||!1,nativeTextTracks:"Safari"==i()},0==(null==r||null===(ne=r.customData)||void 0===ne?void 0:ne.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(oe=r.customData)||void 0===oe?void 0:oe.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(te,"poster",ve),e(te,"techOrder",ue),e(te,"chromecast",{requestCustomDataFn:function(e){var n,o,i=H(t),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,o){var i,t,l,r,a,d,s,u,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,w,g,y,b,h,O,_;f.isDrmEnabled=!0;var C=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==C?void 0:C.url)||(null==n||null===(w=n.keySystemOptions)||void 0===w||null===(g=w[0])||void 0===g||null===(y=g.options)||void 0===y?void 0:y.serverURL);f.licenseUrl=I;var S=(null==C?void 0:C.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(h=b[0])||void 0===h||null===(O=h.options)||void 0===O||null===(_=O.httpRequestHeaders)||void 0===_?void 0:_["X-AxDRM-Message"]);f.licenseToken=S}var k=(null==e||null===(i=e[p])||void 0===i||null===(t=i.gist)||void 0===t?void 0:t.contentType)||"VIDEO";f.contentType=k;var E=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=E;var T=null==e||null===(a=e[p])||void 0===a||null===(d=a.gist)||void 0===d?void 0:d.title;f.mediaTitle=T;var P=null==e||null===(s=e[p])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=P,f.subTitles=o,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ae,e,l);return io(io({},a),{},{convivaMetaData:io({customerKey:(null==r||null===(n=r.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==r||null===(o=r.convivaConfig)||void 0===o?void 0:o.debug)||!1},fn.getData())})},modifyLoadRequestFn:function(e){var n,o,i,l,r,a=H(t),d=(null==a?void 0:a.currentSource())||{};!(null===(n=ae)||void 0===n||null===(o=n[ce])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=d&&d.src&&null!=d&&null!==(r=d.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),te);if(!z.getPlayers()[t]){null!=r&&r.debugConfig&&null!=r&&null!==(le=r.debugConfig)&&void 0!==le&&le.enable&&z.log.level("debug");var he=z(t,be,function(){var e=n(o.mark((function e(){var n,i,l,u,g,y,b,h,O,_,C,I,S,k,E,T,P,j,D,R,A;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(he),console.log(z.VERSION),console.log(z.getPlugins()),e.next=5,Ke(r,ae);case 5:if(S=null===(n=ae)||void 0===n||null===(i=n[ce])||void 0===i||null===(l=i.liveDetails)||void 0===l?void 0:l.startOverTime,fe&&a.resolve(io({status:!0,msg:"Player Initialised"},se?{seriesResponse:se,response:ae}:{response:ae})),pe&&null!=r&&null!==(u=r.dvrConfig)&&void 0!==u&&u.enable&&Zn(t,io(io({},r),{},{isDvrEnabled:pe})),p(t,null==r?void 0:r.analyticsCb,null==r?void 0:r.customData),pn(t,r),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),pe&&Ne(t,S),!me||null!=r&&null!==(g=r.customData)&&void 0!==g&&g.disableAds||f(t,me,ae),k=d(ae,t),console.log(k),null!=r&&r.nearestClusterUrl&&(k=m(k,r.nearestClusterUrl)),!we){e.next=21;break}return e.next=20,w(t,ae);case 20:k=e.sent;case 21:k?s(t,k):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:ae}),c(t,"Incompatible / Missing Source")),((null===(y=ae)||void 0===y||null===(b=y[ce])||void 0===b||null===(h=b.contentDetails)||void 0===h||null===(O=h.closedCaptions)||void 0===O?void 0:O.length)>0||(null===(_=ae)||void 0===_||null===(C=_[ce])||void 0===C||null===(I=C.closedCaptions)||void 0===I?void 0:I.length)>0)&&(A=(null===(T=ae)||void 0===T||null===(P=T[ce])||void 0===P||null===(j=P.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(D=ae)||void 0===D||null===(R=D[ce])||void 0===R?void 0:R.closedCaptions),E=A.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),Z(t,E)),null!=r&&r.disableControls?v(t):mn(t,io(io(io({},r),be),{},{liveVideo:fe,isDvrEnabled:pe,res:ae,sres:se})),Jn(t,io(io(io({},r),be),{},{liveVideo:fe}),a,{res:ae,sres:se});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},lo={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function ro(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function ao(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ro(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ro(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var so,uo=function(e,n){var o=n.resolve,i=n.reject,t=null==e?void 0:e.playerId,l=co(e);to(t,{res:l},e,{resolve:o,reject:i})},co=function(e){var n,o,i,t,l,r,a,d,s=null==e?void 0:e.streamingInfo,u=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,c=(null==e||null===(o=e.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,v=(null==e||null===(i=e.streamingInfo)||void 0===i||null===(t=i.ads)||void 0===t?void 0:t.url)||null,p=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,f=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(d=a.videoAssets)||void 0===d?void 0:d.drmProvider)||null,w=null==e?void 0:e.token,y=g(w),b=null==y?void 0:y.site;return ao(ao({id:null==lo?void 0:lo[b]},!c&&{directPlaybackUrl:null==u?void 0:u.url}),{},{video:{drmEnabled:c,streamingInfo:{videoAssets:ao(ao({},m&&{drmProvider:m}),{},{widevine:null==u?void 0:u.widevine,fairPlay:null==u?void 0:u.fairPlay,playReady:null==u?void 0:u.playReady})},liveDetails:{isDvrEnabled:null==s?void 0:s.isDvrEnabled},gist:ao({},p&&{videoImageUrl:p}),contentDetails:ao({},(null==f?void 0:f.length)>0&&{closedCaptions:Pe(f)})},ads:{preRoll:{adTags:{web:ao(ao({},v&&{active:!0}),v&&{url:v})}}}})};function vo(e,n){return po.apply(this,arguments)}function po(){return(po=n(o.mark((function e(n,i){var t,l,r,a,d,s;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.resolve,l=i.reject,r=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,d=!(null==n||!n.anonymousId),e.next=6,O();case 6:s=e.sent,y(r,s).then((function(e){var o,i,u,c;window.contentType=null==e||null===(o=e.data)||void 0===o||null===(i=o.video)||void 0===i||null===(u=i.gist)||void 0===u?void 0:u.contentType,de(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(c=n.watchHistory)&&void 0!==c&&c.enable&&!d)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,w,g=Sn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",r,null==n?void 0:n.siteOwner);if(g&&g.length)n.watchHistoryResumeTime=(null===(m=g[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(w=g[0])||void 0===w?void 0:w.watchedPercentage)||null;p.contentType="video",to(a,{res:p},n,{resolve:t,reject:l})}else b(r,s).then((function(e){var o,i,t,l,r,a;null!==(o=window)&&void 0!==o&&null!==(i=o.watchHistory)&&void 0!==i&&i.cb&&(null===(t=window)||void 0===t||null===(l=t.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"})).catch((function(e){var n,o,i,t;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(t=i.watchHistory)||void 0===t||t.cb(e))})).finally((function(){to(a,{res:p},n,{resolve:t,reject:l})}));else to(a,{res:p},n,{resolve:t,reject:l})})).catch((function(e){h(e,a,l,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fo(e,n){return mo.apply(this,arguments)}function mo(){return(mo=n(o.mark((function e(n,i){var t,l,r,a,d;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.resolve,l=i.reject,e.next=3,O();case 3:r=e.sent,a=null==n?void 0:n.playerId,d=null==n?void 0:n.epg,_(d,r).then((function(e){var o=null==e?void 0:e.data;o.contentType="linearchannel",o.channelId=null==d?void 0:d.channelId,to(a,{res:o},n,{resolve:t,reject:l})})).catch((function(e){h(e,a,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wo(e,n){return go.apply(this,arguments)}function go(){return(go=n(o.mark((function e(n,i){var t,l,r,a,d,s,u;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=i.resolve,r=i.reject,e.next=3,O();case 3:a=e.sent,d=null==n?void 0:n.playerId,s=sessionStorage.getItem("season-idx")||0,pe.set(parseInt(s)),u=null==n||null===(t=n.series)||void 0===t?void 0:t.id,C(u,a).then((function(e){var o,i,t,s=e.data,c=e.data.seasons;fe(c);var v=videoId||(null==c||null===(o=c[0])||void 0===o||null===(i=o.episodes)||void 0===i||null===(t=i[0])||void 0===t?void 0:t.id);I(u,a),y(v,a).then((function(e){var o,i,t;window.contentType=null==e||null===(o=e.data)||void 0===o||null===(i=o.video)||void 0===i||null===(t=i.gist)||void 0===t?void 0:t.contentType,de(e.data),to(d,{res:null==e?void 0:e.data,sres:s},n,{resolve:l,reject:r})})).catch((function(e){h(e,d,r,videoId)}))})).catch((function(e){h(e,d,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yo(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function bo(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?yo(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):yo(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}function ho(){return{loadVideoInstantly:S,onTimeUpdate:G,getVideoDuration:W,onVideoEnded:q,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(o.mark((function n(i,t){var l,r,a,d,s,u,c,v,p,f,m,w,g,b,O,_,C,I,S,k,E,T,P,D,R;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!j(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(g=(null==e?void 0:e.videoSourceUrl)||!1,b=null==e?void 0:e.asat,O=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,_=null==e?void 0:e.videoId,C=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,I=(null==e?void 0:e.streamingInfo)||!1,window.videoId=_,S=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",S),B().set(null==e?void 0:e.refreshToken),S&&!F(S)){n.next=16;break}return t({status:!1,msg:"".concat(S?"Token is expired !":"Missing Authorization Token"),response:{token:S}}),n.abrupt("return");case 16:so=JSON.parse(atob(S.split(".")[1]));case 17:return window.siteName=null===(a=so)||void 0===a?void 0:a.site,window.siteId=null===(d=so)||void 0===d?void 0:d.siteId,e.isAnonymousUser=!(null===(s=so)||void 0===s||!s.anonymousId),e.siteOwner=(null===(u=so)||void 0===u?void 0:u.site)||null,e.userId=(null===(c=so)||void 0===c?void 0:c.userId)||null,window.sessionStorage.setItem("uid",null===(v=so)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,k=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(T=null==e?void 0:e.errors)&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,le(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),L.set(e.apiBaseUrl),null!=e&&e.skin&&!te(e.skin)||(e.skin="VL_ONE"),n.next=35,ze(e);case 35:E&&je("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return U(E)})).catch((function(e){})),(P=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(k)))&&P.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g?(R={directPlaybackUrl:g,id:D="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?y(D,S).then((function(n){var o=(null==n?void 0:n.data)||{};to(k,{res:bo(bo({},o),R)},e,{resolve:i,reject:t})})).catch((function(e){h(e,k,t,D)})):to(k,{res:R},e,{resolve:i,reject:t})):I?uo(e,{resolve:i,reject:t}):C?wo(e,{resolve:i,reject:t}):O?fo(e,{resolve:i,reject:t}):vo(e,{resolve:i,reject:t});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:ne,skip:k,getPlayer:H,play:E,pause:T,detectBrowser:i,rewind:P,loadVideo:s,seekToTimeStamp:K,isPlayerInitialised:j,load:D,authenticateLC:R,dispose:A,enableCaptions:ee,disableCaptions:$,getCaptions:Q,playSelectedResolution:oe,getSource:d,setVolume:Re,getVolume:Ae,disableControls:v,setPlaybackSpeed:J,getEntitlementData:M,adsQueuePointManager:N,getSsaiEvents:x,playerEvents:Y,onReplay:X}}export{ho as V,Yn as i,Qn as r};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as r,a as i}from"./currentVideoInfo-a8a254c2.js";import{s as o}from"./autoNextVideo-0ddc8aa3.js";import{e as a}from"./icons-37daa6b3.js";import{p as l,d as u,t as s}from"./skin-d5091b86.js";import c from"@babel/runtime/helpers/typeof";import d from"video.js";import p from"@babel/runtime/helpers/asyncToGenerator";import m from"@babel/runtime/regenerator";import v from"@babel/runtime/helpers/defineProperty";import f from"@babel/runtime/helpers/slicedToArray";var g,h,b,y,x=[],w=!1,E=function(i,o){var s;if(w=!1,null!=o&&null!==(s=o.series)&&void 0!==s&&s.enable){var c;x=[];var d=r();null==d||d.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==o||null===(c=o.series)||void 0===c||c.cb}else{var p,m;x=(null==o||null===(p=o.relatedVideos)||void 0===p?void 0:p.content)||[],null==o||null===(m=o.relatedVideos)||void 0===m||m.cb}var v=t(i);v.on("timeupdate",(function(){var e,t;if(!w){var r=Math.floor(v.currentTime()),i=v.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var f,g=x.filter((function(e,t){return t==n()}));if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,b,y,E,N,j,k,C,O,T,I,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var L=null===(b=document.getElementsByClassName("next-ep-title"))||void 0===b?void 0:b[0],S=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],M=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],P=null===(N=g[0])||void 0===N?void 0:N.title;(null===(j=P)||void 0===j?void 0:j.length)>60&&(P=P.substr(0,60)+"..."),L.textContent="".concat(P),S.src=(null===(k=g[0])||void 0===k||null===(C=k.gist)||void 0===C||null===(O=C.imageGist)||void 0===O?void 0:O.r16x9)||(null==g||null===(T=g[0])||void 0===T?void 0:T.img)||(null===(I=window)||void 0===I||null===(B=I.customData)||void 0===B?void 0:B.fallbackImage),M.onclick=function(){return A(i)}}else{var R,D,$,X,F,U,_,G,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var V=document.createElement("div");V.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var z=document.createElement("div");z.className="next-ep-close",z.onclick=function(){q.style.visibility="hidden",w=!0},z.appendChild(l(a())),V.append(W),V.append(z);var H=null===(R=g[0])||void 0===R?void 0:R.title,Q=document.createElement("img");Q.className="next-ep-img",Q.src=(null===(D=g[0])||void 0===D||null===($=D.gist)||void 0===$||null===(X=$.imageGist)||void 0===X?void 0:X.r16x9)||(null==g||null===(F=g[0])||void 0===F?void 0:F.img)||(null===(U=window)||void 0===U||null===(_=U.customData)||void 0===_?void 0:_.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),Y.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Q),J.append(Y),J.onclick=u((function(){null==q||q.remove(),w=!0,A(i)}),400),q.append(V),q.append(J)}},A=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,x)}};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}g={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},h=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===c(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},b=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},y=function e(t){return"HTML"!==t.nodeName&&"static"===b(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=h({},g,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",h(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=y(o.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=y(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&h(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=b(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k="my-player";function C(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 O(){return(O=p(m.mark((function e(t){var n,r,i,o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,k,C;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=f(o,2),l=a[0],u=a[1],s=i.width/u,c=i.height/l,d=[],p=0;p<l;p++)for(v=0;v<u;v++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,v*s,p*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=f(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(j=N.app_data)||void 0===j||null===(k=j.appcmsMain)||void 0===k||null===(C=k.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function T(e,t){return I.apply(this,arguments)}function I(){return(I=p(m.mark((function e(t,n){var r,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",C(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)}function B(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(k);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return O.apply(this,arguments)}(s).then((function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri})))}}function L(e){return S.apply(this,arguments)}function S(){return(S=p(m.mark((function e(t){var n,r,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),i=f(r,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);n[s]=j(j({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},v(u,"left","-60px"),v(u,"border","1px solid transparent"),v(u,"borderRadius","4px"),u)})}})),r=Object.keys(n).map(Number).sort((function(e,t){return e-t})),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",s((function(e){return B(e,n,r)}),500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",s((function(e){return B(e,n,r)}),500))})),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M=function(){var e=p(m.mark((function e(t,n){var r,i,o,a,l,u,s,c;return m.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:i=e.sent,o=i.split("\n").map((function(e){return e.trim()})),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach((function(e){var t=e.split("="),n=f(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())})),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function P(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function R(e,t){return D.apply(this,arguments)}function D(){return(D=p(m.mark((function e(n,r){var o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,M,R,D,F,U,_,G,q,V,W,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,o=t(r),a=n.split("/"),l=a.findIndex((function(e){return"dash"===e.toLowerCase()})),u=P(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return p=e.sent,e.next=11,p.text();case 11:v=e.sent,g=new DOMParser,h=g.parseFromString(v,"application/xml"),b=(null==o?void 0:o.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],M=S.getAttribute("value"),R=null==M?void 0:M.split("x"),D=f(R,2),F=D[0],U=D[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),G=(_?B/_:B)/(F*U),q=L.getAttribute("id"),V=Math.round(b/G),W=Math.ceil(V/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<W;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:G,layout:M,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=f(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),oe=N.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=$(ce),w=0;w<se;w++)ve=me?X(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}}),e,null,[[5,76]])})))).apply(this,arguments)}function $(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function F(e){return U.apply(this,arguments)}function U(){return(U=p(m.mark((function e(n){var r,i,o,a,l,u,s,c,d,p,v,f,g,h,b,y;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,T(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return p=(null==d?void 0:d[0])||null,v=p.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,M(f,v);case 12:return g=e.sent,e.next=15,L(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,R(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,L(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{E as a,_ as b,F as i};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as r,a as i}from"./currentVideoInfo-a8a254c2.js";import{s as o}from"./autoNextVideo-a7610b13.js";import{e as a}from"./icons-37daa6b3.js";import{p as l,d as u,t as s}from"./skin-d5091b86.js";import c from"@babel/runtime/helpers/typeof";import d from"video.js";import p from"@babel/runtime/helpers/asyncToGenerator";import m from"@babel/runtime/regenerator";import v from"@babel/runtime/helpers/defineProperty";import f from"@babel/runtime/helpers/slicedToArray";var g,h,b,y,x=[],w=!1,E=function(i,o){var s;if(w=!1,null!=o&&null!==(s=o.series)&&void 0!==s&&s.enable){var c;x=[];var d=r();null==d||d.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==o||null===(c=o.series)||void 0===c||c.cb}else{var p,m;x=(null==o||null===(p=o.relatedVideos)||void 0===p?void 0:p.content)||[],null==o||null===(m=o.relatedVideos)||void 0===m||m.cb}var v=t(i);v.on("timeupdate",(function(){var e,t;if(!w){var r=Math.floor(v.currentTime()),i=v.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var f,g=x.filter((function(e,t){return t==n()}));if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,b,y,E,N,j,k,C,O,T,I,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var L=null===(b=document.getElementsByClassName("next-ep-title"))||void 0===b?void 0:b[0],S=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],M=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],P=null===(N=g[0])||void 0===N?void 0:N.title;(null===(j=P)||void 0===j?void 0:j.length)>60&&(P=P.substr(0,60)+"..."),L.textContent="".concat(P),S.src=(null===(k=g[0])||void 0===k||null===(C=k.gist)||void 0===C||null===(O=C.imageGist)||void 0===O?void 0:O.r16x9)||(null==g||null===(T=g[0])||void 0===T?void 0:T.img)||(null===(I=window)||void 0===I||null===(B=I.customData)||void 0===B?void 0:B.fallbackImage),M.onclick=function(){return A(i)}}else{var R,D,$,X,F,U,_,G,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var V=document.createElement("div");V.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var z=document.createElement("div");z.className="next-ep-close",z.onclick=function(){q.style.visibility="hidden",w=!0},z.appendChild(l(a())),V.append(W),V.append(z);var H=null===(R=g[0])||void 0===R?void 0:R.title,Q=document.createElement("img");Q.className="next-ep-img",Q.src=(null===(D=g[0])||void 0===D||null===($=D.gist)||void 0===$||null===(X=$.imageGist)||void 0===X?void 0:X.r16x9)||(null==g||null===(F=g[0])||void 0===F?void 0:F.img)||(null===(U=window)||void 0===U||null===(_=U.customData)||void 0===_?void 0:_.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),Y.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Q),J.append(Y),J.onclick=u((function(){null==q||q.remove(),w=!0,A(i)}),400),q.append(V),q.append(J)}},A=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,x)}};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}g={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},h=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===c(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},b=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},y=function e(t){return"HTML"!==t.nodeName&&"static"===b(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=h({},g,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",h(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=y(o.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=y(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&h(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=b(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k="my-player";function C(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 O(){return(O=p(m.mark((function e(t){var n,r,i,o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,k,C;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=f(o,2),l=a[0],u=a[1],s=i.width/u,c=i.height/l,d=[],p=0;p<l;p++)for(v=0;v<u;v++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,v*s,p*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=f(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(j=N.app_data)||void 0===j||null===(k=j.appcmsMain)||void 0===k||null===(C=k.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function T(e,t){return I.apply(this,arguments)}function I(){return(I=p(m.mark((function e(t,n){var r,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",C(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)}function B(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(k);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return O.apply(this,arguments)}(s).then((function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri})))}}function L(e){return S.apply(this,arguments)}function S(){return(S=p(m.mark((function e(t){var n,r,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),i=f(r,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);n[s]=j(j({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},v(u,"left","-60px"),v(u,"border","1px solid transparent"),v(u,"borderRadius","4px"),u)})}})),r=Object.keys(n).map(Number).sort((function(e,t){return e-t})),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",s((function(e){return B(e,n,r)}),500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",s((function(e){return B(e,n,r)}),500))})),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M=function(){var e=p(m.mark((function e(t,n){var r,i,o,a,l,u,s,c;return m.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:i=e.sent,o=i.split("\n").map((function(e){return e.trim()})),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach((function(e){var t=e.split("="),n=f(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())})),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function P(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function R(e,t){return D.apply(this,arguments)}function D(){return(D=p(m.mark((function e(n,r){var o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,M,R,D,F,U,_,G,q,V,W,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,o=t(r),a=n.split("/"),l=a.findIndex((function(e){return"dash"===e.toLowerCase()})),u=P(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return p=e.sent,e.next=11,p.text();case 11:v=e.sent,g=new DOMParser,h=g.parseFromString(v,"application/xml"),b=(null==o?void 0:o.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],M=S.getAttribute("value"),R=null==M?void 0:M.split("x"),D=f(R,2),F=D[0],U=D[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),G=(_?B/_:B)/(F*U),q=L.getAttribute("id"),V=Math.round(b/G),W=Math.ceil(V/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<W;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:G,layout:M,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=f(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),oe=N.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=$(ce),w=0;w<se;w++)ve=me?X(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}}),e,null,[[5,76]])})))).apply(this,arguments)}function $(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function F(e){return U.apply(this,arguments)}function U(){return(U=p(m.mark((function e(n){var r,i,o,a,l,u,s,c,d,p,v,f,g,h,b,y;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,T(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return p=(null==d?void 0:d[0])||null,v=p.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,M(f,v);case 12:return g=e.sent,e.next=15,L(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,R(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,L(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{E as a,_ as b,F as i};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- 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"./generic-bd28bc10.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-1c1a0ec1.js";import"./util-086c3bd1.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
1
+ 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"./generic-b3cb59a6.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-1d0c78b9.js";import"./util-2cff93e3.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{i as s,e as i,j as l}from"./icons-37daa6b3.js";import{C as c,y as m}from"./generic-bd28bc10.js";import{g as d,s as p,k as u}from"./skin-d5091b86.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./player_instance-34118a5b.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"./captions-f507e8ee.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";function v(e){var t=h();return function(){var r,n=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(n,arguments,s)}else r=n.apply(this,arguments);return a(this,r)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=n.getComponent("Component"),y=function(a){r(h,f);var o=v(h);function h(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=o.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=n.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=n.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return n.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-b7cec0cf.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),r=n.dom.createEl("div",{className:"stream-container hidden"});n.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=r.classList)&&void 0!==a&&a.contains("hidden")?(d(),r.classList.remove("hidden"),t.classList.add("open"),p(e.playerId,r)):(r.classList.add("hidden"),t.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var o=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);r.style.height="".concat(o,"px"),a.style.overflow="hidden",n.dom.appendContent(t,r),this.addFunctionality(r)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=n.dom.createEl("div",{className:"stream-selector-head"}),o=n.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),r.classList.remove("open")};for(var s=n.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=n.dom.createEl("div",{className:"stream-selector-content"}),p=n.dom.createEl("div",{className:"stream-tray"}),v=parseInt(sessionStorage.getItem("selectedStreamIndex")||0),h=function(e){var r,a,o,s=n.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});v==e&&(s.classList.add("selected"),s.style.border="2px solid #D2393B"),s.onclick=function(){for(var r=n.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");s.classList.add("selected"),s.style.border="2px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},s.style.backgroundImage="url(".concat(t.streams[e].img,")");var i=document.createElement("img");i.className="stream-thumbnail-image",i.src="".concat((null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img)||(null===(a=window)||void 0===a||null===(o=a.customData)||void 0===o?void 0:o.fallbackImage)),s.append(i),n.dom.appendContent(p,s),n.dom.appendContent(d,p)},f=0;f<this.streams.length;f++)h(f);n.dom.appendContent(a,o),n.dom.appendContent(a,s),n.dom.appendContent(e,a),n.dom.appendContent(e,d),u(this.playerId,e)}}]),h}();export{y as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{i as s,e as i,j as l}from"./icons-37daa6b3.js";import{C as c,y as m}from"./generic-b3cb59a6.js";import{g as d,s as p,k as u}from"./skin-d5091b86.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./player_instance-34118a5b.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"./captions-f507e8ee.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";function v(e){var t=h();return function(){var r,n=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(n,arguments,s)}else r=n.apply(this,arguments);return a(this,r)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=n.getComponent("Component"),y=function(a){r(h,f);var o=v(h);function h(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=o.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=n.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=n.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return n.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-b7cec0cf.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),r=n.dom.createEl("div",{className:"stream-container hidden"});n.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=r.classList)&&void 0!==a&&a.contains("hidden")?(d(),r.classList.remove("hidden"),t.classList.add("open"),p(e.playerId,r)):(r.classList.add("hidden"),t.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var o=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);r.style.height="".concat(o,"px"),a.style.overflow="hidden",n.dom.appendContent(t,r),this.addFunctionality(r)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=n.dom.createEl("div",{className:"stream-selector-head"}),o=n.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),r.classList.remove("open")};for(var s=n.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=n.dom.createEl("div",{className:"stream-selector-content"}),p=n.dom.createEl("div",{className:"stream-tray"}),v=parseInt(sessionStorage.getItem("selectedStreamIndex")||0),h=function(e){var r,a,o,s=n.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});v==e&&(s.classList.add("selected"),s.style.border="2px solid #D2393B"),s.onclick=function(){for(var r=n.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");s.classList.add("selected"),s.style.border="2px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},s.style.backgroundImage="url(".concat(t.streams[e].img,")");var i=document.createElement("img");i.className="stream-thumbnail-image",i.src="".concat((null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img)||(null===(a=window)||void 0===a||null===(o=a.customData)||void 0===o?void 0:o.fallbackImage)),s.append(i),n.dom.appendContent(p,s),n.dom.appendContent(d,p)},f=0;f<this.streams.length;f++)h(f);n.dom.appendContent(a,o),n.dom.appendContent(a,s),n.dom.appendContent(e,a),n.dom.appendContent(e,d),u(this.playerId,e)}}]),h}();export{y as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import o from"video.js";import{i as s,e as i,j as l}from"./icons-37daa6b3.js";import{C as c,y as m}from"./generic-bd28bc10.js";import{g as d}from"./skin-d5091b86.js";import{g as p}from"./player_instance-34118a5b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"./captions-f507e8ee.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";function u(e){var t=h();return function(){var r,o=n(e);if(t){var s=n(this).constructor;r=Reflect.construct(o,arguments,s)}else r=o.apply(this,arguments);return a(this,r)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var v=o.getComponent("Component"),f=function(a){r(h,v);var n=u(h);function h(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=n.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=o.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return o.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-1fb5149a.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=o.dom.createEl("div",{className:"stream-container hidden"});o.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(d(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var a=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(a,"px"),r.style.overflow="hidden",o.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=o.dom.createEl("div",{className:"stream-selector-head"}),n=o.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var s=o.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=o.dom.createEl("div",{className:"stream-selector-content"}),u=o.dom.createEl("div",{className:"stream-tray"}),h=function(e){var r,a=o.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(a.classList.add("selected"),a.style.border="4px solid #D2393B"),a.onclick=function(){for(var r=o.dom.$$(".stream"),n=0;n<r.length;n++)r[n].style.border="none",r[n].classList.remove("selected");a.classList.add("selected"),a.style.border="4px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},a.style.backgroundImage="url(".concat(t.streams[e].img,")");var n=document.createElement("img");n.className="stream-thumbnail-image",n.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),n.alt="No Thumbnail Available",a.append(n),o.dom.appendContent(u,a),o.dom.appendContent(d,u)},v=0;v<this.streams.length;v++)h(v);o.dom.appendContent(a,n),o.dom.appendContent(a,s),o.dom.appendContent(e,a),o.dom.appendContent(e,d),p(this.playerId).on("fullscreenchange",(function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")}))}}]),h}();export{f as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import o from"video.js";import{i as s,e as i,j as l}from"./icons-37daa6b3.js";import{C as c,y as m}from"./generic-b3cb59a6.js";import{g as d}from"./skin-d5091b86.js";import{g as p}from"./player_instance-34118a5b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"./captions-f507e8ee.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";function u(e){var t=h();return function(){var r,o=n(e);if(t){var s=n(this).constructor;r=Reflect.construct(o,arguments,s)}else r=o.apply(this,arguments);return a(this,r)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var v=o.getComponent("Component"),f=function(a){r(h,v);var n=u(h);function h(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=n.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=o.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return o.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-1fb5149a.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=o.dom.createEl("div",{className:"stream-container hidden"});o.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(d(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var a=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(a,"px"),r.style.overflow="hidden",o.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=o.dom.createEl("div",{className:"stream-selector-head"}),n=o.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var s=o.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=o.dom.createEl("div",{className:"stream-selector-content"}),u=o.dom.createEl("div",{className:"stream-tray"}),h=function(e){var r,a=o.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(a.classList.add("selected"),a.style.border="4px solid #D2393B"),a.onclick=function(){for(var r=o.dom.$$(".stream"),n=0;n<r.length;n++)r[n].style.border="none",r[n].classList.remove("selected");a.classList.add("selected"),a.style.border="4px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},a.style.backgroundImage="url(".concat(t.streams[e].img,")");var n=document.createElement("img");n.className="stream-thumbnail-image",n.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),n.alt="No Thumbnail Available",a.append(n),o.dom.appendContent(u,a),o.dom.appendContent(d,u)},v=0;v<this.streams.length;v++)h(v);o.dom.appendContent(a,n),o.dom.appendContent(a,s),o.dom.appendContent(e,a),o.dom.appendContent(e,d),p(this.playerId).on("fullscreenchange",(function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")}))}}]),h}();export{f as default};