@viewlift/player-backup 2.0.118-backup → 2.0.120-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.
- package/cjs/{autoNextVideo-5fd08f6b.js → autoNextVideo-30f8c89c.js} +1 -1
- package/cjs/bundle.css +33 -33
- package/cjs/{features-dfab79d7.js → features-e3fdf1e7.js} +1 -1
- package/cjs/{generic-090f20e4.js → generic-bfd81e0e.js} +1 -1
- package/cjs/index-08d3c4b6.js +1 -0
- package/cjs/{index-a2c88360.js → index-a5c150cc.js} +1 -1
- package/cjs/index-de801167.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-f64e8e6e.js → multicamv2-6f471fb0.js} +1 -1
- package/cjs/{multicamv2-9b16e7b4.js → multicamv2-83af7dc3.js} +1 -1
- package/cjs/{nextEpisodeButton-174ce343.js → nextEpisodeButton-f7d4f8e9.js} +1 -1
- package/cjs/playlist-a6555cdd.js +1 -0
- package/cjs/{series-d787a3c5.js → series-72eca3c2.js} +1 -1
- package/cjs/series-v2-4d51cc69.js +1 -0
- package/cjs/series-v2-add2a53f.js +1 -0
- package/cjs/{skin-6da45dd8.js → skin-19f5ee87.js} +1 -1
- package/cjs/{skin-00cff21e.js → skin-4849e82b.js} +1 -1
- package/cjs/{skin-fb780f09.js → skin-5b2feda8.js} +1 -1
- package/cjs/{skin-4cf0f454.js → skin-e6d5161d.js} +1 -1
- package/cjs/{skin-17344da4.js → skin-f14e4493.js} +1 -1
- package/cjs/skin-f5457a27.js +1 -0
- package/cjs/{start-begin-btn-b8828163.js → start-begin-btn-d17055ca.js} +1 -1
- package/cjs/util-a3ed1133.js +1 -0
- package/cjs/videoSelector-7599aaf6.js +1 -0
- package/cjs/videoSelector-8834cfd9.js +1 -0
- package/cjs/{videojs-dash5.es-0c89add5.js → videojs-dash5.es-ced4b564.js} +1 -1
- package/esm/{autoNextVideo-cfe8aa87.js → autoNextVideo-068e496c.js} +1 -1
- package/esm/bundle.css +33 -33
- package/esm/core/util.d.ts +1 -0
- package/esm/{features-15befb53.js → features-96af00c0.js} +1 -1
- package/esm/{generic-63e4557c.js → generic-dd89c778.js} +1 -1
- package/esm/{index-6884c042.js → index-710a5238.js} +1 -1
- package/esm/{index-0e07d7c1.js → index-8bf8b43f.js} +1 -1
- package/esm/index-a012aae4.js +1 -0
- package/esm/index.js +1 -1
- package/esm/{multicamv2-879ad44b.js → multicamv2-7fe85e6a.js} +1 -1
- package/esm/{multicamv2-c67371c1.js → multicamv2-8e508c51.js} +1 -1
- package/esm/{nextEpisodeButton-68eb0785.js → nextEpisodeButton-591509b7.js} +1 -1
- package/esm/playlist-4c796e1f.js +1 -0
- package/esm/{series-016bb1c9.js → series-d46535b8.js} +1 -1
- package/esm/series-v2-730cd221.js +1 -0
- package/esm/series-v2-cb05c6df.js +1 -0
- package/esm/{skin-c169e7d8.js → skin-70cec92b.js} +1 -1
- package/esm/{skin-a31850f0.js → skin-a9816629.js} +1 -1
- package/esm/{skin-01b0e1a5.js → skin-bde50aaa.js} +1 -1
- package/esm/skin-efae74e7.js +1 -0
- package/esm/{skin-160448cf.js → skin-f2e99bd5.js} +1 -1
- package/esm/{skin-072e0b5c.js → skin-fa5461e2.js} +1 -1
- package/esm/{start-begin-btn-798fe08c.js → start-begin-btn-ff036cfe.js} +1 -1
- package/esm/util-28923483.js +1 -0
- package/esm/videoSelector-48609307.js +1 -0
- package/esm/videoSelector-da42dc2c.js +1 -0
- package/esm/{videojs-dash5.es-6c1ba1fe.js → videojs-dash5.es-2dcf13b7.js} +1 -1
- package/package.json +1 -1
- package/cjs/index-36a39813.js +0 -1
- package/cjs/index-c5bb1c0f.js +0 -1
- package/cjs/playlist-975d63e2.js +0 -1
- package/cjs/series-v2-90b35eef.js +0 -1
- package/cjs/series-v2-dc89938a.js +0 -1
- package/cjs/skin-3874c0d0.js +0 -1
- package/cjs/util-db87d399.js +0 -1
- package/cjs/videoSelector-9c7be217.js +0 -1
- package/cjs/videoSelector-9eb3d659.js +0 -1
- package/esm/index-2068da20.js +0 -1
- package/esm/playlist-26e445f5.js +0 -1
- package/esm/series-v2-0d2dd639.js +0 -1
- package/esm/series-v2-6b9fe00e.js +0 -1
- package/esm/skin-43ce728e.js +0 -1
- package/esm/util-9649ae40.js +0 -1
- package/esm/videoSelector-b4b6876d.js +0 -1
- package/esm/videoSelector-bb89e286.js +0 -1
- /package/esm/components/{dvr-overlay → dvr-startover}/index.d.ts +0 -0
- /package/esm/components/{dvr-overlay → dvr-startover}/start-begin-btn.d.ts +0 -0
- /package/esm/components/{dvr-overlay → dvr-startover}/watch-live-btn.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,g as r,a as i,b as l,c as a,e as s,s as u,f as c,l as d,h as v,i as f,j as p,k as m,m as y,r as g,n as h,o as b,p as w,q as k,t as S,u as O,v as I,w as j,x as T,y as E,z as P,A as D,B as A,C as x,D as C,E as L,F as R,G as N,H as M,I as _,J as U,K as V,L as B,M as H,N as F,O as Q,P as G,Q as K}from"./generic-63e4557c.js";import{g as q}from"./player_instance-34118a5b.js";import z from"video.js";import{o as J,g as W,a as X,s as Y,b as $,p as Z}from"./util-9649ae40.js";import{g as ee,d as ne,a as te,e as oe}from"./captions-b619441b.js";import{g as re,p as ie}from"./resolution-62be852a.js";import{t as le,i as ae,a as se}from"./skin-16f83185.js";import{s as ue}from"./localisation-0bf399a1.js";import ce from"@babel/runtime/helpers/typeof";import de from"@babel/runtime/helpers/toConsumableArray";import ve from"@babel/runtime/helpers/slicedToArray";import{a as fe}from"./index-2068da20.js";var pe=function(e){return new Promise(function(n,t){if(me(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ye=function(e,n,t){var o=q(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var r=parseFloat(n)/100;o.volume(r),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ge=function(e){var n=q(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},he=function(){var e=n(t.mark(function e(n){var r,i,l,a,s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=q(null==n?void 0:n.playerId),null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(z),e.finish(13);case 16:(s=z.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==o()?null==i||i.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),be=function(e,n){var t=q(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,r,i,l,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}})};var we=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),pe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(z),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-5d92eaa3.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),Ie=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-6c1ba1fe.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(z)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(z)})},loadAdsLibrary:we,loadEMELibrary:ke,loadMuxPlugin:Se,loadDvrSeekbar:Oe,loadContribDash:Ie});function Te(e){return Ee.apply(this,arguments)}function Ee(){return(Ee=n(t.mark(function e(n){var r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,we();case 3:r&&"Safari"==o()&&Promise.resolve().then(function(){return je}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Pe(e,n){return De.apply(this,arguments)}function De(){return(De=n(t.mark(function e(n,r){var i,l,a,s,u,c,d,v,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==r?void 0:r.contentType)||"video",v=null==r||null===(i=r[d])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[d])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==r||null===(s=r[d])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(c=u.videoAssets)||void 0===c?void 0:c.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==o()?ke():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?Ie():ke():"Safari"!=o()&&f?Ie():null,he(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}function Ae(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function xe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ae(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Ce=new Set,Le=null,Re=function(e,n,t){var o,i,a,s,u,c,d,v={},f=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(o=e[f])||void 0===o?void 0:o.id)||"Null",v["c3.cm.contentType"]=He(e),v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==t||null===(s=t.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===r()?"NULL":r(),v["c3.cm.categoryType"]=Ue(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[f])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=e[f])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Ve(e),v["c3.cm.genreList"]=Me(e),v["c3.cm.genre"]=Ne(e),v["c3.cm.channel"]=_e(e);var p=Ge(l(),e);return v=xe(xe({},v),p)},Ne=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Me=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},_e=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Ue=function(e){return(null==e?void 0:e.contentType)||"null"},Ve=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},Be=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},He=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Fe,Qe,Ge=function(e,n){var t,o,r,l,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=a(),d=i();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(r=e[c-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(s=l[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Ke=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},qe=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ze=function(){var e=n(t.mark(function e(n,o){var r,i,l,a,u,c,d,v,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==o?void 0:o.convivaConfig)||{},i=r.trackConvivaPlayerEvent,l=r.paymentHandler,a=r.tveProvider,u=r.enable,c=r.appName,d=(o||{}).token,u){e.next=4;break}return e.abrupt("return");case 4:if(v=q(n),"function"==typeof(f=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(p=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=Ke(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})}),n||f("contentInfo",{DRMEnabled:"None"})}),v.on("loadstart",function(){var e,n;Le&&Le!==v.currentSrc()&&f("playbackEnded"),f("setPlayer",v),Ce.clear(),Le=v.currentSrc();var t=qe(v.currentType()),r=s(),i=Re(r,v,p);i[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=c||"WEB",i[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=Be(r,o),i.authToken=d||"NULL",i.streamType=t,i.D2CType=l||"NONE",i.subscriberType=a||(l?"D2C":"FREE"),i["c3.cm.affiliate"]=a||"NULL",Je.setData(i),f("contentInfo",i)}),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"),f("contentInfo",{screenResolution:e})}),v.on("play",function(){Ce.has(v.currentSrc())||(Ce.add(v.currentSrc()),f("playbackStarted",null))}),v.on("ended",function(){Ce.has(v.currentSrc())&&Ce.delete(v.currentSrc()),f("playbackEnded")}),v.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})}),v.on("dispose",function(){null==Ce||Ce.clear(),f("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Je=(Fe={},{setData:function(e){Fe=xe(xe({},Fe),e)},getData:function(){return Fe}}),We=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-01b0e1a5.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-a31850f0.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-160448cf.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-c169e7d8.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-072e0b5c.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t&&import("./skin-43ce728e.js").then(function(t){t.initialiseSkin(e,n)})};function Xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ye(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Xe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $e=[],Ze=0,en=null;function nn(n,t,o){var r,i,l,a,c,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(r=t.watchHistory)||void 0===r||r.apiVersion;var v=null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.profileId,f=Math.floor(n.currentTime()),p=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,y=(null==t||null===(c=t.watchHistory)||void 0===c?void 0:c.saveOffline)||!1,g=Math.floor(n.currentTime()),h=d?100:Math.floor(f/p*100),b={};y?function(n,t,o){var r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=tn(r),l=(new Date).getTime(),a=s(),u=(null==a?void 0:a.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(n,t){return Ye(Ye({},n),{},e({},t,u[t]))},{}),d=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Qe});d<0?i.push(Ye(Ye({content:c},n),{},{addedDate:l,updateDate:l})):i[d]=Ye(Ye(Ye({},i[d]),n),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(i))}(b={completed:d,watchedTime:g,watchedPercentage:h},v,t.siteOwner):(b=Ye(Ye({videoId:Qe,watchedTime:g,watchedPercentage:h,doneWatching:d,profileId:v},en&&{seriesId:en}),m&&{originalObjectId:m}),u(b).then(function(e){}).catch(function(e){})),Ze=f+o}function tn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function on(e,n,t){var o=tn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),r}var rn=!1,ln=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!rn){var i=an(e,"videoAssets","secondaryVideoAssets"),l=c(i,n);return l&&d(n,l),rn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function an(e,n,t){if(Array.isArray(e))return e.map(function(e){return an(e,n,t)});if(null!==e&&"object"===ce(e)){var o={};return Object.keys(e).forEach(function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=an(e[r],n,t)}),o}return e}function sn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return un(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?un(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function un(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function dn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):cn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var vn=function(e,n,t,r){var i,l,a,u,c=r.res,d=r.sres,y=q(e),g=(null==c?void 0:c.contentType)||"video",h=(null==c?void 0:c[g].drmEnabled)||!1,b=(null==c||null===(i=c[g])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,w=(null==c||null===(a=c[g])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;p(c),y&&(y.on("loadstart",function(){b?t.resolve({status:!0,msg:"Video Loaded",response:c}):t.resolve(dn({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:c}:{response:c}))}),y.on("loadeddata",function(){var t,r,i,l=ee(e);if(null==l||l.map(function(n){return ne(e,n.id)}),w&&"Safari"===o())try{var a;null==y||null===(a=y.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&ye(e,sessionStorage.getItem("volume")||"100");var u=s();if(v(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.saveOffline)){var d,f,p=dn(dn({},n),c);!function(e,n,t){var o,r,i;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(en=null==n||null===(r=n.series)||void 0===r?void 0:r.id),$e=[],Ze=0,Qe=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=q(e);a&&(a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());$e.includes(Ze)||(e==Ze?($e.push(e),nn(a,n,l)):e>Ze&&(Ze=e+l))}}),a.one("ended",function(){nn(a,n,l,!0)}))}(e,p,null==u||null===(d=u.video)||void 0===d||null===(f=d.gist)||void 0===f?void 0:f.id)}if(null!=n&&null!==(i=n.analytics)&&void 0!==i&&i.muxKey&&null!=y&&y.mux){var m,g,h,b,k,S,O=(null===(m=s())||void 0===m?void 0:m.video)||(null==c?void 0:c.video),I=null==O?void 0:O.gist,j={env_key:null==n||null===(g=n.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==I?void 0:I.id,video_title:null==I?void 0:I.title,video_series:null==O||null===(b=O.series)||void 0===b?void 0:b.title,video_stream_type:null!=O&&null!==(k=O.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==n||null===(S=n.analytics)||void 0===S?void 0:S.userId};y.mux({debug:!1,data:j})}}),y.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];y.trigger("subtitlechanged",n)}),y.on("subtitlechanged",function(e,n){var t,o,r,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,y=p.getMediaSession(),g=y.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}}),y.tech_.on("retryplaylist",function(){b&&ln(c,e)}),y.on("error",function(){var n,o;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&b)?ln(c,e):(f(e,(null==y||null===(n=y.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==y||null===(o=y.error())||void 0===o?void 0:o.message)||"Some error occured",response:c}))}),y.one("play",function(){var e,t,o,r,i;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable){var l,a,u,c=null===(l=s())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=m(),v=(null==d?void 0:d.get(c))||{t:0,p:0},f=v.t,p=v.p;f&&p<95&&setTimeout(function(){y.currentTime(f)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){y.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=y&&y.dvrSeekbar)try{y.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),y.on("volumechange",function(){var e=100*y.volume().toFixed(2);y.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),y.on("chromecastDisconnected",function(){if(b){y.currentSource();for(var e=y.textTracks(),n=e.length-1;n>=0;n--)y.removeRemoteTextTrack(e[n])}}),y.one("loadeddata",function(){var e,n=(null==y||null===(e=y.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==ce(y.dash)){var t,r,i,l=null==y||null===(t=y.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),a=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),s=sn(n);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var c,d=sn(n);try{for(d.s();!(c=d.n()).done;){var v,f,p,m=c.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(f=v.userAgent)&&void 0!==f&&f.includes("Macintosh")||!h))&&null!=m&&null!==(p=m.label)&&void 0!==p&&p.includes("5.1"))y.audioTracks().removeTrack(m);else{if("main"==m.kind){m.enabled=!0;break}m.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function fn(e,n){var t,o,r,i=q(e),l=null==i||null===(t=i.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,a=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,s,u,c,d,v,f,p;if(mn.enabled&&"input"!=t.target.localName){var m=t.key,h=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(m)&&(t.preventDefault(),null==a||a.focus()),m){case" ":null==l||l.click();break;case"m":case"M":i.muted(!i.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":h&&!1===n.liveui||g(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(s=r.app_data)||void 0===s||null===(u=s.appcmsMain)||void 0===u||null===(c=u.adsConfig)||void 0===c?void 0:c.vodAdSticherProvider)&&null!==(d=window)&&void 0!==d&&null!==(v=d.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(p=f.adsConfig)&&void 0!==p&&p.vodAdClientSideTracking)return;h||y(e,10)}}},!0)}var pn,mn=(pn=!0,{enable:function(){pn=!0},disable:function(){pn=!1},get enabled(){return pn}}),yn="ssai-breakStart",gn="ssai-adImpression",hn="ssai-firstQuartile",bn="ssai-midpoint",wn="ssai-thirdQuartile",kn="ssai-complete",Sn="ssai-breakEnd",On={breakStart:yn,impression:gn,firstQuartile:hn,midpoint:bn,thirdQuartile:wn,complete:kn,breakEnd:Sn};function In(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=q(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=On[o];r&&t.trigger(r,n)}function jn(e){var n=q(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(yn,e)},adImpression:function(e){return t(gn,e)},adFirstQuartile:function(e){return t(hn,e)},adMidpoint:function(e){return t(bn,e)},adThirdQuartile:function(e){return t(wn,e)},adComplete:function(e){return t(kn,e)},adBreakEnd:function(e){return t(Sn,e)}}}function Tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function En(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Tn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Tn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function Pn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Dn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Dn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Dn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var An,xn,Cn=(An="",{set:function(e){e&&(An=e)},get:function(){return An}}),Ln=(xn=null,{set:function(e){xn=e},get position(){return xn}});function Rn(e,n){return Nn.apply(this,arguments)}function Nn(){return Nn=n(t.mark(function e(n,o){var r,i,l,a,s,u,d,v,f,p,m,y,g,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return q(n),r=c(o,n),i=r.src,l=i.replace("/dash/","/session/").replace("master","session"),l=h(l,n,o),a=Mn(l),s=ve(a,2),u=s[0],d=s[1],l=new URL(l.split("?")[0]),Object.keys(d).length>0&&Object.entries(d).forEach(function(e){var n=ve(e,2),t=n[0],o=n[1];l.searchParams.set(t,o)}),e.prev=8,e.next=11,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:En({},u)})});case 11:return v=e.sent,e.next=14,v.json();case 14:return f=e.sent,p="https://"+new URL(l).hostname,m=f.trackingUrl,y=f.manifestUrl,g=p+m,b=p+y,Cn.set(g),console.log("%c TRACKING URL","background: #bdf369; color: #000",g),r.src=b,e.abrupt("return",r);case 26:return e.prev=26,e.t0=e.catch(8),e.abrupt("return",r);case 29:case"end":return e.stop()}},e,null,[[8,26]])})),Nn.apply(this,arguments)}function Mn(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var o,r=Pn(t.split("&"));try{for(r.s();!(o=r.n()).done;){var i=o.value.split("="),l=ve(i,2),a=l[0],s=l[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},c={},d=0,v=Object.entries(n);d<v.length;d++){var f=ve(v[d],2),p=f[0],m=f[1];if(p.startsWith("ads."))u[p.replace(/^ads\./,"")]=m;else c[p]=m}return[u,c]}var _n,Un=(_n=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),_n=Array.isArray(e)?de(e):_n},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",_n),de(_n)}});function Vn(e,n){return Bn.apply(this,arguments)}function Bn(){return Bn=n(t.mark(function e(o,r){var i,l,a,s,u,c,d,v,f,p,m,g,h,b,w,k,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:S=function(e,n,t,r,i,l){var a=q(o);if(!a.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(a.currentTime());var s,u=Pn(t);try{var c=function(){var t,u,c,d=s.value,v=d.eventType,f=d.beaconUrls,p=d.startTimeInSeconds,m=d.startTime,y=d.durationInSeconds,g=p||0,h=f,b=(null===(t=window)||void 0===t||null===(u=t.customData)||void 0===u||null===(c=u.ads)||void 0===c?void 0:c.adEventHandler)||null,S="".concat(g,"_").concat(v),O=w.get("pod-".concat(i))||[];if(console.warn(e,g,"map:",v,"condition1:",e>=g,"map:",w),e>=g&&!O.includes(S)){O.push(S),w.set("pod-".concat(i),O);try{k(v,n,h,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var I=Ln.position;Ln.set(null),setTimeout(function(){null!=I&&(a.currentTime(I),l())},500)}if("function"==typeof b)try{var j,T={eventType:v,startTimeInSeconds:p,startTime:m,durationInSeconds:y,ad:null==n||null===(j=n.ads)||void 0===j?void 0:j[r],adIndex:r};b({adsData:T}),In(o,T)}catch(e){console.error("Error when calling ads callback:",e)}}};for(u.s();!(s=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},k=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},b=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Ln.set(r),u=Cn.get(),(c=q(o)).one("loadeddata",function(){u&&h(u)}),d=new Map,v=new Map,f=-1,p=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,m=(null==c||null===(a=c.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,g=(null==c||null===(s=c.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,h=function(){var e=n(t.mark(function e(n){var i,l,a,s,u,c,h,w,k,O,I,j,T,E,P,D,A;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return T=function(e){document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",T),0===e.button&&O()},j=function(e){},I=function(){var e,n=h.currentTime(),t=null,o=Pn(c);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,d.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},O=function(){var e,n=h.currentTime(),t=null,o=Pn(c);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,s=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>i)&&!d.has(i)||n>=i&&n<=s)&&(t=i,d.set(i,!0),v.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){h.currentTime(t+.4)},100))},l=!1,e.next=7,fetch(n);case 7:return a=e.sent,e.next=10,a.json();case 10:s=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",s),u=s.avails,c=[],h=q(o),w=h.controlBar.progressControl,k=w.seekBar.el(),u.map(function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(l=!0),c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===r?void 0:r[0])||[]})}),!l&&r&&(h.currentTime(r),I()),null!=c&&c.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),window.adsQueueList=c),console.log(c,"data"),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",k.appendChild(i)}}),h.on("timeupdate",le(function(){var e=h.currentTime();if(e!==f){f=e;for(var n=!1,t=function(){var t=c[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&d.set(r,!0),mn.disable(),p&&p.classList.add("vjs-hidden"),m&&(m.el().style.pointerEvents="none",m.el().classList.add("vjs-hidden")),g&&(g.el().style.pointerEvents="none",g.el().classList.add("vjs-hidden")),w.el().style.visibility="hidden";for(var s=e-r,u=0,f=0,y=0;y<l.length;y++){var h,k=null==l||null===(h=l[y])||void 0===h?void 0:h.durationInSeconds;if(s<u+k){f=y;break}u+=k}l[f];var O=Math.max(0,i-s),j=Math.round(O);E.style.display="block",A.textContent="".concat(f+1," of ").concat(l.length," • ").concat(b(j));var T=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});T.push.apply(T,de(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&T.push(null==t?void 0:t.podSlotImpressionBeacon),S(e,t,T,f,o,I),"break"}v.delete(r)},o=0;o<c.length;o++){if("break"===t())break}n||(E.style.display="none",w.el().style.visibility="visible",m&&(m.el().style.pointerEvents="auto",m.el().classList.remove("vjs-hidden")),g&&(g.el().style.pointerEvents="auto",g.el().classList.remove("vjs-hidden")),p&&p.classList.remove("vjs-hidden"),mn.enable())}},1e3)),null===(i=document)||void 0===i||i.addEventListener("keydown",function(e){mn.enabled&&"ArrowRight"==e.key&&(O(),y(o,10),e.stopPropagation())}),w.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",j),document.addEventListener("pointerup",T))}),(E=document.createElement("div")).className="ssai-ad-container",(P=document.createElement("div")).className="sponsored-adbox",(D=document.createElement("div")).className="sponsored-text",D.textContent="Sponsored Ad",P.append(D),(A=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",E.append(P),E.append(A),h.el().appendChild(E);case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),w=new Map;case 16:case"end":return e.stop()}},e)})),Bn.apply(this,arguments)}function Hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Fn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Hn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Hn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Qn=function(r,i,l,a){var s,u,v,p,m,y,g,h,O,I,j,T,E,P,D,A,x,C,L,R,N,M,_,U,V,B,H,F,Q,G,K,J,W,X,Y,$,Z,ee,ne=i.res,oe=void 0===ne?null:ne,re=i.sres,ie=void 0===re?null:re,le=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],se=(null===(s=oe)||void 0===s?void 0:s.contentType)||"video",ue=ae(null===(u=oe)||void 0===u||null===(v=u[se])||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.videoImageUrl)||ae(null===(m=oe)||void 0===m||null===(y=m[se])||void 0===y||null===(g=y.gist)||void 0===g||null===(h=g.imageGist)||void 0===h?void 0:h.r16x9),ce=(null===(O=oe)||void 0===O||null===(I=O[se])||void 0===I||null===(j=I.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,de=(null===(T=oe)||void 0===T||null===(E=T[se])||void 0===E||null===(P=E.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,ve=(null===(D=oe)||void 0===D||null===(A=D.ads)||void 0===A||null===(x=A.preRoll)||void 0===x||null===(C=x.adTags)||void 0===C||null===(L=C.web)||void 0===L?void 0:L.active)&&(null===(R=oe)||void 0===R||null===(N=R.ads)||void 0===N||null===(M=N.preRoll)||void 0===M||null===(_=M.adTags)||void 0===_||null===(U=_.web)||void 0===U?void 0:U.url),pe=(null===(V=oe=Fn(Fn({},oe),{},{audioAssetSource:null==l?void 0:l.audioAssetSource}))||void 0===V||null===(B=V[se])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(F=H.app_data)||void 0===F||null===(Q=F.appcmsMain)||void 0===Q||null===(G=Q.adsConfig)||void 0===G?void 0:G.vodAdSticherProvider)||!1,me=(null==l?void 0:l.latency)||6,ye=(null==l?void 0:l.skin_settings)||{},ge=(null==l?void 0:l.dvrConfig)||{enable:!1},he=(ee={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ye?void 0:ye.pictureInPictureToggle)||!1},playbackRates:null!=ye&&ye.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:ce},e(ee,"autoplay",null==l?void 0:l.autoplay),e(ee,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!ve),e(ee,"loop",(null==l?void 0:l.loop)||!1),e(ee,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(ee,"html5",Fn(Fn({dash:Fn(Fn(Fn({},!z.browser.IS_SAFARI&&{useTTML:!0}),(null==l?void 0:l.debugConfig)&&(null==l||null===(K=l.debugConfig)||void 0===K?void 0:K.enable)&&{debug:!0,logLevel:null!=l&&null!==(J=l.debugConfig)&&void 0!==J&&J.logLevel?null==l||null===(W=l.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:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Fn(Fn({liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==l||null===(X=l.customData)||void 0===X?void 0:X.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(Y=null==l?void 0:l.enableLowInitialPlaylist)||void 0===Y||Y}),debug:!0,nativeTextTracks:"Safari"==o()},0==(null==l||null===($=l.customData)||void 0===$?void 0:$.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(Z=l.customData)||void 0===Z?void 0:Z.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ee,"poster",ue),e(ee,"techOrder",le),e(ee,"chromecast",{requestCustomDataFn:function(e){var n,t,o=q(r),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,r,i,l,a,s,u,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,y,g,h,b,w,k,S;p.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==O?void 0:O.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);p.licenseUrl=I;var j=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=j}var T=(null==e||null===(o=e[f])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";p.contentType=T;var E=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=E;var P=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=P;var D=null==e||null===(u=e[f])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(oe,e,i);return Fn(Fn({},a),{},{convivaMetaData:Fn({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},Je.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,l,a=q(r),s=(null==a?void 0:a.currentSource())||{};!(null===(n=oe)||void 0===n||null===(t=n[se])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ee);if(!z.getPlayers()[r]){z.log.level("debug");var we=z(r,he,function(){var e=n(t.mark(function e(){var n,o,i,s,u,v,p,m,y,g,h,O,I,j,T,E,P,D,A,x,C,L,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(z.VERSION),console.log(z.getPlugins()),e.next=5,Pe(l,oe);case 5:if(O=null===(n=oe)||void 0===n||null===(o=n[se])||void 0===o||null===(i=o.liveDetails)||void 0===i?void 0:i.startOverTime,de&&a.resolve(Fn({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:oe}:{response:oe})),I={},null!=ge&&ge.enable&&ce&&(I.playFromBegining=ge.playFromBegining,I.playLive=ge.playLive,T=null==l||null===(j=l.epg)||void 0===j?void 0:j.programSubType,"linearchannel"===se?"LIVE"===(null==T?void 0:T.toUpperCase())&&fe(r,l):fe(r,l)),w(r,null==l?void 0:l.analyticsCb,I),ze(r,l),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),ce&&be(r,O),!ve||null!=l&&null!==(s=l.customData)&&void 0!==s&&s.disableAds||k(r,ve,oe),E=c(oe,r),console.log(E),null!=l&&l.nearestClusterUrl&&(E=S(E,l.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,Rn(r,oe);case 20:E=e.sent;case 21:E?d(r,E):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:oe}),f(r,"Incompatible / Missing Source")),((null===(u=oe)||void 0===u||null===(v=u[se])||void 0===v||null===(p=v.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=oe)||void 0===y||null===(g=y[se])||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0)&&(R=(null===(D=oe)||void 0===D||null===(A=D[se])||void 0===A||null===(x=A.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(C=oe)||void 0===C||null===(L=C[se])||void 0===L?void 0:L.closedCaptions),P=R.filter(function(e){return"VTT"===e.format}),te(r,P)),null!=l&&l.disableControls?b(r):We(r,Fn(Fn(Fn({},l),he),{},{liveVideo:de,isDvrEnabled:ce,res:oe,sres:ie})),vn(r,Fn(Fn(Fn({},l),he),{},{liveVideo:de}),a,{res:oe,sres:ie});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}},Gn={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function qn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Kn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var zn,Jn=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Wn(e);Qn(r,{res:i},e,{resolve:t,reject:o})},Wn=function(e){var n,t,o,r,i,l,a,s,u=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,d=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.url)||null,f=(null==e||null===(i=e.streamingInfo)||void 0===i?void 0:i.posterUrl)||null,p=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,y=null==e?void 0:e.token,g=O(y),h=null==g?void 0:g.site;return qn(qn({id:null==Gn?void 0:Gn[h]},!d&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:d,streamingInfo:{videoAssets:qn(qn({},m&&{drmProvider:m}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:qn({},f&&{videoImageUrl:f}),contentDetails:qn({},(null==p?void 0:p.length)>0&&{closedCaptions:de(p)})},ads:{preRoll:{adTags:{web:qn(qn({},v&&{active:!0}),v&&{url:v})}}}})};function Xn(e,n){return Yn.apply(this,arguments)}function Yn(){return(Yn=n(t.mark(function e(n,o){var r,i,l,a,s,u;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,i=o.reject,l=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,E();case 6:u=e.sent,I(l,u).then(function(e){var t,o,c,d;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(c=o.gist)||void 0===c?void 0:c.contentType,p(null==e?void 0:e.data);var v,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(d=n.watchHistory)&&void 0!==d&&d.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var m,y,g,h=on((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",l,null==n?void 0:n.siteOwner);if(h&&h.length)n.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",Qn(a,{res:f},n,{resolve:r,reject:i})}else j(l,u).then(function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"}).catch(function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))}).finally(function(){Qn(a,{res:f},n,{resolve:r,reject:i})});else Qn(a,{res:f},n,{resolve:r,reject:i})}).catch(function(e){T(e,a,i,l)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $n(e,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=n(t.mark(function e(n,o){var r,i,l,a,s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,i=o.reject,e.next=3,E();case 3:l=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,P(s,l).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Qn(a,{res:t},n,{resolve:r,reject:i})}).catch(function(e){T(e,a,i,videoId)});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function et(e,n){return nt.apply(this,arguments)}function nt(){return(nt=n(t.mark(function e(n,o){var r,i,l,a,s,u,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,l=o.reject,e.next=3,E();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,x.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,D(c,a).then(function(e){var t,o,r,u=e.data,d=e.data.seasons;C(d);var v=videoId||(null==d||null===(t=d[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.id);A(c,a),I(v,a).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,p(e.data),Qn(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:i,reject:l})}).catch(function(e){T(e,s,l,videoId)})}).catch(function(e){T(e,s,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(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):tt(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function rt(){return{loadVideoInstantly:L,onTimeUpdate:J,getVideoDuration:W,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark(function n(o,r){var i,l,a,s,u,c,d,v,f,p,m,y,g,h,b,w,k,S,O,j,E,P,D;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!M(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(m=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,g=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,h=null==e?void 0:e.videoId,b=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,w=(null==e?void 0:e.streamingInfo)||!1,window.videoId=h,k=null==e?void 0:e.token,!F(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",k),Q().set(null==e?void 0:e.refreshToken),k&&!G(k)){n.next=16;break}return r({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 16:zn=JSON.parse(atob(k.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(a=zn)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=zn)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=zn)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=zn)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,S=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(d=e.series)&&void 0!==d&&d.enable?null:null==e?void 0:e.chromecastReceiverId,O=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,(j=null==e?void 0:e.errors)&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,ue(null==e||null===(f=e.customData)||void 0===f?void 0:f.localisation),H.set(e.apiBaseUrl),null!=e&&e.skin&&!se(e.skin)||(e.skin="VL_ONE"),n.next=33,Te(e);case 33:O&&pe("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then(function(){return K(O)}).catch(function(e){}),(E=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(S)))&&E.addEventListener("contextmenu",function(e){return e.preventDefault()}),m?(D={directPlaybackUrl:m,id:P="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?I(P,k).then(function(n){var t=(null==n?void 0:n.data)||{};Qn(S,{res:ot(ot({},t),D)},e,{resolve:o,reject:r})}).catch(function(e){T(e,S,r,P)}):Qn(S,{res:D},e,{resolve:o,reject:r})):w?Jn(e,{resolve:o,reject:r}):b?et(e,{resolve:o,reject:r}):g?$n(e,{resolve:o,reject:r}):Xn(e,{resolve:o,reject:r});case 37:case"end":return n.stop()}},n)}));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:re,skip:y,getPlayer:q,play:R,pause:N,detectBrowser:o,rewind:g,loadVideo:d,seekToTimeStamp:Y,isPlayerInitialised:M,load:_,authenticateLC:U,dispose:V,enableCaptions:oe,disableCaptions:ne,getCaptions:ee,playSelectedResolution:ie,getSource:c,setVolume:ye,getVolume:ge,disableControls:b,setPlaybackSpeed:$,getEntitlementData:B,adsQueuePointManager:Un,getSsaiEvents:jn,playerEvents:Z}}export{rt as V,fn as i,Vn as s};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,g as r,a as i,b as l,c as a,e as s,s as u,f as c,l as d,h as v,i as f,j as p,k as m,m as y,r as g,n as h,o as b,p as w,q as k,t as S,u as O,v as I,w as j,x as T,y as P,z as E,A as D,B as A,C as x,D as C,E as L,F as R,G as N,H as M,I as _,J as U,K as V,L as B,M as H,N as F,O as Q,P as G,Q as K}from"./generic-dd89c778.js";import{g as q}from"./player_instance-34118a5b.js";import z from"video.js";import{o as J,g as W,a as X,s as Y,b as $,p as Z}from"./util-28923483.js";import{g as ee,d as ne,a as te,e as oe}from"./captions-b619441b.js";import{g as re,p as ie}from"./resolution-62be852a.js";import{t as le,i as ae,a as se}from"./skin-16f83185.js";import{s as ue}from"./localisation-0bf399a1.js";import ce from"@babel/runtime/helpers/typeof";import de from"@babel/runtime/helpers/toConsumableArray";import ve from"@babel/runtime/helpers/slicedToArray";import{a as fe}from"./index-a012aae4.js";var pe=function(e){return new Promise(function(n,t){if(me(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ye=function(e,n,t){var o=q(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var r=parseFloat(n)/100;o.volume(r),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ge=function(e){var n=q(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},he=function(){var e=n(t.mark(function e(n){var r,i,l,a,s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=q(null==n?void 0:n.playerId),null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(z),e.finish(13);case 16:(s=z.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==o()?null==i||i.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),be=function(e,n){var t=q(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,r,i,l,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}})};var we=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),pe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(z),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-5d92eaa3.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),Ie=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-2dcf13b7.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(z)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(z)})},loadAdsLibrary:we,loadEMELibrary:ke,loadMuxPlugin:Se,loadDvrSeekbar:Oe,loadContribDash:Ie});function Te(e){return Pe.apply(this,arguments)}function Pe(){return(Pe=n(t.mark(function e(n){var r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,we();case 3:r&&"Safari"==o()&&Promise.resolve().then(function(){return je}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ee(e,n){return De.apply(this,arguments)}function De(){return(De=n(t.mark(function e(n,r){var i,l,a,s,u,c,d,v,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==r?void 0:r.contentType)||"video",v=null==r||null===(i=r[d])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[d])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==r||null===(s=r[d])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(c=u.videoAssets)||void 0===c?void 0:c.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==o()?ke():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?Ie():ke():"Safari"!=o()&&f?Ie():null,he(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}function Ae(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function xe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ae(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Ce=new Set,Le=null,Re=function(e,n,t){var o,i,a,s,u,c,d,v={},f=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(o=e[f])||void 0===o?void 0:o.id)||"Null",v["c3.cm.contentType"]=He(e),v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==t||null===(s=t.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===r()?"NULL":r(),v["c3.cm.categoryType"]=Ue(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[f])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=e[f])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Ve(e),v["c3.cm.genreList"]=Me(e),v["c3.cm.genre"]=Ne(e),v["c3.cm.channel"]=_e(e);var p=Ge(l(),e);return v=xe(xe({},v),p)},Ne=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Me=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},_e=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Ue=function(e){return(null==e?void 0:e.contentType)||"null"},Ve=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},Be=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},He=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Fe,Qe,Ge=function(e,n){var t,o,r,l,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=a(),d=i();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(r=e[c-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(s=l[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Ke=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},qe=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ze=function(){var e=n(t.mark(function e(n,o){var r,i,l,a,u,c,d,v,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==o?void 0:o.convivaConfig)||{},i=r.trackConvivaPlayerEvent,l=r.paymentHandler,a=r.tveProvider,u=r.enable,c=r.appName,d=(o||{}).token,u){e.next=4;break}return e.abrupt("return");case 4:if(v=q(n),"function"==typeof(f=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(p=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=Ke(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})}),n||f("contentInfo",{DRMEnabled:"None"})}),v.on("loadstart",function(){var e,n;Le&&Le!==v.currentSrc()&&f("playbackEnded"),f("setPlayer",v),Ce.clear(),Le=v.currentSrc();var t=qe(v.currentType()),r=s(),i=Re(r,v,p);i[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=c||"WEB",i[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=Be(r,o),i.authToken=d||"NULL",i.streamType=t,i.D2CType=l||"NONE",i.subscriberType=a||(l?"D2C":"FREE"),i["c3.cm.affiliate"]=a||"NULL",Je.setData(i),f("contentInfo",i)}),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"),f("contentInfo",{screenResolution:e})}),v.on("play",function(){Ce.has(v.currentSrc())||(Ce.add(v.currentSrc()),f("playbackStarted",null))}),v.on("ended",function(){Ce.has(v.currentSrc())&&Ce.delete(v.currentSrc()),f("playbackEnded")}),v.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})}),v.on("dispose",function(){null==Ce||Ce.clear(),f("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Je=(Fe={},{setData:function(e){Fe=xe(xe({},Fe),e)},getData:function(){return Fe}}),We=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-bde50aaa.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-a9816629.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-f2e99bd5.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-70cec92b.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-fa5461e2.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t&&import("./skin-efae74e7.js").then(function(t){t.initialiseSkin(e,n)})};function Xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ye(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Xe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $e=[],Ze=0,en=null;function nn(n,t,o){var r,i,l,a,c,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(r=t.watchHistory)||void 0===r||r.apiVersion;var v=null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.profileId,f=Math.floor(n.currentTime()),p=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,y=(null==t||null===(c=t.watchHistory)||void 0===c?void 0:c.saveOffline)||!1,g=Math.floor(n.currentTime()),h=d?100:Math.floor(f/p*100),b={};y?function(n,t,o){var r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=tn(r),l=(new Date).getTime(),a=s(),u=(null==a?void 0:a.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(n,t){return Ye(Ye({},n),{},e({},t,u[t]))},{}),d=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Qe});d<0?i.push(Ye(Ye({content:c},n),{},{addedDate:l,updateDate:l})):i[d]=Ye(Ye(Ye({},i[d]),n),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(i))}(b={completed:d,watchedTime:g,watchedPercentage:h},v,t.siteOwner):(b=Ye(Ye({videoId:Qe,watchedTime:g,watchedPercentage:h,doneWatching:d,profileId:v},en&&{seriesId:en}),m&&{originalObjectId:m}),u(b).then(function(e){}).catch(function(e){})),Ze=f+o}function tn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function on(e,n,t){var o=tn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),r}var rn=!1,ln=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!rn){var i=an(e,"videoAssets","secondaryVideoAssets"),l=c(i,n);return l&&d(n,l),rn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function an(e,n,t){if(Array.isArray(e))return e.map(function(e){return an(e,n,t)});if(null!==e&&"object"===ce(e)){var o={};return Object.keys(e).forEach(function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=an(e[r],n,t)}),o}return e}function sn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return un(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?un(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function un(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function dn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):cn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var vn=function(e,n,t,r){var i,l,a,u,c=r.res,d=r.sres,y=q(e),g=(null==c?void 0:c.contentType)||"video",h=(null==c?void 0:c[g].drmEnabled)||!1,b=(null==c||null===(i=c[g])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,w=(null==c||null===(a=c[g])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;p(c),y&&(y.on("loadstart",function(){b?t.resolve({status:!0,msg:"Video Loaded",response:c}):t.resolve(dn({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:c}:{response:c}))}),y.on("loadeddata",function(){var t,r,i,l=ee(e);if(null==l||l.map(function(n){return ne(e,n.id)}),w&&"Safari"===o())try{var a;null==y||null===(a=y.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&ye(e,sessionStorage.getItem("volume")||"100");var u=s();if(v(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.saveOffline)){var d,f,p=dn(dn({},n),c);!function(e,n,t){var o,r,i;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(en=null==n||null===(r=n.series)||void 0===r?void 0:r.id),$e=[],Ze=0,Qe=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=q(e);a&&(a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());$e.includes(Ze)||(e==Ze?($e.push(e),nn(a,n,l)):e>Ze&&(Ze=e+l))}}),a.one("ended",function(){nn(a,n,l,!0)}))}(e,p,null==u||null===(d=u.video)||void 0===d||null===(f=d.gist)||void 0===f?void 0:f.id)}if(null!=n&&null!==(i=n.analytics)&&void 0!==i&&i.muxKey&&null!=y&&y.mux){var m,g,h,b,k,S,O=(null===(m=s())||void 0===m?void 0:m.video)||(null==c?void 0:c.video),I=null==O?void 0:O.gist,j={env_key:null==n||null===(g=n.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==I?void 0:I.id,video_title:null==I?void 0:I.title,video_series:null==O||null===(b=O.series)||void 0===b?void 0:b.title,video_stream_type:null!=O&&null!==(k=O.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==n||null===(S=n.analytics)||void 0===S?void 0:S.userId};y.mux({debug:!1,data:j})}}),y.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];y.trigger("subtitlechanged",n)}),y.on("subtitlechanged",function(e,n){var t,o,r,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,y=p.getMediaSession(),g=y.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}}),y.tech_.on("retryplaylist",function(){b&&ln(c,e)}),y.on("error",function(){var n,o;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&b)?ln(c,e):(f(e,(null==y||null===(n=y.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==y||null===(o=y.error())||void 0===o?void 0:o.message)||"Some error occured",response:c}))}),y.one("play",function(){var e,t,o,r,i;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable){var l,a,u,c=null===(l=s())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=m(),v=(null==d?void 0:d.get(c))||{t:0,p:0},f=v.t,p=v.p;f&&p<95&&setTimeout(function(){y.currentTime(f)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){y.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=y&&y.dvrSeekbar)try{y.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),y.on("volumechange",function(){var e=100*y.volume().toFixed(2);y.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),y.on("chromecastDisconnected",function(){if(b){y.currentSource();for(var e=y.textTracks(),n=e.length-1;n>=0;n--)y.removeRemoteTextTrack(e[n])}}),y.one("loadeddata",function(){var e,n=(null==y||null===(e=y.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==ce(y.dash)){var t,r,i,l=null==y||null===(t=y.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),a=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),s=sn(n);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var c,d=sn(n);try{for(d.s();!(c=d.n()).done;){var v,f,p,m=c.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(f=v.userAgent)&&void 0!==f&&f.includes("Macintosh")||!h))&&null!=m&&null!==(p=m.label)&&void 0!==p&&p.includes("5.1"))y.audioTracks().removeTrack(m);else{if("main"==m.kind){m.enabled=!0;break}m.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function fn(e,n){var t,o,r,i=q(e),l=null==i||null===(t=i.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,a=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,s,u,c,d,v,f,p;if(mn.enabled&&"input"!=t.target.localName){var m=t.key,h=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(m)&&(t.preventDefault(),null==a||a.focus()),m){case" ":null==l||l.click();break;case"m":case"M":i.muted(!i.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":h&&!1===n.liveui||g(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(s=r.app_data)||void 0===s||null===(u=s.appcmsMain)||void 0===u||null===(c=u.adsConfig)||void 0===c?void 0:c.vodAdSticherProvider)&&null!==(d=window)&&void 0!==d&&null!==(v=d.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(p=f.adsConfig)&&void 0!==p&&p.vodAdClientSideTracking)return;h||y(e,10)}}},!0)}var pn,mn=(pn=!0,{enable:function(){pn=!0},disable:function(){pn=!1},get enabled(){return pn}}),yn="ssai-breakStart",gn="ssai-adImpression",hn="ssai-firstQuartile",bn="ssai-midpoint",wn="ssai-thirdQuartile",kn="ssai-complete",Sn="ssai-breakEnd",On={breakStart:yn,impression:gn,firstQuartile:hn,midpoint:bn,thirdQuartile:wn,complete:kn,breakEnd:Sn};function In(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=q(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=On[o];r&&t.trigger(r,n)}function jn(e){var n=q(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(yn,e)},adImpression:function(e){return t(gn,e)},adFirstQuartile:function(e){return t(hn,e)},adMidpoint:function(e){return t(bn,e)},adThirdQuartile:function(e){return t(wn,e)},adComplete:function(e){return t(kn,e)},adBreakEnd:function(e){return t(Sn,e)}}}function Tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Pn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Tn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Tn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function En(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Dn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Dn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Dn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var An,xn,Cn=(An="",{set:function(e){e&&(An=e)},get:function(){return An}}),Ln=(xn=null,{set:function(e){xn=e},get position(){return xn}});function Rn(e,n){return Nn.apply(this,arguments)}function Nn(){return Nn=n(t.mark(function e(n,o){var r,i,l,a,s,u,d,v,f,p,m,y,g,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return q(n),r=c(o,n),i=r.src,l=i.replace("/dash/","/session/").replace("/master/","session"),l=h(l,n,o),a=Mn(l),s=ve(a,2),u=s[0],d=s[1],l=new URL(l.split("?")[0]),Object.keys(d).length>0&&Object.entries(d).forEach(function(e){var n=ve(e,2),t=n[0],o=n[1];l.searchParams.set(t,o)}),e.prev=8,e.next=11,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:Pn({},u)})});case 11:return v=e.sent,e.next=14,v.json();case 14:return f=e.sent,p="https://"+new URL(l).hostname,m=f.trackingUrl,y=f.manifestUrl,g=p+m,b=p+y,Cn.set(g),console.log("%c TRACKING URL","background: #bdf369; color: #000",g),r.src=b,e.abrupt("return",r);case 26:return e.prev=26,e.t0=e.catch(8),e.abrupt("return",r);case 29:case"end":return e.stop()}},e,null,[[8,26]])})),Nn.apply(this,arguments)}function Mn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=En((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=ve(t.value,2),l=i[0],a=i[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},u={},c=0,d=Object.entries(n);c<d.length;c++){var v=ve(d[c],2),f=v[0],p=v[1];if(f.startsWith("ads."))s[f.replace(/^ads\./,"")]=p;else u[f]=p}return[s,u]}var _n,Un=(_n=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),_n=Array.isArray(e)?de(e):_n},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",_n),de(_n)}});function Vn(e,n){return Bn.apply(this,arguments)}function Bn(){return Bn=n(t.mark(function e(o,r){var i,l,a,s,u,c,d,v,f,p,m,g,h,b,w,k,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:S=function(e,n,t,r,i,l){var a=q(o);if(!a.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(a.currentTime());var s,u=En(t);try{var c=function(){var t,u,c,d=s.value,v=d.eventType,f=d.beaconUrls,p=d.startTimeInSeconds,m=d.startTime,y=d.durationInSeconds,g=p||0,h=f,b=(null===(t=window)||void 0===t||null===(u=t.customData)||void 0===u||null===(c=u.ads)||void 0===c?void 0:c.adEventHandler)||null,S="".concat(g,"_").concat(v),O=w.get("pod-".concat(i))||[];if(console.warn(e,g,"map:",v,"condition1:",e>=g,"map:",w),e>=g&&!O.includes(S)){O.push(S),w.set("pod-".concat(i),O);try{k(v,n,h,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var I=Ln.position;Ln.set(null),setTimeout(function(){null!=I&&(a.currentTime(I),l())},500)}if("function"==typeof b)try{var j,T={eventType:v,startTimeInSeconds:p,startTime:m,durationInSeconds:y,ad:null==n||null===(j=n.ads)||void 0===j?void 0:j[r],adIndex:r};b({adsData:T}),In(o,T)}catch(e){console.error("Error when calling ads callback:",e)}}};for(u.s();!(s=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},k=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},b=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Ln.set(r),u=Cn.get(),(c=q(o)).one("loadeddata",function(){u&&h(u)}),d=new Map,v=new Map,f=-1,p=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,m=(null==c||null===(a=c.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,g=(null==c||null===(s=c.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,h=function(){var e=n(t.mark(function e(n){var i,l,a,s,u,c,h,w,k,O,I,j,T,P,E,D,A;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return T=function(e){document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",T),0===e.button&&O()},j=function(e){},I=function(){var e,n=h.currentTime(),t=null,o=En(c);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,d.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},O=function(){var e,n=h.currentTime(),t=null,o=En(c);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,s=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>i)&&!d.has(i)||n>=i&&n<=s)&&(t=i,d.set(i,!0),v.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){h.currentTime(t+.4)},100))},l=!1,e.next=7,fetch(n);case 7:return a=e.sent,e.next=10,a.json();case 10:s=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",s),u=s.avails,c=[],h=q(o),w=h.controlBar.progressControl,k=w.seekBar.el(),u.map(function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(l=!0),c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===r?void 0:r[0])||[]})}),!l&&r&&(h.currentTime(r),I()),null!=c&&c.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),window.adsQueueList=c),console.log(c,"data"),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",k.appendChild(i)}}),h.on("timeupdate",le(function(){var e=h.currentTime();if(e!==f){f=e;for(var n=!1,t=function(){var t=c[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&d.set(r,!0),mn.disable(),p&&p.classList.add("vjs-hidden"),m&&(m.el().style.pointerEvents="none",m.el().classList.add("vjs-hidden")),g&&(g.el().style.pointerEvents="none",g.el().classList.add("vjs-hidden")),w.el().style.visibility="hidden";for(var s=e-r,u=0,f=0,y=0;y<l.length;y++){var h,k=null==l||null===(h=l[y])||void 0===h?void 0:h.durationInSeconds;if(s<u+k){f=y;break}u+=k}l[f];var O=Math.max(0,i-s),j=Math.round(O);P.style.display="block",A.textContent="".concat(f+1," of ").concat(l.length," • ").concat(b(j));var T=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});T.push.apply(T,de(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&T.push(null==t?void 0:t.podSlotImpressionBeacon),S(e,t,T,f,o,I),"break"}v.delete(r)},o=0;o<c.length;o++){if("break"===t())break}n||(P.style.display="none",w.el().style.visibility="visible",m&&(m.el().style.pointerEvents="auto",m.el().classList.remove("vjs-hidden")),g&&(g.el().style.pointerEvents="auto",g.el().classList.remove("vjs-hidden")),p&&p.classList.remove("vjs-hidden"),mn.enable())}},1e3)),null===(i=document)||void 0===i||i.addEventListener("keydown",function(e){mn.enabled&&"ArrowRight"==e.key&&(O(),y(o,10),e.stopPropagation())}),w.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",j),document.addEventListener("pointerup",T))}),(P=document.createElement("div")).className="ssai-ad-container",(E=document.createElement("div")).className="sponsored-adbox",(D=document.createElement("div")).className="sponsored-text",D.textContent="Sponsored Ad",E.append(D),(A=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",P.append(E),P.append(A),h.el().appendChild(P);case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),w=new Map;case 16:case"end":return e.stop()}},e)})),Bn.apply(this,arguments)}function Hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Fn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Hn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Hn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Qn=function(r,i,l,a){var s,u,v,p,m,y,g,h,O,I,j,T,P,E,D,A,x,C,L,R,N,M,_,U,V,B,H,F,Q,G,K,J,W,X,Y,$,Z,ee,ne=i.res,oe=void 0===ne?null:ne,re=i.sres,ie=void 0===re?null:re,le=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],se=(null===(s=oe)||void 0===s?void 0:s.contentType)||"video",ue=ae(null===(u=oe)||void 0===u||null===(v=u[se])||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.videoImageUrl)||ae(null===(m=oe)||void 0===m||null===(y=m[se])||void 0===y||null===(g=y.gist)||void 0===g||null===(h=g.imageGist)||void 0===h?void 0:h.r16x9),ce=(null===(O=oe)||void 0===O||null===(I=O[se])||void 0===I||null===(j=I.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,de=(null===(T=oe)||void 0===T||null===(P=T[se])||void 0===P||null===(E=P.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,ve=(null===(D=oe)||void 0===D||null===(A=D.ads)||void 0===A||null===(x=A.preRoll)||void 0===x||null===(C=x.adTags)||void 0===C||null===(L=C.web)||void 0===L?void 0:L.active)&&(null===(R=oe)||void 0===R||null===(N=R.ads)||void 0===N||null===(M=N.preRoll)||void 0===M||null===(_=M.adTags)||void 0===_||null===(U=_.web)||void 0===U?void 0:U.url),pe=(null===(V=oe=Fn(Fn({},oe),{},{audioAssetSource:null==l?void 0:l.audioAssetSource}))||void 0===V||null===(B=V[se])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(F=H.app_data)||void 0===F||null===(Q=F.appcmsMain)||void 0===Q||null===(G=Q.adsConfig)||void 0===G?void 0:G.vodAdSticherProvider)||!1,me=(null==l?void 0:l.latency)||6,ye=(null==l?void 0:l.skin_settings)||{},ge=(null==l?void 0:l.dvrConfig)||{enable:!1},he=(ee={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ye?void 0:ye.pictureInPictureToggle)||!1},playbackRates:null!=ye&&ye.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:ce},e(ee,"autoplay",null==l?void 0:l.autoplay),e(ee,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!ve),e(ee,"loop",(null==l?void 0:l.loop)||!1),e(ee,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(ee,"html5",Fn(Fn({dash:Fn(Fn(Fn({},!z.browser.IS_SAFARI&&{useTTML:!0}),(null==l?void 0:l.debugConfig)&&(null==l||null===(K=l.debugConfig)||void 0===K?void 0:K.enable)&&{debug:!0,logLevel:null!=l&&null!==(J=l.debugConfig)&&void 0!==J&&J.logLevel?null==l||null===(W=l.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:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Fn(Fn({liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==l||null===(X=l.customData)||void 0===X?void 0:X.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(Y=null==l?void 0:l.enableLowInitialPlaylist)||void 0===Y||Y}),debug:!0,nativeTextTracks:"Safari"==o()},0==(null==l||null===($=l.customData)||void 0===$?void 0:$.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(Z=l.customData)||void 0===Z?void 0:Z.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ee,"poster",ue),e(ee,"techOrder",le),e(ee,"chromecast",{requestCustomDataFn:function(e){var n,t,o=q(r),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,r,i,l,a,s,u,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,y,g,h,b,w,k,S;p.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==O?void 0:O.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);p.licenseUrl=I;var j=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=j}var T=(null==e||null===(o=e[f])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";p.contentType=T;var P=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=P;var E=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=E;var D=null==e||null===(u=e[f])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(oe,e,i);return Fn(Fn({},a),{},{convivaMetaData:Fn({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},Je.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,l,a=q(r),s=(null==a?void 0:a.currentSource())||{};!(null===(n=oe)||void 0===n||null===(t=n[se])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ee);if(!z.getPlayers()[r]){z.log.level("debug");var we=z(r,he,function(){var e=n(t.mark(function e(){var n,o,i,s,u,v,p,m,y,g,h,O,I,j,T,P,E,D,A,x,C,L,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(z.VERSION),console.log(z.getPlugins()),e.next=5,Ee(l,oe);case 5:if(O=null===(n=oe)||void 0===n||null===(o=n[se])||void 0===o||null===(i=o.liveDetails)||void 0===i?void 0:i.startOverTime,de&&a.resolve(Fn({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:oe}:{response:oe})),I={},null!=ge&&ge.enable&&ce&&(I.playFromBegining=ge.playFromBegining,I.playLive=ge.playLive,T=null==l||null===(j=l.epg)||void 0===j?void 0:j.programSubType,"linearchannel"===se?"LIVE"===(null==T?void 0:T.toUpperCase())&&fe(r,l):fe(r,l)),w(r,null==l?void 0:l.analyticsCb,I),ze(r,l),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),ce&&be(r,O),!ve||null!=l&&null!==(s=l.customData)&&void 0!==s&&s.disableAds||k(r,ve,oe),P=c(oe,r),console.log(P),null!=l&&l.nearestClusterUrl&&(P=S(P,l.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,Rn(r,oe);case 20:P=e.sent;case 21:P?d(r,P):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:oe}),f(r,"Incompatible / Missing Source")),((null===(u=oe)||void 0===u||null===(v=u[se])||void 0===v||null===(p=v.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=oe)||void 0===y||null===(g=y[se])||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0)&&(R=(null===(D=oe)||void 0===D||null===(A=D[se])||void 0===A||null===(x=A.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(C=oe)||void 0===C||null===(L=C[se])||void 0===L?void 0:L.closedCaptions),E=R.filter(function(e){return"VTT"===e.format}),te(r,E)),null!=l&&l.disableControls?b(r):We(r,Fn(Fn(Fn({},l),he),{},{liveVideo:de,isDvrEnabled:ce,res:oe,sres:ie})),vn(r,Fn(Fn(Fn({},l),he),{},{liveVideo:de}),a,{res:oe,sres:ie});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}},Gn={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function qn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Kn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var zn,Jn=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Wn(e);Qn(r,{res:i},e,{resolve:t,reject:o})},Wn=function(e){var n,t,o,r,i,l,a,s,u=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,d=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.url)||null,f=(null==e||null===(i=e.streamingInfo)||void 0===i?void 0:i.posterUrl)||null,p=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,y=null==e?void 0:e.token,g=O(y),h=null==g?void 0:g.site;return qn(qn({id:null==Gn?void 0:Gn[h]},!d&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:d,streamingInfo:{videoAssets:qn(qn({},m&&{drmProvider:m}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:qn({},f&&{videoImageUrl:f}),contentDetails:qn({},(null==p?void 0:p.length)>0&&{closedCaptions:de(p)})},ads:{preRoll:{adTags:{web:qn(qn({},v&&{active:!0}),v&&{url:v})}}}})};function Xn(e,n){return Yn.apply(this,arguments)}function Yn(){return(Yn=n(t.mark(function e(n,o){var r,i,l,a,s,u;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,i=o.reject,l=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,P();case 6:u=e.sent,I(l,u).then(function(e){var t,o,c,d;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(c=o.gist)||void 0===c?void 0:c.contentType,p(null==e?void 0:e.data);var v,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(d=n.watchHistory)&&void 0!==d&&d.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var m,y,g,h=on((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",l,null==n?void 0:n.siteOwner);if(h&&h.length)n.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",Qn(a,{res:f},n,{resolve:r,reject:i})}else j(l,u).then(function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"}).catch(function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))}).finally(function(){Qn(a,{res:f},n,{resolve:r,reject:i})});else Qn(a,{res:f},n,{resolve:r,reject:i})}).catch(function(e){T(e,a,i,l)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $n(e,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=n(t.mark(function e(n,o){var r,i,l,a,s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,i=o.reject,e.next=3,P();case 3:l=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,E(s,l).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Qn(a,{res:t},n,{resolve:r,reject:i})}).catch(function(e){T(e,a,i,videoId)});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function et(e,n){return nt.apply(this,arguments)}function nt(){return(nt=n(t.mark(function e(n,o){var r,i,l,a,s,u,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,l=o.reject,e.next=3,P();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,x.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,D(c,a).then(function(e){var t,o,r,u=e.data,d=e.data.seasons;C(d);var v=videoId||(null==d||null===(t=d[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.id);A(c,a),I(v,a).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,p(e.data),Qn(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:i,reject:l})}).catch(function(e){T(e,s,l,videoId)})}).catch(function(e){T(e,s,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(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):tt(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function rt(){return{loadVideoInstantly:L,onTimeUpdate:J,getVideoDuration:W,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark(function n(o,r){var i,l,a,s,u,c,d,v,f,p,m,y,g,h,b,w,k,S,O,j,P,E,D;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!M(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(m=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,g=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,h=null==e?void 0:e.videoId,b=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,w=(null==e?void 0:e.streamingInfo)||!1,window.videoId=h,k=null==e?void 0:e.token,!F(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",k),Q().set(null==e?void 0:e.refreshToken),k&&!G(k)){n.next=16;break}return r({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 16:zn=JSON.parse(atob(k.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(a=zn)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=zn)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=zn)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=zn)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,S=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(d=e.series)&&void 0!==d&&d.enable?null:null==e?void 0:e.chromecastReceiverId,O=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,(j=null==e?void 0:e.errors)&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,ue(null==e||null===(f=e.customData)||void 0===f?void 0:f.localisation),H.set(e.apiBaseUrl),null!=e&&e.skin&&!se(e.skin)||(e.skin="VL_ONE"),n.next=33,Te(e);case 33:O&&pe("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then(function(){return K(O)}).catch(function(e){}),(P=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(S)))&&P.addEventListener("contextmenu",function(e){return e.preventDefault()}),m?(D={directPlaybackUrl:m,id:E="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?I(E,k).then(function(n){var t=(null==n?void 0:n.data)||{};Qn(S,{res:ot(ot({},t),D)},e,{resolve:o,reject:r})}).catch(function(e){T(e,S,r,E)}):Qn(S,{res:D},e,{resolve:o,reject:r})):w?Jn(e,{resolve:o,reject:r}):b?et(e,{resolve:o,reject:r}):g?$n(e,{resolve:o,reject:r}):Xn(e,{resolve:o,reject:r});case 37:case"end":return n.stop()}},n)}));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:re,skip:y,getPlayer:q,play:R,pause:N,detectBrowser:o,rewind:g,loadVideo:d,seekToTimeStamp:Y,isPlayerInitialised:M,load:_,authenticateLC:U,dispose:V,enableCaptions:oe,disableCaptions:ne,getCaptions:ee,playSelectedResolution:ie,getSource:c,setVolume:ye,getVolume:ge,disableControls:b,setPlaybackSpeed:$,getEntitlementData:B,adsQueuePointManager:Un,getSsaiEvents:jn,playerEvents:Z}}export{rt as V,fn as i,Vn as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{S as n,b as r,e as i}from"./generic-63e4557c.js";import{s as a}from"./autoNextVideo-cfe8aa87.js";import{e as o}from"./icons-c139587c.js";import{p as l,t as u}from"./skin-16f83185.js";import s from"@babel/runtime/helpers/typeof";import c from"video.js";import d from"@babel/runtime/helpers/asyncToGenerator";import p from"@babel/runtime/regenerator";import m from"@babel/runtime/helpers/defineProperty";import v from"@babel/runtime/helpers/slicedToArray";var f,g,h,b,y=[],x=!1,w=function(i,a){var u;if(x=!1,null!=a&&null!==(u=a.series)&&void 0!==u&&u.enable){var s;y=[];var c=r();null==c||c.map(function(t){var n;return(n=y).push.apply(n,e(t.episodes))}),null==a||null===(s=a.series)||void 0===s||s.cb}else{var d,p;y=(null==a||null===(d=a.relatedVideos)||void 0===d?void 0:d.content)||[],null==a||null===(p=a.relatedVideos)||void 0===p||p.cb}var m=t(i);m.on("timeupdate",function(){var e,t;if(!x){var r=Math.floor(m.currentTime()),i=m.duration(),a=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=y)||void 0===t?void 0:t.length)-1?a&&(a.style.visibility="visible"):a&&(a.style.visibility="hidden")}});var v,f=y.filter(function(e,t){return t==n()});if((null==f?void 0:f.length)>0)if(null!==(v=document.getElementsByClassName("next-ep-preview"))&&void 0!==v&&v[0]){var g,h,b,w,A,N,k,j,C,O,T,I;(null===(g=document.getElementsByClassName("next-ep-preview"))||void 0===g?void 0:g[0]).style.visibility="hidden";var B=null===(h=document.getElementsByClassName("next-ep-title"))||void 0===h?void 0:h[0],L=null===(b=document.getElementsByClassName("next-ep-img"))||void 0===b?void 0:b[0],S=null===(w=document.getElementsByClassName("next-ep-content"))||void 0===w?void 0:w[0],M=null===(A=f[0])||void 0===A?void 0:A.title;(null===(N=M)||void 0===N?void 0:N.length)>60&&(M=M.substr(0,60)+"..."),B.textContent="".concat(M),L.src=(null===(k=f[0])||void 0===k||null===(j=k.gist)||void 0===j||null===(C=j.imageGist)||void 0===C?void 0:C.r16x9)||(null==f||null===(O=f[0])||void 0===O?void 0:O.img)||(null===(T=window)||void 0===T||null===(I=T.customData)||void 0===I?void 0:I.fallbackImage),S.onclick=function(){return E(i)}}else{var P,R,D,$,X,F,U,_,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var G=document.createElement("div");G.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var V=document.createElement("div");V.className="next-ep-close",V.onclick=function(){q.style.visibility="hidden",x=!0},V.appendChild(l(o())),G.append(W),G.append(V);var z=null===(P=f[0])||void 0===P?void 0:P.title,H=document.createElement("img");H.className="next-ep-img",H.src=(null===(R=f[0])||void 0===R||null===(D=R.gist)||void 0===D||null===($=D.imageGist)||void 0===$?void 0:$.r16x9)||(null==f||null===(X=f[0])||void 0===X?void 0:X.img)||(null===(F=window)||void 0===F||null===(U=F.customData)||void 0===U?void 0:U.fallbackImage);var Q=document.createElement("div");Q.className="next-ep-title",(null===(_=z)||void 0===_?void 0:_.length)>60&&(z=z.substr(0,60)+"..."),Q.textContent="".concat(z);var Y=document.createElement("div");Y.className="next-ep-content",Y.append(H),Y.append(Q),Y.onclick=function(){return E(i)},q.append(G),q.append(Y)}},E=function(e,r){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=n();a(l,e,y)}};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}f={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},g=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===s(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},h=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},b=function e(t){return"HTML"!==t.nodeName&&"static"===h(t)("position")?e(t.offsetParent):t},c.registerPlugin("thumbnails",function(e){var t,n,r,i,a,o,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=g({},f,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",g(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",function(e){o=i.duration()}),i.on("loadedmetadata",function(e){o=i.duration()}),(a=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=b(a.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=b(a.el()).getBoundingClientRect().left+v,i=Math.floor((s-a.el().offsetLeft)/a.width()*o),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&g(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=h(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},a.on("mousemove",l),a.on("touchmove",l),a.on("pointerdown",function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)}),u=function(e){t.style.left="-1000px"},a.on("mouseout",u),a.on("touchcancel",u),a.on("touchend",u),i.on("userinactive",u)});var k="my-player";function j(e){var t=e.split("\n"),n=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))}),n.push(r)}}),n}function C(){return(C=d(p.mark(function e(t){var n,r,i,a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,k,j,C;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=v(a,2),l=o[0],u=o[1],s=i.width/u,c=i.height/l,d=[],m=0;m<l;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,f*s,m*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=v(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(j=k.appcmsMain)||void 0===j||null===(C=j.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function O(e,t){return T.apply(this,arguments)}function T(){return(T=d(p.mark(function e(t,n){var r,i;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",j(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function I(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=t(k);if(i&&a){var o=i.getBoundingClientRect(),l=(e.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*a.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return C.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function B(e){return L.apply(this,arguments)}function L(){return(L=d(p.mark(function e(t){var n,r,i,a;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),i=v(r,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);n[s]=N(N({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},m(u,"left","-60px"),m(u,"border","1px solid transparent"),m(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",u(function(e){return I(e,n,r)},500)),null==(a=document.querySelector(".vjs-progress-control.vjs-control"))||a.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",u(function(e){return I(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var S=function(){var e=d(p.mark(function e(t,n){var r,i,a,o,l,u,s,c;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(s=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach(function(e){var t=e.split("="),n=v(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function M(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function P(e,t){return R.apply(this,arguments)}function R(){return(R=d(p.mark(function e(n,r){var a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,P,R,X,F,U,_,q,G,W,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,me,ve;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,a=t(r),o=n.split("/"),l=o.findIndex(function(e){return"dash"===e.toLowerCase()}),u=M(-1!==l?o.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return m=e.sent,e.next=11,m.text();case 11:f=e.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==a?void 0:a.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],P=S.getAttribute("value"),R=null==P?void 0:P.split("x"),X=v(R,2),F=X[0],U=X[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),q=(_?B/_:B)/(F*U),G=L.getAttribute("id"),W=Math.round(b/q),V=Math.ceil(W/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(V))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<V;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:q,layout:P,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",G)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=v(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),ae=N.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/oe),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=D(ce),w=0;w<se;w++)ve=me?$(me,w+de):ce,pe.push({duration:oe,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function D(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function $(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function X(e){return F.apply(this,arguments)}function F(){return(F=d(p.mark(function e(n){var r,i,a,o,l,u,s,c,d,m,v,f,g,h,b,y;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(a=i.player)||void 0===a?void 0:a.getSource():c,null===(o=c)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,O(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return m=(null==d?void 0:d[0])||null,v=m.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,S(f,v);case 12:return g=e.sent,e.next=15,B(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,P(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,B(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function U(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var a=document.createElement("div");a.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",a.append(o),r.el().appendChild(a),r.on("useractive",function(){a.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||a.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}}export{w as a,U as b,X as i};
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{S as n,b as r,e as i}from"./generic-dd89c778.js";import{s as a}from"./autoNextVideo-068e496c.js";import{e as o}from"./icons-c139587c.js";import{p as l,t as u}from"./skin-16f83185.js";import s from"@babel/runtime/helpers/typeof";import c from"video.js";import d from"@babel/runtime/helpers/asyncToGenerator";import p from"@babel/runtime/regenerator";import m from"@babel/runtime/helpers/defineProperty";import v from"@babel/runtime/helpers/slicedToArray";var f,g,h,b,y=[],x=!1,w=function(i,a){var u;if(x=!1,null!=a&&null!==(u=a.series)&&void 0!==u&&u.enable){var s;y=[];var c=r();null==c||c.map(function(t){var n;return(n=y).push.apply(n,e(t.episodes))}),null==a||null===(s=a.series)||void 0===s||s.cb}else{var d,p;y=(null==a||null===(d=a.relatedVideos)||void 0===d?void 0:d.content)||[],null==a||null===(p=a.relatedVideos)||void 0===p||p.cb}var m=t(i);m.on("timeupdate",function(){var e,t;if(!x){var r=Math.floor(m.currentTime()),i=m.duration(),a=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=y)||void 0===t?void 0:t.length)-1?a&&(a.style.visibility="visible"):a&&(a.style.visibility="hidden")}});var v,f=y.filter(function(e,t){return t==n()});if((null==f?void 0:f.length)>0)if(null!==(v=document.getElementsByClassName("next-ep-preview"))&&void 0!==v&&v[0]){var g,h,b,w,A,N,k,j,C,O,T,I;(null===(g=document.getElementsByClassName("next-ep-preview"))||void 0===g?void 0:g[0]).style.visibility="hidden";var B=null===(h=document.getElementsByClassName("next-ep-title"))||void 0===h?void 0:h[0],L=null===(b=document.getElementsByClassName("next-ep-img"))||void 0===b?void 0:b[0],S=null===(w=document.getElementsByClassName("next-ep-content"))||void 0===w?void 0:w[0],M=null===(A=f[0])||void 0===A?void 0:A.title;(null===(N=M)||void 0===N?void 0:N.length)>60&&(M=M.substr(0,60)+"..."),B.textContent="".concat(M),L.src=(null===(k=f[0])||void 0===k||null===(j=k.gist)||void 0===j||null===(C=j.imageGist)||void 0===C?void 0:C.r16x9)||(null==f||null===(O=f[0])||void 0===O?void 0:O.img)||(null===(T=window)||void 0===T||null===(I=T.customData)||void 0===I?void 0:I.fallbackImage),S.onclick=function(){return E(i)}}else{var P,R,D,$,X,F,U,_,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var G=document.createElement("div");G.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var V=document.createElement("div");V.className="next-ep-close",V.onclick=function(){q.style.visibility="hidden",x=!0},V.appendChild(l(o())),G.append(W),G.append(V);var z=null===(P=f[0])||void 0===P?void 0:P.title,H=document.createElement("img");H.className="next-ep-img",H.src=(null===(R=f[0])||void 0===R||null===(D=R.gist)||void 0===D||null===($=D.imageGist)||void 0===$?void 0:$.r16x9)||(null==f||null===(X=f[0])||void 0===X?void 0:X.img)||(null===(F=window)||void 0===F||null===(U=F.customData)||void 0===U?void 0:U.fallbackImage);var Q=document.createElement("div");Q.className="next-ep-title",(null===(_=z)||void 0===_?void 0:_.length)>60&&(z=z.substr(0,60)+"..."),Q.textContent="".concat(z);var Y=document.createElement("div");Y.className="next-ep-content",Y.append(H),Y.append(Q),Y.onclick=function(){return E(i)},q.append(G),q.append(Y)}},E=function(e,r){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=n();a(l,e,y)}};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}f={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},g=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===s(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},h=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},b=function e(t){return"HTML"!==t.nodeName&&"static"===h(t)("position")?e(t.offsetParent):t},c.registerPlugin("thumbnails",function(e){var t,n,r,i,a,o,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=g({},f,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",g(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",function(e){o=i.duration()}),i.on("loadedmetadata",function(e){o=i.duration()}),(a=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=b(a.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=b(a.el()).getBoundingClientRect().left+v,i=Math.floor((s-a.el().offsetLeft)/a.width()*o),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&g(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=h(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},a.on("mousemove",l),a.on("touchmove",l),a.on("pointerdown",function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)}),u=function(e){t.style.left="-1000px"},a.on("mouseout",u),a.on("touchcancel",u),a.on("touchend",u),i.on("userinactive",u)});var k="my-player";function j(e){var t=e.split("\n"),n=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))}),n.push(r)}}),n}function C(){return(C=d(p.mark(function e(t){var n,r,i,a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,k,j,C;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=v(a,2),l=o[0],u=o[1],s=i.width/u,c=i.height/l,d=[],m=0;m<l;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,f*s,m*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=v(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(j=k.appcmsMain)||void 0===j||null===(C=j.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function O(e,t){return T.apply(this,arguments)}function T(){return(T=d(p.mark(function e(t,n){var r,i;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",j(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function I(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=t(k);if(i&&a){var o=i.getBoundingClientRect(),l=(e.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*a.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return C.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function B(e){return L.apply(this,arguments)}function L(){return(L=d(p.mark(function e(t){var n,r,i,a;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),i=v(r,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);n[s]=N(N({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},m(u,"left","-60px"),m(u,"border","1px solid transparent"),m(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",u(function(e){return I(e,n,r)},500)),null==(a=document.querySelector(".vjs-progress-control.vjs-control"))||a.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",u(function(e){return I(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var S=function(){var e=d(p.mark(function e(t,n){var r,i,a,o,l,u,s,c;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(s=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach(function(e){var t=e.split("="),n=v(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function M(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function P(e,t){return R.apply(this,arguments)}function R(){return(R=d(p.mark(function e(n,r){var a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,P,R,X,F,U,_,q,G,W,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,me,ve;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,a=t(r),o=n.split("/"),l=o.findIndex(function(e){return"dash"===e.toLowerCase()}),u=M(-1!==l?o.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return m=e.sent,e.next=11,m.text();case 11:f=e.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==a?void 0:a.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],P=S.getAttribute("value"),R=null==P?void 0:P.split("x"),X=v(R,2),F=X[0],U=X[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),q=(_?B/_:B)/(F*U),G=L.getAttribute("id"),W=Math.round(b/q),V=Math.ceil(W/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(V))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<V;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:q,layout:P,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",G)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=v(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),ae=N.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/oe),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=D(ce),w=0;w<se;w++)ve=me?$(me,w+de):ce,pe.push({duration:oe,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function D(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function $(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function X(e){return F.apply(this,arguments)}function F(){return(F=d(p.mark(function e(n){var r,i,a,o,l,u,s,c,d,m,v,f,g,h,b,y;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(a=i.player)||void 0===a?void 0:a.getSource():c,null===(o=c)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,O(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return m=(null==d?void 0:d[0])||null,v=m.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,S(f,v);case 12:return g=e.sent,e.next=15,B(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,P(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,B(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function U(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var a=document.createElement("div");a.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",a.append(o),r.el().appendChild(a),r.on("useractive",function(){a.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||a.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}}export{w as a,U as b,X as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./player_instance-34118a5b.js";import{w as t,s as n}from"./icons-c139587c.js";function o(o,l){var u=l.dvrConfig,s=l.videoId,d=(l.userId,(null==u?void 0:u.buttonConfig)||{}),v=d.watchLive,f=d.resume,b=d.startFromBegining,m=(null==u?void 0:u.programs)||[],g=e(o),y=(null==u?void 0:u.playLive)||!1;if((null==u?void 0:u.playFromBegining)||!1)!function(e){e.one("canplay",function(){e.seekable()&&(e.currentTime(e.seekable().start(0)),e.play())})}(g);else if(y)!function(e){e.one("canplay",function(){e.seekable()&&(e.currentTime(e.seekable().end(0)),e.play())})}(g);else{var h=document.querySelector(".vjs-dvr-btn-overlay");h||((h=document.createElement("div")).className="vjs-dvr-btn-overlay"),g.el().appendChild(h);var p=!!i(s);h.innerHTML=function(e,o){var a=(null==e?void 0:e.buttonConfig)||{},i=a.watchLive,r=a.resume,c=a.startFromBegining,l='<button id="watch-live-btn">'.concat(t()," ").concat((null==i?void 0:i.text)||"Watch Live","</button>"),u='<button id="resume-btn">'.concat(t()," ").concat((null==r?void 0:r.text)||"Resume","</button>"),s='<button id="watch-begining-btn">\n '.concat(n()," ").concat((null==c?void 0:c.text)||"Start From Begining","\n </button>"),d=o?u:l;return'<div class="dvr-button">'.concat(d," ").concat(s,"</div>")}(u,p),g.pause(),g.bigPlayButton.hide(),g.controlBar.hide(),a("watch-live-btn",v,function(){g&&g.seekable()&&g.currentTime(g.seekable().end(0)),r(g,h),v&&"function"==typeof v.cb&&(null==v||v.cb())}),a("resume-btn",f,function(){if(g&&g.seekable()){var e=i(s),t=Math.min(e,g.seekable().end(0));g.currentTime(t)}r(g,h),f&&"function"==typeof f.cb&&(null==f||f.cb())}),a("watch-begining-btn",b,function(){var e=g.seekable();if(e&&e.length>0){var t=c(m,e);g.currentTime(t)}r(g,h),b&&"function"==typeof b.cb&&(null==b||b.cb())})}!function(e,t){var n=e.currentTime(),o=!1;e.on("seeking",function(){o=!0}),e.on("seeked",function(){o=!1,n=e.currentTime()}),e.on("timeupdate",function(){if(!o){var a=e.currentTime();if(a-n>=30&&(!function(e,t,n){sessionStorage.setItem("lastWatchedPosition-".concat(e),n.toFixed(2))}(t,0,a),n=a),e.liveTracker){var i=e.liveTracker.atLiveEdge(),r=e.controlBar.getChild("SeekToLive");i?null==r||r.show():null==r||r.hide()}}})}(g,s)}function a(e,t,n){var o,a,i=document.getElementById(e);i&&(a=t,(o=i)&&(o.style.color="".concat((null==a?void 0:a.textColor)||"#000"),o.style.backgroundColor="".concat((null==a?void 0:a.backGroundColor)||"#DCF95B")),i.addEventListener("click",n))}function i(e,t){return sessionStorage.getItem("lastWatchedPosition-".concat(e))||0}function r(e,t){e.play(),e.bigPlayButton.show(),e.controlBar.show(),t.style.display="none"}function c(e,t){var n=new Date,o=e.find(function(e){var t=new Date(e.formatted_startdate),o=new Date(e.formatted_enddate);return n>=t&&n<o}),a=t.start(0),i=a;if(null!=o&&o.formatted_startdate){var r=t.end(t.length-1)-a;i=a+(new Date(o.formatted_startdate).getTime()-new Date(n-1e3*r).getTime())/1e3}return i}export{o as a,c as g};
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-
|
|
1
|
+
import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-dd89c778.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-710a5238.js";import"./util-28923483.js";import"./captions-b619441b.js";import"./resolution-62be852a.js";import"./skin-16f83185.js";import"./localisation-0bf399a1.js";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"./index-a012aae4.js";import"./icons-c139587c.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{h as s,e as i,i as l}from"./icons-c139587c.js";import{I as c,F as m}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{h as s,e as i,i as l}from"./icons-c139587c.js";import{I as c,F as m}from"./generic-dd89c778.js";import{e as d}from"./skin-16f83185.js";import{g as p}from"./player_instance-34118a5b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-b619441b.js";import"@babel/runtime/helpers/toConsumableArray";function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var h=n.getComponent("Component"),v=function(){a(g,h);var v,f,y=(v=g,f=u(),function(){var e,t=o(v);if(f){var a=o(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function g(t){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(a=y.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.streams=r.streams,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a}return t(g,[{key:"createEl",value:function(){var e=n.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=n.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return n.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-1fb5149a.js").then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=n.dom.createEl("div",{className:"stream-container hidden"});n.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=t.classList)&&void 0!==a&&a.contains("hidden")?(d(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var a=document.getElementById(this.playerId);if(a){var r=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(r,"px"),a.style.overflow="hidden",n.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),r=n.dom.createEl("div",{className:"stream-selector-head"}),o=n.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),a.classList.remove("open"),e.style.right="-350px"};for(var s=n.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=n.dom.createEl("div",{className:"stream-selector-content"}),u=n.dom.createEl("div",{className:"stream-tray"}),h=function(e){var a,r=n.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(r.classList.add("selected"),r.style.border="4px solid #D2393B"),r.onclick=function(){for(var a=n.dom.$$(".stream"),o=0;o<a.length;o++)a[o].style.border="none",a[o].classList.remove("selected");r.classList.add("selected"),r.style.border="4px solid #D2393B",c(t.playerId,t.streams[e].id).then(function(e){m(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},r.style.backgroundImage="url(".concat(t.streams[e].img,")");var o=document.createElement("img");o.className="stream-thumbnail-image",o.src="".concat(null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img),o.alt="No Thumbnail Available",r.append(o),n.dom.appendContent(u,r),n.dom.appendContent(d,u)},v=0;v<this.streams.length;v++)h(v);n.dom.appendContent(r,o),n.dom.appendContent(r,s),n.dom.appendContent(e,r),n.dom.appendContent(e,d),p(this.playerId).on("fullscreenchange",function(){var a=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(a,"px")})}}]),g}();export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import s from"video.js";import{h as n,e as i,i as l}from"./icons-c139587c.js";import{I as c,F as m}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import s from"video.js";import{h as n,e as i,i as l}from"./icons-c139587c.js";import{I as c,F as m}from"./generic-dd89c778.js";import{e as d,s as p,g as u}from"./skin-16f83185.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./player_instance-34118a5b.js";import"js-cookie";import"ua-parser-js";import"./captions-b619441b.js";import"@babel/runtime/helpers/toConsumableArray";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var h=s.getComponent("Component"),f=function(){a(g,h);var f,y,b=(f=g,y=v(),function(){var e,t=o(f);if(y){var a=o(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function g(t){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(a=b.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.streams=r.streams,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a}return t(g,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(n())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-b7cec0cf.js").then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),a=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=a.classList)&&void 0!==r&&r.contains("hidden")?(d(),a.classList.remove("hidden"),t.classList.add("open"),p(e.playerId,a)):(a.classList.add("hidden"),t.classList.remove("open"))};var r=document.getElementById(this.playerId);if(r){var o=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);a.style.height="".concat(o,"px"),r.style.overflow="hidden",s.dom.appendContent(t,a),this.addFunctionality(a)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),r=s.dom.createEl("div",{className:"stream-selector-head"}),o=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),a.classList.remove("open")};for(var n=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),p=s.dom.createEl("div",{className:"stream-tray"}),v=parseInt(sessionStorage.getItem("selectedStreamIndex")||0),h=function(e){var a,r,o,n=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});v==e&&(n.classList.add("selected"),n.style.border="2px solid #D2393B"),n.onclick=function(){for(var a=s.dom.$$(".stream"),r=0;r<a.length;r++)a[r].style.border="none",a[r].classList.remove("selected");n.classList.add("selected"),n.style.border="2px solid #D2393B",c(t.playerId,t.streams[e].id).then(function(e){m(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},n.style.backgroundImage="url(".concat(t.streams[e].img,")");var i=document.createElement("img");i.className="stream-thumbnail-image",i.src="".concat((null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img)||(null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o?void 0:o.fallbackImage)),n.append(i),s.dom.appendContent(p,n),s.dom.appendContent(d,p)},f=0;f<this.streams.length;f++)h(f);s.dom.appendContent(r,o),s.dom.appendContent(r,n),s.dom.appendContent(e,r),s.dom.appendContent(e,d),u(this.playerId,e)}}]),g}();export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import r from"video.js";import{P as l}from"./icons-c139587c.js";import{I as s,j as a}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import r from"video.js";import{P as l}from"./icons-c139587c.js";import{I as s,j as a}from"./generic-dd89c778.js";import{d}from"./skin-16f83185.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./player_instance-34118a5b.js";import"js-cookie";import"ua-parser-js";import"./captions-b619441b.js";import"@babel/runtime/helpers/toConsumableArray";function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var u=r.getComponent("Component"),c=function(){n(c,u);var s,a,d=(s=c,a=p(),function(){var e,t=i(s);if(a){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function c(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,c),(n=d.call(this,t,o)).playerId=o.playerId,n.seriesData=o.sres,n.currentVideoData=o.res,n.initialiseStructure(),n.loadCSS(),n}return t(c,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"play-next"}),t=r.dom.createEl("div",{className:"play-next-icon",innerHTML:"".concat(l(window.controlsColor?window.controlsColor:"white"))});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./nextEpisodeButton-a1556cdf.js").then(function(e){var t=document.createElement("style");t.id="multicam",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"next-eps nextepisode-hidden"}),n=r.dom.createEl("div",{className:"next",innerHTML:"Next Episode"}),o=r.dom.createEl("div",{className:"nextep-meta-details next-margin"}),i=r.dom.createEl("div",{className:"next-eps-image"}),l=r.dom.createEl("div",{className:"next-eps-description"});r.dom.appendContent(o,i),r.dom.appendContent(o,l),r.dom.appendContent(t,n),r.dom.appendContent(t,o),this.toggleContentOnHover(e,t),r.dom.appendContent(e,t)}},{key:"toggleContentOnHover",value:function(e,t){e.addEventListener("mouseover",function(){r.dom.removeClass(t,"nextepisode-hidden")}),t.addEventListener("mouseover",function(){r.dom.removeClass(t,"nextepisode-hidden")}),e.addEventListener("mouseout",function(){r.dom.addClass(t,"nextepisode-hidden")}),t.addEventListener("mouseout",function(){r.dom.addClass(t,"nextepisode-hidden")})}}]),c}(),m=function(e,t){var n=v(e,t.video.gist.id),o=h(e[n],t.video.gist.id),i=f(e[n],o);x(i.nextEp)},v=function(e,t){for(var n=-1,o=0;o<e.length;o++)for(var i=0;i<e[o].episodes.length;i++)if(e[o].episodes[i].id===t){n=o;break}return n},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;if(!(e&&t>=0))return{prevEp:null,nextEp:null};var n=e.episodes.length,o=t-1>=0?t-1:n-1,i=(t+1)%n,r=n>1?e.episodes[o]:null,l=n>1?e.episodes[i]:null;return o===i&&(0===o?l=null:r=null),{prevEp:r,nextEp:l,prevEpIdx:o,nextEpIdx:i}},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=null;return e?(e.episodes.forEach(function(e,o){e.gist.id===t&&(n=o)}),n):null},x=function(e){var t,n;r.dom.$(".next-eps"),r.dom.$(".play-next").onclick=function(){var t;s("my-player",null==e||null===(t=e.gist)||void 0===t?void 0:t.id).then(function(e){a(e.response)})};var o=r.dom.$(".next-eps-image"),i=d("<img src=".concat(null==e||null===(t=e.gist)||void 0===t?void 0:t.videoImageUrl," />")),l=null==i?void 0:i.firstChild;null==o||o.append(l);for(var p=r.dom.$(".next-eps-description"),u=d("<div class='next-eps-title'>".concat(null==e?void 0:e.title,"</div>\n <div class='next-eps-description-details'>").concat(null==e||null===(n=e.gist)||void 0===n?void 0:n.description,"</div>"));null!=u&&u.firstChild;)null==p||p.appendChild(u.firstChild)};export{c as default,m as initaliseFunctionality};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/inherits";import l from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as s,e as r}from"./icons-c139587c.js";import{I as c,U as d}from"./generic-dd89c778.js";import{a as p}from"./autoNextVideo-068e496c.js";import{e as m}from"./skin-16f83185.js";import{g as u}from"./player_instance-34118a5b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-b619441b.js";import"./util-28923483.js";import"@babel/runtime/helpers/typeof";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var y=a.getComponent("Component"),h=function(){o(g,y);var h,f,b=(h=g,f=v(),function(){var e,t=i(h);if(f){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function g(e){var n,o,l,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,g),(i=b.call(this,e,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=null==a||null===(n=a.playlist)||void 0===n?void 0:n.content,i.cb=(null==a||null===(o=a.playlist)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==a||null===(l=a.playlist)||void 0===l?void 0:l.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&p({playerId:i.playerId,content:i.videos,cb:i.cb}),i}return n(g,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./playlist-7ecf432a.js").then(function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(m(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var o=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),a.dom.appendContent(e,t),n.style.overflow="hidden",this.addFunctionality(t)}}},{key:"addFunctionality",value:function(t){var n=this,o=this.el(),l=a.dom.createEl("div",{className:"playlist-selector-head"}),i=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r())});i.onclick=function(){t.classList.add("hidden"),o.classList.remove("open"),t.style.right="-350px"};for(var s=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),p=a.dom.createEl("div",{className:"playlist-selector-content"}),m=function(t){var o,l,i=a.dom.createEl("div",{className:"playlist-container"}),s=a.dom.createEl("div",{className:"playlist-section",index:t}),r=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(o=n.videos[t])||void 0===o?void 0:o.title)||"")}),m=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(s,r),a.dom.appendContent(s,m),a.dom.appendContent(i,s),a.dom.appendContent(p,i);var u=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),v=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.description)||"")}),y=a.dom.createEl("div",{className:"playlist-image"});y.style.backgroundImage="url(".concat(n.videos[t].img,")"),a.dom.appendContent(u,y),a.dom.appendContent(u,v),a.dom.appendContent(i,u),a.dom.appendContent(p,i),u.onclick=function(e){e.stopPropagation(),d(t+1),c(n.playerId,n.videos[t].id).then(function(e){null!=n&&n.cb&&n.cb(e)}).catch(function(e){null!=n&&n.cb&&n.cb(e)})},s.onclick=function(t){var n,o,l,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(i.style.backgroundColor="#0000007d",null==s||null===(o=s.classList)||void 0===o||o.remove("hidden")):(null==s||null===(l=s.classList)||void 0===l||l.add("hidden"),i.style.backgroundColor="unset")}},v=0;v<this.videos.length;v++)m(v);a.dom.appendContent(l,i),a.dom.appendContent(l,s),a.dom.appendContent(t,l),a.dom.appendContent(t,p),u(this.playerId).on("fullscreenchange",function(){var e=document.getElementById(n.playerId);if(e){var o=window.getComputedStyle(e,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px")}})}}]),g}();export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/classCallCheck";import i from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/assertThisInitialized";import s from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/regenerator";import c from"video.js";import{V as d,G as p,I as u,j as v,F as m}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/classCallCheck";import i from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/assertThisInitialized";import s from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/regenerator";import c from"video.js";import{V as d,G as p,I as u,j as v,F as m}from"./generic-dd89c778.js";import{E as f}from"./icons-c139587c.js";import{d as h}from"./skin-16f83185.js";import"axios";import"./player_instance-34118a5b.js";import"js-cookie";import"ua-parser-js";import"./captions-b619441b.js";import"@babel/runtime/helpers/toConsumableArray";var g=function(e){document.getElementById("".concat(e)).classList.add("vjs-waiting")};function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function(){return!!e})()}var y,C=c.getComponent("Component"),w=function(){s(d,C);var e,l,c=(e=d,l=b(),function(){var t,i=a(e);if(l){var n=a(this).constructor;t=Reflect.construct(i,arguments,n)}else t=i.apply(this,arguments);return r(this,t)});function d(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,d),i=c.call(this,e,s),o(n(i),"seriesData",[]),i.seriesData=s.seriesData,y=s.playerId,j(i.el(),i.seriesData),i.loadCSS(),i}return i(d,[{key:"createEl",value:function(){var e=document.createElement("div");return e.classList.add("vjs-season-list"),e}},{key:"loadCSS",value:function(){import("./series-041152aa.js").then(function(e){var t=document.createElement("style");t.id="series",t.append("".concat(e.default)),document.head.appendChild(t)})}}]),d}();function L(){return(L=e(l.mark(function e(t,i,n,s){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:p(y),g(y),u(y,i).then(function(e){v(e.response),m(y)});case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function k(e,t,i,n){var s=document.getElementById("season-list"),r=document.getElementById("episode-list"),a=document.getElementById("episode-container");e.id;for(var o=e.episodes.map(function(e,t){return'\n <div id="episode-wrapper" class="episode-wrapper">\n <div class="episode-title" id="episode-title">\n <div class="details-wrapper">\n <div id="title-wrapper" class="title-wrapper">'.concat(t+1," ").concat(e.title,' </div>\n <div class="progress-bar-div">\n <div id="progress-div" class="progress-div"></div>\n </div>\n </div>\n <div class="meta-details">\n <div class="episode-image lazy" style="width:124px; height: 70px;">\n <img src=').concat(e.gist.videoImageUrl,' alt="').concat(e.title,'\'s cover"></img>\n </div>\n <div class="description-wrapper">').concat(e.gist.description,"</div>\n </div>\n </div>\n </div>")}).join("");null!=a&&a.firstChild;)a.removeChild(a.firstChild);for(var l=h(o);null!=l&&l.firstChild;)a.appendChild(l.firstChild);!function(e){d(e).then(function(e){var t=e.data,i=document.querySelectorAll("#progress-div");i&&t.map(function(e,t){e&&e.watchedPercentage&&i[t]&&(i[t].style.width=e.watchedPercentage+"px")})}).catch(function(e){})}(n),s.classList.toggle("hide-container"),r.classList.toggle("hide-container");var c=document.querySelectorAll(".details-wrapper"),p=document.querySelectorAll("#episode-title"),u=document.querySelectorAll(".meta-details"),v=document.querySelector("#episodes-back-btn"),m=e.id,f=e.episodes;v.addEventListener("click",function(){return function(e,t){e.classList.remove("hide-container"),t.classList.add("hide-container")}(s,r)});for(var g=function(t){c[t].addEventListener("click",function(){return function(e,t,i){var n=t.querySelector(".meta-details");t.classList.toggle("episode-active"),n.classList.toggle("metadetails-active"),i.forEach(function(t,n){n!==e&&(i[n].classList.remove("episode-active"),i[n].querySelector(".meta-details").classList.remove("metadetails-active"))})}(t,p[t],p)}),u[t].addEventListener("click",function(){return function(e,t,i,n){return L.apply(this,arguments)}(t,f[t].id,i,p)}),e.episodes[t].id==m&&p[t].classList.add("highlight-active-eps")},b=0;b<c.length;b++)g(b)}function j(e,t){for(var i='<div class="hover-div"></div>\n '.concat(f(),'\n <div class="player-season-list-container on-click-toggle">\n <div id="season-list" class="season-list">\n <div class="season-list-head">seasons</div>\n <div class="season-name-container">\n ').concat(function(e){return e.map(function(e,t){return'<div\n class="season-title-sdk"\n key='.concat("title-".concat(e.title),'\n > <div class="season-container">\n ',e.title,"\n </div>\n </div>\n ")}).join("")}(t),'\n </div>\n </div>\n <div id="episode-list" class="episode-list hide-container"><div id="episodes-back-btn" class="episodes-back-btn" >\n <svg class=\'icon icon-backward\' height="22px" width="22px" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0.383092 19.5818C-0.0882695 19.0669 -0.124672 18.2566 0.273985 17.6961L0.382714 17.5615L7.30134 9.99714L0.383092 2.43893C-0.0882694 1.92406 -0.124672 1.11374 0.273985 0.553232L0.382714 0.418625C0.853882 -0.0964584 1.59542 -0.136236 2.10835 0.299398L2.23153 0.418213L11 9.99608L2.23191 19.5814C1.72148 20.1394 0.893733 20.1396 0.383092 19.5818Z" fill="white"/>\n </svg>\n <span>Episodes<span></div> <div id="episode-container" class="episode-container"> </div></div>\n </div>');null!=e&&e.firstChild;)e.removeChild(e.firstChild);for(var n=h(i);null!=n&&n.firstChild;)e.appendChild(n.firstChild)}export{j as customSeasonList,k as handleSeasonChange,w as seriesModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import s from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as r,e as d,B as c}from"./icons-c139587c.js";import{k as u,W as m,X as p,b as v,C as h,I as f}from"./generic-dd89c778.js";import{e as C,p as y}from"./skin-16f83185.js";import{a as g}from"./autoNextVideo-068e496c.js";import{g as b}from"./player_instance-34118a5b.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-b619441b.js";import"./util-28923483.js";import"@babel/runtime/helpers/typeof";function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}var E=a.getComponent("Component"),k=function(){n(L,E);var k,S,x=(k=L,S=N(),function(){var e,t=l(k);if(S){var s=l(this).constructor;e=Reflect.construct(t,arguments,s)}else e=t.apply(this,arguments);return i(this,e)});function L(s){var n,i,l,a,r,d,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,L),(d=x.call(this,s,c)).playerId=c.playerId,d.seriesData=c.sres,d.videos=null==c||null===(n=c.sres)||void 0===n?void 0:n.seasons,d.currentVideoData=c.res,d.initialiseStructure(),d.loadCSS(),d.selectedSeason=0,d.cb=null==c||null===(i=c.series)||void 0===i?void 0:i.cb,d.autoPlayNext=(null==c||null===(l=c.series)||void 0===l?void 0:l.autoPlayNext)||!1,sessionStorage.getItem("token"),d.watchMap=u(),null!==(a=o(d))&&void 0!==a&&a.autoPlayNext&&null!=c&&null!==(r=c.series)&&void 0!==r&&r.enable){var v,h,f,C,y=null==c||null===(v=c.sres)||void 0===v?void 0:v.seasons,b=[];y.map(function(t){b.push.apply(b,e(t.episodes))}),m(b),p(null===(h=d.options_)||void 0===h||null===(f=h.res)||void 0===f||null===(C=f.video)||void 0===C?void 0:C.id),g({playerId:d.playerId,content:b,cb:d.cb,series:null==c?void 0:c.sres})}return d}return s(L,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"series-selector-icon",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./series-v2-87343239.js").then(function(e){var t=document.createElement("style");t.id="series-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"toggleOpenClose",value:function(e){var t,s=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(C(),e.classList.remove("hidden"),s.classList.add("open"),e.style.right="0px"):(e.classList.add("hidden"),s.classList.remove("open"),e.style.right="-350px")}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),s=a.dom.createEl("div",{className:"series-selection-container hidden"});a.dom.$(".series-selector-icon",this.el()).onclick=function(){return e.toggleOpenClose(s)};var o=document.getElementById(this.playerId);if(o){var n=window.getComputedStyle(o,null).getPropertyValue("height").slice(0,-2);s.style.height="".concat(n,"px"),a.dom.appendContent(t,s),o.style.overflow="hidden",this.addFunctionality(s)}}},{key:"addFunctionality",value:function(e){var t=this,s=this.el(),o=a.dom.createEl("div",{className:"series-selector-head"}),n=a.dom.createEl("div",{className:"series-selector-cross-icon",innerHTML:"".concat(d())});n.onclick=function(){if("series-selector-cross-icon"===n.className)e.classList.add("hidden"),s.classList.remove("open"),e.style.right="-350px";else if("series-selector-back-icon"===n.className){var o=a.dom.$(".series-selector-content",t.el());for(a.dom.$(".series-selector-cross-icon",t.el()),n.className="series-selector-cross-icon";null!=o&&o.firstChild;)o.removeChild(o.firstChild);var i=t.createSeasonLister();for(a.dom.appendContent(o,i),a.dom.$(".series-selector-title",t.el()).textContent="Seasons";null!=n&&n.firstChild;)n.removeChild(n.firstChild);var l=y(d());n.appendChild(l)}};var i=a.dom.createEl("div",{className:"series-selector-title",innerHTML:"Seasons"}),l=a.dom.createEl("div",{className:"series-selector-content"}),r=this.createSeasonLister();a.dom.appendContent(l,r),a.dom.appendContent(o,n),a.dom.appendContent(o,i),a.dom.appendContent(e,o),a.dom.appendContent(e,l),b(this.playerId).on("fullscreenchange",function(){var s=document.getElementById(t.playerId);if(s){var o=window.getComputedStyle(s,null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(o,"px")}})}},{key:"createSeasonLister",value:function(){var e=this;b(this.playerId);for(var t=v(),s=a.dom.createEl("div",{className:"season-container"}),o=function(o){var n,i=document.createElement("label");i.className="season-holder",i.setAttribute("for","season-".concat(o));var l=document.createElement("div");l.className="season - ".concat(o),l.textContent=null===(n=t[o])||void 0===n?void 0:n.title;var r=a.dom.createEl("input",{className:"radio - ".concat(o),id:"season-".concat(o),name:"season-radio"});r.setAttribute("type","radio"),e.selectedSeason==o&&(r.checked=!0),r.onclick=function(t){h.set(o),e.showSeasonDetails(o)},a.dom.appendContent(i,r),a.dom.appendContent(i,l),a.dom.appendContent(s,i)},n=0;n<t.length;n++)o(n);return s}},{key:"getSeasonDetailsContainer",value:function(t,s){var o=this;t=t.map(function(e){var t,s,n,i,l;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:null==e||null===(s=e.gist)||void 0===s||null===(n=s.imageGist)||void 0===n?void 0:n.r16x9,watchedPercentage:(null==o||null===(i=o.watchMap)||void 0===i||null===(l=i.get(null==e?void 0:e.id))||void 0===l?void 0:l.p)||0}});for(var n=function(n){var i,l,r,d,c,u,m,v=a.dom.createEl("div",{className:"series-container"}),h=a.dom.createEl("div",{className:"series-section",index:n}),C=a.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(i=t[n])||void 0===i?void 0:i.title)||"")}),y=a.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[n].watchedPercentage,"%' class='series-progress-bar-value'></div>")});a.dom.appendContent(h,C),a.dom.appendContent(h,y),a.dom.appendContent(v,h),a.dom.appendContent(s,v);var g=a.dom.createEl("div",{className:"series-section-expanded hidden"}),b=(null===(l=t[n])||void 0===l?void 0:l.description)||"";(null===(r=b)||void 0===r?void 0:r.length)>170&&(b=b.substr(0,170)+"...");var N=a.dom.createEl("div",{className:"series-description",innerHTML:"".concat(b||"")}),E=a.dom.createEl("img",{className:"series-image"});E.src="".concat((null===(d=t[n])||void 0===d?void 0:d.img)||(null===(c=window)||void 0===c||null===(u=c.customData)||void 0===u?void 0:u.fallbackImage)),E.alt="".concat(null===(m=t[n])||void 0===m?void 0:m.title),a.dom.appendContent(g,E),a.dom.appendContent(g,N),a.dom.appendContent(v,g),a.dom.appendContent(s,v),g.onclick=function(e){var s;e.stopPropagation(),p(null===(s=t[n])||void 0===s?void 0:s.id),f(o.playerId,t[n].id).then(function(e){null!=o&&o.cb&&o.cb(e)}).catch(function(e){null!=o&&o.cb&&o.cb(e)})},h.onclick=function(t){var s,o,n,i=document.getElementsByClassName("series-selector-content")[0].childNodes,l=(i=e(i))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=l&&null!==(s=l.classList)&&void 0!==s&&s.contains("hidden")?(v.style.backgroundColor="#0000007d",null==l||null===(o=l.classList)||void 0===o||o.remove("hidden")):(null==l||null===(n=l.classList)||void 0===n||n.add("hidden"),v.style.backgroundColor="unset")}},i=0;i<t.length;i++)n(i);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;for(var t=a.dom.$(".series-selector-content",this.el());null!=t&&t.firstChild;)t.removeChild(t.firstChild);var s=v()[e].episodes;this.getSeasonDetailsContainer(s,t);var o=a.dom.$(".series-selector-cross-icon",this.el());for(o.className="series-selector-back-icon";null!=o&&o.firstChild;)o.removeChild(o.firstChild);var n=y(c());o.appendChild(n),a.dom.$(".series-selector-title",this.el()).textContent="Season ".concat(e+1)}}]),L}();export{k as default};
|