@viewlift/player-backup 1.0.95-backup → 1.0.96-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/bundle.css CHANGED
@@ -15,7 +15,6 @@
15
15
 
16
16
 
17
17
 
18
-
19
18
  .widget-selection{
20
19
  display: flex;
21
20
  align-items: center;
@@ -136,6 +135,7 @@
136
135
  .widget-selector-content #sr-widget{
137
136
  padding: 0 18px;
138
137
  }
138
+
139
139
  .vjs-poster {
140
140
  display: inline-block;
141
141
  vertical-align: middle;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-f509b427.js"),r=require("video.js"),l=require("@babel/runtime/helpers/typeof"),a=require("./util-aab98883.js"),s=require("./renditions-ebfc0c1b.js"),d=require("./resolution-7e6c58e5.js"),u=require("./localisation-56e0a999.js");function c(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function v(e,t){c("event",e,t)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?f(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p=function(){var e,t,n,i;return(null===(e=o.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=o.getCurrentVideo())||void 0===i?void 0:i.id)};function w(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function h(){var e=window.sessionStorage.getItem("uid");return e||(e=w(),window.sessionStorage.setItem("uid",e),e)}function g(){return y.apply(this,arguments)}function y(){return y=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}window.initialise=function(e){window.sid=w(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());v(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),v("PLAY",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))v("BUFFERING",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,v("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;v("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),v("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:p()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(b(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var b=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,w,y;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=h(),e.t5=p(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,g();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),w=[e.t31],e.next=37,o.getToken();case 37:y=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:y},contentType:"application/x-www-form-urlencoded",dataType:"text",data:w}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var T,k,P=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},O=function(){var e=t(n.mark((function e(t){var i,l,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,P("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,s.default(r),e.finish(13);case 16:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==o.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*d,v.seek()}}))};function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function j(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?E(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var D=[],C=0,A=null;function R(t,n,i){var r,l,a,s,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];k=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var c=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration()),m=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,w=(null==n||null===(d=n.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,h=Math.floor(t.currentTime()),g=u?100:Math.floor(v/f*100),y={};w?function(t,n,i){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=x(r),a=(new Date).getTime(),s=o.getCurrentVideo(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return j(j({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===T}));c<0?l.push(j(j({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=j(j(j({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(y={completed:u,watchedTime:h,watchedPercentage:g},c,n.siteOwner):("v1"==k?y={videoId:T,watchedTime:h,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:m}:"v2"==k&&(y=j(j({videoId:T,watchedTime:h,watchedPercentage:g,doneWatching:u,profileId:c},A&&{seriesId:A}),p&&{originalObjectId:p})),o.saveWatchHistory(y,k).then((function(e){})).catch((function(e){}))),C=v+i}function x(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var F=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},B=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},H=!1,V=function(e,t){var n,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[r])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!H){var l=M(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,t);return a&&o.loadVideo(t,a),H=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function M(e,t,n){if(Array.isArray(e))return e.map((function(e){return M(e,t,n)}));if(null!==e&&"object"===l(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=M(e[o],t,n)})),i}return e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function N(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var q=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d&&(d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i,r;(null==d||!d.muted())&&F(e,sessionStorage.getItem("volume")||"100");var l=o.getCurrentVideo();if(o.clearError(),n.resolve(N({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var u,c,v=N(N({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(A=null==t||null===(r=t.series)||void 0===r?void 0:r.id),D=[],C=0,T=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());D.includes(C)||(e==C?(D.push(e),R(s,t,a)):e>C&&(C=e+a))})),s.one("ended",(function(){R(s,t,a,!0)})))}(e,v,null==l||null===(u=l.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.tech_.on("retryplaylist",(function(){c&&V(a,e)})),d.on("error",(function(){var t,i;4===d.error().code&&c?V(a,e):(o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){if(c){d.currentSource();for(var e=d.textTracks(),t=e.length-1;t>=0;t--)d.removeRemoteTextTrack(e[t])}})))},L=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-9f0e9d17.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-56a9cb0c.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-66635068.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-7631a75f.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?Promise.resolve().then((function(){return require("./skin-362e29f3.js")})).then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&Promise.resolve().then((function(){return require("./skin-6e7f6ca8.js")})).then((function(n){n.initaliseSkin(e,t)}))},W=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var U,z=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),P("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:z,loadEMELibrary:G});function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Q(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?K(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Y=function(i,l,a,s){var d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R,x,F,B,H,V,M,_,N,U,J,K,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z;null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f||f.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=X)||void 0===m?void 0:m.contentType)||"video",ne=o.impolicy16x9(null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(k=X)||void 0===k||null===(P=k[te])||void 0===P||null===(I=P.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(x=R.adTags)||void 0===x||null===(F=x.web)||void 0===F?void 0:F.active)&&(null===(B=X)||void 0===B||null===(H=B.ads)||void 0===H||null===(V=H.preRoll)||void 0===V||null===(M=V.adTags)||void 0===M||null===(_=M.web)||void 0===_?void 0:_.url);X=Q(Q({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ae=(K={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(K,"autoplay",null==a?void 0:a.autoplay),e(K,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!le),e(K,"loop",(null==a?void 0:a.loop)||!1),e(K,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(K,"html5",Q(Q({dash:Q(Q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Q(Q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(N=a.customData)||void 0===N?void 0:N.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(U=a.customData)||void 0===U?void 0:U.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ne),e(K,"techOrder",ee),e(K,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),K),se=r(i,ae,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(a);case 2:if(oe&&s.resolve(Q({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&W(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,T=null===(d=X)||void 0===d||null===(u=d[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=22;break}if("Safari"!==o.detectBrowser()){e.next=15;break}return e.next=13,G();case 13:e.next=22;break;case 15:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=20;break}return e.next=18,G();case 18:e.next=22;break;case 20:return e.next=22,z();case 22:ie&&S(i,T),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,le,X),(P=o.getSource(X,i))?o.loadVideo(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=X)||void 0===f||null===(m=f[te])||void 0===m||null===(p=m.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[te])||void 0===A?void 0:A.closedCaptions),I=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,I)),null!=a&&a.disableControls?o.disableControls(i):L(i,Q(Q(Q({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),q(i,Q(Q(Q({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:a.onTimeUpdate,getVideoDuration:a.getVideoDuration,onVideoEnded:a.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,d,v,f,m,p,w;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e?void 0:e.videoSourceUrl)||!1,g=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=b;var k=null==e?void 0:e.token;if(o.token_authentication_enabled(e)){if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),!k||o.isTokenExpired(k))return void n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}});U=JSON.parse(atob(k.split(".")[1]))}window.siteId=null===(l=U)||void 0===l?void 0:l.siteId,window.siteName=null===(a=U)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=U)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=U)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=U)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=U)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var O=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,u.setLocalisation(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return J})).then((function(e){e.importIMA()})),O&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return J})).then((function(e){e.importAirplay()})),E&&P("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],c("js",new Date),void c("config",e);var e})).catch((function(e){}));var D=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I));if(D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",A={directPlaybackUrl:h,id:C};g?o.getVideoDetails(C,k).then((function(i){Y(I,{res:Q(Q({},i),A)},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,C)})):Y(I,{res:A},e,{resolve:t,reject:n})}else if(T){var R,F=null==e||null===(R=e.series)||void 0===R?void 0:R.id;o.getSeriesDetails(F,k).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=b||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(F,k),o.getVideoDetails(u,k).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),Y(I,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))})).catch((function(e){o.initiateErrorHandling(e,I,n)}))}else if(y){var B=null==e?void 0:e.epg;o.getLinearChannelDetails(B,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==B?void 0:B.channelId,Y(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}else o.getVideoDetails(b,k).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==i?void 0:i.data);var d,u=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(d=e.watchHistory)||void 0===d?void 0:d.saveOffline)||!1){var c,v,f,m=function(e,t,n){var i=x(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(c=e.watchHistory)||void 0===c?void 0:c.profileId)||"",b,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})}else o.getVideoInfo(b,k).then((function(i){var o,r,l,a,s,d;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedPercentage)||null,u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Y(I,{res:u},e,{resolve:t,reject:n})}));else Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}}))},getRenditions:s.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:a.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:F,getVolume:B,disableControls:o.disableControls,setPlaybackSpeed:a.setPlaybackSpeed}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-f509b427.js"),r=require("video.js"),l=require("@babel/runtime/helpers/typeof"),a=require("./util-aab98883.js"),s=require("./renditions-ebfc0c1b.js"),d=require("./resolution-7e6c58e5.js"),u=require("./localisation-56e0a999.js");function c(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function v(e,t){c("event",e,t)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?f(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p=function(){var e,t,n,i;return(null===(e=o.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=o.getCurrentVideo())||void 0===i?void 0:i.id)};function w(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function h(){var e=window.sessionStorage.getItem("uid");return e||(e=w(),window.sessionStorage.setItem("uid",e),e)}function g(){return y.apply(this,arguments)}function y(){return y=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}window.initialise=function(e){window.sid=w(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());v(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),v("PLAY",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))v("BUFFERING",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,v("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;v("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),v("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:p()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(b(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var b=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,w,y;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=h(),e.t5=p(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,g();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),w=[e.t31],e.next=37,o.getToken();case 37:y=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:y},contentType:"application/x-www-form-urlencoded",dataType:"text",data:w}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var T,k,P=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},O=function(){var e=t(n.mark((function e(t){var i,l,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,P("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,s.default(r),e.finish(13);case 16:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==o.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*d,v.seek()}}))};function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function j(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?E(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var D=[],C=0,A=null;function R(t,n,i){var r,l,a,s,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];k=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var c=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration()),m=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,w=(null==n||null===(d=n.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,h=Math.floor(t.currentTime()),g=u?100:Math.floor(v/f*100),y={};w?function(t,n,i){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=x(r),a=(new Date).getTime(),s=o.getCurrentVideo(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return j(j({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===T}));c<0?l.push(j(j({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=j(j(j({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(y={completed:u,watchedTime:h,watchedPercentage:g},c,n.siteOwner):("v1"==k?y={videoId:T,watchedTime:h,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:m}:"v2"==k&&(y=j(j({videoId:T,watchedTime:h,watchedPercentage:g,doneWatching:u,profileId:c},A&&{seriesId:A}),p&&{originalObjectId:p})),o.saveWatchHistory(y,k).then((function(e){})).catch((function(e){}))),C=v+i}function x(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var F=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},B=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},H=!1,V=function(e,t){var n,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[r])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!H){var l=M(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,t);return a&&o.loadVideo(t,a),H=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function M(e,t,n){if(Array.isArray(e))return e.map((function(e){return M(e,t,n)}));if(null!==e&&"object"===l(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=M(e[o],t,n)})),i}return e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function N(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var q=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d&&(d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i,r;(null==d||!d.muted())&&F(e,sessionStorage.getItem("volume")||"100");var l=o.getCurrentVideo();if(o.clearError(),n.resolve(N({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var u,c,v=N(N({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(A=null==t||null===(r=t.series)||void 0===r?void 0:r.id),D=[],C=0,T=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());D.includes(C)||(e==C?(D.push(e),R(s,t,a)):e>C&&(C=e+a))})),s.one("ended",(function(){R(s,t,a,!0)})))}(e,v,null==l||null===(u=l.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.tech_.on("retryplaylist",(function(){c&&V(a,e)})),d.on("error",(function(){var t,i;4===d.error().code&&c?V(a,e):(o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){if(c){d.currentSource();for(var e=d.textTracks(),t=e.length-1;t>=0;t--)d.removeRemoteTextTrack(e[t])}})))},L=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-9f0e9d17.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-56a9cb0c.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-66635068.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-7631a75f.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?Promise.resolve().then((function(){return require("./skin-362e29f3.js")})).then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&Promise.resolve().then((function(){return require("./skin-22db2127.js")})).then((function(n){n.initaliseSkin(e,t)}))},W=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var U,z=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),P("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:z,loadEMELibrary:G});function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Q(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?K(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Y=function(i,l,a,s){var d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R,x,F,B,H,V,M,_,N,U,J,K,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z;null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f||f.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=X)||void 0===m?void 0:m.contentType)||"video",ne=o.impolicy16x9(null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(k=X)||void 0===k||null===(P=k[te])||void 0===P||null===(I=P.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(x=R.adTags)||void 0===x||null===(F=x.web)||void 0===F?void 0:F.active)&&(null===(B=X)||void 0===B||null===(H=B.ads)||void 0===H||null===(V=H.preRoll)||void 0===V||null===(M=V.adTags)||void 0===M||null===(_=M.web)||void 0===_?void 0:_.url);X=Q(Q({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ae=(K={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(K,"autoplay",null==a?void 0:a.autoplay),e(K,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!le),e(K,"loop",(null==a?void 0:a.loop)||!1),e(K,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(K,"html5",Q(Q({dash:Q(Q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Q(Q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(N=a.customData)||void 0===N?void 0:N.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(U=a.customData)||void 0===U?void 0:U.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ne),e(K,"techOrder",ee),e(K,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),K),se=r(i,ae,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(a);case 2:if(oe&&s.resolve(Q({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&W(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,T=null===(d=X)||void 0===d||null===(u=d[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=22;break}if("Safari"!==o.detectBrowser()){e.next=15;break}return e.next=13,G();case 13:e.next=22;break;case 15:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=20;break}return e.next=18,G();case 18:e.next=22;break;case 20:return e.next=22,z();case 22:ie&&S(i,T),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,le,X),(P=o.getSource(X,i))?o.loadVideo(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=X)||void 0===f||null===(m=f[te])||void 0===m||null===(p=m.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[te])||void 0===A?void 0:A.closedCaptions),I=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,I)),null!=a&&a.disableControls?o.disableControls(i):L(i,Q(Q(Q({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),q(i,Q(Q(Q({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:a.onTimeUpdate,getVideoDuration:a.getVideoDuration,onVideoEnded:a.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,d,v,f,m,p,w;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e?void 0:e.videoSourceUrl)||!1,g=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=b;var k=null==e?void 0:e.token;if(o.token_authentication_enabled(e)){if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),!k||o.isTokenExpired(k))return void n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}});U=JSON.parse(atob(k.split(".")[1]))}window.siteId=null===(l=U)||void 0===l?void 0:l.siteId,window.siteName=null===(a=U)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=U)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=U)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=U)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=U)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var O=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,u.setLocalisation(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return J})).then((function(e){e.importIMA()})),O&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return J})).then((function(e){e.importAirplay()})),E&&P("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],c("js",new Date),void c("config",e);var e})).catch((function(e){}));var D=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I));if(D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",A={directPlaybackUrl:h,id:C};g?o.getVideoDetails(C,k).then((function(i){Y(I,{res:Q(Q({},i),A)},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,C)})):Y(I,{res:A},e,{resolve:t,reject:n})}else if(T){var R,F=null==e||null===(R=e.series)||void 0===R?void 0:R.id;o.getSeriesDetails(F,k).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=b||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(F,k),o.getVideoDetails(u,k).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),Y(I,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))})).catch((function(e){o.initiateErrorHandling(e,I,n)}))}else if(y){var B=null==e?void 0:e.epg;o.getLinearChannelDetails(B,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==B?void 0:B.channelId,Y(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}else o.getVideoDetails(b,k).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==i?void 0:i.data);var d,u=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(d=e.watchHistory)||void 0===d?void 0:d.saveOffline)||!1){var c,v,f,m=function(e,t,n){var i=x(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(c=e.watchHistory)||void 0===c?void 0:c.profileId)||"",b,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})}else o.getVideoInfo(b,k).then((function(i){var o,r,l,a,s,d;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedPercentage)||null,u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Y(I,{res:u},e,{resolve:t,reject:n})}));else Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}}))},getRenditions:s.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:a.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:F,getVolume:B,disableControls:o.disableControls,setPlaybackSpeed:a.setPlaybackSpeed}};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./generic-f509b427.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var r=function(r){var i=e.getPlayer(r),t=document.getElementById("".concat(r));t&&t.addEventListener("touchstart",(function(){i.paused()?e.play(r):e.pause(r)}))},i=function(r){var i=e.getPlayer(r);i.requestFullscreen=function(){},i.controlBar.hide()};exports.initaliseSkin=function(e){i(e),r(e)};
