@viewlift/player-backup 2.0.159-backup → 2.0.160-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/cjs/{autoNextVideo-21a1049d.js → autoNextVideo-13514d21.js} +1 -1
  2. package/cjs/bundle.css +2 -2
  3. package/cjs/{features-e2899174.js → features-0044a595.js} +1 -1
  4. package/cjs/{generic-5e07ea8b.js → generic-8c12704d.js} +1 -1
  5. package/cjs/{index-5537647b.js → index-0780388f.js} +1 -1
  6. package/cjs/{index-87f3e1e6.js → index-24c09bbb.js} +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/{multicamv2-325bbe73.js → multicamv2-0acd6deb.js} +1 -1
  9. package/cjs/{multicamv2-b313fb5d.js → multicamv2-5d15164d.js} +1 -1
  10. package/cjs/{nextEpisodeButton-232247a4.js → nextEpisodeButton-763def9b.js} +1 -1
  11. package/cjs/{playlist-c141ff16.js → playlist-5457078d.js} +1 -1
  12. package/cjs/{series-fd1884af.js → series-3bce2a99.js} +1 -1
  13. package/cjs/{series-v2-a3caee3c.js → series-v2-7bcaa844.js} +1 -1
  14. package/cjs/{series-v2-b7106048.js → series-v2-bf8392ea.js} +1 -1
  15. package/cjs/{skin-e9ba717d.js → skin-108c151e.js} +1 -1
  16. package/cjs/{skin-1e7fef54.js → skin-2d359d14.js} +1 -1
  17. package/cjs/{skin-877b093a.js → skin-495df2a7.js} +1 -1
  18. package/cjs/{skin-e13e342c.js → skin-652221cd.js} +1 -1
  19. package/cjs/{skin-45b2684f.js → skin-7deb8ced.js} +1 -1
  20. package/cjs/{skin-3143455d.js → skin-eb422b1c.js} +1 -1
  21. package/cjs/{skin-8b519923.js → skin-f4a34fdd.js} +1 -1
  22. package/cjs/{util-893a38c8.js → util-ee35a412.js} +1 -1
  23. package/cjs/{videoSelector-b89ef252.js → videoSelector-0605816f.js} +1 -1
  24. package/cjs/{videoSelector-a0b8f36f.js → videoSelector-e0f18aec.js} +1 -1
  25. package/esm/{autoNextVideo-a21e02dd.js → autoNextVideo-c2ac0eb9.js} +1 -1
  26. package/esm/bundle.css +2 -2
  27. package/esm/{features-14ef64fe.js → features-7a22971d.js} +1 -1
  28. package/esm/{generic-d87c4ef9.js → generic-c24a44e9.js} +1 -1
  29. package/esm/{index-c1d9085a.js → index-272a7332.js} +1 -1
  30. package/esm/{index-5e61c418.js → index-bcffd8fd.js} +1 -1
  31. package/esm/index.js +1 -1
  32. package/esm/{multicamv2-3e7bcb5d.js → multicamv2-57e3a4ae.js} +1 -1
  33. package/esm/{multicamv2-139782ca.js → multicamv2-e69078fe.js} +1 -1
  34. package/esm/{nextEpisodeButton-faac9e00.js → nextEpisodeButton-dda0ab2c.js} +1 -1
  35. package/esm/{playlist-92f9c705.js → playlist-11a7a14d.js} +1 -1
  36. package/esm/{series-ee0a6351.js → series-e8cb07a4.js} +1 -1
  37. package/esm/{series-v2-fef6169d.js → series-v2-3c35c10d.js} +1 -1
  38. package/esm/{series-v2-de656ccb.js → series-v2-4bd4b716.js} +1 -1
  39. package/esm/{skin-66ca00f2.js → skin-335f6008.js} +1 -1
  40. package/esm/{skin-7363a9d3.js → skin-3ddc583c.js} +1 -1
  41. package/esm/{skin-1fff3b82.js → skin-4945d551.js} +1 -1
  42. package/esm/{skin-857c967c.js → skin-4b8b7b35.js} +1 -1
  43. package/esm/{skin-17b28904.js → skin-9373adc6.js} +1 -1
  44. package/esm/{skin-9d3c27a9.js → skin-b3dcd4b4.js} +1 -1
  45. package/esm/{skin-fedd2fe1.js → skin-fa209cb6.js} +1 -1
  46. package/esm/{util-1e9ccaca.js → util-11deb719.js} +1 -1
  47. package/esm/{videoSelector-7c0cfaeb.js → videoSelector-05897f6d.js} +1 -1
  48. package/esm/{videoSelector-18b12597.js → videoSelector-a933d6a1.js} +1 -1
  49. package/package.json +1 -1
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import r from"axios";import{g as i}from"./player_instance-34118a5b.js";import a from"js-cookie";import{a as l,e as s,g as u,h as d,s as c,i as v,d as f}from"./currentVideoInfo-a8a254c2.js";import{a as m,r as p}from"./captions-f507e8ee.js";import{t as g,c as I}from"./skin-d5091b86.js";import h from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";function E(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function T(e){window.dataLayer=window.dataLayer||[],E("js",new Date),E("config",e)}function b(e,n){E("event",e,n)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?S(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):S(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var O={name:"@viewlift/player",version:"2.0.61",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=O.version;var A,L=function(e,n){var t,o,i,a,l,s,u,d;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:null!==(l=window)&&void 0!==l&&null!==(s=l.customData)&&void 0!==s&&s.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(d=u.customData)||void 0===d?void 0:d.overrideEntitlementBaseUrl)+"/video/status":j.get()+"".concat(null==w?void 0:w.getVideoDetails),params:_({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":O.version,"x-player-name":"videojs"},withCredentials:!0})},D=function(e,n){var t,o,i,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:j.get()+w.getLinearChannelDetails,params:_(_(_(_(_({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},P=function(e,n){var t,o,i=H(n),a=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):r({url:j.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},k=function(){var e=n(t.mark((function e(n){var o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return o=e.sent,e.abrupt("return",r({url:j.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:_({},n),params:_({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:j.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},R=function(e){var n=e.videoId;return r({method:"GET",url:j.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},j=(A=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(A=e)},get:function(){return A}}),F=function(e,n,t,o){return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},V=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},W=null;function N(){return{set:function(e){e&&(W=e)},get:function(){return W}}}var U=function(){var e=n(t.mark((function e(){var n,o,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=N().get(),o=j.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),B=null,M=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!V(n)){e.next=6;break}return B||(B=U().then((function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&N().set(i),r||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){B=null}))),e.abrupt("return",B);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},H=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function G(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?G(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Y=100,z=function(){var e,n,t,o,r,i,a,s=l();return"linearchannel"===((null==s?void 0:s.contentType)||"video")?null==s||null===(e=s.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==s?void 0:s.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==s||null===(r=s.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==s||null===(a=s.video)||void 0===a?void 0:a.id)||(null==s?void 0:s.id)};function q(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function K(){var e=window.sessionStorage.getItem("uid");return e||(e=q(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=n(t.mark((function e(){var n,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(e){return e?String(e):""}var Z=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function ee(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=q(),s="production",u="WEBSITE",d=null,c=0,v=null,f=0,m=0,p=!1,g=[],I=i(e);if(I){var h=function(){var e,n,t,o;return Math.round((null==I||null===(e=I.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)},y=Z((function(){for(var e=I.currentTime(),n=I.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0})),E=function(){var e=n(t.mark((function e(n){var o,i,d,c,v,f,m,p,g,I,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return g=e.sent,I=H(g),e.t0=Q,e.t1=Q,e.t2=null==I?void 0:I.site,e.t3=null==I?void 0:I.siteId,e.t4=u,e.t5=K(),e.t6=z(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11=s,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?$(n.adPosition):"",e.next=25,X();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=l,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(d=n.bitrate)&&void 0!==d?d:null,e.t25=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t26=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t27=null!==(f=n.bufferHealth)&&void 0!==f?f:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==a||null===(m=a.beacon)||void 0===m?void 0:m.params,e.t32=(0,e.t0)(e.t30,e.t31),h=[e.t32],r({url:(null==a||null===(p=a.beacon)||void 0===p?void 0:p.url)||j.get()+w.getBeaconUrl,method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){return console.error(e)}));case 41:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),T=function(e){if(!I.paused()&&I.readyState()>2)return clearInterval(d),clearInterval(v),e;var n,t=e+.1;return+t.toFixed(2)>=5&&m<4&&p?(m++,b("BUFFERING",Q({pfm:u,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime)},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:"BUFFERING",videoPosition:Math.floor(I.currentTime),isAdEvent:!1}),0):t},S=function(){var e=Math.floor(I.currentTime);I.on("error",(function(){var n,t=Math.floor(I.currentTime);clearInterval(d);var o=e===t?"FAILED_TO_START":"DROPPED_STREAM";b(o,Q({pfm:u,uid:K(),vid:z(),videoPosition:t},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:o,videoPosition:t,isAdEvent:!1})}))},_=function(){var e=Z((function(){var e;c=0,v=setInterval((function(){c=T(c)}),Y),b("PLAY",Q({pfm:u,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime)},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"PLAY",videoPosition:Math.floor(I.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":z(),watchTime:Math.floor(I.currentTime)})}));I.one("play",e)},O=function(){I.one("timeupdate",(function(){var e;clearInterval(v),clearInterval(d),f=c||0,b("FIRST_FRAME",Q({pfm:u,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime),ttFirstFrame:c,bufferHealth:y()},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"FIRST_FRAME",videoPosition:Math.floor(I.currentTime),isAdEvent:!1,ttFirstFrame:c,bufferHealth:y()}),p=!0,c=0}))},A=function(){var e=!1;I.on("waiting",Z((function(){p&&(e=!0,clearInterval(d),d=setInterval((function(){e&&!I.paused()?f=T(f):clearInterval(d)}),Y))}))),I.on("playing",Z((function(){e=!1,clearInterval(d)})))},L=function(){var e=function(e){var n,t,o,r=Q({videoPosition:Math.floor(I.currentTime),isAdEvent:!0,bufferHealth:y(),pfm:u,uid:K(),vid:z(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==a||null===(o=a.beacon)||void 0===o?void 0:o.params);b(e,Q({},r)),E(Q({eventName:e,adPosition:1},r))};I.on("adstart",(function(){e("AD_REQUEST"),e("AD_IMPRESSION")})),I.on("adskip",(function(){c=0})),I.on("adend",(function(){c=0}))},D=function(){I.on("timeupdate",(function(){var e=Math.floor(I.currentTime());if(e>=30&&e%30==0&&!g.includes(e)){var n,t=null===(n=I.el().getElementsByTagName("video"))||void 0===n?void 0:n[0];m=0,g.push(e),E({eventName:"PING",videoPosition:e,isAdEvent:!1,duration:30,resHeight:(null==t?void 0:t.videoHeight)||null,resWidth:(null==t?void 0:t.videoWidth)||null,bufferHealth:y(),bitrate:h()})}}))};S(),A(),L(),D(),_(),I.on("loadeddata",O)}else console.error("Videojs: Player instance not found.")}function ne(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&ee(e,n,t)}var te=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},oe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},re=function(e,n){var t=new Map;R({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),d(t)})).catch((function(e){return console.log(e)}))},ie=function(){var e=s.get();return e>=0?e+1:1},ae=function(){var e,n,t,o=u(),r=l(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=s.get(),d=null==o||null===(n=o[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===i}));return d>=0?d+1:1};function le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function se(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?le(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):le(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ue=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},de=function(e){var n=ce(e,"video.tags",[]),t=ce(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},ce=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},ve=function(){var n,t,o,r,l,s,u,d,c,v,f,m,p,g,I,h,y,E,T,b,w,S,_,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return A;var P=(null==D?void 0:D.siteName)||"",k=(null==D?void 0:D.contentType)||"video",C=(null==D||null===(o=D[k])||void 0===o?void 0:o.metadata)||(null==D||null===(r=D[k])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),R=i(L);if(!A.includes("VIEWLIFT_"))return A;var j,F=window.getComputedStyle(document.getElementById(L),null),V=Math.trunc(F.getPropertyValue("height").slice(0,-2)),W=Math.trunc(F.getPropertyValue("width").slice(0,-2)),N="linearchannel"===k?null==D||null===(s=D.linearchannel)||void 0===s||null===(u=s.channels)||void 0===u||null===(d=u.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===d||null===(c=d.content)||void 0===c?void 0:c.id:ce(D,"video.gist.id",""),U="linearchannel"===k?null==D||null===(v=D.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(m=f.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===m?void 0:m.title:ce(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(j=window)||void 0===j||j.__gpp("ping",(function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]})));var x=se(se({},fe(C)),{},(S={VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:ue(W,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ce(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(g=R.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(I=R.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:de(D),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ce(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ce(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ce(null===(h=window)||void 0===h||null===(y=h.app_data)||void 0===y||null===(E=y.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P?"":ce(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(w=b.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:ce(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ce(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:ie(),VIEWLIFT_CONTENT_TAGS:de(D),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(S,"VIEWLIFT_LAT",""),e(S,"VIEWLIFT_APP_BUNDLE",""),e(S,"VIEWLIFT_ATT_CONSENT",""),S),null===(_=window)||void 0===_||null===(O=_.customData)||void 0===O?void 0:O.macros);for(var H in x){var G=new RegExp(H,"g");A=A.replace(G,x[H])}return A},fe=function(e){var n,t,o,r,i,a,l={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){s.set(e.name,e.value)})));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,d=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return u||d?(oe()?u?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):d&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):u?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):d&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),u?l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):d&&(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),l=oe()?se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),l=oe()?se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),l=se(se({},l),{},{VIEWLIFT_AFID:s.get("afid")})},me=function(e,n){var t,o,r,i,a,l,s,u,d,c,v,f,m,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,h=null==e||null===(i=e[p])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,y=(null==e||null===(l=e[p])||void 0===l||null===(s=l.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(d=e[p])||void 0===d||null===(c=d.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[p])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(m=f.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=h&&h.hls)return ge(h);if(g){var T=Ie(I,n);return T.src=ve(T.src,n,e),T}if("Safari"!==te()&&E)return pe(I);if(y){var b=ge(I);return b.src=ve(b.src,n,e),b}if(null!=I&&I.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return w.src=ve(w.src,n,e),w}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ge=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ie=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,s=te();if(i(n),"Safari"===s){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,n,t){console.log(e),e&&i(e),i(null,t)}))}}}}}(r);return he(n),u}var d,c={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(d=window)||void 0===d?void 0:d.siteName)?(he(n),c.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var he=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ye=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},Ee=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},Te=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var be=!1,we=function(e,n,t){var o=ve(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,a=i(e);if(null!==a.el_){be=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),be&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()}),1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var u="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,u="touchend"),a.one(u,(function(){d&&a.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})),n.addEventListener(google.ima.AdEvent.Type.LOADED,(function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o)}};function Se(e,n){var t,o,r,a=i(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",(function(t){var o,r,i,u,d,c,v,f,m;if(Oe.enabled&&"input"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==s||s.focus()),p){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||ln(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(u=i.appcmsMain)||void 0===u||null===(d=u.adsConfig)||void 0===d?void 0:d.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||an(e,10)}}}),!0)}var _e,Oe=(_e=!0,{enable:function(){_e=!0},disable:function(){_e=!1},get enabled(){return _e}}),Ae="ssai-breakStart",Le="ssai-adImpression",De="ssai-firstQuartile",Pe="ssai-midpoint",ke="ssai-thirdQuartile",Ce="ssai-complete",Re="ssai-breakEnd",je={breakStart:Ae,impression:Le,firstQuartile:De,midpoint:Pe,thirdQuartile:ke,complete:Ce,breakEnd:Re};function Fe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=je[o];r&&t.trigger(r,n)}function Ve(e){var n=i(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Ae,e)},adImpression:function(e){return t(Le,e)},adFirstQuartile:function(e){return t(De,e)},adMidpoint:function(e){return t(Pe,e)},adThirdQuartile:function(e){return t(ke,e)},adComplete:function(e){return t(Ce,e)},adBreakEnd:function(e){return t(Re,e)}}}function We(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ne(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?We(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Ue(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Be(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Be(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function Be(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var Me,xe=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),He=(Me=null,{set:function(e){Me=e},get position(){return Me}});function Ge(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=n(t.mark((function e(n,o){var r,a,l,s,u,d,c,v,f,m,p,g,I,h,E,T,b,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),l=me(o,n),s=l.src,u=(null==o?void 0:o.contentType)||"video",d=(null==o||null===(r=o[u])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,c=s.replace("/dash/","/session/").replace("/master/","/session/"),c=ve(c,n,o),v=Ye(c),f=y(v,2),m=f[0],p=f[1],c=new URL(c.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=y(e,2),t=n[0],o=n[1];c.searchParams.set(t,o)})),e.prev=10,e.next=13,fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ne({adsParams:Ne({},m)},d&&{availSuppression:{mode:"BEHIND_LIVE_EDGE",value:"00:00:00"}}))});case 13:return g=e.sent,e.next=16,g.json();case 16:return I=e.sent,h="https://"+new URL(c).hostname,E=I.trackingUrl,T=I.manifestUrl,b=h+E,w=h+T,xe.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),l.src=w,e.abrupt("return",l);case 28:return e.prev=28,e.t0=e.catch(10),e.abrupt("return",l);case 31:case"end":return e.stop()}}),e,null,[[10,28]])})))).apply(this,arguments)}function Ye(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ue((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=y(t.value,2),a=i[0],l=i[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},u={},d=0,c=Object.entries(n);d<c.length;d++){var v=y(c[d],2),f=v[0],m=v[1];if(f.startsWith("ads."))s[f.replace(/^ads\./,"")]=m;else u[f]=m}return[s,u]}var ze,qe=(ze=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),ze=Array.isArray(e)?h(e):ze},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",ze),h(ze)}}),Ke=new Map;function Xe(e,n){return Je.apply(this,arguments)}function Je(){return Je=n(t.mark((function e(o,r){var a,l,s,u,d,c,v,f,m,p,I,y,E,T,b,w,S,_,O,A,L,D;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:D=function(e,n,t,r,a,l){var s=i(o);if(!s.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(s.currentTime());var u,d=Ue(t);try{var c=function(){var t,i,d,c=u.value,v=c.eventType,f=c.beaconUrls,m=c.startTimeInSeconds,p=c.startTime,g=c.durationInSeconds,I=m||0,h=f,y=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,E="".concat(I,"_").concat(v),T=Ke.get("pod-".concat(a))||[];if(console.warn(e,I,"map:",v,"condition1:",e>=I,"map:",Ke),e>=I&&!T.includes(E)){T.push(E),Ke.set("pod-".concat(a),T);try{L(v,n,h,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var b=He.position;He.set(null),setTimeout((function(){null!=b&&(s.currentTime(b),l())}),500)}if("function"==typeof y)try{var w,S={eventType:v,startTimeInSeconds:m,startTime:p,durationInSeconds:g,ad:null==n||null===(w=n.ads)||void 0===w?void 0:w[r],adIndex:r};y({adsData:S}),Fe(o,S)}catch(e){console.error("Error when calling ads callback:",e)}}};for(d.s();!(u=d.n()).done;)c()}catch(e){d.e(e)}finally{d.f()}}},L=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Ke.clear(),He.set(r),m=xe.get(),(p=i(o)).one("loadeddata",(function(){m&&O(m)})),I=new Map,y=new Map,E=-1,T=(null===(a=document)||void 0===a||null===(l=a.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==p||null===(s=p.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,w=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==p||null===(d=p.el())||void 0===d||null===(c=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,_=(null==p||null===(v=p.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,O=function(){var e=n(t.mark((function e(n){var a,l,s,u,d,c,v,f,m,p,O,L,P,k,C,R,j,F,V,W;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R=function(e){document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",R),0===e.button&&P()},C=function(e){},k=function(){var e,n=p.currentTime(),t=null,o=Ue(m);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(i+a));n>=i&&n<=l&&(t=l,I.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){p.currentTime(t+2.2)}),100))},P=function(){var e,n=p.currentTime(),t=null,o=Ue(m);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,s=Math.floor(i+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>s||n>i)&&!I.has(i)||n>=i&&n<=s)&&(t=i,I.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){p.currentTime(t+.4)}),100))},d=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),f=v.avails,m=[],p=i(o),O=p.controlBar.progressControl,L=O.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),f.map((function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(d=!0),m.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),!d&&r&&(p.currentTime(r),k()),null!=m&&m.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),window.adsQueueList=m),console.log(m,"data"),m.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",L.appendChild(i)}})),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=g((function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=m[o],r=t.startTimeInSeconds,i=t.durationInSeconds,a=t.ads,l=r+i;if(e>=r-1.2&&e<=l+1.2){e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&I.set(r,!0),Oe.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var s=e-r,u=0,d=0,c=0;c<a.length;c++){var v,f=null==a||null===(v=a[c])||void 0===v?void 0:v.durationInSeconds;if(s<u+f){d=c;break}u+=f}a[d];var p=Math.max(0,i-s),g=Math.round(p);j.style.display="block",W.textContent="".concat(d+1," of ").concat(a.length," • ").concat(A(g));var E=[];return null==a||a.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));E.push.apply(E,h(n))})),Array.isArray(a)&&0==(null==a?void 0:a.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),D(e,t,E,d,o,k),"break"}y.delete(r)},o=0;o<m.length;o++){if("break"===t())break}n||(j.style.display="none",O.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),Oe.enable())}}),1e3),p.on("timeupdate",p._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",(function(e){Oe.enabled&&"ArrowRight"==e.key&&(P(),an(o,10),e.stopPropagation())})),O.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",C),document.addEventListener("pointerup",R))})),null===(s=document)||void 0===s||null===(u=s.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach((function(e){return null==e?void 0:e.remove()})),(j=document.createElement("div")).className="ssai-ad-container",(F=document.createElement("div")).className="sponsored-adbox",(V=document.createElement("div")).className="sponsored-text",V.textContent="Sponsored Ad",F.append(V),(W=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",j.append(F),j.append(W),p.el().appendChild(j);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}}),e)}))),Je.apply(this,arguments)}function $e(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Ze(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function Ze(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function en(e){return nn.apply(this,arguments)}function nn(){return nn=n(t.mark((function e(o){var r,a,l,s,u,d,c,v,f,m,p,I,y,E,T,b,w,S,_,O,A,L,D,P,k,C;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,r,a){var l=i(o);if(!l.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(l.currentTime());var s,u=$e(t);try{for(u.s();!(s=u.n()).done;){var d,c,v,f=s.value,m=f.eventType,p=f.beaconUrls,g=f.startTimeInSeconds,I=f.startTime,h=f.durationInSeconds,y=g||0,E=p,T=(null===(d=window)||void 0===d||null===(c=d.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,b="".concat(y,"_").concat(m),w=P.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",m,"condition1:",e>=y,"map:",P),e>=y&&!w.includes(b)){w.push(b),P.set("pod-".concat(a),w);try{k(m,n,E,l)}catch(e){console.error("Error when calling triggerAdBeacon:",e,m,n)}if("function"==typeof T)try{var S,_={eventType:m,startTimeInSeconds:g,startTime:I,durationInSeconds:h,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[r],adIndex:r};T({adsData:_}),Fe(o,_)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){u.e(e)}finally{u.f()}}},k=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},I=function(){p&&clearInterval(p)},f=xe.get(),m=i(o),p=null,m.one("loadeddata",(function(){p=setInterval((function(){f&&!m.paused()&&D(f)}),2e3)})),m.on("sourceset",(function(e){null!=e&&e.src||I(),console.log(e,"sourceset")})),m.on("dispose",(function(){I()})),y=new Map,E=new Map,T=-1,b=null,w=(null===(r=document)||void 0===r||null===(a=r.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,S=(null==m||null===(l=m.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,_=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,O=(null==m||null===(u=m.el())||void 0===u||null===(d=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===d?void 0:d[0])||null,A=(null==m||null===(c=m.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,L=!1,D=function(){var e=n(t.mark((function e(n){var r,a,l,s,u,d,c,v,f,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new URL(n),b&&a.searchParams.append("nextToken",b),e.next=4,fetch(a.toString(),{method:"GET"});case 4:return l=e.sent,e.next=7,l.json();case 7:s=e.sent,u=s.avails,d=s.nextToken||null,b=d,c=[],v=i(o),f=v.controlBar.progressControl,m=f.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),u.map((function(e,n){var t,o;c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(t=e.adBreakTrackingEvents)||void 0===t||null===(o=t.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===o?void 0:o[0])||[]})})),console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c),c.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",m.appendChild(i)}})),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=g((function(){var e=v.currentTime();if(e!==T){T=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,a=o+r;if(e>=o-1.2&&e<=a+1.2){L=!!(e>=o&&e<=a&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>a&&y.set(o,!0),Oe.disable(),w&&w.classList.add("vjs-hidden"),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),A&&(A.style.pointerEvents="none",A.classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var l=e-o,s=0,u=0,d=0;d<i.length;d++){var v,m=null==i||null===(v=i[d])||void 0===v?void 0:v.durationInSeconds;if(l<s+m){u=d;break}s+=m}var p=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));p.push.apply(p,h(n))})),Array.isArray(i)&&0==(null==i?void 0:i.length)&&p.push(null==n?void 0:n.podSlotImpressionBeacon),C(e,n,p,u,t),"break"}E.delete(o)},t=0;t<c.length;t++){if("break"===n())break}L||(f.el().classList.remove("hide-progress-bar"),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),w&&w.classList.remove("vjs-hidden"),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),A&&(A.style.pointerEvents="auto",A.classList.remove("vjs-hidden")),Oe.enable())}}),1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),P=new Map;case 23:case"end":return e.stop()}}),e)}))),nn.apply(this,arguments)}function tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var on=function(e){o(e).play()},rn=function(e){o(e).pause()},an=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},ln=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},sn=function(e){return!!o.getPlayer("".concat(e))},un=function(e){return o(e).paused()},dn=function(){var e=n(t.mark((function e(o,r){var a,l,s,u=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>2&&void 0!==u[2]&&u[2],e.next=3,M();case 3:return l=e.sent,s=i(o),e.abrupt("return",new Promise((function(e,i){var u=(null==r?void 0:r.programs)||[];null==r||delete r.programs,D(r,l).then(function(){var i=n(t.mark((function n(i){var l,d,v,m,p,g,I,h;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(g=null==i?void 0:i.data,window.sid=q(),g.contentType="linearchannel",g.channelId=null==r?void 0:r.channelId,I=(null==g||null===(l=g.linearchannel)||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(v=d.app_data)||void 0===v||null===(m=v.appcmsMain)||void 0===m||null===(p=m.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,h=me(g,o),!I){n.next=11;break}return n.next=9,Ge(o,g);case 9:h=n.sent,a=!0;case 11:c(g),f(u),sessionStorage.setItem("program_switched",!0),h&&a?(pn(o,h),I&&en(o),s.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:g})}))):e({status:!0,msg:"Feed authenticated",response:g});case 15:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){i({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),cn=function(){var e=n(t.mark((function e(o,r,a){var l,s,d,f,g,I,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return f=e.sent,(u()||null)&&v(r),g=0,I=0,h=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(d=s.watchHistory)&&void 0!==d&&d.enable&&C(r,f).then((function(e){var n,t,o,r,i,a,l;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),g=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(I=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null)<95)&&(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null)})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})),e.abrupt("return",new Promise((function(e,a){L(r,f).then(function(){var r=n(t.mark((function n(r){var l,s,u,d,v,f,y,E,T,b,w,S,_,O,A,L,D,P,k,C,R,j,F,V,W,N,U,B,M,x,H,G,Q,Y,z,q,K,X;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(L=null==r?void 0:r.data,D=(null==L?void 0:L.contentType)||"video",P=(null==L||null===(l=L[D])||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(u=s.app_data)||void 0===u||null===(d=u.appcmsMain)||void 0===d||null===(v=d.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==L||null===(f=L.video)||void 0===f||null===(y=f.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,c(r.data),(C=(null==L||null===(E=L.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(b=T.adTags)||void 0===b||null===(w=b.web)||void 0===w?void 0:w.active)&&(null==L||null===(S=L.ads)||void 0===S||null===(_=S.preRoll)||void 0===_||null===(O=_.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&we(o,C,L),R=me(L,o),!P){n.next=12;break}return n.next=11,Ge(o,L);case 11:R=n.sent;case 12:R?(G=(null==L||null===(j=L.video)||void 0===j||null===(F=j.gist)||void 0===F?void 0:F.videoImageUrl)||(null==L||null===(V=L.video)||void 0===V||null===(W=V.gist)||void 0===W||null===(N=W.imageGist)||void 0===N?void 0:N.r16x9),(Q=i(o)).poster(G),pn(o,R),P&&Xe(o,h),Q.on("loadstart",(function(){k&&e({status:!0,msg:"Video Loaded",response:L})})),Q.on("loadeddata",(function(){Te(),e({status:!0,msg:"Video Loaded",response:L})})),Q.one("play",(function(){g&&!P&&I<95&&setTimeout((function(){Q.currentTime(g)}),0)})),Q.one("error",(function(){var e;a({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==L||null===(U=L.video)||void 0===U||null===(B=U.contentDetails)||void 0===B||null===(M=B.closedCaptions)||void 0===M?void 0:M.length)>0||(null==L||null===(x=L.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==L||null===(z=L.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==L||null===(K=L.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter((function(e){return"VTT"===e.format})),m(o,Y)):p(o)):(Ee(o,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}}),n)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){gn(e,o,a,r)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),vn=function(e,n,t){var o=i(e);return o.src(n),new Promise((function(e,n){var r=0;o.one("loadedmetadata",(function(){clearTimeout(r),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){r=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},fn=function(e){var n=i(e);if(mn(),I(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},mn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},pn=function(e,n){var t=i(e);t&&t.src(n)},gn=function(n,t,o,r){var i,a,l,s,u,d,c=null==n||null===(i=n.response)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);sn(t)&&Ee(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(d=window)||void 0===d?void 0:d.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?tn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):tn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},In=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")};export{ln as A,sn as B,cn as C,dn as D,fn as E,F,qe as G,Ve as H,j as I,x as J,N as K,V as L,T as M,Ke as N,Se as O,oe as P,un as Q,en as R,Xe as S,R as T,ae as a,ie as b,me as c,te as d,Te as e,In as f,K as g,Ee as h,ne as i,we as j,ye as k,pn as l,Ge as m,H as n,L as o,C as p,gn as q,M as r,k as s,D as t,P as u,re as v,vn as w,an as x,on as y,rn as z};
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import r from"axios";import{g as i}from"./player_instance-34118a5b.js";import a from"js-cookie";import{a as l,e as s,g as u,h as d,s as c,i as v,d as f}from"./currentVideoInfo-a8a254c2.js";import{a as m,r as p}from"./captions-f507e8ee.js";import{t as g,c as I}from"./skin-d5091b86.js";import h from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";function E(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function T(e){window.dataLayer=window.dataLayer||[],E("js",new Date),E("config",e)}function b(e,n){E("event",e,n)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?S(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):S(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var O={name:"@viewlift/player",version:"2.0.61",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=O.version;var A,L=function(e,n){var t,o,i,a,l,s,u,d;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:null!==(l=window)&&void 0!==l&&null!==(s=l.customData)&&void 0!==s&&s.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(d=u.customData)||void 0===d?void 0:d.overrideEntitlementBaseUrl)+"/video/status":j.get()+"".concat(null==w?void 0:w.getVideoDetails),params:_({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":O.version,"x-player-name":"videojs"},withCredentials:!0})},D=function(e,n){var t,o,i,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:j.get()+w.getLinearChannelDetails,params:_(_(_(_(_({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},P=function(e,n){var t,o,i=H(n),a=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):r({url:j.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},k=function(){var e=n(t.mark((function e(n){var o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return o=e.sent,e.abrupt("return",r({url:j.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:_({},n),params:_({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:j.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},R=function(e){var n=e.videoId;return r({method:"GET",url:j.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},j=(A=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(A=e)},get:function(){return A}}),F=function(e,n,t,o){return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},V=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},W=null;function N(){return{set:function(e){e&&(W=e)},get:function(){return W}}}var U=function(){var e=n(t.mark((function e(){var n,o,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=N().get(),o=j.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),B=null,M=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!V(n)){e.next=6;break}return B||(B=U().then((function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&N().set(i),r||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){B=null}))),e.abrupt("return",B);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},H=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function G(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?G(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Y=100,z=function(){var e,n,t,o,r,i,a,s=l();return"linearchannel"===((null==s?void 0:s.contentType)||"video")?null==s||null===(e=s.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==s?void 0:s.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==s||null===(r=s.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==s||null===(a=s.video)||void 0===a?void 0:a.id)||(null==s?void 0:s.id)};function q(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function K(){var e=window.sessionStorage.getItem("uid");return e||(e=q(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=n(t.mark((function e(){var n,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(e){return e?String(e):""}var Z=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function ee(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=q(),s="production",u="WEBSITE",d=null,c=0,v=null,f=0,m=0,p=!1,g=[],I=i(e);if(I){var h=function(){var e,n,t,o;return Math.round((null==I||null===(e=I.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)},y=Z((function(){for(var e=I.currentTime(),n=I.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0})),E=function(){var e=n(t.mark((function e(n){var o,i,d,c,v,f,m,p,g,I,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return g=e.sent,I=H(g),e.t0=Q,e.t1=Q,e.t2=null==I?void 0:I.site,e.t3=null==I?void 0:I.siteId,e.t4=u,e.t5=K(),e.t6=z(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11=s,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?$(n.adPosition):"",e.next=25,X();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=l,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(d=n.bitrate)&&void 0!==d?d:null,e.t25=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t26=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t27=null!==(f=n.bufferHealth)&&void 0!==f?f:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==a||null===(m=a.beacon)||void 0===m?void 0:m.params,e.t32=(0,e.t0)(e.t30,e.t31),h=[e.t32],r({url:(null==a||null===(p=a.beacon)||void 0===p?void 0:p.url)||j.get()+w.getBeaconUrl,method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){return console.error(e)}));case 41:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),T=function(e){if(!I.paused()&&I.readyState()>2)return clearInterval(d),clearInterval(v),e;var n,t=e+.1;return+t.toFixed(2)>=5&&m<4&&p?(m++,b("BUFFERING",Q({pfm:u,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime)},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:"BUFFERING",videoPosition:Math.floor(I.currentTime),isAdEvent:!1}),0):t},S=function(){var e=Math.floor(I.currentTime);I.on("error",(function(){var n,t=Math.floor(I.currentTime);clearInterval(d);var o=e===t?"FAILED_TO_START":"DROPPED_STREAM";b(o,Q({pfm:u,uid:K(),vid:z(),videoPosition:t},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:o,videoPosition:t,isAdEvent:!1})}))},_=function(){var e=Z((function(){var e;c=0,v=setInterval((function(){c=T(c)}),Y),b("PLAY",Q({pfm:u,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime)},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"PLAY",videoPosition:Math.floor(I.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":z(),watchTime:Math.floor(I.currentTime)})}));I.one("play",e)},O=function(){I.one("timeupdate",(function(){var e;clearInterval(v),clearInterval(d),f=c||0,b("FIRST_FRAME",Q({pfm:u,uid:K(),vid:z(),videoPosition:Math.floor(I.currentTime),ttFirstFrame:c,bufferHealth:y()},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"FIRST_FRAME",videoPosition:Math.floor(I.currentTime),isAdEvent:!1,ttFirstFrame:c,bufferHealth:y()}),p=!0,c=0}))},A=function(){var e=!1;I.on("waiting",Z((function(){p&&(e=!0,clearInterval(d),d=setInterval((function(){e&&!I.paused()?f=T(f):clearInterval(d)}),Y))}))),I.on("playing",Z((function(){e=!1,clearInterval(d)})))},L=function(){var e=function(e){var n,t,o,r=Q({videoPosition:Math.floor(I.currentTime),isAdEvent:!0,bufferHealth:y(),pfm:u,uid:K(),vid:z(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==a||null===(o=a.beacon)||void 0===o?void 0:o.params);b(e,Q({},r)),E(Q({eventName:e,adPosition:1},r))};I.on("adstart",(function(){e("AD_REQUEST"),e("AD_IMPRESSION")})),I.on("adskip",(function(){c=0})),I.on("adend",(function(){c=0}))},D=function(){I.on("timeupdate",(function(){var e=Math.floor(I.currentTime());if(e>=30&&e%30==0&&!g.includes(e)){var n,t=null===(n=I.el().getElementsByTagName("video"))||void 0===n?void 0:n[0];m=0,g.push(e),E({eventName:"PING",videoPosition:e,isAdEvent:!1,duration:30,resHeight:(null==t?void 0:t.videoHeight)||null,resWidth:(null==t?void 0:t.videoWidth)||null,bufferHealth:y(),bitrate:h()})}}))};S(),A(),L(),D(),_(),I.on("loadeddata",O)}else console.error("Videojs: Player instance not found.")}function ne(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&ee(e,n,t)}var te=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},oe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},re=function(e,n){var t=new Map;R({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),d(t)})).catch((function(e){return console.log(e)}))},ie=function(){var e=s.get();return e>=0?e+1:1},ae=function(){var e,n,t,o=u(),r=l(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=s.get(),d=null==o||null===(n=o[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===i}));return d>=0?d+1:1};function le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function se(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?le(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):le(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ue=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},de=function(e){var n=ce(e,"video.tags",[]),t=ce(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},ce=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},ve=function(){var n,t,o,r,l,s,u,d,c,v,f,m,p,g,I,h,y,E,T,b,w,S,_,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return A;var P=(null==D?void 0:D.siteName)||"",k=(null==D?void 0:D.contentType)||"video",C=(null==D||null===(o=D[k])||void 0===o?void 0:o.metadata)||(null==D||null===(r=D[k])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),R=i(L);if(!A.includes("VIEWLIFT_"))return A;var j,F=window.getComputedStyle(document.getElementById(L),null),V=Math.trunc(F.getPropertyValue("height").slice(0,-2)),W=Math.trunc(F.getPropertyValue("width").slice(0,-2)),N="linearchannel"===k?null==D||null===(s=D.linearchannel)||void 0===s||null===(u=s.channels)||void 0===u||null===(d=u.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===d||null===(c=d.content)||void 0===c?void 0:c.id:ce(D,"video.gist.id",""),U="linearchannel"===k?null==D||null===(v=D.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(m=f.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===m?void 0:m.title:ce(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(j=window)||void 0===j||j.__gpp("ping",(function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]})));var x=se(se({},fe(C)),{},(S={VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:ue(W,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ce(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(g=R.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(I=R.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:de(D),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ce(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ce(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ce(null===(h=window)||void 0===h||null===(y=h.app_data)||void 0===y||null===(E=y.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P?"":ce(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(w=b.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ce(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:ce(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ce(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:ie(),VIEWLIFT_CONTENT_TAGS:de(D),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(S,"VIEWLIFT_LAT",""),e(S,"VIEWLIFT_APP_BUNDLE",""),e(S,"VIEWLIFT_ATT_CONSENT",""),S),null===(_=window)||void 0===_||null===(O=_.customData)||void 0===O?void 0:O.macros);for(var H in x){var G=new RegExp(H,"g");A=A.replace(G,x[H])}return A},fe=function(e){var n,t,o,r,i,a,l={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){s.set(e.name,e.value)})));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,d=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return u||d?(oe()?u?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):d&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):u?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):d&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),u?l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):d&&(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),l=oe()?se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),l=oe()?se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),l=se(se({},l),{},{VIEWLIFT_AFID:s.get("afid")})},me=function(e,n){var t,o,r,i,a,l,s,u,d,c,v,f,m,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,h=null==e||null===(i=e[p])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,y=(null==e||null===(l=e[p])||void 0===l||null===(s=l.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(d=e[p])||void 0===d||null===(c=d.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[p])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(m=f.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=h&&h.hls)return ge(h);if(g){var T=Ie(I,n);return T.src=ve(T.src,n,e),T}if("Safari"!==te()&&E)return pe(I);if(y){var b=ge(I);return b.src=ve(b.src,n,e),b}if(null!=I&&I.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return w.src=ve(w.src,n,e),w}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ge=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ie=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,s=te();if(i(n),"Safari"===s){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,n,t){console.log(e),e&&i(e),i(null,t)}))}}}}}(r);return he(n),u}var d,c={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(d=window)||void 0===d?void 0:d.siteName)?(he(n),c.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var he=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ye=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},Ee=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},Te=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var be=!1,we=function(e,n,t){var o=ve(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,a=i(e);if(null!==a.el_){be=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),be&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()}),1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var u="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,u="touchend"),a.one(u,(function(){d&&a.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})),n.addEventListener(google.ima.AdEvent.Type.LOADED,(function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o)}};function Se(e,n){var t,o,r,a=i(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",(function(t){var o,r,i,u,d,c,v,f,m;if(Oe.enabled&&"input"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==s||s.focus()),p){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||ln(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(u=i.appcmsMain)||void 0===u||null===(d=u.adsConfig)||void 0===d?void 0:d.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||an(e,10)}}}),!0)}var _e,Oe=(_e=!0,{enable:function(){_e=!0},disable:function(){_e=!1},get enabled(){return _e}}),Ae="ssai-breakStart",Le="ssai-adImpression",De="ssai-firstQuartile",Pe="ssai-midpoint",ke="ssai-thirdQuartile",Ce="ssai-complete",Re="ssai-breakEnd",je={breakStart:Ae,impression:Le,firstQuartile:De,midpoint:Pe,thirdQuartile:ke,complete:Ce,breakEnd:Re};function Fe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=je[o];r&&t.trigger(r,n)}function Ve(e){var n=i(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Ae,e)},adImpression:function(e){return t(Le,e)},adFirstQuartile:function(e){return t(De,e)},adMidpoint:function(e){return t(Pe,e)},adThirdQuartile:function(e){return t(ke,e)},adComplete:function(e){return t(Ce,e)},adBreakEnd:function(e){return t(Re,e)}}}function We(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ne(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?We(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Ue(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Be(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Be(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function Be(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var Me,xe=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),He=(Me=null,{set:function(e){Me=e},get position(){return Me}});function Ge(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=n(t.mark((function e(n,o){var r,a,l,s,u,d,c,v,f,m,p,g,I,h,E,T,b,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),l=me(o,n),s=l.src,u=(null==o?void 0:o.contentType)||"video",d=(null==o||null===(r=o[u])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,c=s.replace("/dash/","/session/").replace("/master/","/session/"),c=ve(c,n,o),v=Ye(c),f=y(v,2),m=f[0],p=f[1],c=new URL(c.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=y(e,2),t=n[0],o=n[1];c.searchParams.set(t,o)})),e.prev=10,e.next=13,fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ne({adsParams:Ne({},m)},d&&{availSuppression:{mode:"BEHIND_LIVE_EDGE",value:"00:00:00"}}))});case 13:return g=e.sent,e.next=16,g.json();case 16:return I=e.sent,h="https://"+new URL(c).hostname,E=I.trackingUrl,T=I.manifestUrl,b=h+E,w=h+T,xe.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),l.src=w,e.abrupt("return",l);case 28:return e.prev=28,e.t0=e.catch(10),e.abrupt("return",l);case 31:case"end":return e.stop()}}),e,null,[[10,28]])})))).apply(this,arguments)}function Ye(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ue((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=y(t.value,2),a=i[0],l=i[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},u={},d=0,c=Object.entries(n);d<c.length;d++){var v=y(c[d],2),f=v[0],m=v[1];if(f.startsWith("ads."))s[f.replace(/^ads\./,"")]=m;else u[f]=m}return[s,u]}var ze,qe=(ze=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),ze=Array.isArray(e)?h(e):ze},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",ze),h(ze)}}),Ke=new Map;function Xe(e,n){return Je.apply(this,arguments)}function Je(){return Je=n(t.mark((function e(o,r){var a,l,s,u,d,c,v,f,m,p,I,y,E,T,b,w,S,_,O,A,L,D;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:D=function(e,n,t,r,a,l){var s=i(o);if(!s.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(s.currentTime());var u,d=Ue(t);try{var c=function(){var t,i,d,c=u.value,v=c.eventType,f=c.beaconUrls,m=c.startTimeInSeconds,p=c.startTime,g=c.durationInSeconds,I=m||0,h=f,y=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,E="".concat(I,"_").concat(v),T=Ke.get("pod-".concat(a))||[];if(console.warn(e,I,"map:",v,"condition1:",e>=I,"map:",Ke),e>=I&&!T.includes(E)){T.push(E),Ke.set("pod-".concat(a),T);try{L(v,n,h,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var b=He.position;He.set(null),setTimeout((function(){null!=b&&(s.currentTime(b),l())}),500)}if("function"==typeof y)try{var w,S={eventType:v,startTimeInSeconds:m,startTime:p,durationInSeconds:g,ad:null==n||null===(w=n.ads)||void 0===w?void 0:w[r],adIndex:r};y({adsData:S}),Fe(o,S)}catch(e){console.error("Error when calling ads callback:",e)}}};for(d.s();!(u=d.n()).done;)c()}catch(e){d.e(e)}finally{d.f()}}},L=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Ke.clear(),He.set(r),m=xe.get(),(p=i(o)).one("loadeddata",(function(){m&&O(m)})),I=new Map,y=new Map,E=-1,T=(null===(a=document)||void 0===a||null===(l=a.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==p||null===(s=p.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,w=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==p||null===(d=p.el())||void 0===d||null===(c=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,_=(null==p||null===(v=p.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,O=function(){var e=n(t.mark((function e(n){var a,l,s,u,d,c,v,f,m,p,O,L,P,k,C,R,j,F,V,W;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R=function(e){document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",R),0===e.button&&P()},C=function(e){},k=function(){var e,n=p.currentTime(),t=null,o=Ue(m);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(i+a));n>=i&&n<=l&&(t=l,I.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){p.currentTime(t+2.2)}),100))},P=function(){var e,n=p.currentTime(),t=null,o=Ue(m);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,s=Math.floor(i+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>s||n>i)&&!I.has(i)||n>=i&&n<=s)&&(t=i,I.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){p.currentTime(t+.4)}),100))},d=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),f=v.avails,m=[],p=i(o),O=p.controlBar.progressControl,L=O.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),f.map((function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(d=!0),m.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),!d&&r&&(p.currentTime(r),k()),null!=m&&m.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),window.adsQueueList=m),console.log(m,"data"),m.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",L.appendChild(i)}})),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=g((function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=m[o],r=t.startTimeInSeconds,i=t.durationInSeconds,a=t.ads,l=r+i;if(e>=r-1.2&&e<=l+1.2){e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&I.set(r,!0),Oe.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var s=e-r,u=0,d=0,c=0;c<a.length;c++){var v,f=null==a||null===(v=a[c])||void 0===v?void 0:v.durationInSeconds;if(s<u+f){d=c;break}u+=f}a[d];var p=Math.max(0,i-s),g=Math.round(p);j.style.display="block",W.textContent="".concat(d+1," of ").concat(a.length," • ").concat(A(g));var E=[];return null==a||a.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));E.push.apply(E,h(n))})),Array.isArray(a)&&0==(null==a?void 0:a.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),D(e,t,E,d,o,k),"break"}y.delete(r)},o=0;o<m.length;o++){if("break"===t())break}n||(j.style.display="none",O.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),Oe.enable())}}),1e3),p.on("timeupdate",p._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",(function(e){Oe.enabled&&"ArrowRight"==e.key&&(P(),an(o,10),e.stopPropagation())})),O.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",C),document.addEventListener("pointerup",R))})),null===(s=document)||void 0===s||null===(u=s.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach((function(e){return null==e?void 0:e.remove()})),(j=document.createElement("div")).className="ssai-ad-container",(F=document.createElement("div")).className="sponsored-adbox",(V=document.createElement("div")).className="sponsored-text",V.textContent="Sponsored Ad",F.append(V),(W=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",j.append(F),j.append(W),p.el().appendChild(j);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}}),e)}))),Je.apply(this,arguments)}function $e(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Ze(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function Ze(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function en(e){return nn.apply(this,arguments)}function nn(){return nn=n(t.mark((function e(o){var r,a,l,s,u,d,c,v,f,m,p,I,y,E,T,b,w,S,_,O,A,L,D,P,k,C,R;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:R=function(e,n,t,r,a){var l=i(o);if(!l.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(l.currentTime());var s,u=$e(t);try{for(u.s();!(s=u.n()).done;){var d,c,v,f=s.value,m=f.eventType,p=f.beaconUrls,g=f.startTimeInSeconds,I=f.startTime,h=f.durationInSeconds,y=g||0,E=p,T=(null===(d=window)||void 0===d||null===(c=d.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,b="".concat(y,"_").concat(m),w=P.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",m,"condition1:",e>=y,"map:",P),e>=y&&e<=y+k&&!w.includes(b)){w.push(b),P.set("pod-".concat(a),w);try{C(m,n,E,l)}catch(e){console.error("Error when calling triggerAdBeacon:",e,m,n)}if("function"==typeof T)try{var S,_={eventType:m,startTimeInSeconds:g,startTime:I,durationInSeconds:h,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[r],adIndex:r};T({adsData:_}),Fe(o,_)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){u.e(e)}finally{u.f()}}},C=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},I=function(){p&&clearInterval(p)},f=xe.get(),m=i(o),p=null,m.one("loadeddata",(function(){p=setInterval((function(){f&&!m.paused()&&D(f)}),2e3)})),m.on("sourceset",(function(e){null!=e&&e.src||I(),console.log(e,"sourceset")})),m.on("dispose",(function(){I()})),y=new Map,E=new Map,T=-1,b=null,w=(null===(r=document)||void 0===r||null===(a=r.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,S=(null==m||null===(l=m.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,_=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,O=(null==m||null===(u=m.el())||void 0===u||null===(d=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===d?void 0:d[0])||null,A=(null==m||null===(c=m.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,L=!1,D=function(){var e=n(t.mark((function e(n){var r,a,l,s,u,d,c,v,f,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new URL(n),b&&a.searchParams.append("nextToken",b),e.next=4,fetch(a.toString(),{method:"GET"});case 4:return l=e.sent,e.next=7,l.json();case 7:s=e.sent,u=s.avails,d=s.nextToken||null,b=d,c=[],v=i(o),f=v.controlBar.progressControl,m=f.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),u.map((function(e,n){var t,o;c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(t=e.adBreakTrackingEvents)||void 0===t||null===(o=t.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===o?void 0:o[0])||[]})})),console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c),c.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",m.appendChild(i)}})),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=g((function(){var e=v.currentTime();if(e!==T){T=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,a=o+r;if(e>=o-1.2&&e<=a+1.2){L=!!(e>=o&&e<=a&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>a&&y.set(o,!0),Oe.disable(),w&&w.classList.add("vjs-hidden"),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),A&&(A.style.pointerEvents="none",A.classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var l=e-o,s=0,u=0,d=0;d<i.length;d++){var v,m=null==i||null===(v=i[d])||void 0===v?void 0:v.durationInSeconds;if(l<s+m){u=d;break}s+=m}var p=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));p.push.apply(p,h(n))})),Array.isArray(i)&&0==(null==i?void 0:i.length)&&p.push(null==n?void 0:n.podSlotImpressionBeacon),R(e,n,p,u,t),"break"}E.delete(o)},t=0;t<c.length;t++){if("break"===n())break}L||(f.el().classList.remove("hide-progress-bar"),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),w&&w.classList.remove("vjs-hidden"),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),A&&(A.style.pointerEvents="auto",A.classList.remove("vjs-hidden")),Oe.enable())}}),1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),P=new Map,k=2.5;case 23:case"end":return e.stop()}}),e)}))),nn.apply(this,arguments)}function tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var on=function(e){o(e).play()},rn=function(e){o(e).pause()},an=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},ln=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},sn=function(e){return!!o.getPlayer("".concat(e))},un=function(e){return o(e).paused()},dn=function(){var e=n(t.mark((function e(o,r){var a,l,s,u=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>2&&void 0!==u[2]&&u[2],e.next=3,M();case 3:return l=e.sent,s=i(o),e.abrupt("return",new Promise((function(e,i){var u=(null==r?void 0:r.programs)||[];null==r||delete r.programs,D(r,l).then(function(){var i=n(t.mark((function n(i){var l,d,v,m,p,g,I,h;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(g=null==i?void 0:i.data,window.sid=q(),g.contentType="linearchannel",g.channelId=null==r?void 0:r.channelId,I=(null==g||null===(l=g.linearchannel)||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(v=d.app_data)||void 0===v||null===(m=v.appcmsMain)||void 0===m||null===(p=m.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,h=me(g,o),!I){n.next=11;break}return n.next=9,Ge(o,g);case 9:h=n.sent,a=!0;case 11:c(g),f(u),sessionStorage.setItem("program_switched",!0),h&&a?(pn(o,h),I&&en(o),s.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:g})}))):e({status:!0,msg:"Feed authenticated",response:g});case 15:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){i({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),cn=function(){var e=n(t.mark((function e(o,r,a){var l,s,d,f,g,I,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return f=e.sent,(u()||null)&&v(r),g=0,I=0,h=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(d=s.watchHistory)&&void 0!==d&&d.enable&&C(r,f).then((function(e){var n,t,o,r,i,a,l;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),g=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(I=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null)<95)&&(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null)})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})),e.abrupt("return",new Promise((function(e,a){L(r,f).then(function(){var r=n(t.mark((function n(r){var l,s,u,d,v,f,y,E,T,b,w,S,_,O,A,L,D,P,k,C,R,j,F,V,W,N,U,B,M,x,H,G,Q,Y,z,q,K,X;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(L=null==r?void 0:r.data,D=(null==L?void 0:L.contentType)||"video",P=(null==L||null===(l=L[D])||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(u=s.app_data)||void 0===u||null===(d=u.appcmsMain)||void 0===d||null===(v=d.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==L||null===(f=L.video)||void 0===f||null===(y=f.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,c(r.data),(C=(null==L||null===(E=L.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(b=T.adTags)||void 0===b||null===(w=b.web)||void 0===w?void 0:w.active)&&(null==L||null===(S=L.ads)||void 0===S||null===(_=S.preRoll)||void 0===_||null===(O=_.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&we(o,C,L),R=me(L,o),!P){n.next=12;break}return n.next=11,Ge(o,L);case 11:R=n.sent;case 12:R?(G=(null==L||null===(j=L.video)||void 0===j||null===(F=j.gist)||void 0===F?void 0:F.videoImageUrl)||(null==L||null===(V=L.video)||void 0===V||null===(W=V.gist)||void 0===W||null===(N=W.imageGist)||void 0===N?void 0:N.r16x9),(Q=i(o)).poster(G),pn(o,R),P&&Xe(o,h),Q.on("loadstart",(function(){k&&e({status:!0,msg:"Video Loaded",response:L})})),Q.on("loadeddata",(function(){Te(),e({status:!0,msg:"Video Loaded",response:L})})),Q.one("play",(function(){g&&!P&&I<95&&setTimeout((function(){Q.currentTime(g)}),0)})),Q.one("error",(function(){var e;a({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==L||null===(U=L.video)||void 0===U||null===(B=U.contentDetails)||void 0===B||null===(M=B.closedCaptions)||void 0===M?void 0:M.length)>0||(null==L||null===(x=L.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==L||null===(z=L.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==L||null===(K=L.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter((function(e){return"VTT"===e.format})),m(o,Y)):p(o)):(Ee(o,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}}),n)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){gn(e,o,a,r)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),vn=function(e,n,t){var o=i(e);return o.src(n),new Promise((function(e,n){var r=0;o.one("loadedmetadata",(function(){clearTimeout(r),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){r=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},fn=function(e){var n=i(e);if(mn(),I(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},mn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},pn=function(e,n){var t=i(e);t&&t.src(n)},gn=function(n,t,o,r){var i,a,l,s,u,d,c=null==n||null===(i=n.response)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);sn(t)&&Ee(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(d=window)||void 0===d?void 0:d.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?tn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):tn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},In=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")};export{ln as A,sn as B,cn as C,dn as D,fn as E,F,qe as G,Ve as H,j as I,x as J,N as K,V as L,T as M,Ke as N,Se as O,oe as P,un as Q,en as R,Xe as S,R as T,ae as a,ie as b,me as c,te as d,Te as e,In as f,K as g,Ee as h,ne as i,we as j,ye as k,pn as l,Ge as m,H as n,L as o,C as p,gn as q,M as r,k as s,D as t,P as u,re as v,vn as w,an as x,on as y,rn as z};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as r,a as i}from"./currentVideoInfo-a8a254c2.js";import{s as o}from"./autoNextVideo-a21e02dd.js";import{e as a}from"./icons-37daa6b3.js";import{p as l,d as u,t as s}from"./skin-d5091b86.js";import c from"@babel/runtime/helpers/typeof";import d from"video.js";import p from"@babel/runtime/helpers/asyncToGenerator";import m from"@babel/runtime/regenerator";import v from"@babel/runtime/helpers/defineProperty";import f from"@babel/runtime/helpers/slicedToArray";var g,h,b,y,x=[],w=!1,E=function(i,o){var s;if(w=!1,null!=o&&null!==(s=o.series)&&void 0!==s&&s.enable){var c;x=[];var d=r();null==d||d.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==o||null===(c=o.series)||void 0===c||c.cb}else{var p,m;x=(null==o||null===(p=o.relatedVideos)||void 0===p?void 0:p.content)||[],null==o||null===(m=o.relatedVideos)||void 0===m||m.cb}var v=t(i);v.on("timeupdate",(function(){var e,t;if(!w){var r=Math.floor(v.currentTime()),i=v.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var f,g=x.filter((function(e,t){return t==n()}));if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,b,y,E,N,j,k,C,O,T,I,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var L=null===(b=document.getElementsByClassName("next-ep-title"))||void 0===b?void 0:b[0],S=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],M=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],P=null===(N=g[0])||void 0===N?void 0:N.title;(null===(j=P)||void 0===j?void 0:j.length)>60&&(P=P.substr(0,60)+"..."),L.textContent="".concat(P),S.src=(null===(k=g[0])||void 0===k||null===(C=k.gist)||void 0===C||null===(O=C.imageGist)||void 0===O?void 0:O.r16x9)||(null==g||null===(T=g[0])||void 0===T?void 0:T.img)||(null===(I=window)||void 0===I||null===(B=I.customData)||void 0===B?void 0:B.fallbackImage),M.onclick=function(){return A(i)}}else{var R,D,$,X,F,U,_,G,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var V=document.createElement("div");V.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var z=document.createElement("div");z.className="next-ep-close",z.onclick=function(){q.style.visibility="hidden",w=!0},z.appendChild(l(a())),V.append(W),V.append(z);var H=null===(R=g[0])||void 0===R?void 0:R.title,Q=document.createElement("img");Q.className="next-ep-img",Q.src=(null===(D=g[0])||void 0===D||null===($=D.gist)||void 0===$||null===(X=$.imageGist)||void 0===X?void 0:X.r16x9)||(null==g||null===(F=g[0])||void 0===F?void 0:F.img)||(null===(U=window)||void 0===U||null===(_=U.customData)||void 0===_?void 0:_.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),Y.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Q),J.append(Y),J.onclick=u((function(){null==q||q.remove(),w=!0,A(i)}),400),q.append(V),q.append(J)}},A=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,x)}};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}g={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},h=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===c(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},b=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},y=function e(t){return"HTML"!==t.nodeName&&"static"===b(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=h({},g,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",h(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=y(o.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=y(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&h(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=b(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k="my-player";function C(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function O(){return(O=p(m.mark((function e(t){var n,r,i,o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,k,C;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=f(o,2),l=a[0],u=a[1],s=i.width/u,c=i.height/l,d=[],p=0;p<l;p++)for(v=0;v<u;v++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,v*s,p*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=f(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(j=N.app_data)||void 0===j||null===(k=j.appcmsMain)||void 0===k||null===(C=k.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function T(e,t){return I.apply(this,arguments)}function I(){return(I=p(m.mark((function e(t,n){var r,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",C(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)}function B(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(k);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return O.apply(this,arguments)}(s).then((function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri})))}}function L(e){return S.apply(this,arguments)}function S(){return(S=p(m.mark((function e(t){var n,r,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),i=f(r,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);n[s]=j(j({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},v(u,"left","-60px"),v(u,"border","1px solid transparent"),v(u,"borderRadius","4px"),u)})}})),r=Object.keys(n).map(Number).sort((function(e,t){return e-t})),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",s((function(e){return B(e,n,r)}),500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",s((function(e){return B(e,n,r)}),500))})),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M=function(){var e=p(m.mark((function e(t,n){var r,i,o,a,l,u,s,c;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,o=i.split("\n").map((function(e){return e.trim()})),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach((function(e){var t=e.split("="),n=f(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())})),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function P(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function R(e,t){return D.apply(this,arguments)}function D(){return(D=p(m.mark((function e(n,r){var o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,M,R,D,F,U,_,G,q,V,W,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,o=t(r),a=n.split("/"),l=a.findIndex((function(e){return"dash"===e.toLowerCase()})),u=P(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return p=e.sent,e.next=11,p.text();case 11:v=e.sent,g=new DOMParser,h=g.parseFromString(v,"application/xml"),b=(null==o?void 0:o.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],M=S.getAttribute("value"),R=null==M?void 0:M.split("x"),D=f(R,2),F=D[0],U=D[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),G=(_?B/_:B)/(F*U),q=L.getAttribute("id"),V=Math.round(b/G),W=Math.ceil(V/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<W;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:G,layout:M,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=f(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),oe=N.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=$(ce),w=0;w<se;w++)ve=me?X(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}}),e,null,[[5,76]])})))).apply(this,arguments)}function $(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function F(e){return U.apply(this,arguments)}function U(){return(U=p(m.mark((function e(n){var r,i,o,a,l,u,s,c,d,p,v,f,g,h,b,y;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,T(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return p=(null==d?void 0:d[0])||null,v=p.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,M(f,v);case 12:return g=e.sent,e.next=15,L(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,R(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,L(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{E as a,_ as b,F as i};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as r,a as i}from"./currentVideoInfo-a8a254c2.js";import{s as o}from"./autoNextVideo-c2ac0eb9.js";import{e as a}from"./icons-37daa6b3.js";import{p as l,d as u,t as s}from"./skin-d5091b86.js";import c from"@babel/runtime/helpers/typeof";import d from"video.js";import p from"@babel/runtime/helpers/asyncToGenerator";import m from"@babel/runtime/regenerator";import v from"@babel/runtime/helpers/defineProperty";import f from"@babel/runtime/helpers/slicedToArray";var g,h,b,y,x=[],w=!1,E=function(i,o){var s;if(w=!1,null!=o&&null!==(s=o.series)&&void 0!==s&&s.enable){var c;x=[];var d=r();null==d||d.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==o||null===(c=o.series)||void 0===c||c.cb}else{var p,m;x=(null==o||null===(p=o.relatedVideos)||void 0===p?void 0:p.content)||[],null==o||null===(m=o.relatedVideos)||void 0===m||m.cb}var v=t(i);v.on("timeupdate",(function(){var e,t;if(!w){var r=Math.floor(v.currentTime()),i=v.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var f,g=x.filter((function(e,t){return t==n()}));if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,b,y,E,N,j,k,C,O,T,I,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var L=null===(b=document.getElementsByClassName("next-ep-title"))||void 0===b?void 0:b[0],S=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],M=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],P=null===(N=g[0])||void 0===N?void 0:N.title;(null===(j=P)||void 0===j?void 0:j.length)>60&&(P=P.substr(0,60)+"..."),L.textContent="".concat(P),S.src=(null===(k=g[0])||void 0===k||null===(C=k.gist)||void 0===C||null===(O=C.imageGist)||void 0===O?void 0:O.r16x9)||(null==g||null===(T=g[0])||void 0===T?void 0:T.img)||(null===(I=window)||void 0===I||null===(B=I.customData)||void 0===B?void 0:B.fallbackImage),M.onclick=function(){return A(i)}}else{var R,D,$,X,F,U,_,G,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var V=document.createElement("div");V.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var z=document.createElement("div");z.className="next-ep-close",z.onclick=function(){q.style.visibility="hidden",w=!0},z.appendChild(l(a())),V.append(W),V.append(z);var H=null===(R=g[0])||void 0===R?void 0:R.title,Q=document.createElement("img");Q.className="next-ep-img",Q.src=(null===(D=g[0])||void 0===D||null===($=D.gist)||void 0===$||null===(X=$.imageGist)||void 0===X?void 0:X.r16x9)||(null==g||null===(F=g[0])||void 0===F?void 0:F.img)||(null===(U=window)||void 0===U||null===(_=U.customData)||void 0===_?void 0:_.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),Y.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Q),J.append(Y),J.onclick=u((function(){null==q||q.remove(),w=!0,A(i)}),400),q.append(V),q.append(J)}},A=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,x)}};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}g={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},h=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===c(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},b=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},y=function e(t){return"HTML"!==t.nodeName&&"static"===b(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=h({},g,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",h(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=y(o.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=y(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&h(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=b(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k="my-player";function C(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function O(){return(O=p(m.mark((function e(t){var n,r,i,o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,k,C;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=f(o,2),l=a[0],u=a[1],s=i.width/u,c=i.height/l,d=[],p=0;p<l;p++)for(v=0;v<u;v++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,v*s,p*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=f(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(j=N.app_data)||void 0===j||null===(k=j.appcmsMain)||void 0===k||null===(C=k.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function T(e,t){return I.apply(this,arguments)}function I(){return(I=p(m.mark((function e(t,n){var r,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",C(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)}function B(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(k);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return O.apply(this,arguments)}(s).then((function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri})))}}function L(e){return S.apply(this,arguments)}function S(){return(S=p(m.mark((function e(t){var n,r,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),i=f(r,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);n[s]=j(j({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},v(u,"left","-60px"),v(u,"border","1px solid transparent"),v(u,"borderRadius","4px"),u)})}})),r=Object.keys(n).map(Number).sort((function(e,t){return e-t})),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",s((function(e){return B(e,n,r)}),500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",s((function(e){return B(e,n,r)}),500))})),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M=function(){var e=p(m.mark((function e(t,n){var r,i,o,a,l,u,s,c;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,o=i.split("\n").map((function(e){return e.trim()})),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach((function(e){var t=e.split("="),n=f(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())})),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function P(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function R(e,t){return D.apply(this,arguments)}function D(){return(D=p(m.mark((function e(n,r){var o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,M,R,D,F,U,_,G,q,V,W,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,o=t(r),a=n.split("/"),l=a.findIndex((function(e){return"dash"===e.toLowerCase()})),u=P(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return p=e.sent,e.next=11,p.text();case 11:v=e.sent,g=new DOMParser,h=g.parseFromString(v,"application/xml"),b=(null==o?void 0:o.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],M=S.getAttribute("value"),R=null==M?void 0:M.split("x"),D=f(R,2),F=D[0],U=D[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),G=(_?B/_:B)/(F*U),q=L.getAttribute("id"),V=Math.round(b/G),W=Math.ceil(V/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<W;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:G,layout:M,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=f(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),oe=N.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=$(ce),w=0;w<se;w++)ve=me?X(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}}),e,null,[[5,76]])})))).apply(this,arguments)}function $(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function F(e){return U.apply(this,arguments)}function U(){return(U=p(m.mark((function e(n){var r,i,o,a,l,u,s,c,d,p,v,f,g,h,b,y;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,T(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return p=(null==d?void 0:d[0])||null,v=p.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,M(f,v);case 12:return g=e.sent,e.next=15,L(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,R(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,L(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{E as a,_ as b,F as i};