@viewlift/player-backup 0.0.71 → 0.0.73

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 (41) hide show
  1. package/cjs/{autoNextVideo-d8ed0e25.js → autoNextVideo-3a524b4d.js} +1 -1
  2. package/cjs/bundle.css +157 -157
  3. package/cjs/{caption-settings-7fa59013.js → caption-settings-ce2fa0a9.js} +1 -1
  4. package/cjs/{icons-9be597a5.js → icons-d8f94f7c.js} +1 -1
  5. package/cjs/index-1d224071.js +1 -0
  6. package/cjs/index.js +1 -1
  7. package/cjs/{keyboardShortcuts-0c7aabb9.js → keyboardShortcuts-10fe7aa8.js} +1 -1
  8. package/cjs/{multicam-700b45d9.js → multicam-7b60c23c.js} +1 -1
  9. package/cjs/{multicamv2-9c9d5e29.js → multicamv2-65a59cd9.js} +1 -1
  10. package/cjs/{mwebPotraitTray-23372ec1.js → mwebPotraitTray-e2e53f9e.js} +1 -1
  11. package/cjs/{nextEpisodeButton-c0ad7ec8.js → nextEpisodeButton-7816e04d.js} +1 -1
  12. package/cjs/{playlist-2581942d.js → playlist-3d2ec530.js} +1 -1
  13. package/cjs/{series-db731320.js → series-ae65d158.js} +1 -1
  14. package/cjs/{settings-icon-683e0ffc.js → settings-icon-06625c5a.js} +1 -1
  15. package/cjs/{skin-394660be.js → skin-098cb35e.js} +1 -1
  16. package/cjs/{skin-494fc580.js → skin-33eb4d19.js} +1 -1
  17. package/cjs/{skin-9b2d99e1.js → skin-4f49b71c.js} +1 -1
  18. package/cjs/{skin-c286ced7.js → skin-93933d7d.js} +1 -1
  19. package/cjs/{videoSelector-a2f4ba90.js → videoSelector-98b0d4cf.js} +1 -1
  20. package/esm/{autoNextVideo-639f04eb.js → autoNextVideo-86cc32a3.js} +1 -1
  21. package/esm/bundle.css +157 -157
  22. package/esm/{caption-settings-af710394.js → caption-settings-17f2494d.js} +1 -1
  23. package/esm/{icons-36fb8d8e.js → icons-fc068578.js} +1 -1
  24. package/esm/index-1deb3ac4.js +1 -0
  25. package/esm/index.js +1 -1
  26. package/esm/{keyboardShortcuts-1033561e.js → keyboardShortcuts-fd069374.js} +1 -1
  27. package/esm/{multicam-72cb8077.js → multicam-78d84dfa.js} +1 -1
  28. package/esm/{multicamv2-287b3456.js → multicamv2-7577611b.js} +1 -1
  29. package/esm/{mwebPotraitTray-ead10378.js → mwebPotraitTray-24ee3a25.js} +1 -1
  30. package/esm/{nextEpisodeButton-23d635eb.js → nextEpisodeButton-b44546b7.js} +1 -1
  31. package/esm/{playlist-b55deec8.js → playlist-5457007a.js} +1 -1
  32. package/esm/{series-1e4ba34b.js → series-ecbac20e.js} +1 -1
  33. package/esm/{settings-icon-b13fa7ac.js → settings-icon-b4b0dcfd.js} +1 -1
  34. package/esm/{skin-de0a7286.js → skin-35ce8abf.js} +1 -1
  35. package/esm/{skin-affa5562.js → skin-49f64786.js} +1 -1
  36. package/esm/{skin-cfa0dc95.js → skin-6627468e.js} +1 -1
  37. package/esm/{skin-59fef55d.js → skin-c1de7a5d.js} +1 -1
  38. package/esm/{videoSelector-983131d7.js → videoSelector-e6c46cf3.js} +1 -1
  39. package/package.json +1 -1
  40. package/cjs/index-a2318063.js +0 -1
  41. package/esm/index-3001eb19.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("axios"),n=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),i=require("video.js");require("js-cookie");var r=require("ua-parser-js"),a=require("@babel/runtime/helpers/toConsumableArray"),l=require("@babel/runtime/helpers/classCallCheck"),d=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),u=require("@babel/runtime/helpers/inherits"),c=require("@babel/runtime/helpers/possibleConstructorReturn"),v=require("@babel/runtime/helpers/getPrototypeOf"),m={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status","beacon-msn-dev":"https://analytics-api.develop.monumentalsportsnetwork.com/player-beacon","beacon-msn-qa":"https://analytics-api.qa.monumentalsportsnetwork.com/player-beacon","beacon-msn-uat":"https://analytics-api.uat.monumentalsportsnetwork.com/player-beacon","beacon-msn-prod":"https://analytics-api.monumentalsportsnetwork.com/player-beacon","beacon-prod":"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",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"};function p(){window.dataLayer.push(arguments)}function f(e,t){p("event",e,t)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function h(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?w(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):w(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function g(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function y(){var e=window.sessionStorage.getItem("uid");return e||(e=g(),window.sessionStorage.setItem("uid",e),e)}function I(e){return e?String(e):""}window.initialise=function(e){var t,n,o;window.sid=g();var i=function(e){switch(e){case"prod":default:return m["beacon-prod"];case"msndev":return m["beacon-msn-dev"];case"msnqa":return m["beacon-msn-qa"];case"msnuat":return m["beacon-msn-uat"];case"monumental-network":return m["beacon-msn-prod"]}}((null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.url)||"prod");window.beaconUrl=i,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,o,i,r=Math.floor(e.currentTime());f(r?"FAILED_TO_START":"DROPPED_STREAM",h({pfm:window.platform,uid:y(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),f("PLAY",h({pfm:window.platform,uid:y(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){if(t.el_){var n,o,i,r=e+.1;if(+r.toFixed(2)%5==0)f("BUFFERING",h({pfm:window.platform,uid:y(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return r}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,f("FIRST_FRAME",h({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:y(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.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,o,i,r,a;f("AD_REQUEST",h({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:y(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,adPosition:1}),f("AD_IMPRESSION",h({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:y(),vid:window.videoId},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),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(),o=e.buffered(),i=0;i<o.length;i++){var r=o.start(i),a=o.end(i);if(E(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var E=function(e,t,n){return e>=t&&e<=n};function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function b(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?T(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):T(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window.fireEvent=function(e){var n,o,i,r,a,l,d=[h(h(h({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params),{},{uid:y(),vid:window.videoId,url:e.url||document.location.href,ref:e.ref||document.referrer,pa:e.eventName,vpos:I(e.videoPosition),environment:window.environment,dp1:e.dp1||"",dp2:e.dp2||"",dp3:e.dp3||"",dp4:e.dp4||"",dp5:e.dp5||"",apos:!0===e.isAdEvent?I(e.videoPosition):"",apod:!0===e.isAdEvent?I(e.adPosition):"",profid:"",player:e.playerType||"native",media_type:e.mediaType||"VIDEO",stream_id:window.sid,embedurl:"",ttfirstframe:I(e.ttFirstFrame),bitrate:I(e.bitrate),connectionspeed:"",resolutionheight:I(e.resHeight),resolutionwidth:I(e.resWidth),bufferhealth:I(e.bufferHealth)},(null==e?void 0:e.duration)&&{duration:e.duration}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(l=a.beacon)||void 0===l?void 0:l.params)];t({url:window.beaconUrl,method:"post",contentType:"application/x-www-form-urlencoded",dataType:"text",data:d}).catch((function(e){console.error(e)}))},window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var O=function(e,n){var o,i;return t({url:N(),params:b({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i?void 0:i.entitlement),method:"GET",headers:{Authorization:n},withCredentials:!0})},D=function(e,n,o){if("v1"==o){var i={siteOwner:null==e?void 0:e.siteOwner,userId:null==e?void 0:e.userId,videoId:null==e?void 0:e.videoId,watchedPercentage:null==e?void 0:e.watchedPercentage,watchedTime:null==e?void 0:e.watchedTime};return t({url:R(),method:"POST",headers:{Authorization:n,"x-api-key":e.xApiKey},params:{version:"v2"},data:JSON.stringify(i),withCredentials:!0})}if("v2"==o){var r={doneWatching:null==e?void 0:e.doneWatching,videoId:null==e?void 0:e.videoId,watchedPercentage:null==e?void 0:e.watchedPercentage,watchedTime:null==e?void 0:e.watchedTime};return t({url:A(),method:"POST",headers:{Authorization:n},data:r,params:b({},(null==e?void 0:e.profileId)&&{profileId:null==e?void 0:e.profileId})})}},S=function(e,n){var o,i,r=(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(n.split(".")[1])),s=(null==d?void 0:d.site)||null;return t({method:"GET",url:_(e),params:{site:s},headers:{Authorization:n,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey}})}if("v2"==r){var u,c;JSON.parse(atob(n.split(".")[1]));var v=window.contentType;return t({method:"GET",url:k(e,v),headers:{Authorization:n,"x-api-key":null===(u=window)||void 0===u||null===(c=u.watchHistory)||void 0===c?void 0:c.xApiKey}})}},C=function(e){return L()+"".concat(null==m?void 0:m.getSeriesWatchHistoryV2,"/").concat(e)},P=function(){return L()+"".concat(null==m?void 0:m.getSeriesWatchHistoryV1)},_=function(e){return L()+"".concat(null==m?void 0:m.getVideoInfoV1,"/").concat(e)},k=function(e,t){return L()+"".concat(null==m?void 0:m.getVideoInfoV2,"/").concat(t,"/").concat(e)},R=function(){return L()+"".concat(null==m?void 0:m.saveWatchHistoryV1)},A=function(){return L()+"".concat(null==m?void 0:m.saveWatchHistoryV2)},N=function(){return L()+"".concat(null==m?void 0:m.getVideoDetails)},F=function(e,t){return L()+"".concat(null==m?void 0:m.getSeriesDetails)},L=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==m?void 0:m.apiBaseUrl)},V=function(e,t){if(Promise.resolve().then((function(){return require("./error-26d5a3c3.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 o=document.getElementById(e),i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),i.appendChild(r),o.append(i)}},j=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var x=function(){var e,t;return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.onlyPlayReadyDRM||navigator.userAgent.indexOf("Edg")>-1?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"};function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function H(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?B(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):B(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window._deviceInfo=r(navigator.userAgent);var M=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},W=function(e){var t=U(e,"video.tags",[]),n=U(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},U=function(e,t,n){for(var o=0,i=(t=t.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[t[o]]}return e||n},q=function(){var e,t,n,o,i,r,a,l,d,s,u,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",v=arguments.length>1?arguments[1]:void 0,m=arguments.length>2?arguments[2]:void 0,p=ue(v);if(!c.includes("VIEWLIFT_"))return c;var f=window.getComputedStyle(document.getElementById(v),null),w=Math.trunc(f.getPropertyValue("height").slice(0,-2)),h=Math.trunc(f.getPropertyValue("width").slice(0,-2)),g=U(m,"video.gist.id",""),y=H({VIEWLIFT_WIDTH:h,VIEWLIFT_HEIGHT:w,VIEWLIFT_SIZE:M(h,w),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(e=window)||void 0===e?void 0:e.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:navigator.userAgent,VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:U(m,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:U(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:U(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==p||null===(t=p.options_)||void 0===t?void 0:t.autoplay)||1,VIEWLIFT_MUTE:(null==p||null===(n=p.options_)||void 0===n?void 0:n.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:W(m),VIEWLIFT_MEDIA_ID:g,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(U(m,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:g,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+U(m,"video.gist.permalink","")),VIEWLIFT_COPPA:U(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(r=i.site)||void 0===r?void 0:r.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:U(null===(a=window)||void 0===a||null===(l=a.app_data)||void 0===l||null===(d=l.site)||void 0===d?void 0:d.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*U(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:U(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:g,VIEWLIFT_CONTENT_TITLE:U(m,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:U(m,"video.series[0].gist.title",U(m,"seriesInfo.title","VIEWLIFT_CONTENT_SERIES_TITLE")),VIEWLIFT_CONTENT_EPISODE:U(m,"video.currentEpisode","VIEWLIFT_CONTENT_EPISODE"),VIEWLIFT_CONTENT_SEASON:U(m,"video.currentSeason","VIEWLIFT_CONTENT_SEASON"),VIEWLIFT_CONTENT_GENRE:U(m,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER"},null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.macros);for(var I in y){var E=new RegExp("\\b("+I+")\\b","g");c=c.replace(E,y[I])}return c};function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function G(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?z(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):z(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var K,Y,J=function(e,t){var n,o,i,r,a,l,d,s,u=null==e||null===(n=e.video)||void 0===n?void 0:n.drmEnabled,c=null==e||null===(o=e.video)||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,v=(null==e||null===(r=e.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a||null===(l=a.videoAssets)||void 0===l?void 0:l.hls)||!1,m=(null==e||null===(d=e.video)||void 0===d||null===(s=d.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;if(u){var p=Q(c,t);return p.src=q(p.src,t,e),m&&(p=G(G({},p),{},{src:X(G(G({},e.video),{},{src:"".concat(p.src)}))})),p}if(v){var f=$(c);return f.src=q(f.src,t,e),m&&(f=G(G({},f),{},{src:X(G(G({},e.video),{},{src:"".concat(f.src)}))})),f}if(null!=c&&c.mpeg){var w=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(c);return w.src=q(w.src,t,e),w}return null},X=function(e){var t=e.src;if(e.liveDetails.startOverTime){var n=e.liveDetails.startOverTime,o=e.gist.scheduleStartDate,i=e.gist.scheduleEndDate,r=new Date,a=0,l=r.getTime();a=l-o<1e3*n?l-o:1e3*n;var d=null;i<=l&&null!=i&&(d=new Date(i)),r.setMilliseconds(r.getMilliseconds()-a),t=t.includes("?")?i&&d?"".concat(e.src,"&start=").concat(r.toISOString(),"&end=").concat(d.toISOString()):"".concat(e.src,"&start=").concat(r.toISOString()):i&&d?"".concat(e.src,"?start=").concat(r.toISOString(),"&end=").concat(d.toISOString()):"".concat(e.src,"?start=").concat(r.toISOString())}return t},$=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},Q=function(e,t){var n=e.fairPlay,o=e.widevine,r=e.playReady,a=x(),l=ue(t);if("Safari"===a){var d=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,o){console.log(e),e&&n(e),n(null,new Uint8Array(o))}))},getContentId:function(e,t){if(t)return new TextDecoder("utf-16").decode(t.slice(16))},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);try{l.eme()}catch(e){}return d}if("Chrome"===a||"Firefox"===a){var s={src:o.url,type:"application/dash+xml",keySystemOptions:[]};return s.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),s}if("IE"===a){var u={src:r.url,type:"application/dash+xml",keySystemOptions:[]};return u.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),u}};var Z=function(e){K=e},ee=function(){return K},te=function(e,t){for(var n=ue(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"===i.kind&&i.id==t&&(i.mode="showing")}},ne=function(e,t){for(var n=ue(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"===i.kind&&i.id===t&&(i.mode="hidden")}},oe=function(e){var t,n=ue(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind})))||[]},ie=function(e,t){var n=ue(e);n.remoteTextTracks().tracks_.map((function(e){n.removeRemoteTextTrack(e)})),t.map((function(e){n.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},re=function(e){i(e).play()},ae=function(e){i(e).pause()},le=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},de=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},se=function(e){return!!i.getPlayer("".concat(e))},ue=function(e){return!!i.getPlayer("".concat(e))&&i.getPlayer("".concat(e))},ce=function(e,t,n){var o,i,r,a=0,l=0;return null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.enable&&S(t,n).then((function(e){var t,n,o,i,r,d;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),a=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,l=(null==e||null===(d=e.data)||void 0===d?void 0:d.watchedPercentage)||null})).catch((function(e){var t,n,o,i;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})),new Promise((function(o,i){O(t,n).then((function(t){var n,r,d=null==t?void 0:t.data,s=(null==d||null===(n=d.video)||void 0===n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;Z(t.data);var u=J(d,e);if(u){var c,v,m,p,f,w,h,g,y,I,E,T=null==d||null===(c=d.video)||void 0===c||null===(v=c.gist)||void 0===v?void 0:v.videoImageUrl,b=ue(e);if(b.poster(T),fe(e,u),b.on("loadstart",(function(){s&&o({status:!0,msg:"Video Loaded",response:d})})),b.on("loadeddata",(function(){j(),o({status:!0,msg:"Video Loaded",response:d})})),b.one("play",(function(){a&&l<95&&b.currentTime(a)})),b.one("error",(function(){var e;i({status:!1,msg:(null==b||null===(e=b.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==d||null===(m=d.video)||void 0===m||null===(p=m.contentDetails)||void 0===p||null===(f=p.closedCaptions)||void 0===f?void 0:f.length)>0||(null==d||null===(w=d.video)||void 0===w||null===(h=w.closedCaptions)||void 0===h?void 0:h.length)>0)g=((null==d||null===(y=d.video)||void 0===y||null===(I=y.contentDetails)||void 0===I?void 0:I.closedCaptions)||(null==d||null===(E=d.video)||void 0===E?void 0:E.closedCaptions)).filter((function(e){return"VTT"===e.format})),ie(e,g);else!function(e){var t=ue(e);t.remoteTextTracks().tracks_.map((function(e){null==e||e.kind,t.removeRemoteTextTrack(e)}))}(e)}else V(e,"Incompatible Source, only hls,mp4,drm content is allowed"),i("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(t){we(t,e,i)}))}))},ve=function(e,t){var n=ue(e);return n.src(t),new Promise((function(e,t){n.on("loadedmetadata",(function(){e({status:!0,msg:"video loaded"})}))}))},me=function(e){var t=ue(e);if(pe(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},pe=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()},fe=function(e,t){ue(e).src(t)},we=function(e,t,n){var o,r,a,l,d,s,u=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(a=e.response)||void 0===a||null===(l=a.data)||void 0===l?void 0:l.errorMessage)||(null==e?void 0:e.message);se(t)||i(t,{fluid:!0}),V(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[u])||"".concat(c)),n&&n({status:!1,response:e,msg:"".concat(c)})},he=function(){var e=document.getElementsByClassName("vjs-control-bar")[0];e&&(e.style.visibility="hidden");var t=document.getElementsByClassName("vjs-big-play-button")[0];t&&(t.style.display="none");var n=document.getElementsByClassName("vjs-fullscreen-control")[0];n&&(n.style.display="none")};function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ye(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?ge(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ge(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var Ie,Ee,Te=function(e,t){var n=ue(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,o,r,a,l,d=this.el(),s=i.dom.getPointerPosition(d,t).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(o=n.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(a=r.CastContext)||void 0===a||null===(l=a.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*s,v.seek()}}))},be=[],Oe=0;function De(e,t,n){var o,i,r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Ee=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var l=null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),s=Math.floor(e.duration()),u=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,c={};"v1"==Ee?c={videoId:Ie,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(d/s*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:u}:"v2"==Ee&&(c={videoId:Ie,watchedTime:Math.floor(e.currentTime()),watchedPercentage:a?100:Math.floor(d/s*100),doneWatching:a,profileId:l}),D(c,t.token,Ee).then((function(e){})).catch((function(e){})),Oe=d+n}var Se=function(e,t,n){var o=ue(e);if(o)if(t>=0&&t<=100){var i=parseFloat(t)/100;o.volume(i),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ce=function(e){var t=ue(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var _e=function(t,n,o,i){var r,a,l=i.res,d=i.sres,s=ue(t),u=(null==l||null===(r=l.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;Z(l),s.on("loadstart",(function(){u&&o.resolve({status:!0,msg:"Video Loaded",response:l})})),s.on("loadeddata",(function(){var i;Se(t,sessionStorage.getItem("volume")||"100");var r,a,s=ee();(j(),o.resolve(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?Pe(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Pe(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:l}:{response:l})),null!=n&&n.watchHistory&&null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.enable&&!n.isAnonymousUser)&&function(e,t,n){var o;be=[],Oe=0,Ie=n;var i=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.interval)||30,r=ue(e);r&&(r.on("timeupdate",(function(){var e=Math.floor(r.currentTime());be.includes(Oe)||(e==Oe?(be.push(e),De(r,t,i)):e>Oe&&(Oe=e+i))})),r.on("ended",(function(){De(r,t,i,!0)})))}(t,n,null==s||null===(r=s.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.id)})),s.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];s.trigger("subtitlechanged",t)})),s.on("subtitlechanged",(function(e,t){var n,o,i,r,a,l,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(o=n.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(a=r.getInstance())||void 0===a?void 0:a.S,p=null===(l=window)||void 0===l||null===(d=l.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,w=p.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));f=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(f)}})),s.on("loadedmetadata",(function(){window.endFirstFrame(s)})),s.one("error",(function(){var e,n;V(t,(null==s||null===(e=s.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==s||null===(n=s.error())||void 0===n?void 0:n.message)||"Some error occured"})})),s.one("play",(function(){null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&s.currentTime(null==n?void 0:n.watchHistoryResumeTime)})),s.on("volumechange",(function(){var e=100*s.volume().toFixed(2);s.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},ke=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-9b2d99e1.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-c286ced7.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-494fc580.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n&&Promise.resolve().then((function(){return require("./skin-394660be.js")})).then((function(n){n.initialiseSkin(e,t)}))},Re=function(e){return new Promise((function(t,n){if(Ae(e))n("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!1,o.src=e,document.head.appendChild(o),t()}}))},Ae=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ne=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)},Fe=function(e,t,n){var o=ue(e);o?t>=0&&t<=o.duration()?(n({status:!0,msg:"Successfully seeked to timestamp : ".concat(t)}),o.currentTime(t)):n({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):n("Cannot find player with id: '".concat(e,"'"))},Le=function(e,t){var n=ue(e);if(!n)return"Cannot find player with id: '".concat(e,"'");try{return n.playbackRate(t),"Playback speed set to ".concat(t,"x")}catch(e){return"Error: ".concat(e)}},Ve=function(e,t){var n=ue(e);n?n.on("timeupdate",(function(){return t(n.currentTime())})):t("Cannot find player with id: '".concat(e,"'"))},je=function(e,t){var n=ue(e);n?n.on("ended",(function(){return t(!0)})):t("Cannot find player with id: '".concat(e,"'"))},xe=function(e){var t=ue(e);return t?t.duration():"Cannot find player with id: '".concat(e,"'")},Be=function(e){var t,n=ue(e),o=[];if((null==n||null===(t=n.tech_)||void 0===t?void 0:t.vhs)||!1){var i,r,a=null==n||null===(i=n.tech_)||void 0===i||null===(r=i.vhs)||void 0===r?void 0:r.representations();(null==a?void 0:a.length)>0&&(o=null==a?void 0:a.sort((function(e,t){return(null==e?void 0:e.height)==(null==t?void 0:t.height)?(null==t?void 0:t.bandwidth)-(null==e?void 0:e.bandwidth):(null==t?void 0:t.height)-(null==e?void 0:e.height)})))}else{var l,d,s=null==n||null===(l=n.dash)||void 0===l||null===(d=l.mediaPlayer)||void 0===d?void 0:d.getBitrateInfoListFor("video");(null==s?void 0:s.length)>0&&(o=null==s?void 0:s.sort((function(e,t){return t.height-e.height})))}return o};function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=v(e);if(t){var i=v(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return c(this,n)}}var Me=i.getComponent("Component"),We=function(t){u(o,Me);var n=He(o);function o(t){var r,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,o),r=n.call(this,t,d),e(s(r),"masterRenditions",[]),e(s(r),"addCustomFont",(function(e){var t=i.dom.createEl("div",{className:"font hideCustomFonts"}),n=i.dom.createEl("p",{className:"customFontHeading",innerHTML:"Font Size"});i.dom.appendContent(t,n);var o=i.dom.createEl("div",{className:"font-options"});o.style.fontSize="12px",r.fontSizeOptions.map((function(e,t){var n=i.dom.createEl("div",{className:"options",innerHTML:'<div class="radio-item" >\n <input class=opt'.concat(t,' type="radio" id=').concat(e,' name="item" />\n <label class="radio-btn-lable" for=').concat(e,">").concat(e,"pt</label>\n </div>")});n.addEventListener("click",(function(e){var t=e.target.id;r.changeFontSize(t)})),i.dom.appendContent(o,n)})),i.dom.appendContent(t,o),i.dom.appendContent(e,t)})),e(s(r),"resetRenditions",(function(){a(document.getElementsByClassName("rendition")).map((function(e){i.dom.removeClass(e,"selected")}))})),r.playerId=null==d?void 0:d.playerId,r.skin=null==d?void 0:d.skin,r.icon=null==d?void 0:d.icon,r.masterRenditions=[],r.fontSizeOptions=[10,12,14],r.createRenditions(d.renditions),window.height=null,r}return d(o,[{key:"toggleContentOnHover",value:function(e,t){var n=i.dom.$(".setting-icon",e);n.addEventListener("mouseover",(function(){i.dom.removeClass(t,"hidden")})),t.addEventListener("mouseover",(function(){i.dom.removeClass(t,"hidden")})),n.addEventListener("mouseout",(function(){i.dom.addClass(t,"hidden")})),t.addEventListener("mouseout",(function(){i.dom.addClass(t,"hidden")}))}},{key:"changeFontSize",value:function(e){var t=i.dom.$(".renditions",this.contentEl()),n=i.dom.$(".font-options",this.contentEl());t.style.fontSize="".concat(e,"px"),n.style.fontSize="".concat(e,"px")}},{key:"createRenditions",value:function(e){var t=this,n=this.el();i.dom.$(".setting-icon",this.el()).innerHTML="".concat(this.icon," ").concat("live"===this.skin?"&nbsp Settings":""," ");var o=i.dom.createEl("div",{className:"content hidden"}),r=i.dom.createEl("div",{innerHTML:"Quality",className:"title"}),a=i.dom.createEl("div",{className:"resolution"});i.dom.appendContent(a,r),this.toggleContentOnHover(n,o);var l=i.dom.createEl("div",{className:"renditions"});this.player_.tech_.vhs?(e.map((function(e,n){var o,r,a=i.dom.createEl("div",{className:"relative"}),d=(((null==e||null===(o=e.playlist)||void 0===o?void 0:o.attributes["AVERAGE-BANDWIDTH"])||(null==e||null===(r=e.playlist)||void 0===r?void 0:r.attributes.BANDWIDTH))/1048576).toFixed(1),s="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");s="".concat(e.height,"p @ ").concat(d,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");var u=i.dom.createEl("p",{innerHTML:s,className:"rendition",res:e.height,bandwidth:e.bandwidth});i.dom.appendContent(a,u),i.dom.appendContent(l,a),u.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(t.resetRenditions(),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,Ue(t.playerId,e.target),i.dom.addClass(u,"selected"))}))})),this.addAutoRendition("nondrm",l),"Safari"!=x()&&this.addDynamicSwitchIfAuto()):(e.map((function(e,n){var o=i.dom.createEl("div",{className:"relative"}),r=(e.bitrate/1e6).toFixed(1),a="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");window.enableResolutionsBitrate&&(a="".concat(e.height,"p @ ").concat(r,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":""));var d=i.dom.createEl("p",{innerHTML:a,className:"rendition",res:e.height,qualityIndex:e.qualityIndex});i.dom.appendContent(o,d),i.dom.appendContent(l,o),d.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(t.resetRenditions(),window.height=e.target.res,window.selectedVideo=e.target.video,window.qualityIndex=e.target.qualityIndex,Ue(t.playerId,e.target),i.dom.addClass(d,"selected"))}))})),this.addAutoRendition("drm",l)),i.dom.appendContent(a,l),i.dom.appendContent(o,a),i.dom.appendContent(n,o)}},{key:"addDynamicSwitchIfAuto",value:function(){for(var e,t=this.player_.textTracks(),n=0;n<t.length;n++)"segment-metadata"===t[n].label&&(e=t[n]);var o=null;e&&e.on("cuechange",(function(){var t,n,i=e.activeCues[0];if(console.log((null==i||null===(t=i.value)||void 0===t||null===(n=t.resolution)||void 0===n?void 0:n.height)+"p"),i&&document.querySelector(".auto.selected")){var r,a,l,d,s,u,c,v;if(null!=i&&null!==(r=i.value)&&void 0!==r&&null!==(a=r.resolution)&&void 0!==a&&a.height&&o!==(null==i||null===(l=i.value)||void 0===l||null===(d=l.resolution)||void 0===d?void 0:d.height))document.querySelector(".auto.selected").innerHTML="Auto ".concat(null==i||null===(c=i.value)||void 0===c||null===(v=c.resolution)||void 0===v?void 0:v.height,"p");o=null==i||null===(s=i.value)||void 0===s||null===(u=s.resolution)||void 0===u?void 0:u.height}}))}},{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"container"}),t=i.dom.createEl("div",{className:"setting-icon"});return i.dom.appendContent(e,t),e}},{key:"addAutoRendition",value:function(e,t){var n=this;if("nondrm"==e){var o,r,a,l,d=null===(o=this.player_)||void 0===o||null===(r=o.tech_)||void 0===r?void 0:r.vhs.selectPlaylist().attributes.RESOLUTION.height,s=null===(a=this.player_)||void 0===a||null===(l=a.tech_)||void 0===l?void 0:l.vhs.selectPlaylist().attributes.BANDWIDTH,u=i.dom.createEl("div",{className:"relative"}),c=i.dom.createEl("p",{innerHTML:"Auto ".concat(d,"p"),className:"rendition auto selected",bandwidth:s,res:d});c.addEventListener("click",(function(e){window.height!==e.target.res&&(n.resetRenditions(),i.dom.addClass(c,"selected"),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,Ue(n.playerId,null,!0))})),i.dom.appendContent(u,c),i.dom.appendContent(t,u)}else{var v=i.dom.createEl("div",{className:"relative"}),m=i.dom.createEl("p",{innerHTML:"Auto",className:"rendition selected",qualityIndex:"auto"});m.addEventListener("click",(function(e){n.resetRenditions(),i.dom.addClass(m,"selected"),window.qualityIndex=e.target.qualityIndex,window.selectedVideo=e.target.video,Ue(n.playerId,null,!0)})),i.dom.appendContent(v,m),i.dom.appendContent(t,v)}}}]),o}(),Ue=function(e,t,n){var o,r=ue(e),a=null==t?void 0:t.bandwidth;if((null==r||null===(o=r.tech_)||void 0===o?void 0:o.vhs)||!1){r.tech_.vhs.representations().forEach((function(e){n||e.bandwidth===a?e.enabled(!0):e.enabled(!1)})),r.handleTechPlaying_();var l=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(l)}),100);var d=i.dom.$(".content");d&&i.dom.addClass(d,"hidden")}else{var s=null==t?void 0:t.qualityIndex;if(n){var u,c;null==r||null===(u=r.dash)||void 0===u||null===(c=u.mediaPlayer)||void 0===c||c.resetSettings()}else{var v,m,p,f;null==r||null===(v=r.dash)||void 0===v||null===(m=v.mediaPlayer)||void 0===m||m.updateSettings({streaming:{abr:{autoSwitchBitrate:!1}}}),null==r||null===(p=r.dash)||void 0===p||null===(f=p.mediaPlayer)||void 0===f||f.setQualityFor("video",s,!0);var w=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(w)}),100);var h=i.dom.$(".content");h&&i.dom.addClass(h,"hidden")}}},qe=Object.freeze({__proto__:null,playSelectedResolution:Ue,default:We});var ze,Ge=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ye=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Re("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),Re("https://imasdk.googleapis.com/js/sdkloader/ima3.js")},loadDashLibrary:Ge,loadEMELibrary:Ke}),Je=!1,Xe=function(e,t){var n=ue(e);t&&window.google&&(n.ima.initializeAdDisplayContainer&&n.ima.initializeAdDisplayContainer(),Je?(n.ima.setContentWithAdTag(null,t,!0),n.ima.requestAds()):function(e,t){var n,o,i,r=ue(e);if(null!==r.el_){Je=!0;var a={id:e,adTagUrl:"".concat(t,"&vid=").concat(window.videoId,"&url=").concat(window.location.href,"&correlator=").concat((new Date).getTime(),"&cust_params=sd%3D60000%26site%3D").concat(window.location.origin,"%26autostart%3D%26mute%3D%26user_agent%3D%26keyword%3D%26category%3D").concat(window.category,"%26vid%3D").concat(window.videoId),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),Je&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var d="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,d="touchend"),r.one(d,(function(){s&&r.ima.initializeAdDisplayContainer()}));var u=(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;r.one("ads-ad-started",(function(){u&&u({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){u&&u({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){u&&u({status:"ERROR",msg:"Advertisement Error"})}))}}(e,t))};function $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Qe(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):$e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var Ze=function(t,r,a,l){var d,s,u,c,v,m,p,f,w,h,g,y,I,E,T,b=r.res,O=void 0===b?null:b,D=r.sres,S=void 0===D?null:D,C=(null===(d=window)||void 0===d||null===(s=d.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(v=c.getInstance())||void 0===v?void 0:v.S)||void 0,P=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==C&&"NOT_CONNECTED"!==C?["html5","chromecast"]:["chromecast","html5"]:["html5"],_=null==O||null===(m=O.video)||void 0===m||null===(p=m.gist)||void 0===p?void 0:p.videoImageUrl,k=(null==O||null===(f=O.video)||void 0===f||null===(w=f.liveDetails)||void 0===w?void 0:w.isDvrEnabled)||!1,R=function(e){var t,n={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(t=window)&&void 0!==t&&t.cast&&(n={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==x()&&(n=ye(ye({},n),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),n}(a),A=(null==O||null===(h=O.video)||void 0===h||null===(g=h.streamingInfo)||void 0===g?void 0:g.isLiveStream)||!1,N=(null==a?void 0:a.drmLibrary)||!1,F=Qe(Qe({controls:!0,playsinline:!0,fluid:!0},"carousel"==a.skin&&{muted:!0}),{},(T={autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},liveui:k},e(T,"autoplay",null==a?void 0:a.autoplay),e(T,"normalizeAutoplay",null==a?void 0:a.autoplay),e(T,"html5",Qe(Qe({vhs:Qe({limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(y=a.customData)||void 0===y?void 0:y.overrideNative)&&{overrideNative:!0})},0==(null==a||null===(I=a.customData)||void 0===I?void 0:I.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(E=a.customData)||void 0===E?void 0:E.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(T,"poster",_),e(T,"techOrder",P),e(T,"chromecast",{requestCustomDataFn:function(e){var n=ue(t);console.log(n.textTracksJson_);var o=n.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,t,n){var o,i,r,a,l,d,s,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=f}var w=(null==e||null===(o=e.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=w;var h=null==e||null===(r=e.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.runtime;m.duration=h;var g=null==e||null===(l=e.video)||void 0===l||null===(d=l.gist)||void 0===d?void 0:d.title;m.mediaTitle=g;var y=null==e||null===(s=e.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=y,m.subTitles=n,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(O,e,o)}}),e(T,"plugins",R),T)),L=i(t,F,function(){var e=n(o.mark((function e(){var n,r,d,s,u,c,v,m,p,f,w,h,g,y,I,E,T,b,D,C,P,_,R,j,B;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A&&l.resolve(Qe({status:!0,msg:"Player Initialised"},S?{seriesResponse:S,response:O}:{response:O})),window.initialise(L),window.firstFrame(L),"white"!==window.controlsColor&&Ne(window.controlsColor,L),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),T=null==O||null===(n=O.video)||void 0===n?void 0:n.drmEnabled,b=(null==O||null===(r=O.ads)||void 0===r||null===(d=r.preRoll)||void 0===d||null===(s=d.adTags)||void 0===s||null===(u=s.web)||void 0===u?void 0:u.active)&&(null==O||null===(c=O.ads)||void 0===c||null===(v=c.preRoll)||void 0===v||null===(m=v.adTags)||void 0===m||null===(p=m.web)||void 0===p?void 0:p.url),D=null==O||null===(f=O.video)||void 0===f||null===(w=f.liveDetails)||void 0===w?void 0:w.startOverTime,!T&&!N){e.next=16;break}if("Safari"!==x()){e.next=14;break}return e.next=12,Ke();case 12:e.next=16;break;case 14:return e.next=16,Promise.all([Ke(),Ge()]);case 16:k&&Te(t,D),b&&Xe(t,b),(C=J(O,t))?fe(t,C):(l.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:O}),V(t,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==O||null===(h=O.video)||void 0===h||null===(g=h.contentDetails)||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0||(null==O||null===(I=O.video)||void 0===I||null===(E=I.closedCaptions)||void 0===E?void 0:E.length)>0)&&(B=(null==O||null===(_=O.video)||void 0===_||null===(R=_.contentDetails)||void 0===R?void 0:R.closedCaptions)||(null==O||null===(j=O.video)||void 0===j?void 0:j.closedCaptions),P=B.filter((function(e){return"VTT"===e.format})),ie(t,P)),null!=a&&a.disableControls?he():ke(t,Qe(Qe(Qe({},a),F),{},{liveVideo:A,isDvrEnabled:k,res:O,sres:S})),_e(t,Qe(Qe(Qe({},a),F),{},{liveVideo:A}),l,{res:O,sres:S});case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};exports.VLPlayerCore=function(){return{loadVideoInstantly:ve,onTimeUpdate:Ve,getVideoDuration:xe,onVideoEnded:je,init:function(e){return new Promise((function(n,o){var i,r,a,l,d,s,u,c;if(!se(null==e?void 0:e.playerId)){var v=null==e?void 0:e.videoId,m=(null==e?void 0:e.series)||!1;window.videoId=v;var f=null==e?void 0:e.token;ze=JSON.parse(atob(f.split(".")[1])),window.siteId=null===(i=ze)||void 0===i?void 0:i.siteId,window.siteName=null===(r=ze)||void 0===r?void 0:r.site,e.isAnonymousUser=!(null===(a=ze)||void 0===a||!a.anonymousId),e.siteOwner=(null===(l=ze)||void 0===l?void 0:l.site)||null,e.userId=(null===(d=ze)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(s=ze)||void 0===s?void 0:s.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",f);var w,h=null==e?void 0:e.playerId,g=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,y=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(u=e.analytics)||void 0===u?void 0:u.gaId)||null,T=null==e?void 0:e.errors;T&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,I&&(window.playerEntitlementUrl=I),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&("live"===(w=e.skin)||"carousel"===w||"V2"===w||"defaultV2"===w)||(e.skin="default"),Promise.resolve().then((function(){return Ye})).then((function(e){e.importIMA()})),!g||null!=e&&e.series||Promise.resolve().then((function(){return Ye})).then((function(e){e.importChromecast()})),y&&"Safari"==x()&&Promise.resolve().then((function(){return Ye})).then((function(e){e.importAirplay()})),E&&Re("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],p("js",new Date),void p("config",e);var e})).catch((function(e){}));var D=null===(c=document)||void 0===c?void 0:c.getElementById("".concat(h));D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),m?function(e,n){var o,i,r=JSON.parse(atob(n.split(".")[1])),a=r&&r.countryCode;return t({url:F(),params:b({id:e,deviceType:"web_browser",contentConsumption:"web",countryCode:a,episodeData:!0},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i?void 0:i.entitlement),method:"GET",headers:{Authorization:n},withCredentials:!0})}(v,f).then((function(t){var i=t.data.series,r=t.data.series.seasons[0].episodes[0].id;O(r,f).then((function(t){var r,a,l;window.contentType=null==t||null===(r=t.data)||void 0===r||null===(a=r.video)||void 0===a||null===(l=a.gist)||void 0===l?void 0:l.contentType,Z(t.data),Ze(h,{res:null==t?void 0:t.data,sres:i},e,{resolve:n,reject:o})})).catch((function(e){we(e,h,o)}))})).catch((function(e){we(e,h,o)})):O(v,f).then((function(t){var i,r,a,l;window.contentType=null==t||null===(i=t.data)||void 0===i||null===(r=i.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,Z(null==t?void 0:t.data);var d=null==t?void 0:t.data;null!=e&&e.watchHistory&&null!=e&&null!==(l=e.watchHistory)&&void 0!==l&&l.enable?S(v,f).then((function(t){var i,r,a,l,s,u;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l||l.cb(null==t?void 0:t.data)),e.watchHistoryResumeTime=(null==t||null===(s=t.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==t||null===(u=t.data)||void 0===u?void 0:u.watchedPercentage)||null,Ze(h,{res:d},e,{resolve:n,reject:o})})).catch((function(t){var i,r,a,l;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l||l.cb(t)),Ze(h,{res:d},e,{resolve:n,reject:o})})):Ze(h,{res:d},e,{resolve:n,reject:o})})).catch((function(e){we(e,h,o)}))}}))},getRenditions:Be,skip:le,getPlayer:ue,play:re,pause:ae,detectBrowser:x,rewind:de,loadVideo:fe,seekToTimeStamp:Fe,isPlayerInitialised:se,load:ce,dispose:me,enableCaptions:te,disableCaptions:ne,getCaptions:oe,playSelectedResolution:Ue,getSource:J,setVolume:Se,getVolume:Ce,disableControls:he,setPlaybackSpeed:Le}},exports.closeOpenDrawers=function(){var e=a(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))},exports.createIconMarkup=function(e){var t=document.createElement("div");return t.innerHTML=e,t.children[0]},exports.detectBrowser=x,exports.disableCaptions=ne,exports.enableCaptions=te,exports.getCaptions=oe,exports.getCurrentVideo=ee,exports.getPlayer=ue,exports.getRenditions=Be,exports.getSeriesWatchHistory=function(e){var n,o;if("v1"==((null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1"))return t({method:"GET",url:P(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token}});var i=e.videoId;return t({method:"GET",url:C(i),headers:{Authorization:e.token}})},exports.getVideoIdx=function(){return Y},exports.highlightVideo=function(e){a(document.querySelectorAll("[video-idx]")).map((function(t){var n=t.getAttribute("video-idx");t.style.border=n==e?"2px solid white":"none"}))},exports.load=ce,exports.onVideoEnded=je,exports.pause=ae,exports.play=re,exports.playSelectedResolution=Ue,exports.resolution=qe,exports.rewind=de,exports.setCurrentVideo=Z,exports.setVideoIdx=function(e){Y=e},exports.skip=le;
@@ -1 +0,0 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"axios";import n from"@babel/runtime/helpers/asyncToGenerator";import o from"@babel/runtime/regenerator";import i from"video.js";import"js-cookie";import r from"ua-parser-js";import a from"@babel/runtime/helpers/toConsumableArray";import l from"@babel/runtime/helpers/classCallCheck";import d from"@babel/runtime/helpers/createClass";import s from"@babel/runtime/helpers/assertThisInitialized";import u from"@babel/runtime/helpers/inherits";import c from"@babel/runtime/helpers/possibleConstructorReturn";import v from"@babel/runtime/helpers/getPrototypeOf";var m={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status","beacon-msn-dev":"https://analytics-api.develop.monumentalsportsnetwork.com/player-beacon","beacon-msn-qa":"https://analytics-api.qa.monumentalsportsnetwork.com/player-beacon","beacon-msn-uat":"https://analytics-api.uat.monumentalsportsnetwork.com/player-beacon","beacon-msn-prod":"https://analytics-api.monumentalsportsnetwork.com/player-beacon","beacon-prod":"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",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"};function p(){window.dataLayer.push(arguments)}function f(e,t){p("event",e,t)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function h(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?w(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):w(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function g(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function y(){var e=window.sessionStorage.getItem("uid");return e||(e=g(),window.sessionStorage.setItem("uid",e),e)}function I(e){return e?String(e):""}window.initialise=function(e){var t,n,o;window.sid=g();var i=function(e){switch(e){case"prod":default:return m["beacon-prod"];case"msndev":return m["beacon-msn-dev"];case"msnqa":return m["beacon-msn-qa"];case"msnuat":return m["beacon-msn-uat"];case"monumental-network":return m["beacon-msn-prod"]}}((null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.url)||"prod");window.beaconUrl=i,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,o,i,r=Math.floor(e.currentTime());f(r?"FAILED_TO_START":"DROPPED_STREAM",h({pfm:window.platform,uid:y(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),f("PLAY",h({pfm:window.platform,uid:y(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){if(t.el_){var n,o,i,r=e+.1;if(+r.toFixed(2)%5==0)f("BUFFERING",h({pfm:window.platform,uid:y(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return r}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,f("FIRST_FRAME",h({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:y(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.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,o,i,r,a;f("AD_REQUEST",h({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:y(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,adPosition:1}),f("AD_IMPRESSION",h({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:y(),vid:window.videoId},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),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(),o=e.buffered(),i=0;i<o.length;i++){var r=o.start(i),a=o.end(i);if(E(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var E=function(e,t,n){return e>=t&&e<=n};function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function b(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?T(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):T(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window.fireEvent=function(e){var n,o,i,r,a,l,d=[h(h(h({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params),{},{uid:y(),vid:window.videoId,url:e.url||document.location.href,ref:e.ref||document.referrer,pa:e.eventName,vpos:I(e.videoPosition),environment:window.environment,dp1:e.dp1||"",dp2:e.dp2||"",dp3:e.dp3||"",dp4:e.dp4||"",dp5:e.dp5||"",apos:!0===e.isAdEvent?I(e.videoPosition):"",apod:!0===e.isAdEvent?I(e.adPosition):"",profid:"",player:e.playerType||"native",media_type:e.mediaType||"VIDEO",stream_id:window.sid,embedurl:"",ttfirstframe:I(e.ttFirstFrame),bitrate:I(e.bitrate),connectionspeed:"",resolutionheight:I(e.resHeight),resolutionwidth:I(e.resWidth),bufferhealth:I(e.bufferHealth)},(null==e?void 0:e.duration)&&{duration:e.duration}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(l=a.beacon)||void 0===l?void 0:l.params)];t({url:window.beaconUrl,method:"post",contentType:"application/x-www-form-urlencoded",dataType:"text",data:d}).catch((function(e){console.error(e)}))},window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var O=function(e,n){var o,i;return t({url:F(),params:b({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i?void 0:i.entitlement),method:"GET",headers:{Authorization:n},withCredentials:!0})},D=function(e,n,o){if("v1"==o){var i={siteOwner:null==e?void 0:e.siteOwner,userId:null==e?void 0:e.userId,videoId:null==e?void 0:e.videoId,watchedPercentage:null==e?void 0:e.watchedPercentage,watchedTime:null==e?void 0:e.watchedTime};return t({url:A(),method:"POST",headers:{Authorization:n,"x-api-key":e.xApiKey},params:{version:"v2"},data:JSON.stringify(i),withCredentials:!0})}if("v2"==o){var r={doneWatching:null==e?void 0:e.doneWatching,videoId:null==e?void 0:e.videoId,watchedPercentage:null==e?void 0:e.watchedPercentage,watchedTime:null==e?void 0:e.watchedTime};return t({url:N(),method:"POST",headers:{Authorization:n},data:r,params:b({},(null==e?void 0:e.profileId)&&{profileId:null==e?void 0:e.profileId})})}},S=function(e,n){var o,i,r=(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(n.split(".")[1])),s=(null==d?void 0:d.site)||null;return t({method:"GET",url:k(e),params:{site:s},headers:{Authorization:n,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey}})}if("v2"==r){var u,c;JSON.parse(atob(n.split(".")[1]));var v=window.contentType;return t({method:"GET",url:R(e,v),headers:{Authorization:n,"x-api-key":null===(u=window)||void 0===u||null===(c=u.watchHistory)||void 0===c?void 0:c.xApiKey}})}},_=function(e){var n,o;if("v1"==((null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1"))return t({method:"GET",url:P(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token}});var i=e.videoId;return t({method:"GET",url:C(i),headers:{Authorization:e.token}})},C=function(e){return j()+"".concat(null==m?void 0:m.getSeriesWatchHistoryV2,"/").concat(e)},P=function(){return j()+"".concat(null==m?void 0:m.getSeriesWatchHistoryV1)},k=function(e){return j()+"".concat(null==m?void 0:m.getVideoInfoV1,"/").concat(e)},R=function(e,t){return j()+"".concat(null==m?void 0:m.getVideoInfoV2,"/").concat(t,"/").concat(e)},A=function(){return j()+"".concat(null==m?void 0:m.saveWatchHistoryV1)},N=function(){return j()+"".concat(null==m?void 0:m.saveWatchHistoryV2)},F=function(){return j()+"".concat(null==m?void 0:m.getVideoDetails)},L=function(e,t){return j()+"".concat(null==m?void 0:m.getSeriesDetails)},j=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==m?void 0:m.apiBaseUrl)},V=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 o=document.getElementById(e),i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),i.appendChild(r),o.append(i)}},x=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var B=function(){var e,t;return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.onlyPlayReadyDRM||navigator.userAgent.indexOf("Edg")>-1?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"};function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function M(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?H(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):H(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window._deviceInfo=r(navigator.userAgent);var W=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},U=function(e){var t=q(e,"video.tags",[]),n=q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},q=function(e,t,n){for(var o=0,i=(t=t.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[t[o]]}return e||n},z=function(){var e,t,n,o,i,r,a,l,d,s,u,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",v=arguments.length>1?arguments[1]:void 0,m=arguments.length>2?arguments[2]:void 0,p=me(v);if(!c.includes("VIEWLIFT_"))return c;var f=window.getComputedStyle(document.getElementById(v),null),w=Math.trunc(f.getPropertyValue("height").slice(0,-2)),h=Math.trunc(f.getPropertyValue("width").slice(0,-2)),g=q(m,"video.gist.id",""),y=M({VIEWLIFT_WIDTH:h,VIEWLIFT_HEIGHT:w,VIEWLIFT_SIZE:W(h,w),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(e=window)||void 0===e?void 0:e.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:navigator.userAgent,VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:q(m,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:q(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:q(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==p||null===(t=p.options_)||void 0===t?void 0:t.autoplay)||1,VIEWLIFT_MUTE:(null==p||null===(n=p.options_)||void 0===n?void 0:n.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:U(m),VIEWLIFT_MEDIA_ID:g,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(q(m,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:g,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+q(m,"video.gist.permalink","")),VIEWLIFT_COPPA:q(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(r=i.site)||void 0===r?void 0:r.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:q(null===(a=window)||void 0===a||null===(l=a.app_data)||void 0===l||null===(d=l.site)||void 0===d?void 0:d.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*q(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:q(m,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:g,VIEWLIFT_CONTENT_TITLE:q(m,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:q(m,"video.series[0].gist.title",q(m,"seriesInfo.title","VIEWLIFT_CONTENT_SERIES_TITLE")),VIEWLIFT_CONTENT_EPISODE:q(m,"video.currentEpisode","VIEWLIFT_CONTENT_EPISODE"),VIEWLIFT_CONTENT_SEASON:q(m,"video.currentSeason","VIEWLIFT_CONTENT_SEASON"),VIEWLIFT_CONTENT_GENRE:q(m,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER"},null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.macros);for(var I in y){var E=new RegExp("\\b("+I+")\\b","g");c=c.replace(E,y[I])}return c};function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function K(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?G(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var Y,J,X=function(e,t){var n,o,i,r,a,l,d,s,u=null==e||null===(n=e.video)||void 0===n?void 0:n.drmEnabled,c=null==e||null===(o=e.video)||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,v=(null==e||null===(r=e.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a||null===(l=a.videoAssets)||void 0===l?void 0:l.hls)||!1,m=(null==e||null===(d=e.video)||void 0===d||null===(s=d.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;if(u){var p=Z(c,t);return p.src=z(p.src,t,e),m&&(p=K(K({},p),{},{src:$(K(K({},e.video),{},{src:"".concat(p.src)}))})),p}if(v){var f=Q(c);return f.src=z(f.src,t,e),m&&(f=K(K({},f),{},{src:$(K(K({},e.video),{},{src:"".concat(f.src)}))})),f}if(null!=c&&c.mpeg){var w=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(c);return w.src=z(w.src,t,e),w}return null},$=function(e){var t=e.src;if(e.liveDetails.startOverTime){var n=e.liveDetails.startOverTime,o=e.gist.scheduleStartDate,i=e.gist.scheduleEndDate,r=new Date,a=0,l=r.getTime();a=l-o<1e3*n?l-o:1e3*n;var d=null;i<=l&&null!=i&&(d=new Date(i)),r.setMilliseconds(r.getMilliseconds()-a),t=t.includes("?")?i&&d?"".concat(e.src,"&start=").concat(r.toISOString(),"&end=").concat(d.toISOString()):"".concat(e.src,"&start=").concat(r.toISOString()):i&&d?"".concat(e.src,"?start=").concat(r.toISOString(),"&end=").concat(d.toISOString()):"".concat(e.src,"?start=").concat(r.toISOString())}return t},Q=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},Z=function(e,t){var n=e.fairPlay,o=e.widevine,r=e.playReady,a=B(),l=me(t);if("Safari"===a){var d=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,o){console.log(e),e&&n(e),n(null,new Uint8Array(o))}))},getContentId:function(e,t){if(t)return new TextDecoder("utf-16").decode(t.slice(16))},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);try{l.eme()}catch(e){}return d}if("Chrome"===a||"Firefox"===a){var s={src:o.url,type:"application/dash+xml",keySystemOptions:[]};return s.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),s}if("IE"===a){var u={src:r.url,type:"application/dash+xml",keySystemOptions:[]};return u.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),u}};var ee=function(e){Y=e},te=function(){return Y},ne=function(){return J},oe=function(e){J=e},ie=function(e,t){for(var n=me(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"===i.kind&&i.id==t&&(i.mode="showing")}},re=function(e,t){for(var n=me(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"===i.kind&&i.id===t&&(i.mode="hidden")}},ae=function(e){var t,n=me(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind})))||[]},le=function(e,t){var n=me(e);n.remoteTextTracks().tracks_.map((function(e){n.removeRemoteTextTrack(e)})),t.map((function(e){n.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},de=function(e){i(e).play()},se=function(e){i(e).pause()},ue=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},ce=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},ve=function(e){return!!i.getPlayer("".concat(e))},me=function(e){return!!i.getPlayer("".concat(e))&&i.getPlayer("".concat(e))},pe=function(e,t,n){var o,i,r,a=0,l=0;return null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.enable&&S(t,n).then((function(e){var t,n,o,i,r,d;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),a=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,l=(null==e||null===(d=e.data)||void 0===d?void 0:d.watchedPercentage)||null})).catch((function(e){var t,n,o,i;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})),new Promise((function(o,i){O(t,n).then((function(t){var n,r,d=null==t?void 0:t.data,s=(null==d||null===(n=d.video)||void 0===n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;ee(t.data);var u=X(d,e);if(u){var c,v,m,p,f,w,h,g,y,I,E,T=null==d||null===(c=d.video)||void 0===c||null===(v=c.gist)||void 0===v?void 0:v.videoImageUrl,b=me(e);if(b.poster(T),ge(e,u),b.on("loadstart",(function(){s&&o({status:!0,msg:"Video Loaded",response:d})})),b.on("loadeddata",(function(){x(),o({status:!0,msg:"Video Loaded",response:d})})),b.one("play",(function(){a&&l<95&&b.currentTime(a)})),b.one("error",(function(){var e;i({status:!1,msg:(null==b||null===(e=b.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==d||null===(m=d.video)||void 0===m||null===(p=m.contentDetails)||void 0===p||null===(f=p.closedCaptions)||void 0===f?void 0:f.length)>0||(null==d||null===(w=d.video)||void 0===w||null===(h=w.closedCaptions)||void 0===h?void 0:h.length)>0)g=((null==d||null===(y=d.video)||void 0===y||null===(I=y.contentDetails)||void 0===I?void 0:I.closedCaptions)||(null==d||null===(E=d.video)||void 0===E?void 0:E.closedCaptions)).filter((function(e){return"VTT"===e.format})),le(e,g);else!function(e){var t=me(e);t.remoteTextTracks().tracks_.map((function(e){null==e||e.kind,t.removeRemoteTextTrack(e)}))}(e)}else V(e,"Incompatible Source, only hls,mp4,drm content is allowed"),i("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(t){ye(t,e,i)}))}))},fe=function(e,t){var n=me(e);return n.src(t),new Promise((function(e,t){n.on("loadedmetadata",(function(){e({status:!0,msg:"video loaded"})}))}))},we=function(e){var t=me(e);if(he(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},he=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()},ge=function(e,t){me(e).src(t)},ye=function(e,t,n){var o,r,a,l,d,s,u=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(a=e.response)||void 0===a||null===(l=a.data)||void 0===l?void 0:l.errorMessage)||(null==e?void 0:e.message);ve(t)||i(t,{fluid:!0}),V(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[u])||"".concat(c)),n&&n({status:!1,response:e,msg:"".concat(c)})},Ie=function(){var e=document.getElementsByClassName("vjs-control-bar")[0];e&&(e.style.visibility="hidden");var t=document.getElementsByClassName("vjs-big-play-button")[0];t&&(t.style.display="none");var n=document.getElementsByClassName("vjs-fullscreen-control")[0];n&&(n.style.display="none")};function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Te(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Ee(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var be,Oe,De=function(e,t){var n=me(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,o,r,a,l,d=this.el(),s=i.dom.getPointerPosition(d,t).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(o=n.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(a=r.CastContext)||void 0===a||null===(l=a.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*s,v.seek()}}))},Se=[],_e=0;function Ce(e,t,n){var o,i,r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Oe=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var l=null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),s=Math.floor(e.duration()),u=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,c={};"v1"==Oe?c={videoId:be,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(d/s*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:u}:"v2"==Oe&&(c={videoId:be,watchedTime:Math.floor(e.currentTime()),watchedPercentage:a?100:Math.floor(d/s*100),doneWatching:a,profileId:l}),D(c,t.token,Oe).then((function(e){})).catch((function(e){})),_e=d+n}var Pe=function(e,t,n){var o=me(e);if(o)if(t>=0&&t<=100){var i=parseFloat(t)/100;o.volume(i),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ke=function(e){var t=me(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var Ae=function(t,n,o,i){var r,a,l=i.res,d=i.sres,s=me(t),u=(null==l||null===(r=l.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;ee(l),s.on("loadstart",(function(){u&&o.resolve({status:!0,msg:"Video Loaded",response:l})})),s.on("loadeddata",(function(){var i;Pe(t,sessionStorage.getItem("volume")||"100");var r,a,s=te();(x(),o.resolve(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?Re(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Re(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:l}:{response:l})),null!=n&&n.watchHistory&&null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.enable&&!n.isAnonymousUser)&&function(e,t,n){var o;Se=[],_e=0,be=n;var i=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.interval)||30,r=me(e);r&&(r.on("timeupdate",(function(){var e=Math.floor(r.currentTime());Se.includes(_e)||(e==_e?(Se.push(e),Ce(r,t,i)):e>_e&&(_e=e+i))})),r.on("ended",(function(){Ce(r,t,i,!0)})))}(t,n,null==s||null===(r=s.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.id)})),s.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];s.trigger("subtitlechanged",t)})),s.on("subtitlechanged",(function(e,t){var n,o,i,r,a,l,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(o=n.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(a=r.getInstance())||void 0===a?void 0:a.S,p=null===(l=window)||void 0===l||null===(d=l.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,w=p.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));f=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(f)}})),s.on("loadedmetadata",(function(){window.endFirstFrame(s)})),s.one("error",(function(){var e,n;V(t,(null==s||null===(e=s.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==s||null===(n=s.error())||void 0===n?void 0:n.message)||"Some error occured"})})),s.one("play",(function(){null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&s.currentTime(null==n?void 0:n.watchHistoryResumeTime)})),s.on("volumechange",(function(){var e=100*s.volume().toFixed(2);s.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},Ne=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-de0a7286.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-cfa0dc95.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-affa5562.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n&&import("./skin-59fef55d.js").then((function(n){n.initialiseSkin(e,t)}))},Fe=function(e){return new Promise((function(t,n){if(Le(e))n("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!1,o.src=e,document.head.appendChild(o),t()}}))},Le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},je=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)},Ve=function(e,t,n){var o=me(e);o?t>=0&&t<=o.duration()?(n({status:!0,msg:"Successfully seeked to timestamp : ".concat(t)}),o.currentTime(t)):n({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):n("Cannot find player with id: '".concat(e,"'"))},xe=function(e,t){var n=me(e);if(!n)return"Cannot find player with id: '".concat(e,"'");try{return n.playbackRate(t),"Playback speed set to ".concat(t,"x")}catch(e){return"Error: ".concat(e)}},Be=function(e,t){var n=me(e);n?n.on("timeupdate",(function(){return t(n.currentTime())})):t("Cannot find player with id: '".concat(e,"'"))},He=function(e,t){var n=me(e);n?n.on("ended",(function(){return t(!0)})):t("Cannot find player with id: '".concat(e,"'"))},Me=function(e){var t=me(e);return t?t.duration():"Cannot find player with id: '".concat(e,"'")},We=function(e){var t,n=me(e),o=[];if((null==n||null===(t=n.tech_)||void 0===t?void 0:t.vhs)||!1){var i,r,a=null==n||null===(i=n.tech_)||void 0===i||null===(r=i.vhs)||void 0===r?void 0:r.representations();(null==a?void 0:a.length)>0&&(o=null==a?void 0:a.sort((function(e,t){return(null==e?void 0:e.height)==(null==t?void 0:t.height)?(null==t?void 0:t.bandwidth)-(null==e?void 0:e.bandwidth):(null==t?void 0:t.height)-(null==e?void 0:e.height)})))}else{var l,d,s=null==n||null===(l=n.dash)||void 0===l||null===(d=l.mediaPlayer)||void 0===d?void 0:d.getBitrateInfoListFor("video");(null==s?void 0:s.length)>0&&(o=null==s?void 0:s.sort((function(e,t){return t.height-e.height})))}return o};function Ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=v(e);if(t){var i=v(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return c(this,n)}}var qe=i.getComponent("Component"),ze=function(t){u(o,qe);var n=Ue(o);function o(t){var r,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,o),r=n.call(this,t,d),e(s(r),"masterRenditions",[]),e(s(r),"addCustomFont",(function(e){var t=i.dom.createEl("div",{className:"font hideCustomFonts"}),n=i.dom.createEl("p",{className:"customFontHeading",innerHTML:"Font Size"});i.dom.appendContent(t,n);var o=i.dom.createEl("div",{className:"font-options"});o.style.fontSize="12px",r.fontSizeOptions.map((function(e,t){var n=i.dom.createEl("div",{className:"options",innerHTML:'<div class="radio-item" >\n <input class=opt'.concat(t,' type="radio" id=').concat(e,' name="item" />\n <label class="radio-btn-lable" for=').concat(e,">").concat(e,"pt</label>\n </div>")});n.addEventListener("click",(function(e){var t=e.target.id;r.changeFontSize(t)})),i.dom.appendContent(o,n)})),i.dom.appendContent(t,o),i.dom.appendContent(e,t)})),e(s(r),"resetRenditions",(function(){a(document.getElementsByClassName("rendition")).map((function(e){i.dom.removeClass(e,"selected")}))})),r.playerId=null==d?void 0:d.playerId,r.skin=null==d?void 0:d.skin,r.icon=null==d?void 0:d.icon,r.masterRenditions=[],r.fontSizeOptions=[10,12,14],r.createRenditions(d.renditions),window.height=null,r}return d(o,[{key:"toggleContentOnHover",value:function(e,t){var n=i.dom.$(".setting-icon",e);n.addEventListener("mouseover",(function(){i.dom.removeClass(t,"hidden")})),t.addEventListener("mouseover",(function(){i.dom.removeClass(t,"hidden")})),n.addEventListener("mouseout",(function(){i.dom.addClass(t,"hidden")})),t.addEventListener("mouseout",(function(){i.dom.addClass(t,"hidden")}))}},{key:"changeFontSize",value:function(e){var t=i.dom.$(".renditions",this.contentEl()),n=i.dom.$(".font-options",this.contentEl());t.style.fontSize="".concat(e,"px"),n.style.fontSize="".concat(e,"px")}},{key:"createRenditions",value:function(e){var t=this,n=this.el();i.dom.$(".setting-icon",this.el()).innerHTML="".concat(this.icon," ").concat("live"===this.skin?"&nbsp Settings":""," ");var o=i.dom.createEl("div",{className:"content hidden"}),r=i.dom.createEl("div",{innerHTML:"Quality",className:"title"}),a=i.dom.createEl("div",{className:"resolution"});i.dom.appendContent(a,r),this.toggleContentOnHover(n,o);var l=i.dom.createEl("div",{className:"renditions"});this.player_.tech_.vhs?(e.map((function(e,n){var o,r,a=i.dom.createEl("div",{className:"relative"}),d=(((null==e||null===(o=e.playlist)||void 0===o?void 0:o.attributes["AVERAGE-BANDWIDTH"])||(null==e||null===(r=e.playlist)||void 0===r?void 0:r.attributes.BANDWIDTH))/1048576).toFixed(1),s="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");s="".concat(e.height,"p @ ").concat(d,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");var u=i.dom.createEl("p",{innerHTML:s,className:"rendition",res:e.height,bandwidth:e.bandwidth});i.dom.appendContent(a,u),i.dom.appendContent(l,a),u.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(t.resetRenditions(),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,Ge(t.playerId,e.target),i.dom.addClass(u,"selected"))}))})),this.addAutoRendition("nondrm",l),"Safari"!=B()&&this.addDynamicSwitchIfAuto()):(e.map((function(e,n){var o=i.dom.createEl("div",{className:"relative"}),r=(e.bitrate/1e6).toFixed(1),a="".concat(e.height,"p ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":"");window.enableResolutionsBitrate&&(a="".concat(e.height,"p @ ").concat(r,"mbps ").concat(e.height>719&&e.height<1081?"<span>HD</span>":e.height>1081&&e.height<1500?"<span>2K (HD)</span>":e.height>1501?"<span>4K (HD)</span>":""));var d=i.dom.createEl("p",{innerHTML:a,className:"rendition",res:e.height,qualityIndex:e.qualityIndex});i.dom.appendContent(o,d),i.dom.appendContent(l,o),d.addEventListener("click",(function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(t.resetRenditions(),window.height=e.target.res,window.selectedVideo=e.target.video,window.qualityIndex=e.target.qualityIndex,Ge(t.playerId,e.target),i.dom.addClass(d,"selected"))}))})),this.addAutoRendition("drm",l)),i.dom.appendContent(a,l),i.dom.appendContent(o,a),i.dom.appendContent(n,o)}},{key:"addDynamicSwitchIfAuto",value:function(){for(var e,t=this.player_.textTracks(),n=0;n<t.length;n++)"segment-metadata"===t[n].label&&(e=t[n]);var o=null;e&&e.on("cuechange",(function(){var t,n,i=e.activeCues[0];if(console.log((null==i||null===(t=i.value)||void 0===t||null===(n=t.resolution)||void 0===n?void 0:n.height)+"p"),i&&document.querySelector(".auto.selected")){var r,a,l,d,s,u,c,v;if(null!=i&&null!==(r=i.value)&&void 0!==r&&null!==(a=r.resolution)&&void 0!==a&&a.height&&o!==(null==i||null===(l=i.value)||void 0===l||null===(d=l.resolution)||void 0===d?void 0:d.height))document.querySelector(".auto.selected").innerHTML="Auto ".concat(null==i||null===(c=i.value)||void 0===c||null===(v=c.resolution)||void 0===v?void 0:v.height,"p");o=null==i||null===(s=i.value)||void 0===s||null===(u=s.resolution)||void 0===u?void 0:u.height}}))}},{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"container"}),t=i.dom.createEl("div",{className:"setting-icon"});return i.dom.appendContent(e,t),e}},{key:"addAutoRendition",value:function(e,t){var n=this;if("nondrm"==e){var o,r,a,l,d=null===(o=this.player_)||void 0===o||null===(r=o.tech_)||void 0===r?void 0:r.vhs.selectPlaylist().attributes.RESOLUTION.height,s=null===(a=this.player_)||void 0===a||null===(l=a.tech_)||void 0===l?void 0:l.vhs.selectPlaylist().attributes.BANDWIDTH,u=i.dom.createEl("div",{className:"relative"}),c=i.dom.createEl("p",{innerHTML:"Auto ".concat(d,"p"),className:"rendition auto selected",bandwidth:s,res:d});c.addEventListener("click",(function(e){window.height!==e.target.res&&(n.resetRenditions(),i.dom.addClass(c,"selected"),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,Ge(n.playerId,null,!0))})),i.dom.appendContent(u,c),i.dom.appendContent(t,u)}else{var v=i.dom.createEl("div",{className:"relative"}),m=i.dom.createEl("p",{innerHTML:"Auto",className:"rendition selected",qualityIndex:"auto"});m.addEventListener("click",(function(e){n.resetRenditions(),i.dom.addClass(m,"selected"),window.qualityIndex=e.target.qualityIndex,window.selectedVideo=e.target.video,Ge(n.playerId,null,!0)})),i.dom.appendContent(v,m),i.dom.appendContent(t,v)}}}]),o}(),Ge=function(e,t,n){var o,r=me(e),a=null==t?void 0:t.bandwidth;if((null==r||null===(o=r.tech_)||void 0===o?void 0:o.vhs)||!1){r.tech_.vhs.representations().forEach((function(e){n||e.bandwidth===a?e.enabled(!0):e.enabled(!1)})),r.handleTechPlaying_();var l=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(l)}),100);var d=i.dom.$(".content");d&&i.dom.addClass(d,"hidden")}else{var s=null==t?void 0:t.qualityIndex;if(n){var u,c;null==r||null===(u=r.dash)||void 0===u||null===(c=u.mediaPlayer)||void 0===c||c.resetSettings()}else{var v,m,p,f;null==r||null===(v=r.dash)||void 0===v||null===(m=v.mediaPlayer)||void 0===m||m.updateSettings({streaming:{abr:{autoSwitchBitrate:!1}}}),null==r||null===(p=r.dash)||void 0===p||null===(f=p.mediaPlayer)||void 0===f||f.setQualityFor("video",s,!0);var w=r.currentTime();r.currentTime(0),setTimeout((function(){r.currentTime(w)}),100);var h=i.dom.$(".content");h&&i.dom.addClass(h,"hidden")}}},Ke=Object.freeze({__proto__:null,playSelectedResolution:Ge,default:ze}),Ye=function(e){var t=document.createElement("div");return t.innerHTML=e,t.children[0]},Je=function(e){a(document.querySelectorAll("[video-idx]")).map((function(t){var n=t.getAttribute("video-idx");t.style.border=n==e?"2px solid white":"none"}))},Xe=function(){var e=a(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))};var $e,Qe=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ze=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),et=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),Fe("https://imasdk.googleapis.com/js/sdkloader/ima3.js")},loadDashLibrary:Qe,loadEMELibrary:Ze}),tt=!1,nt=function(e,t){var n=me(e);t&&window.google&&(n.ima.initializeAdDisplayContainer&&n.ima.initializeAdDisplayContainer(),tt?(n.ima.setContentWithAdTag(null,t,!0),n.ima.requestAds()):function(e,t){var n,o,i,r=me(e);if(null!==r.el_){tt=!0;var a={id:e,adTagUrl:"".concat(t,"&vid=").concat(window.videoId,"&url=").concat(window.location.href,"&correlator=").concat((new Date).getTime(),"&cust_params=sd%3D60000%26site%3D").concat(window.location.origin,"%26autostart%3D%26mute%3D%26user_agent%3D%26keyword%3D%26category%3D").concat(window.category,"%26vid%3D").concat(window.videoId),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),tt&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var d="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,d="touchend"),r.one(d,(function(){s&&r.ima.initializeAdDisplayContainer()}));var u=(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;r.one("ads-ad-started",(function(){u&&u({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){u&&u({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){u&&u({status:"ERROR",msg:"Advertisement Error"})}))}}(e,t))};function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function it(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?ot(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ot(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var rt=function(t,r,a,l){var d,s,u,c,v,m,p,f,w,h,g,y,I,E,T,b=r.res,O=void 0===b?null:b,D=r.sres,S=void 0===D?null:D,_=(null===(d=window)||void 0===d||null===(s=d.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(v=c.getInstance())||void 0===v?void 0:v.S)||void 0,C=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==_&&"NOT_CONNECTED"!==_?["html5","chromecast"]:["chromecast","html5"]:["html5"],P=null==O||null===(m=O.video)||void 0===m||null===(p=m.gist)||void 0===p?void 0:p.videoImageUrl,k=(null==O||null===(f=O.video)||void 0===f||null===(w=f.liveDetails)||void 0===w?void 0:w.isDvrEnabled)||!1,R=function(e){var t,n={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(t=window)&&void 0!==t&&t.cast&&(n={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==B()&&(n=Te(Te({},n),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),n}(a),A=(null==O||null===(h=O.video)||void 0===h||null===(g=h.streamingInfo)||void 0===g?void 0:g.isLiveStream)||!1,N=(null==a?void 0:a.drmLibrary)||!1,F=it(it({controls:!0,playsinline:!0,fluid:!0},"carousel"==a.skin&&{muted:!0}),{},(T={autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},liveui:k},e(T,"autoplay",null==a?void 0:a.autoplay),e(T,"normalizeAutoplay",null==a?void 0:a.autoplay),e(T,"html5",it(it({vhs:it({limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(y=a.customData)||void 0===y?void 0:y.overrideNative)&&{overrideNative:!0})},0==(null==a||null===(I=a.customData)||void 0===I?void 0:I.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(E=a.customData)||void 0===E?void 0:E.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(T,"poster",P),e(T,"techOrder",C),e(T,"chromecast",{requestCustomDataFn:function(e){var n=me(t);console.log(n.textTracksJson_);var o=n.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,t,n){var o,i,r,a,l,d,s,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=f}var w=(null==e||null===(o=e.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=w;var h=null==e||null===(r=e.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.runtime;m.duration=h;var g=null==e||null===(l=e.video)||void 0===l||null===(d=l.gist)||void 0===d?void 0:d.title;m.mediaTitle=g;var y=null==e||null===(s=e.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=y,m.subTitles=n,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(O,e,o)}}),e(T,"plugins",R),T)),L=i(t,F,function(){var e=n(o.mark((function e(){var n,r,d,s,u,c,v,m,p,f,w,h,g,y,I,E,T,b,D,_,C,P,R,j,x;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A&&l.resolve(it({status:!0,msg:"Player Initialised"},S?{seriesResponse:S,response:O}:{response:O})),window.initialise(L),window.firstFrame(L),"white"!==window.controlsColor&&je(window.controlsColor,L),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),T=null==O||null===(n=O.video)||void 0===n?void 0:n.drmEnabled,b=(null==O||null===(r=O.ads)||void 0===r||null===(d=r.preRoll)||void 0===d||null===(s=d.adTags)||void 0===s||null===(u=s.web)||void 0===u?void 0:u.active)&&(null==O||null===(c=O.ads)||void 0===c||null===(v=c.preRoll)||void 0===v||null===(m=v.adTags)||void 0===m||null===(p=m.web)||void 0===p?void 0:p.url),D=null==O||null===(f=O.video)||void 0===f||null===(w=f.liveDetails)||void 0===w?void 0:w.startOverTime,!T&&!N){e.next=16;break}if("Safari"!==B()){e.next=14;break}return e.next=12,Ze();case 12:e.next=16;break;case 14:return e.next=16,Promise.all([Ze(),Qe()]);case 16:k&&De(t,D),b&&nt(t,b),(_=X(O,t))?ge(t,_):(l.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:O}),V(t,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==O||null===(h=O.video)||void 0===h||null===(g=h.contentDetails)||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0||(null==O||null===(I=O.video)||void 0===I||null===(E=I.closedCaptions)||void 0===E?void 0:E.length)>0)&&(x=(null==O||null===(P=O.video)||void 0===P||null===(R=P.contentDetails)||void 0===R?void 0:R.closedCaptions)||(null==O||null===(j=O.video)||void 0===j?void 0:j.closedCaptions),C=x.filter((function(e){return"VTT"===e.format})),le(t,C)),null!=a&&a.disableControls?Ie():Ne(t,it(it(it({},a),F),{},{liveVideo:A,isDvrEnabled:k,res:O,sres:S})),Ae(t,it(it(it({},a),F),{},{liveVideo:A}),l,{res:O,sres:S});case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function at(){return{loadVideoInstantly:fe,onTimeUpdate:Be,getVideoDuration:Me,onVideoEnded:He,init:function(e){return new Promise((function(n,o){var i,r,a,l,d,s,u,c;if(!ve(null==e?void 0:e.playerId)){var v=null==e?void 0:e.videoId,m=(null==e?void 0:e.series)||!1;window.videoId=v;var f=null==e?void 0:e.token;$e=JSON.parse(atob(f.split(".")[1])),window.siteId=null===(i=$e)||void 0===i?void 0:i.siteId,window.siteName=null===(r=$e)||void 0===r?void 0:r.site,e.isAnonymousUser=!(null===(a=$e)||void 0===a||!a.anonymousId),e.siteOwner=(null===(l=$e)||void 0===l?void 0:l.site)||null,e.userId=(null===(d=$e)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(s=$e)||void 0===s?void 0:s.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",f);var w,h=null==e?void 0:e.playerId,g=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,y=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(u=e.analytics)||void 0===u?void 0:u.gaId)||null,T=null==e?void 0:e.errors;T&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,I&&(window.playerEntitlementUrl=I),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&("live"===(w=e.skin)||"carousel"===w||"V2"===w||"defaultV2"===w)||(e.skin="default"),Promise.resolve().then((function(){return et})).then((function(e){e.importIMA()})),!g||null!=e&&e.series||Promise.resolve().then((function(){return et})).then((function(e){e.importChromecast()})),y&&"Safari"==B()&&Promise.resolve().then((function(){return et})).then((function(e){e.importAirplay()})),E&&Fe("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],p("js",new Date),void p("config",e);var e})).catch((function(e){}));var D=null===(c=document)||void 0===c?void 0:c.getElementById("".concat(h));D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),m?function(e,n){var o,i,r=JSON.parse(atob(n.split(".")[1])),a=r&&r.countryCode;return t({url:L(),params:b({id:e,deviceType:"web_browser",contentConsumption:"web",countryCode:a,episodeData:!0},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i?void 0:i.entitlement),method:"GET",headers:{Authorization:n},withCredentials:!0})}(v,f).then((function(t){var i=t.data.series,r=t.data.series.seasons[0].episodes[0].id;O(r,f).then((function(t){var r,a,l;window.contentType=null==t||null===(r=t.data)||void 0===r||null===(a=r.video)||void 0===a||null===(l=a.gist)||void 0===l?void 0:l.contentType,ee(t.data),rt(h,{res:null==t?void 0:t.data,sres:i},e,{resolve:n,reject:o})})).catch((function(e){ye(e,h,o)}))})).catch((function(e){ye(e,h,o)})):O(v,f).then((function(t){var i,r,a,l;window.contentType=null==t||null===(i=t.data)||void 0===i||null===(r=i.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,ee(null==t?void 0:t.data);var d=null==t?void 0:t.data;null!=e&&e.watchHistory&&null!=e&&null!==(l=e.watchHistory)&&void 0!==l&&l.enable?S(v,f).then((function(t){var i,r,a,l,s,u;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l||l.cb(null==t?void 0:t.data)),e.watchHistoryResumeTime=(null==t||null===(s=t.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==t||null===(u=t.data)||void 0===u?void 0:u.watchedPercentage)||null,rt(h,{res:d},e,{resolve:n,reject:o})})).catch((function(t){var i,r,a,l;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l||l.cb(t)),rt(h,{res:d},e,{resolve:n,reject:o})})):rt(h,{res:d},e,{resolve:n,reject:o})})).catch((function(e){ye(e,h,o)}))}}))},getRenditions:We,skip:ue,getPlayer:me,play:de,pause:se,detectBrowser:B,rewind:ce,loadVideo:ge,seekToTimeStamp:Ve,isPlayerInitialised:ve,load:pe,dispose:we,enableCaptions:ie,disableCaptions:re,getCaptions:ae,playSelectedResolution:Ge,getSource:X,setVolume:Pe,getVolume:ke,disableControls:Ie,setPlaybackSpeed:xe}}export{at as V,We as a,te as b,Ye as c,B as d,se as e,ae as f,me as g,ee as h,_ as i,Xe as j,Je as k,pe as l,oe as m,ne as n,He as o,de as p,re as q,ce as r,ue as s,ie as t,Ge as u,Ke as v};