@viewlift/player-backup 2.0.200-backup → 2.0.202-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import"video.js/dist/video-js.min.css";import{d as e,c as n,g as t,a as o,b as i,s as l,e as r,l as a,i as u,f as s,h as d,j as c,k as v,m as p,n as f,o as m,p as g,q as y,r as h,t as b,u as w,v as k,w as I,x as S,y as O,z as j,A as T,B as P,C as E,D,E as C,F as x,G as A,H as R,I as L,J as N,K as _,L as M,M as V,N as B,O as U,P as H}from"./generic-e9c5dc1a.js";import F from"@babel/runtime/helpers/defineProperty";import K from"@babel/runtime/helpers/asyncToGenerator";import q from"@babel/runtime/regenerator";import J from"video.js";import{o as W,g as z,a as G,s as X,b as Y,p as Q,c as $}from"./util-0d462277.js";import{g as Z,d as ee,a as ne,e as te}from"./captions-78bd2908.js";import{g as oe,p as ie}from"./resolution-62be852a.js";import{i as le,a as re}from"./skin-65765793.js";import{g as ae}from"./player_instance-34118a5b.js";import{s as ue}from"./localisation-0bf399a1.js";import{g as se,a as de,s as ce,v as ve,b as pe,c as fe,d as me,e as ge,f as ye}from"./currentVideoInfo-0b234e55.js";import he from"@babel/runtime/helpers/typeof";import{s as be,w as we}from"./icons-37daa6b3.js";import{c as ke,p as Ie,a as Se,h as Oe,r as je,g as Te,b as Pe,d as Ee,s as De,e as Ce,f as xe}from"./helper-d52dff3c.js";import Ae from"@babel/runtime/helpers/toConsumableArray";var Re=function(e){return new Promise(function(n,t){if(Le(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},Le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ne=function(e,n,t){var o=ae(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},_e=function(e){var n=ae(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Me=function(){var n=K(q.mark(function n(t){var o,i,l,r,a;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=ae(null==t?void 0:t.playerId),null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,Re("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(J),(a=J.getTech("chromecast"))&&!a.prototype.seeking&&(a.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}},n,null,[[2,7]])}));return function(e){return n.apply(this,arguments)}}(),Ve=function(e,n){var t=ae(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),u=J.dom.getPointerPosition(a,n).x;J.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(s),s&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,c.seek()}})};var Be=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Re("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then(function(e){n.set(e)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),He=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){J.getPlugin("eme")||J.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Fe=function(){var e=K(q.mark(function e(){var n;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(J),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-6ecf4a3a.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-fc3c1bcf.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),Je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){Re("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(J)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(J)})},loadAdsLibrary:Be,loadEMELibrary:He,loadMuxPlugin:Fe,loadDvrSeekbar:Ke,loadContribDash:qe,loadComscorePlugin:Ue});function We(e){return ze.apply(this,arguments)}function ze(){return(ze=K(q.mark(function n(t){var o,i,l;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=(null==t?void 0:t.airplay)||!1,n.next=3,Be();case 3:o&&"Safari"==e()?Promise.resolve().then(function(){return Je}).then(function(e){e.importAirplay()}):(l=(null===(i=document)||void 0===i?void 0:i.getElementById(null==t?void 0:t.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ge(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=K(q.mark(function e(n){var t,o,i,l,r,a;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=ae(n.playerId),e.next=3,Ue();case 3:a.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.endpoint,implementationId:null==n||null===(i=n.comscore)||void 0===i?void 0:i.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(r=n.comscore)||void 0===r?void 0:r.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ye(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=K(q.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,y;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return v=(null==o?void 0:o.contentType)||"video",p=null==o||null===(i=o[v])||void 0===i?void 0:i.drmEnabled,null==o||null===(l=o[v])||void 0===l||null===(r=l.liveDetails)||void 0===r||r.isDvrEnabled,null==t||t.showPositiveSeekbar,f=(null==o||null===(a=o[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==t||null===(d=t.comscore)||void 0===d?void 0:d.enable)||!1,g=!(null==t||null===(c=t.analytics)||void 0===c||!c.muxKey),n.prev=7,n.next=10,Promise.allSettled([p?"Safari"==e()?He():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?qe():He():"Safari"!=e()&&f?qe():null,m?Ge(t):null,g?Fe():null,Me(t)]);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(7),console.log("Error",n.t0);case 15:case"end":return n.stop()}},n,null,[[7,12]])}))).apply(this,arguments)}function $e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var en=new Set,nn=null,tn=function(e,n,o,i){var l,r,a,u,s,d,c,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(l=e[p])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=dn(e),v[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),v[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===t()?"NULL":t(),v["c3.cm.categoryType"]=an(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=e[p])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[o.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=un(e),v["c3.cm.genreList"]=ln(e),v["c3.cm.genre"]=on(e),v["c3.cm.channel"]=rn(e,i);var f=pn(se(),e);return v=Ze(Ze({},v),f)},on=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},ln=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},rn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===o?void 0:o.title)||"NULL"},an=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},un=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},sn=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},dn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var cn,vn,pn=function(e,n){var t,l,r,a,u,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var d=i(),c=o();return s["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(l=t.series)||void 0===l?void 0:l.title)||"Null",s["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(r=e[d-1])||void 0===r||null===(a=r.episodes)||void 0===a||null===(u=a[c-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},fn=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},mn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},gn=function(){var e=K(q.mark(function e(n,t){var o,i,l,r,a,u,s,d,c,v,p,f;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},i=o.trackConvivaPlayerEvent,l=o.paymentHandler,r=o.tveProvider,a=o.enable,u=o.appName,d=(s=t||{}).token,c=s.epg,a){e.next=4;break}return e.abrupt("return");case 4:if(v=ae(n),"function"==typeof(p=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,p("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:v.ready(function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=fn(t.keySystem);p("contentInfo",{DRMEnabled:o})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),v.on("loadstart",function(){var e,n;nn&&nn!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),en.clear(),nn=v.currentSrc();var o=mn(v.currentType()),i=de(),a=tn(i,v,f,c);a[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",a[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=sn(i,t),a.authToken=d||"NULL",a.streamType=o,a.D2CType=l||"NONE",a.subscriberType=r?"MVPD":"FREE"!==l?"D2C":"FREE",a["c3.cm.affiliate"]=r||"NULL",yn.setData(a),p("contentInfo",a)}),v.on("loadedmetadata",function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),v.on("play",function(){en.has(v.currentSrc())||(en.add(v.currentSrc()),p("playbackStarted",null))}),v.on("ended",function(){en.has(v.currentSrc())&&en.delete(v.currentSrc()),p("playbackEnded")}),v.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})}),v.on("dispose",function(){null==en||en.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),yn=(cn={},{setData:function(e){cn=Ze(Ze({},cn),e)},getData:function(){return cn}}),hn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-c39cc7a4.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-06d132a7.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-d235a2ec.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-e79cdff2.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-e4e26727.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-3e19d3e4.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-026e23a0.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-9bc879d8.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&import("./skin-02ed9ac3.js").then(function(t){t.initialiseSkin(e,n)})};function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var kn=[],In=0,Sn=null;function On(){console.log("Cleaning up watch history data"),vn=null,kn=[],In=0,Sn=null}function jn(e,n,t){var o,i,r,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,m=Math.floor(e.currentTime()),g=s?100:Math.floor(c/v*100),y={};f?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=Tn(o),l=(new Date).getTime(),r=de(),a=(null==r?void 0:r.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return wn(wn({},e),{},F({},n,a[n]))},{}),s=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===vn});s<0?i.push(wn(wn({content:u},e),{},{addedDate:l,updateDate:l})):i[s]=wn(wn(wn({},i[s]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(y={completed:s,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=wn(wn({videoId:vn,watchedTime:m,watchedPercentage:g,doneWatching:s,profileId:d},Sn&&{seriesId:Sn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),In=c+t}function Tn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pn(e,n,t){var o=Tn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var En=!1,Dn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!En){var l=Cn(e,"videoAssets","secondaryVideoAssets"),u=r(l,n);return u&&a(n,u),En=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Cn(e,n,t){if(Array.isArray(e))return e.map(function(e){return Cn(e,n,t)});if(null!==e&&"object"===he(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Cn(e[i],n,t)}),o}return e}function xn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return An(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?An(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function An(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ln(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Rn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Rn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Nn=function(n,t,o,i){var l,r,a,c,v,p=i.res,f=i.sres,m=ae(n),g=(null==p?void 0:p.contentType)||"video",y=(null==p||null===(l=p[g])||void 0===l?void 0:l.drmEnabled)||!1,h=(null==p||null===(r=p[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==p||null===(c=p[g])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;ce(p),ve.set(p),m&&(m.on("loadstart",function(){h?o.resolve({status:!0,msg:"Video Loaded",response:p}):o.resolve(Ln({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))}),m.on("loadeddata",function(){var o,i,l,r=Z(n);if(null==r||r.map(function(e){return ee(n,e.id)}),b&&"Safari"===e())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&Ne(n,sessionStorage.getItem("volume")||"100");var d=de();if(u(t,p),s(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var c,v,f=Ln(Ln({},t),p);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Sn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),kn=[],In=0,vn=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=ae(e);a&&(a.on("dispose",On),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());kn.includes(In)||(e!=In||e<r?e>In&&(In=e+r):(kn.push(e),jn(a,n,r)))}}),a.one("ended",function(){jn(a,n,r,!0)}))}(n,f,null==d||null===(c=d.video)||void 0===c||null===(v=c.gist)||void 0===v?void 0:v.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var g,y,h,w,k,I,S=(null===(g=de())||void 0===g?void 0:g.video)||(null==p?void 0:p.video),O=null==S?void 0:S.gist,j={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==S||null===(w=S.series)||void 0===w?void 0:w.title,video_stream_type:null!=S&&null!==(k=S.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==t||null===(I=t.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}}),m.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,i,l,r,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){h&&Dn(p,n)}),m.on("error",function(){var e,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?Dn(p,n):(d(n,(null==m||null===(e=m.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured",response:p}))}),m.one("play",function(){var e,n,o,i,l;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var r,a,u,s=null===(r=de())||void 0===r||null===(a=r.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=pe(),c=(null==d?void 0:d.get(s))||{t:0,p:0},v=c.t,p=c.p;v&&p<95&&setTimeout(function(){m.currentTime(v)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(h){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var n,t=(null==m||null===(n=m.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==he(m.dash)){var o,i,l,r=null==m||null===(o=m.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==r?void 0:r.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),u=xn(t);try{for(u.s();!(l=u.n()).done;){var s=l.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=xn(t);try{for(c.s();!(d=c.n()).done;){var v,p,f,g=d.value;if(("Chrome"==e()||"Edge"==e()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!y))&&null!=g&&null!==(f=g.label)&&void 0!==f&&f.includes("5.1"))m.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function _n(e){var n=ae(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;Vn(),Bn(l).forEach(function(e){var n=e.id,t=e.title,i=e.time,r=Mn(n,t,Math.min(i/l*100,99.5));o.appendChild(r)})}}function Mn(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Vn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function Bn(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(fe()||[]).filter(function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n}).map(function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}})}function Un(e,n){var t=ae(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var r=i.playLive,a=i.playFromBegining,u=i.programs;me(u),t.on("loadeddata",function(){ke(n)?a?Ie(t,n):r?Se(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,l=n.epg,r=o.buttonConfig,a=void 0===r?{}:r,u=a.watchLive;a.resume;var s=a.startFromBegining,d=i;if(l&&null!=l&&l.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!Te(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Pe(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,l=t.startFromBegining,r=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(we()," ").concat(r,"</button>"),u='<button id="watch-begining-btn">'.concat(be()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}(o,v),p.style.display="flex",e.el().appendChild(p),Ee(e),Hn("watch-live-resume-btn",u,function(){xe(e,p),Se(e,d)}),Hn("watch-begining-btn",s,function(){xe(e,p),Ie(e,n)})}(t,n),Oe({player:t,showWatchLive:!0,showStartOver:!0})):je(t)}),t.one("loadedmetadata",function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",function(){i=!0}),e.on("seeked",function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}De(s,o),Ce(e,n),Oe({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})}),e.on("timeupdate",function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(De(s,t),o=t,function(e,n){Bn(n).forEach(function(t){var o=t.id,i=t.title,l=t.time,r=document.getElementById(o);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=Mn(o,i,Math.min(l/n*100,99.5));u.appendChild(s)}})}(e,a))}})}(t,n)})}else console.warn("Player instance is required to initialize start over.")}function Hn(e,n,t){var o,i,l=document.getElementById(e);l&&(i=n,(o=l)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),l.addEventListener("click",t))}function Fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Kn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var qn=function(n,t,o,i){var l,u,s,g,y,h,b,w,k,I,S,O,j,T,P,E,D,C,x,A,R,L,N,_,M,V,B,U,H,W,z,G,X,Y,Q,$,Z,ee=t.res,te=void 0===ee?null:ee,oe=t.sres,ie=void 0===oe?null:oe,re=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(l=te)||void 0===l?void 0:l.contentType)||"video",se=le(null===(u=te)||void 0===u||null===(s=u[ue])||void 0===s||null===(g=s.gist)||void 0===g?void 0:g.videoImageUrl)||le(null===(y=te)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.gist)||void 0===b||null===(w=b.imageGist)||void 0===w?void 0:w.r16x9),de=(null===(k=te)||void 0===k||null===(I=k[ue])||void 0===I||null===(S=I.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ce=(null===(O=te)||void 0===O||null===(j=O[ue])||void 0===j||null===(T=j.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,ve=(null===(P=te)||void 0===P||null===(E=P.ads)||void 0===E||null===(D=E.preRoll)||void 0===D||null===(C=D.adTags)||void 0===C||null===(x=C.web)||void 0===x?void 0:x.active)&&(null===(A=te)||void 0===A||null===(R=A.ads)||void 0===R||null===(L=R.preRoll)||void 0===L||null===(N=L.adTags)||void 0===N||null===(_=N.web)||void 0===_?void 0:_.url);te=Kn(Kn({},te),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var pe=(null==o||null===(M=o.customData)||void 0===M?void 0:M.ads)||{},fe=(null===(V=te)||void 0===V||null===(B=V[ue])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==pe?void 0:pe.vodAdSticherProvider)||!1,me=(null==o?void 0:o.latency)||6,ge=(null==o?void 0:o.skin_settings)||{};null==o||o.dvrConfig;var ye=($={enableSmoothSeeking:!0,controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==o.skin,liveui:de},F($,"autoplay",null==o?void 0:o.autoplay),F($,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!ve),F($,"loop",(null==o?void 0:o.loop)||!1),F($,"audioPosterMode",null==o?void 0:o.audioPosterMode),F($,"html5",Kn(Kn({dash:Kn(Kn(Kn({},!J.browser.IS_SAFARI&&{useTTML:!0}),(null==o?void 0:o.debugConfig)&&(null==o||null===(U=o.debugConfig)||void 0===U?void 0:U.enable)&&{debug:!0,logLevel:null!=o&&null!==(H=o.debugConfig)&&void 0!==H&&H.logLevel?null==o||null===(W=o.debugConfig)||void 0===W?void 0:W.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:Kn(Kn({},(null==o?void 0:o.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==o?void 0:o.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Kn(Kn(Kn({},(null==o?void 0:o.initialBandwidth)&&{bandwidth:o.initialBandwidth}),{},{liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==o||null===(z=o.customData)||void 0===z?void 0:z.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(G=null==o?void 0:o.enableLowInitialPlaylist)||void 0===G||G}),debug:(null==o?void 0:o.debugConfig)&&(null==o||null===(X=o.debugConfig)||void 0===X?void 0:X.enable)||!1,nativeTextTracks:"Safari"==e()},0==(null==o||null===(Y=o.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),F($,"poster",se),F($,"techOrder",re),F($,"chromecast",{requestCustomDataFn:function(e){var t,i,l=ae(n),r=((null==l?void 0:l.textTracksJson_)||l.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,i,l,r,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,I;f.isDrmEnabled=!0;var S=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==S?void 0:S.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var j=(null==S?void 0:S.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=j}var T=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=T;var P=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=P;var E=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=E;var D=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=D,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(te,e,r);return Kn(Kn({},a),{},{convivaMetaData:Kn({customerKey:(null==o||null===(t=o.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==o||null===(i=o.convivaConfig)||void 0===i?void 0:i.debug)||!1},yn.getData())})},modifyLoadRequestFn:function(e){var t,o,i,l,r,a=ae(n),u=(null==a?void 0:a.currentSource())||{};!(null===(t=te)||void 0===t||null===(o=t[ue])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(r=u.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!J.getPlayers()[n]){null!=o&&o.debugConfig&&null!=o&&null!==(Z=o.debugConfig)&&void 0!==Z&&Z.enable&&J.log.level("debug");var he=J(n,ye,function(){var e=K(q.mark(function e(){var t,l,u,s,g,y,h,b,w,k,I,S,O,j,T,P,E,D,C,x,A;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(he),console.log(J.VERSION),console.log(J.getPlugins()),e.next=5,Ye(o,te);case 5:if(O=null===(t=te)||void 0===t||null===(l=t[ue])||void 0===l||null===(u=l.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&i.resolve(Kn({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:te}:{response:te})),de&&null!=o&&null!==(s=o.dvrConfig)&&void 0!==s&&s.enable&&Un(n,Kn(Kn({},o),{},{isDvrEnabled:de})),v(n,null==o?void 0:o.analyticsCb,null==o?void 0:o.customData),gn(n,o),/Android/i.test(navigator.userAgent)&&(J.options.vhs.overrideNative=!0),de&&Ve(n,O),!ve||null!=o&&null!==(g=o.customData)&&void 0!==g&&g.disableAds||p(n,ve,te),j=r(te,n),console.log(j),null!=o&&o.nearestClusterUrl&&(j=f(j,o.nearestClusterUrl)),!fe){e.next=21;break}return e.next=20,m(n,te);case 20:j=e.sent;case 21:j?a(n,j):(i.reject({status:!1,msg:"Incompatible / Missing Source",response:te}),d(n,"Incompatible / Missing Source")),((null===(y=te)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.contentDetails)||void 0===b||null===(w=b.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(k=te)||void 0===k||null===(I=k[ue])||void 0===I||null===(S=I.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(P=te)||void 0===P||null===(E=P[ue])||void 0===E||null===(D=E.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=te)||void 0===C||null===(x=C[ue])||void 0===x?void 0:x.closedCaptions),T=A.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),ne(n,T)),null!=o&&o.disableControls?c(n):hn(n,Kn(Kn(Kn({},o),ye),{},{liveVideo:ce,isDvrEnabled:de,res:te,sres:ie})),Nn(n,Kn(Kn(Kn({},o),ye),{},{liveVideo:ce}),i,{res:te,sres:ie});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}};function Jn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Jn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Jn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var zn,Gn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Xn(e);qn(i,{res:l},e,{resolve:t,reject:o})},Xn=function(e){var n,t,o,i,l,r,a,u,s,d,c,v=null==e?void 0:e.streamingInfo,p=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,f=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,m=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,y=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,h=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],b=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,w=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],k=(null==e||null===(d=e.customData)||void 0===d||null===(c=d.ads)||void 0===c?void 0:c.isSSAIEnabled)||!1,I=null==e?void 0:e.token,S=g(I);null==S||S.site;var O=null==S?void 0:S.siteId;return Wn(Wn({id:"".concat(O,"_external")},!f&&{directPlaybackUrl:null==p?void 0:p.url}),{},{video:Wn(Wn({drmEnabled:f,streamingInfo:Wn({videoAssets:Wn(Wn({},b&&{drmProvider:b}),{},{widevine:null==p?void 0:p.widevine,fairPlay:null==p?void 0:p.fairPlay,playReady:null==p?void 0:p.playReady})},(null==v?void 0:v.isDvrEnabled)&&{isLiveStream:!0})},k&&{isSSAIEnabled:k}),{},{metadata:w,liveDetails:{isDvrEnabled:null==v?void 0:v.isDvrEnabled},gist:Wn({},y&&{videoImageUrl:y}),contentDetails:Wn({},(null==h?void 0:h.length)>0&&{closedCaptions:Ae(h)})}),ads:{preRoll:{adTags:{web:Wn(Wn({},m&&{active:!0}),m&&{url:m})}}}})};function Yn(e,n){return Qn.apply(this,arguments)}function Qn(){return(Qn=K(q.mark(function e(n,t){var o,i,l,r,a,u,s,d,c;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,w();case 6:d=e.sent,c=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),y(a,d,c).then(function(e){var t,o,i,c;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,ce(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(c=n.watchHistory)&&void 0!==c&&c.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Pn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",a,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",qn(u,{res:p},n,{resolve:l,reject:r})}else h(a,d).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){qn(u,{res:p},n,{resolve:l,reject:r})});else qn(u,{res:p},n,{resolve:l,reject:r})}).catch(function(e){b(e,u,r,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $n(e,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=K(q.mark(function e(n,t){var o,i,l,r,a,u,s,d;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,e.next=3,w();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,d=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),k(s,a,d).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,qn(u,{res:t},n,{resolve:l,reject:r})}).catch(function(e){b(e,u,r,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function et(e,n){return nt.apply(this,arguments)}function nt(){return(nt=K(q.mark(function e(n,t){var o,i,l,r,a,u,s;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,w();case 3:r=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,ge.set(parseInt(u)),s=null==n||null===(o=n.series)||void 0===o?void 0:o.id,I(s,r).then(function(e){var t,o,u,d=e.data,c=e.data.seasons;ye(c);var v=videoId||(null==c||null===(t=c[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);S(s,r),y(v,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,ce(e.data),qn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:l})}).catch(function(e){b(e,a,l,videoId)})}).catch(function(e){b(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function tt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ot(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tt(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function it(){return{loadVideoInstantly:O,onTimeUpdate:W,getVideoDuration:z,onVideoEnded:G,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=K(q.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,h,w,k,I,S,O,j,T,P,E,C,x;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!D(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(g=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,w=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,k=null==e?void 0:e.videoId,I=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,O=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",O),B().set(null==e?void 0:e.refreshToken),O&&!U(O)){n.next=16;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 16:zn=JSON.parse(atob(O.split(".")[1]));case 17:return window.siteName=null===(r=zn)||void 0===r?void 0:r.site,window.siteId=null===(a=zn)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=zn)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=zn)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=zn)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=zn)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,j=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(v=e.series)&&void 0!==v&&v.enable?null:null==e?void 0:e.chromecastReceiverId,T=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(P=null==e?void 0:e.errors)&&(window.customErrors=P),window.customData=null==e?void 0:e.customData,ue(null==e||null===(f=e.customData)||void 0===f?void 0:f.localisation),M.set(e.apiBaseUrl),null!=e&&e.skin&&!re(e.skin)||(e.skin="VL_ONE"),n.next=35,We(e);case 35:T&&Re("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then(function(){return H(T)}).catch(function(e){}),(E=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(j)))&&E.addEventListener("contextmenu",function(e){return e.preventDefault()}),g?(x={directPlaybackUrl:g,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?y(C,O).then(function(n){var i=(null==n?void 0:n.data)||{};qn(j,{res:ot(ot({},i),x)},e,{resolve:t,reject:o})}).catch(function(e){b(e,j,o,C)}):qn(j,{res:x},e,{resolve:t,reject:o})):S?Gn(e,{resolve:t,reject:o}):I?et(e,{resolve:t,reject:o}):w?$n(e,{resolve:t,reject:o}):Yn(e,{resolve:t,reject:o});case 39:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:j,getPlayer:ae,play:T,pause:P,detectBrowser:e,rewind:E,loadVideo:a,seekToTimeStamp:X,isPlayerInitialised:D,load:C,authenticateLC:x,dispose:A,enableCaptions:te,disableCaptions:ee,getCaptions:Z,playSelectedResolution:ie,getSource:r,setVolume:Ne,getVolume:_e,disableControls:c,setPlaybackSpeed:Y,getEntitlementData:R,adsQueuePointManager:L,getSsaiEvents:N,playerEvents:Q,onReplay:$,isBehindLive:_}}export{it as V,_n as i,Vn as r};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import"./generic-e9c5dc1a.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-1539e2eb.js";import"./util-0d462277.js";import"./captions-78bd2908.js";import"./resolution-62be852a.js";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./player_instance-34118a5b.js";import"axios";import"js-cookie";import"./currentVideoInfo-0b234e55.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./icons-37daa6b3.js";import"./helper-d52dff3c.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
1
+ import"video.js/dist/video-js.min.css";import"./generic-e9c5dc1a.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-54d57353.js";import"./util-0d462277.js";import"./captions-78bd2908.js";import"./resolution-62be852a.js";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./player_instance-34118a5b.js";import"axios";import"js-cookie";import"./currentVideoInfo-0b234e55.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./icons-37daa6b3.js";import"./helper-d52dff3c.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
@@ -1 +1 @@
1
- import{h as l,d as e,e as o,o as i,p as n,q as t,r,s as a}from"./features-0fa9b0fa.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,b as d}from"./index-b0c406e3.js";import{i as v}from"./index-4ca3b369.js";import{S as c,e as m,R as p,U as b,V as h}from"./generic-e9c5dc1a.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-1539e2eb.js";import{c as g}from"./helper-d52dff3c.js";import{c as j,a as w,b as C}from"./currentVideoInfo-0b234e55.js";import k from"video.js";import{c as T,d as B}from"./icons-37daa6b3.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./resolution-62be852a.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-d65c3fbf.js";import"./util-0d462277.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-78bd2908.js";import"@viewlift/comscore/index.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",function(){var l,n,t,r,a,d=g(o),m=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(r=t.appcmsMain)&&void 0!==r&&null!==(a=r.features)&&void 0!==a&&a.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||c()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||v(e),d&&m&&m.length?f(e):y()}),i.one("play",function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)}))}function V(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,s){var v,c,f,y,j,k,L,V,E,M=u(l),q=(null==s?void 0:s.liveVideo)||!1,x=(null==s||null===(v=s.res)||void 0===v?void 0:v.contentType)||"video",_=(null==s||null===(c=s.res)||void 0===c||null===(f=c[x])||void 0===f?void 0:f.isSSAIEnabled)||!1,A=m(null==s?void 0:s.res,l)||{};A.src;var D=(null==s?void 0:s.skin_settings)||{},I=(null==s||null===(y=s.customData)||void 0===y?void 0:y.ads)||{};if(g(s),q&&!(null!=s&&s.liveui)){var R,S,O=(null==M||null===(R=M.controlBar)||void 0===R||null===(S=R.getChild("LiveDisplay"))||void 0===S?void 0:S.el())||null;O&&(O.onclick=function(){try{var l;null==M||null===(l=M.liveTracker)||void 0===l||l.seekToLiveEdge()}catch(l){console.log(l,"Cannot seek to LE")}})}null!=D&&D.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&e(l,"VL_ONE",T());(null!=D&&D.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&o(l,"VL_ONE",B());(null==s||null===(j=s.relatedVideos)||void 0===j||null===(k=j.content)||void 0===k?void 0:k.length)>0&&i(l,null==s?void 0:s.relatedVideos);null!=s&&null!==(L=s.series)&&void 0!==L&&L.enable&&n(l,s);(null==s||null===(V=s.streams)||void 0===V?void 0:V.length)>1&&t(l,null==s?void 0:s.streams);if(d(l,s),p(l,s),"MEDIA_TAILOR"==(null==I?void 0:I.vodAdSticherProvider)&&null!=I&&I.vodAdClientSideTracking&&_)if(q)b(l);else{var P,H=null;if(null!=s&&null!==(P=s.series)&&void 0!==P&&P.enable){var N,U,$,z,G,J=null===(N=w())||void 0===N||null===(U=N.video)||void 0===U||null===($=U.gist)||void 0===$?void 0:$.id,K=C(),Y=(null==K?void 0:K.get(J))||{t:0,p:0},F=Y.t,Q=Y.p;"function"==typeof(null===(z=window)||void 0===z||null===(G=z.watchHistory)||void 0===G?void 0:G.cb)&&window.watchHistory.cb({watchedTime:F}),Q<95&&(H=F)}else{var W=s.watchHistoryResumeTime;s.watchedPercentage<95&&(H=W)}h(l,H)}null!=s&&s.isDvrEnabled&&null!=s&&null!==(E=s.dvrConfig)&&void 0!==E&&E.enable&&(r(l,s),a(l,s))}(l,s),E(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var r=n.controlBar.getChild("VolumePanel"),a=null===(e=r.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==r||null===(o=r.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==r||null===(i=r.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!r||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),m(p(l.touches[0]))}function c(l){l.preventDefault(),m(p(l.changedTouches[0])),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3)}function m(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function p(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}a.addEventListener("touchend",function(){null!=r&&r.el()&&(r.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3))}),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",c,{passive:!1})}(l)}var E=function(l,e){var o,i,n,t,r,a,s,d,v,c,m,p,b=u(l),h=(null==e?void 0:e.theme)||{},f=k.dom.$(".vjs-play-progress"),y=k.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(r=t.cta)||void 0===r||null===(a=r.primary)||void 0===a?void 0:a.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(c=v.brand)||void 0===c||null===(m=c.cta)||void 0===m||null===(p=m.primary)||void 0===p?void 0:p.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{V as initialiseSkin};
1
+ import{h as l,d as e,e as o,o as i,p as n,q as t,r,s as a}from"./features-0fa9b0fa.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,b as d}from"./index-b0c406e3.js";import{i as v}from"./index-4ca3b369.js";import{S as c,e as m,R as p,U as b,V as h}from"./generic-e9c5dc1a.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-54d57353.js";import{c as g}from"./helper-d52dff3c.js";import{c as j,a as w,b as C}from"./currentVideoInfo-0b234e55.js";import k from"video.js";import{c as T,d as B}from"./icons-37daa6b3.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./resolution-62be852a.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-d65c3fbf.js";import"./util-0d462277.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-78bd2908.js";import"@viewlift/comscore/index.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",function(){var l,n,t,r,a,d=g(o),m=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(r=t.appcmsMain)&&void 0!==r&&null!==(a=r.features)&&void 0!==a&&a.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||c()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||v(e),d&&m&&m.length?f(e):y()}),i.one("play",function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)}))}function V(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,s){var v,c,f,y,j,k,L,V,E,M=u(l),q=(null==s?void 0:s.liveVideo)||!1,x=(null==s||null===(v=s.res)||void 0===v?void 0:v.contentType)||"video",_=(null==s||null===(c=s.res)||void 0===c||null===(f=c[x])||void 0===f?void 0:f.isSSAIEnabled)||!1,A=m(null==s?void 0:s.res,l)||{};A.src;var D=(null==s?void 0:s.skin_settings)||{},I=(null==s||null===(y=s.customData)||void 0===y?void 0:y.ads)||{};if(g(s),q&&!(null!=s&&s.liveui)){var R,S,O=(null==M||null===(R=M.controlBar)||void 0===R||null===(S=R.getChild("LiveDisplay"))||void 0===S?void 0:S.el())||null;O&&(O.onclick=function(){try{var l;null==M||null===(l=M.liveTracker)||void 0===l||l.seekToLiveEdge()}catch(l){console.log(l,"Cannot seek to LE")}})}null!=D&&D.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&e(l,"VL_ONE",T());(null!=D&&D.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&o(l,"VL_ONE",B());(null==s||null===(j=s.relatedVideos)||void 0===j||null===(k=j.content)||void 0===k?void 0:k.length)>0&&i(l,null==s?void 0:s.relatedVideos);null!=s&&null!==(L=s.series)&&void 0!==L&&L.enable&&n(l,s);(null==s||null===(V=s.streams)||void 0===V?void 0:V.length)>1&&t(l,null==s?void 0:s.streams);if(d(l,s),p(l,s),"MEDIA_TAILOR"==(null==I?void 0:I.vodAdSticherProvider)&&null!=I&&I.vodAdClientSideTracking&&_)if(q)b(l);else{var P,H=null;if(null!=s&&null!==(P=s.series)&&void 0!==P&&P.enable){var N,U,$,z,G,J=null===(N=w())||void 0===N||null===(U=N.video)||void 0===U||null===($=U.gist)||void 0===$?void 0:$.id,K=C(),Y=(null==K?void 0:K.get(J))||{t:0,p:0},F=Y.t,Q=Y.p;"function"==typeof(null===(z=window)||void 0===z||null===(G=z.watchHistory)||void 0===G?void 0:G.cb)&&window.watchHistory.cb({watchedTime:F}),Q<95&&(H=F)}else{var W=s.watchHistoryResumeTime;s.watchedPercentage<95&&(H=W)}h(l,H)}null!=s&&s.isDvrEnabled&&null!=s&&null!==(E=s.dvrConfig)&&void 0!==E&&E.enable&&(r(l,s),a(l,s))}(l,s),E(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var r=n.controlBar.getChild("VolumePanel"),a=null===(e=r.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==r||null===(o=r.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==r||null===(i=r.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!r||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),m(p(l.touches[0]))}function c(l){l.preventDefault(),m(p(l.changedTouches[0])),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3)}function m(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function p(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}a.addEventListener("touchend",function(){null!=r&&r.el()&&(r.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3))}),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",c,{passive:!1})}(l)}var E=function(l,e){var o,i,n,t,r,a,s,d,v,c,m,p,b=u(l),h=(null==e?void 0:e.theme)||{},f=k.dom.$(".vjs-play-progress"),y=k.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(r=t.cta)||void 0===r||null===(a=r.primary)||void 0===a?void 0:a.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(c=v.brand)||void 0===c||null===(m=c.cta)||void 0===m||null===(p=m.primary)||void 0===p?void 0:p.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{V as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "2.0.200-backup",
3
+ "version": "2.0.202-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "types": "dist/@viewlift/player/esm/index.d.ts",
6
6
  "amdName": "_playerCore",
@@ -1 +0,0 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-6b6ff7a7.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),i=require("video.js"),r=require("./util-ac4cdcec.js"),l=require("./captions-68e263dd.js"),a=require("./resolution-9c4872ec.js"),u=require("./skin-eeec7a85.js"),s=require("./player_instance-fcf6a8fb.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-5802821b.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-dbf2fb22.js"),m=require("@babel/runtime/helpers/toConsumableArray"),g=function(e){return new Promise(function(n,t){if(y(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},h=function(e,n,t){var o=s.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var n=t(o.mark(function n(t){var r,l,a,u,d;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=s.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,g("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(i),(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}},n,null,[[2,7]])}));return function(e){return n.apply(this,arguments)}}(),k=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,r,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}})};var S=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),g("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),I=function(){var n=t(o.mark(function n(){return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),O=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),P=function(){var e=t(o.mark(function e(){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),j=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-96485ab1.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),T=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-d676214f.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),C=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){g("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)})},loadAdsLibrary:S,loadEMELibrary:O,loadMuxPlugin:P,loadDvrSeekbar:j,loadContribDash:T,loadComscorePlugin:I});function E(e){return D.apply(this,arguments)}function D(){return(D=t(o.mark(function n(t){var i,r,l;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null==t?void 0:t.airplay)||!1,n.next=3,S();case 3:i&&"Safari"==e.detectBrowser()?Promise.resolve().then(function(){return C}).then(function(e){e.importAirplay()}):(l=(null===(r=document)||void 0===r?void 0:r.getElementById(null==t?void 0:t.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function x(e){return L.apply(this,arguments)}function L(){return(L=t(o.mark(function e(n){var t,i,r,l,a,u;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=s.getPlayer(n.playerId),e.next=3,I();case 3:u.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function R(e,n){return A.apply(this,arguments)}function A(){return(A=t(o.mark(function n(t,i){var r,l,a,u,s,d,c,v,p,f,m,g;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return v=(null==i?void 0:i.contentType)||"video",p=null==i||null===(r=i[v])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[v])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,f=(null==i||null===(u=i[v])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,m=(null==t||null===(c=t.comscore)||void 0===c?void 0:c.enable)||!1,n.prev=6,n.next=9,Promise.allSettled([p?"Safari"==e.detectBrowser()?O():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?T():O():"Safari"!=e.detectBrowser()&&f?T():null,m?x(t):null,w(t)]);case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(6),console.log("Error",n.t0);case 14:case"end":return n.stop()}},n,null,[[6,11]])}))).apply(this,arguments)}function V(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function N(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?V(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):V(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var B=new Set,_=null,M=function(n,t,o,i){var r,l,a,u,s,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(r=n[f])||void 0===r?void 0:r.id)||"Null",p["c3.cm.contentType"]=J(n),p[null==o||null===(l=o.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=F(n),p["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),p.DRMEnabled=(null===(s=n[f])||void 0===s?void 0:s.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[o.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=W(n),p["c3.cm.genreList"]=q(n),p["c3.cm.genre"]=H(n),p["c3.cm.channel"]=U(n,i);var m=X(c.getCurrentSeries(),n);return p=N(N({},p),m)},H=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},q=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},U=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===o?void 0:o.title)||"NULL"},F=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},W=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},G=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var K,z,X=function(n,t){var o,i,r,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(r=n[s-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Y=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var e=t(o.mark(function e(n,t){var i,r,l,a,u,d,v,p,f,m,g,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==t?void 0:t.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,u=i.enable,d=i.appName,p=(v=t||{}).token,f=v.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(m=s.getPlayer(n),"function"==typeof(g=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(y=e.sent){e.next=13;break}return e.abrupt("return");case 13:m.ready(function(){var e=m.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Y(t.keySystem);g("contentInfo",{DRMEnabled:o})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),m.on("loadstart",function(){var e,n;_&&_!==m.currentSrc()&&g("playbackEnded"),g("setPlayer",m),B.clear(),_=m.currentSrc();var o=Q(m.currentType()),i=c.getCurrentVideo(),r=M(i,m,y,f);r[null==y||null===(e=y.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",r[null==y||null===(n=y.Constants)||void 0===n?void 0:n.ASSET_NAME]=G(i,t),r.authToken=p||"NULL",r.streamType=o,r.D2CType=l||"NONE",r.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",r["c3.cm.affiliate"]=a||"NULL",Z.setData(r),g("contentInfo",r)}),m.on("loadedmetadata",function(){var e,n=m.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),m.on("play",function(){B.has(m.currentSrc())||(B.add(m.currentSrc()),g("playbackStarted",null))}),m.on("ended",function(){B.has(m.currentSrc())&&B.delete(m.currentSrc()),g("playbackEnded")}),m.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:m,adsLoader:null==e?void 0:e.adsLoader})}),m.on("dispose",function(){null==B||B.clear(),g("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Z=(K={},{setData:function(e){K=N(N({},K),e)},getData:function(){return K}}),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-dcec0b88.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-f3fe196e.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-eca48b86.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-e80fa829.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-43f75fd5.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-0d3ac32d.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-a7db5cc3.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-d1fd17f5.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-ef24cd98.js")}).then(function(t){t.initialiseSkin(e,n)})};function ne(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function te(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ne(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var oe=[],ie=0,re=null;function le(){console.log("Cleaning up watch history data"),z=null,oe=[],ie=0,re=null}function ae(t,o,i){var r,l,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var v=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,p=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var m=(null==o||null===(u=o.video)||void 0===u?void 0:u.originalObjectId)||null,g=(null==o||null===(s=o.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,y=Math.floor(t.currentTime()),h=d?100:Math.floor(p/f*100),b={};g?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=ue(i),l=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return te(te({},e),{},n({},t,u[t]))},{}),d=r.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z});d<0?r.push(te(te({content:s},e),{},{addedDate:l,updateDate:l})):r[d]=te(te(te({},r[d]),e),{},{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(b={completed:d,watchedTime:y,watchedPercentage:h},v,o.siteOwner):(b=te(te({videoId:z,watchedTime:y,watchedPercentage:h,doneWatching:d,profileId:v},re&&{seriesId:re}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then(function(e){}).catch(function(e){})),ie=p+i}function ue(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function se(e,n,t){var o=ue(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var de=!1,ce=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!de){var l=ve(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),de=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ve(e,n,t){if(Array.isArray(e))return e.map(function(e){return ve(e,n,t)});if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=ve(e[i],n,t)}),o}return e}function pe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return fe(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?fe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function fe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ge(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?me(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):me(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var ye=function(n,t,o,i){var r,a,u,d,p,f=i.res,m=i.sres,g=s.getPlayer(n),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(r=f[y])||void 0===r?void 0:r.drmEnabled)||!1,w=(null==f||null===(a=f[y])||void 0===a||null===(u=a.streamingInfo)||void 0===u?void 0:u.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),g&&(g.on("loadstart",function(){w?o.resolve({status:!0,msg:"Video Loaded",response:f}):o.resolve(ge({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))}),g.on("loadeddata",function(){var o,i,r,a=l.getCaptions(n);if(null==a||a.map(function(e){return l.disableCaptions(n,e.id)}),k&&"Safari"===e.detectBrowser())try{var u;null==g||null===(u=g.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==g||!g.muted())&&h(n,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t,f),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,m=ge(ge({},t),f);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(re=null==n||null===(i=n.series)||void 0===i?void 0:i.id),oe=[],ie=0,z=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",le),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());oe.includes(ie)||(e!=ie||e<l?e>ie&&(ie=e+l):(oe.push(e),ae(a,n,l)))}}),a.one("ended",function(){ae(a,n,l,!0)}))}(n,m,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=g&&g.mux){var y,b,w,S,I,O,P=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),j=null==P?void 0:P.gist,T={env_key:null==t||null===(b=t.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==P||null===(S=P.series)||void 0===S?void 0:S.title,video_stream_type:null!=P&&null!==(I=P.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==t||null===(O=t.analytics)||void 0===O?void 0:O.userId};g.mux({debug:!1,data:T})}}),g.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];g.trigger("subtitlechanged",n)}),g.on("subtitlechanged",function(e,n){var t,o,i,r,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),g.tech_.on("retryplaylist",function(){w&&ce(f,n)}),g.on("error",function(){var t,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?ce(f,n):(e.handleError(n,(null==g||null===(t=g.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))}),g.one("play",function(){var e,n,o,i,r;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout(function(){g.currentTime(p)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){g.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=g&&g.dvrSeekbar)try{g.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),g.on("volumechange",function(){var e=100*g.volume().toFixed(2);g.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),g.on("chromecastDisconnected",function(){if(w){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}}),g.one("loadeddata",function(){var n,t=(null==g||null===(n=g.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==v(g.dash)){var o,i,r,l=null==g||null===(o=g.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),u=pe(t);try{for(u.s();!(r=u.n()).done;){var s=r.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=pe(t);try{for(c.s();!(d=c.n()).done;){var p,f,m,y=d.value;if(("Chrome"==e.detectBrowser()||"Edge"==e.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))g.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function he(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function be(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function we(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter(function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n}).map(function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}})}function ke(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,u=i.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",function(){f.checkDvrStartOverEnabled(n)?a?f.playFromBeginningHandler(t,n):l?f.playLiveOrResumeHandler(t,r):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,u=a.watchLive;a.resume;var s=a.startFromBegining,d=i;if(r&&null!=r&&r.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),m=document.querySelector(".vjs-dvr-btn-overlay");m||((m=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=f.getCurrentProgramThumbnail(n);g&&(m.style.backgroundImage="url(".concat(g,")"),m.style.backgroundPosition="center center",m.style.backgroundRepeat="no-repeat",m.style.backgroundSize="cover");m.innerHTML=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}(o,v),m.style.display="flex",e.el().appendChild(m),f.pauseAndHideControl(e),Se("watch-live-resume-btn",u,function(){f.showControl(e,m),f.playLiveOrResumeHandler(e,d)}),Se("watch-begining-btn",s,function(){f.showControl(e,m),f.playFromBeginningHandler(e,n)})}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)}),t.one("loadedmetadata",function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",function(){i=!0}),e.on("seeked",function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(s,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})}),e.on("timeupdate",function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(s,t),o=t,function(e,n){we(n).forEach(function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=he(o,i,Math.min(r/n*100,99.5));u.appendChild(s)}})}(e,a))}})}(t,n)})}else console.warn("Player instance is required to initialize start over.")}function Se(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function Ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Oe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ie(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Pe=function(r,a,d,c){var v,p,f,m,g,y,h,b,w,S,I,O,P,j,T,C,E,D,x,L,A,V,N,B,_,M,H,q,U,F,W,G,J,K,z,X,Y,Q=a.res,ne=void 0===Q?null:Q,te=a.sres,oe=void 0===te?null:te,ie=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],re=(null===(v=ne)||void 0===v?void 0:v.contentType)||"video",le=u.impolicy16x9(null===(p=ne)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=ne)||void 0===g||null===(y=g[re])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=ne)||void 0===w||null===(S=w[re])||void 0===S||null===(I=S.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ue=(null===(O=ne)||void 0===O||null===(P=O[re])||void 0===P||null===(j=P.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,se=(null===(T=ne)||void 0===T||null===(C=T.ads)||void 0===C||null===(E=C.preRoll)||void 0===E||null===(D=E.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(L=ne)||void 0===L||null===(A=L.ads)||void 0===A||null===(V=A.preRoll)||void 0===V||null===(N=V.adTags)||void 0===N||null===(B=N.web)||void 0===B?void 0:B.url);ne=Oe(Oe({},ne),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(_=d.customData)||void 0===_?void 0:_.ads)||{},ce=(null===(M=ne)||void 0===M||null===(H=M[re])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==de?void 0:de.vodAdSticherProvider)||!1,ve=(null==d?void 0:d.latency)||6,pe=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var fe=(X={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==pe?void 0:pe.pictureInPictureToggle)||!1},playbackRates:null!=pe&&pe.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:ae},n(X,"autoplay",null==d?void 0:d.autoplay),n(X,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!se),n(X,"loop",(null==d?void 0:d.loop)||!1),n(X,"audioPosterMode",null==d?void 0:d.audioPosterMode),n(X,"html5",Oe(Oe({dash:Oe(Oe(Oe({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(q=d.debugConfig)||void 0===q?void 0:q.enable)&&{debug:!0,logLevel:null!=d&&null!==(U=d.debugConfig)&&void 0!==U&&U.logLevel?null==d||null===(F=d.debugConfig)||void 0===F?void 0:F.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ve},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:Oe(Oe({},(null==d?void 0:d.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==d?void 0:d.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Oe(Oe(Oe({},(null==d?void 0:d.initialBandwidth)&&{bandwidth:d.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(W=d.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(G=null==d?void 0:d.enableLowInitialPlaylist)||void 0===G||G}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(J=d.debugConfig)||void 0===J?void 0:J.enable)||!1,nativeTextTracks:"Safari"==e.detectBrowser()},0==(null==d||null===(K=d.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(z=d.customData)||void 0===z?void 0:z.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(X,"poster",le),n(X,"techOrder",ie),n(X,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(r),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),l=function(e,n,t){var o,i,r,l,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,S;f.isDrmEnabled=!0;var I=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var P=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=P}var j=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=j;var T=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=T;var C=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=C;var E=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ne,e,i);return Oe(Oe({},l),{},{convivaMetaData:Oe({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},Z.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,l,a=s.getPlayer(r),u=(null==a?void 0:a.currentSource())||{};!(null===(n=ne)||void 0===n||null===(t=n[re])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),X);if(!i.getPlayers()[r]){null!=d&&d.debugConfig&&null!=d&&null!==(Y=d.debugConfig)&&void 0!==Y&&Y.enable&&i.log.level("debug");var me=i(r,fe,function(){var n=t(o.mark(function n(){var t,a,u,s,v,p,f,m,g,y,h,b,w,S,I,O,P,j,T,C,E;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,R(d,ne);case 5:if(w=null===(t=ne)||void 0===t||null===(a=t[re])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(Oe({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:ne}:{response:ne})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&ke(r,Oe(Oe({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(r,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),$(r,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),ae&&k(r,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,se,ne),S=e.getSource(ne,r),console.log(S),null!=d&&d.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(r,ne);case 20:S=n.sent;case 21:S?e.loadVideo(r,S):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:ne}),e.handleError(r,"Incompatible / Missing Source")),((null===(p=ne)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=ne)||void 0===y||null===(h=y[re])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(E=(null===(O=ne)||void 0===O||null===(P=O[re])||void 0===P||null===(j=P.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(T=ne)||void 0===T||null===(C=T[re])||void 0===C?void 0:C.closedCaptions),I=E.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),l.addCaptions(r,I)),null!=d&&d.disableControls?e.disableControls(r):ee(r,Oe(Oe(Oe({},d),fe),{},{liveVideo:ue,isDvrEnabled:ae,res:ne,sres:oe})),ye(r,Oe(Oe(Oe({},d),fe),{},{liveVideo:ue}),c,{res:ne,sres:oe});case 25:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function je(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Te(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?je(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):je(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Ce,Ee=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=De(e);Pe(i,{res:r},e,{resolve:t,reject:o})},De=function(n){var t,o,i,r,l,a,u,s,d,c,v,p=null==n?void 0:n.streamingInfo,f=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,g=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,y=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.url)||null,h=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,b=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],w=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,k=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],S=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,I=null==n?void 0:n.token,O=e.getDecodedToken(I);null==O||O.site;var P=null==O?void 0:O.siteId;return Te(Te({id:"".concat(P,"_external")},!g&&{directPlaybackUrl:null==f?void 0:f.url}),{},{video:Te(Te({drmEnabled:g,streamingInfo:Te({videoAssets:Te(Te({},w&&{drmProvider:w}),{},{widevine:null==f?void 0:f.widevine,fairPlay:null==f?void 0:f.fairPlay,playReady:null==f?void 0:f.playReady})},(null==p?void 0:p.isDvrEnabled)&&{isLiveStream:!0})},S&&{isSSAIEnabled:S}),{},{metadata:k,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:Te({},h&&{videoImageUrl:h}),contentDetails:Te({},(null==b?void 0:b.length)>0&&{closedCaptions:m(b)})}),ads:{preRoll:{adTags:{web:Te(Te({},y&&{active:!0}),y&&{url:y})}}}})};function xe(e,n){return Le.apply(this,arguments)}function Le(){return(Le=t(o.mark(function n(t,i){var r,l,a,u,s,d,v,p,f;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:p=n.sent,f=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,p,f).then(function(n){var o,i,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(null==n?void 0:n.data);var f,m=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.enable&&!v)if((null===(f=t.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var g,y,h,b=se((null===(g=t.watchHistory)||void 0===g?void 0:g.profileId)||"",s,null==t?void 0:t.siteOwner);if(b&&b.length)t.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;m.contentType="video",Pe(d,{res:m},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then(function(e){var n,o,i,r,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,m.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Pe(d,{res:m},t,{resolve:a,reject:u})});else Pe(d,{res:m},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Re(e,n){return Ae.apply(this,arguments)}function Ae(){return(Ae=t(o.mark(function n(t,i){var r,l,a,u,s,d,c,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Pe(d,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ve(e,n){return Ne.apply(this,arguments)}function Ne(){return(Ne=t(o.mark(function n(t,i){var r,l,a,u,s,d,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==t||null===(r=t.series)||void 0===r?void 0:r.id,e.getSeriesDetails(v,u).then(function(n){var o,i,r,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(o=p[0])||void 0===o||null===(i=o.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(f,u).then(function(e){var n,o,i;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Pe(s,{res:null==e?void 0:e.data,sres:d},t,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function _e(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Be(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:r.onTimeUpdate,getVideoDuration:r.getVideoDuration,onVideoEnded:r.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(o.mark(function t(i,r){var l,a,s,c,v,p,f,m,y,h,b,w,k,S,I,O,P,j,T,C,D,x,L,R,A;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(k=(null==n?void 0:n.videoSourceUrl)||!1,S=null==n?void 0:n.asat,I=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,j=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,T=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",T),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),T&&!e.isTokenExpired(T)){t.next=16;break}return r({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),t.abrupt("return");case 16:Ce=JSON.parse(atob(T.split(".")[1]));case 17:return window.siteName=null===(s=Ce)||void 0===s?void 0:s.site,window.siteId=null===(c=Ce)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Ce)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Ce)||void 0===p?void 0:p.site)||null,n.userId=(null===(f=Ce)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=Ce)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,C=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(y=n.series)&&void 0!==y&&y.enable?null:null==n?void 0:n.chromecastReceiverId,D=(null==n||null===(h=n.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==n?void 0:n.errors)&&(window.customErrors=x),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=35,E(n);case 35:D&&g("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then(function(){return e.runGtag(D)}).catch(function(e){}),(L=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(C)))&&L.addEventListener("contextmenu",function(e){return e.preventDefault()}),k?(A={directPlaybackUrl:k,id:R="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?e.getVideoDetails(R,T).then(function(e){var t=(null==e?void 0:e.data)||{};Pe(C,{res:_e(_e({},t),A)},n,{resolve:i,reject:r})}).catch(function(n){e.initiateErrorHandling(n,C,r,R)}):Pe(C,{res:A},n,{resolve:i,reject:r})):j?Ee(n,{resolve:i,reject:r}):P?Ve(n,{resolve:i,reject:r}):I?Re(n,{resolve:i,reject:r}):xe(n,{resolve:i,reject:r});case 39:case"end":return t.stop()}},t)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:r.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:e.getSource,setVolume:h,getVolume:b,disableControls:e.disableControls,setPlaybackSpeed:r.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:r.playerEvents,onReplay:r.onReplay,isBehindLive:e.isBehindLive}},exports.initiateMarker=function(e){var n=s.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),r=t.end(t.length-1)-i;be(),we(r).forEach(function(e){var n=e.id,t=e.title,i=e.time,l=he(n,t,Math.min(i/r*100,99.5));o.appendChild(l)})}},exports.removeMarkers=be;
@@ -1 +0,0 @@
1
- import"video.js/dist/video-js.min.css";import{d as e,c as n,g as t,a as o,b as i,s as l,e as r,l as a,i as s,f as u,h as d,j as c,k as v,m as p,n as f,o as m,p as g,q as y,r as h,t as b,u as w,v as k,w as I,x as S,y as O,z as j,A as T,B as P,C as E,D,E as C,F as x,G as A,H as R,I as L,J as N,K as _,L as M,M as V,N as B,O as U,P as H}from"./generic-e9c5dc1a.js";import F from"@babel/runtime/helpers/defineProperty";import q from"@babel/runtime/helpers/asyncToGenerator";import J from"@babel/runtime/regenerator";import K from"video.js";import{o as W,g as z,a as G,s as X,b as Y,p as Q,c as $}from"./util-0d462277.js";import{g as Z,d as ee,a as ne,e as te}from"./captions-78bd2908.js";import{g as oe,p as ie}from"./resolution-62be852a.js";import{i as le,a as re}from"./skin-65765793.js";import{g as ae}from"./player_instance-34118a5b.js";import{s as se}from"./localisation-0bf399a1.js";import{g as ue,a as de,s as ce,v as ve,b as pe,c as fe,d as me,e as ge,f as ye}from"./currentVideoInfo-0b234e55.js";import he from"@babel/runtime/helpers/typeof";import{s as be,w as we}from"./icons-37daa6b3.js";import{c as ke,p as Ie,a as Se,h as Oe,r as je,g as Te,b as Pe,d as Ee,s as De,e as Ce,f as xe}from"./helper-d52dff3c.js";import Ae from"@babel/runtime/helpers/toConsumableArray";var Re=function(e){return new Promise(function(n,t){if(Le(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},Le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ne=function(e,n,t){var o=ae(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},_e=function(e){var n=ae(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Me=function(){var n=q(J.mark(function n(t){var o,i,l,r,a;return J.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=ae(null==t?void 0:t.playerId),null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,Re("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(K),(a=K.getTech("chromecast"))&&!a.prototype.seeking&&(a.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}},n,null,[[2,7]])}));return function(e){return n.apply(this,arguments)}}(),Ve=function(e,n){var t=ae(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),s=K.dom.getPointerPosition(a,n).x;K.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}})};var Be=function(){var e=q(J.mark(function e(){return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Re("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=q(J.mark(function e(){return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then(function(e){n.set(e)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),He=function(){var e=q(J.mark(function e(){return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){K.getPlugin("eme")||K.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Fe=function(){var e=q(J.mark(function e(){var n;return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(K),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=q(J.mark(function e(){return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-6ecf4a3a.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),Je=function(){var e=q(J.mark(function e(){return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-fc3c1bcf.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),Ke=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(K)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(K)})},loadAdsLibrary:Be,loadEMELibrary:He,loadMuxPlugin:Fe,loadDvrSeekbar:qe,loadContribDash:Je,loadComscorePlugin:Ue});function We(e){return ze.apply(this,arguments)}function ze(){return(ze=q(J.mark(function n(t){var o,i,l;return J.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=(null==t?void 0:t.airplay)||!1,n.next=3,Be();case 3:o&&"Safari"==e()?Promise.resolve().then(function(){return Ke}).then(function(e){e.importAirplay()}):(l=(null===(i=document)||void 0===i?void 0:i.getElementById(null==t?void 0:t.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ge(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=q(J.mark(function e(n){var t,o,i,l,r,a;return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=ae(n.playerId),e.next=3,Ue();case 3:a.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.endpoint,implementationId:null==n||null===(i=n.comscore)||void 0===i?void 0:i.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(r=n.comscore)||void 0===r?void 0:r.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ye(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=q(J.mark(function n(t,o){var i,l,r,a,s,u,d,c,v,p,f,m;return J.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return c=(null==o?void 0:o.contentType)||"video",v=null==o||null===(i=o[c])||void 0===i?void 0:i.drmEnabled,null==o||null===(l=o[c])||void 0===l||null===(r=l.liveDetails)||void 0===r||r.isDvrEnabled,null==t||t.showPositiveSeekbar,p=(null==o||null===(a=o[c])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.dash)||null,f=(null==t||null===(d=t.comscore)||void 0===d?void 0:d.enable)||!1,n.prev=6,n.next=9,Promise.allSettled([v?"Safari"==e()?He():"caliente"!=(null===(m=window)||void 0===m?void 0:m.siteName)?Je():He():"Safari"!=e()&&p?Je():null,f?Ge(t):null,Me(t)]);case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(6),console.log("Error",n.t0);case 14:case"end":return n.stop()}},n,null,[[6,11]])}))).apply(this,arguments)}function $e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var en=new Set,nn=null,tn=function(e,n,o,i){var l,r,a,s,u,d,c,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(l=e[p])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=dn(e),v[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),v[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==o||null===(s=o.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===t()?"NULL":t(),v["c3.cm.categoryType"]=an(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[o.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=sn(e),v["c3.cm.genreList"]=ln(e),v["c3.cm.genre"]=on(e),v["c3.cm.channel"]=rn(e,i);var f=pn(ue(),e);return v=Ze(Ze({},v),f)},on=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},ln=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},rn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===o?void 0:o.title)||"NULL"},an=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},sn=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},un=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},dn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var cn,vn,pn=function(e,n){var t,l,r,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var d=i(),c=o();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(l=t.series)||void 0===l?void 0:l.title)||"Null",u["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(r=e[d-1])||void 0===r||null===(a=r.episodes)||void 0===a||null===(s=a[c-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},fn=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},mn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},gn=function(){var e=q(J.mark(function e(n,t){var o,i,l,r,a,s,u,d,c,v,p,f;return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},i=o.trackConvivaPlayerEvent,l=o.paymentHandler,r=o.tveProvider,a=o.enable,s=o.appName,d=(u=t||{}).token,c=u.epg,a){e.next=4;break}return e.abrupt("return");case 4:if(v=ae(n),"function"==typeof(p=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,p("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:v.ready(function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=fn(t.keySystem);p("contentInfo",{DRMEnabled:o})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),v.on("loadstart",function(){var e,n;nn&&nn!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),en.clear(),nn=v.currentSrc();var o=mn(v.currentType()),i=de(),a=tn(i,v,f,c);a[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",a[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=un(i,t),a.authToken=d||"NULL",a.streamType=o,a.D2CType=l||"NONE",a.subscriberType=r?"MVPD":"FREE"!==l?"D2C":"FREE",a["c3.cm.affiliate"]=r||"NULL",yn.setData(a),p("contentInfo",a)}),v.on("loadedmetadata",function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),v.on("play",function(){en.has(v.currentSrc())||(en.add(v.currentSrc()),p("playbackStarted",null))}),v.on("ended",function(){en.has(v.currentSrc())&&en.delete(v.currentSrc()),p("playbackEnded")}),v.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})}),v.on("dispose",function(){null==en||en.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),yn=(cn={},{setData:function(e){cn=Ze(Ze({},cn),e)},getData:function(){return cn}}),hn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-c39cc7a4.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-06d132a7.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-d235a2ec.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-e79cdff2.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-e4e26727.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-aa258d30.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-026e23a0.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-9bc879d8.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&import("./skin-02ed9ac3.js").then(function(t){t.initialiseSkin(e,n)})};function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var kn=[],In=0,Sn=null;function On(){console.log("Cleaning up watch history data"),vn=null,kn=[],In=0,Sn=null}function jn(e,n,t){var o,i,r,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(c/v*100),y={};f?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=Tn(o),l=(new Date).getTime(),r=de(),a=(null==r?void 0:r.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return wn(wn({},e),{},F({},n,a[n]))},{}),u=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===vn});u<0?i.push(wn(wn({content:s},e),{},{addedDate:l,updateDate:l})):i[u]=wn(wn(wn({},i[u]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(y={completed:u,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=wn(wn({videoId:vn,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:d},Sn&&{seriesId:Sn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),In=c+t}function Tn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pn(e,n,t){var o=Tn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var En=!1,Dn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!En){var l=Cn(e,"videoAssets","secondaryVideoAssets"),s=r(l,n);return s&&a(n,s),En=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Cn(e,n,t){if(Array.isArray(e))return e.map(function(e){return Cn(e,n,t)});if(null!==e&&"object"===he(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Cn(e[i],n,t)}),o}return e}function xn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return An(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?An(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function An(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ln(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Rn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Rn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Nn=function(n,t,o,i){var l,r,a,c,v,p=i.res,f=i.sres,m=ae(n),g=(null==p?void 0:p.contentType)||"video",y=(null==p||null===(l=p[g])||void 0===l?void 0:l.drmEnabled)||!1,h=(null==p||null===(r=p[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==p||null===(c=p[g])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;ce(p),ve.set(p),m&&(m.on("loadstart",function(){h?o.resolve({status:!0,msg:"Video Loaded",response:p}):o.resolve(Ln({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))}),m.on("loadeddata",function(){var o,i,l,r=Z(n);if(null==r||r.map(function(e){return ee(n,e.id)}),b&&"Safari"===e())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&Ne(n,sessionStorage.getItem("volume")||"100");var d=de();if(s(t,p),u(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var c,v,f=Ln(Ln({},t),p);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Sn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),kn=[],In=0,vn=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=ae(e);a&&(a.on("dispose",On),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());kn.includes(In)||(e!=In||e<r?e>In&&(In=e+r):(kn.push(e),jn(a,n,r)))}}),a.one("ended",function(){jn(a,n,r,!0)}))}(n,f,null==d||null===(c=d.video)||void 0===c||null===(v=c.gist)||void 0===v?void 0:v.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var g,y,h,w,k,I,S=(null===(g=de())||void 0===g?void 0:g.video)||(null==p?void 0:p.video),O=null==S?void 0:S.gist,j={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==S||null===(w=S.series)||void 0===w?void 0:w.title,video_stream_type:null!=S&&null!==(k=S.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==t||null===(I=t.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}}),m.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){h&&Dn(p,n)}),m.on("error",function(){var e,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?Dn(p,n):(d(n,(null==m||null===(e=m.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured",response:p}))}),m.one("play",function(){var e,n,o,i,l;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var r,a,s,u=null===(r=de())||void 0===r||null===(a=r.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,d=pe(),c=(null==d?void 0:d.get(u))||{t:0,p:0},v=c.t,p=c.p;v&&p<95&&setTimeout(function(){m.currentTime(v)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(h){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var n,t=(null==m||null===(n=m.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==he(m.dash)){var o,i,l,r=null==m||null===(o=m.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==r?void 0:r.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),s=xn(t);try{for(s.s();!(l=s.n()).done;){var u=l.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var d,c=xn(t);try{for(c.s();!(d=c.n()).done;){var v,p,f,g=d.value;if(("Chrome"==e()||"Edge"==e()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!y))&&null!=g&&null!==(f=g.label)&&void 0!==f&&f.includes("5.1"))m.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function _n(e){var n=ae(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;Vn(),Bn(l).forEach(function(e){var n=e.id,t=e.title,i=e.time,r=Mn(n,t,Math.min(i/l*100,99.5));o.appendChild(r)})}}function Mn(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Vn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function Bn(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(fe()||[]).filter(function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n}).map(function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}})}function Un(e,n){var t=ae(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var r=i.playLive,a=i.playFromBegining,s=i.programs;me(s),t.on("loadeddata",function(){ke(n)?a?Ie(t,n):r?Se(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,l=n.epg,r=o.buttonConfig,a=void 0===r?{}:r,s=a.watchLive;a.resume;var u=a.startFromBegining,d=i;if(l&&null!=l&&l.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!Te(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Pe(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,l=t.startFromBegining,r=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(we()," ").concat(r,"</button>"),s='<button id="watch-begining-btn">'.concat(be()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}(o,v),p.style.display="flex",e.el().appendChild(p),Ee(e),Hn("watch-live-resume-btn",s,function(){xe(e,p),Se(e,d)}),Hn("watch-begining-btn",u,function(){xe(e,p),Ie(e,n)})}(t,n),Oe({player:t,showWatchLive:!0,showStartOver:!0})):je(t)}),t.one("loadedmetadata",function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,d=!0;if(s&&null!=s&&s.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",function(){i=!0}),e.on("seeked",function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}De(u,o),Ce(e,n),Oe({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})}),e.on("timeupdate",function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(De(u,t),o=t,function(e,n){Bn(n).forEach(function(t){var o=t.id,i=t.title,l=t.time,r=document.getElementById(o);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=Mn(o,i,Math.min(l/n*100,99.5));s.appendChild(u)}})}(e,a))}})}(t,n)})}else console.warn("Player instance is required to initialize start over.")}function Hn(e,n,t){var o,i,l=document.getElementById(e);l&&(i=n,(o=l)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),l.addEventListener("click",t))}function Fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function qn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Jn=function(n,t,o,i){var l,s,u,g,y,h,b,w,k,I,S,O,j,T,P,E,D,C,x,A,R,L,N,_,M,V,B,U,H,W,z,G,X,Y,Q,$,Z,ee=t.res,te=void 0===ee?null:ee,oe=t.sres,ie=void 0===oe?null:oe,re=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],se=(null===(l=te)||void 0===l?void 0:l.contentType)||"video",ue=le(null===(s=te)||void 0===s||null===(u=s[se])||void 0===u||null===(g=u.gist)||void 0===g?void 0:g.videoImageUrl)||le(null===(y=te)||void 0===y||null===(h=y[se])||void 0===h||null===(b=h.gist)||void 0===b||null===(w=b.imageGist)||void 0===w?void 0:w.r16x9),de=(null===(k=te)||void 0===k||null===(I=k[se])||void 0===I||null===(S=I.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ce=(null===(O=te)||void 0===O||null===(j=O[se])||void 0===j||null===(T=j.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,ve=(null===(P=te)||void 0===P||null===(E=P.ads)||void 0===E||null===(D=E.preRoll)||void 0===D||null===(C=D.adTags)||void 0===C||null===(x=C.web)||void 0===x?void 0:x.active)&&(null===(A=te)||void 0===A||null===(R=A.ads)||void 0===R||null===(L=R.preRoll)||void 0===L||null===(N=L.adTags)||void 0===N||null===(_=N.web)||void 0===_?void 0:_.url);te=qn(qn({},te),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var pe=(null==o||null===(M=o.customData)||void 0===M?void 0:M.ads)||{},fe=(null===(V=te)||void 0===V||null===(B=V[se])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==pe?void 0:pe.vodAdSticherProvider)||!1,me=(null==o?void 0:o.latency)||6,ge=(null==o?void 0:o.skin_settings)||{};null==o||o.dvrConfig;var ye=($={enableSmoothSeeking:!0,controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==o.skin,liveui:de},F($,"autoplay",null==o?void 0:o.autoplay),F($,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!ve),F($,"loop",(null==o?void 0:o.loop)||!1),F($,"audioPosterMode",null==o?void 0:o.audioPosterMode),F($,"html5",qn(qn({dash:qn(qn(qn({},!K.browser.IS_SAFARI&&{useTTML:!0}),(null==o?void 0:o.debugConfig)&&(null==o||null===(U=o.debugConfig)||void 0===U?void 0:U.enable)&&{debug:!0,logLevel:null!=o&&null!==(H=o.debugConfig)&&void 0!==H&&H.logLevel?null==o||null===(W=o.debugConfig)||void 0===W?void 0:W.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:qn(qn({},(null==o?void 0:o.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==o?void 0:o.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:qn(qn(qn({},(null==o?void 0:o.initialBandwidth)&&{bandwidth:o.initialBandwidth}),{},{liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==o||null===(z=o.customData)||void 0===z?void 0:z.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(G=null==o?void 0:o.enableLowInitialPlaylist)||void 0===G||G}),debug:(null==o?void 0:o.debugConfig)&&(null==o||null===(X=o.debugConfig)||void 0===X?void 0:X.enable)||!1,nativeTextTracks:"Safari"==e()},0==(null==o||null===(Y=o.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),F($,"poster",ue),F($,"techOrder",re),F($,"chromecast",{requestCustomDataFn:function(e){var t,i,l=ae(n),r=((null==l?void 0:l.textTracksJson_)||l.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,i,l,r,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,I;f.isDrmEnabled=!0;var S=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==S?void 0:S.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var j=(null==S?void 0:S.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=j}var T=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=T;var P=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=P;var E=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=E;var D=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=D,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(te,e,r);return qn(qn({},a),{},{convivaMetaData:qn({customerKey:(null==o||null===(t=o.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==o||null===(i=o.convivaConfig)||void 0===i?void 0:i.debug)||!1},yn.getData())})},modifyLoadRequestFn:function(e){var t,o,i,l,r,a=ae(n),s=(null==a?void 0:a.currentSource())||{};!(null===(t=te)||void 0===t||null===(o=t[se])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(r=s.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!K.getPlayers()[n]){null!=o&&o.debugConfig&&null!=o&&null!==(Z=o.debugConfig)&&void 0!==Z&&Z.enable&&K.log.level("debug");var he=K(n,ye,function(){var e=q(J.mark(function e(){var t,l,s,u,g,y,h,b,w,k,I,S,O,j,T,P,E,D,C,x,A;return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(he),console.log(K.VERSION),console.log(K.getPlugins()),e.next=5,Ye(o,te);case 5:if(O=null===(t=te)||void 0===t||null===(l=t[se])||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,ce&&i.resolve(qn({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:te}:{response:te})),de&&null!=o&&null!==(u=o.dvrConfig)&&void 0!==u&&u.enable&&Un(n,qn(qn({},o),{},{isDvrEnabled:de})),v(n,null==o?void 0:o.analyticsCb,null==o?void 0:o.customData),gn(n,o),/Android/i.test(navigator.userAgent)&&(K.options.vhs.overrideNative=!0),de&&Ve(n,O),!ve||null!=o&&null!==(g=o.customData)&&void 0!==g&&g.disableAds||p(n,ve,te),j=r(te,n),console.log(j),null!=o&&o.nearestClusterUrl&&(j=f(j,o.nearestClusterUrl)),!fe){e.next=21;break}return e.next=20,m(n,te);case 20:j=e.sent;case 21:j?a(n,j):(i.reject({status:!1,msg:"Incompatible / Missing Source",response:te}),d(n,"Incompatible / Missing Source")),((null===(y=te)||void 0===y||null===(h=y[se])||void 0===h||null===(b=h.contentDetails)||void 0===b||null===(w=b.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(k=te)||void 0===k||null===(I=k[se])||void 0===I||null===(S=I.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(P=te)||void 0===P||null===(E=P[se])||void 0===E||null===(D=E.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=te)||void 0===C||null===(x=C[se])||void 0===x?void 0:x.closedCaptions),T=A.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),ne(n,T)),null!=o&&o.disableControls?c(n):hn(n,qn(qn(qn({},o),ye),{},{liveVideo:ce,isDvrEnabled:de,res:te,sres:ie})),Nn(n,qn(qn(qn({},o),ye),{},{liveVideo:ce}),i,{res:te,sres:ie});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}};function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var zn,Gn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Xn(e);Jn(i,{res:l},e,{resolve:t,reject:o})},Xn=function(e){var n,t,o,i,l,r,a,s,u,d,c,v=null==e?void 0:e.streamingInfo,p=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,f=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,m=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,y=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,h=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],b=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,w=(null==e||null===(u=e.streamingInfo)||void 0===u?void 0:u.macroMap)||[],k=(null==e||null===(d=e.customData)||void 0===d||null===(c=d.ads)||void 0===c?void 0:c.isSSAIEnabled)||!1,I=null==e?void 0:e.token,S=g(I);null==S||S.site;var O=null==S?void 0:S.siteId;return Wn(Wn({id:"".concat(O,"_external")},!f&&{directPlaybackUrl:null==p?void 0:p.url}),{},{video:Wn(Wn({drmEnabled:f,streamingInfo:Wn({videoAssets:Wn(Wn({},b&&{drmProvider:b}),{},{widevine:null==p?void 0:p.widevine,fairPlay:null==p?void 0:p.fairPlay,playReady:null==p?void 0:p.playReady})},(null==v?void 0:v.isDvrEnabled)&&{isLiveStream:!0})},k&&{isSSAIEnabled:k}),{},{metadata:w,liveDetails:{isDvrEnabled:null==v?void 0:v.isDvrEnabled},gist:Wn({},y&&{videoImageUrl:y}),contentDetails:Wn({},(null==h?void 0:h.length)>0&&{closedCaptions:Ae(h)})}),ads:{preRoll:{adTags:{web:Wn(Wn({},m&&{active:!0}),m&&{url:m})}}}})};function Yn(e,n){return Qn.apply(this,arguments)}function Qn(){return(Qn=q(J.mark(function e(n,t){var o,i,l,r,a,s,u,d,c;return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,a=null==n?void 0:n.videoId,s=null==n?void 0:n.playerId,u=!(null==n||!n.anonymousId),e.next=6,w();case 6:d=e.sent,c=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),y(a,d,c).then(function(e){var t,o,i,c;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,ce(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(c=n.watchHistory)&&void 0!==c&&c.enable&&!u)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Pn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",a,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Jn(s,{res:p},n,{resolve:l,reject:r})}else h(a,d).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Jn(s,{res:p},n,{resolve:l,reject:r})});else Jn(s,{res:p},n,{resolve:l,reject:r})}).catch(function(e){b(e,s,r,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $n(e,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=q(J.mark(function e(n,t){var o,i,l,r,a,s,u,d;return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,e.next=3,w();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=null==n?void 0:n.epg,d=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),k(u,a,d).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==u?void 0:u.channelId,Jn(s,{res:t},n,{resolve:l,reject:r})}).catch(function(e){b(e,s,r,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function et(e,n){return nt.apply(this,arguments)}function nt(){return(nt=q(J.mark(function e(n,t){var o,i,l,r,a,s,u;return J.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,w();case 3:r=e.sent,a=null==n?void 0:n.playerId,s=sessionStorage.getItem("season-idx")||0,ge.set(parseInt(s)),u=null==n||null===(o=n.series)||void 0===o?void 0:o.id,I(u,r).then(function(e){var t,o,s,d=e.data,c=e.data.seasons;ye(c);var v=videoId||(null==c||null===(t=c[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(s=o[0])||void 0===s?void 0:s.id);S(u,r),y(v,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,ce(e.data),Jn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:l})}).catch(function(e){b(e,a,l,videoId)})}).catch(function(e){b(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function tt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ot(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tt(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function it(){return{loadVideoInstantly:O,onTimeUpdate:W,getVideoDuration:z,onVideoEnded:G,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=q(J.mark(function n(t,o){var i,l,r,a,s,u,d,c,v,p,f,m,g,h,w,k,I,S,O,j,T,P,E,C,x;return J.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!D(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(g=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,w=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,k=null==e?void 0:e.videoId,I=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,O=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",O),B().set(null==e?void 0:e.refreshToken),O&&!U(O)){n.next=16;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 16:zn=JSON.parse(atob(O.split(".")[1]));case 17:return window.siteName=null===(r=zn)||void 0===r?void 0:r.site,window.siteId=null===(a=zn)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(s=zn)||void 0===s||!s.anonymousId),e.siteOwner=(null===(u=zn)||void 0===u?void 0:u.site)||null,e.userId=(null===(d=zn)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=zn)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,j=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(v=e.series)&&void 0!==v&&v.enable?null:null==e?void 0:e.chromecastReceiverId,T=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(P=null==e?void 0:e.errors)&&(window.customErrors=P),window.customData=null==e?void 0:e.customData,se(null==e||null===(f=e.customData)||void 0===f?void 0:f.localisation),M.set(e.apiBaseUrl),null!=e&&e.skin&&!re(e.skin)||(e.skin="VL_ONE"),n.next=35,We(e);case 35:T&&Re("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then(function(){return H(T)}).catch(function(e){}),(E=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(j)))&&E.addEventListener("contextmenu",function(e){return e.preventDefault()}),g?(x={directPlaybackUrl:g,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?y(C,O).then(function(n){var i=(null==n?void 0:n.data)||{};Jn(j,{res:ot(ot({},i),x)},e,{resolve:t,reject:o})}).catch(function(e){b(e,j,o,C)}):Jn(j,{res:x},e,{resolve:t,reject:o})):S?Gn(e,{resolve:t,reject:o}):I?et(e,{resolve:t,reject:o}):w?$n(e,{resolve:t,reject:o}):Yn(e,{resolve:t,reject:o});case 39:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:j,getPlayer:ae,play:T,pause:P,detectBrowser:e,rewind:E,loadVideo:a,seekToTimeStamp:X,isPlayerInitialised:D,load:C,authenticateLC:x,dispose:A,enableCaptions:te,disableCaptions:ee,getCaptions:Z,playSelectedResolution:ie,getSource:r,setVolume:Ne,getVolume:_e,disableControls:c,setPlaybackSpeed:Y,getEntitlementData:R,adsQueuePointManager:L,getSsaiEvents:N,playerEvents:Q,onReplay:$,isBehindLive:_}}export{it as V,_n as i,Vn as r};