package/esm/bundle.css CHANGED
@@ -15,7 +15,6 @@
15
15
 
16
16
 
17
17
 
18
-
19
18
  .widget-selection{
20
19
  display: flex;
21
20
  align-items: center;
@@ -136,6 +135,7 @@
136
135
  .widget-selector-content #sr-widget{
137
136
  padding: 0 18px;
138
137
  }
138
+
139
139
  .vjs-poster {
140
140
  display: inline-block;
141
141
  vertical-align: middle;
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,d as l,b as a,s,c as d,l as u,e as c,f as v,h as f,i as m,j as p,k as w,m as h,n as g,p as y,o as b,r as T,q as k,t as I,u as P,v as O,w as j,x as S,y as E,z as D,A,B as R,C as F,D as x,E as C,F as B,G as M,H as _,I as H,J as N,K as L,L as V,M as U}from"./generic-fe5217fd.js";import W from"video.js";import q from"@babel/runtime/helpers/typeof";import{o as z,g as G,a as J,s as K,b as Q}from"./util-2920fb7e.js";import{g as Y}from"./renditions-bebe05c1.js";import{playSelectedResolution as X}from"./resolution-8461bc29.js";import{s as Z}from"./localisation-0bf399a1.js";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function $(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ee(e,t){$("event",e,t)}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ne(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?te(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):te(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ie=function(){var e,t,n,i;return(null===(e=r())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=r())||void 0===i?void 0:i.id)};function oe(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function re(){var e=window.sessionStorage.getItem("uid");return e||(e=oe(),window.sessionStorage.setItem("uid",e),e)}function le(){return ae.apply(this,arguments)}function ae(){return ae=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),ae.apply(this,arguments)}window.initialise=function(e){window.sid=oe(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());ee(r?"FAILED_TO_START":"DROPPED_STREAM",ne({pfm:window.platform,uid:re(),vid:ie(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),ee("PLAY",ne({pfm:window.platform,uid:re(),vid:ie(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))ee("BUFFERING",ne({pfm:window.platform,uid:re(),vid:ie(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,ee("FIRST_FRAME",ne({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:re(),vid:ie()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;ee("AD_REQUEST",ne({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:re(),vid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),ee("AD_IMPRESSION",ne({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:re(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:ie()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(se(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var se=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ne,e.t1=ne,e.t2=ne({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=re(),e.t5=ie(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,le();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),m=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de,ue,ce=function(e){return new Promise((function(t,n){if(ve(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},ve=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},fe=function(){var e=t(n.mark((function e(t){var i,o,r,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,ce("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,s.default(W),e.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==l()?null==o||o.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),me=function(e,t){var n=a(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=W.dom.getPointerPosition(a,t).x;W.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function we(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?pe(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):pe(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var he=[],ge=0,ye=null;function be(t,n,i){var o,l,a,d,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ue=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var v=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,f=Math.floor(t.currentTime()),m=Math.floor(t.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,w=(null==n||null===(d=n.video)||void 0===d?void 0:d.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),y=c?100:Math.floor(f/m*100),b={};h?function(t,n,i){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=Te(o),a=(new Date).getTime(),s=r(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return we(we({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===de}));c<0?l.push(we(we({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=we(we(we({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:y},v,n.siteOwner):("v1"==ue?b={videoId:de,watchedTime:g,watchedPercentage:y,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==ue&&(b=we(we({videoId:de,watchedTime:g,watchedPercentage:y,doneWatching:c,profileId:v},ye&&{seriesId:ye}),w&&{originalObjectId:w})),s(b,ue).then((function(e){})).catch((function(e){}))),ge=f+i}function Te(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var ke=function(e,t,n){var i=a(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ie=function(e){var t=a(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Pe=!1,Oe=function(e,t){var n,i,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[o])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!Pe){var r=je(e,"videoAssets","secondaryVideoAssets"),l=d(r,t);return l&&u(t,l),Pe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,t,n){if(Array.isArray(e))return e.map((function(e){return je(e,t,n)}));if(null!==e&&"object"===q(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=je(e[o],t,n)})),i}return e}function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ee(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var De=function(e,t,n,i){var o,l,s=i.res,d=i.sres,u=a(e),p=(null==s?void 0:s.contentType)||"video",w=(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(s),u&&(u.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:s})})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&ke(e,sessionStorage.getItem("volume")||"100");var l=r();if(v(),n.resolve(Ee({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var c,f,m=Ee(Ee({},t),s);!function(e,t,n){var i,o,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ye=null==t||null===(o=t.series)||void 0===o?void 0:o.id),he=[],ge=0,de=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=a(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());he.includes(ge)||(e==ge?(he.push(e),be(s,t,l)):e>ge&&(ge=e+l))})),s.one("ended",(function(){be(s,t,l,!0)})))}(e,m,null==l||null===(c=l.video)||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.id)}})),u.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",t)})),u.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.tech_.on("retryplaylist",(function(){w&&Oe(s,e)})),u.on("error",(function(){var t,i;4===u.error().code&&w?Oe(s,e):(f(e,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),u.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,l=null===(n=r())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=m().get(l)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){u.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(w){u.currentSource();for(var e=u.textTracks(),t=e.length-1;t>=0;t--)u.removeRemoteTextTrack(e[t])}})))},Ae=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-f45c0e82.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-2f5f2197.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-8c9cf6db.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-ac86c6e6.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?import("./skin-0b7765b0.js").then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&import("./skin-e0d9c840.js").then((function(n){n.initaliseSkin(e,t)}))},Re=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Fe,xe=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ce=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){W.getPlugin("eme")||W.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ce("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(W)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(W)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),ce("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:xe,loadEMELibrary:Ce});function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _e(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Me(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Me(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var He=function(i,o,r,s){var c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,F,x,C,B,M,_,H,U,q,z,G,J,K,Q,Y=o.res,X=void 0===Y?null:Y,Z=o.sres,$=void 0===Z?null:Z;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(w=p.getInstance())||void 0===w||w.S;var ee=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(h=X)||void 0===h?void 0:h.contentType)||"video",ne=N(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b?void 0:b.videoImageUrl)||N(null===(T=X)||void 0===T||null===(k=T[te])||void 0===k||null===(I=k.gist)||void 0===I||null===(P=I.imageGist)||void 0===P?void 0:P.r16x9),ie=(null===(O=X)||void 0===O||null===(j=O[te])||void 0===j||null===(S=j.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(A=E[te])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,re=(null==r?void 0:r.drmLibrary)||!1,le=(null===(F=X)||void 0===F||null===(x=F.ads)||void 0===x||null===(C=x.preRoll)||void 0===C||null===(B=C.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(_=X)||void 0===_||null===(H=_.ads)||void 0===H||null===(U=H.preRoll)||void 0===U||null===(q=U.adTags)||void 0===q||null===(z=q.web)||void 0===z?void 0:z.url);X=_e(_e({},X),{},{audioAssetSource:null==r?void 0:r.audioAssetSource});var ae=(Q={controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:("default"==r.skin||"defaultV2"==r.skin||"live"==(null==r?void 0:r.skin))&&{inline:!1},fullscreenToggle:"default"==r.skin||"defaultV2"==r.skin,audioTrackButton:!1,pictureInPictureToggle:(r.skin,!1)},muteToggle:"multiplayer"==r.skin,liveui:ie},e(Q,"autoplay",null==r?void 0:r.autoplay),e(Q,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!le),e(Q,"loop",(null==r?void 0:r.loop)||!1),e(Q,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(Q,"html5",_e(_e({dash:_e(_e({},!W.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:_e(_e({experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==r||null===(G=r.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==r?void 0:r.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==r?void 0:r.experimentalBufferBasedABR)||!1})},0==(null==r||null===(J=r.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(K=r.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ne),e(Q,"techOrder",ee),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=a(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),Q),se=W(i,ae,function(){var e=t(n.mark((function e(){var t,o,a,c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,F,x;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe(r);case 2:if(oe&&s.resolve(_e({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&Re(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(W.options.vhs.overrideNative=!0),k=null===(t=X)||void 0===t||null===(o=t[te])||void 0===o?void 0:o.drmEnabled,I=null===(a=X)||void 0===a||null===(c=a[te])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!k&&!re){e.next=22;break}if("Safari"!==l()){e.next=15;break}return e.next=13,Ce();case 13:e.next=22;break;case 15:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=20;break}return e.next=18,Ce();case 18:e.next=22;break;case 20:return e.next=22,xe();case 22:ie&&me(i,I),!le||null!=r&&null!==(m=r.customData)&&void 0!==m&&m.disableAds||L(i,le,X),(O=d(X,i))?u(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),f(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=X)||void 0===y||null===(b=y[te])||void 0===b||null===(T=b.closedCaptions)||void 0===T?void 0:T.length)>0)&&(x=(null===(S=X)||void 0===S||null===(E=S[te])||void 0===E||null===(A=E.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[te])||void 0===F?void 0:F.closedCaptions),j=x.filter((function(e){return"VTT"===e.format})),V(i,j)),null!=r&&r.disableControls?D(i):Ae(i,_e(_e(_e({},r),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),De(i,_e(_e(_e({},r),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ne(){return{loadVideoInstantly:h,onTimeUpdate:z,getVideoDuration:G,onVideoEnded:J,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,f,m,h;if(!k(null==e?void 0:e.playerId)){var g=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,T=null==e?void 0:e.videoId,I=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=T;var P=null==e?void 0:e.token;if(A(e)){if(R().set(null==e?void 0:e.refreshToken),!P||F(P))return void n({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}});Fe=JSON.parse(atob(P.split(".")[1]))}window.siteId=null===(r=Fe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Fe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Fe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Fe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Fe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Fe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",P);var O=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var j=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,D=null==e?void 0:e.errors;D&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,Z(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!x(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Be})).then((function(e){e.importIMA()})),j&&"Safari"==l()&&Promise.resolve().then((function(){return Be})).then((function(e){e.importAirplay()})),E&&ce("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],$("js",new Date),void $("config",e);var e})).catch((function(e){}));var N=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(O));if(N&&N.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g){var L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",V={directPlaybackUrl:g,id:L};y?C(L,P).then((function(i){He(O,{res:_e(_e({},i),V)},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,L)})):He(O,{res:V},e,{resolve:t,reject:n})}else if(I){var W,q=null==e||null===(W=e.series)||void 0===W?void 0:W.id;M(q,P).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;U(s);var d=T||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;p({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),w(n)})).catch((function(e){return console.log(e)}))}(q,P),C(d,P).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(i.data),He(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))})).catch((function(e){B(e,O,n)}))}else if(b){var z=null==e?void 0:e.epg;_(z,P).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==z?void 0:z.channelId,He(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}else C(T,P).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==i?void 0:i.data);var s,d=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable)if((null===(s=e.watchHistory)||void 0===s?void 0:s.saveOffline)||!1){var u,v,f,m=function(e,t,n){var i=Te(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(u=e.watchHistory)||void 0===u?void 0:u.profileId)||"",T,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;d.contentType="video",He(O,{res:d},e,{resolve:t,reject:n})}else H(T,P).then((function(i){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",He(O,{res:d},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),He(O,{res:d},e,{resolve:t,reject:n})}));else He(O,{res:d},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}}))},getRenditions:Y,skip:g,getPlayer:a,play:y,pause:b,detectBrowser:l,rewind:T,loadVideo:u,seekToTimeStamp:K,isPlayerInitialised:k,load:I,authenticateLC:P,dispose:O,enableCaptions:j,disableCaptions:S,getCaptions:E,playSelectedResolution:X,getSource:d,setVolume:ke,getVolume:Ie,disableControls:D,setPlaybackSpeed:Q}}export{Ne as default};
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,d as l,b as a,s,c as d,l as u,e as c,f as v,h as f,i as m,j as p,k as w,m as h,n as g,p as y,o as b,r as T,q as k,t as I,u as P,v as O,w as j,x as S,y as E,z as D,A,B as R,C as F,D as x,E as C,F as B,G as M,H as _,I as H,J as N,K as L,L as V,M as U}from"./generic-fe5217fd.js";import W from"video.js";import q from"@babel/runtime/helpers/typeof";import{o as z,g as G,a as J,s as K,b as Q}from"./util-2920fb7e.js";import{g as Y}from"./renditions-bebe05c1.js";import{playSelectedResolution as X}from"./resolution-8461bc29.js";import{s as Z}from"./localisation-0bf399a1.js";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function $(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ee(e,t){$("event",e,t)}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ne(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?te(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):te(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ie=function(){var e,t,n,i;return(null===(e=r())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=r())||void 0===i?void 0:i.id)};function oe(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function re(){var e=window.sessionStorage.getItem("uid");return e||(e=oe(),window.sessionStorage.setItem("uid",e),e)}function le(){return ae.apply(this,arguments)}function ae(){return ae=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),ae.apply(this,arguments)}window.initialise=function(e){window.sid=oe(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());ee(r?"FAILED_TO_START":"DROPPED_STREAM",ne({pfm:window.platform,uid:re(),vid:ie(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),ee("PLAY",ne({pfm:window.platform,uid:re(),vid:ie(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))ee("BUFFERING",ne({pfm:window.platform,uid:re(),vid:ie(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,ee("FIRST_FRAME",ne({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:re(),vid:ie()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;ee("AD_REQUEST",ne({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:re(),vid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),ee("AD_IMPRESSION",ne({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:re(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:ie()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(se(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var se=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ne,e.t1=ne,e.t2=ne({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=re(),e.t5=ie(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,le();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),m=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de,ue,ce=function(e){return new Promise((function(t,n){if(ve(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},ve=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},fe=function(){var e=t(n.mark((function e(t){var i,o,r,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,ce("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,s.default(W),e.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==l()?null==o||o.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),me=function(e,t){var n=a(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=W.dom.getPointerPosition(a,t).x;W.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function we(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?pe(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):pe(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var he=[],ge=0,ye=null;function be(t,n,i){var o,l,a,d,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ue=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var v=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,f=Math.floor(t.currentTime()),m=Math.floor(t.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,w=(null==n||null===(d=n.video)||void 0===d?void 0:d.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),y=c?100:Math.floor(f/m*100),b={};h?function(t,n,i){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=Te(o),a=(new Date).getTime(),s=r(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return we(we({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===de}));c<0?l.push(we(we({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=we(we(we({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:y},v,n.siteOwner):("v1"==ue?b={videoId:de,watchedTime:g,watchedPercentage:y,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==ue&&(b=we(we({videoId:de,watchedTime:g,watchedPercentage:y,doneWatching:c,profileId:v},ye&&{seriesId:ye}),w&&{originalObjectId:w})),s(b,ue).then((function(e){})).catch((function(e){}))),ge=f+i}function Te(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var ke=function(e,t,n){var i=a(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ie=function(e){var t=a(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Pe=!1,Oe=function(e,t){var n,i,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[o])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!Pe){var r=je(e,"videoAssets","secondaryVideoAssets"),l=d(r,t);return l&&u(t,l),Pe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,t,n){if(Array.isArray(e))return e.map((function(e){return je(e,t,n)}));if(null!==e&&"object"===q(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=je(e[o],t,n)})),i}return e}function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ee(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var De=function(e,t,n,i){var o,l,s=i.res,d=i.sres,u=a(e),p=(null==s?void 0:s.contentType)||"video",w=(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(s),u&&(u.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:s})})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&ke(e,sessionStorage.getItem("volume")||"100");var l=r();if(v(),n.resolve(Ee({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var c,f,m=Ee(Ee({},t),s);!function(e,t,n){var i,o,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ye=null==t||null===(o=t.series)||void 0===o?void 0:o.id),he=[],ge=0,de=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=a(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());he.includes(ge)||(e==ge?(he.push(e),be(s,t,l)):e>ge&&(ge=e+l))})),s.one("ended",(function(){be(s,t,l,!0)})))}(e,m,null==l||null===(c=l.video)||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.id)}})),u.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",t)})),u.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.tech_.on("retryplaylist",(function(){w&&Oe(s,e)})),u.on("error",(function(){var t,i;4===u.error().code&&w?Oe(s,e):(f(e,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),u.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,l=null===(n=r())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=m().get(l)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){u.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(w){u.currentSource();for(var e=u.textTracks(),t=e.length-1;t>=0;t--)u.removeRemoteTextTrack(e[t])}})))},Ae=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-f45c0e82.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-2f5f2197.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-8c9cf6db.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-ac86c6e6.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?import("./skin-0b7765b0.js").then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&import("./skin-b785a5b5.js").then((function(n){n.initaliseSkin(e,t)}))},Re=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Fe,xe=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ce=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){W.getPlugin("eme")||W.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ce("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(W)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(W)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),ce("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:xe,loadEMELibrary:Ce});function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _e(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Me(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Me(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var He=function(i,o,r,s){var c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,F,x,C,B,M,_,H,U,q,z,G,J,K,Q,Y=o.res,X=void 0===Y?null:Y,Z=o.sres,$=void 0===Z?null:Z;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(w=p.getInstance())||void 0===w||w.S;var ee=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(h=X)||void 0===h?void 0:h.contentType)||"video",ne=N(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b?void 0:b.videoImageUrl)||N(null===(T=X)||void 0===T||null===(k=T[te])||void 0===k||null===(I=k.gist)||void 0===I||null===(P=I.imageGist)||void 0===P?void 0:P.r16x9),ie=(null===(O=X)||void 0===O||null===(j=O[te])||void 0===j||null===(S=j.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(A=E[te])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,re=(null==r?void 0:r.drmLibrary)||!1,le=(null===(F=X)||void 0===F||null===(x=F.ads)||void 0===x||null===(C=x.preRoll)||void 0===C||null===(B=C.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(_=X)||void 0===_||null===(H=_.ads)||void 0===H||null===(U=H.preRoll)||void 0===U||null===(q=U.adTags)||void 0===q||null===(z=q.web)||void 0===z?void 0:z.url);X=_e(_e({},X),{},{audioAssetSource:null==r?void 0:r.audioAssetSource});var ae=(Q={controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:("default"==r.skin||"defaultV2"==r.skin||"live"==(null==r?void 0:r.skin))&&{inline:!1},fullscreenToggle:"default"==r.skin||"defaultV2"==r.skin,audioTrackButton:!1,pictureInPictureToggle:(r.skin,!1)},muteToggle:"multiplayer"==r.skin,liveui:ie},e(Q,"autoplay",null==r?void 0:r.autoplay),e(Q,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!le),e(Q,"loop",(null==r?void 0:r.loop)||!1),e(Q,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(Q,"html5",_e(_e({dash:_e(_e({},!W.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:_e(_e({experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==r||null===(G=r.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==r?void 0:r.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==r?void 0:r.experimentalBufferBasedABR)||!1})},0==(null==r||null===(J=r.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(K=r.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ne),e(Q,"techOrder",ee),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=a(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),Q),se=W(i,ae,function(){var e=t(n.mark((function e(){var t,o,a,c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,F,x;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe(r);case 2:if(oe&&s.resolve(_e({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&Re(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(W.options.vhs.overrideNative=!0),k=null===(t=X)||void 0===t||null===(o=t[te])||void 0===o?void 0:o.drmEnabled,I=null===(a=X)||void 0===a||null===(c=a[te])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!k&&!re){e.next=22;break}if("Safari"!==l()){e.next=15;break}return e.next=13,Ce();case 13:e.next=22;break;case 15:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=20;break}return e.next=18,Ce();case 18:e.next=22;break;case 20:return e.next=22,xe();case 22:ie&&me(i,I),!le||null!=r&&null!==(m=r.customData)&&void 0!==m&&m.disableAds||L(i,le,X),(O=d(X,i))?u(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),f(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=X)||void 0===y||null===(b=y[te])||void 0===b||null===(T=b.closedCaptions)||void 0===T?void 0:T.length)>0)&&(x=(null===(S=X)||void 0===S||null===(E=S[te])||void 0===E||null===(A=E.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[te])||void 0===F?void 0:F.closedCaptions),j=x.filter((function(e){return"VTT"===e.format})),V(i,j)),null!=r&&r.disableControls?D(i):Ae(i,_e(_e(_e({},r),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),De(i,_e(_e(_e({},r),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ne(){return{loadVideoInstantly:h,onTimeUpdate:z,getVideoDuration:G,onVideoEnded:J,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,f,m,h;if(!k(null==e?void 0:e.playerId)){var g=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,T=null==e?void 0:e.videoId,I=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=T;var P=null==e?void 0:e.token;if(A(e)){if(R().set(null==e?void 0:e.refreshToken),!P||F(P))return void n({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}});Fe=JSON.parse(atob(P.split(".")[1]))}window.siteId=null===(r=Fe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Fe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Fe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Fe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Fe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Fe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",P);var O=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var j=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,D=null==e?void 0:e.errors;D&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,Z(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!x(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Be})).then((function(e){e.importIMA()})),j&&"Safari"==l()&&Promise.resolve().then((function(){return Be})).then((function(e){e.importAirplay()})),E&&ce("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],$("js",new Date),void $("config",e);var e})).catch((function(e){}));var N=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(O));if(N&&N.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g){var L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",V={directPlaybackUrl:g,id:L};y?C(L,P).then((function(i){He(O,{res:_e(_e({},i),V)},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,L)})):He(O,{res:V},e,{resolve:t,reject:n})}else if(I){var W,q=null==e||null===(W=e.series)||void 0===W?void 0:W.id;M(q,P).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;U(s);var d=T||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;p({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),w(n)})).catch((function(e){return console.log(e)}))}(q,P),C(d,P).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(i.data),He(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))})).catch((function(e){B(e,O,n)}))}else if(b){var z=null==e?void 0:e.epg;_(z,P).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==z?void 0:z.channelId,He(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}else C(T,P).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==i?void 0:i.data);var s,d=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable)if((null===(s=e.watchHistory)||void 0===s?void 0:s.saveOffline)||!1){var u,v,f,m=function(e,t,n){var i=Te(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(u=e.watchHistory)||void 0===u?void 0:u.profileId)||"",T,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;d.contentType="video",He(O,{res:d},e,{resolve:t,reject:n})}else H(T,P).then((function(i){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",He(O,{res:d},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),He(O,{res:d},e,{resolve:t,reject:n})}));else He(O,{res:d},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}}))},getRenditions:Y,skip:g,getPlayer:a,play:y,pause:b,detectBrowser:l,rewind:T,loadVideo:u,seekToTimeStamp:K,isPlayerInitialised:k,load:I,authenticateLC:P,dispose:O,enableCaptions:j,disableCaptions:S,getCaptions:E,playSelectedResolution:X,getSource:d,setVolume:ke,getVolume:Ie,disableControls:D,setPlaybackSpeed:Q}}export{Ne as default};
@@ -0,0 +1 @@
1
+ import{b as e,p as r,o as t}from"./generic-fe5217fd.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function o(e){i(e),n(e)}var n=function(o){var n=e(o),i=document.getElementById("".concat(o));i&&i.addEventListener("touchstart",(function(){n.paused()?r(o):t(o)}))},i=function(r){var t=e(r);t.requestFullscreen=function(){},t.controlBar.hide()};export{o as initaliseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.95-backup",
3
+ "version": "1.0.96-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";var e=require("./generic-f509b427.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var r=function(r){var i=e.getPlayer(r);i&&i.on("click",(function(){i.paused()?e.play(r):e.pause(r)}));var n=document.getElementById("".concat(r));n&&n.addEventListener("touchstart",(function(){i.paused()?e.play(r):e.pause(r)}))},i=function(r){e.getPlayer(r).controls(!1)};exports.initaliseSkin=function(e){i(e),r(e)};
@@ -1 +0,0 @@
1
- import{b as e,p as r,o}from"./generic-fe5217fd.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function t(e){i(e),n(e)}var n=function(t){var n=e(t);n&&n.on("click",(function(){n.paused()?r(t):o(t)}));var i=document.getElementById("".concat(t));i&&i.addEventListener("touchstart",(function(){n.paused()?r(t):o(t)}))},i=function(r){e(r).controls(!1)};export{t as initaliseSkin};