@viewlift/player-backup 2.0.116-backup → 2.0.117-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 (142) hide show
  1. package/cjs/autoNextVideo-b8450765.js +1 -0
  2. package/cjs/bundle.css +34 -34
  3. package/cjs/{features-b9518c47.js → features-badd86f2.js} +1 -1
  4. package/cjs/generic-05ef2861.js +1 -0
  5. package/cjs/{index-62222a39.js → index-0b3792d7.js} +1 -1
  6. package/cjs/index-36a39813.js +1 -0
  7. package/cjs/index-6a6f8368.js +1 -0
  8. package/cjs/index.js +1 -1
  9. package/cjs/{multicamv2-8d52871f.js → multicamv2-07e13c53.js} +1 -1
  10. package/cjs/{multicamv2-833efcf1.js → multicamv2-39262f51.js} +1 -1
  11. package/cjs/{nextEpisodeButton-b98fc202.js → nextEpisodeButton-4e891cf4.js} +1 -1
  12. package/cjs/{playlist-ce7f9db5.js → playlist-4b56fc94.js} +1 -1
  13. package/cjs/{series-1ba5aa80.js → series-fcc866d0.js} +1 -1
  14. package/cjs/{series-v2-66cc35c6.js → series-v2-784168f8.js} +1 -1
  15. package/cjs/{series-v2-b1911450.js → series-v2-eda449bd.js} +1 -1
  16. package/cjs/{skin-cd625772.js → skin-58100657.js} +1 -1
  17. package/cjs/{skin-710efb6a.js → skin-658cd334.js} +1 -1
  18. package/cjs/{skin-207038f1.js → skin-7bbf08e9.js} +1 -1
  19. package/cjs/{skin-8fd50d98.js → skin-9aeadda0.js} +1 -1
  20. package/cjs/{skin-b1e9a1d6.js → skin-a4802e10.js} +1 -1
  21. package/cjs/skin-f238c543.js +1 -0
  22. package/cjs/{start-begin-btn-95c6cc92.js → start-begin-btn-b8828163.js} +1 -1
  23. package/cjs/{videoSelector-4cd10521.js → videoSelector-74885792.js} +1 -1
  24. package/cjs/{videoSelector-481263de.js → videoSelector-f3704f94.js} +1 -1
  25. package/esm/apis/index.d.ts +11 -0
  26. package/esm/assets/icons.d.ts +24 -0
  27. package/esm/autoNextVideo-44e6d7e6.js +1 -0
  28. package/esm/bundle.css +34 -34
  29. package/esm/components/advertisement/advertisement.d.ts +1 -0
  30. package/esm/components/auto-next-video/autoNextVideo.d.ts +2 -0
  31. package/esm/components/broadcaster_image/index.d.ts +1 -0
  32. package/esm/components/caption-settings/caption-settings.d.ts +14 -0
  33. package/esm/components/dvr-overlay/index.d.ts +2 -0
  34. package/esm/components/dvr-overlay/start-begin-btn.d.ts +6 -0
  35. package/esm/components/dvr-overlay/watch-live-btn.d.ts +6 -0
  36. package/esm/components/dvr-seekbar/index.d.ts +14 -0
  37. package/esm/components/markers/index.d.ts +1 -0
  38. package/esm/components/markers/marker.d.ts +1 -0
  39. package/esm/components/multicam/multicam.d.ts +18 -0
  40. package/esm/components/multicam-v2/multicamv2.d.ts +13 -0
  41. package/esm/components/multicam-v2_TEMP/multicamv2.d.ts +13 -0
  42. package/esm/components/next-ep-preview/next-ep-preview.d.ts +1 -0
  43. package/esm/components/next-episode/nextEpisodeButton.d.ts +13 -0
  44. package/esm/components/playlist-tray/playlist.d.ts +15 -0
  45. package/esm/components/quality-selector/index.d.ts +1 -0
  46. package/esm/components/resolution/resolution-v2.d.ts +18 -0
  47. package/esm/components/resolution/resolution.d.ts +20 -0
  48. package/esm/components/series/series.d.ts +10 -0
  49. package/esm/components/series-v2/helper.d.ts +3 -0
  50. package/esm/components/series-v2/series-v2.d.ts +25 -0
  51. package/esm/components/series-v2_TEMP/helper.d.ts +1 -0
  52. package/esm/components/series-v2_TEMP/series-v2.d.ts +21 -0
  53. package/esm/components/settings-icon/settings-icon.d.ts +17 -0
  54. package/esm/components/trickplay/helper.d.ts +13 -0
  55. package/esm/components/trickplay/index.d.ts +1 -0
  56. package/esm/components/trickplay/videojs.thumbnails.d.ts +1 -0
  57. package/esm/components/video-selector/videoSelector.d.ts +18 -0
  58. package/esm/components/video-selector_TEMP/videoSelector.d.ts +16 -0
  59. package/esm/components/watch-history/handleWatchHistory.d.ts +2 -0
  60. package/esm/contentHandler/content_types/epg.d.ts +4 -0
  61. package/esm/contentHandler/content_types/external.d.ts +4 -0
  62. package/esm/contentHandler/content_types/index.d.ts +5 -0
  63. package/esm/contentHandler/content_types/series.d.ts +4 -0
  64. package/esm/contentHandler/content_types/vod.d.ts +4 -0
  65. package/esm/contentHandler/firePlayer.d.ts +4 -0
  66. package/esm/core/captions.d.ts +10 -0
  67. package/esm/core/generic.d.ts +48 -0
  68. package/esm/core/player_instance.d.ts +6 -0
  69. package/esm/core/renditions.d.ts +6 -0
  70. package/esm/core/util.d.ts +16 -0
  71. package/esm/core/volume.d.ts +2 -0
  72. package/esm/dash/dashHandler.d.ts +1 -0
  73. package/esm/dash/sgai.d.ts +9 -0
  74. package/esm/{features-b17a311f.js → features-5a4e3389.js} +1 -1
  75. package/esm/features.d.ts +32 -0
  76. package/esm/generic-7e22e260.js +1 -0
  77. package/esm/globalPlayerEvents.d.ts +8 -0
  78. package/esm/helpers/browser.d.ts +2 -0
  79. package/esm/helpers/currentVideoInfo.d.ts +14 -0
  80. package/esm/helpers/errorHandling.d.ts +2 -0
  81. package/esm/helpers/loader.d.ts +2 -0
  82. package/esm/helpers/localisation.d.ts +2 -0
  83. package/esm/helpers/scriptLoader.d.ts +2 -0
  84. package/esm/helpers/secondary-switching.d.ts +1 -0
  85. package/esm/helpers/skin.d.ts +14 -0
  86. package/esm/helpers/sourceRetriever.d.ts +11 -0
  87. package/esm/helpers/ssaiEventHandler.d.ts +27 -0
  88. package/esm/helpers/token.d.ts +9 -0
  89. package/esm/index-2068da20.js +1 -0
  90. package/esm/{index-20d3b872.js → index-863cdd6a.js} +1 -1
  91. package/esm/index-94145c0c.js +1 -0
  92. package/esm/index.d.ts +42 -0
  93. package/esm/index.js +1 -1
  94. package/esm/{multicamv2-ea35068b.js → multicamv2-140c7b5f.js} +1 -1
  95. package/esm/{multicamv2-716b15d0.js → multicamv2-bc51f879.js} +1 -1
  96. package/esm/{nextEpisodeButton-a918f043.js → nextEpisodeButton-7033ccfb.js} +1 -1
  97. package/esm/{playlist-ad9491f0.js → playlist-efc64fc5.js} +1 -1
  98. package/esm/plugins/chromecast.d.ts +18 -0
  99. package/esm/plugins/index.d.ts +2 -0
  100. package/esm/plugins/library.d.ts +7 -0
  101. package/esm/plugins/videojs-dash5.es.d.ts +51 -0
  102. package/esm/plugins/videojs_contrib_dash.d.ts +51 -0
  103. package/esm/{series-efca8869.js → series-81d21874.js} +1 -1
  104. package/esm/{series-v2-0f338773.js → series-v2-05b04cf6.js} +1 -1
  105. package/esm/{series-v2-38415907.js → series-v2-224ee9f1.js} +1 -1
  106. package/esm/skin/carousel/skin.d.ts +1 -0
  107. package/esm/skin/default/events.d.ts +1 -0
  108. package/esm/skin/default/skin.d.ts +1 -0
  109. package/esm/skin/defaultV2/events.d.ts +1 -0
  110. package/esm/skin/defaultV2/skin.d.ts +1 -0
  111. package/esm/skin/index.d.ts +1 -0
  112. package/esm/skin/minimalist/skin.d.ts +1 -0
  113. package/esm/skin/multiplayer/events.d.ts +1 -0
  114. package/esm/skin/multiplayer/skin.d.ts +1 -0
  115. package/esm/skin/vl_one/events.d.ts +1 -0
  116. package/esm/skin/vl_one/skin.d.ts +1 -0
  117. package/esm/{skin-f2cb9f9e.js → skin-05c9af11.js} +1 -1
  118. package/esm/{skin-1d3bf1bb.js → skin-0f3166df.js} +1 -1
  119. package/esm/{skin-3fa3b400.js → skin-24059b44.js} +1 -1
  120. package/esm/{skin-c51a3958.js → skin-3ff9d56b.js} +1 -1
  121. package/esm/skin-cc9a0b3a.js +1 -0
  122. package/esm/{skin-6520acf0.js → skin-d1f3257d.js} +1 -1
  123. package/esm/{start-begin-btn-8120ecdd.js → start-begin-btn-798fe08c.js} +1 -1
  124. package/esm/utilities/analytics.d.ts +3 -0
  125. package/esm/utilities/beacon.d.ts +3 -0
  126. package/esm/utilities/controlsColor.d.ts +1 -0
  127. package/esm/utilities/conviva.d.ts +5 -0
  128. package/esm/utilities/keyboardShortcuts.d.ts +5 -0
  129. package/esm/utilities/replaceMacros.d.ts +1 -0
  130. package/esm/{videoSelector-64c721c9.js → videoSelector-a12206bc.js} +1 -1
  131. package/esm/{videoSelector-7c82db41.js → videoSelector-f7c3d747.js} +1 -1
  132. package/package.json +1 -1
  133. package/cjs/autoNextVideo-d2ba145d.js +0 -1
  134. package/cjs/generic-377c0573.js +0 -1
  135. package/cjs/index-88dc9e09.js +0 -1
  136. package/cjs/index-94a30fd0.js +0 -1
  137. package/cjs/skin-ac9b0b26.js +0 -1
  138. package/esm/autoNextVideo-0cba47e8.js +0 -1
  139. package/esm/generic-e4833832.js +0 -1
  140. package/esm/index-7dec4239.js +0 -1
  141. package/esm/index-e1f939b0.js +0 -1
  142. package/esm/skin-e55951c5.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-377c0573.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./util-db87d399.js"),l=require("./captions-bf891620.js"),a=require("./resolution-9c4872ec.js"),u=require("./skin-9e714900.js"),s=require("./player_instance-fcf6a8fb.js"),c=require("./localisation-56e0a999.js"),d=require("@babel/runtime/helpers/typeof"),v=require("@babel/runtime/helpers/toConsumableArray"),f=require("@babel/runtime/helpers/slicedToArray"),p=require("./index-88dc9e09.js"),m=function(e){return new Promise(function(n,t){if(g(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}})},g=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},y=function(e,n,t){var r=s.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var o=parseFloat(n)/100;r.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},h=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},b=function(){var n=t(r.mark(function n(t){var i,l,a,u,c;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=s.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){n.next=22;break}return n.next=4,import("@silvermine/videojs-chromecast");case 4:return u=n.sent,n.prev=5,n.next=8,m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:n.next=13;break;case 10:n.prev=10,n.t0=n.catch(5),console.log("Error",n.t0);case 13:return n.prev=13,u.default(o),n.finish(13);case 16:(c=o.getTech("chromecast"))&&!c.prototype.seeking&&(c.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return n.stop()}},n,null,[[5,10,13,16]])}));return function(e){return n.apply(this,arguments)}}(),w=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,i,l,a,u=this.el(),s=o.dom.getPointerPosition(u,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*s,v.seek()}})};var k=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("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)}}(),S=function(){var e=t(r.mark(function e(){return r.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){o.getPlugin("eme")||o.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),O=function(){var e=t(r.mark(function e(){var n;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),P=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-84cce26a.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),I=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-0c89add5.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)}}(),T=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(o)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(o)})},loadAdsLibrary:k,loadEMELibrary:S,loadMuxPlugin:O,loadDvrSeekbar:P,loadContribDash:I});function j(e){return E.apply(this,arguments)}function E(){return(E=t(r.mark(function n(t){var o;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=(null==t?void 0:t.airplay)||!1,n.next=3,k();case 3:o&&"Safari"==e.detectBrowser()&&Promise.resolve().then(function(){return T}).then(function(e){e.importAirplay()});case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function D(e,n){return C.apply(this,arguments)}function C(){return(C=t(r.mark(function n(t,o){var i,l,a,u,s,c,d,v,f,p;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return d=(null==o?void 0:o.contentType)||"video",v=null==o||null===(i=o[d])||void 0===i?void 0:i.drmEnabled,null==o||null===(l=o[d])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,f=(null==o||null===(u=o[d])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(c=s.videoAssets)||void 0===c?void 0:c.dash)||null,n.prev=5,n.next=8,Promise.allSettled([v?"Safari"==e.detectBrowser()?S():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?I():S():"Safari"!=e.detectBrowser()&&f?I():null,b(t)]);case 8:n.next=13;break;case 10:n.prev=10,n.t0=n.catch(5),console.log("Error",n.t0);case 13:case"end":return n.stop()}},n,null,[[5,10]])}))).apply(this,arguments)}function A(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var L=new Set,R=null,N=function(n,t,r){var o,i,l,a,u,s,c,d={},v=(null==n?void 0:n.contentType)||"video";d["c3.cm.id"]=(null===(o=n[v])||void 0===o?void 0:o.id)||"Null",d["c3.cm.contentType"]=q(n),d[null==r||null===(i=r.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==n||!n.linearchannel),d[null==r||null===(l=r.Constants)||void 0===l?void 0:l.STREAM_URL]=t.currentSrc(),d[null==r||null===(a=r.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),d["c3.cm.categoryType"]=B(n),d["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"}}(),d.DRMEnabled=(null===(u=n[v])||void 0===u?void 0:u.drmEnabled)||"None",d.DAIStream=null!==(s=n[v])&&void 0!==s&&null!==(c=s.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[r.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=U(n),d["c3.cm.genreList"]=V(n),d["c3.cm.genre"]=M(n),d["c3.cm.channel"]=_(n);var f=G(e.getCurrentSeries(),n);return d=x(x({},d),f)},M=function(e){var n,t,r,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},V=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},_=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"VOD":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},B=function(e){return(null==e?void 0:e.contentType)||"null"},U=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},H=function(e,n){var t,r,o=(n||{}).epg;if(o&&null!=o&&o.enable&&null!=o&&o.programTitle)return o.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},q=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var F,Q,G=function(n,t){var r,o,i,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),c=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(o=r.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(i=n[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},K=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"}},W=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},z=function(){var n=t(r.mark(function n(t,o){var i,l,a,u,c,d,v,f,p,m;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,a=i.paymentHandler,u=i.tveProvider,c=i.enable,d=i.appName,v=(o||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(f=s.getPlayer(t),"function"==typeof(p=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(m=n.sent){n.next=13;break}return n.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=K(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var n,t;R&&R!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),L.clear(),R=f.currentSrc();var r=W(f.currentType()),i=e.getCurrentVideo(),l=N(i,f,m);l[null==m||null===(n=m.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",l[null==m||null===(t=m.Constants)||void 0===t?void 0:t.ASSET_NAME]=H(i,o),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=u||(a?"D2C":"FREE"),l["c3.cm.affiliate"]=u||"NULL",J.setData(l),p("contentInfo",l)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),f.on("play",function(){L.has(f.currentSrc())||(L.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){L.has(f.currentSrc())&&L.delete(f.currentSrc()),p("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==L||L.clear(),p("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}(),J=(F={},{setData:function(e){F=x(x({},F),e)},getData:function(){return F}}),X=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-710efb6a.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-207038f1.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-cd625772.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-b1e9a1d6.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-8fd50d98.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t&&Promise.resolve().then(function(){return require("./skin-ac9b0b26.js")}).then(function(t){t.initialiseSkin(e,n)})};function Y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Z=[],ee=0,ne=null;function te(t,r,o){var i,l,a,u,s,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(i=r.watchHistory)||void 0===i||i.apiVersion;var d=null==r||null===(l=r.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==r||null===(a=r.watchHistory)||void 0===a||a.xapiKey;var p=(null==r||null===(u=r.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==r||null===(s=r.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(t.currentTime()),y=c?100:Math.floor(v/f*100),h={};m?function(t,r,o){var i=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(o),l=re(i),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return $($({},e),{},n({},t,s[t]))},{}),d=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Q});d<0?l.push($($({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=$($($({},l[d]),t),{},{updateDate:a});localStorage.setItem("".concat(i),JSON.stringify(l))}(h={completed:c,watchedTime:g,watchedPercentage:y},d,r.siteOwner):(h=$($({videoId:Q,watchedTime:g,watchedPercentage:y,doneWatching:c,profileId:d},ne&&{seriesId:ne}),p&&{originalObjectId:p}),e.saveWatchHistory(h).then(function(e){}).catch(function(e){})),ee=v+o}function re(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function oe(e,n,t){var r=re(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return r&&Array.isArray(r)&&(o=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),o}var ie=!1,le=function(n,t){var r,o,i=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[i])||void 0===r||null===(o=r.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ie){var l=ae(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ie=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ae(e,n,t){if(Array.isArray(e))return e.map(function(e){return ae(e,n,t)});if(null!==e&&"object"===d(e)){var r={};return Object.keys(e).forEach(function(o){o===n&&void 0!==e[t]?r[o]=e[t]:o===t&&void 0!==e[n]?r[o]=e[n]:r[o]=ae(e[o],n,t)}),r}return e}function ue(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 se(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)?se(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function se(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ve=function(n,t,r,o){var i,a,u,c,v=o.res,f=o.sres,p=s.getPlayer(n),m=(null==v?void 0:v.contentType)||"video",g=(null==v?void 0:v[m].drmEnabled)||!1,h=(null==v||null===(i=v[m])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==v||null===(u=v[m])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.isDvrEnabled)||!1;e.setCurrentVideo(v),p&&(p.on("loadstart",function(){h?r.resolve({status:!0,msg:"Video Loaded",response:v}):r.resolve(de({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:v}:{response:v}))}),p.on("loadeddata",function(){var r,o,i,a=l.getCaptions(n);if(null==a||a.map(function(e){return l.disableCaptions(n,e.id)}),b&&"Safari"===e.detectBrowser())try{var u;null==p||null===(u=p.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==p||!p.muted())&&y(n,sessionStorage.getItem("volume")||"100");var c=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var d,f,m=de(de({},t),v);!function(e,n,t){var r,o,i;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(ne=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Z=[],ee=0,Q=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=s.getPlayer(e);a&&(a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Z.includes(ee)||(e==ee?(Z.push(e),te(a,n,l)):e>ee&&(ee=e+l))}}),a.one("ended",function(){te(a,n,l,!0)}))}(n,m,null==c||null===(d=c.video)||void 0===d||null===(f=d.gist)||void 0===f?void 0:f.id)}if(null!=t&&null!==(i=t.analytics)&&void 0!==i&&i.muxKey&&null!=p&&p.mux){var g,h,w,k,S,O,P=(null===(g=e.getCurrentVideo())||void 0===g?void 0:g.video)||(null==v?void 0:v.video),I=null==P?void 0:P.gist,T={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==I?void 0:I.id,video_title:null==I?void 0:I.title,video_series:null==P||null===(k=P.series)||void 0===k?void 0:k.title,video_stream_type:null!=P&&null!==(S=P.streamingInfo)&&void 0!==S&&S.isLiveStream?"live":"video",viewer_user_id:null==t||null===(O=t.analytics)||void 0===O?void 0:O.userId};p.mux({debug:!1,data:T})}}),p.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];p.trigger("subtitlechanged",n)}),p.on("subtitlechanged",function(e,n){var t,r,o,i,l,a,u,s,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(c=s.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,g=p.getMediaSession(),y=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),p.tech_.on("retryplaylist",function(){h&&le(v,n)}),p.on("error",function(){var t,o;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&h)?le(v,n):(e.handleError(n,(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==p||null===(o=p.error())||void 0===o?void 0:o.message)||"Some error occured",response:v}))}),p.one("play",function(){var n,r,o,i,l;if(null===(n=window)||void 0===n||null===(r=n.app_data)||void 0===r||null===(o=r.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var a,u,s,c=null===(a=e.getCurrentVideo())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,d=e.getSeriesWatchMap(),v=(null==d?void 0:d.get(c))||{t:0,p:0},f=v.t,m=v.p;f&&m<95&&setTimeout(function(){p.currentTime(f)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=p&&p.dvrSeekbar)try{p.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),p.on("volumechange",function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),p.on("chromecastDisconnected",function(){if(h){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}}),p.one("loadeddata",function(){var n,t=(null==p||null===(n=p.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0}),"object"==d(p.dash)){var r,o,i,l=null==p||null===(r=p.dash)||void 0===r||null===(o=r.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),a=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),u=ue(t);try{for(u.s();!(i=u.n()).done;){var s=i.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var c,v=ue(t);try{for(v.s();!(c=v.n()).done;){var f,m,y,h=c.value;if(("Chrome"==e.detectBrowser()||"Edge"==e.detectBrowser()&&(null!==(f=navigator)&&void 0!==f&&null!==(m=f.userAgent)&&void 0!==m&&m.includes("Macintosh")||!g))&&null!=h&&null!==(y=h.label)&&void 0!==y&&y.includes("5.1"))p.audioTracks().removeTrack(h);else{if("main"==h.kind){h.enabled=!0;break}h.enabled=!1}}}catch(e){v.e(e)}finally{v.f()}}}))};var fe,pe=(fe=!0,{enable:function(){fe=!0},disable:function(){fe=!1},get enabled(){return fe}}),me="ssai-breakStart",ge="ssai-adImpression",ye="ssai-firstQuartile",he="ssai-midpoint",be="ssai-thirdQuartile",we="ssai-complete",ke="ssai-breakEnd",Se={breakStart:me,impression:ge,firstQuartile:ye,midpoint:he,thirdQuartile:be,complete:we,breakEnd:ke};function Oe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=s.getPlayer(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var r=n.eventType,o=Se[r];o&&t.trigger(o,n)}function Pe(e){var n=s.getPlayer(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{adBreakStart:function(e){return t(me,e)},adImpression:function(e){return t(ge,e)},adFirstQuartile:function(e){return t(ye,e)},adMidpoint:function(e){return t(he,e)},adThirdQuartile:function(e){return t(be,e)},adComplete:function(e){return t(we,e)},adBreakEnd:function(e){return t(ke,e)}}}function Ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function je(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 Ee(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)?Ee(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Ee(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var De,Ce,Ae=(De="",{set:function(e){e&&(De=e)},get:function(){return De}}),xe=(Ce=null,{set:function(e){Ce=e},get position(){return Ce}});function Le(e,n){return Re.apply(this,arguments)}function Re(){return Re=t(r.mark(function n(t,o){var i,l,a,u,c,d,v,p,m,g,y,h,b,w;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return s.getPlayer(t),i=e.getSource(o,t),l=i.src,a=l.replace("/dash/","/session/").replace("master","session"),a=e.replaceMacros(a,t,o),u=Ne(a),c=f(u,2),d=c[0],v=c[1],a=new URL(a.split("?")[0]),Object.keys(v).length>0&&Object.entries(v).forEach(function(e){var n=f(e,2),t=n[0],r=n[1];a.searchParams.set(t,r)}),n.prev=8,n.next=11,fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:Te({},d)})});case 11:return p=n.sent,n.next=14,p.json();case 14:return m=n.sent,g="https://"+new URL(a).hostname,y=m.trackingUrl,h=m.manifestUrl,b=g+y,w=g+h,Ae.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),i.src=w,n.abrupt("return",i);case 26:return n.prev=26,n.t0=n.catch(8),n.abrupt("return",i);case 29:case"end":return n.stop()}},n,null,[[8,26]])})),Re.apply(this,arguments)}function Ne(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var r,o=je(t.split("&"));try{for(o.s();!(r=o.n()).done;){var i=r.value.split("="),l=f(i,2),a=l[0],u=l[1];n[decodeURIComponent(a)]=decodeURIComponent(u||"")}}catch(e){o.e(e)}finally{o.f()}for(var s={},c={},d=0,v=Object.entries(n);d<v.length;d++){var p=f(v[d],2),m=p[0],g=p[1];if(m.startsWith("ads."))s[m.replace(/^ads\./,"")]=g;else c[m]=g}return[s,c]}var Me,Ve=(Me=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),Me=Array.isArray(e)?v(e):Me},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",Me),v(Me)}});function _e(){return _e=t(r.mark(function n(o,i){var l,a,c,d,f,p,m,g,y,h,b,w,k,S,O,P,I;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:I=function(e,n,t,r,i,l){var a=s.getPlayer(o);if(!a.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(a.currentTime());var u,c=je(t);try{var d=function(){var t,s,c,d=u.value,v=d.eventType,f=d.beaconUrls,p=d.startTimeInSeconds,m=d.startTime,g=d.durationInSeconds,y=p||0,h=f,b=(null===(t=window)||void 0===t||null===(s=t.customData)||void 0===s||null===(c=s.ads)||void 0===c?void 0:c.adEventHandler)||null,w="".concat(y,"_").concat(v),k=O.get("pod-".concat(i))||[];if(console.warn(e,y,"map:",v,"condition1:",e>=y,"map:",O),e>=y&&!k.includes(w)){k.push(w),O.set("pod-".concat(i),k);try{P(v,n,h,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var S=xe.position;xe.set(null),setTimeout(function(){null!=S&&(a.currentTime(S),l())},500)}if("function"==typeof b)try{var I,T={eventType:v,startTimeInSeconds:p,startTime:m,durationInSeconds:g,ad:null==n||null===(I=n.ads)||void 0===I?void 0:I[r],adIndex:r};b({adsData:T}),Oe(o,T)}catch(e){console.error("Error when calling ads callback:",e)}}};for(c.s();!(u=c.n()).done;)d()}catch(e){c.e(e)}finally{c.f()}}},P=function(e,n,t,r){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},S=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},xe.set(i),f=Ae.get(),(p=s.getPlayer(o)).one("loadeddata",function(){f&&k(f)}),m=new Map,g=new Map,y=-1,h=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,b=(null==p||null===(c=p.controlBar)||void 0===c?void 0:c.getChild("videoSelector"))||null,w=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,k=function(){var n=t(r.mark(function n(t){var l,a,c,d,f,p,k,O,P,T,j,E,D,C,A,x,L;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return D=function(e){document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",D),0===e.button&&T()},E=function(e){},j=function(){var e,n=k.currentTime(),t=null,r=je(p);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=o.startTimeInSeconds,l=o.durationInSeconds,a=(o.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,m.set(i,!0))}}catch(e){r.e(e)}finally{r.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){k.currentTime(t+2.2)},100))},T=function(){var e,n=k.currentTime(),t=null,r=je(p);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=o.startTimeInSeconds,l=o.durationInSeconds,a=o.ads,u=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>u||n>i)&&!m.has(i)||n>=i&&n<=u)&&(t=i,m.set(i,!0),g.set(i,!0))}}catch(e){r.e(e)}finally{r.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){k.currentTime(t+.4)},100))},a=!1,n.next=7,fetch(t);case 7:return c=n.sent,n.next=10,c.json();case 10:d=n.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",d),f=d.avails,p=[],k=s.getPlayer(o),O=k.controlBar.progressControl,P=O.seekBar.el(),f.map(function(e,n){var t,r,o;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(a=!0),p.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(r=e.adBreakTrackingEvents)||void 0===r||null===(o=r.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===o?void 0:o[0])||[]})}),!a&&i&&(k.currentTime(i),j()),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p),console.log(p,"data"),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,r=k.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var o=n/r*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(o,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(o,"%"),i.style.pointerEvents="none",P.appendChild(i)}}),k.on("timeupdate",u.throttle(function(){var e=k.currentTime();if(e!==y){y=e;for(var n=!1,t=function(){var t=p[r],o=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=o+i;if(e>=o-1.2&&e<=a+1.2){e>=o&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&m.set(o,!0),pe.disable(),h&&h.classList.add("vjs-hidden"),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),O.el().style.visibility="hidden";for(var u=e-o,s=0,c=0,d=0;d<l.length;d++){var f,y=null==l||null===(f=l[d])||void 0===f?void 0:f.durationInSeconds;if(u<s+y){c=d;break}s+=y}l[c];var k=Math.max(0,i-u),P=Math.round(k);C.style.display="block",L.textContent="".concat(c+1," of ").concat(l.length," • ").concat(S(P));var T=[];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)});T.push.apply(T,v(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&T.push(null==t?void 0:t.podSlotImpressionBeacon),I(e,t,T,c,r,j),"break"}g.delete(o)},r=0;r<p.length;r++){if("break"===t())break}n||(C.style.display="none",O.el().style.visibility="visible",b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),h&&h.classList.remove("vjs-hidden"),pe.enable())}},1e3)),null===(l=document)||void 0===l||l.addEventListener("keydown",function(n){pe.enabled&&"ArrowRight"==n.key&&(T(),e.skip(o,10),n.stopPropagation())}),O.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",E),document.addEventListener("pointerup",D))}),(C=document.createElement("div")).className="ssai-ad-container",(A=document.createElement("div")).className="sponsored-adbox",(x=document.createElement("div")).className="sponsored-text",x.textContent="Sponsored Ad",A.append(x),(L=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",C.append(A),C.append(L),k.el().appendChild(C);case 41:case"end":return n.stop()}},n)}));return function(e){return n.apply(this,arguments)}}(),O=new Map;case 16:case"end":return n.stop()}},n)})),_e.apply(this,arguments)}function Be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var He=function(i,a,c,d){var v,f,m,g,y,h,b,k,S,O,P,I,T,j,E,C,A,x,L,R,N,M,V,_,B,U,H,q,F,Q,G,K,W,Y,$,Z,ee,ne,te=a.res,re=void 0===te?null:te,oe=a.sres,ie=void 0===oe?null:oe,le=null!=c&&c.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(v=re)||void 0===v?void 0:v.contentType)||"video",ue=u.impolicy16x9(null===(f=re)||void 0===f||null===(m=f[ae])||void 0===m||null===(g=m.gist)||void 0===g?void 0:g.videoImageUrl)||u.impolicy16x9(null===(y=re)||void 0===y||null===(h=y[ae])||void 0===h||null===(b=h.gist)||void 0===b||null===(k=b.imageGist)||void 0===k?void 0:k.r16x9),se=(null===(S=re)||void 0===S||null===(O=S[ae])||void 0===O||null===(P=O.liveDetails)||void 0===P?void 0:P.isDvrEnabled)||!1,ce=(null===(I=re)||void 0===I||null===(T=I[ae])||void 0===T||null===(j=T.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,de=(null===(E=re)||void 0===E||null===(C=E.ads)||void 0===C||null===(A=C.preRoll)||void 0===A||null===(x=A.adTags)||void 0===x||null===(L=x.web)||void 0===L?void 0:L.active)&&(null===(R=re)||void 0===R||null===(N=R.ads)||void 0===N||null===(M=N.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(_=V.web)||void 0===_?void 0:_.url),fe=(null===(B=re=Ue(Ue({},re),{},{audioAssetSource:null==c?void 0:c.audioAssetSource}))||void 0===B||null===(U=B[ae])||void 0===U?void 0:U.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(q=H.app_data)||void 0===q||null===(F=q.appcmsMain)||void 0===F||null===(Q=F.adsConfig)||void 0===Q?void 0:Q.vodAdSticherProvider)||!1,pe=(null==c?void 0:c.latency)||6,me=(null==c?void 0:c.skin_settings)||{},ge=(null==c?void 0:c.dvrConfig)||{enable:!1},ye=(ne={enableSmoothSeeking:!0,controls:0!=(null==c?void 0:c.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==c?void 0:c.muted)||!1,autoplay:(null==c?void 0:c.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==me?void 0:me.pictureInPictureToggle)||!1},playbackRates:null!=me&&me.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==c.skin,liveui:se},n(ne,"autoplay",null==c?void 0:c.autoplay),n(ne,"normalizeAutoplay",(null==c?void 0:c.autoplay)&&!de),n(ne,"loop",(null==c?void 0:c.loop)||!1),n(ne,"audioPosterMode",null==c?void 0:c.audioPosterMode),n(ne,"html5",Ue(Ue({dash:Ue(Ue(Ue({},!o.browser.IS_SAFARI&&{useTTML:!0}),(null==c?void 0:c.debugConfig)&&(null==c||null===(G=c.debugConfig)||void 0===G?void 0:G.enable)&&{debug:!0,logLevel:null!=c&&null!==(K=c.debugConfig)&&void 0!==K&&K.logLevel?null==c||null===(W=c.debugConfig)||void 0===W?void 0:W.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:pe},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Ue(Ue({liveRangeSafeTimeDelta:pe,useDevicePixelRatio:!0,experimentalLLHLS:(null==c?void 0:c.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==c||null===(Y=c.customData)||void 0===Y?void 0:Y.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==c?void 0:c.enableLowInitialPlaylist)||void 0===$||$}),debug:!0,nativeTextTracks:"Safari"==e.detectBrowser()},0==(null==c||null===(Z=c.customData)||void 0===Z?void 0:Z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==c||null===(ee=c.customData)||void 0===ee?void 0:ee.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(ne,"poster",ue),n(ne,"techOrder",le),n(ne,"chromecast",{requestCustomDataFn:function(e){var n,t,r=s.getPlayer(i),o=((null==r?void 0:r.textTracksJson_)||r.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),l=function(e,n,t){var r,o,i,l,a,u,s,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,y,h,b,w,k,S;p.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,P=(null==O?void 0:O.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);p.licenseUrl=P;var I=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=I}var T=(null==e||null===(r=e[f])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";p.contentType=T;var j=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=j;var E=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=E;var D=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(re,e,o);return Ue(Ue({},l),{},{convivaMetaData:Ue({customerKey:(null==c||null===(n=c.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==c||null===(t=c.convivaConfig)||void 0===t?void 0:t.debug)||!1},J.getData())})},modifyLoadRequestFn:function(e){var n,t,r,o,l,a=s.getPlayer(i),u=(null==a?void 0:a.currentSource())||{};!(null===(n=re)||void 0===n||null===(t=n[ae])||void 0===t||null===(r=t.streamingInfo)||void 0===r||null===(o=r.videoAssets)||void 0===o?void 0:o.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ne);if(!o.getPlayers()[i]){o.log.level("debug");var he=o(i,ye,function(){var n=t(r.mark(function n(){var t,a,u,s,v,f,m,g,y,h,b,k,S,O,P,I,T,j,E,C,A,x,L;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(he),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,D(c,re);case 5:if(k=null===(t=re)||void 0===t||null===(a=t[ae])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&d.resolve(Ue({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:re}:{response:re})),S={},null!=ge&&ge.enable&&se&&(S.playFromBegining=ge.playFromBegining,S.playLive=ge.playLive,P=null==c||null===(O=c.epg)||void 0===O?void 0:O.programSubType,"linearchannel"===ae?"LIVE"===(null==P?void 0:P.toUpperCase())&&p.addDvrOverlay(i,c):p.addDvrOverlay(i,c)),e.inititateBeacon(i,null==c?void 0:c.analyticsCb,S),z(i,c),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),se&&w(i,k),!de||null!=c&&null!==(s=c.customData)&&void 0!==s&&s.disableAds||e.initialiseAdvertisement(i,de,re),I=e.getSource(re,i),console.log(I),null!=c&&c.nearestClusterUrl&&(I=e.getUpdatedClusterSource(I,c.nearestClusterUrl)),!fe){n.next=21;break}return n.next=20,Le(i,re);case 20:I=n.sent;case 21:I?e.loadVideo(i,I):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:re}),e.handleError(i,"Incompatible / Missing Source")),((null===(v=re)||void 0===v||null===(f=v[ae])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=re)||void 0===y||null===(h=y[ae])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(L=(null===(j=re)||void 0===j||null===(E=j[ae])||void 0===E||null===(C=E.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(A=re)||void 0===A||null===(x=A[ae])||void 0===x?void 0:x.closedCaptions),T=L.filter(function(e){return"VTT"===e.format}),l.addCaptions(i,T)),null!=c&&c.disableControls?e.disableControls(i):X(i,Ue(Ue(Ue({},c),ye),{},{liveVideo:ce,isDvrEnabled:se,res:re,sres:ie})),ve(i,Ue(Ue(Ue({},c),ye),{},{liveVideo:ce}),d,{res:re,sres:ie});case 25:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}},qe={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ge,Ke=function(e,n){var t=n.resolve,r=n.reject,o=null==e?void 0:e.playerId,i=We(e);He(o,{res:i},e,{resolve:t,reject:r})},We=function(n){var t,r,o,i,l,a,u,s,c=null==n?void 0:n.streamingInfo,d=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,f=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isDrmEnabled)||null,p=(null==n||null===(o=n.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,m=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,g=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],y=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,h=null==n?void 0:n.token,b=e.getDecodedToken(h),w=null==b?void 0:b.site;return Qe(Qe({id:null==qe?void 0:qe[w]},!f&&{directPlaybackUrl:null==d?void 0:d.url}),{},{video:{drmEnabled:f,streamingInfo:{videoAssets:Qe(Qe({},y&&{drmProvider:y}),{},{widevine:null==d?void 0:d.widevine,fairPlay:null==d?void 0:d.fairPlay,playReady:null==d?void 0:d.playReady})},liveDetails:{isDvrEnabled:null==c?void 0:c.isDvrEnabled},gist:Qe({},m&&{videoImageUrl:m}),contentDetails:Qe({},(null==g?void 0:g.length)>0&&{closedCaptions:v(g)})},ads:{preRoll:{adTags:{web:Qe(Qe({},p&&{active:!0}),p&&{url:p})}}}})};function ze(e,n){return Je.apply(this,arguments)}function Je(){return(Je=t(r.mark(function n(t,o){var i,l,a,u,s,c;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,a=null==t?void 0:t.videoId,u=null==t?void 0:t.playerId,s=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then(function(n){var r,o,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(d=o.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var f,p=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!s)if((null===(f=t.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,g,y,h=oe((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(g=h[0])||void 0===g?void 0:g.watchedTime)||null,t.watchedPercentage=(null===(y=h[0])||void 0===y?void 0:y.watchedPercentage)||null;p.contentType="video",He(u,{res:p},t,{resolve:i,reject:l})}else e.getVideoInfo(a,c).then(function(e){var n,r,o,i,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,r,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(o=r.watchHistory)||void 0===o||o.cb(e))}).finally(function(){He(u,{res:p},t,{resolve:i,reject:l})});else He(u,{res:p},t,{resolve:i,reject:l})}).catch(function(n){e.initiateErrorHandling(n,u,l,a)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Xe(e,n){return Ye.apply(this,arguments)}function Ye(){return(Ye=t(r.mark(function n(t,o){var i,l,a,u,s;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,n.next=3,e.getToken();case 3:a=n.sent,u=null==t?void 0:t.playerId,s=null==t?void 0:t.epg,e.getLinearChannelDetails(s,a).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==s?void 0:s.channelId,He(u,{res:n},t,{resolve:i,reject:l})}).catch(function(n){e.initiateErrorHandling(n,u,l,videoId)});case 7:case"end":return n.stop()}},n)}))).apply(this,arguments)}function $e(e,n){return Ze.apply(this,arguments)}function Ze(){return(Ze=t(r.mark(function n(t,o){var i,l,a,u,s,c,d;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=o.resolve,a=o.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(i=t.series)||void 0===i?void 0:i.id,e.getSeriesDetails(d,u).then(function(n){var r,o,i,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var f=videoId||(null==v||null===(r=v[0])||void 0===r||null===(o=r.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);e.createSeriesWatchMap(d,u),e.getVideoDetails(f,u).then(function(n){var r,o,i;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,e.setCurrentVideo(n.data),He(s,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function en(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function nn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?en(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,onVideoEnded:i.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=t(r.mark(function t(o,i){var l,a,s,d,v,f,p,g,y,h,b,w,k,S,O,P,I,T,E,D,C,A,x;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(b=(null==n?void 0:n.videoSourceUrl)||!1,w=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,S=null==n?void 0:n.videoId,O=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,P=(null==n?void 0:n.streamingInfo)||!1,window.videoId=S,I=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",I),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),I&&!e.isTokenExpired(I)){t.next=16;break}return i({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}}),t.abrupt("return");case 16:Ge=JSON.parse(atob(I.split(".")[1]));case 17:return n.isAnonymousUser=!(null===(s=Ge)||void 0===s||!s.anonymousId),n.siteOwner=(null===(d=Ge)||void 0===d?void 0:d.site)||null,n.userId=(null===(v=Ge)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=Ge)||void 0===f?void 0:f.userId),window.watchHistory=n.watchHistory||null,T=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(p=n.series)&&void 0!==p&&p.enable?null:null==n?void 0:n.chromecastReceiverId,E=(null==n||null===(g=n.analytics)||void 0===g?void 0:g.gaId)||null,(D=null==n?void 0:n.errors)&&(window.customErrors=D),window.customData=null==n?void 0:n.customData,c.setLocalisation(null==n||null===(y=n.customData)||void 0===y?void 0:y.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=33,j(n);case 33:E&&m("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then(function(){return e.runGtag(E)}).catch(function(e){}),(C=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(T)))&&C.addEventListener("contextmenu",function(e){return e.preventDefault()}),b?(x={directPlaybackUrl:b,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?e.getVideoDetails(A,I).then(function(e){var t=(null==e?void 0:e.data)||{};He(T,{res:nn(nn({},t),x)},n,{resolve:o,reject:i})}).catch(function(n){e.initiateErrorHandling(n,T,i,A)}):He(T,{res:x},n,{resolve:o,reject:i})):P?Ke(n,{resolve:o,reject:i}):O?$e(n,{resolve:o,reject:i}):k?Xe(n,{resolve:o,reject:i}):ze(n,{resolve:o,reject:i});case 37:case"end":return t.stop()}},t)}));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:i.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:h,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:Ve,getSsaiEvents:Pe,playerEvents:i.playerEvents}},exports.initialiseKeyboardEvents=function(n,t){var r,o,i,l=s.getPlayer(n),a=null==l||null===(r=l.controlBar)||void 0===r||null===(o=r.playToggle)||void 0===o?void 0:o.el_,u=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(r){var o,i,s,c,d,v,f,p,m;if(pe.enabled&&"input"!=r.target.localName){var g=r.key,y=!0===t.liveVideo||!0===t.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(g)&&(r.preventDefault(),null==u||u.focus()),g){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":y&&!1===t.liveui||e.rewind(n,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(s=i.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(d=c.adsConfig)||void 0===d?void 0:d.vodAdSticherProvider)&&null!==(v=window)&&void 0!==v&&null!==(f=v.app_data)&&void 0!==f&&null!==(p=f.appcmsMain)&&void 0!==p&&null!==(m=p.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;y||e.skip(n,10)}}},!0)},exports.setupAdvertisementMarkers=function(e,n){return _e.apply(this,arguments)};
@@ -1 +0,0 @@
1
- "use strict";var e=require("./features-b9518c47.js"),r=require("./player_instance-fcf6a8fb.js"),i=require("./index-62222a39.js"),l=require("./generic-377c0573.js");require("videojs-contrib-quality-menu");var n=require("video.js"),t=require("@babel/runtime/helpers/asyncToGenerator"),a=require("@babel/runtime/regenerator"),o=require("./index-94a30fd0.js"),u=require("./icons-79591410.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./resolution-9c4872ec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/assertThisInitialized"),require("./skin-9e714900.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-d2ba145d.js"),require("./util-db87d399.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./captions-bf891620.js"),require("video.js/dist/video-js.min.css"),require("./index-88dc9e09.js");var d={markerStyle:{width:"5px","background-color":"red"},markerTip:{display:!1,text:function(e){return e.title},time:function(e){return e.time}},onMarkerClick:function(e){},markers:[],duration:0};function s(){return(s=t(a.mark(function e(i,l){var n,t,o,u,d,s;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=r.getPlayer(i),(t=n.seekable())&&t.length>0&&(o=t.start(0),u=t.end(t.length-1),d=u-o,n.markers({markerStyle:{width:"4px","background-color":"#576478"},markerTip:{display:!1},duration:d||0}),n.markers.initializeMarker(),s=v(l,d),n.markers.add(s));case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function v(e,r){var i=(new Date).getTime(),l=new Date(i-1e3*r).getTime();return e.filter(function(e){var r=new Date(e.startDate).getTime();return r>=l&&r<=i}).map(function(e){var r=new Date(e.startDate).getTime()-l;return{key:e.programId,title:e.title,time:r/1e3}})}function c(n,t){var a=r.getPlayer(n);a&&(a.on("loadeddata",function(){var e,o,u,d,v,c,p,m=(null==t||null===(e=t.dvrConfig)||void 0===e?void 0:e.programs)||[];a.qualityLevels()&&a.qualityLevels().length&&function(e){var i=r.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(n),!(null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable||null!==(u=window)&&void 0!==u&&null!==(d=u.app_data)&&void 0!==d&&null!==(v=d.appcmsMain)&&void 0!==v&&null!==(c=v.features)&&void 0!==c&&c.auto_play)||null!=t&&t.liveVideo||i.addNextEpPreview(n,t),null!=t&&t.liveVideo||l.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||i.initiateTrickplay(n),null!=t&&null!==(p=t.dvrConfig)&&void 0!==p&&p.enable&&m&&m.length&&function(e,r){s.apply(this,arguments)}(n,m)}),a.one("play",function(){var r,i,l,t;null!==(r=window)&&void 0!==r&&null!==(i=r.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(n,null===(l=window)||void 0===l||null===(t=l.customData)||void 0===t?void 0:t.iframeOverlayUrl)}))}n.registerPlugin("markers",function(e){var r=n.mergeOptions(d,e),i={},l=[],t=this,a=null;function o(){l.sort(function(e,i){return r.markerTip.time(e)-r.markerTip.time(i)})}function u(e){e.forEach(function(e){t.el().querySelector(".vjs-progress-holder").appendChild(function(e){var l=n.dom.createEl("div",{},{"data-marker-key":e.key,"data-marker-time":r.markerTip.time(e)});return v(e,l),l.addEventListener("click",function(l){var n=!1;if("function"==typeof r.onMarkerClick&&(n=!1===r.onMarkerClick(e)),!n){var a=this.getAttribute("data-marker-key");t.currentTime(r.markerTip.time(i[a]))}}),r.markerTip.display&&function(e){e.addEventListener("mouseover",function(){var l=i[e.getAttribute("data-marker-key")];a&&(r.markerTip.html?a.querySelector(".vjs-tip-inner").innerHTML=r.markerTip.html(l):a.querySelector(".vjs-tip-inner").innerText=r.markerTip.text(l),a.style.left=s(l)+"%",a.style.visibility="visible")}),e.addEventListener("mouseout",function(){a&&(a.style.visibility="hidden")})}(l),l}(e)),i[e.key]=e,l.push(e)}),o()}function s(e){return r.markerTip.time(e)/r.duration*100}function v(e,i){i.className="vjs-marker ".concat(e.class||""),Object.keys(r.markerStyle).forEach(function(e){i.style[e]=r.markerStyle[e]});var l=e.time/r.duration;(l<0||l>1)&&(i.style.display="none");var n=s(e);n>=99.5&&(n=99.5),i.style.left=n+"%"}t.markers={getMarkers:function(){return l},initializeMarker:function(){a=n.dom.createEl("div",{className:"vjs-tip",innerHTML:"<div class='vjs-tip-arrow'></div><div class='vjs-tip-inner'></div>"}),t.el().querySelector(".vjs-progress-holder").appendChild(a)},add:function(e){u(e)},update:function(e,i){!function(e,i){e.forEach(function(e){var l=t.el().querySelector(".vjs-marker[data-marker-key='"+e.key+"']"),n=r.markerTip.time(e);l?(i||l.getAttribute("data-marker-time")!==n)&&(v(e,l),l.setAttribute("data-marker-time",n)):u([e])}),o()}(e,i)}}});var p=function(e,i){var l,t,a,o,u,d,s,v,c,p,m,y,k=r.getPlayer(e),g=(null==i?void 0:i.theme)||{},f=n.dom.$(".vjs-play-progress"),b=n.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.style.color="".concat(null===(l=window)||void 0===l||null===(t=l.app_data)||void 0===t||null===(a=t.appcmsMain)||void 0===a||null===(o=a.brand)||void 0===o||null===(u=o.cta)||void 0===u||null===(d=u.primary)||void 0===d?void 0:d.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(c=v.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(y=m.primary)||void 0===y?void 0:y.backgroundColor));var h=k.getChild("BigPlayButton")||null;(null==g?void 0:g.progressBarColor)&&f&&(f.style.background=g.progressBarColor),(null==g?void 0:g.playButtonBackgroundColor)&&h&&(h.el().style.background=g.playButtonBackgroundColor),(null==g?void 0:g.playButtonColor)&&b&&(b.style.color=g.playButtonColor),(null==g?void 0:g.playButtonType)&&("square"==(null==g?void 0:g.playButtonType)?h.el().style.borderRadius=".3em":h.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(n,t){r.getPlayer(n).addClass("skin_vlone"),c(n,t),function(r,n){var t,a,d,s,v,c,p,m,y,k,g,f,b,h,q,j=(null==n||null===(t=n.res)||void 0===t||null===(a=t.video)||void 0===a?void 0:a.isSSAIEnabled)||!1,T=l.getSource(null==n?void 0:n.res,r)||{};T.src;var w=(null==n?void 0:n.skin_settings)||{};null!=w&&w.skipBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(r,"VL_ONE",u.SkipSvgV2());(null!=w&&w.rewindBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(r,"VL_ONE",u.RewindSvgV2());(null==n||null===(d=n.relatedVideos)||void 0===d||null===(s=d.content)||void 0===s?void 0:s.length)>0&&e.addVideoSelector(r,null==n?void 0:n.relatedVideos);null!=n&&null!==(v=n.series)&&void 0!==v&&v.enable&&e.addSeriesSelectorV2(r,n);(null==n||null===(c=n.streams)||void 0===c?void 0:c.length)>1&&e.addMulticamSelector(r,null==n?void 0:n.streams);if(i.addTVProviderImage(r,n),o.initialiseKeyboardEvents(r,n),"MEDIA_TAILOR"==(null===(p=window)||void 0===p||null===(m=p.app_data)||void 0===m||null===(y=m.appcmsMain)||void 0===y||null===(k=y.adsConfig)||void 0===k?void 0:k.vodAdSticherProvider)&&null!==(g=window)&&void 0!==g&&null!==(f=g.app_data)&&void 0!==f&&null!==(b=f.appcmsMain)&&void 0!==b&&null!==(h=b.adsConfig)&&void 0!==h&&h.vodAdClientSideTracking&&j){var C,S=null;if(null!=n&&null!==(C=n.series)&&void 0!==C&&C.enable){var M,B,E,V=null===(M=l.getCurrentVideo())||void 0===M||null===(B=M.video)||void 0===B||null===(E=B.gist)||void 0===E?void 0:E.id,x=l.getSeriesWatchMap(),P=(null==x?void 0:x.get(V))||{t:0,p:0},A=P.t;P.p<95&&(S=A)}else{var L=n.watchHistoryResumeTime;n.watchedPercentage<95&&(S=L)}o.setupAdvertisementMarkers(r,S)}null!=n&&null!==(q=n.dvrConfig)&&void 0!==q&&q.enable&&null!=n&&n.isDvrEnabled&&(e.addStartFromBeginningButton(r,n),e.addWatchLiveButton(r,n))}(n,t),p(n,t)};
@@ -1 +0,0 @@
1
- import{I as n,h as t,T as i,S as o,U as e}from"./generic-e4833832.js";import{a}from"./util-9649ae40.js";import{h as s}from"./skin-16f83185.js";import{g as c}from"./player_instance-34118a5b.js";var r,u=0,f=0,l=function(l){clearTimeout(u);var p=null==l?void 0:l.content;r=null==l?void 0:l.cb;var v=l.playerId;a(v,function(){var a=c(v);0!==(null==a?void 0:a.currentTime())&&((f=o())>p.length-1||(e(f+1),n(v,p[f].id).then(function(n){s(f,v),t(n.response),f++,h(n)}).catch(function(n){h(n),s(f,v),f++,u=setTimeout(function(){i(v)&&m(f,v,p)},5e3)})))})},m=function t(i,o,a,c){f=i,i>a.length-1||(e(f+1),n(o,a[i].id).then(function(n){s(f,o),f++,h(n)}).catch(function(n){h(n),setTimeout(function(){s(f,o),f++,t(f,o,a)},5e3)}))},h=function(n){r&&r(n)};export{l as a,m as s};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r}from"./player_instance-34118a5b.js";import a from"js-cookie";import{UAParser as l}from"ua-parser-js";import{a as d,r as u}from"./captions-b619441b.js";import{c as s}from"./skin-16f83185.js";function c(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function v(e){window.dataLayer=window.dataLayer||[],c("js",new Date),c("config",e)}function m(e,n){c("event",e,n)}var f={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function w(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?p(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):p(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var I={name:"@viewlift/player-backup",version:"2.0.116-backup",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=I.version;var E,g=function(e,n){var t,i,r,a,l,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(l=window)&&void 0!==l&&null!==(d=l.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":O.get()+"".concat(null==f?void 0:f.getVideoDetails),params:w({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":I.version},withCredentials:!0})},T=function(e,n){var t,i,r,a;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:O.get()+f.getLinearChannelDetails,params:w(w(w(w(w({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===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},h=function(e,n){var t,i,r=M(n),a=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):o({url:O.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},y=function(){var e=n(t.mark(function e(n){var i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return i=e.sent,e.abrupt("return",o({url:O.get()+"".concat(null==f?void 0:f.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:w({},n),params:w({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),_=function(e,n){var t,i,r=window.contentType;return o({method:"GET",url:O.get()+"".concat(null==f?void 0:f.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},b=function(e){var n=e.videoId;return o({method:"GET",url:O.get()+"".concat(null==f?void 0:f.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},O=(E=null==f?void 0:f.apiBaseUrl,{set:function(e){e&&(E=e)},get:function(){return E}}),F=function(e,n,t,i){return o({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},D=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},R=null;function S(){return{set:function(e){e&&(R=e)},get:function(){return R}}}var P,L,A,W,V,C,N=function(){var e=n(t.mark(function e(){var n,i,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=S().get(),i=O.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/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)}}(),B=null,U=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!D(n)){e.next=6;break}return B||(B=N().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&S().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){B=null})),e.abrupt("return",B);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),j=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},M=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},k=function(e){L=e},x=function(){return L},H=function(e){P=e},G=function(){return P},Y=function(){return A},z=function(e){A=e},q=function(){return V},X=function(e){W=new Map,e.map(function(e,n){W.set(e.id,n)})},J=function(e){if(W){var n=W.get(e);z(n+1)}},K=(C=0,{set:function(e){e>=0&&(C=e)},get:function(){return C}});function Q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Z(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Q(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var $=0,ee=function(){var e,n,t,i,o,r,a,l=x();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)};function ne(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function te(){var e=window.sessionStorage.getItem("uid");return e||(e=ne(),window.sessionStorage.setItem("uid",e),e)}function ie(){return oe.apply(this,arguments)}function oe(){return(oe=n(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function re(e){return e?String(e):""}window.initialise=function(e){window.sid=ne(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,m(r?"FAILED_TO_START":"DROPPED_STREAM",Z({pfm:window.platform,uid:te(),vid:ee(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),m("PLAY",Z({pfm:window.platform,uid:te(),vid:ee(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":ee(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&$<4)$++,m("BUFFERING",Z({pfm:window.platform,uid:te(),vid:ee(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,m("FIRST_FRAME",Z({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:ee()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,i,o,r,a;m("AD_REQUEST",Z({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:ee(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),m("AD_IMPRESSION",Z({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:ee()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&($=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(ae(n,r,a)){var l=Math.round(t-a);if(isFinite(l))return l}}})()};var ae=function(e,n,t){return e>=n&&e<=t};function le(e,n,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var i=r(e);window.initialise(i,n),window.firstFrame(i,n),null!=t&&t.playFromBegining&&function(e){fireEvent({eventName:"START_FROM_BEGINNING",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0})}(i),null!=t&&t.playLive&&function(e){fireEvent({eventName:"WATCH_LIVE",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0})}(i),i.on("loadedmetadata",function(){window.endFirstFrame(i)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var i,r,a,l,d,u,s,c,v,m,p,w,I,E,g,T,h,y,_,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return T=e.sent,h=M(T),y=null==h?void 0:h.site,_=null==h?void 0:h.siteId,e.t0=Z,e.t1=Z,e.t2=Z({aid:y,cid:_,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=te(),e.t5=ee(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(l=n.videoPosition)&&void 0!==l?l:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?re(n.adPosition):"",e.next=26,ie();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(w=p.beacon)||void 0===w?void 0:w.params,e.t31=(0,e.t0)(e.t29,e.t30),b=[e.t31],o({url:(null===(I=window)||void 0===I||null===(E=I.customData)||void 0===E||null===(g=E.beacon)||void 0===g?void 0:g.url)||O.get()+f.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de=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"},ue=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},se=function(e,n){var t=new Map;b({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),V=t}).catch(function(e){return console.log(e)})},ce=function(){var e=K.get();return e>=0?e+1:1},ve=function(){var e,n,t,i=G(),o=x(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=K.get(),l=null==i||null===(n=i[a])||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 l>=0?l+1:1};function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function fe(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?me(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):me(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}window._deviceInfo=l(navigator.userAgent);var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},we=function(e){var n=Ie(e,"video.tags",[]),t=Ie(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ie=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},Ee=function(){var n,t,i,o,l,d,u,s,c,v,m,f,p,w,I,E,g,T,h,y,_,b,O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",F=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0,R=(null==D?void 0:D.siteName)||"",S=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(n=D[S])||void 0===n?void 0:n.metadata)||(null==D||null===(t=D[S])||void 0===t||null===(i=t.gist)||void 0===i?void 0:i.metadata),L=r(F);if(!O.includes("VIEWLIFT_"))return O;var A,W=window.getComputedStyle(document.getElementById(F),null),V=Math.trunc(W.getPropertyValue("height").slice(0,-2)),C=Math.trunc(W.getPropertyValue("width").slice(0,-2)),N="linearchannel"===S?null==D||null===(o=D.linearchannel)||void 0===o||null===(l=o.channels)||void 0===l||null===(d=l.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===d||null===(u=d.content)||void 0===u?void 0:u.id:Ie(D,"video.gist.id",""),B="linearchannel"===S?null==D||null===(s=D.linearchannel)||void 0===s||null===(c=s.channels)||void 0===c||null===(v=c.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===v?void 0:v.title:Ie(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,j=null;"function"==typeof window.__gpp&&(null===(A=window)||void 0===A||A.__gpp("ping",function(e){U=null==e?void 0:e.gppString,j=null==e?void 0:e.sectionList[0]}));var M=fe(fe({},ge(P)),{},(y={VIEWLIFT_WIDTH:C,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:pe(C,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(m=window)||void 0===m?void 0:m.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ie(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ie(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ie(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==L||null===(f=L.options_)||void 0===f?void 0:f.autoplay)||1,VIEWLIFT_MUTE:(null==L||null===(p=L.options_)||void 0===p?void 0:p.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==R||"usanetwork"==R?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:we(D),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ie(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ie(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ie(null===(w=window)||void 0===w||null===(I=w.app_data)||void 0===I||null===(E=I.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==R||"usanetwork"==R?"":Ie(null===(g=window)||void 0===g||null===(T=g.app_data)||void 0===T||null===(h=T.site)||void 0===h?void 0:h.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Ie(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ie(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:B,VIEWLIFT_CONTENT_SERIES_TITLE:Ie(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ie(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:we(D),VIEWLIFT_GPP_SID:j||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(y,"VIEWLIFT_LAT",""),e(y,"VIEWLIFT_APP_BUNDLE",""),e(y,"VIEWLIFT_ATT_CONSENT",""),y),null===(_=window)||void 0===_||null===(b=_.customData)||void 0===b?void 0:b.macros);for(var k in M){var x=new RegExp(k,"g");O=O.replace(x,M[k])}return O},ge=function(e){var n,t,i,o,r,a,l={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return u||s?(ue()?u?l=fe(fe({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(l=fe(fe({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?l=fe(fe({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(l=fe(fe({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?l=fe(fe({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(l=fe(fe({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),l=ue()?fe(fe({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):fe(fe({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=fe(fe({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),l=ue()?fe(fe({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):fe(fe({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l=fe(fe({},l),{},{VIEWLIFT_AFID:d.get("afid")})},Te=function(e,n){var t,i,o,r,a,l,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",w=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(i=e[p])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[p])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,g=(null==e||null===(l=e[p])||void 0===l||null===(d=l.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var T=(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 ye(E);if(w){var h=_e(I,n);return h.src=Ee(h.src,n,e),h}if("Safari"!==de()&&T)return he(I);if(g){var y=ye(I);return y.src=Ee(y.src,n,e),y}if(null!=I&&I.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return _.src=Ee(_.src,n,e),_}return null},he=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ye=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},_e=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,o=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,d=de();if(r(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,o,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(o);return be(n),u}var s,c={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(be(n),c.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var be=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==de()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Oe=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},Fe=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},De=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Re=!1,Se=function(e,n,t){var i=Ee(n,e,t),o=r(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,a=r(e);if(null!==a.el_){Re=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Re&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout(function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),a.one(u,function(){s&&a.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;a.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),a.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),a.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var Le=function(e){i(e).play()},Ae=function(e){i(e).pause()},We=function(e,n){var t=i(e),o=t.currentTime()+n;t.currentTime(o)},Ve=function(e,n){var t=i(e),o=t.currentTime(),r=o<=n?0:o-n;t.currentTime(r)},Ce=function(e){return!!i.getPlayer("".concat(e))},Ne=function(e){return i(e).paused()},Be=function(){var e=n(t.mark(function e(n,i){var o,a,l,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,U();case 3:return a=e.sent,l=r(n),e.abrupt("return",new Promise(function(e,t){T(i,a).then(function(t){var r=null==t?void 0:t.data;window.sid=ne(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=Te(r,n);k(r),a&&o?(xe(n,a),l.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})})):e({status:!0,msg:"Feed authenticated",response:r})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark(function e(n,i,o){var a,l,s,c,v,m;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return c=e.sent,(G()||null)&&J(i),v=0,m=0,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(s=l.watchHistory)&&void 0!==s&&s.enable&&_(i,c).then(function(e){var n,t,i,o,r,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),v=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,m=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){g(i,c).then(function(i){var o,a,l,s,c,f,p,w,I,E,g=null==i?void 0:i.data,T=(null==g||null===(o=g.video)||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;k(i.data);var h=(null==g||null===(l=g.ads)||void 0===l||null===(s=l.preRoll)||void 0===s||null===(c=s.adTags)||void 0===c||null===(f=c.web)||void 0===f?void 0:f.active)&&(null==g||null===(p=g.ads)||void 0===p||null===(w=p.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(E=I.web)||void 0===E?void 0:E.url);h&&Se(n,h,g);var y=Te(g,n);if(y){var _,b,O,F,D,R,S,P,L,A,W,V,C,N,B=(null==g||null===(_=g.video)||void 0===_||null===(b=_.gist)||void 0===b?void 0:b.videoImageUrl)||(null==g||null===(O=g.video)||void 0===O||null===(F=O.gist)||void 0===F||null===(D=F.imageGist)||void 0===D?void 0:D.r16x9),U=r(n);if(U.poster(B),xe(n,y),U.on("loadstart",function(){T&&e({status:!0,msg:"Video Loaded",response:g})}),U.on("loadeddata",function(){De(),e({status:!0,msg:"Video Loaded",response:g})}),U.one("play",function(){v&&m<95&&setTimeout(function(){U.currentTime(v)},0)}),U.one("error",function(){var e;t({status:!1,msg:(null==U||null===(e=U.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==g||null===(R=g.video)||void 0===R||null===(S=R.contentDetails)||void 0===S||null===(P=S.closedCaptions)||void 0===P?void 0:P.length)>0||(null==g||null===(L=g.video)||void 0===L||null===(A=L.closedCaptions)||void 0===A?void 0:A.length)>0)W=((null==g||null===(V=g.video)||void 0===V||null===(C=V.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==g||null===(N=g.video)||void 0===N?void 0:N.closedCaptions)).filter(function(e){return"VTT"===e.format}),d(n,W);else u(n)}else Fe(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){He(e,n,t,i)})}));case 9:case"end":return e.stop()}},e)}));return function(n,t,i){return e.apply(this,arguments)}}(),je=function(e,n,t){var i=r(e);return i.src(n),new Promise(function(e,n){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Me=function(e){var n=r(e);if(ke(),s(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},ke=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()},xe=function(e,n){var t=r(e);t&&t.src(n)},He=function(n,t,i,o){var r,a,l,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Ce(t)&&Fe(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Pe(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},Ge=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{h as A,se as B,K as C,H as D,je as E,Le as F,Ae as G,Ce as H,Ue as I,Be as J,Me as K,F as L,O as M,j as N,S as O,D as P,v as Q,ue as R,Y as S,Ne as T,z as U,b as V,X as W,J as X,ve as a,G as b,ce as c,de as d,x as e,Te as f,te as g,k as h,De as i,Fe as j,q as k,xe as l,We as m,Ee as n,Ge as o,le as p,Se as q,Ve as r,y as s,Oe as t,M as u,g as v,_ as w,He as x,U as y,T as z};
@@ -1 +0,0 @@
1
- import{g as e}from"./player_instance-34118a5b.js";import{w as n,s as t}from"./icons-c139587c.js";function o(o,l){var u=l.dvrConfig,s=l.videoId,d=(l.userId,(null==u?void 0:u.buttonConfig)||{}),v=d.watchLive,b=d.resume,f=d.startFromBegining,m=(null==u?void 0:u.programs)||[],g=e(o),h=(null==u?void 0:u.playLive)||!1,k=(null==u?void 0:u.playFromBegining)||!1,p=document.createElement("div");p.className="vjs-dvr-btn-overlay",h||k||g.el().appendChild(p),g.on("loadeddata",function(){if(k)!function(e){e.one("canplay",function(){e.seekable()&&(e.currentTime(e.seekable().start(0)),e.play())})}(g);else if(h)!function(e){e.one("canplay",function(){e.seekable()&&(e.currentTime(e.seekable().end(0)),e.play())})}(g);else{g.bigPlayButton.hide(),g.controlBar.hide();var e=!!i(s);p.innerHTML=function(e,o){var a=(null==e?void 0:e.buttonConfig)||{},i=a.watchLive,r=a.resume,c=a.startFromBegining,l='<button id="watch-live-btn">'.concat(n()," ").concat((null==i?void 0:i.text)||"Watch Live","</button>"),u='<button id="resume-btn">'.concat(n()," ").concat((null==r?void 0:r.text)||"Resume","</button>"),s='<button id="watch-begining-btn">\n '.concat(t()," ").concat((null==c?void 0:c.text)||"Start From Begining","\n </button>"),d=o?u:l;return'<div class="dvr-button">'.concat(d," ").concat(s,"</div>")}(u,e),a("watch-live-btn",v,function(){g&&g.seekable()&&g.currentTime(g.seekable().end(0)),r(g,p),null==v||v.cb()}),a("resume-btn",b,function(){if(g&&g.seekable()){var e=i(s),n=Math.min(e,g.seekable().end(0));g.currentTime(n)}r(g,p),null==b||b.cb()}),a("watch-begining-btn",f,function(){var e=g.seekable();if(e&&e.length>0){var n=c(m,e);g.currentTime(n)}r(g,p),null==f||f.cb()})}}),function(e,n){var t=e.currentTime(),o=!1;e.on("seeking",function(){o=!0}),e.on("seeked",function(){o=!1,t=e.currentTime()}),e.on("timeupdate",function(){if(!o){var a=e.currentTime();if(a-t>=30&&(!function(e,n,t){sessionStorage.setItem("lastWatchedPosition-".concat(e),t.toFixed(2))}(n,0,a),t=a),e.liveTracker){var i=e.liveTracker.atLiveEdge(),r=e.controlBar.getChild("SeekToLive");i?null==r||r.show():null==r||r.hide()}}})}(g,s)}function a(e,n,t){var o,a,i=document.getElementById(e);i&&(a=n,(o=i)&&(o.style.color="".concat((null==a?void 0:a.textColor)||"#000"),o.style.backgroundColor="".concat((null==a?void 0:a.backGroundColor)||"#DCF95B")),i.addEventListener("click",t))}function i(e,n){return sessionStorage.getItem("lastWatchedPosition-".concat(e))||0}function r(e,n){e.play(),e.bigPlayButton.show(),e.controlBar.show(),n.style.display="none"}function c(e,n){var t=new Date,o=e.find(function(e){var n=new Date(e.startDate),o=new Date(e.endDate);return t>=n&&t<o}),a=n.start(0),i=a;if(null!=o&&o.startDate){var r=n.end(n.length-1)-a;i=a+(new Date(o.startDate).getTime()-new Date(t-1e3*r).getTime())/1e3}return i}export{o as a,c as g};
@@ -1 +0,0 @@
1
- import"video.js/dist/video-js.min.css";import{d as e,g as n,a as t,b as o,c as r,e as i,s as l,f as a,l as s,h as u,i as c,j as d,k as v,m as f,r as p,n as m,o as y,p as g,q as h,t as b,u as w,v as k,w as S,x as O,y as I,z as j,A as T,B as E,C as P,D,E as A,F as x,G as C,H as L,I as R,J as N,K as M,L as _,M as U,N as V,O as B,P as H,Q as F}from"./generic-e4833832.js";import Q from"@babel/runtime/helpers/defineProperty";import G from"@babel/runtime/helpers/asyncToGenerator";import K from"@babel/runtime/regenerator";import q from"video.js";import{o as z,g as J,a as W,s as X,b as Y,p as $}from"./util-9649ae40.js";import{g as Z,d as ee,a as ne,e as te}from"./captions-b619441b.js";import{g as oe,p as re}from"./resolution-62be852a.js";import{t as ie,i as le,a as ae}from"./skin-16f83185.js";import{g as se}from"./player_instance-34118a5b.js";import{s as ue}from"./localisation-0bf399a1.js";import ce from"@babel/runtime/helpers/typeof";import de from"@babel/runtime/helpers/toConsumableArray";import ve from"@babel/runtime/helpers/slicedToArray";import{a as fe}from"./index-7dec4239.js";var pe=function(e){return new Promise(function(n,t){if(me(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ye=function(e,n,t){var o=se(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var r=parseFloat(n)/100;o.volume(r),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ge=function(e){var n=se(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},he=function(){var n=G(K.mark(function n(t){var o,r,i,l,a;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r=se(null==t?void 0:t.playerId),null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable||null==t||!t.chromecastReceiverId){n.next=22;break}return n.next=4,import("@silvermine/videojs-chromecast");case 4:return l=n.sent,n.prev=5,n.next=8,pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:n.next=13;break;case 10:n.prev=10,n.t0=n.catch(5),console.log("Error",n.t0);case 13:return n.prev=13,l.default(q),n.finish(13);case 16:(a=q.getTech("chromecast"))&&!a.prototype.seeking&&(a.prototype.seeking=function(){}),null!==(i=window)&&void 0!==i&&i.cast?null==r||r.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=t&&t.airplay&&"Safari"==e()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return n.stop()}},n,null,[[5,10,13,16]])}));return function(e){return n.apply(this,arguments)}}(),be=function(e,n){var t=se(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,r,i,l,a=this.el(),s=q.dom.getPointerPosition(a,n).x;q.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}})};var we=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),pe("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)}}(),ke=function(){var e=G(K.mark(function e(){return K.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){q.getPlugin("eme")||q.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=G(K.mark(function e(){var n;return K.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(q),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)}}(),Oe=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-5d92eaa3.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)}}(),Ie=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-6c1ba1fe.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)}}(),je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(q)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(q)})},loadAdsLibrary:we,loadEMELibrary:ke,loadMuxPlugin:Se,loadDvrSeekbar:Oe,loadContribDash:Ie});function Te(e){return Ee.apply(this,arguments)}function Ee(){return(Ee=G(K.mark(function n(t){var o;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=(null==t?void 0:t.airplay)||!1,n.next=3,we();case 3:o&&"Safari"==e()&&Promise.resolve().then(function(){return je}).then(function(e){e.importAirplay()});case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Pe(e,n){return De.apply(this,arguments)}function De(){return(De=G(K.mark(function n(t,o){var r,i,l,a,s,u,c,d,v,f;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return c=(null==o?void 0:o.contentType)||"video",d=null==o||null===(r=o[c])||void 0===r?void 0:r.drmEnabled,null==o||null===(i=o[c])||void 0===i||null===(l=i.liveDetails)||void 0===l||l.isDvrEnabled,null==t||t.showPositiveSeekbar,v=(null==o||null===(a=o[c])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.dash)||null,n.prev=5,n.next=8,Promise.allSettled([d?"Safari"==e()?ke():"caliente"!=(null===(f=window)||void 0===f?void 0:f.siteName)?Ie():ke():"Safari"!=e()&&v?Ie():null,he(t)]);case 8:n.next=13;break;case 10:n.prev=10,n.t0=n.catch(5),console.log("Error",n.t0);case 13:case"end":return n.stop()}},n,null,[[5,10]])}))).apply(this,arguments)}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 xe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ae(Object(t),!0).forEach(function(n){Q(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ae(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ce=new Set,Le=null,Re=function(e,t,r){var i,l,a,s,u,c,d,v={},f=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(i=e[f])||void 0===i?void 0:i.id)||"Null",v["c3.cm.contentType"]=He(e),v[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==e||!e.linearchannel),v[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),v[null==r||null===(s=r.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===n()?"NULL":n(),v["c3.cm.categoryType"]=Ue(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[f])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=e[f])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[r.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Ve(e),v["c3.cm.genreList"]=Me(e),v["c3.cm.genre"]=Ne(e),v["c3.cm.channel"]=_e(e);var p=Ge(o(),e);return v=xe(xe({},v),p)},Ne=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Me=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},_e=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Ue=function(e){return(null==e?void 0:e.contentType)||"null"},Ve=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},Be=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},He=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Fe,Qe,Ge=function(e,n){var o,i,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=r(),d=t();return u["c3.cm.seriesName"]=(null==n||null===(o=n.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Ke=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"}},qe=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ze=function(){var e=G(K.mark(function e(n,t){var o,r,l,a,s,u,c,d,v,f;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},r=o.trackConvivaPlayerEvent,l=o.paymentHandler,a=o.tveProvider,s=o.enable,u=o.appName,c=(t||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=se(n),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready(function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Ke(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})}),n||v("contentInfo",{DRMEnabled:"None"})}),d.on("loadstart",function(){var e,n;Le&&Le!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Ce.clear(),Le=d.currentSrc();var o=qe(d.currentType()),r=i(),s=Re(r,d,f);s[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=Be(r,t),s.authToken=c||"NULL",s.streamType=o,s.D2CType=l||"NONE",s.subscriberType=a||(l?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",Je.setData(s),v("contentInfo",s)}),d.on("loadedmetadata",function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})}),d.on("play",function(){Ce.has(d.currentSrc())||(Ce.add(d.currentSrc()),v("playbackStarted",null))}),d.on("ended",function(){Ce.has(d.currentSrc())&&Ce.delete(d.currentSrc()),v("playbackEnded")}),d.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})}),d.on("dispose",function(){null==Ce||Ce.clear(),v("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Je=(Fe={},{setData:function(e){Fe=xe(xe({},Fe),e)},getData:function(){return Fe}}),We=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-f2cb9f9e.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-6520acf0.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-c51a3958.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-3fa3b400.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-1d3bf1bb.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t&&import("./skin-e55951c5.js").then(function(t){t.initialiseSkin(e,n)})};function Xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ye(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Xe(Object(t),!0).forEach(function(n){Q(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var $e=[],Ze=0,en=null;function nn(e,n,t){var o,r,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(e.currentTime()),f=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(e.currentTime()),g=c?100:Math.floor(v/f*100),h={};m?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),r=tn(o),l=(new Date).getTime(),a=i(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return Ye(Ye({},e),{},Q({},n,s[n]))},{}),c=r.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Qe});c<0?r.push(Ye(Ye({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=Ye(Ye(Ye({},r[c]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(r))}(h={completed:c,watchedTime:y,watchedPercentage:g},d,n.siteOwner):(h=Ye(Ye({videoId:Qe,watchedTime:y,watchedPercentage:g,doneWatching:c,profileId:d},en&&{seriesId:en}),p&&{originalObjectId:p}),l(h).then(function(e){}).catch(function(e){})),Ze=v+t}function tn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function on(e,n,t){var o=tn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),r}var rn=!1,ln=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!rn){var i=an(e,"videoAssets","secondaryVideoAssets"),l=a(i,n);return l&&s(n,l),rn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function an(e,n,t){if(Array.isArray(e))return e.map(function(e){return an(e,n,t)});if(null!==e&&"object"===ce(e)){var o={};return Object.keys(e).forEach(function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=an(e[r],n,t)}),o}return e}function sn(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 un(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)?un(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function un(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function 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}function dn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?cn(Object(t),!0).forEach(function(n){Q(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var vn=function(n,t,o,r){var l,a,s,f,p=r.res,m=r.sres,y=se(n),g=(null==p?void 0:p.contentType)||"video",h=(null==p?void 0:p[g].drmEnabled)||!1,b=(null==p||null===(l=p[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,w=(null==p||null===(s=p[g])||void 0===s||null===(f=s.liveDetails)||void 0===f?void 0:f.isDvrEnabled)||!1;u(p),y&&(y.on("loadstart",function(){b?o.resolve({status:!0,msg:"Video Loaded",response:p}):o.resolve(dn({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:p}:{response:p}))}),y.on("loadeddata",function(){var o,r,l,a=Z(n);if(null==a||a.map(function(e){return ee(n,e.id)}),w&&"Safari"===e())try{var s;null==y||null===(s=y.liveTracker)||void 0===s||s.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&ye(n,sessionStorage.getItem("volume")||"100");var u=i();if(c(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var d,v,f=dn(dn({},t),p);!function(e,n,t){var o,r,i;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(en=null==n||null===(r=n.series)||void 0===r?void 0:r.id),$e=[],Ze=0,Qe=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=se(e);a&&(a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());$e.includes(Ze)||(e==Ze?($e.push(e),nn(a,n,l)):e>Ze&&(Ze=e+l))}}),a.one("ended",function(){nn(a,n,l,!0)}))}(n,f,null==u||null===(d=u.video)||void 0===d||null===(v=d.gist)||void 0===v?void 0:v.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=y&&y.mux){var m,g,h,b,k,S,O=(null===(m=i())||void 0===m?void 0:m.video)||(null==p?void 0:p.video),I=null==O?void 0:O.gist,j={env_key:null==t||null===(g=t.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==I?void 0:I.id,video_title:null==I?void 0:I.title,video_series:null==O||null===(b=O.series)||void 0===b?void 0:b.title,video_stream_type:null!=O&&null!==(k=O.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==t||null===(S=t.analytics)||void 0===S?void 0:S.userId};y.mux({debug:!1,data:j})}}),y.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];y.trigger("subtitlechanged",n)}),y.on("subtitlechanged",function(e,n){var t,o,r,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,y=p.getMediaSession(),g=y.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}}),y.tech_.on("retryplaylist",function(){b&&ln(p,n)}),y.on("error",function(){var e,t;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&b)?ln(p,n):(d(n,(null==y||null===(e=y.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==y||null===(t=y.error())||void 0===t?void 0:t.message)||"Some error occured",response:p}))}),y.one("play",function(){var e,n,o,r,l;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var a,s,u,c=null===(a=i())||void 0===a||null===(s=a.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id,d=v(),f=(null==d?void 0:d.get(c))||{t:0,p:0},p=f.t,m=f.p;p&&m<95&&setTimeout(function(){y.currentTime(p)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){y.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=y&&y.dvrSeekbar)try{y.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),y.on("volumechange",function(){var e=100*y.volume().toFixed(2);y.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),y.on("chromecastDisconnected",function(){if(b){y.currentSource();for(var e=y.textTracks(),n=e.length-1;n>=0;n--)y.removeRemoteTextTrack(e[n])}}),y.one("loadeddata",function(){var n,t=(null==y||null===(n=y.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==ce(y.dash)){var o,r,i,l=null==y||null===(o=y.dash)||void 0===o||null===(r=o.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),a=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),s=sn(t);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var c,d=sn(t);try{for(d.s();!(c=d.n()).done;){var v,f,p,m=c.value;if(("Chrome"==e()||"Edge"==e()&&(null!==(v=navigator)&&void 0!==v&&null!==(f=v.userAgent)&&void 0!==f&&f.includes("Macintosh")||!h))&&null!=m&&null!==(p=m.label)&&void 0!==p&&p.includes("5.1"))y.audioTracks().removeTrack(m);else{if("main"==m.kind){m.enabled=!0;break}m.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function fn(e,n){var t,o,r,i=se(e),l=null==i||null===(t=i.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,a=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,s,u,c,d,v,m,y;if(mn.enabled&&"input"!=t.target.localName){var g=t.key,h=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(g)&&(t.preventDefault(),null==a||a.focus()),g){case" ":null==l||l.click();break;case"m":case"M":i.muted(!i.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":h&&!1===n.liveui||p(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(s=r.app_data)||void 0===s||null===(u=s.appcmsMain)||void 0===u||null===(c=u.adsConfig)||void 0===c?void 0:c.vodAdSticherProvider)&&null!==(d=window)&&void 0!==d&&null!==(v=d.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(y=m.adsConfig)&&void 0!==y&&y.vodAdClientSideTracking)return;h||f(e,10)}}},!0)}var pn,mn=(pn=!0,{enable:function(){pn=!0},disable:function(){pn=!1},get enabled(){return pn}}),yn="ssai-breakStart",gn="ssai-adImpression",hn="ssai-firstQuartile",bn="ssai-midpoint",wn="ssai-thirdQuartile",kn="ssai-complete",Sn="ssai-breakEnd",On={breakStart:yn,impression:gn,firstQuartile:hn,midpoint:bn,thirdQuartile:wn,complete:kn,breakEnd:Sn};function In(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=se(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=On[o];r&&t.trigger(r,n)}function jn(e){var n=se(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(yn,e)},adImpression:function(e){return t(gn,e)},adFirstQuartile:function(e){return t(hn,e)},adMidpoint:function(e){return t(bn,e)},adThirdQuartile:function(e){return t(wn,e)},adComplete:function(e){return t(kn,e)},adBreakEnd:function(e){return t(Sn,e)}}}function Tn(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 En(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Tn(Object(t),!0).forEach(function(n){Q(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Pn(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 Dn(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)?Dn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Dn(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,xn,Cn=(An="",{set:function(e){e&&(An=e)},get:function(){return An}}),Ln=(xn=null,{set:function(e){xn=e},get position(){return xn}});function Rn(e,n){return Nn.apply(this,arguments)}function Nn(){return Nn=G(K.mark(function e(n,t){var o,r,i,l,s,u,c,d,v,f,p,y,g,h;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return se(n),o=a(t,n),r=o.src,i=r.replace("/dash/","/session/").replace("master","session"),i=m(i,n,t),l=Mn(i),s=ve(l,2),u=s[0],c=s[1],i=new URL(i.split("?")[0]),Object.keys(c).length>0&&Object.entries(c).forEach(function(e){var n=ve(e,2),t=n[0],o=n[1];i.searchParams.set(t,o)}),e.prev=8,e.next=11,fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:En({},u)})});case 11:return d=e.sent,e.next=14,d.json();case 14:return v=e.sent,f="https://"+new URL(i).hostname,p=v.trackingUrl,y=v.manifestUrl,g=f+p,h=f+y,Cn.set(g),console.log("%c TRACKING URL","background: #bdf369; color: #000",g),o.src=h,e.abrupt("return",o);case 26:return e.prev=26,e.t0=e.catch(8),e.abrupt("return",o);case 29:case"end":return e.stop()}},e,null,[[8,26]])})),Nn.apply(this,arguments)}function Mn(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var o,r=Pn(t.split("&"));try{for(r.s();!(o=r.n()).done;){var i=o.value.split("="),l=ve(i,2),a=l[0],s=l[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},c={},d=0,v=Object.entries(n);d<v.length;d++){var f=ve(v[d],2),p=f[0],m=f[1];if(p.startsWith("ads."))u[p.replace(/^ads\./,"")]=m;else c[p]=m}return[u,c]}var _n,Un=(_n=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),_n=Array.isArray(e)?de(e):_n},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",_n),de(_n)}});function Vn(e,n){return Bn.apply(this,arguments)}function Bn(){return Bn=G(K.mark(function e(n,t){var o,r,i,l,a,s,u,c,d,v,p,m,y,g,h,b,w;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:w=function(e,t,o,r,i,l){var a=se(n);if(!a.seeking()){t.startTimeInSeconds,t.durationInSeconds,Math.floor(a.currentTime());var s,u=Pn(o);try{var c=function(){var o,u,c,d=s.value,v=d.eventType,f=d.beaconUrls,p=d.startTimeInSeconds,m=d.startTime,y=d.durationInSeconds,g=p||0,w=f,k=(null===(o=window)||void 0===o||null===(u=o.customData)||void 0===u||null===(c=u.ads)||void 0===c?void 0:c.adEventHandler)||null,S="".concat(g,"_").concat(v),O=h.get("pod-".concat(i))||[];if(console.warn(e,g,"map:",v,"condition1:",e>=g,"map:",h),e>=g&&!O.includes(S)){O.push(S),h.set("pod-".concat(i),O);try{b(v,t,w,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,t)}if("breakEnd"==v){var I=Ln.position;Ln.set(null),setTimeout(function(){null!=I&&(a.currentTime(I),l())},500)}if("function"==typeof k)try{var j,T={eventType:v,startTimeInSeconds:p,startTime:m,durationInSeconds:y,ad:null==t||null===(j=t.ads)||void 0===j?void 0:j[r],adIndex:r};k({adsData:T}),In(n,T)}catch(e){console.error("Error when calling ads callback:",e)}}};for(u.s();!(s=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},b=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)})})},g=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Ln.set(t),a=Cn.get(),(s=se(n)).one("loadeddata",function(){a&&y(a)}),u=new Map,c=new Map,d=-1,v=(null===(o=document)||void 0===o||null===(r=o.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])||null,p=(null==s||null===(i=s.controlBar)||void 0===i?void 0:i.getChild("videoSelector"))||null,m=(null==s||null===(l=s.controlBar)||void 0===l?void 0:l.getChild("seriesV2"))||null,y=function(){var e=G(K.mark(function e(o){var r,i,l,a,s,y,h,b,k,S,O,I,j,T,E,P,D;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return j=function(e){document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",j),0===e.button&&S()},I=function(e){},O=function(){var e,n=h.currentTime(),t=null,o=Pn(y);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,u.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},S=function(){var e,n=h.currentTime(),t=null,o=Pn(y);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,s=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>i)&&!u.has(i)||n>=i&&n<=s)&&(t=i,u.set(i,!0),c.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){h.currentTime(t+.4)},100))},i=!1,e.next=7,fetch(o);case 7:return l=e.sent,e.next=10,l.json();case 10:a=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",a),s=a.avails,y=[],h=se(n),b=h.controlBar.progressControl,k=b.seekBar.el(),s.map(function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(i=!0),y.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===r?void 0:r[0])||[]})}),!i&&t&&(h.currentTime(t),O()),null!=y&&y.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",y),window.adsQueueList=y),console.log(y,"data"),y.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",k.appendChild(i)}}),h.on("timeupdate",ie(function(){var e=h.currentTime();if(e!==d){d=e;for(var n=!1,t=function(){var t=y[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&u.set(r,!0),mn.disable(),v&&v.classList.add("vjs-hidden"),p&&(p.el().style.pointerEvents="none",p.el().classList.add("vjs-hidden")),m&&(m.el().style.pointerEvents="none",m.el().classList.add("vjs-hidden")),b.el().style.visibility="hidden";for(var s=e-r,d=0,f=0,h=0;h<l.length;h++){var k,S=null==l||null===(k=l[h])||void 0===k?void 0:k.durationInSeconds;if(s<d+S){f=h;break}d+=S}l[f];var I=Math.max(0,i-s),j=Math.round(I);T.style.display="block",D.textContent="".concat(f+1," of ").concat(l.length," • ").concat(g(j));var E=[];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)});E.push.apply(E,de(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),w(e,t,E,f,o,O),"break"}c.delete(r)},o=0;o<y.length;o++){if("break"===t())break}n||(T.style.display="none",b.el().style.visibility="visible",p&&(p.el().style.pointerEvents="auto",p.el().classList.remove("vjs-hidden")),m&&(m.el().style.pointerEvents="auto",m.el().classList.remove("vjs-hidden")),v&&v.classList.remove("vjs-hidden"),mn.enable())}},1e3)),null===(r=document)||void 0===r||r.addEventListener("keydown",function(e){mn.enabled&&"ArrowRight"==e.key&&(S(),f(n,10),e.stopPropagation())}),b.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",j))}),(T=document.createElement("div")).className="ssai-ad-container",(E=document.createElement("div")).className="sponsored-adbox",(P=document.createElement("div")).className="sponsored-text",P.textContent="Sponsored Ad",E.append(P),(D=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",T.append(E),T.append(D),h.el().appendChild(T);case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),h=new Map;case 16:case"end":return e.stop()}},e)})),Bn.apply(this,arguments)}function Hn(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 Fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Hn(Object(t),!0).forEach(function(n){Q(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Hn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Qn=function(n,t,o,r){var i,l,u,c,v,f,p,m,w,k,S,O,I,j,T,E,P,D,A,x,C,L,R,N,M,_,U,V,B,H,F,z,J,W,X,Y,$,Z,ee=t.res,te=void 0===ee?null:ee,oe=t.sres,re=void 0===oe?null:oe,ie=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(i=te)||void 0===i?void 0:i.contentType)||"video",ue=le(null===(l=te)||void 0===l||null===(u=l[ae])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl)||le(null===(v=te)||void 0===v||null===(f=v[ae])||void 0===f||null===(p=f.gist)||void 0===p||null===(m=p.imageGist)||void 0===m?void 0:m.r16x9),ce=(null===(w=te)||void 0===w||null===(k=w[ae])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,de=(null===(O=te)||void 0===O||null===(I=O[ae])||void 0===I||null===(j=I.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,ve=(null===(T=te)||void 0===T||null===(E=T.ads)||void 0===E||null===(P=E.preRoll)||void 0===P||null===(D=P.adTags)||void 0===D||null===(A=D.web)||void 0===A?void 0:A.active)&&(null===(x=te)||void 0===x||null===(C=x.ads)||void 0===C||null===(L=C.preRoll)||void 0===L||null===(R=L.adTags)||void 0===R||null===(N=R.web)||void 0===N?void 0:N.url),pe=(null===(M=te=Fn(Fn({},te),{},{audioAssetSource:null==o?void 0:o.audioAssetSource}))||void 0===M||null===(_=M[ae])||void 0===_?void 0:_.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(U=window)||void 0===U||null===(V=U.app_data)||void 0===V||null===(B=V.appcmsMain)||void 0===B||null===(H=B.adsConfig)||void 0===H?void 0:H.vodAdSticherProvider)||!1,me=(null==o?void 0:o.latency)||6,ye=(null==o?void 0:o.skin_settings)||{},ge=(null==o?void 0:o.dvrConfig)||{enable:!1},he=(Z={enableSmoothSeeking:!0,controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.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"==o.skin,liveui:ce},Q(Z,"autoplay",null==o?void 0:o.autoplay),Q(Z,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!ve),Q(Z,"loop",(null==o?void 0:o.loop)||!1),Q(Z,"audioPosterMode",null==o?void 0:o.audioPosterMode),Q(Z,"html5",Fn(Fn({dash:Fn(Fn(Fn({},!q.browser.IS_SAFARI&&{useTTML:!0}),(null==o?void 0:o.debugConfig)&&(null==o||null===(F=o.debugConfig)||void 0===F?void 0:F.enable)&&{debug:!0,logLevel:null!=o&&null!==(z=o.debugConfig)&&void 0!==z&&z.logLevel?null==o||null===(J=o.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Fn(Fn({liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==o||null===(W=o.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(X=null==o?void 0:o.enableLowInitialPlaylist)||void 0===X||X}),debug:!0,nativeTextTracks:"Safari"==e()},0==(null==o||null===(Y=o.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===($=o.customData)||void 0===$?void 0:$.nativeVideoTracks)&&{nativeVideoTracks:!1})),Q(Z,"poster",ue),Q(Z,"techOrder",ie),Q(Z,"chromecast",{requestCustomDataFn:function(e){var t,r,i=se(n),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,r,i,l,a,s,u,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,y,g,h,b,w,k,S;p.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==O?void 0:O.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);p.licenseUrl=I;var j=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=j}var T=(null==e||null===(o=e[f])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";p.contentType=T;var E=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=E;var P=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=P;var D=null==e||null===(u=e[f])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(te,e,l);return Fn(Fn({},a),{},{convivaMetaData:Fn({customerKey:(null==o||null===(t=o.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==o||null===(r=o.convivaConfig)||void 0===r?void 0:r.debug)||!1},Je.getData())})},modifyLoadRequestFn:function(e){var t,o,r,i,l,a=se(n),s=(null==a?void 0:a.currentSource())||{};!(null===(t=te)||void 0===t||null===(o=t[ae])||void 0===o||null===(r=o.streamingInfo)||void 0===r||null===(i=r.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),Z);if(!q.getPlayers()[n]){q.log.level("debug");var we=q(n,he,function(){var e=G(K.mark(function e(){var t,i,l,u,c,v,f,p,m,w,k,S,O,I,j,T,E,P,D,A,x,C,L;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(q.VERSION),console.log(q.getPlugins()),e.next=5,Pe(o,te);case 5:if(S=null===(t=te)||void 0===t||null===(i=t[ae])||void 0===i||null===(l=i.liveDetails)||void 0===l?void 0:l.startOverTime,de&&r.resolve(Fn({status:!0,msg:"Player Initialised"},re?{seriesResponse:re,response:te}:{response:te})),O={},null!=ge&&ge.enable&&ce&&(O.playFromBegining=ge.playFromBegining,O.playLive=ge.playLive,j=null==o||null===(I=o.epg)||void 0===I?void 0:I.programSubType,"linearchannel"===ae?"LIVE"===(null==j?void 0:j.toUpperCase())&&fe(n,o):fe(n,o)),g(n,null==o?void 0:o.analyticsCb,O),ze(n,o),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),ce&&be(n,S),!ve||null!=o&&null!==(u=o.customData)&&void 0!==u&&u.disableAds||h(n,ve,te),T=a(te,n),console.log(T),null!=o&&o.nearestClusterUrl&&(T=b(T,o.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,Rn(n,te);case 20:T=e.sent;case 21:T?s(n,T):(r.reject({status:!1,msg:"Incompatible / Missing Source",response:te}),d(n,"Incompatible / Missing Source")),((null===(c=te)||void 0===c||null===(v=c[ae])||void 0===v||null===(f=v.contentDetails)||void 0===f||null===(p=f.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(m=te)||void 0===m||null===(w=m[ae])||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0)&&(L=(null===(P=te)||void 0===P||null===(D=P[ae])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(x=te)||void 0===x||null===(C=x[ae])||void 0===C?void 0:C.closedCaptions),E=L.filter(function(e){return"VTT"===e.format}),ne(n,E)),null!=o&&o.disableControls?y(n):We(n,Fn(Fn(Fn({},o),he),{},{liveVideo:de,isDvrEnabled:ce,res:te,sres:re})),vn(n,Fn(Fn(Fn({},o),he),{},{liveVideo:de}),r,{res:te,sres:re});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}},Gn={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Kn(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 qn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach(function(n){Q(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var zn,Jn=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Wn(e);Qn(r,{res:i},e,{resolve:t,reject:o})},Wn=function(e){var n,t,o,r,i,l,a,s,u=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,d=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.url)||null,f=(null==e||null===(i=e.streamingInfo)||void 0===i?void 0:i.posterUrl)||null,p=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,y=null==e?void 0:e.token,g=w(y),h=null==g?void 0:g.site;return qn(qn({id:null==Gn?void 0:Gn[h]},!d&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:d,streamingInfo:{videoAssets:qn(qn({},m&&{drmProvider:m}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:qn({},f&&{videoImageUrl:f}),contentDetails:qn({},(null==p?void 0:p.length)>0&&{closedCaptions:de(p)})},ads:{preRoll:{adTags:{web:qn(qn({},v&&{active:!0}),v&&{url:v})}}}})};function Xn(e,n){return Yn.apply(this,arguments)}function Yn(){return(Yn=G(K.mark(function e(n,t){var o,r,i,l,a,s;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,r=t.reject,i=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,I();case 6:s=e.sent,k(i,s).then(function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,u(null==e?void 0:e.data);var f,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,g,h=on((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",i,null==n?void 0:n.siteOwner);if(h&&h.length)n.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Qn(l,{res:p},n,{resolve:o,reject:r})}else S(i,s).then(function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.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,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))}).finally(function(){Qn(l,{res:p},n,{resolve:o,reject:r})});else Qn(l,{res:p},n,{resolve:o,reject:r})}).catch(function(e){O(e,l,r,i)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $n(e,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=G(K.mark(function e(n,t){var o,r,i,l,a;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,r=t.reject,e.next=3,I();case 3:i=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,j(a,i).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,Qn(l,{res:t},n,{resolve:o,reject:r})}).catch(function(e){O(e,l,r,videoId)});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function et(e,n){return nt.apply(this,arguments)}function nt(){return(nt=G(K.mark(function e(n,t){var o,r,i,l,a,s,c;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.resolve,i=t.reject,e.next=3,I();case 3:l=e.sent,a=null==n?void 0:n.playerId,s=sessionStorage.getItem("season-idx")||0,P.set(parseInt(s)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,T(c,l).then(function(e){var t,o,s,d=e.data,v=e.data.seasons;D(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(s=o[0])||void 0===s?void 0:s.id);E(c,l),k(f,l).then(function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,u(e.data),Qn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:r,reject:i})}).catch(function(e){O(e,a,i,videoId)})}).catch(function(e){O(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function tt(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 ot(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tt(Object(t),!0).forEach(function(n){Q(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function rt(){return{loadVideoInstantly:A,onTimeUpdate:z,getVideoDuration:J,onVideoEnded:W,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=G(K.mark(function n(t,o){var r,i,l,a,s,u,c,d,v,f,p,m,y,g,h,b,w,S,I,j,T,E,P;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!L(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(p=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,y=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,g=null==e?void 0:e.videoId,h=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,b=(null==e?void 0:e.streamingInfo)||!1,window.videoId=g,w=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",w),B().set(null==e?void 0:e.refreshToken),w&&!H(w)){n.next=16;break}return o({status:!1,msg:"".concat(w?"Token is expired !":"Missing Authorization Token"),response:{token:w}}),n.abrupt("return");case 16:zn=JSON.parse(atob(w.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(l=zn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=zn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=zn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=zn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,S=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,I=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(j=null==e?void 0:e.errors)&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,ue(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),U.set(e.apiBaseUrl),null!=e&&e.skin&&!ae(e.skin)||(e.skin="VL_ONE"),n.next=33,Te(e);case 33:I&&pe("https://www.googletagmanager.com/gtag/js?id=".concat(I)).then(function(){return F(I)}).catch(function(e){}),(T=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(S)))&&T.addEventListener("contextmenu",function(e){return e.preventDefault()}),p?(P={directPlaybackUrl:p,id:E="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?k(E,w).then(function(n){var r=(null==n?void 0:n.data)||{};Qn(S,{res:ot(ot({},r),P)},e,{resolve:t,reject:o})}).catch(function(e){O(e,S,o,E)}):Qn(S,{res:P},e,{resolve:t,reject:o})):b?Jn(e,{resolve:t,reject:o}):h?et(e,{resolve:t,reject:o}):y?$n(e,{resolve:t,reject:o}):Xn(e,{resolve:t,reject:o});case 37:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:f,getPlayer:se,play:x,pause:C,detectBrowser:e,rewind:p,loadVideo:s,seekToTimeStamp:X,isPlayerInitialised:L,load:R,authenticateLC:N,dispose:M,enableCaptions:te,disableCaptions:ee,getCaptions:Z,playSelectedResolution:re,getSource:a,setVolume:ye,getVolume:ge,disableControls:y,setPlaybackSpeed:Y,getEntitlementData:_,adsQueuePointManager:Un,getSsaiEvents:jn,playerEvents:$}}export{rt as V,fn as i,Vn as s};
@@ -1 +0,0 @@
1
- import{h as e,d as i,e as r,o as l,p as t,q as n,r as o,s as a}from"./features-b17a311f.js";import{g as s}from"./player_instance-34118a5b.js";import{a as u,i as d,b as v}from"./index-20d3b872.js";import{R as m,f as p,e as c,k as f}from"./generic-e4833832.js";import"videojs-contrib-quality-menu";import y from"video.js";import k from"@babel/runtime/helpers/asyncToGenerator";import b from"@babel/runtime/regenerator";import{i as g,s as h}from"./index-e1f939b0.js";import{c as j,d as T}from"./icons-c139587c.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./resolution-62be852a.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-16f83185.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-0cba47e8.js";import"./util-9649ae40.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-b619441b.js";import"video.js/dist/video-js.min.css";import"./index-7dec4239.js";var w={markerStyle:{width:"5px","background-color":"red"},markerTip:{display:!1,text:function(e){return e.title},time:function(e){return e.time}},onMarkerClick:function(e){},markers:[],duration:0};function C(){return(C=k(b.mark(function e(i,r){var l,t,n,o,a,u;return b.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:l=s(i),(t=l.seekable())&&t.length>0&&(n=t.start(0),o=t.end(t.length-1),a=o-n,l.markers({markerStyle:{width:"4px","background-color":"#576478"},markerTip:{display:!1},duration:a||0}),l.markers.initializeMarker(),u=M(r,a),l.markers.add(u));case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function M(e,i){var r=(new Date).getTime(),l=new Date(r-1e3*i).getTime();return e.filter(function(e){var i=new Date(e.startDate).getTime();return i>=l&&i<=r}).map(function(e){var i=new Date(e.startDate).getTime()-l;return{key:e.programId,title:e.title,time:i/1e3}})}function B(i,r){var l=s(i);l&&(l.on("loadeddata",function(){var e,t,n,o,a,v,p,c=(null==r||null===(e=r.dvrConfig)||void 0===e?void 0:e.programs)||[];l.qualityLevels()&&l.qualityLevels().length&&function(e){var i=s(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(i),!(null!=r&&null!==(t=r.series)&&void 0!==t&&t.enable||null!==(n=window)&&void 0!==n&&null!==(o=n.app_data)&&void 0!==o&&null!==(a=o.appcmsMain)&&void 0!==a&&null!==(v=a.features)&&void 0!==v&&v.auto_play)||null!=r&&r.liveVideo||u(i,r),null!=r&&r.liveVideo||m()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||d(i),null!=r&&null!==(p=r.dvrConfig)&&void 0!==p&&p.enable&&c&&c.length&&function(e,i){C.apply(this,arguments)}(i,c)}),l.one("play",function(){var r,l,t,n;null!==(r=window)&&void 0!==r&&null!==(l=r.customData)&&void 0!==l&&l.iframeOverlayUrl&&e(i,null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n?void 0:n.iframeOverlayUrl)}))}function E(e,u){s(e).addClass("skin_vlone"),B(e,u),function(e,s){var u,d,m,y,k,b,w,C,M,B,E,S,q,x,_,A=(null==s||null===(u=s.res)||void 0===u||null===(d=u.video)||void 0===d?void 0:d.isSSAIEnabled)||!1,D=p(null==s?void 0:s.res,e)||{};D.src;var L=(null==s?void 0:s.skin_settings)||{};null!=L&&L.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&i(e,"VL_ONE",j());(null!=L&&L.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&r(e,"VL_ONE",T());(null==s||null===(m=s.relatedVideos)||void 0===m||null===(y=m.content)||void 0===y?void 0:y.length)>0&&l(e,null==s?void 0:s.relatedVideos);null!=s&&null!==(k=s.series)&&void 0!==k&&k.enable&&t(e,s);(null==s||null===(b=s.streams)||void 0===b?void 0:b.length)>1&&n(e,null==s?void 0:s.streams);if(v(e,s),g(e,s),"MEDIA_TAILOR"==(null===(w=window)||void 0===w||null===(C=w.app_data)||void 0===C||null===(M=C.appcmsMain)||void 0===M||null===(B=M.adsConfig)||void 0===B?void 0:B.vodAdSticherProvider)&&null!==(E=window)&&void 0!==E&&null!==(S=E.app_data)&&void 0!==S&&null!==(q=S.appcmsMain)&&void 0!==q&&null!==(x=q.adsConfig)&&void 0!==x&&x.vodAdClientSideTracking&&A){var V,O=null;if(null!=s&&null!==(V=s.series)&&void 0!==V&&V.enable){var R,I,P,N=null===(R=c())||void 0===R||null===(I=R.video)||void 0===I||null===(P=I.gist)||void 0===P?void 0:P.id,z=f(),H=(null==z?void 0:z.get(N))||{t:0,p:0},U=H.t;H.p<95&&(O=U)}else{var $=s.watchHistoryResumeTime;s.watchedPercentage<95&&(O=$)}h(e,O)}null!=s&&null!==(_=s.dvrConfig)&&void 0!==_&&_.enable&&null!=s&&s.isDvrEnabled&&(o(e,s),a(e,s))}(e,u),S(e,u)}y.registerPlugin("markers",function(e){var i=y.mergeOptions(w,e),r={},l=[],t=this,n=null;function o(){l.sort(function(e,r){return i.markerTip.time(e)-i.markerTip.time(r)})}function a(e){e.forEach(function(e){t.el().querySelector(".vjs-progress-holder").appendChild(function(e){var l=y.dom.createEl("div",{},{"data-marker-key":e.key,"data-marker-time":i.markerTip.time(e)});return u(e,l),l.addEventListener("click",function(l){var n=!1;if("function"==typeof i.onMarkerClick&&(n=!1===i.onMarkerClick(e)),!n){var o=this.getAttribute("data-marker-key");t.currentTime(i.markerTip.time(r[o]))}}),i.markerTip.display&&function(e){e.addEventListener("mouseover",function(){var l=r[e.getAttribute("data-marker-key")];n&&(i.markerTip.html?n.querySelector(".vjs-tip-inner").innerHTML=i.markerTip.html(l):n.querySelector(".vjs-tip-inner").innerText=i.markerTip.text(l),n.style.left=s(l)+"%",n.style.visibility="visible")}),e.addEventListener("mouseout",function(){n&&(n.style.visibility="hidden")})}(l),l}(e)),r[e.key]=e,l.push(e)}),o()}function s(e){return i.markerTip.time(e)/i.duration*100}function u(e,r){r.className="vjs-marker ".concat(e.class||""),Object.keys(i.markerStyle).forEach(function(e){r.style[e]=i.markerStyle[e]});var l=e.time/i.duration;(l<0||l>1)&&(r.style.display="none");var t=s(e);t>=99.5&&(t=99.5),r.style.left=t+"%"}t.markers={getMarkers:function(){return l},initializeMarker:function(){n=y.dom.createEl("div",{className:"vjs-tip",innerHTML:"<div class='vjs-tip-arrow'></div><div class='vjs-tip-inner'></div>"}),t.el().querySelector(".vjs-progress-holder").appendChild(n)},add:function(e){a(e)},update:function(e,r){!function(e,r){e.forEach(function(e){var l=t.el().querySelector(".vjs-marker[data-marker-key='"+e.key+"']"),n=i.markerTip.time(e);l?(r||l.getAttribute("data-marker-time")!==n)&&(u(e,l),l.setAttribute("data-marker-time",n)):a([e])}),o()}(e,r)}}});var S=function(e,i){var r,l,t,n,o,a,u,d,v,m,p,c,f=s(e),k=(null==i?void 0:i.theme)||{},b=y.dom.$(".vjs-play-progress"),g=y.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");g&&(g.style.color="".concat(null===(r=window)||void 0===r||null===(l=r.app_data)||void 0===l||null===(t=l.appcmsMain)||void 0===t||null===(n=t.brand)||void 0===n||null===(o=n.cta)||void 0===o||null===(a=o.primary)||void 0===a?void 0:a.backgroundColor)),b&&(b.style.background="".concat(null===(u=window)||void 0===u||null===(d=u.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(m=v.brand)||void 0===m||null===(p=m.cta)||void 0===p||null===(c=p.primary)||void 0===c?void 0:c.backgroundColor));var h=f.getChild("BigPlayButton")||null;(null==k?void 0:k.progressBarColor)&&b&&(b.style.background=k.progressBarColor),(null==k?void 0:k.playButtonBackgroundColor)&&h&&(h.el().style.background=k.playButtonBackgroundColor),(null==k?void 0:k.playButtonColor)&&g&&(g.style.color=k.playButtonColor),(null==k?void 0:k.playButtonType)&&("square"==(null==k?void 0:k.playButtonType)?h.el().style.borderRadius=".3em":h.el().style.borderRadius="1.3em")};export{E as initialiseSkin};