@viewlift/player-backup 1.0.163-backup → 1.0.165-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 (58) hide show
  1. package/cjs/{autoNextVideo-bbc109f3.js → autoNextVideo-0e700dee.js} +1 -1
  2. package/cjs/bundle.css +140 -140
  3. package/cjs/{features-3e89a9c2.js → features-60b6a83e.js} +1 -1
  4. package/cjs/generic-61978e4d.js +1 -0
  5. package/cjs/{index-feb73531.js → index-97b0b73e.js} +1 -1
  6. package/cjs/index.js +1 -1
  7. package/cjs/keyboardShortcuts-65ac75f6.js +1 -0
  8. package/cjs/{multicamv2-0ed4c383.js → multicamv2-6faeae79.js} +1 -1
  9. package/cjs/{multicamv2-86b2e3e8.js → multicamv2-fcb8bb14.js} +1 -1
  10. package/cjs/{nextEpisodeButton-17935cf8.js → nextEpisodeButton-bab84e5a.js} +1 -1
  11. package/cjs/{playlist-532b640b.js → playlist-3b24d942.js} +1 -1
  12. package/cjs/{resolution-181912c7.js → resolution-c59e995e.js} +1 -1
  13. package/cjs/{series-5579d9ea.js → series-13238fed.js} +1 -1
  14. package/cjs/{series-v2-b4b3179f.js → series-v2-0a78c44e.js} +1 -1
  15. package/cjs/{series-v2-7491837c.js → series-v2-c0f8a3e3.js} +1 -1
  16. package/cjs/{settings-icon-33e4bfcc.js → settings-icon-bef54795.js} +1 -1
  17. package/cjs/{skin-978b8d8b.js → skin-337e2fe5.js} +1 -1
  18. package/cjs/{skin-b221b956.js → skin-7e7c4ce1.js} +1 -1
  19. package/cjs/{skin-e6def068.js → skin-8eb170ef.js} +1 -1
  20. package/cjs/{skin-5e793190.js → skin-99078201.js} +1 -1
  21. package/cjs/{skin-dc6258b8.js → skin-bce101a3.js} +1 -1
  22. package/cjs/{skin-5d2f3649.js → skin-cd9dc93e.js} +1 -1
  23. package/cjs/{videoSelector-3bb34ca3.js → videoSelector-2a582b0b.js} +1 -1
  24. package/cjs/{videoSelector-810a79ce.js → videoSelector-a7ed27e9.js} +1 -1
  25. package/esm/autoNextVideo-d84f6aba.js +1 -0
  26. package/esm/bundle.css +140 -140
  27. package/esm/{caption-settings-ddfbca32.js → caption-settings-6b429691.js} +1 -1
  28. package/esm/{captions-6cc39cdc.js → captions-59c404fa.js} +1 -1
  29. package/esm/{features-76fa714b.js → features-d9401691.js} +1 -1
  30. package/esm/{generic-46a48054.js → generic-4c43a94b.js} +1 -1
  31. package/esm/{index-f59ab0a4.js → index-07ef3817.js} +1 -1
  32. package/esm/index.js +1 -1
  33. package/esm/keyboardShortcuts-cfdbf3b9.js +1 -0
  34. package/esm/{multicamv2-01f69d34.js → multicamv2-18bf6f1a.js} +1 -1
  35. package/esm/{multicamv2-9449eb12.js → multicamv2-d5fc76da.js} +1 -1
  36. package/esm/{nextEpisodeButton-7c43cd79.js → nextEpisodeButton-f84ca95e.js} +1 -1
  37. package/esm/{playlist-5df17788.js → playlist-ac64e4e7.js} +1 -1
  38. package/esm/{renditions-c0f96578.js → renditions-16e1a2db.js} +1 -1
  39. package/esm/{resolution-00449d8d.js → resolution-a5e1082b.js} +1 -1
  40. package/esm/{series-13770477.js → series-68d00891.js} +1 -1
  41. package/esm/{series-v2-b310ee4f.js → series-v2-97947ec9.js} +1 -1
  42. package/esm/{series-v2-949efad9.js → series-v2-a0799a86.js} +1 -1
  43. package/esm/{settings-icon-23053add.js → settings-icon-364df3cf.js} +1 -1
  44. package/esm/{skin-2882ecc4.js → skin-612c987b.js} +1 -1
  45. package/esm/{skin-852c6ec1.js → skin-6b668dbc.js} +1 -1
  46. package/esm/{skin-8cdb3e1d.js → skin-842d8d4f.js} +1 -1
  47. package/esm/{skin-62f6d88c.js → skin-96fd066b.js} +1 -1
  48. package/esm/{skin-5ed4c85e.js → skin-b1a6b7e1.js} +1 -1
  49. package/esm/{skin-a3dc3a00.js → skin-d3aae505.js} +1 -1
  50. package/esm/{skin-980707cc.js → skin-f7160fdb.js} +1 -1
  51. package/esm/{util-6f289757.js → util-435845ca.js} +1 -1
  52. package/esm/{videoSelector-13414dfd.js → videoSelector-bdd9c4e6.js} +1 -1
  53. package/esm/{videoSelector-afa4b868.js → videoSelector-ea2ddd7f.js} +1 -1
  54. package/package.json +1 -1
  55. package/cjs/generic-cf3f5d22.js +0 -1
  56. package/cjs/keyboardShortcuts-74a083a5.js +0 -1
  57. package/esm/autoNextVideo-2b476e56.js +0 -1
  58. package/esm/keyboardShortcuts-6810bdee.js +0 -1
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as a}from"./skin-2882ecc4.js";import{i as l,d}from"./browser-d4613b36.js";import u from"js-cookie";import s from"ua-parser-js";import{a as c,r as v}from"./captions-6cc39cdc.js";function m(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,t){m("event",e,t)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel"};function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function g(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?I(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var E={name:"@viewlift/player8",version:"1.0.110",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"^8.21.1","videojs-contrib-ads":"^7.5.2","videojs-contrib-eme":"^5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=E.version;var T,h=function(e,t){var n,i,r,a,l,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.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":F.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({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:t,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,t){var n,i,r,a;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:F.get()+w.getLinearChannelDetails,params:g(g(g(g(g({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t}})},b=function(e,t){var n,i,r=x(t),a=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})})):o({url:F.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},_=function(){var e=t(n.mark((function e(t){var i;return n.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:F.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},t),params:g({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},O=function(e){var t=e.videoId;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},F=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),S=function(e,t,n){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:t},withCredentials:!0})},L=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},P=null;function R(){return{set:function(e){e&&(P=e)},get:function(){return P}}}var V,A,W,C,N,j,B=function(){var e=t(n.mark((function e(){var t,i,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=R().get(),i=F.get(),e.prev=2,e.next=5,axios({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});case 5:return o=e.sent,e.abrupt("return",o);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=null,U=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!L(t)){e.next=6;break}return M||(M=B().then((function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&R().set(r),o||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){M=null}))),e.abrupt("return",M);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t},x=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){A=e},G=function(){return A},z=function(e){V=e},Y=function(){return V},J=function(){return W},K=function(e){W=e},Q=function(){return N},X=function(e){C=new Map,e.map((function(e,t){C.set(e.id,t)}))},q=function(e){if(C){var t=C.get(e);K(t+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ee(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?$(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var te=function(){var e,t,n,i,o,r,a,l=G();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===n||null===(i=n.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)};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 ie(){var e=window.sessionStorage.getItem("uid");return e||(e=ne(),window.sessionStorage.setItem("uid",e),e)}function oe(){return re.apply(this,arguments)}function re(){return(re=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.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)}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 t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e,t){e.one("play",tryCatch((function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),p("PLAY",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.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}),t&&t("Video Start",{"Video ID":te(),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 t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))p("BUFFERING",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:t.el_&&Math.floor(t.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:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.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 t,n,i,o,r,a;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.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}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},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 t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,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 t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(ae(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var ae=function(e,t,n){return e>=t&&e<=n};function le(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=t(n.mark((function e(t){var i,r,a,l,d,u,s,c,v,m,f,p,w,I;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return m=e.sent,f=x(m),p=null==f?void 0:f.site,w=null==f?void 0:f.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:p,cid:w,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=ie(),e.t5=te(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=26,oe();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(l=window)||void 0===l||null===(d=l.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),I=[e.t31],o({url:(null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c||null===(v=c.beacon)||void 0===v?void 0:v.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:m},contentType:"application/x-www-form-urlencoded",dataType:"text",data:I}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var n}),e)})));return function(t){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(e,t){if(import("./error-2395864b.js").then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}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(t),o.appendChild(r),i.append(o)}}},ue=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var se=function(e,t){var n=new Map;O({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),N=n})).catch((function(e){return console.log(e)}))},ce=function(){var e=Z.get();return e>=0?e+1:1},ve=function(){var e,t,n,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=Z.get(),l=null==i||null===(t=i[a])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1};function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function fe(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?me(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):me(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window._deviceInfo=s(navigator.userAgent);var pe=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},we=function(e){var t=Ie(e,"video.tags",[]),n=Ie(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},Ie=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},ge=function(){var e,t,n,i,o,a,l,d,s,c,v,m,f,p,w,I,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",E=arguments.length>1?arguments[1]:void 0,T=arguments.length>2?arguments[2]:void 0,h=(null==T?void 0:T.contentType)||"video",y=null==T||null===(e=T[h])||void 0===e?void 0:e.metadata,b=r(E);if(!g.includes("VIEWLIFT_"))return g;var _=window.getComputedStyle(document.getElementById(E),null),D=Math.trunc(_.getPropertyValue("height").slice(0,-2)),O=Math.trunc(_.getPropertyValue("width").slice(0,-2)),F="linearchannel"===h?null==T||null===(t=T.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(i=n.find((function(e){return(null==e?void 0:e.id)===(null==T?void 0:T.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:Ie(T,"video.gist.id",""),S=fe(fe({},Ee(y)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:D,VIEWLIFT_SIZE:pe(O,D),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===(a=window)||void 0===a?void 0:a.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ie(T,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ie(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ie(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==b||null===(l=b.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==b||null===(d=b.options_)||void 0===d?void 0:d.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:we(T),VIEWLIFT_MEDIA_ID:F,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ie(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:F,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+Ie(T,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ie(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.site)||void 0===v?void 0:v.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:Ie(null===(m=window)||void 0===m||null===(f=m.app_data)||void 0===f||null===(p=f.site)||void 0===p?void 0:p.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Ie(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ie(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:F,VIEWLIFT_CONTENT_TITLE:Ie(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:Ie(T,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ie(T,"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(T)},null===(w=window)||void 0===w||null===(I=w.customData)||void 0===I?void 0:I.macros);for(var L in S){var P=new RegExp(L,"g");g=g.replace(P,S[L])}return g},Ee=function(e){var t,n,i,o,r,a,d={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,c=(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 s||c?(l()?s?d=fe(fe({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):c&&(d=fe(fe({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?d=fe(fe({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):c&&(d=fe(fe({},d),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?d=fe(fe({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}):c&&(d=fe(fe({},d),{},{VIEWLIFT_SFID:u.get("sfid.tve")||""})),d=l()?fe(fe({},d),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):fe(fe({},d),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(d=fe(fe({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}),d=l()?fe(fe({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):fe(fe({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),d},Te=function(e,t){var n,i,o,r,a,l,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[w])||void 0===n?void 0:n.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[w])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.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(I){var y=be(g,t);return y.src=ge(y.src,t,e),y}if("Safari"!==d()&&h)return he(g);if(T){var b=ye(g);return b.src=ge(b.src,t,e),b}if(null!=g&&g.mpeg){var _=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(g);return _.src=ge(_.src,t,e),_}return null},he=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},ye=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},be=function(e,t){var n=e.fairPlay,o=e.widevine,a=e.playReady,l=d();if(r(t),"Safari"===l){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,(function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))}))},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,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,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return _e(t),u}var s={src:o.url,type:"application/dash+xml"};return _e(t),s.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},s};var _e=function(e){var t=r(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==d()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},De=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},Oe=!1,Fe=function(e,t,n){var i=ge(t,e,n),o=r(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,a=r(e);if(null!==a.el_){Oe=!0;var l={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Oe&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,t,!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===(n=window)||void 0===n||null===(i=n.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 Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Le=function(e){i(e).play()},Pe=function(e){i(e).pause()},Re=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},Ve=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},Ae=function(e){return!!i.getPlayer("".concat(e))},We=function(e){return i(e).paused()},Ce=function(){var e=t(n.mark((function e(t,i){var o,a,l,d=arguments;return n.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(t),e.abrupt("return",new Promise((function(e,n){y(i,a).then((function(n){var r=null==n?void 0:n.data;window.sid=ne(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=Te(r,t);H(r),a&&o?(Ue(t,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){n({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ne=function(){var e=t(n.mark((function e(t,i,o){var a,l,d,u,s,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return u=e.sent,(Y()||null)&&q(i),s=0,m=0,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(d=l.watchHistory)&&void 0!==d&&d.enable&&D(i,u).then((function(e){var t,n,i,o,r,a;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(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 t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,n){h(i,u).then((function(i){var o,a,l,d,u,f,p,w,I,g,E=null==i?void 0:i.data,T=(null==E||null===(o=E.video)||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;H(i.data);var h=(null==E||null===(l=E.ads)||void 0===l||null===(d=l.preRoll)||void 0===d||null===(u=d.adTags)||void 0===u||null===(f=u.web)||void 0===f?void 0:f.active)&&(null==E||null===(p=E.ads)||void 0===p||null===(w=p.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(g=I.web)||void 0===g?void 0:g.url);h&&Fe(t,h,E);var y=Te(E,t);if(y){var b,_,D,O,F,S,L,P,R,V,A,W,C,N,j=(null==E||null===(b=E.video)||void 0===b||null===(_=b.gist)||void 0===_?void 0:_.videoImageUrl)||(null==E||null===(D=E.video)||void 0===D||null===(O=D.gist)||void 0===O||null===(F=O.imageGist)||void 0===F?void 0:F.r16x9),B=r(t);if(B.poster(j),Ue(t,y),B.on("loadstart",(function(){T&&e({status:!0,msg:"Video Loaded",response:E})})),B.on("loadeddata",(function(){ue(),e({status:!0,msg:"Video Loaded",response:E})})),B.one("play",(function(){s&&m<95&&setTimeout((function(){B.currentTime(s)}),0)})),B.one("error",(function(){var e;n({status:!1,msg:(null==B||null===(e=B.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==E||null===(S=E.video)||void 0===S||null===(L=S.contentDetails)||void 0===L||null===(P=L.closedCaptions)||void 0===P?void 0:P.length)>0||(null==E||null===(R=E.video)||void 0===R||null===(V=R.closedCaptions)||void 0===V?void 0:V.length)>0)A=((null==E||null===(W=E.video)||void 0===W||null===(C=W.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==E||null===(N=E.video)||void 0===N?void 0:N.closedCaptions)).filter((function(e){return"VTT"===e.format})),c(t,A);else v(t)}else de(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ke(e,t,n,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),je=function(e,t,n){var i=r(e);return i.src(t),new Promise((function(e,t){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){t("FAILED: Took too long to load")}),n)}))}))},Be=function(e){var t=r(e);if(Me(),a(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},Me=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()},Ue=function(e,t){var n=r(e);n&&n.src(t)},ke=function(t,n,i,o){var r,a,l,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ae(n)&&de(n,(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(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))},xe=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{F as A,k as B,R as C,L as D,Fe as E,De as F,le as G,f as H,b as I,se as J,y as K,Z as L,z as M,J as N,We as O,K as P,O as Q,X as R,q as S,Te as a,H as b,ue as c,Q as d,ie as e,ve as f,G as g,de as h,Y as i,ce as j,je as k,Ue as l,Re as m,Pe as n,Ae as o,Le as p,Ne as q,Ve as r,_ as s,Ce as t,Be as u,xe as v,S as w,h as x,D as y,ke as z};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as a}from"./skin-612c987b.js";import{i as l,d}from"./browser-d4613b36.js";import u from"js-cookie";import s from"ua-parser-js";import{a as c,r as v}from"./captions-59c404fa.js";function m(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,t){m("event",e,t)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel"};function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function g(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?I(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var E={name:"@viewlift/player8",version:"1.0.110",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"^8.21.1","videojs-contrib-ads":"^7.5.2","videojs-contrib-eme":"^5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=E.version;var T,h=function(e,t){var n,i,r,a,l,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.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":F.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({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:t,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,t){var n,i,r,a;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:F.get()+w.getLinearChannelDetails,params:g(g(g(g(g({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t}})},b=function(e,t){var n,i,r=x(t),a=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})})):o({url:F.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},_=function(){var e=t(n.mark((function e(t){var i;return n.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:F.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},t),params:g({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},O=function(e){var t=e.videoId;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},F=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),S=function(e,t,n){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:t},withCredentials:!0})},L=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},P=null;function R(){return{set:function(e){e&&(P=e)},get:function(){return P}}}var V,A,W,C,N,j,B=function(){var e=t(n.mark((function e(){var t,i,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=R().get(),i=F.get(),e.prev=2,e.next=5,axios({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});case 5:return o=e.sent,e.abrupt("return",o);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=null,U=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!L(t)){e.next=6;break}return M||(M=B().then((function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&R().set(r),o||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){M=null}))),e.abrupt("return",M);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t},x=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){A=e},G=function(){return A},z=function(e){V=e},Y=function(){return V},J=function(){return W},K=function(e){W=e},Q=function(){return N},X=function(e){C=new Map,e.map((function(e,t){C.set(e.id,t)}))},q=function(e){if(C){var t=C.get(e);K(t+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ee(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?$(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var te=function(){var e,t,n,i,o,r,a,l=G();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===n||null===(i=n.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)};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 ie(){var e=window.sessionStorage.getItem("uid");return e||(e=ne(),window.sessionStorage.setItem("uid",e),e)}function oe(){return re.apply(this,arguments)}function re(){return(re=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.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)}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 t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e,t){e.one("play",tryCatch((function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),p("PLAY",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.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}),t&&t("Video Start",{"Video ID":te(),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 t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))p("BUFFERING",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:t.el_&&Math.floor(t.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:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.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 t,n,i,o,r,a;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.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}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},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 t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,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 t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(ae(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var ae=function(e,t,n){return e>=t&&e<=n};function le(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=t(n.mark((function e(t){var i,r,a,l,d,u,s,c,v,m,f,p,w,I;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return m=e.sent,f=x(m),p=null==f?void 0:f.site,w=null==f?void 0:f.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:p,cid:w,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=ie(),e.t5=te(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=26,oe();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(l=window)||void 0===l||null===(d=l.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),I=[e.t31],o({url:(null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c||null===(v=c.beacon)||void 0===v?void 0:v.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:m},contentType:"application/x-www-form-urlencoded",dataType:"text",data:I}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var n}),e)})));return function(t){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(e,t){var n=new Map;O({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),N=n})).catch((function(e){return console.log(e)}))},ue=function(){var e=Z.get();return e>=0?e+1:1},se=function(){var e,t,n,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=Z.get(),l=null==i||null===(t=i[a])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1};function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ve(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ce(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ce(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window._deviceInfo=s(navigator.userAgent);var me=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},fe=function(e){var t=pe(e,"video.tags",[]),n=pe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},pe=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},we=function(){var e,t,n,i,o,a,l,d,s,c,v,m,f,p,w,I,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",E=arguments.length>1?arguments[1]:void 0,T=arguments.length>2?arguments[2]:void 0,h=(null==T?void 0:T.contentType)||"video",y=null==T||null===(e=T[h])||void 0===e?void 0:e.metadata,b=r(E);if(!g.includes("VIEWLIFT_"))return g;var _=window.getComputedStyle(document.getElementById(E),null),D=Math.trunc(_.getPropertyValue("height").slice(0,-2)),O=Math.trunc(_.getPropertyValue("width").slice(0,-2)),F="linearchannel"===h?null==T||null===(t=T.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(i=n.find((function(e){return(null==e?void 0:e.id)===(null==T?void 0:T.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:pe(T,"video.gist.id",""),S=ve(ve({},Ie(y)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:D,VIEWLIFT_SIZE:me(O,D),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===(a=window)||void 0===a?void 0:a.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:pe(T,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==b||null===(l=b.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==b||null===(d=b.options_)||void 0===d?void 0:d.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:fe(T),VIEWLIFT_MEDIA_ID:F,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(pe(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:F,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+pe(T,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:pe(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.site)||void 0===v?void 0:v.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:pe(null===(m=window)||void 0===m||null===(f=m.app_data)||void 0===f||null===(p=f.site)||void 0===p?void 0:p.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:F,VIEWLIFT_CONTENT_TITLE:pe(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:pe(T,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:pe(T,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:se(),VIEWLIFT_SEASON_NUMBER:ue(),VIEWLIFT_CONTENT_TAGS:fe(T)},null===(w=window)||void 0===w||null===(I=w.customData)||void 0===I?void 0:I.macros);for(var L in S){var P=new RegExp(L,"g");g=g.replace(P,S[L])}return g},Ie=function(e){var t,n,i,o,r,a,d={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,c=(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 s||c?(l()?s?d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.tve")||""})),d=l()?ve(ve({},d),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):ve(ve({},d),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}),d=l()?ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),d},ge=function(e,t){var n,i,o,r,a,l,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[w])||void 0===n?void 0:n.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[w])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.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 Te(E);if(I){var y=he(g,t);return y.src=we(y.src,t,e),y}if("Safari"!==d()&&h)return Ee(g);if(T){var b=Te(g);return b.src=we(b.src,t,e),b}if(null!=g&&g.mpeg){var _=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(g);return _.src=we(_.src,t,e),_}return null},Ee=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},Te=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},he=function(e,t){var n=e.fairPlay,o=e.widevine,a=e.playReady,l=d();if(r(t),"Safari"===l){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,(function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))}))},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,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,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return ye(t),u}var s={src:o.url,type:"application/dash+xml"};return ye(t),s.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},s};var ye=function(e){var t=r(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==d()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},be=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},_e=function(e,t){if(import("./error-2395864b.js").then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}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(t),o.appendChild(r),i.append(o)}}},De=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Oe=!1,Fe=function(e,t,n){var i=we(t,e,n),o=r(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,a=r(e);if(null!==a.el_){Oe=!0;var l={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Oe&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,t,!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===(n=window)||void 0===n||null===(i=n.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 Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Le=function(e){i(e).play()},Pe=function(e){i(e).pause()},Re=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},Ve=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},Ae=function(e){return!!i.getPlayer("".concat(e))},We=function(e){return i(e).paused()},Ce=function(){var e=t(n.mark((function e(t,i){var o,a,l,d=arguments;return n.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(t),e.abrupt("return",new Promise((function(e,n){y(i,a).then((function(n){var r=null==n?void 0:n.data;window.sid=ne(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=ge(r,t);H(r),a&&o?(Ue(t,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){n({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ne=function(){var e=t(n.mark((function e(t,i,o){var a,l,d,u,s,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return u=e.sent,(Y()||null)&&q(i),s=0,m=0,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(d=l.watchHistory)&&void 0!==d&&d.enable&&D(i,u).then((function(e){var t,n,i,o,r,a;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(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 t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,n){h(i,u).then((function(i){var o,a,l,d,u,f,p,w,I,g,E=null==i?void 0:i.data,T=(null==E||null===(o=E.video)||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;H(i.data);var h=(null==E||null===(l=E.ads)||void 0===l||null===(d=l.preRoll)||void 0===d||null===(u=d.adTags)||void 0===u||null===(f=u.web)||void 0===f?void 0:f.active)&&(null==E||null===(p=E.ads)||void 0===p||null===(w=p.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(g=I.web)||void 0===g?void 0:g.url);h&&Fe(t,h,E);var y=ge(E,t);if(y){var b,_,D,O,F,S,L,P,R,V,A,W,C,N,j=(null==E||null===(b=E.video)||void 0===b||null===(_=b.gist)||void 0===_?void 0:_.videoImageUrl)||(null==E||null===(D=E.video)||void 0===D||null===(O=D.gist)||void 0===O||null===(F=O.imageGist)||void 0===F?void 0:F.r16x9),B=r(t);if(B.poster(j),Ue(t,y),B.on("loadstart",(function(){T&&e({status:!0,msg:"Video Loaded",response:E})})),B.on("loadeddata",(function(){De(),e({status:!0,msg:"Video Loaded",response:E})})),B.one("play",(function(){s&&m<95&&setTimeout((function(){B.currentTime(s)}),0)})),B.one("error",(function(){var e;n({status:!1,msg:(null==B||null===(e=B.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==E||null===(S=E.video)||void 0===S||null===(L=S.contentDetails)||void 0===L||null===(P=L.closedCaptions)||void 0===P?void 0:P.length)>0||(null==E||null===(R=E.video)||void 0===R||null===(V=R.closedCaptions)||void 0===V?void 0:V.length)>0)A=((null==E||null===(W=E.video)||void 0===W||null===(C=W.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==E||null===(N=E.video)||void 0===N?void 0:N.closedCaptions)).filter((function(e){return"VTT"===e.format})),c(t,A);else v(t)}else _e(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ke(e,t,n,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),je=function(e,t,n){var i=r(e);return i.src(t),new Promise((function(e,t){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){t("FAILED: Took too long to load")}),n)}))}))},Be=function(e){var t=r(e);if(Me(),a(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},Me=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()},Ue=function(e,t){var n=r(e);n&&n.src(t)},ke=function(t,n,i,o){var r,a,l,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ae(n)&&_e(n,(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(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))},xe=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{Le as A,Pe as B,Ve as C,Ae as D,Ne as E,Ce as F,Be as G,S as H,F as I,f as J,k as K,R as L,L as M,J as N,We as O,K as P,O as Q,X as R,q as S,Z as T,ie as a,se as b,Y as c,ue as d,ge as e,H as f,G as g,De as h,_e as i,Q as j,le as k,Ue as l,Fe as m,be as n,xe as o,h as p,D as q,ke as r,_ as s,U as t,y as u,b as v,de as w,z as x,je as y,Re as z};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-2882ecc4.js";import{N as n,i as r,g as i}from"./generic-46a48054.js";import{s as o}from"./autoNextVideo-2b476e56.js";import a from"@babel/runtime/helpers/typeof";import l from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/defineProperty";import d from"@babel/runtime/helpers/slicedToArray";var p,m,v,f,h=[],g=function(i,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=r();null==u||u.map((function(t){var n;return(n=h).push.apply(n,e(t.episodes))})),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=h.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var L=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],B=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],M=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=M)||void 0===w?void 0:w.length)>60&&(M=M.substr(0,60)+"..."),L.textContent="".concat(M),B.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return x(i)}}else{var P,j,O,S,R,X,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var $=null===(P=m[0])||void 0===P?void 0:P.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=m[0])||void 0===j||null===(O=j.gist)||void 0===O||null===(S=O.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(X=window)||void 0===X||null===(D=X.customData)||void 0===D?void 0:D.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(F=$)||void 0===F?void 0:F.length)>60&&($=$.substr(0,60)+"..."),W.textContent="".concat($);var _=document.createElement("div");_.className="next-ep-content",_.append(V),_.append(W),_.onclick=function(){return x(i)},U.append(G),U.append(_)}},x=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,h)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function b(e){return w.apply(this,arguments)}function w(){return(w=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=d(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function N(e){return k.apply(this,arguments)}function k(){return(k=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return b(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},c(n,"left","-60px"),c(n,"border","1px solid transparent"),c(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===a(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},v=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},f=function e(t){return"HTML"!==t.nodeName&&"static"===v(t)("position")?e(t.offsetParent):t},l.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=m({},p,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,h,g,x;for(l in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=f(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=v(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+h-p:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var T=function(){var e=u(s.mark((function e(t,n){var r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function A(e){return L.apply(this,arguments)}function L(){return(L=u(s.mark((function e(t){var n,r,o,a,l,u,c,p,m,v,f,h,g,x,y,b,w,E,C,N,k,T,A,L,B,I,M,P,j,O;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:c=e.sent,p=new DOMParser,m=p.parseFromString(c,"application/xml"),v=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,f=(null==m||null===(a=m.getElementsByTagName("BaseURL"))||void 0===a||null===(l=a[0])||void 0===l?void 0:l.textContent)||n,h=m.getElementsByTagName("AdaptationSet"),g=0;case 14:if(!(g<h.length)){e.next=38;break}if(("image"!==(x=h[g]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=d(C,2),k=N[0],T=N[1],!y){e.next=35;break}for(y.getAttribute("media"),A=y.getAttribute("duration"),L=y.getAttribute("timescale"),B=A/(L||A/(k*T)),I=b.getAttribute("id"),M=Math.round(v/B),P=Math.ceil(M/k*T),j=y.getAttribute("media"),O=[],g=0;g<P;g++)O.push({duration:B,layout:E,uri:f+j.replace("$Number$",g).replace("$RepresentationID$",I)});return e.abrupt("return",O);case 35:g++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function B(e){return I.apply(this,arguments)}function I(){return(I=u(s.mark((function e(n){var r,i,o,a,l,u,c,d,p,m,v,f,h,g,x,y;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,E(d);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,T(f,v);case 12:return h=e.sent,e.next=15,N(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,A(d);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,N(x);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{g as a,M as b,B as i};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-612c987b.js";import{N as n,c as r,g as i}from"./generic-4c43a94b.js";import{s as o}from"./autoNextVideo-d84f6aba.js";import a from"@babel/runtime/helpers/typeof";import l from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/defineProperty";import d from"@babel/runtime/helpers/slicedToArray";var p,m,v,f,h=[],g=function(i,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=r();null==u||u.map((function(t){var n;return(n=h).push.apply(n,e(t.episodes))})),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=h.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var L=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],B=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],M=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=M)||void 0===w?void 0:w.length)>60&&(M=M.substr(0,60)+"..."),L.textContent="".concat(M),B.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return x(i)}}else{var P,j,O,S,R,X,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var $=null===(P=m[0])||void 0===P?void 0:P.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=m[0])||void 0===j||null===(O=j.gist)||void 0===O||null===(S=O.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(X=window)||void 0===X||null===(D=X.customData)||void 0===D?void 0:D.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(F=$)||void 0===F?void 0:F.length)>60&&($=$.substr(0,60)+"..."),W.textContent="".concat($);var _=document.createElement("div");_.className="next-ep-content",_.append(V),_.append(W),_.onclick=function(){return x(i)},U.append(G),U.append(_)}},x=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,h)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function b(e){return w.apply(this,arguments)}function w(){return(w=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=d(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function N(e){return k.apply(this,arguments)}function k(){return(k=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return b(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},c(n,"left","-60px"),c(n,"border","1px solid transparent"),c(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===a(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},v=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},f=function e(t){return"HTML"!==t.nodeName&&"static"===v(t)("position")?e(t.offsetParent):t},l.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=m({},p,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,h,g,x;for(l in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=f(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=v(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+h-p:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var T=function(){var e=u(s.mark((function e(t,n){var r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function A(e){return L.apply(this,arguments)}function L(){return(L=u(s.mark((function e(t){var n,r,o,a,l,u,c,p,m,v,f,h,g,x,y,b,w,E,C,N,k,T,A,L,B,I,M,P,j,O;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:c=e.sent,p=new DOMParser,m=p.parseFromString(c,"application/xml"),v=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,f=(null==m||null===(a=m.getElementsByTagName("BaseURL"))||void 0===a||null===(l=a[0])||void 0===l?void 0:l.textContent)||n,h=m.getElementsByTagName("AdaptationSet"),g=0;case 14:if(!(g<h.length)){e.next=38;break}if(("image"!==(x=h[g]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=d(C,2),k=N[0],T=N[1],!y){e.next=35;break}for(y.getAttribute("media"),A=y.getAttribute("duration"),L=y.getAttribute("timescale"),B=A/(L||A/(k*T)),I=b.getAttribute("id"),M=Math.round(v/B),P=Math.ceil(M/k*T),j=y.getAttribute("media"),O=[],g=0;g<P;g++)O.push({duration:B,layout:E,uri:f+j.replace("$Number$",g).replace("$RepresentationID$",I)});return e.abrupt("return",O);case 35:g++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function B(e){return I.apply(this,arguments)}function I(){return(I=u(s.mark((function e(n){var r,i,o,a,l,u,c,d,p,m,v,f,h,g,x,y;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,E(d);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,T(f,v);case 12:return h=e.sent,e.next=15,N(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,A(d);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,N(x);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{g as a,M as b,B as i};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import{s as e,g as n,a as t,l as o,b as i,c as l,h as r,d as a,e as s,f as u,i as c,j as d,k as v,m as p,p as m,n as f,r as y,o as h,q as g,t as w,u as b,v as k,w as O,x as S,y as j,z as T,A as P,B as I,C as x,D,E,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M as H}from"./generic-46a48054.js";import M from"@babel/runtime/helpers/asyncToGenerator";import U from"@babel/runtime/helpers/defineProperty";import B from"@babel/runtime/regenerator";import F from"video.js";import{g as z,i as q,a as K}from"./skin-2882ecc4.js";import{d as G}from"./browser-d4613b36.js";import J from"@babel/runtime/helpers/typeof";import{o as W,g as X,a as Y,s as Q,b as Z}from"./util-6f289757.js";import{e as $,d as ee,g as ne,a as te}from"./captions-6cc39cdc.js";import{g as oe}from"./renditions-c0f96578.js";import{playSelectedResolution as ie}from"./resolution-00449d8d.js";import{s as le}from"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var re,ae=function(e){return new Promise((function(n,t){if(se(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)}}))},se=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ue=function(){var e=M(B.mark((function e(n){var t,o,i,l;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=z(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return l=e.sent,e.prev=6,e.next=9,ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,l.default(F),e.finish(14);case 17:null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==G()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),ce=function(e,n){var t=z(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=F.dom.getPointerPosition(a,n).x;F.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===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.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()}}))};function de(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 ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?de(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):de(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pe=[],me=0,fe=null;function ye(t,o,i){var l,r,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(l=o.watchHistory)||void 0===l||l.apiVersion;var d=null==o||null===(r=o.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var m=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,f=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(t.currentTime()),h=c?100:Math.floor(v/p*100),g={};f?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=he(i),r=(new Date).getTime(),a=n(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ve(ve({},e),{},U({},n,s[n]))}),{}),c=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===re}));c<0?l.push(ve(ve({content:u},e),{},{addedDate:r,updateDate:r})):l[c]=ve(ve(ve({},l[c]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(g={completed:c,watchedTime:y,watchedPercentage:h},d,o.siteOwner):(g=ve(ve({videoId:re,watchedTime:y,watchedPercentage:h,doneWatching:c,profileId:d},fe&&{seriesId:fe}),m&&{originalObjectId:m}),e(g).then((function(e){})).catch((function(e){}))),me=v+i}function he(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ge(e,n,t){var o=he(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var we=function(e,n,t){var o=z(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},be=function(e){var n=z(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ke=!1,Oe=function(e,n){var i,l,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(i=e[r])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.secondaryVideoAssets)||null)&&!ke){var a=Se(e,"videoAssets","secondaryVideoAssets"),s=t(a,n);return s&&o(n,s),ke=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Se(e,n,t){if(Array.isArray(e))return e.map((function(e){return Se(e,n,t)}));if(null!==e&&"object"===J(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Se(e[i],n,t)})),o}return e}function je(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 Te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?je(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Pe=function(e,t,o,s){var u,c,d=s.res,v=s.sres,p=z(e),m=(null==d?void 0:d.contentType)||"video",f=(null==d||null===(u=d[m])||void 0===u||null===(c=u.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;i(d),p&&(p.on("loadstart",(function(){f?o.resolve({status:!0,msg:"Video Loaded",response:d}):o.resolve(Te({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:d}:{response:d}))})),p.on("loadeddata",(function(){var o,i,r;(null==p||!p.muted())&&we(e,sessionStorage.getItem("volume")||"100");var a=n();if(l(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,u,c=Te(Te({},t),d);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(fe=null==n||null===(i=n.series)||void 0===i?void 0:i.id),pe=[],me=0,re=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=z(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());pe.includes(me)||(e==me?(pe.push(e),ye(a,n,r)):e>me&&(me=e+r))})),a.one("ended",(function(){ye(a,n,r,!0)})))}(e,c,null==a||null===(s=a.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=p&&p.mux){var v,m,f,y,h,g,w=(null===(v=n())||void 0===v?void 0:v.video)||(null==d?void 0:d.video),b=null==w?void 0:w.gist,k={env_key:null==t||null===(m=t.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(f=window)||void 0===f?void 0:f.vl_player_version,video_id:null==b?void 0:b.id,video_title:null==b?void 0:b.title,video_series:null==w||null===(y=w.series)||void 0===y?void 0:y.title,video_stream_type:null!=w&&null!==(h=w.streamingInfo)&&void 0!==h&&h.isLiveStream?"live":"video",viewer_user_id:null==t||null===(g=t.analytics)||void 0===g?void 0:g.userId};p.mux({debug:!1,data:k})}})),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,o,i,l,r,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,m=null===(a=window)||void 0===a||null===(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"===p){var f,y=m.getMediaSession(),h=y.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(f)}})),p.tech_.on("retryplaylist",(function(){f&&Oe(d,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&f)?Oe(d,e):(r(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),o.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:d}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,l,r=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,s=a(),u=(null==s?void 0:s.get(r))||{t:0,p:0},c=u.t,d=u.p;c&&d<95&&setTimeout((function(){p.currentTime(c)}),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(f){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},Ie=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-a3dc3a00.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-8cdb3e1d.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-5ed4c85e.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-62f6d88c.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-852c6ec1.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-980707cc.js").then((function(t){t.initialiseSkin(e,n)}))};var xe=function(){var e=M(B.mark((function e(){return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ae("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)}}(),De=function(){var e=M(B.mark((function e(){return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){F.getPlugin("eme")||F.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=M(B.mark((function e(){var n;return B.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(F),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)}}(),Ce=function(){var e=M(B.mark((function e(){return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-0b54f83d.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)}}(),Re=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(F)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(F)}))},loadAdsLibrary:xe,loadEMELibrary:De,loadMuxPlugin:Ee,loadDvrSeekbar:Ce});function Ne(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 Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ne(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Le=new Set,_e=null,Ve=function(e,n,t){var o,i,l,r,a,u,d,v,p,m={},f=(null==e?void 0:e.contentType)||"video";m[null==t||null===(o=t.Constants)||void 0===o?void 0:o.ASSET_NAME]=ze(e),m["c3.cm.id"]=(null===(i=e[f])||void 0===i?void 0:i.id)||"Null",m["c3.cm.contentType"]=qe(e),m[null==t||null===(l=t.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==e||!e.linearchannel),m[null==t||null===(r=t.Constants)||void 0===r?void 0:r.STREAM_URL]=n.currentSrc(),m[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===s()?"NULL":s(),m["c3.cm.categoryType"]=Be(e),m[null==t||null===(u=t.Constants)||void 0===u?void 0:u.PLAYER_NAME]="VL_WEB_PLAYER",m["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"}}(),m.DRMEnabled=(null===(d=e[f])||void 0===d?void 0:d.drmEnabled)||"None",m.DAIStream=null!==(v=e[f])&&void 0!==v&&null!==(p=v.gist)&&void 0!==p&&p.isSSAIEnabled?"YES":"NO",m[t.Constants.DEFAULT_RESOURCE]="AKAMAI",m["c3.cm.brand"]="NULL",m.CDVREnabled=Fe(e),m["c3.cm.genreList"]=Me(e),m["c3.cm.genre"]=He(e),m["c3.cm.channel"]=Ue(e);var y=Ge(c(),e);return m=Ae(Ae({},m),y)},He=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},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"},Ue=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"NULL":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},Be=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(o=t[0])||void 0===o?void 0:o.title)||"Null";var n,t,o},Fe=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},ze=function(e){var n,t,o,i,l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[l])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(o=e[l])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(r)},qe=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Ke,Ge=function(e,n){var t,o,i,l,r,a={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return a;var s=d(),c=u();return a["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",a["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",a["c3.cm.showTitle"]=(null==e||null===(i=e[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(r=l[c-1])||void 0===r?void 0:r.title)||"Null",a["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",a},Je=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"}},We=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Xe=function(){var e=M(B.mark((function e(t,o){var i,l,r,a,s,u,c,d,v;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,r=i.paymentHandler,a=i.tveProvider,s=i.enable,u=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(c=z(t),"function"==typeof(d=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,d("getConvivaObject");case 10:if(v=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready((function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Je(t.keySystem);d("contentInfo",{DRMEnabled:o})}else d("contentInfo",{DRMEnabled:"None"})})),n||d("contentInfo",{DRMEnabled:"None"})})),c.on("loadstart",(function(){_e&&_e!==c.currentSrc()&&d("playbackEnded"),d("setPlayer",c),Le.clear(),_e=c.currentSrc();var e=We(c.currentType()),t=n(),o=Ve(t,c,v);o.authToken=u||"NULL",o.streamType=e,o.D2CType=r||"NONE",o.subscriberType=a||(r?"D2C":"FREE"),o["c3.cm.affiliate"]=a||"NULL",d("contentInfo",o)})),c.on("loadedmetadata",(function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),d("contentInfo",{screenResolution:e})})),c.on("play",(function(){Le.has(c.currentSrc())||(Le.add(c.currentSrc()),d("playbackStarted",null))})),c.on("ended",(function(){Le.has(c.currentSrc())&&Le.delete(c.currentSrc()),d("playbackEnded")})),c.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&d("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})})),c.on("dispose",(function(){null==Le||Le.clear(),d("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();function Ye(e){return Qe.apply(this,arguments)}function Qe(){return(Qe=M(B.mark((function e(n){var t,o,i,l,r,a,s,u,c,d,v,p;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:i=this.el().querySelector("video")||this.el(),l=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),r=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),l&&i?(l.initialize(i,n.src,!0),r&&(c=null===(a=n.keySystems["com.widevine.alpha"])||void 0===a?void 0:a.url,d=null===(s=n.keySystems["com.microsoft.playready"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.widevine.alpha"])||void 0===u?void 0:u.licenseHeaders["X-AxDRM-Message"],p={"com.widevine.alpha":{serverURL:c,httpRequestHeaders:{"X-AxDRM-Message":v}},"com.microsoft.playready":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":v}}},l.setProtectionData(p))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Ze(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function $e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ze(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ze(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var en=function(e,n,i,l){var a,s,u,c,d,v,p,m,f,y,h,g,w,b,O,S,j,T,P,I,x,D,N,A,L,_,V,H,q,J,W,X,Y,Q=n.res,Z=void 0===Q?null:Q,$=n.sres,ee=void 0===$?null:$;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||d.S;var ne=null!=i&&i.chromecastReceiverId?["chromecast","html5"]:["html5"],oe=(null===(v=Z)||void 0===v?void 0:v.contentType)||"video",ie=K(null===(p=Z)||void 0===p||null===(m=p[oe])||void 0===m||null===(f=m.gist)||void 0===f?void 0:f.videoImageUrl)||K(null===(y=Z)||void 0===y||null===(h=y[oe])||void 0===h||null===(g=h.gist)||void 0===g||null===(w=g.imageGist)||void 0===w?void 0:w.r16x9),le=(null===(b=Z)||void 0===b||null===(O=b[oe])||void 0===O||null===(S=O.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,re=(null===(j=Z)||void 0===j||null===(T=j[oe])||void 0===T||null===(P=T.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,ae=(null==i?void 0:i.showPositiveSeekbar)||!1,se=(null===(I=Z)||void 0===I||null===(x=I.ads)||void 0===x||null===(D=x.preRoll)||void 0===D||null===(N=D.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.active)&&(null===(L=Z)||void 0===L||null===(_=L.ads)||void 0===_||null===(V=_.preRoll)||void 0===V||null===(H=V.adTags)||void 0===H||null===(q=H.web)||void 0===q?void 0:q.url);Z=$e($e({},Z),{},{audioAssetSource:null==i?void 0:i.audioAssetSource});var de=(Y={enableSmoothSeeking:!0,controls:0!=(null==i?void 0:i.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==i?void 0:i.muted)||!1,autoplay:(null==i?void 0:i.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==i.skin,liveui:le},U(Y,"autoplay",null==i?void 0:i.autoplay),U(Y,"normalizeAutoplay",(null==i?void 0:i.autoplay)&&!se),U(Y,"loop",(null==i?void 0:i.loop)||!1),U(Y,"audioPosterMode",null==i?void 0:i.audioPosterMode),U(Y,"html5",$e($e({vhs:$e($e({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==i?void 0:i.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==i||null===(J=i.customData)||void 0===J?void 0:J.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!0},0==(null==i||null===(W=i.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==i||null===(X=i.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),U(Y,"poster",ie),U(Y,"techOrder",ne),U(Y,"chromecast",{requestCustomDataFn:function(n){var t=z(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,l,r,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var f;m.isDrmEnabled=!0;var y=(null==n||null===(f=n.keySystems)||void 0===f?void 0:f["com.widevine.alpha"])||null,h=null==y?void 0:y.url;m.licenseUrl=h;var g=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];m.licenseToken=g}var w=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=w;var b=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;m.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return m.mediaImage=O,m.subTitles=t,m.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Z,n,o)}}),Y);if(!F.getPlayers()[e])var ve=F(e,de,function(){var n=M(B.mark((function n(){var a,s,u,c,d,v,p,m,f,y,h,g,w,b,O,S,j,T,P,I,x,D,N,A,L,_;return B.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ve),console.log(F.VERSION),console.log(F.getPlugins()),n.next=5,ue(i);case 5:if(null!=i&&null!==(a=i.analytics)&&void 0!==a&&a.muxKey&&Ee(),re&&l.resolve($e({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),R(e,null==i?void 0:i.analyticsCb),Xe(e,i),/Android/i.test(navigator.userAgent)&&(F.options.vhs.overrideNative=!0),j=null===(s=Z)||void 0===s||null===(u=s[oe])||void 0===u?void 0:u.drmEnabled,T=null===(c=Z)||void 0===c||null===(d=c[oe])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.startOverTime,!j){n.next=15;break}return n.next=15,De();case 15:if(!le||!ae){n.next=18;break}return n.next=18,Ce();case 18:le&&ce(e,T),!se||null!=i&&null!==(p=i.customData)&&void 0!==p&&p.disableAds||E(e,se,Z),P=t(Z,e),console.log(P),null!=i&&i.nearestClusterUrl&&(P=C(P,i.nearestClusterUrl)),"Chrome"==G()&&(null===(m=Z)||void 0===m||null===(f=m.video)||void 0===f?void 0:f.isSSAIEnabled)?Ye.call(this,P):P?o(e,P):(l.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),r(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(y=Z)||void 0===y||null===(h=y[oe])||void 0===h||null===(g=h.contentDetails)||void 0===g||null===(w=g.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(b=Z)||void 0===b||null===(O=b[oe])||void 0===O||null===(S=O.closedCaptions)||void 0===S?void 0:S.length)>0)&&(_=(null===(x=Z)||void 0===x||null===(D=x[oe])||void 0===D||null===(N=D.contentDetails)||void 0===N?void 0:N.closedCaptions)||(null===(A=Z)||void 0===A||null===(L=A[oe])||void 0===L?void 0:L.closedCaptions),I=_.filter((function(e){return"VTT"===e.format})),te(e,I)),null!=i&&i.disableControls?k(e):Ie(e,$e($e($e({},i),de),{},{liveVideo:re,isDvrEnabled:le,res:Z,sres:ee})),Pe(e,$e($e($e({},i),de),{},{liveVideo:re}),l,{res:Z,sres:ee});case 28:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function nn(){return{loadVideoInstantly:v,onTimeUpdate:W,getVideoDuration:X,onVideoEnded:Y,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c FINAL-1 ","background: #bdf369; color: #000"),new Promise(function(){var n=M(B.mark((function n(t,o){var l,r,a,s,u,c,d,v,p,m,f,y,g,w,b,k,O,E,C,R,M,U,F,z,K,J,W;return B.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!h(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,g=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,w=null==e?void 0:e.videoId,b=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=w,k=null==e?void 0:e.token,!I(e)){n.next=15;break}if(x().set(null==e?void 0:e.refreshToken),k&&!D(k)){n.next=14;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 14:Ke=JSON.parse(atob(k.split(".")[1]));case 15:return e.isAnonymousUser=!(null===(a=Ke)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=Ke)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=Ke)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=Ke)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k),O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(d=e.series)&&void 0!==d&&d.enable?null:null==e?void 0:e.chromecastReceiverId,E=null==e?void 0:e.airplay,C=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,(R=null==e?void 0:e.errors)&&(window.customErrors=R),window.customData=null==e?void 0:e.customData,le(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),P.set(e.apiBaseUrl),null!=e&&e.skin&&!q(e.skin)||(e.skin="VL_ONE"),n.next=33,xe();case 33:E&&"Safari"==G()&&Promise.resolve().then((function(){return Re})).then((function(e){e.importAirplay()})),C&&ae("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then((function(){return N(C)})).catch((function(e){})),(M=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(O)))&&M.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(F={directPlaybackUrl:f,id:U="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?S(U,k).then((function(n){en(O,{res:$e($e({},n),F)},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,U)})):en(O,{res:F},e,{resolve:t,reject:o})):b?(K=sessionStorage.getItem("season-idx")||0,V.set(parseInt(K)),J=null==e||null===(z=e.series)||void 0===z?void 0:z.id,A(J,k).then((function(n){var l,r,a,s=n.data,u=n.data.seasons;H(u);var c=w||(null==u||null===(l=u[0])||void 0===l||null===(r=l.episodes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.id);L(J,k),S(c,k).then((function(n){var l,r,a;window.contentType=null==n||null===(l=n.data)||void 0===l||null===(r=l.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,i(n.data),en(O,{res:null==n?void 0:n.data,sres:s},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}))})).catch((function(e){T(e,O,o)}))):g?(W=null==e?void 0:e.epg,_(W,k).then((function(n){var i=null==n?void 0:n.data;i.contentType="linearchannel",i.channelId=null==W?void 0:W.channelId,en(O,{res:i},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}))):S(w,k).then((function(n){var l,r,a,s;window.contentType=null==n||null===(l=n.data)||void 0===l||null===(r=l.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,i(null==n?void 0:n.data);var u,c=null==n?void 0:n.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(u=e.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var d,v,p,m=ge((null===(d=e.watchHistory)||void 0===d?void 0:d.profileId)||"",w,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;c.contentType="video",en(O,{res:c},e,{resolve:t,reject:o})}else j(w,k).then((function(n){var i,l,r,a,s,u;null!==(i=window)&&void 0!==i&&null!==(l=i.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(s=n.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,c.contentType="video",en(O,{res:c},e,{resolve:t,reject:o})})).catch((function(n){var i,l,r,a;null!==(i=window)&&void 0!==i&&null!==(l=i.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(n)),en(O,{res:c},e,{resolve:t,reject:o})}));else en(O,{res:c},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}));case 38:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:p,getPlayer:z,play:m,pause:f,detectBrowser:G,rewind:y,loadVideo:o,seekToTimeStamp:Q,isPlayerInitialised:h,load:g,authenticateLC:w,dispose:b,enableCaptions:$,disableCaptions:ee,getCaptions:ne,playSelectedResolution:ie,getSource:t,setVolume:we,getVolume:be,disableControls:k,setPlaybackSpeed:Z,getEntitlementData:O}}export{nn as default};
1
+ import"video.js/dist/video-js.min.css";import{s as e,g as n,a as t,b as o,c as i,d as r,e as l,l as a,f as s,h as u,i as c,j as d,k as v,m as p,n as f,o as m,p as y,q as h,r as g,t as w,u as b,v as k,w as O,x as j,y as S,z as P,A as T,B as I,C as x,D,E,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M}from"./generic-4c43a94b.js";import H from"@babel/runtime/helpers/defineProperty";import U from"@babel/runtime/helpers/asyncToGenerator";import B from"@babel/runtime/regenerator";import F from"video.js";import{o as z,g as q,a as K,s as G,b as J}from"./util-435845ca.js";import{a as W,e as X,d as Y,g as Q}from"./captions-59c404fa.js";import{g as Z}from"./renditions-16e1a2db.js";import{playSelectedResolution as $}from"./resolution-a5e1082b.js";import{g as ee,i as ne,a as te}from"./skin-612c987b.js";import{d as oe}from"./browser-d4613b36.js";import{s as ie}from"./localisation-0bf399a1.js";import re from"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var le,ae=function(e){return new Promise((function(n,t){if(se(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)}}))},se=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ue=function(e,n,t){var o=ee(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ce=function(e){var n=ee(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function de(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 ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?de(Object(t),!0).forEach((function(n){H(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):de(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pe=[],fe=0,me=null;function ye(t,o,i){var r,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var d=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var f=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(t.currentTime()),h=c?100:Math.floor(v/p*100),g={};m?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=he(i),l=(new Date).getTime(),a=n(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ve(ve({},e),{},H({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===le}));c<0?r.push(ve(ve({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=ve(ve(ve({},r[c]),e),{},{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(g={completed:c,watchedTime:y,watchedPercentage:h},d,o.siteOwner):(g=ve(ve({videoId:le,watchedTime:y,watchedPercentage:h,doneWatching:c,profileId:d},me&&{seriesId:me}),f&&{originalObjectId:f}),e(g).then((function(e){})).catch((function(e){}))),fe=v+i}function he(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ge(e,n,t){var o=he(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var we=function(){var e=U(B.mark((function e(n){var t,o,i,r;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=ee(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return r=e.sent,e.prev=6,e.next=9,ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,r.default(F),e.finish(14);case 17:null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==oe()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),be=function(e,n){var t=ee(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=F.dom.getPointerPosition(a,n).x;F.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===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.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 ke=function(){var e=U(B.mark((function e(){return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ae("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)}}(),Oe=function(){var e=U(B.mark((function e(){return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){F.getPlugin("eme")||F.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=function(){var e=U(B.mark((function e(){var n;return B.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(F),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)}}(),Se=function(){var e=U(B.mark((function e(){return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-0b54f83d.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)}}(),Pe=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(F)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(F)}))},loadAdsLibrary:ke,loadEMELibrary:Oe,loadMuxPlugin:je,loadDvrSeekbar:Se});function Te(e){return Ie.apply(this,arguments)}function Ie(){return(Ie=U(B.mark((function e(n){var t;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,ke();case 3:t&&"Safari"==detectBrowser()&&Promise.resolve().then((function(){return Pe})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(e,n){return De.apply(this,arguments)}function De(){return De=U(B.mark((function e(n,t){var o,i,r,l,a,s,u;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=(null==t?void 0:t.contentType)||"video",a=null==t||null===(o=t[l])||void 0===o?void 0:o.drmEnabled,s=(null==t||null===(i=t[l])||void 0===i||null===(r=i.liveDetails)||void 0===r?void 0:r.isDvrEnabled)||!1,e.prev=3,e.next=6,Promise.allSettled([a?Oe():null,we(n),null!=n&&null!==(u=n.analytics)&&void 0!==u&&u.muxKey?loadMuxPlugin():null,s&&showPositiveSeekbar?Se():null]);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.log("Error",e.t0);case 11:case"end":return e.stop()}}),e,null,[[3,8]])}))),De.apply(this,arguments)}function Ee(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ce(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(t),!0).forEach((function(n){H(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Re=new Set,Ne=null,Ae=function(e,n,o){var r,l,a,s,u,c,d,v,p,f={},m=(null==e?void 0:e.contentType)||"video";f[null==o||null===(r=o.Constants)||void 0===r?void 0:r.ASSET_NAME]=Ue(e),f["c3.cm.id"]=(null===(l=e[m])||void 0===l?void 0:l.id)||"Null",f["c3.cm.contentType"]=Be(e),f[null==o||null===(a=o.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),f[null==o||null===(s=o.Constants)||void 0===s?void 0:s.STREAM_URL]=n.currentSrc(),f[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===t()?"NULL":t(),f["c3.cm.categoryType"]=Me(e),f[null==o||null===(c=o.Constants)||void 0===c?void 0:c.PLAYER_NAME]="VL_WEB_PLAYER",f["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"}}(),f.DRMEnabled=(null===(d=e[m])||void 0===d?void 0:d.drmEnabled)||"None",f.DAIStream=null!==(v=e[m])&&void 0!==v&&null!==(p=v.gist)&&void 0!==p&&p.isSSAIEnabled?"YES":"NO",f[o.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=He(e),f["c3.cm.genreList"]=_e(e),f["c3.cm.genre"]=Le(e),f["c3.cm.channel"]=Ve(e);var y=Fe(i(),e);return f=Ce(Ce({},f),y)},Le=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},_e=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"},Ve=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"NULL":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},Me=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(o=t[0])||void 0===o?void 0:o.title)||"Null";var n,t,o},He=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Ue=function(e){var n,t,o,i,r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(o=e[r])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(l)},Be=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Fe=function(e,n){var t,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=o();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(i=t.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},ze=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"}},Ke=function(){var e=U(B.mark((function e(t,o){var i,r,l,a,s,u,c,d,v;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(c=ee(t),"function"==typeof(d=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,d("getConvivaObject");case 10:if(v=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready((function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=ze(t.keySystem);d("contentInfo",{DRMEnabled:o})}else d("contentInfo",{DRMEnabled:"None"})})),n||d("contentInfo",{DRMEnabled:"None"})})),c.on("loadstart",(function(){Ne&&Ne!==c.currentSrc()&&d("playbackEnded"),d("setPlayer",c),Re.clear(),Ne=c.currentSrc();var e=qe(c.currentType()),t=n(),o=Ae(t,c,v);o.authToken=u||"NULL",o.streamType=e,o.D2CType=l||"NONE",o.subscriberType=a||(l?"D2C":"FREE"),o["c3.cm.affiliate"]=a||"NULL",d("contentInfo",o)})),c.on("loadedmetadata",(function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),d("contentInfo",{screenResolution:e})})),c.on("play",(function(){Re.has(c.currentSrc())||(Re.add(c.currentSrc()),d("playbackStarted",null))})),c.on("ended",(function(){Re.has(c.currentSrc())&&Re.delete(c.currentSrc()),d("playbackEnded")})),c.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&d("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})})),c.on("dispose",(function(){null==Re||Re.clear(),d("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Ge=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-d3aae505.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-842d8d4f.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-b1a6b7e1.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-96fd066b.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-6b668dbc.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-f7160fdb.js").then((function(t){t.initialiseSkin(e,n)}))},Je=!1,We=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Je){var r=Xe(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),Je=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Xe(e,n,t){if(Array.isArray(e))return e.map((function(e){return Xe(e,n,t)}));if(null!==e&&"object"===re(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Xe(e[i],n,t)})),o}return e}function Ye(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 Qe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ye(Object(t),!0).forEach((function(n){H(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ye(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ze=function(e,t,o,i){var r,l,a=i.res,v=i.sres,p=ee(e),f=(null==a?void 0:a.contentType)||"video",m=(null==a||null===(r=a[f])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;s(a),p&&(p.on("loadstart",(function(){m?o.resolve({status:!0,msg:"Video Loaded",response:a}):o.resolve(Qe({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:a}:{response:a}))})),p.on("loadeddata",(function(){var o,i,r;(null==p||!p.muted())&&ue(e,sessionStorage.getItem("volume")||"100");var l=n();if(u(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,c,d=Qe(Qe({},t),a);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(me=null==n||null===(i=n.series)||void 0===i?void 0:i.id),pe=[],fe=0,le=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=ee(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());pe.includes(fe)||(e==fe?(pe.push(e),ye(a,n,l)):e>fe&&(fe=e+l))})),a.one("ended",(function(){ye(a,n,l,!0)})))}(e,d,null==l||null===(s=l.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=p&&p.mux){var v,f,m,y,h,g,w=(null===(v=n())||void 0===v?void 0:v.video)||(null==a?void 0:a.video),b=null==w?void 0:w.gist,k={env_key:null==t||null===(f=t.analytics)||void 0===f?void 0:f.muxKey,player_name:"vl-web-player",player_version:null===(m=window)||void 0===m?void 0:m.vl_player_version,video_id:null==b?void 0:b.id,video_title:null==b?void 0:b.title,video_series:null==w||null===(y=w.series)||void 0===y?void 0:y.title,video_stream_type:null!=w&&null!==(h=w.streamingInfo)&&void 0!==h&&h.isLiveStream?"live":"video",viewer_user_id:null==t||null===(g=t.analytics)||void 0===g?void 0:g.userId};p.mux({debug:!1,data:k})}})),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,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=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"===p){var m,y=f.getMediaSession(),h=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),p.tech_.on("retryplaylist",(function(){m&&We(a,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&m)?We(a,e):(c(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),o.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:a}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,r,l=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=d(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){p.currentTime(u)}),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(m){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))};function $e(e){return en.apply(this,arguments)}function en(){return(en=U(B.mark((function e(n){var t,o,i,r,l,a,s,u,c,d,v,p;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:i=this.el().querySelector("video")||this.el(),r=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),l=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),r&&i?(r.initialize(i,n.src,!0),l&&(c=null===(a=n.keySystems["com.widevine.alpha"])||void 0===a?void 0:a.url,d=null===(s=n.keySystems["com.microsoft.playready"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.widevine.alpha"])||void 0===u?void 0:u.licenseHeaders["X-AxDRM-Message"],p={"com.widevine.alpha":{serverURL:c,httpRequestHeaders:{"X-AxDRM-Message":v}},"com.microsoft.playready":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":v}}},r.setProtectionData(p))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function nn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function tn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nn(Object(t),!0).forEach((function(n){H(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var on,rn=function(e,n,t,o){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,P,T,I,x,D,E,C,R,N,A,L,_,V,M,z=n.res,q=void 0===z?null:z,K=n.sres,G=void 0===K?null:K,J=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],X=(null===(i=q)||void 0===i?void 0:i.contentType)||"video",Y=ne(null===(r=q)||void 0===r||null===(s=r[X])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||ne(null===(d=q)||void 0===d||null===(y=d[X])||void 0===y||null===(h=y.gist)||void 0===h||null===(g=h.imageGist)||void 0===g?void 0:g.r16x9),Q=(null===(w=q)||void 0===w||null===(b=w[X])||void 0===b||null===(k=b.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,Z=(null===(O=q)||void 0===O||null===(j=O[X])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,$=(null===(P=q)||void 0===P||null===(T=P.ads)||void 0===T||null===(I=T.preRoll)||void 0===I||null===(x=I.adTags)||void 0===x||null===(D=x.web)||void 0===D?void 0:D.active)&&(null===(E=q)||void 0===E||null===(C=E.ads)||void 0===C||null===(R=C.preRoll)||void 0===R||null===(N=R.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.url);q=tn(tn({},q),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var ee=(M={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:Q},H(M,"autoplay",null==t?void 0:t.autoplay),H(M,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!$),H(M,"loop",(null==t?void 0:t.loop)||!1),H(M,"audioPosterMode",null==t?void 0:t.audioPosterMode),H(M,"html5",tn(tn({vhs:tn(tn({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==t||null===(L=t.customData)||void 0===L?void 0:L.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!0},0==(null==t||null===(_=t.customData)||void 0===_?void 0:_.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(V=t.customData)||void 0===V?void 0:V.nativeVideoTracks)&&{nativeVideoTracks:!1})),H(M,"poster",Y),H(M,"techOrder",J),H(M,"chromecast",{requestCustomDataFn:function(n){var t=getPlayer(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,h=null==y?void 0:y.url;f.licenseUrl=h;var g=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=g}var w=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(q,n,o)}}),M);if(!F.getPlayers()[e])var te=F(e,ee,function(){var n=U(B.mark((function n(){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,P,T,I,x;return B.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(te),console.log(F.VERSION),console.log(F.getPlugins()),n.next=5,xe(t,q);case 5:Z&&o.resolve(tn({status:!0,msg:"Player Initialised"},G?{seriesResponse:G,response:q}:{response:q})),v(e,null==t?void 0:t.analyticsCb),Ke(e,t),/Android/i.test(navigator.userAgent)&&(F.options.vhs.overrideNative=!0),Q&&be(e,startOverTime),!$||null!=t&&null!==(i=t.customData)&&void 0!==i&&i.disableAds||p(e,$,q),k=l(q,e),console.log(k),null!=t&&t.nearestClusterUrl&&(k=f(k,t.nearestClusterUrl)),"Chrome"==oe()&&(null===(r=q)||void 0===r||null===(s=r.video)||void 0===s?void 0:s.isSSAIEnabled)?$e.call(this,k):k?a(e,k):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:q}),c(e,"Incompatible / Missing Source")),((null===(u=q)||void 0===u||null===(d=u[X])||void 0===d||null===(y=d.contentDetails)||void 0===y||null===(h=y.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(g=q)||void 0===g||null===(w=g[X])||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0)&&(x=(null===(j=q)||void 0===j||null===(S=j[X])||void 0===S||null===(P=S.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(T=q)||void 0===T||null===(I=T[X])||void 0===I?void 0:I.closedCaptions),O=x.filter((function(e){return"VTT"===e.format})),W(e,O)),null!=t&&t.disableControls?m(e):Ge(e,tn(tn(tn({},t),ee),{},{liveVideo:Z,isDvrEnabled:Q,res:q,sres:G})),Ze(e,tn(tn(tn({},t),ee),{},{liveVideo:Z}),o,{res:q,sres:G});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function ln(e,n){return an.apply(this,arguments)}function an(){return(an=U(B.mark((function e(n,t){var o,i,r,l,a,u;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,r=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,w();case 6:u=e.sent,y(r,u).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,s(null==e?void 0:e.data);var p,f=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===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,w=ge((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(w&&w.length)n.watchHistoryResumeTime=(null===(y=w[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=w[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",rn(l,{res:f},n,{resolve:o,reject:i})}else h(r,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.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,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){rn(l,{res:f},n,{resolve:o,reject:i})}));else rn(l,{res:f},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sn(e,n){return un.apply(this,arguments)}function un(){return(un=U(B.mark((function e(n,t){var o,i,r,l,a;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,w();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,b(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,rn(l,{res:t},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cn(e,n){return dn.apply(this,arguments)}function dn(){return(dn=U(B.mark((function e(n,t){var o,i,r,l,a,u,c;return B.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,r=t.reject,e.next=3,w();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,seasonIdxManager.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,k(c,l).then((function(e){var t,o,u,d=e.data,v=e.data.seasons;j(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);O(c,l),y(p,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,s(e.data),rn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:r})})).catch((function(e){g(e,a,r,videoId)}))})).catch((function(e){g(e,a,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vn(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 pn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vn(Object(t),!0).forEach((function(n){H(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function fn(){return{loadVideoInstantly:S,onTimeUpdate:z,getVideoDuration:q,onVideoEnded:K,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c Handlers added ","background: #bdf369; color: #000"),new Promise(function(){var n=U(B.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,h,w,b,k,O,j,S,P,T,I;return B.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!D(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,w=null==e?void 0:e.videoId,b=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=w,k=null==e?void 0:e.token,!_(e)){n.next=16;break}if(sessionStorage.setItem("vlp_token",k),V().set(null==e?void 0:e.refreshToken),k&&!M(k)){n.next=15;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 15:on=JSON.parse(atob(k.split(".")[1]));case 16:e.isAnonymousUser=!(null===(l=on)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=on)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=on)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=on)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(S=null==e?void 0:e.errors)&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,ie(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),A.set(e.apiBaseUrl),null!=e&&e.skin&&!te(e.skin)||(e.skin="VL_ONE"),Te(e),j&&ae("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return L(j)})).catch((function(e){})),(P=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(O)))&&P.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(I={directPlaybackUrl:f,id:T="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?y(T,k).then((function(n){rn(O,{res:pn(pn({},n),I)},e,{resolve:t,reject:o})})).catch((function(e){g(e,O,o,T)})):rn(O,{res:I},e,{resolve:t,reject:o})):b?cn(e,{resolve:t,reject:o}):h?sn(e,{resolve:t,reject:o}):ln(e,{resolve:t,reject:o});case 35:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:Z,skip:P,getPlayer:ee,play:T,pause:I,detectBrowser:oe,rewind:x,loadVideo:a,seekToTimeStamp:G,isPlayerInitialised:D,load:E,authenticateLC:C,dispose:R,enableCaptions:X,disableCaptions:Y,getCaptions:Q,playSelectedResolution:$,getSource:l,setVolume:ue,getVolume:ce,disableControls:m,setPlaybackSpeed:J,getEntitlementData:N}}export{fn as default};
@@ -0,0 +1 @@
1
+ import{z as e,C as l}from"./generic-4c43a94b.js";import{g as o}from"./skin-612c987b.js";function r(r,i){var a,t,n,c=o(r),u=null==c||null===(a=c.controlBar)||void 0===a||null===(t=a.playToggle)||void 0===t?void 0:t.el_,s=document.getElementsByTagName("video")[0];null===(n=document)||void 0===n||n.addEventListener("keydown",(function(o){var a;if("input"!=o.target.localName){var t=o.key,n=!0===i.liveVideo||!0===i.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(t)&&(o.preventDefault(),null==s||s.focus()),t){case" ":null==u||u.click();break;case"m":case"M":c.muted(!c.muted());break;case"f":case"F":null===(a=document.querySelector(".vjs-fullscreen-control"))||void 0===a||a.click();break;case"ArrowLeft":n&&!1===i.liveui||l(r,10);break;case"ArrowRight":n||e(r,10)}}}),!0)}export{r as i};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import s from"video.js";import{h as n,f as i,i as l}from"./icons-79ad4d7d.js";import{q as c,p as m}from"./generic-46a48054.js";import{e as d,s as p,j as u}from"./skin-2882ecc4.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-6cc39cdc.js";import"@babel/runtime/helpers/toConsumableArray";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var h=s.getComponent("Component"),f=function(){a(g,h);var f,y,b=(f=g,y=v(),function(){var e,t=o(f);if(y){var a=o(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function g(t){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(a=b.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.streams=r.streams,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a}return t(g,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(n())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-92ab3e07.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),a=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=a.classList)&&void 0!==r&&r.contains("hidden")?(d(),a.classList.remove("hidden"),t.classList.add("open"),p(e.playerId,a)):(a.classList.add("hidden"),t.classList.remove("open"))};var r=document.getElementById(this.playerId);if(r){var o=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);a.style.height="".concat(o,"px"),r.style.overflow="hidden",s.dom.appendContent(t,a),this.addFunctionality(a)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),r=s.dom.createEl("div",{className:"stream-selector-head"}),o=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),a.classList.remove("open")};for(var n=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),p=s.dom.createEl("div",{className:"stream-tray"}),v=function(e){var a,r,o,n=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(n.classList.add("selected"),n.style.border="2px solid #D2393B"),n.onclick=function(){for(var a=s.dom.$$(".stream"),r=0;r<a.length;r++)a[r].style.border="none",a[r].classList.remove("selected");n.classList.add("selected"),n.style.border="2px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},n.style.backgroundImage="url(".concat(t.streams[e].img,")");var i=document.createElement("img");i.className="stream-thumbnail-image",i.src="".concat((null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img)||(null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o?void 0:o.fallbackImage)),n.append(i),s.dom.appendContent(p,n),s.dom.appendContent(d,p)},h=0;h<this.streams.length;h++)v(h);s.dom.appendContent(r,o),s.dom.appendContent(r,n),s.dom.appendContent(e,r),s.dom.appendContent(e,d),u(this.playerId,e)}}]),g}();export{f as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import s from"video.js";import{h as n,f as i,i as l}from"./icons-79ad4d7d.js";import{E as c,A as m}from"./generic-4c43a94b.js";import{e as d,s as p,j as u}from"./skin-612c987b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-59c404fa.js";import"@babel/runtime/helpers/toConsumableArray";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var h=s.getComponent("Component"),f=function(){a(g,h);var f,y,b=(f=g,y=v(),function(){var e,t=o(f);if(y){var a=o(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function g(t){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(a=b.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.streams=r.streams,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a}return t(g,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(n())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-92ab3e07.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),a=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=a.classList)&&void 0!==r&&r.contains("hidden")?(d(),a.classList.remove("hidden"),t.classList.add("open"),p(e.playerId,a)):(a.classList.add("hidden"),t.classList.remove("open"))};var r=document.getElementById(this.playerId);if(r){var o=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);a.style.height="".concat(o,"px"),r.style.overflow="hidden",s.dom.appendContent(t,a),this.addFunctionality(a)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),r=s.dom.createEl("div",{className:"stream-selector-head"}),o=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),a.classList.remove("open")};for(var n=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),p=s.dom.createEl("div",{className:"stream-tray"}),v=function(e){var a,r,o,n=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(n.classList.add("selected"),n.style.border="2px solid #D2393B"),n.onclick=function(){for(var a=s.dom.$$(".stream"),r=0;r<a.length;r++)a[r].style.border="none",a[r].classList.remove("selected");n.classList.add("selected"),n.style.border="2px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},n.style.backgroundImage="url(".concat(t.streams[e].img,")");var i=document.createElement("img");i.className="stream-thumbnail-image",i.src="".concat((null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img)||(null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o?void 0:o.fallbackImage)),n.append(i),s.dom.appendContent(p,n),s.dom.appendContent(d,p)},h=0;h<this.streams.length;h++)v(h);s.dom.appendContent(r,o),s.dom.appendContent(r,n),s.dom.appendContent(e,r),s.dom.appendContent(e,d),u(this.playerId,e)}}]),g}();export{f as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{h as s,f as i,i as l}from"./icons-79ad4d7d.js";import{q as c,p as m}from"./generic-46a48054.js";import{e as d,g as p}from"./skin-2882ecc4.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-6cc39cdc.js";import"@babel/runtime/helpers/toConsumableArray";function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var h=n.getComponent("Component"),v=function(){r(g,h);var v,f,y=(v=g,f=u(),function(){var e,t=o(v);if(f){var r=o(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function g(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(r=y.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(g,[{key:"createEl",value:function(){var e=n.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=n.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return n.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-1fb5149a.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=n.dom.createEl("div",{className:"stream-container hidden"});n.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(d(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var a=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(a,"px"),r.style.overflow="hidden",n.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=n.dom.createEl("div",{className:"stream-selector-head"}),o=n.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var s=n.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=n.dom.createEl("div",{className:"stream-selector-content"}),u=n.dom.createEl("div",{className:"stream-tray"}),h=function(e){var r,a=n.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(a.classList.add("selected"),a.style.border="4px solid #D2393B"),a.onclick=function(){for(var r=n.dom.$$(".stream"),o=0;o<r.length;o++)r[o].style.border="none",r[o].classList.remove("selected");a.classList.add("selected"),a.style.border="4px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},a.style.backgroundImage="url(".concat(t.streams[e].img,")");var o=document.createElement("img");o.className="stream-thumbnail-image",o.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),o.alt="No Thumbnail Available",a.append(o),n.dom.appendContent(u,a),n.dom.appendContent(d,u)},v=0;v<this.streams.length;v++)h(v);n.dom.appendContent(a,o),n.dom.appendContent(a,s),n.dom.appendContent(e,a),n.dom.appendContent(e,d),p(this.playerId).on("fullscreenchange",(function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")}))}}]),g}();export{v as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{h as s,f as i,i as l}from"./icons-79ad4d7d.js";import{E as c,A as m}from"./generic-4c43a94b.js";import{e as d,g as p}from"./skin-612c987b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-59c404fa.js";import"@babel/runtime/helpers/toConsumableArray";function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var h=n.getComponent("Component"),v=function(){r(g,h);var v,f,y=(v=g,f=u(),function(){var e,t=o(v);if(f){var r=o(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function g(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(r=y.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(g,[{key:"createEl",value:function(){var e=n.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=n.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return n.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-1fb5149a.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=n.dom.createEl("div",{className:"stream-container hidden"});n.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(d(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var a=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(a,"px"),r.style.overflow="hidden",n.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=n.dom.createEl("div",{className:"stream-selector-head"}),o=n.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var s=n.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=n.dom.createEl("div",{className:"stream-selector-content"}),u=n.dom.createEl("div",{className:"stream-tray"}),h=function(e){var r,a=n.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(a.classList.add("selected"),a.style.border="4px solid #D2393B"),a.onclick=function(){for(var r=n.dom.$$(".stream"),o=0;o<r.length;o++)r[o].style.border="none",r[o].classList.remove("selected");a.classList.add("selected"),a.style.border="4px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},a.style.backgroundImage="url(".concat(t.streams[e].img,")");var o=document.createElement("img");o.className="stream-thumbnail-image",o.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),o.alt="No Thumbnail Available",a.append(o),n.dom.appendContent(u,a),n.dom.appendContent(d,u)},v=0;v<this.streams.length;v++)h(v);n.dom.appendContent(a,o),n.dom.appendContent(a,s),n.dom.appendContent(e,a),n.dom.appendContent(e,d),p(this.playerId).on("fullscreenchange",(function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")}))}}]),g}();export{v as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import r from"video.js";import{P as l}from"./icons-79ad4d7d.js";import{q as s,b as a}from"./generic-46a48054.js";import{d}from"./skin-2882ecc4.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-6cc39cdc.js";import"@babel/runtime/helpers/toConsumableArray";function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var u=r.getComponent("Component"),c=function(){n(c,u);var s,a,d=(s=c,a=p(),function(){var e,t=i(s);if(a){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function c(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,c),(n=d.call(this,t,o)).playerId=o.playerId,n.seriesData=o.sres,n.currentVideoData=o.res,n.initialiseStructure(),n.loadCSS(),n}return t(c,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"play-next"}),t=r.dom.createEl("div",{className:"play-next-icon",innerHTML:"".concat(l(window.controlsColor?window.controlsColor:"white"))});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./nextEpisodeButton-a1556cdf.js").then((function(e){var t=document.createElement("style");t.id="multicam",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"next-eps nextepisode-hidden"}),n=r.dom.createEl("div",{className:"next",innerHTML:"Next Episode"}),o=r.dom.createEl("div",{className:"nextep-meta-details next-margin"}),i=r.dom.createEl("div",{className:"next-eps-image"}),l=r.dom.createEl("div",{className:"next-eps-description"});r.dom.appendContent(o,i),r.dom.appendContent(o,l),r.dom.appendContent(t,n),r.dom.appendContent(t,o),this.toggleContentOnHover(e,t),r.dom.appendContent(e,t)}},{key:"toggleContentOnHover",value:function(e,t){e.addEventListener("mouseover",(function(){r.dom.removeClass(t,"nextepisode-hidden")})),t.addEventListener("mouseover",(function(){r.dom.removeClass(t,"nextepisode-hidden")})),e.addEventListener("mouseout",(function(){r.dom.addClass(t,"nextepisode-hidden")})),t.addEventListener("mouseout",(function(){r.dom.addClass(t,"nextepisode-hidden")}))}}]),c}(),m=function(e,t){var n=v(e,t.video.gist.id),o=h(e[n],t.video.gist.id),i=f(e[n],o);x(i.nextEp)},v=function(e,t){for(var n=-1,o=0;o<e.length;o++)for(var i=0;i<e[o].episodes.length;i++)if(e[o].episodes[i].id===t){n=o;break}return n},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;if(!(e&&t>=0))return{prevEp:null,nextEp:null};var n=e.episodes.length,o=t-1>=0?t-1:n-1,i=(t+1)%n,r=n>1?e.episodes[o]:null,l=n>1?e.episodes[i]:null;return o===i&&(0===o?l=null:r=null),{prevEp:r,nextEp:l,prevEpIdx:o,nextEpIdx:i}},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=null;return e?(e.episodes.forEach((function(e,o){e.gist.id===t&&(n=o)})),n):null},x=function(e){var t,n;r.dom.$(".next-eps"),r.dom.$(".play-next").onclick=function(){var t;s("my-player",null==e||null===(t=e.gist)||void 0===t?void 0:t.id).then((function(e){a(e.response)}))};var o=r.dom.$(".next-eps-image"),i=d("<img src=".concat(null==e||null===(t=e.gist)||void 0===t?void 0:t.videoImageUrl," />")),l=null==i?void 0:i.firstChild;null==o||o.append(l);for(var p=r.dom.$(".next-eps-description"),u=d("<div class='next-eps-title'>".concat(null==e?void 0:e.title,"</div>\n <div class='next-eps-description-details'>").concat(null==e||null===(n=e.gist)||void 0===n?void 0:n.description,"</div>"));null!=u&&u.firstChild;)null==p||p.appendChild(u.firstChild)};export{c as default,m as initaliseFunctionality};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import r from"video.js";import{P as l}from"./icons-79ad4d7d.js";import{E as s,f as a}from"./generic-4c43a94b.js";import{d}from"./skin-612c987b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-59c404fa.js";import"@babel/runtime/helpers/toConsumableArray";function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var u=r.getComponent("Component"),c=function(){n(c,u);var s,a,d=(s=c,a=p(),function(){var e,t=i(s);if(a){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function c(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,c),(n=d.call(this,t,o)).playerId=o.playerId,n.seriesData=o.sres,n.currentVideoData=o.res,n.initialiseStructure(),n.loadCSS(),n}return t(c,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"play-next"}),t=r.dom.createEl("div",{className:"play-next-icon",innerHTML:"".concat(l(window.controlsColor?window.controlsColor:"white"))});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./nextEpisodeButton-a1556cdf.js").then((function(e){var t=document.createElement("style");t.id="multicam",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"next-eps nextepisode-hidden"}),n=r.dom.createEl("div",{className:"next",innerHTML:"Next Episode"}),o=r.dom.createEl("div",{className:"nextep-meta-details next-margin"}),i=r.dom.createEl("div",{className:"next-eps-image"}),l=r.dom.createEl("div",{className:"next-eps-description"});r.dom.appendContent(o,i),r.dom.appendContent(o,l),r.dom.appendContent(t,n),r.dom.appendContent(t,o),this.toggleContentOnHover(e,t),r.dom.appendContent(e,t)}},{key:"toggleContentOnHover",value:function(e,t){e.addEventListener("mouseover",(function(){r.dom.removeClass(t,"nextepisode-hidden")})),t.addEventListener("mouseover",(function(){r.dom.removeClass(t,"nextepisode-hidden")})),e.addEventListener("mouseout",(function(){r.dom.addClass(t,"nextepisode-hidden")})),t.addEventListener("mouseout",(function(){r.dom.addClass(t,"nextepisode-hidden")}))}}]),c}(),m=function(e,t){var n=v(e,t.video.gist.id),o=h(e[n],t.video.gist.id),i=f(e[n],o);x(i.nextEp)},v=function(e,t){for(var n=-1,o=0;o<e.length;o++)for(var i=0;i<e[o].episodes.length;i++)if(e[o].episodes[i].id===t){n=o;break}return n},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;if(!(e&&t>=0))return{prevEp:null,nextEp:null};var n=e.episodes.length,o=t-1>=0?t-1:n-1,i=(t+1)%n,r=n>1?e.episodes[o]:null,l=n>1?e.episodes[i]:null;return o===i&&(0===o?l=null:r=null),{prevEp:r,nextEp:l,prevEpIdx:o,nextEpIdx:i}},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=null;return e?(e.episodes.forEach((function(e,o){e.gist.id===t&&(n=o)})),n):null},x=function(e){var t,n;r.dom.$(".next-eps"),r.dom.$(".play-next").onclick=function(){var t;s("my-player",null==e||null===(t=e.gist)||void 0===t?void 0:t.id).then((function(e){a(e.response)}))};var o=r.dom.$(".next-eps-image"),i=d("<img src=".concat(null==e||null===(t=e.gist)||void 0===t?void 0:t.videoImageUrl," />")),l=null==i?void 0:i.firstChild;null==o||o.append(l);for(var p=r.dom.$(".next-eps-description"),u=d("<div class='next-eps-title'>".concat(null==e?void 0:e.title,"</div>\n <div class='next-eps-description-details'>").concat(null==e||null===(n=e.gist)||void 0===n?void 0:n.description,"</div>"));null!=u&&u.firstChild;)null==p||p.appendChild(u.firstChild)};export{c as default,m as initaliseFunctionality};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/inherits";import l from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as s,f as r}from"./icons-79ad4d7d.js";import{q as c,P as d}from"./generic-46a48054.js";import{a as p}from"./autoNextVideo-2b476e56.js";import{e as m,g as u}from"./skin-2882ecc4.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-6cc39cdc.js";import"./util-6f289757.js";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var y=a.getComponent("Component"),h=function(){o(g,y);var h,f,b=(h=g,f=v(),function(){var e,t=i(h);if(f){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function g(e){var n,o,l,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,g),(i=b.call(this,e,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=null==a||null===(n=a.playlist)||void 0===n?void 0:n.content,i.cb=(null==a||null===(o=a.playlist)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==a||null===(l=a.playlist)||void 0===l?void 0:l.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&p({playerId:i.playerId,content:i.videos,cb:i.cb}),i}return n(g,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./playlist-7ecf432a.js").then((function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(m(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var o=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),a.dom.appendContent(e,t),n.style.overflow="hidden",this.addFunctionality(t)}}},{key:"addFunctionality",value:function(t){var n=this,o=this.el(),l=a.dom.createEl("div",{className:"playlist-selector-head"}),i=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r())});i.onclick=function(){t.classList.add("hidden"),o.classList.remove("open"),t.style.right="-350px"};for(var s=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),p=a.dom.createEl("div",{className:"playlist-selector-content"}),m=function(t){var o,l,i=a.dom.createEl("div",{className:"playlist-container"}),s=a.dom.createEl("div",{className:"playlist-section",index:t}),r=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(o=n.videos[t])||void 0===o?void 0:o.title)||"")}),m=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(s,r),a.dom.appendContent(s,m),a.dom.appendContent(i,s),a.dom.appendContent(p,i);var u=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),v=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.description)||"")}),y=a.dom.createEl("div",{className:"playlist-image"});y.style.backgroundImage="url(".concat(n.videos[t].img,")"),a.dom.appendContent(u,y),a.dom.appendContent(u,v),a.dom.appendContent(i,u),a.dom.appendContent(p,i),u.onclick=function(e){e.stopPropagation(),d(t+1),c(n.playerId,n.videos[t].id).then((function(e){null!=n&&n.cb&&n.cb(e)})).catch((function(e){null!=n&&n.cb&&n.cb(e)}))},s.onclick=function(t){var n,o,l,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(i.style.backgroundColor="#0000007d",null==s||null===(o=s.classList)||void 0===o||o.remove("hidden")):(null==s||null===(l=s.classList)||void 0===l||l.add("hidden"),i.style.backgroundColor="unset")}},v=0;v<this.videos.length;v++)m(v);a.dom.appendContent(l,i),a.dom.appendContent(l,s),a.dom.appendContent(t,l),a.dom.appendContent(t,p),u(this.playerId).on("fullscreenchange",(function(){var e=document.getElementById(n.playerId);if(e){var o=window.getComputedStyle(e,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px")}}))}}]),g}();export{h as default};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/inherits";import l from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as s,f as r}from"./icons-79ad4d7d.js";import{E as c,P as d}from"./generic-4c43a94b.js";import{a as p}from"./autoNextVideo-d84f6aba.js";import{e as m,g as u}from"./skin-612c987b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-59c404fa.js";import"./util-435845ca.js";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var y=a.getComponent("Component"),h=function(){o(g,y);var h,f,b=(h=g,f=v(),function(){var e,t=i(h);if(f){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function g(e){var n,o,l,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,g),(i=b.call(this,e,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=null==a||null===(n=a.playlist)||void 0===n?void 0:n.content,i.cb=(null==a||null===(o=a.playlist)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==a||null===(l=a.playlist)||void 0===l?void 0:l.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&p({playerId:i.playerId,content:i.videos,cb:i.cb}),i}return n(g,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./playlist-7ecf432a.js").then((function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(m(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var o=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),a.dom.appendContent(e,t),n.style.overflow="hidden",this.addFunctionality(t)}}},{key:"addFunctionality",value:function(t){var n=this,o=this.el(),l=a.dom.createEl("div",{className:"playlist-selector-head"}),i=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r())});i.onclick=function(){t.classList.add("hidden"),o.classList.remove("open"),t.style.right="-350px"};for(var s=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),p=a.dom.createEl("div",{className:"playlist-selector-content"}),m=function(t){var o,l,i=a.dom.createEl("div",{className:"playlist-container"}),s=a.dom.createEl("div",{className:"playlist-section",index:t}),r=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(o=n.videos[t])||void 0===o?void 0:o.title)||"")}),m=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(s,r),a.dom.appendContent(s,m),a.dom.appendContent(i,s),a.dom.appendContent(p,i);var u=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),v=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.description)||"")}),y=a.dom.createEl("div",{className:"playlist-image"});y.style.backgroundImage="url(".concat(n.videos[t].img,")"),a.dom.appendContent(u,y),a.dom.appendContent(u,v),a.dom.appendContent(i,u),a.dom.appendContent(p,i),u.onclick=function(e){e.stopPropagation(),d(t+1),c(n.playerId,n.videos[t].id).then((function(e){null!=n&&n.cb&&n.cb(e)})).catch((function(e){null!=n&&n.cb&&n.cb(e)}))},s.onclick=function(t){var n,o,l,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(i.style.backgroundColor="#0000007d",null==s||null===(o=s.classList)||void 0===o||o.remove("hidden")):(null==s||null===(l=s.classList)||void 0===l||l.add("hidden"),i.style.backgroundColor="unset")}},v=0;v<this.videos.length;v++)m(v);a.dom.appendContent(l,i),a.dom.appendContent(l,s),a.dom.appendContent(t,l),a.dom.appendContent(t,p),u(this.playerId).on("fullscreenchange",(function(){var e=document.getElementById(n.playerId);if(e){var o=window.getComputedStyle(e,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px")}}))}}]),g}();export{h as default};
@@ -1 +1 @@
1
- import{g as l}from"./skin-2882ecc4.js";var i=function(i){var n,o=l(i),t=[];if((null==o||null===(n=o.tech_)||void 0===n?void 0:n.vhs)||!1){var d,v,e=null==o||null===(d=o.tech_)||void 0===d||null===(v=d.vhs)||void 0===v?void 0:v.representations();(null==e?void 0:e.length)>0&&(t=null==e?void 0:e.sort((function(l,i){return(null==l?void 0:l.height)==(null==i?void 0:i.height)?(null==i?void 0:i.bandwidth)-(null==l?void 0:l.bandwidth):(null==i?void 0:i.height)-(null==l?void 0:l.height)})))}else{var u,h,r=null==o||null===(u=o.dash)||void 0===u||null===(h=u.mediaPlayer)||void 0===h?void 0:h.getBitrateInfoListFor("video");(null==r?void 0:r.length)>0&&(t=null==r?void 0:r.sort((function(l,i){return i.height-l.height})))}return t};export{i as g};
1
+ import{g as l}from"./skin-612c987b.js";var i=function(i){var n,o=l(i),t=[];if((null==o||null===(n=o.tech_)||void 0===n?void 0:n.vhs)||!1){var d,v,e=null==o||null===(d=o.tech_)||void 0===d||null===(v=d.vhs)||void 0===v?void 0:v.representations();(null==e?void 0:e.length)>0&&(t=null==e?void 0:e.sort((function(l,i){return(null==l?void 0:l.height)==(null==i?void 0:i.height)?(null==i?void 0:i.bandwidth)-(null==l?void 0:l.bandwidth):(null==i?void 0:i.height)-(null==l?void 0:l.height)})))}else{var u,h,r=null==o||null===(u=o.dash)||void 0===u||null===(h=u.mediaPlayer)||void 0===h?void 0:h.getBitrateInfoListFor("video");(null==r?void 0:r.length)>0&&(t=null==r?void 0:r.sort((function(l,i){return i.height-l.height})))}return t};export{i as g};