@viewlift/player-backup 2.0.73-smartTv → 2.0.74-smartTv
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-1f49211b.js → autoNextVideo-b7e91ff3.js} +1 -1
- package/cjs/bundle.css +2 -2
- package/cjs/{features-43b5c4f0.js → features-6abeaa09.js} +1 -1
- package/cjs/{generic-eff9f2d5.js → generic-6bf3ba02.js} +1 -1
- package/cjs/{index-0243ab75.js → index-2ee2a39b.js} +1 -1
- package/cjs/{index-2414bf78.js → index-391dd643.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-4152c3fb.js → multicamv2-421ec910.js} +1 -1
- package/cjs/{multicamv2-97f57710.js → multicamv2-4fdb520e.js} +1 -1
- package/cjs/{nextEpisodeButton-2f8a5dcf.js → nextEpisodeButton-076f0135.js} +1 -1
- package/cjs/{playlist-261f3571.js → playlist-3861f880.js} +1 -1
- package/cjs/{series-50af9773.js → series-3e119ba2.js} +1 -1
- package/cjs/{series-v2-138050e8.js → series-v2-26d49c70.js} +1 -1
- package/cjs/{series-v2-07ce65b0.js → series-v2-88c9fe30.js} +1 -1
- package/cjs/{skin-62650b0f.js → skin-0131ea28.js} +1 -1
- package/cjs/{skin-88b9e5b1.js → skin-5192bd86.js} +1 -1
- package/cjs/{skin-c02dde27.js → skin-75c04f58.js} +1 -1
- package/cjs/{skin-3bdd38e0.js → skin-beebad4a.js} +1 -1
- package/cjs/{skin-b79a429d.js → skin-eaccb61e.js} +1 -1
- package/cjs/{skin-10e868b9.js → skin-ebf1c61b.js} +1 -1
- package/cjs/{skin-3117b6f1.js → skin-ff25c748.js} +1 -1
- package/cjs/{videoSelector-bccb16ce.js → videoSelector-5e111200.js} +1 -1
- package/cjs/{videoSelector-338918fc.js → videoSelector-6171c2a7.js} +1 -1
- package/esm/{autoNextVideo-3f83b349.js → autoNextVideo-69a951c0.js} +1 -1
- package/esm/bundle.css +2 -2
- package/esm/{features-b4c00ff4.js → features-9a994afb.js} +1 -1
- package/esm/{generic-d14a701a.js → generic-ecdd66bc.js} +1 -1
- package/esm/{index-2257f4dd.js → index-82c877d2.js} +1 -1
- package/esm/{index-7e56199c.js → index-962dee5d.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-d637c59b.js → multicamv2-623eca21.js} +1 -1
- package/esm/{multicamv2-0545a0ae.js → multicamv2-6b4b899a.js} +1 -1
- package/esm/{nextEpisodeButton-3bdc1a02.js → nextEpisodeButton-36ca385c.js} +1 -1
- package/esm/{playlist-15c1cf5a.js → playlist-854a1c2a.js} +1 -1
- package/esm/{series-dc5effb9.js → series-ef0753e5.js} +1 -1
- package/esm/{series-v2-9b928249.js → series-v2-6d69b4c4.js} +1 -1
- package/esm/{series-v2-6ab87b3b.js → series-v2-9cec905e.js} +1 -1
- package/esm/{skin-0816e9e9.js → skin-1ce04d9e.js} +1 -1
- package/esm/{skin-049e3470.js → skin-290e8407.js} +1 -1
- package/esm/{skin-6308bce9.js → skin-5f4514f0.js} +1 -1
- package/esm/{skin-4d7c7bee.js → skin-6c7025a3.js} +1 -1
- package/esm/{skin-374cfb40.js → skin-c82837a4.js} +1 -1
- package/esm/{skin-a9e96e66.js → skin-ea45bc48.js} +1 -1
- package/esm/{skin-1ef7495f.js → skin-f339b646.js} +1 -1
- package/esm/{videoSelector-5275b274.js → videoSelector-e8d8f5e5.js} +1 -1
- package/esm/{videoSelector-05c05c24.js → videoSelector-fec759ed.js} +1 -1
- package/package.json +1 -1
- package/cjs/autoNextVideo-50bf0bcb.js +0 -1
- package/cjs/autoNextVideo-836d16c3.js +0 -1
- package/cjs/autoNextVideo-fb6d3116.js +0 -1
- package/cjs/autoNextVideo-ff4a5872.js +0 -1
- package/cjs/features-48d14d21.js +0 -1
- package/cjs/features-9ff981d6.js +0 -1
- package/cjs/features-d5a19c52.js +0 -1
- package/cjs/features-e8393717.js +0 -1
- package/cjs/generic-270e0c0e.js +0 -1
- package/cjs/generic-9dbaac2c.js +0 -1
- package/cjs/generic-b8561129.js +0 -1
- package/cjs/generic-c3ef1a4c.js +0 -1
- package/cjs/index-1b366d64.js +0 -1
- package/cjs/index-27816143.js +0 -1
- package/cjs/index-4282d6c8.js +0 -1
- package/cjs/index-7d0e79b0.js +0 -1
- package/cjs/index-7deb8e51.js +0 -1
- package/cjs/index-952059d8.js +0 -1
- package/cjs/index-a5bc95df.js +0 -1
- package/cjs/index-f8f03b72.js +0 -1
- package/cjs/multicamv2-4a03ff7a.js +0 -1
- package/cjs/multicamv2-59658c00.js +0 -1
- package/cjs/multicamv2-733a4c98.js +0 -1
- package/cjs/multicamv2-afab5e59.js +0 -1
- package/cjs/multicamv2-b0297c16.js +0 -1
- package/cjs/multicamv2-e582b219.js +0 -1
- package/cjs/multicamv2-e60917aa.js +0 -1
- package/cjs/multicamv2-f25bdf97.js +0 -1
- package/cjs/nextEpisodeButton-458c85bb.js +0 -1
- package/cjs/nextEpisodeButton-b62010fa.js +0 -1
- package/cjs/nextEpisodeButton-db512765.js +0 -1
- package/cjs/nextEpisodeButton-dbbf6459.js +0 -1
- package/cjs/playlist-452d88c2.js +0 -1
- package/cjs/playlist-da8132ef.js +0 -1
- package/cjs/playlist-dc7fd81d.js +0 -1
- package/cjs/playlist-f6dc47d2.js +0 -1
- package/cjs/series-5379adf3.js +0 -1
- package/cjs/series-62cf13d7.js +0 -1
- package/cjs/series-f93fa395.js +0 -1
- package/cjs/series-fa977c7b.js +0 -1
- package/cjs/series-v2-1540a570.js +0 -1
- package/cjs/series-v2-26fac2cb.js +0 -1
- package/cjs/series-v2-446ef683.js +0 -1
- package/cjs/series-v2-5db6fcc5.js +0 -1
- package/cjs/series-v2-a0ce7016.js +0 -1
- package/cjs/series-v2-aeb231ee.js +0 -1
- package/cjs/series-v2-dbf8f5c5.js +0 -1
- package/cjs/series-v2-f1dbee5e.js +0 -1
- package/cjs/skin-02cc96c7.js +0 -1
- package/cjs/skin-0d2d9d9c.js +0 -1
- package/cjs/skin-11200134.js +0 -1
- package/cjs/skin-1fb711b8.js +0 -1
- package/cjs/skin-251297dc.js +0 -1
- package/cjs/skin-28e40e43.js +0 -1
- package/cjs/skin-389e200a.js +0 -1
- package/cjs/skin-3e832338.js +0 -1
- package/cjs/skin-408082dc.js +0 -1
- package/cjs/skin-4e3109f5.js +0 -1
- package/cjs/skin-5e026b9e.js +0 -1
- package/cjs/skin-5e6de97a.js +0 -1
- package/cjs/skin-66bb1abb.js +0 -1
- package/cjs/skin-71bb1a0a.js +0 -1
- package/cjs/skin-7cd44fdf.js +0 -1
- package/cjs/skin-7de5dd6b.js +0 -1
- package/cjs/skin-9319e6f5.js +0 -1
- package/cjs/skin-95078d13.js +0 -1
- package/cjs/skin-a4de7dc7.js +0 -1
- package/cjs/skin-a9258d0d.js +0 -1
- package/cjs/skin-c165b563.js +0 -1
- package/cjs/skin-d1c415fe.js +0 -1
- package/cjs/skin-d7cd2ac9.js +0 -1
- package/cjs/skin-db8f3b08.js +0 -1
- package/cjs/skin-e0505707.js +0 -1
- package/cjs/skin-eb1292bc.js +0 -1
- package/cjs/skin-f0dbcafa.js +0 -1
- package/cjs/skin-fc778d21.js +0 -1
- package/cjs/videoSelector-3ab7f937.js +0 -1
- package/cjs/videoSelector-913574c8.js +0 -1
- package/cjs/videoSelector-9dba4d4f.js +0 -1
- package/cjs/videoSelector-c371fba4.js +0 -1
- package/cjs/videoSelector-c8c41440.js +0 -1
- package/cjs/videoSelector-d6d0e1ae.js +0 -1
- package/cjs/videoSelector-e2c21c25.js +0 -1
- package/cjs/videoSelector-eea96e59.js +0 -1
- package/esm/autoNextVideo-63dbac74.js +0 -1
- package/esm/autoNextVideo-793707f8.js +0 -1
- package/esm/autoNextVideo-b51e19f4.js +0 -1
- package/esm/autoNextVideo-f6f0062e.js +0 -1
- package/esm/features-005cbf2c.js +0 -1
- package/esm/features-6746c29c.js +0 -1
- package/esm/features-cc91a503.js +0 -1
- package/esm/features-e7e14dda.js +0 -1
- package/esm/generic-0d71c851.js +0 -1
- package/esm/generic-258d34e7.js +0 -1
- package/esm/generic-817644b6.js +0 -1
- package/esm/generic-9a919ba4.js +0 -1
- package/esm/index-11827a9e.js +0 -1
- package/esm/index-5312b88e.js +0 -1
- package/esm/index-5c199c09.js +0 -1
- package/esm/index-6d959e99.js +0 -1
- package/esm/index-7b9ff142.js +0 -1
- package/esm/index-9327e721.js +0 -1
- package/esm/index-b559de16.js +0 -1
- package/esm/index-c0023a66.js +0 -1
- package/esm/multicamv2-1656a706.js +0 -1
- package/esm/multicamv2-170df815.js +0 -1
- package/esm/multicamv2-2b22eed0.js +0 -1
- package/esm/multicamv2-3cb2c96b.js +0 -1
- package/esm/multicamv2-469790c5.js +0 -1
- package/esm/multicamv2-7d0dc57f.js +0 -1
- package/esm/multicamv2-fa150bd7.js +0 -1
- package/esm/multicamv2-fe3eda2b.js +0 -1
- package/esm/nextEpisodeButton-4fe59bd5.js +0 -1
- package/esm/nextEpisodeButton-c6968fe4.js +0 -1
- package/esm/nextEpisodeButton-d18af0e3.js +0 -1
- package/esm/nextEpisodeButton-f3651707.js +0 -1
- package/esm/playlist-1fc22b9e.js +0 -1
- package/esm/playlist-2131b25d.js +0 -1
- package/esm/playlist-3e586e91.js +0 -1
- package/esm/playlist-4f7cdb85.js +0 -1
- package/esm/series-04163ae5.js +0 -1
- package/esm/series-093b9d99.js +0 -1
- package/esm/series-3d86f785.js +0 -1
- package/esm/series-e696078a.js +0 -1
- package/esm/series-v2-6beb4cc3.js +0 -1
- package/esm/series-v2-76fe35d9.js +0 -1
- package/esm/series-v2-7afbd3dc.js +0 -1
- package/esm/series-v2-7d2aef8f.js +0 -1
- package/esm/series-v2-837b160e.js +0 -1
- package/esm/series-v2-aeb7ed74.js +0 -1
- package/esm/series-v2-dea9bcde.js +0 -1
- package/esm/series-v2-e0e817a0.js +0 -1
- package/esm/skin-08b2a668.js +0 -1
- package/esm/skin-287d98f0.js +0 -1
- package/esm/skin-367d2640.js +0 -1
- package/esm/skin-3688bf2d.js +0 -1
- package/esm/skin-48246846.js +0 -1
- package/esm/skin-49eb5647.js +0 -1
- package/esm/skin-5a4f7dff.js +0 -1
- package/esm/skin-61d92027.js +0 -1
- package/esm/skin-6290413d.js +0 -1
- package/esm/skin-68d81ff0.js +0 -1
- package/esm/skin-6f7eb9bb.js +0 -1
- package/esm/skin-6fb58468.js +0 -1
- package/esm/skin-77856587.js +0 -1
- package/esm/skin-7d9a1801.js +0 -1
- package/esm/skin-7f756cf9.js +0 -1
- package/esm/skin-8563e89f.js +0 -1
- package/esm/skin-8892d0cc.js +0 -1
- package/esm/skin-9701a9b0.js +0 -1
- package/esm/skin-9b61d1eb.js +0 -1
- package/esm/skin-ad92ef73.js +0 -1
- package/esm/skin-b56ca7dd.js +0 -1
- package/esm/skin-b64164a9.js +0 -1
- package/esm/skin-c3287a11.js +0 -1
- package/esm/skin-c360d3a7.js +0 -1
- package/esm/skin-d5e0b3e0.js +0 -1
- package/esm/skin-dfd47b2e.js +0 -1
- package/esm/skin-ec925239.js +0 -1
- package/esm/skin-f2961805.js +0 -1
- package/esm/videoSelector-0e2a85dc.js +0 -1
- package/esm/videoSelector-16ae6e6d.js +0 -1
- package/esm/videoSelector-4230d7f6.js +0 -1
- package/esm/videoSelector-93165559.js +0 -1
- package/esm/videoSelector-ce7a4a33.js +0 -1
- package/esm/videoSelector-d4e66214.js +0 -1
- package/esm/videoSelector-e3a73107.js +0 -1
- package/esm/videoSelector-fc9959a8.js +0 -1
package/cjs/generic-270e0c0e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("video.js"),i=require("axios"),o=require("./skin-3397dca5.js"),r=require("./browser-38ff3331.js"),l=require("js-cookie"),a=require("ua-parser-js"),d=require("./captions-3c7ca3a7.js");function s(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function u(e,t){s("event",e,t)}var c={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"},v={name:"@viewlift/player-backup",version:"2.0.71-smartTv",main:"dist/bundle.cjs.js",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","ua-parser-js":"^2.0.3","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"},browserslist:["chrome > 38, safari > 7"]};window.vl_player_version=v.version;var m,f=function(e,t){var n,o,r,l,a,d,s,u;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.overrideEntitlementBaseUrl)+"/video/status":E.get()+"".concat(null==c?void 0:c.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":v.version},withCredentials:!0})},p=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:E.get()+c.getLinearChannelDetails,params:Object.assign({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},g=function(){var n=e(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return o=e.sent,e.abrupt("return",i({url:E.get()+"".concat(null==c?void 0:c.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},n),params:Object.assign({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),I=function(e,t){var n,o,r=window.contentType;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},w=function(e){var t=e.videoId;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},E=(m=null==c?void 0:c.apiBaseUrl,{set:function(e){e&&(m=e)},get:function(){return m}}),T=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},h=null;function _(){return{set:function(e){e&&(h=e)},get:function(){return h}}}var y,b,F,D,L,V,R=function(){var n=e(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=_().get(),o=E.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);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 n.apply(this,arguments)}}(),S=null,W=function(){var n=e(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"))||!T(n)){e.next=6;break}return S||(S=R().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&_().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){S=null})),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),O=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){b=e},C=function(){return b},P=function(){return y},A=function(e){F=e},N=function(e){if(D){var t=D.get(e);A(t+1)}},B=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}}),M=0,U=function(){var e,t,n,i,o,r,l,a=C();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function j(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function k(){var e=window.sessionStorage.getItem("uid");return e||(e=j(),window.sessionStorage.setItem("uid",e),e)}function H(){return G.apply(this,arguments)}function G(){return(G=e(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(e){return e?String(e):""}window.initialise=function(e){window.sid=j(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,u(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),u("PLAY",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":U(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&M<4)M++,u("BUFFERING",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,u("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;u("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),u("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(M=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Y(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Y=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var n=e(t.mark(function e(n){var o,r,l,a,d,s,u,v,m,f,p,g,I,w,T,h,_,y,b,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return h=e.sent,_=O(h),y=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=Object,e.t1={aid:y,cid:b,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=k(),e.t4=U(),e.t5=n.url||document.location.href,e.t6=n.ref||document.referrer,e.t7=n.eventName,e.t8=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=n.dp1||"",e.t11=n.dp2||"",e.t12=n.dp3||"",e.t13=n.dp4||"",e.t14=n.dp5||"",e.t15=!0===n.isAdEvent?n.videoPosition:null,e.t16=!0===n.isAdEvent?z(n.adPosition):"",e.next=25,H();case 25:e.t17=e.sent,e.t18=n.playerType||"native",e.t19=n.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(s=n.bitrate)&&void 0!==s?s:null,e.t23=null!==(u=n.resHeight)&&void 0!==u?u:null,e.t24=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t25=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==n?void 0:n.duration)&&{duration:n.duration},e.t28=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),F=[e.t29],i({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||E.get()+c.getBeaconUrl,method:"post",headers:{Authorization:h},contentType:"application/x-www-form-urlencoded",dataType:"text",data:F}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var q=function(){var e=B.get();return e>=0?e+1:1},X=function(){var e,t,n,i=P(),o=C(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=B.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=a.UAParser(navigator.userAgent);var J=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},K=function(e){var t=Q(e,"video.tags",[]),n=Q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Q=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},Z=function(){var e,t,n,i,r,a,d,s,u,c,v,m,f,p,g,I,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",L=(null==F?void 0:F.contentType)||"video",V=(null==F||null===(e=F[L])||void 0===e?void 0:e.metadata)||(null==F||null===(t=F[L])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),R=o.getPlayer(b);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(b),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),x=Math.trunc(W.getPropertyValue("width").slice(0,-2)),C="linearchannel"===L?null==F||null===(i=F.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(a=r.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===a||null===(d=a.content)||void 0===d?void 0:d.id:Q(F,"video.gist.id",""),P="linearchannel"===L?null==F||null===(s=F.linearchannel)||void 0===s||null===(u=s.channels)||void 0===u||null===(c=u.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=Object.assign({},$(V),{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:J(x,O),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===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Q(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:K(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Q(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Q(null===(p=window)||void 0===p||null===(g=p.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Q(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:P,VIEWLIFT_CONTENT_SERIES_TITLE:Q(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Q(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:X(),VIEWLIFT_SEASON_NUMBER:q(),VIEWLIFT_CONTENT_TAGS:K(F),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var M in B){var U=new RegExp(M,"g");y=y.replace(U,B[M])}return y},$=function(e){var t,n,i,o,l,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ee(s);var s={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){u.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(l=window)||void 0===l||null===(a=l.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(r.isMobile()?c?s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):c?s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),c?s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),s=r.isMobile()?Object.assign({},s,{VIEWLIFT_PROF:u.get("prof.mweb")||""}):Object.assign({},s,{VIEWLIFT_PROF:u.get("prof.web")||""})):(s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),s=r.isMobile()?Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),s=Object.assign({},s,{VIEWLIFT_AFID:u.get("afid")})},ee=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var s=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,u=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(s||u)&&(u?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},te=function(e){var t=null;try{var n,i,o,r,l,a,d,s,u,c,v,m,f,p,g,I,w,E,T,h,_,y,b,F,D,L,V,R,S;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(s=d.adTags)&&void 0!==s&&null!==(u=s.lg_tv)&&void 0!==u&&u.active){var W,O,x,C;t=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(x=O.adTags)||void 0===x||null===(C=x.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var P,A,N,B;t=null==e||null===(P=e.ads)||void 0===P||null===(A=P.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(g=p.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,U,j,k;t=null==e||null===(M=e.ads)||void 0===M||null===(U=M.preRoll)||void 0===U||null===(j=U.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(y=e.ads)||void 0===y||null===(b=y.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(V=L.preRoll)||void 0===V||null===(R=V.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return t},ne=function(e,t){var n,i,o,l,a,d,s,u,c,v,m,f,p,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(l=e[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(s=d.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return oe(E);if(I){var _=re(w,t);return _.src=Z(_.src,t,e),_}if("Safari"!==r.detectBrowser()&&h)return ie(w);if(T){var y=oe(w);return y.src=Z(y.src,t,e),y}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=Z(b.src,t,e),b}return null},ie=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},oe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},re=function(e,t){var i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=r.detectBrowser();if(o.getPlayer(t),"Safari"===d){var s=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};n.xhr(o,function(e,t,n){console.log(e),e&&i(e),i(null,new Uint8Array(n))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};n.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(i);return le(t),s}var u,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(le(t),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var le=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==r.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ae=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},de=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var se=!1,ue=function(e,t,n){var i=Z(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,l=o.getPlayer(e);if(null!==l.el_){se=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var s="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,s="touchend"),l.one(s,function(){u&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},ce=function(e){return!!n.getPlayer("".concat(e))},ve=function(){var n=e(t.mark(function e(n,i){var r,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,W();case 3:return l=e.sent,a=o.getPlayer(n),e.abrupt("return",new Promise(function(e,t){p(i,l).then(function(t){var o=null==t?void 0:t.data;window.sid=j(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=ne(o,n);x(o),l&&r?(pe(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),me=function(){var n=e(t.mark(function e(n,i){var r,l,a,s,u,c,v=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,W();case 4:s=e.sent;case 5:return(P()||null)&&N(i),u=0,c=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&I(i,s).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){f(i,s).then(function(i){var r,l,a=null==i?void 0:i.data,s=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;x(i.data);var v=te(a);v&&ue(n,v,a);var m=ne(a,n);if(m){var f,p,g,I,w,E,T,h,_,y,b,F,D,L,V=(null==a||null===(f=a.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),R=o.getPlayer(n);if(R.poster(V),pe(n,m),R.on("loadstart",function(){s&&e({status:!0,msg:"Video Loaded",response:a})}),R.on("loadeddata",function(){de(),e({status:!0,msg:"Video Loaded",response:a})}),R.one("play",function(){u&&c<95&&setTimeout(function(){R.currentTime(u)},0)}),R.one("error",function(){var e;t({status:!1,msg:(null==R||null===(e=R.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(y=_.closedCaptions)||void 0===y?void 0:y.length)>0)b=((null==a||null===(F=a.video)||void 0===F||null===(D=F.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),d.addCaptions(n,b);else d.removeCaptions(n)}else ae(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ge(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),fe=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()},pe=function(e,t){var n=o.getPlayer(e);n&&n.src(t)},ge=function(e,t,n,i){var o,r,l,a,d,s,u=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);ce(t)&&ae(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[u])||"".concat(c)),n&&n(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))};exports.authenticateLC=ve,exports.baseUrlManager=E,exports.clearError=de,exports.createIdxMapping=function(e){D=new Map,e.map(function(e,t){D.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;w({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=o.getPlayer(e);if(fe(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=te,exports.getCurrentSeries=P,exports.getCurrentVideo=C,exports.getDecodedToken=O,exports.getEntitlementData=function(e,t,n,o){return i({url:n,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:t},withCredentials:!0})},exports.getEpisodeNumber=X,exports.getLinearChannelDetails=p,exports.getSeasonNumber=q,exports.getSeriesDetails=function(e,t){var n,o,r=O(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):i({url:E.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return L},exports.getSource=ne,exports.getToken=W,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=k,exports.getVideoDetails=f,exports.getVideoIdx=function(){return F},exports.getVideoInfo=I,exports.handleError=ae,exports.initialiseAdvertisement=ue,exports.initiateErrorHandling=ge,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=o.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return n(e).paused()},exports.isPlayerInitialised=ce,exports.isTokenExpired=T,exports.load=me,exports.loadVideo=pe,exports.loadVideoInstantly=function(e,t,n){var i=o.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){n(e).pause()},exports.play=function(e){n(e).play()},exports.refreshTokenManager=_,exports.replaceMacros=Z,exports.rewind=function(e,t){var i=n(e),o=i.currentTime(),r=o<=t?0:o-t;i.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],s("js",new Date),s("config",e)},exports.saveWatchHistory=g,exports.seasonIdxManager=B,exports.setCurrentSeries=function(e){y=e},exports.setCurrentVideo=x,exports.setVideoIdx=A,exports.setVideoIdxById=N,exports.skip=function(e,t){var i=n(e),o=i.currentTime()+t;i.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
package/cjs/generic-9dbaac2c.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("video.js"),i=require("axios"),o=require("./skin-3397dca5.js"),r=require("./browser-38ff3331.js"),l=require("js-cookie"),a=require("ua-parser-js"),d=require("./captions-3c7ca3a7.js");function s(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function u(e,t){s("event",e,t)}var c={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"},v={name:"@viewlift/player-backup",version:"2.0.72-smartTv",main:"dist/bundle.cjs.js",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","ua-parser-js":"^2.0.3","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"},browserslist:["chrome > 38, safari > 7"]};window.vl_player_version=v.version;var m,f=function(e,t){var n,o,r,l,a,d,s,u;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.overrideEntitlementBaseUrl)+"/video/status":E.get()+"".concat(null==c?void 0:c.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":v.version},withCredentials:!0})},p=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:E.get()+c.getLinearChannelDetails,params:Object.assign({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},g=function(){var n=e(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return o=e.sent,e.abrupt("return",i({url:E.get()+"".concat(null==c?void 0:c.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},n),params:Object.assign({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),I=function(e,t){var n,o,r=window.contentType;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},w=function(e){var t=e.videoId;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},E=(m=null==c?void 0:c.apiBaseUrl,{set:function(e){e&&(m=e)},get:function(){return m}}),T=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},h=null;function _(){return{set:function(e){e&&(h=e)},get:function(){return h}}}var y,b,F,D,L,V,R=function(){var n=e(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=_().get(),o=E.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);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 n.apply(this,arguments)}}(),S=null,W=function(){var n=e(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"))||!T(n)){e.next=6;break}return S||(S=R().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&_().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){S=null})),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),O=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){b=e},C=function(){return b},P=function(){return y},A=function(e){F=e},N=function(e){if(D){var t=D.get(e);A(t+1)}},B=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}}),M=0,U=function(){var e,t,n,i,o,r,l,a=C();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function j(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function k(){var e=window.sessionStorage.getItem("uid");return e||(e=j(),window.sessionStorage.setItem("uid",e),e)}function H(){return G.apply(this,arguments)}function G(){return(G=e(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(e){return e?String(e):""}window.initialise=function(e){window.sid=j(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,u(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),u("PLAY",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":U(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&M<4)M++,u("BUFFERING",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,u("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;u("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),u("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(M=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Y(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Y=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var n=e(t.mark(function e(n){var o,r,l,a,d,s,u,v,m,f,p,g,I,w,T,h,_,y,b,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return h=e.sent,_=O(h),y=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=Object,e.t1={aid:y,cid:b,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=k(),e.t4=U(),e.t5=n.url||document.location.href,e.t6=n.ref||document.referrer,e.t7=n.eventName,e.t8=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=n.dp1||"",e.t11=n.dp2||"",e.t12=n.dp3||"",e.t13=n.dp4||"",e.t14=n.dp5||"",e.t15=!0===n.isAdEvent?n.videoPosition:null,e.t16=!0===n.isAdEvent?z(n.adPosition):"",e.next=25,H();case 25:e.t17=e.sent,e.t18=n.playerType||"native",e.t19=n.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(s=n.bitrate)&&void 0!==s?s:null,e.t23=null!==(u=n.resHeight)&&void 0!==u?u:null,e.t24=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t25=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==n?void 0:n.duration)&&{duration:n.duration},e.t28=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),F=[e.t29],i({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||E.get()+c.getBeaconUrl,method:"post",headers:{Authorization:h},contentType:"application/x-www-form-urlencoded",dataType:"text",data:F}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var q=function(){var e=B.get();return e>=0?e+1:1},X=function(){var e,t,n,i=P(),o=C(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=B.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=a.UAParser(navigator.userAgent);var J=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},K=function(e){var t=Q(e,"video.tags",[]),n=Q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Q=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},Z=function(){var e,t,n,i,r,a,d,s,u,c,v,m,f,p,g,I,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",L=(null==F?void 0:F.contentType)||"video",V=(null==F||null===(e=F[L])||void 0===e?void 0:e.metadata)||(null==F||null===(t=F[L])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),R=o.getPlayer(b);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(b),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),x=Math.trunc(W.getPropertyValue("width").slice(0,-2)),C="linearchannel"===L?null==F||null===(i=F.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(a=r.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===a||null===(d=a.content)||void 0===d?void 0:d.id:Q(F,"video.gist.id",""),P="linearchannel"===L?null==F||null===(s=F.linearchannel)||void 0===s||null===(u=s.channels)||void 0===u||null===(c=u.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=Object.assign({},$(V),{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:J(x,O),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===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Q(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:K(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Q(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Q(null===(p=window)||void 0===p||null===(g=p.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Q(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:P,VIEWLIFT_CONTENT_SERIES_TITLE:Q(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Q(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:X(),VIEWLIFT_SEASON_NUMBER:q(),VIEWLIFT_CONTENT_TAGS:K(F),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var M in B){var U=new RegExp(M,"g");y=y.replace(U,B[M])}return y},$=function(e){var t,n,i,o,l,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ee(s);var s={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){u.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(l=window)||void 0===l||null===(a=l.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(r.isMobile()?c?s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):c?s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),c?s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),s=r.isMobile()?Object.assign({},s,{VIEWLIFT_PROF:u.get("prof.mweb")||""}):Object.assign({},s,{VIEWLIFT_PROF:u.get("prof.web")||""})):(s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),s=r.isMobile()?Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),s=Object.assign({},s,{VIEWLIFT_AFID:u.get("afid")})},ee=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var s=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,u=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(s||u)&&(u?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},te=function(e){var t=null;try{var n,i,o,r,l,a,d,s,u,c,v,m,f,p,g,I,w,E,T,h,_,y,b,F,D,L,V,R,S;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(s=d.adTags)&&void 0!==s&&null!==(u=s.lg_tv)&&void 0!==u&&u.active){var W,O,x,C;t=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(x=O.adTags)||void 0===x||null===(C=x.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var P,A,N,B;t=null==e||null===(P=e.ads)||void 0===P||null===(A=P.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(g=p.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,U,j,k;t=null==e||null===(M=e.ads)||void 0===M||null===(U=M.preRoll)||void 0===U||null===(j=U.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(y=e.ads)||void 0===y||null===(b=y.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(V=L.preRoll)||void 0===V||null===(R=V.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return t},ne=function(e,t){var n,i,o,l,a,d,s,u,c,v,m,f,p,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(l=e[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(s=d.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return oe(E);if(I){var _=re(w,t);return _.src=Z(_.src,t,e),_}if("Safari"!==r.detectBrowser()&&h)return ie(w);if(T){var y=oe(w);return y.src=Z(y.src,t,e),y}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=Z(b.src,t,e),b}return null},ie=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},oe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},re=function(e,t){var i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=r.detectBrowser();if(o.getPlayer(t),"Safari"===d){var s=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};n.xhr(o,function(e,t,n){console.log(e),e&&i(e),i(null,new Uint8Array(n))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};n.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(i);return le(t),s}var u,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(le(t),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var le=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==r.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ae=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},de=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var se=!1,ue=function(e,t,n){var i=Z(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,l=o.getPlayer(e);if(null!==l.el_){se=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var s="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,s="touchend"),l.one(s,function(){u&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},ce=function(e){return!!n.getPlayer("".concat(e))},ve=function(){var n=e(t.mark(function e(n,i){var r,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,W();case 3:return l=e.sent,a=o.getPlayer(n),e.abrupt("return",new Promise(function(e,t){p(i,l).then(function(t){var o=null==t?void 0:t.data;window.sid=j(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=ne(o,n);x(o),l&&r?(pe(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),me=function(){var n=e(t.mark(function e(n,i){var r,l,a,s,u,c,v=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,W();case 4:s=e.sent;case 5:return(P()||null)&&N(i),u=0,c=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&I(i,s).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){f(i,s).then(function(i){var r,l,a=null==i?void 0:i.data,s=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;x(i.data);var v=te(a);v&&ue(n,v,a);var m=ne(a,n);if(m){var f,p,g,I,w,E,T,h,_,y,b,F,D,L,V=(null==a||null===(f=a.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),R=o.getPlayer(n);if(R.poster(V),pe(n,m),R.on("loadstart",function(){s&&e({status:!0,msg:"Video Loaded",response:a})}),R.on("loadeddata",function(){de(),e({status:!0,msg:"Video Loaded",response:a})}),R.one("play",function(){u&&c<95&&setTimeout(function(){R.currentTime(u)},0)}),R.one("error",function(){var e;t({status:!1,msg:(null==R||null===(e=R.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(y=_.closedCaptions)||void 0===y?void 0:y.length)>0)b=((null==a||null===(F=a.video)||void 0===F||null===(D=F.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),d.addCaptions(n,b);else d.removeCaptions(n)}else ae(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ge(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),fe=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()},pe=function(e,t){var n=o.getPlayer(e);n&&n.src(t)},ge=function(e,t,n,i){var o,r,l,a,d,s,u=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);ce(t)&&ae(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[u])||"".concat(c)),n&&n(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))};exports.authenticateLC=ve,exports.baseUrlManager=E,exports.clearError=de,exports.createIdxMapping=function(e){D=new Map,e.map(function(e,t){D.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;w({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=o.getPlayer(e);if(fe(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=te,exports.getCurrentSeries=P,exports.getCurrentVideo=C,exports.getDecodedToken=O,exports.getEntitlementData=function(e,t,n,o){return i({url:n,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:t},withCredentials:!0})},exports.getEpisodeNumber=X,exports.getLinearChannelDetails=p,exports.getSeasonNumber=q,exports.getSeriesDetails=function(e,t){var n,o,r=O(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):i({url:E.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return L},exports.getSource=ne,exports.getToken=W,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=k,exports.getVideoDetails=f,exports.getVideoIdx=function(){return F},exports.getVideoInfo=I,exports.handleError=ae,exports.initialiseAdvertisement=ue,exports.initiateErrorHandling=ge,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=o.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return n(e).paused()},exports.isPlayerInitialised=ce,exports.isTokenExpired=T,exports.load=me,exports.loadVideo=pe,exports.loadVideoInstantly=function(e,t,n){var i=o.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){n(e).pause()},exports.play=function(e){n(e).play()},exports.refreshTokenManager=_,exports.replaceMacros=Z,exports.rewind=function(e,t){var i=n(e),o=i.currentTime(),r=o<=t?0:o-t;i.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],s("js",new Date),s("config",e)},exports.saveWatchHistory=g,exports.seasonIdxManager=B,exports.setCurrentSeries=function(e){y=e},exports.setCurrentVideo=x,exports.setVideoIdx=A,exports.setVideoIdxById=N,exports.skip=function(e,t){var i=n(e),o=i.currentTime()+t;i.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
package/cjs/generic-b8561129.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("video.js"),i=require("axios"),o=require("./skin-3397dca5.js"),r=require("./browser-38ff3331.js"),l=require("js-cookie"),a=require("ua-parser-js"),d=require("./captions-3c7ca3a7.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function s(e,t){u("event",e,t)}var c={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"},v={name:"@viewlift/player-backup",version:"2.0.72-smartTv",main:"dist/bundle.cjs.js",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","ua-parser-js":"^2.0.3","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=v.version;var m,f=function(e,t){var n,o,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":E.get()+"".concat(null==c?void 0:c.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":v.version},withCredentials:!0})},p=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:E.get()+c.getLinearChannelDetails,params:Object.assign({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},g=function(){var n=e(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return o=e.sent,e.abrupt("return",i({url:E.get()+"".concat(null==c?void 0:c.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},n),params:Object.assign({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),I=function(e,t){var n,o,r=window.contentType;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},w=function(e){var t=e.videoId;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},E=(m=null==c?void 0:c.apiBaseUrl,{set:function(e){e&&(m=e)},get:function(){return m}}),T=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},h=null;function _(){return{set:function(e){e&&(h=e)},get:function(){return h}}}var y,b,F,D,L,V,R=function(){var n=e(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=_().get(),o=E.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);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 n.apply(this,arguments)}}(),S=null,W=function(){var n=e(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"))||!T(n)){e.next=6;break}return S||(S=R().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&_().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){S=null})),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),O=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){b=e},C=function(){return b},P=function(){return y},A=function(e){F=e},N=function(e){if(D){var t=D.get(e);A(t+1)}},B=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}}),M=0,U=function(){var e,t,n,i,o,r,l,a=C();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function j(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function k(){var e=window.sessionStorage.getItem("uid");return e||(e=j(),window.sessionStorage.setItem("uid",e),e)}function H(){return G.apply(this,arguments)}function G(){return(G=e(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(e){return e?String(e):""}window.initialise=function(e){window.sid=j(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,s(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),s("PLAY",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":U(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&M<4)M++,s("BUFFERING",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,s("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;s("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),s("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(M=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Y(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Y=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var n=e(t.mark(function e(n){var o,r,l,a,d,u,s,v,m,f,p,g,I,w,T,h,_,y,b,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return h=e.sent,_=O(h),y=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=Object,e.t1={aid:y,cid:b,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=k(),e.t4=U(),e.t5=n.url||document.location.href,e.t6=n.ref||document.referrer,e.t7=n.eventName,e.t8=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=n.dp1||"",e.t11=n.dp2||"",e.t12=n.dp3||"",e.t13=n.dp4||"",e.t14=n.dp5||"",e.t15=!0===n.isAdEvent?n.videoPosition:null,e.t16=!0===n.isAdEvent?z(n.adPosition):"",e.next=25,H();case 25:e.t17=e.sent,e.t18=n.playerType||"native",e.t19=n.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t23=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t24=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t25=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==n?void 0:n.duration)&&{duration:n.duration},e.t28=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),F=[e.t29],i({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||E.get()+c.getBeaconUrl,method:"post",headers:{Authorization:h},contentType:"application/x-www-form-urlencoded",dataType:"text",data:F}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var q=function(){var e=B.get();return e>=0?e+1:1},X=function(){var e,t,n,i=P(),o=C(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=B.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=a.UAParser(navigator.userAgent);var J=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},K=function(e){var t=Q(e,"video.tags",[]),n=Q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Q=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},Z=function(){var e,t,n,i,r,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",L=(null==F?void 0:F.contentType)||"video",V=(null==F||null===(e=F[L])||void 0===e?void 0:e.metadata)||(null==F||null===(t=F[L])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),R=o.getPlayer(b);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(b),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),x=Math.trunc(W.getPropertyValue("width").slice(0,-2)),C="linearchannel"===L?null==F||null===(i=F.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(a=r.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===a||null===(d=a.content)||void 0===d?void 0:d.id:Q(F,"video.gist.id",""),P="linearchannel"===L?null==F||null===(u=F.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=Object.assign({},$(V),{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:J(x,O),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===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Q(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:K(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Q(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Q(null===(p=window)||void 0===p||null===(g=p.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Q(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:P,VIEWLIFT_CONTENT_SERIES_TITLE:Q(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Q(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:X(),VIEWLIFT_SEASON_NUMBER:q(),VIEWLIFT_CONTENT_TAGS:K(F),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var M in B){var U=new RegExp(M,"g");y=y.replace(U,B[M])}return y},$=function(e){var t,n,i,o,l,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ee(u);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(l=window)||void 0===l||null===(a=l.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(r.isMobile()?c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=Object.assign({},u,{VIEWLIFT_AFID:s.get("afid")})},ee=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(u||s)&&(s?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},te=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y,b,F,D,L,V,R,S;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var W,O,x,C;t=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(x=O.adTags)||void 0===x||null===(C=x.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var P,A,N,B;t=null==e||null===(P=e.ads)||void 0===P||null===(A=P.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(g=p.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,U,j,k;t=null==e||null===(M=e.ads)||void 0===M||null===(U=M.preRoll)||void 0===U||null===(j=U.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(y=e.ads)||void 0===y||null===(b=y.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(V=L.preRoll)||void 0===V||null===(R=V.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return t},ne=function(e,t){var n,i,o,l,a,d,u,s,c,v,m,f,p,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(l=e[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return oe(E);if(I){var _=re(w,t);return _.src=Z(_.src,t,e),_}if("Safari"!==r.detectBrowser()&&h)return ie(w);if(T){var y=oe(w);return y.src=Z(y.src,t,e),y}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=Z(b.src,t,e),b}return null},ie=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},oe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},re=function(e,t){var i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=r.detectBrowser();if(o.getPlayer(t),"Safari"===d){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};n.xhr(o,function(e,t,n){console.log(e),e&&i(e),i(null,new Uint8Array(n))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};n.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(i);return le(t),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(le(t),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var le=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==r.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ae=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},de=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ue=!1,se=function(e,t,n){var i=Z(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,l=o.getPlayer(e);if(null!==l.el_){ue=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ue&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},ce=function(e){return!!n.getPlayer("".concat(e))},ve=function(){var n=e(t.mark(function e(n,i){var r,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,W();case 3:return l=e.sent,a=o.getPlayer(n),e.abrupt("return",new Promise(function(e,t){p(i,l).then(function(t){var o=null==t?void 0:t.data;window.sid=j(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=ne(o,n);x(o),l&&r?(pe(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),me=function(){var n=e(t.mark(function e(n,i){var r,l,a,u,s,c,v=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,W();case 4:u=e.sent;case 5:return(P()||null)&&N(i),s=0,c=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&I(i,u).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){f(i,u).then(function(i){var r,l,a=null==i?void 0:i.data,u=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;x(i.data);var v=te(a);v&&se(n,v,a);var m=ne(a,n);if(m){var f,p,g,I,w,E,T,h,_,y,b,F,D,L,V=(null==a||null===(f=a.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),R=o.getPlayer(n);if(R.poster(V),pe(n,m),R.on("loadstart",function(){u&&e({status:!0,msg:"Video Loaded",response:a})}),R.on("loadeddata",function(){de(),e({status:!0,msg:"Video Loaded",response:a})}),R.one("play",function(){s&&c<95&&setTimeout(function(){R.currentTime(s)},0)}),R.one("error",function(){var e;t({status:!1,msg:(null==R||null===(e=R.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(y=_.closedCaptions)||void 0===y?void 0:y.length)>0)b=((null==a||null===(F=a.video)||void 0===F||null===(D=F.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),d.addCaptions(n,b);else d.removeCaptions(n)}else ae(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ge(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),fe=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()},pe=function(e,t){var n=o.getPlayer(e);n&&n.src(t)},ge=function(e,t,n,i){var o,r,l,a,d,u,s=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);ce(t)&&ae(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[s])||"".concat(c)),n&&n(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))};exports.authenticateLC=ve,exports.baseUrlManager=E,exports.clearError=de,exports.createIdxMapping=function(e){D=new Map,e.map(function(e,t){D.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;w({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=o.getPlayer(e);if(fe(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=te,exports.getCurrentSeries=P,exports.getCurrentVideo=C,exports.getDecodedToken=O,exports.getEntitlementData=function(e,t,n,o){return i({url:n,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:t},withCredentials:!0})},exports.getEpisodeNumber=X,exports.getLinearChannelDetails=p,exports.getSeasonNumber=q,exports.getSeriesDetails=function(e,t){var n,o,r=O(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):i({url:E.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return L},exports.getSource=ne,exports.getToken=W,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=k,exports.getVideoDetails=f,exports.getVideoIdx=function(){return F},exports.getVideoInfo=I,exports.handleError=ae,exports.initialiseAdvertisement=se,exports.initiateErrorHandling=ge,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=o.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return n(e).paused()},exports.isPlayerInitialised=ce,exports.isTokenExpired=T,exports.load=me,exports.loadVideo=pe,exports.loadVideoInstantly=function(e,t,n){var i=o.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){n(e).pause()},exports.play=function(e){n(e).play()},exports.refreshTokenManager=_,exports.replaceMacros=Z,exports.rewind=function(e,t){var i=n(e),o=i.currentTime(),r=o<=t?0:o-t;i.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)},exports.saveWatchHistory=g,exports.seasonIdxManager=B,exports.setCurrentSeries=function(e){y=e},exports.setCurrentVideo=x,exports.setVideoIdx=A,exports.setVideoIdxById=N,exports.skip=function(e,t){var i=n(e),o=i.currentTime()+t;i.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
package/cjs/generic-c3ef1a4c.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("video.js"),i=require("axios"),o=require("./skin-3397dca5.js"),r=require("./browser-38ff3331.js"),l=require("js-cookie"),a=require("ua-parser-js"),d=require("./captions-3c7ca3a7.js");function s(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function u(e,t){s("event",e,t)}var c={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"},v={name:"@viewlift/player-backup",version:"2.0.70-smartTv",main:"dist/bundle.cjs.js",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","ua-parser-js":"^2.0.3","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"},browserslist:["chrome > 38, safari > 7"]};window.vl_player_version=v.version;var m,f=function(e,t){var n,o,r,l,a,d,s,u;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.overrideEntitlementBaseUrl)+"/video/status":E.get()+"".concat(null==c?void 0:c.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":v.version},withCredentials:!0})},p=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:E.get()+c.getLinearChannelDetails,params:Object.assign({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},g=function(){var n=e(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return o=e.sent,e.abrupt("return",i({url:E.get()+"".concat(null==c?void 0:c.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},n),params:Object.assign({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),I=function(e,t){var n,o,r=window.contentType;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},w=function(e){var t=e.videoId;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},E=(m=null==c?void 0:c.apiBaseUrl,{set:function(e){e&&(m=e)},get:function(){return m}}),T=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},h=null;function _(){return{set:function(e){e&&(h=e)},get:function(){return h}}}var y,b,F,D,L,V,R=function(){var n=e(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=_().get(),o=E.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);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 n.apply(this,arguments)}}(),S=null,W=function(){var n=e(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"))||!T(n)){e.next=6;break}return S||(S=R().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&_().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){S=null})),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),O=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){b=e},C=function(){return b},P=function(){return y},A=function(e){F=e},N=function(e){if(D){var t=D.get(e);A(t+1)}},B=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}}),M=0,U=function(){var e,t,n,i,o,r,l,a=C();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function j(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function k(){var e=window.sessionStorage.getItem("uid");return e||(e=j(),window.sessionStorage.setItem("uid",e),e)}function H(){return G.apply(this,arguments)}function G(){return(G=e(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(e){return e?String(e):""}window.initialise=function(e){window.sid=j(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,u(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),u("PLAY",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":U(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&M<4)M++,u("BUFFERING",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,u("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;u("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),u("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(M=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Y(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Y=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var n=e(t.mark(function e(n){var o,r,l,a,d,s,u,v,m,f,p,g,I,w,T,h,_,y,b,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return h=e.sent,_=O(h),y=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=Object,e.t1={aid:y,cid:b,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=k(),e.t4=U(),e.t5=n.url||document.location.href,e.t6=n.ref||document.referrer,e.t7=n.eventName,e.t8=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=n.dp1||"",e.t11=n.dp2||"",e.t12=n.dp3||"",e.t13=n.dp4||"",e.t14=n.dp5||"",e.t15=!0===n.isAdEvent?n.videoPosition:null,e.t16=!0===n.isAdEvent?z(n.adPosition):"",e.next=25,H();case 25:e.t17=e.sent,e.t18=n.playerType||"native",e.t19=n.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(s=n.bitrate)&&void 0!==s?s:null,e.t23=null!==(u=n.resHeight)&&void 0!==u?u:null,e.t24=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t25=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==n?void 0:n.duration)&&{duration:n.duration},e.t28=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),F=[e.t29],i({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||E.get()+c.getBeaconUrl,method:"post",headers:{Authorization:h},contentType:"application/x-www-form-urlencoded",dataType:"text",data:F}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var q=function(){var e=B.get();return e>=0?e+1:1},X=function(){var e,t,n,i=P(),o=C(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=B.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=a.UAParser(navigator.userAgent);var J=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},K=function(e){var t=Q(e,"video.tags",[]),n=Q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Q=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},Z=function(){var e,t,n,i,r,a,d,s,u,c,v,m,f,p,g,I,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",L=(null==F?void 0:F.contentType)||"video",V=(null==F||null===(e=F[L])||void 0===e?void 0:e.metadata)||(null==F||null===(t=F[L])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),R=o.getPlayer(b);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(b),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),x=Math.trunc(W.getPropertyValue("width").slice(0,-2)),C="linearchannel"===L?null==F||null===(i=F.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(a=r.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===a||null===(d=a.content)||void 0===d?void 0:d.id:Q(F,"video.gist.id",""),P="linearchannel"===L?null==F||null===(s=F.linearchannel)||void 0===s||null===(u=s.channels)||void 0===u||null===(c=u.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=Object.assign({},$(V),{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:J(x,O),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===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Q(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:K(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Q(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Q(null===(p=window)||void 0===p||null===(g=p.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Q(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:P,VIEWLIFT_CONTENT_SERIES_TITLE:Q(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Q(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:X(),VIEWLIFT_SEASON_NUMBER:q(),VIEWLIFT_CONTENT_TAGS:K(F),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var M in B){var U=new RegExp(M,"g");y=y.replace(U,B[M])}return y},$=function(e){var t,n,i,o,l,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ee(s);var s={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){u.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(l=window)||void 0===l||null===(a=l.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(r.isMobile()?c?s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):c?s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),c?s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):v&&(s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),s=r.isMobile()?Object.assign({},s,{VIEWLIFT_PROF:u.get("prof.mweb")||""}):Object.assign({},s,{VIEWLIFT_PROF:u.get("prof.web")||""})):(s=Object.assign({},s,{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),s=r.isMobile()?Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):Object.assign({},s,{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),s=Object.assign({},s,{VIEWLIFT_AFID:u.get("afid")})},ee=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var s=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,u=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(s||u)&&(u?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},te=function(e){var t=null;try{var n,i,o,r,l,a,d,s,u,c,v,m,f,p,g,I,w,E,T,h,_,y,b,F,D,L,V,R,S;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(s=d.adTags)&&void 0!==s&&null!==(u=s.lg_tv)&&void 0!==u&&u.active){var W,O,x,C;t=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(x=O.adTags)||void 0===x||null===(C=x.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var P,A,N,B;t=null==e||null===(P=e.ads)||void 0===P||null===(A=P.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(g=p.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,U,j,k;t=null==e||null===(M=e.ads)||void 0===M||null===(U=M.preRoll)||void 0===U||null===(j=U.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(y=e.ads)||void 0===y||null===(b=y.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(V=L.preRoll)||void 0===V||null===(R=V.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return t},ne=function(e,t){var n,i,o,l,a,d,s,u,c,v,m,f,p,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(l=e[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(s=d.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return oe(E);if(I){var _=re(w,t);return _.src=Z(_.src,t,e),_}if("Safari"!==r.detectBrowser()&&h)return ie(w);if(T){var y=oe(w);return y.src=Z(y.src,t,e),y}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=Z(b.src,t,e),b}return null},ie=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},oe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},re=function(e,t){var i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=r.detectBrowser();if(o.getPlayer(t),"Safari"===d){var s=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};n.xhr(o,function(e,t,n){console.log(e),e&&i(e),i(null,new Uint8Array(n))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};n.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(i);return le(t),s}var u,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(le(t),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var le=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==r.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ae=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},de=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var se=!1,ue=function(e,t,n){var i=Z(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,l=o.getPlayer(e);if(null!==l.el_){se=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var s="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,s="touchend"),l.one(s,function(){u&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},ce=function(e){return!!n.getPlayer("".concat(e))},ve=function(){var n=e(t.mark(function e(n,i){var r,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,W();case 3:return l=e.sent,a=o.getPlayer(n),e.abrupt("return",new Promise(function(e,t){p(i,l).then(function(t){var o=null==t?void 0:t.data;window.sid=j(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=ne(o,n);x(o),l&&r?(pe(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),me=function(){var n=e(t.mark(function e(n,i){var r,l,a,s,u,c,v=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,W();case 4:s=e.sent;case 5:return(P()||null)&&N(i),u=0,c=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&I(i,s).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){f(i,s).then(function(i){var r,l,a=null==i?void 0:i.data,s=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;x(i.data);var v=te(a);v&&ue(n,v,a);var m=ne(a,n);if(m){var f,p,g,I,w,E,T,h,_,y,b,F,D,L,V=(null==a||null===(f=a.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),R=o.getPlayer(n);if(R.poster(V),pe(n,m),R.on("loadstart",function(){s&&e({status:!0,msg:"Video Loaded",response:a})}),R.on("loadeddata",function(){de(),e({status:!0,msg:"Video Loaded",response:a})}),R.one("play",function(){u&&c<95&&setTimeout(function(){R.currentTime(u)},0)}),R.one("error",function(){var e;t({status:!1,msg:(null==R||null===(e=R.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(y=_.closedCaptions)||void 0===y?void 0:y.length)>0)b=((null==a||null===(F=a.video)||void 0===F||null===(D=F.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),d.addCaptions(n,b);else d.removeCaptions(n)}else ae(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ge(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),fe=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()},pe=function(e,t){var n=o.getPlayer(e);n&&n.src(t)},ge=function(e,t,n,i){var o,r,l,a,d,s,u=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);ce(t)&&ae(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[u])||"".concat(c)),n&&n(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))};exports.authenticateLC=ve,exports.baseUrlManager=E,exports.clearError=de,exports.createIdxMapping=function(e){D=new Map,e.map(function(e,t){D.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;w({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=o.getPlayer(e);if(fe(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=te,exports.getCurrentSeries=P,exports.getCurrentVideo=C,exports.getDecodedToken=O,exports.getEntitlementData=function(e,t,n,o){return i({url:n,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:t},withCredentials:!0})},exports.getEpisodeNumber=X,exports.getLinearChannelDetails=p,exports.getSeasonNumber=q,exports.getSeriesDetails=function(e,t){var n,o,r=O(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):i({url:E.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return L},exports.getSource=ne,exports.getToken=W,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=k,exports.getVideoDetails=f,exports.getVideoIdx=function(){return F},exports.getVideoInfo=I,exports.handleError=ae,exports.initialiseAdvertisement=ue,exports.initiateErrorHandling=ge,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=o.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return n(e).paused()},exports.isPlayerInitialised=ce,exports.isTokenExpired=T,exports.load=me,exports.loadVideo=pe,exports.loadVideoInstantly=function(e,t,n){var i=o.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){n(e).pause()},exports.play=function(e){n(e).play()},exports.refreshTokenManager=_,exports.replaceMacros=Z,exports.rewind=function(e,t){var i=n(e),o=i.currentTime(),r=o<=t?0:o-t;i.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],s("js",new Date),s("config",e)},exports.saveWatchHistory=g,exports.seasonIdxManager=B,exports.setCurrentSeries=function(e){y=e},exports.setCurrentVideo=x,exports.setVideoIdx=A,exports.setVideoIdxById=N,exports.skip=function(e,t){var i=n(e),o=i.currentTime()+t;i.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
package/cjs/index-1b366d64.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-b8561129.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./util-c1962d91.js"),r=require("./captions-3c7ca3a7.js"),l=require("./skin-3397dca5.js"),a=require("./renditions-26c6d0df.js"),s=require("./resolution-5a0df2be.js"),u=require("./browser-38ff3331.js"),d=require("./localisation-56e0a999.js"),c=require("@babel/runtime/helpers/defineProperty"),v=require("@babel/runtime/helpers/typeof"),f=require("@babel/runtime/helpers/slicedToArray"),p=function(e){return new Promise(function(n,t){if(m(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(e){var n,t=l.getPlayer(e);return(null==t||null===(n=t.audioTracks())||void 0===n?void 0:n.tracks_)||[]||[]},h=function(e,n){for(var t=l.getPlayer(e).audioTracks().tracks_||[],o=0;o<t.length;o++){var i=t[o];i.id==n?i.enabled=!0:i.enabled=!1}},y=function(e,n,t){var o=l.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var n=l.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark(function e(n){var i,r,a,s,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=l.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,p("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(o),e.finish(13);case 16:(d=o.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==u.detectBrowser()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=l.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*u,v.seek()}})};var S=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),p("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),I=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),E=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-8606834d.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-3cd3423d.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),x=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){p("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(o)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(o)})},loadAdsLibrary:S,loadEMELibrary:T,loadMuxPlugin:I,loadDvrSeekbar:E,loadContribDash:C});function P(e){return j.apply(this,arguments)}function j(){return(j=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=(null==n?void 0:n.airplay)||!1,e.next=3,S();case 3:o&&"Safari"==u.detectBrowser()&&Promise.resolve().then(function(){return x}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function A(e,n){return D.apply(this,arguments)}function D(){return(D=n(t.mark(function e(n,o){var i,r,l,a,s,d,c,v,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=(null==o?void 0:o.contentType)||"video",v=null==o||null===(i=o[c])||void 0===i?void 0:i.drmEnabled,null==o||null===(r=o[c])||void 0===r||null===(l=r.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==o||null===(a=o[c])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==u.detectBrowser()?T():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?C():T():"Safari"!=u.detectBrowser()&&f?C():null,w(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}var L=new Set,N=null,R=function(n,t,o){var i,r,l,a,s,u,d,c={},v=(null==n?void 0:n.contentType)||"video";c["c3.cm.id"]=(null===(i=n[v])||void 0===i?void 0:i.id)||"Null",c["c3.cm.contentType"]=H(n),c[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==n||!n.linearchannel),c[null==o||null===(l=o.Constants)||void 0===l?void 0:l.STREAM_URL]=t.currentSrc(),c[null==o||null===(a=o.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),c["c3.cm.categoryType"]=_(n),c["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),c.DRMEnabled=(null===(s=n[v])||void 0===s?void 0:s.drmEnabled)||"None",c.DAIStream=null!==(u=n[v])&&void 0!==u&&null!==(d=u.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",c[o.Constants.DEFAULT_RESOURCE]="AKAMAI",c["c3.cm.brand"]="NULL",c.CDVREnabled=B(n),c["c3.cm.genreList"]=V(n),c["c3.cm.genre"]=O(n),c["c3.cm.channel"]=M(n);var f=F(e.getCurrentSeries(),n);return c=Object.assign({},c,f)},O=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},V=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},M=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},_=function(e){return(null==e?void 0:e.contentType)||"null"},B=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},U=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},H=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var q,F=function(n,t){var o,i,r,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),d=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(r=n[u-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},W=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},G=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},K=function(){var o=n(t.mark(function n(o,i){var r,a,s,u,d,c,v,f,p,m;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r=(null==i?void 0:i.convivaConfig)||{},a=r.trackConvivaPlayerEvent,s=r.paymentHandler,u=r.tveProvider,d=r.enable,c=r.appName,v=(i||{}).token,d){n.next=4;break}return n.abrupt("return");case 4:if(f=l.getPlayer(o),"function"==typeof(p=a)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(m=n.sent){n.next=13;break}return n.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=W(t.keySystem);p("contentInfo",{DRMEnabled:o})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var n,t;N&&N!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),L.clear(),N=f.currentSrc();var o=G(f.currentType()),r=e.getCurrentVideo(),l=R(r,f,m);l[null==m||null===(n=m.Constants)||void 0===n?void 0:n.PLAYER_NAME]=c||"WEB",l[null==m||null===(t=m.Constants)||void 0===t?void 0:t.ASSET_NAME]=U(r,i),l.authToken=v||"NULL",l.streamType=o,l.D2CType=s||"NONE",l.subscriberType=u||(s?"D2C":"FREE"),l["c3.cm.affiliate"]=u||"NULL",p("contentInfo",l)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),f.on("play",function(){L.has(f.currentSrc())||(L.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){L.has(f.currentSrc())&&L.delete(f.currentSrc()),p("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==L||L.clear(),p("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,n){return o.apply(this,arguments)}}(),z=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-e0505707.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-1fb711b8.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-95078d13.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-3117b6f1.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-a9258d0d.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-b79a429d.js")}).then(function(t){t.initialiseSkin(e,n)}):"VL_SmartTV"==t&&Promise.resolve().then(function(){return require("./skin-c02dde27.js")}).then(function(t){t.initialiseSkin(e,n)})},J=[],Q=0,X=null;function Y(n,t,o){var i,r,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(n.currentTime()),f=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var p=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m=(null==t||null===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(n.currentTime()),h=u?100:Math.floor(v/f*100),y={};m?function(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=$(i),l=(new Date).getTime(),a=e.getCurrentVideo(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return Object.assign({},e,c({},n,s[n]))},{}),d=r.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===q});d<0?r.push(Object.assign({content:u},n,{addedDate:l,updateDate:l})):r[d]=Object.assign({},r[d],n,{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(y={completed:u,watchedTime:g,watchedPercentage:h},d,t.siteOwner):(y=Object.assign({videoId:q,watchedTime:g,watchedPercentage:h,doneWatching:u,profileId:d},X&&{seriesId:X},p&&{originalObjectId:p}),e.saveWatchHistory(y).then(function(e){}).catch(function(e){})),Q=v+o}function $(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Z(e,n,t){var o=$(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var ee=!1,ne=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ee){var l=te(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ee=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function te(e,n,t){if(Array.isArray(e))return e.map(function(e){return te(e,n,t)});if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=te(e[i],n,t)}),o}return e}function oe(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 ie(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)?ie(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function ie(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 re=function(n,t,o,i){var a,s,d,c,f=i.res,p=i.sres,m=l.getPlayer(n),g=(null==f?void 0:f.contentType)||"video",h=(null==f?void 0:f[g].drmEnabled)||!1,b=(null==f||null===(a=f[g])||void 0===a||null===(s=a.streamingInfo)||void 0===s?void 0:s.isLiveStream)||!1,w=(null==f||null===(d=f[g])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.isDvrEnabled)||!1;e.setCurrentVideo(f),m&&(m.on("loadstart",function(){b?o.resolve({status:!0,msg:"Video Loaded",response:f}):o.resolve(Object.assign({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:f}:{response:f}))}),m.on("loadeddata",function(){var o,i,a,s=r.getCaptions(n);if(null==s||s.map(function(e){return r.disableCaptions(n,e.id)}),w&&"Safari"===u.detectBrowser())try{var d;null==m||null===(d=m.liveTracker)||void 0===d||d.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&y(n,sessionStorage.getItem("volume")||"100");var c=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,g=Object.assign({},t,f);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(X=null==n||null===(i=n.series)||void 0===i?void 0:i.id),J=[],Q=0,q=t;var a=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,s=l.getPlayer(e);s&&(s.on("timeupdate",function(){var e=Math.floor(s.currentTime());J.includes(Q)||(e==Q?(J.push(e),Y(s,n,a)):e>Q&&(Q=e+a))}),s.one("ended",function(){Y(s,n,a,!0)}))}(n,g,null==c||null===(v=c.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(a=t.analytics)&&void 0!==a&&a.muxKey&&null!=m&&m.mux){var h,b,k,S,T,I,E=(null===(h=e.getCurrentVideo())||void 0===h?void 0:h.video)||(null==f?void 0:f.video),C=null==E?void 0:E.gist,x={env_key:null==t||null===(b=t.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(k=window)||void 0===k?void 0:k.vl_player_version,video_id:null==C?void 0:C.id,video_title:null==C?void 0:C.title,video_series:null==E||null===(S=E.series)||void 0===S?void 0:S.title,video_stream_type:null!=E&&null!==(T=E.streamingInfo)&&void 0!==T&&T.isLiveStream?"live":"video",viewer_user_id:null==t||null===(I=t.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:x})}}),m.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var m,g=p.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){b&&ne(f,n)}),m.on("error",function(){var t,i;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&b)?ne(f,n):(e.handleError(n,(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(i=m.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))}),m.one("play",function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var o,i,r,l=null===(o=e.getCurrentVideo())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,d=s.p;u&&d<95&&setTimeout(function(){m.currentTime(u)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(b){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if("object"==v(m.dash)){var t,o,i,r=null==m||null===(t=m.dash)||void 0===t||null===(o=t.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),l=null==r?void 0:r.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=oe(n);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(l&&(null==s?void 0:s.id)=="dash-audio-".concat(l.index)){s.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var d,c=oe(n);try{for(c.s();!(d=c.n()).done;){var f,p,g,y=d.value;("Chrome"==u.detectBrowser()||"Edge"==u.detectBrowser()&&(null!==(f=navigator)&&void 0!==f&&null!==(p=f.userAgent)&&void 0!==p&&p.includes("Macintosh")||!h))&&null!=y&&null!==(g=y.label)&&void 0!==g&&g.includes("5.1")?m.audioTracks().removeTrack(y):"main"==y.kind?y.enabled=!0:y.enabled=!1}}catch(e){c.e(e)}finally{c.f()}}}))};var le,ae=(le=!0,{enable:function(){le=!0},disable:function(){le=!1},get enabled(){return le}});function se(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 ue(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)?ue(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function ue(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 de,ce=(de="",{set:function(e){e&&(de=e)},get:function(){return de}});function ve(e,n){return fe.apply(this,arguments)}function fe(){return(fe=n(t.mark(function n(o,i){var r,a,s,u,d,c,v,p,m,g,h,y,b,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l.getPlayer(o),r=e.getSource(i,o),a=r.src,s=a.replace("/dash/","/session/").replace("master","session"),s=e.replaceMacros(s,o,i),u=pe(s),d=f(u,2),c=d[0],v=d[1],s=new URL(s.split("?")[0]),Object.keys(v).length>0&&Object.entries(v).forEach(function(e){var n=f(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),n.prev=8,n.next=11,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:Object.assign({},c)})});case 11:return p=n.sent,n.next=14,p.json();case 14:return m=n.sent,g="https://"+new URL(s).hostname,h=m.trackingUrl,y=m.manifestUrl,b=g+h,w=g+y,ce.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),r.src=w,n.abrupt("return",r);case 26:return n.prev=26,n.t0=n.catch(8),n.abrupt("return",r);case 29:case"end":return n.stop()}},n,null,[[8,26]])}))).apply(this,arguments)}function pe(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var o,i=se(t.split("&"));try{for(i.s();!(o=i.n()).done;){var r=o.value.split("="),l=f(r,2),a=l[0],s=l[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){i.e(e)}finally{i.f()}for(var u={},d={},c=0,v=Object.entries(n);c<v.length;c++){var p=f(v[c],2),m=p[0],g=p[1];if(m.startsWith("ads."))u[m.replace(/^ads\./,"")]=g;else d[m]=g}return[u,d]}function me(){return me=n(t.mark(function e(o,i){var r,a,s,u,d,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:c=function(e,n,t,i,r){var a=l.getPlayer(o);if(!a.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(a.currentTime());var s,c=se(t);try{for(c.s();!(s=c.n()).done;){var v,f,p,m=s.value,g=m.eventType,h=m.beaconUrls,y=m.startTimeInSeconds,b=m.startTime,w=m.durationInSeconds,k=y||0,S=h,T=(null===(v=window)||void 0===v||null===(f=v.customData)||void 0===f||null===(p=f.ads)||void 0===p?void 0:p.adEventHandler)||null,I="".concat(k,"_").concat(g),E=u.get("pod-".concat(r))||[];if(console.warn(e,k,"map:",g,"condition1:",e>=k,"map:",u),e>=k&&!E.includes(I)){E.push(I),u.set("pod-".concat(r),E);try{d(g,n,S,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,g,n)}if("function"==typeof T)try{var C;T({adsData:{eventType:g,startTimeInSeconds:y,startTime:b,durationInSeconds:w,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[i],adIndex:i}})}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){c.e(e)}finally{c.f()}}},d=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)})})},s=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},r=ce.get(),l.getPlayer(o).one("loadeddata",function(){r&&a(r)}),a=function(){var e=n(t.mark(function e(n){var i,r,a,u,d,v,f,p,m,g,h,y,b,w,k,S,T,I,E,C,x,P,j;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return E=function(e){document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",E),0===e.button&&T()},I=function(e){},T=function(){var e,n=m.currentTime(),t=null,o=se(p);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,s=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>r)&&!y.has(r)||n>=r&&n<=s)&&(t=r,y.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){m.currentTime(t+.4)},100))},e.next=5,fetch(n);case 5:return d=e.sent,e.next=8,d.json();case 8:v=e.sent,f=v.avails,p=[],m=l.getPlayer(o),g=m.controlBar.progressControl,h=g.seekBar.el(),f.map(function(e){var n,t;p.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===(n=e.adBreakTrackingEvents)||void 0===n||null===(t=n.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===t?void 0:t[0])||[]})}),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=m.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",h.appendChild(r)}}),y=new Map,b=-1,w=(null===(i=document)||void 0===i||null===(r=i.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])||null,k=(null==m||null===(a=m.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(null==m||null===(u=m.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,T(),m.on("timeupdate",l.throttle(function(){var e=m.currentTime();if(e!==b){b=e;for(var n=!1,t=function(){var t=p[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-2.5&&e<=a+2.5){e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&y.set(i,!0),ae.disable(),w&&w.classList.add("vjs-hidden"),k&&(k.el().style.pointerEvents="none",k.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),g.el().style.visibility="hidden";for(var u=e-i,d=0,v=0,f=0;f<l.length;f++){var m,h=null==l||null===(m=l[f])||void 0===m?void 0:m.durationInSeconds;if(u<d+h){v=f;break}d+=h}var b=l[v],T=u-d,I=Math.max(0,(null==b?void 0:b.durationInSeconds)-T),E=Math.round(I);C.style.display="block",j.textContent="".concat(v+1," of ").concat(l.length," • ").concat(s(E));var x=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});x.push.apply(x,n)}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&x.push(null==t?void 0:t.podSlotImpressionBeacon),c(e,t,x,v,o),"break"}},o=0;o<p.length;o++){if("break"===t())break}n||(C.style.display="none",g.el().style.visibility="visible",k&&(k.el().style.pointerEvents="auto",k.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),w&&w.classList.remove("vjs-hidden"),ae.enable())}},1e3)),g.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",E))}),(C=document.createElement("div")).className="ssai-ad-container",(x=document.createElement("div")).className="sponsored-adbox",(P=document.createElement("div")).className="sponsored-text",P.textContent="Sponsored Ad",x.append(P),(j=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",C.append(x),C.append(j),m.el().appendChild(C);case 40:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),u=new Map;case 9:case"end":return e.stop()}},e)})),me.apply(this,arguments)}var ge,he=function(i,a,s,d){var v,f,p,m,g,h,y,b,w,S,T,I,E,C,x,P,j,D,L,N,R,O,V,M,_,B,U=a.res,H=void 0===U?null:U,q=a.sres,F=void 0===q?null:q,W=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],G=(null===(v=H)||void 0===v?void 0:v.contentType)||"video",J=l.impolicy16x9(null===(f=H)||void 0===f||null===(p=f[G])||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.videoImageUrl)||l.impolicy16x9(null===(g=H)||void 0===g||null===(h=g[G])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),Q=(null===(w=H)||void 0===w||null===(S=w[G])||void 0===S||null===(T=S.liveDetails)||void 0===T?void 0:T.isDvrEnabled)||!1,X=(null===(I=H)||void 0===I||null===(E=I[G])||void 0===E||null===(C=E.streamingInfo)||void 0===C?void 0:C.isLiveStream)||!1,Y=e.getAdsURL(H);H=Object.assign({},H,{audioAssetSource:null==s?void 0:s.audioAssetSource});var $="MEDIA_TAILOR"==(null===(x=window)||void 0===x||null===(P=x.app_data)||void 0===P||null===(j=P.appcmsMain)||void 0===j||null===(D=j.adsConfig)||void 0===D?void 0:D.vodAdSticherProvider)||!1,Z=(null==s?void 0:s.latency)||6,ee=(_={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:Q},c(_,"autoplay",null==s?void 0:s.autoplay),c(_,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!Y),c(_,"loop",(null==s?void 0:s.loop)||!1),c(_,"audioPosterMode",null==s?void 0:s.audioPosterMode),c(_,"html5",Object.assign({dash:Object.assign({},!o.browser.IS_SAFARI&&{useTTML:!0},(null==s?void 0:s.debugConfig)&&(null==s||null===(L=s.debugConfig)||void 0===L?void 0:L.enable)&&{debug:!0,logLevel:null!=s&&null!==(N=s.debugConfig)&&void 0!==N&&N.logLevel?null==s||null===(R=s.debugConfig)||void 0===R?void 0:R.logLevel:"DEBUG"},{updateSettings:{streaming:{delay:{liveDelay:Z},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Object.assign({},"IE"==u.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Object.assign({liveRangeSafeTimeDelta:Z,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==s||null===(O=s.customData)||void 0===O?void 0:O.overrideNative)&&{overrideNative:!0},{enableLowInitialPlaylist:!0}),debug:!0,nativeTextTracks:"Safari"==u.detectBrowser()},0==(null==s||null===(V=s.customData)||void 0===V?void 0:V.nativeAudioTracks)&&{nativeAudioTracks:!1},0==(null==s||null===(M=s.customData)||void 0===M?void 0:M.nativeVideoTracks)&&{nativeVideoTracks:!1})),c(_,"poster",J),c(_,"techOrder",W),c(_,"chromecast",{requestCustomDataFn:function(e){var n=l.getPlayer(i),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind});return function(e,n,t){var o,i,r,l,a,s,u,d,c,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,h,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==T?void 0:T.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=I;var E=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=E}var C=(null==e||null===(o=e[f])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=C;var x=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=x;var P=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=P;var j=null==e||null===(u=e[f])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=j,p.subTitles=t,p.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(H,e,t)},modifyLoadRequestFn:function(e){var n,t,o,r,a,s=l.getPlayer(i),u=(null==s?void 0:s.currentSource())||{};!(null===(n=H)||void 0===n||null===(t=n[G])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(a=u.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),_);if(!o.getPlayers()[i]){null!==(B=window)&&void 0!==B&&B.customData.isSmartTV&&(ee.spatialNavigation={enabled:!0,horizontalSeek:!0}),o.log.level("debug");var ne=o(i,ee,function(){var l=n(t.mark(function n(){var l,a,u,c,v,f,p,m,g,h,y,b,w,S,T,I,E,C,x,P,j;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ne),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,A(s,H);case 5:if(null!==(l=window)&&void 0!==l&&l.customData.isSmartTV&&ne.spatialNavigation.start(),w=null===(a=H)||void 0===a||null===(u=a[G])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,X&&d.resolve(Object.assign({status:!0,msg:"Player Initialised"},F?{seriesResponse:F,response:H}:{response:H})),e.inititateBeacon(i,null==s?void 0:s.analyticsCb),K(i,s),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),Q&&k(i,w),!Y||null!=s&&null!==(v=s.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(i,Y,H),S=e.getSource(H,i),console.log(S),null!=s&&s.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,s.nearestClusterUrl)),!$){n.next=20;break}return n.next=19,ve(i,H);case 19:S=n.sent;case 20:S?e.loadVideo(i,S):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:H}),e.handleError(i,"Incompatible / Missing Source")),((null===(f=H)||void 0===f||null===(p=f[G])||void 0===p||null===(m=p.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=H)||void 0===h||null===(y=h[G])||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0)&&(j=(null===(I=H)||void 0===I||null===(E=I[G])||void 0===E||null===(C=E.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(x=H)||void 0===x||null===(P=x[G])||void 0===P?void 0:P.closedCaptions),T=j.filter(function(e){return"VTT"===e.format}),r.addCaptions(i,T)),null!=s&&s.disableControls?e.disableControls(i):z(i,Object.assign({},s,ee,{liveVideo:X,isDvrEnabled:Q,res:H,sres:F})),re(i,Object.assign({},s,ee,{liveVideo:X}),d,{res:H,sres:F});case 24:case"end":return n.stop()}},n)}));return function(){return l.apply(this,arguments)}}())}},ye={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"},be=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=we(e);he(i,{res:r},e,{resolve:t,reject:o})},we=function(n){var t,o,i=null==n?void 0:n.streamingInfo,r=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,l=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,a=null==n?void 0:n.token,s=e.getDecodedToken(a),u=null==s?void 0:s.site;return Object.assign({id:null==ye?void 0:ye[u]},!l&&{directPlaybackUrl:null==r?void 0:r.url},{video:{drmEnabled:l,streamingInfo:{videoAssets:{widevine:null==r?void 0:r.widevine,fairPlay:null==r?void 0:r.fairPlay,playReady:null==r?void 0:r.playReady}},liveDetails:{isDvrEnabled:null==i?void 0:i.isDvrEnabled}}})};function ke(e,n){return Se.apply(this,arguments)}function Se(){return(Se=n(t.mark(function n(o,i){var r,l,a,s,u,d;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=i.resolve,l=i.reject,a=null==o?void 0:o.videoId,s=null==o?void 0:o.playerId,u=!(null==o||!o.anonymousId),n.next=6,e.getToken();case 6:d=n.sent,e.getVideoDetails(a,d).then(function(n){var t,i,c,v;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(i=t.video)||void 0===i||null===(c=i.gist)||void 0===c?void 0:c.contentType,e.setCurrentVideo(null==n?void 0:n.data);var f,p=null==n?void 0:n.data;if(null!=o&&o.watchHistory&&null!=o&&null!==(v=o.watchHistory)&&void 0!==v&&v.enable&&!u)if((null===(f=o.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,g,h,y=Z((null===(m=o.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==o?void 0:o.siteOwner);if(y&&y.length)o.watchHistoryResumeTime=(null===(g=y[0])||void 0===g?void 0:g.watchedTime)||null,o.watchedPercentage=(null===(h=y[0])||void 0===h?void 0:h.watchedPercentage)||null;p.contentType="video",he(s,{res:p},o,{resolve:r,reject:l})}else e.getVideoInfo(a,d).then(function(e){var n,t,i,r,l,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),o.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,o.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){he(s,{res:p},o,{resolve:r,reject:l})});else he(s,{res:p},o,{resolve:r,reject:l})}).catch(function(n){e.initiateErrorHandling(n,s,l,a)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Te(e,n){return Ie.apply(this,arguments)}function Ie(){return(Ie=n(t.mark(function n(o,i){var r,l,a,s,u;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=i.resolve,l=i.reject,n.next=3,e.getToken();case 3:a=n.sent,s=null==o?void 0:o.playerId,u=null==o?void 0:o.epg,e.getLinearChannelDetails(u,a).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,he(s,{res:n},o,{resolve:r,reject:l})}).catch(function(n){e.initiateErrorHandling(n,s,l,videoId)});case 7:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ee(e,n){return Ce.apply(this,arguments)}function Ce(){return(Ce=n(t.mark(function n(o,i){var r,l,a,s,u,d,c;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:s=n.sent,u=null==o?void 0:o.playerId,d=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(d)),c=null==o||null===(r=o.series)||void 0===r?void 0:r.id,e.getSeriesDetails(c,s).then(function(n){var t,i,r,d=n.data,v=n.data.seasons;e.setCurrentSeries(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(i=t.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);e.createSeriesWatchMap(c,s),e.getVideoDetails(f,s).then(function(n){var t,i,r;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(i=t.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.contentType,e.setCurrentVideo(n.data),he(u,{res:null==n?void 0:n.data,sres:d},o,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,u,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,u,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,getVideoCurrentTime:i.getVideoCurrentTime,onVideoEnded:i.onVideoEnded,init:function(o){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(t.mark(function n(i,r){var a,s,u,c,v,f,m,g,h,y,b,w,k,S,T,I,E,C,x,j,A,D,L;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==o?void 0:o.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(b=(null==o?void 0:o.videoSourceUrl)||!1,w=null==o?void 0:o.asat,k=(null==o||null===(a=o.epg)||void 0===a?void 0:a.enable)||!1,S=null==o?void 0:o.videoId,T=(null==o||null===(s=o.series)||void 0===s?void 0:s.enable)||!1,I=(null==o?void 0:o.streamingInfo)||!1,window.videoId=S,E=null==o?void 0:o.token,!e.token_authentication_enabled(o)){n.next=17;break}if(sessionStorage.setItem("vlp_token",E),e.refreshTokenManager().set(null==o?void 0:o.refreshToken),E&&!e.isTokenExpired(E)){n.next=16;break}return r({status:!1,msg:"".concat(E?"Token is expired !":"Missing Authorization Token"),response:{token:E}}),n.abrupt("return");case 16:ge=JSON.parse(atob(E.split(".")[1]));case 17:return o.isAnonymousUser=!(null===(u=ge)||void 0===u||!u.anonymousId),o.siteOwner=(null===(c=ge)||void 0===c?void 0:c.site)||null,o.userId=(null===(v=ge)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=ge)||void 0===f?void 0:f.userId),window.watchHistory=o.watchHistory||null,C=null==o?void 0:o.playerId,o.chromecastReceiverId=null!=o&&null!==(m=o.series)&&void 0!==m&&m.enable?null:null==o?void 0:o.chromecastReceiverId,x=(null==o||null===(g=o.analytics)||void 0===g?void 0:g.gaId)||null,(j=null==o?void 0:o.errors)&&(window.customErrors=j),window.customData=null==o?void 0:o.customData,d.setLocalisation(null==o||null===(h=o.customData)||void 0===h?void 0:h.localisation),e.baseUrlManager.set(o.apiBaseUrl),null!=o&&o.skin&&!l.isNotAValidSkin(o.skin)||(o.skin="VL_ONE"),n.next=33,P(o);case 33:x&&p("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then(function(){return e.runGtag(x)}).catch(function(e){}),(A=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(C)))&&A.addEventListener("contextmenu",function(e){return e.preventDefault()}),b?(L={directPlaybackUrl:b,id:D="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?e.getVideoDetails(D,E).then(function(e){var n=(null==e?void 0:e.data)||{};he(C,{res:Object.assign({},n,L)},o,{resolve:i,reject:r})}).catch(function(n){e.initiateErrorHandling(n,C,r,D)}):he(C,{res:L},o,{resolve:i,reject:r})):I?be(o,{resolve:i,reject:r}):T?Ee(o,{resolve:i,reject:r}):k?Te(o,{resolve:i,reject:r}):ke(o,{resolve:i,reject:r});case 37:case"end":return n.stop()}},n)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:l.getPlayer,play:e.play,pause:e.pause,isPaused:e.isPaused,detectBrowser:u.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:i.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:r.enableCaptions,disableCaptions:r.disableCaptions,getCaptions:r.getCaptions,getAudioTracks:g,enableAudioTrack:h,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:b,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}},exports.initialiseKeyboardEvents=function(n,t){var o,i,r,a=l.getPlayer(n),s=null==a||null===(o=a.controlBar)||void 0===o||null===(i=o.playToggle)||void 0===i?void 0:i.el_,u=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(o){var i;if(ae.enabled&&"input"!=o.target.localName){var r=o.key,l=!0===t.liveVideo||!0===t.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(r)&&(o.preventDefault(),null==u||u.focus()),r){case" ":null==s||s.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(i=document.querySelector(".vjs-fullscreen-control"))||void 0===i||i.click();break;case"ArrowLeft":l&&!1===t.liveui||e.rewind(n,10);break;case"ArrowRight":l||e.skip(n,10)}}},!0)},exports.setupAdvertisementMarkers=function(e,n){return me.apply(this,arguments)};
|