@viewlift/player-backup 2.0.378-backup → 2.0.380-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-68672b76.js → autoNextVideo-8be87221.js} +1 -1
- package/cjs/bundle.css +21 -4
- package/cjs/caption-settings-6976214c.js +1 -0
- package/cjs/captions-0f7e5504.js +1 -0
- package/cjs/features-d923e404.js +1 -0
- package/cjs/generic-932cd9bd.js +1 -0
- package/cjs/index-0c8d749a.js +1 -0
- package/cjs/index-2ee9beb4.js +1 -0
- package/cjs/index-4d160484.js +1 -0
- package/cjs/index-58f88daa.js +1 -0
- package/cjs/index-63a67aa1.js +1 -0
- package/cjs/index-a1a70e63.js +1 -0
- package/cjs/index-b5636b86.js +1 -0
- package/cjs/index-bf56b967.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/localisation-9b9539fb.js +1 -0
- package/cjs/manager-2b3a6487.js +1 -0
- package/cjs/multicamv2-a9521b14.js +1 -0
- package/cjs/multicamv2-b7debdd6.js +1 -0
- package/cjs/nextEpisodeButton-03a032ed.js +1 -0
- package/cjs/playerControlEvents-4bae757e.js +1 -0
- package/cjs/playlist-0345be6a.js +1 -0
- package/cjs/relatedVideosManager-0a220d05.js +1 -0
- package/cjs/renditions-627bdfad.js +1 -0
- package/cjs/resolution-4741809a.js +1 -0
- package/cjs/series-5b8f294c.js +1 -0
- package/cjs/series-v2-71e53ab6.js +1 -0
- package/cjs/series-v2-849ce280.js +1 -0
- package/cjs/settings-icon-3da03cb8.js +1 -0
- package/cjs/skin-168351ad.js +1 -0
- package/cjs/skin-1f23c6e5.js +1 -0
- package/cjs/skin-30cbcb3b.js +1 -0
- package/cjs/skin-35957e90.js +1 -0
- package/cjs/skin-3fbbf15a.js +1 -0
- package/cjs/skin-66dce245.js +1 -0
- package/cjs/skin-74aa6fdd.js +1 -0
- package/cjs/{skin-9734a061.js → skin-9b50d8e6.js} +1 -1
- package/cjs/skin-b60da048.js +1 -0
- package/cjs/skin-c703c4d8.js +1 -0
- package/cjs/skin-fd27ab72.js +1 -0
- package/cjs/videoSelector-9129264f.js +1 -0
- package/cjs/videoSelector-f1f19a68.js +1 -0
- package/cjs/videojs-dash5.es-80bdd597.js +1 -0
- package/esm/{autoNextVideo-a694d718.js → autoNextVideo-c0d4215f.js} +1 -1
- package/esm/bundle.css +21 -4
- package/esm/caption-settings-ecdb9fdd.js +1 -0
- package/esm/captions-6202f057.js +1 -0
- package/esm/features-ce5e7741.js +1 -0
- package/esm/generic-8c606c9f.js +1 -0
- package/esm/index-1a684bd4.js +1 -0
- package/esm/index-5a3a05a7.js +1 -0
- package/esm/index-6c82fd05.js +1 -0
- package/esm/index-7827eeb5.js +1 -0
- package/esm/index-a4b5d7a7.js +1 -0
- package/esm/index-dbeabd1b.js +1 -0
- package/esm/index-ec92c082.js +1 -0
- package/esm/index-f9ef8d3b.js +1 -0
- package/esm/index.js +1 -1
- package/esm/localisation-a4ec8f68.js +1 -0
- package/esm/manager-71943445.js +1 -0
- package/esm/multicamv2-5345efc1.js +1 -0
- package/esm/multicamv2-a1d5fe38.js +1 -0
- package/esm/nextEpisodeButton-40baf151.js +1 -0
- package/esm/playerControlEvents-a054a667.js +1 -0
- package/esm/playlist-6425a6a1.js +1 -0
- package/esm/relatedVideosManager-81661348.js +1 -0
- package/esm/renditions-620d93b3.js +1 -0
- package/esm/resolution-f2937f41.js +1 -0
- package/esm/series-1f114057.js +1 -0
- package/esm/series-v2-22f006ff.js +1 -0
- package/esm/series-v2-8dda8e16.js +1 -0
- package/esm/settings-icon-fbc91450.js +1 -0
- package/esm/skin-00c8da65.js +1 -0
- package/esm/skin-0782067b.js +1 -0
- package/esm/skin-3653c5b3.js +1 -0
- package/esm/skin-57d9a86c.js +1 -0
- package/esm/skin-6e38dd8e.js +1 -0
- package/{cjs/skin-9ef12f43.js → esm/skin-84f8c45b.js} +1 -1
- package/esm/{skin-16cb5cfb.js → skin-8e064031.js} +1 -1
- package/esm/{skin-16d24d3a.js → skin-8fcaf133.js} +1 -1
- package/esm/skin-95d705f2.js +1 -0
- package/esm/skin-a89d152c.js +1 -0
- package/esm/skin-ff8a2ba0.js +1 -0
- package/esm/src/apis/index.d.ts +4 -4
- package/esm/src/helpers/drmRobustness.d.ts +4 -0
- package/esm/src/helpers/localisation.d.ts +1 -0
- package/esm/src/helpers/token.d.ts +1 -1
- package/esm/src/index.d.ts +1 -1
- package/esm/videoSelector-238393de.js +1 -0
- package/esm/videoSelector-72ba5b67.js +1 -0
- package/esm/videojs-dash5.es-45c88e15.js +1 -0
- package/package.json +1 -1
- package/cjs/caption-settings-af7b30a4.js +0 -1
- package/cjs/captions-8b889384.js +0 -1
- package/cjs/features-38873abb.js +0 -1
- package/cjs/generic-ca2a22d8.js +0 -1
- package/cjs/index-3a351e42.js +0 -1
- package/cjs/index-5562e80d.js +0 -1
- package/cjs/index-774736bd.js +0 -1
- package/cjs/index-9e05e266.js +0 -1
- package/cjs/index-c52abe27.js +0 -1
- package/cjs/index-d9460e79.js +0 -1
- package/cjs/index-de9db53d.js +0 -1
- package/cjs/index-f3365b73.js +0 -1
- package/cjs/localisation-56e0a999.js +0 -1
- package/cjs/manager-77ddd30c.js +0 -1
- package/cjs/multicamv2-39cc5698.js +0 -1
- package/cjs/multicamv2-c33fd165.js +0 -1
- package/cjs/nextEpisodeButton-4cd04954.js +0 -1
- package/cjs/playerControlEvents-db923a5c.js +0 -1
- package/cjs/playlist-5b387ba5.js +0 -1
- package/cjs/relatedVideosManager-44ec6d59.js +0 -1
- package/cjs/renditions-05a85e06.js +0 -1
- package/cjs/resolution-ac7705e6.js +0 -1
- package/cjs/series-554e1f6f.js +0 -1
- package/cjs/series-v2-759d1b9f.js +0 -1
- package/cjs/series-v2-f513d96e.js +0 -1
- package/cjs/settings-icon-8d593433.js +0 -1
- package/cjs/skin-0b2c868e.js +0 -1
- package/cjs/skin-49921eed.js +0 -1
- package/cjs/skin-528d0747.js +0 -1
- package/cjs/skin-55634dc6.js +0 -1
- package/cjs/skin-80ad30a9.js +0 -1
- package/cjs/skin-b4c02ae6.js +0 -1
- package/cjs/skin-c1111e65.js +0 -1
- package/cjs/skin-cfe26f4b.js +0 -1
- package/cjs/skin-ea9d4fd0.js +0 -1
- package/cjs/videoSelector-05f988b1.js +0 -1
- package/cjs/videoSelector-1df54701.js +0 -1
- package/cjs/videojs-dash5.es-0f92604f.js +0 -1
- package/esm/caption-settings-cf49bb1b.js +0 -1
- package/esm/captions-f011a7d4.js +0 -1
- package/esm/features-a7e5e171.js +0 -1
- package/esm/generic-65cb8119.js +0 -1
- package/esm/index-18292507.js +0 -1
- package/esm/index-28ebfa21.js +0 -1
- package/esm/index-7067e5db.js +0 -1
- package/esm/index-8b7ad7a7.js +0 -1
- package/esm/index-cbaac7c7.js +0 -1
- package/esm/index-cbb86a6c.js +0 -1
- package/esm/index-e9e43270.js +0 -1
- package/esm/index-f61ce130.js +0 -1
- package/esm/localisation-0bf399a1.js +0 -1
- package/esm/manager-d812dea7.js +0 -1
- package/esm/multicamv2-97a3b0f4.js +0 -1
- package/esm/multicamv2-ccbd1435.js +0 -1
- package/esm/nextEpisodeButton-cf9328cc.js +0 -1
- package/esm/playerControlEvents-26580023.js +0 -1
- package/esm/playlist-3d669989.js +0 -1
- package/esm/relatedVideosManager-93533a90.js +0 -1
- package/esm/renditions-28891b91.js +0 -1
- package/esm/resolution-d9d21f0e.js +0 -1
- package/esm/series-704b41dd.js +0 -1
- package/esm/series-v2-843283cb.js +0 -1
- package/esm/series-v2-e1ae0c27.js +0 -1
- package/esm/settings-icon-c31267aa.js +0 -1
- package/esm/skin-034c0111.js +0 -1
- package/esm/skin-12fdaa37.js +0 -1
- package/esm/skin-15bea000.js +0 -1
- package/esm/skin-29dfa892.js +0 -1
- package/esm/skin-2a3ee818.js +0 -1
- package/esm/skin-4390b877.js +0 -1
- package/esm/skin-800b5977.js +0 -1
- package/esm/skin-cd51486c.js +0 -1
- package/esm/skin-d5474de8.js +0 -1
- package/esm/src/core/captions.test.d.ts +0 -1
- package/esm/src/features/dvrStartOver/helpers.test.d.ts +0 -1
- package/esm/src/features/dvrStartOver/index.test.d.ts +0 -1
- package/esm/src/helpers/playerControlEvents.test.d.ts +0 -1
- package/esm/src/utilities/beacon.test.d.ts +0 -1
- package/esm/videoSelector-91f8908b.js +0 -1
- package/esm/videoSelector-c185464d.js +0 -1
- package/esm/videojs-dash5.es-cfe95daa.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=require("./generic-
|
|
1
|
+
"use strict";var e,t=require("./generic-932cd9bd.js"),n=require("./index-bf56b967.js"),o=require("./skin-66dce245.js"),i=0,r=0,u=new Set(["NOT_AIRED","VIDEO_NOT_AVAILABLE","CONTENT_NOT_AVAILABLE"]),l=function(e){return(null==e?void 0:e.response)||e},s=function(e,t){return e&&null!=t&&t.gist&&(e.response=e.response||{},e.response.video=e.response.video||{},e.response.video.gist=t.gist),e},d=function(e){var t,n,o=l(e),i=null==o||null===(t=o.response)||void 0===t?void 0:t.data;return 403===(null==o||null===(n=o.response)||void 0===n?void 0:n.status)||(!!(null!=i&&i.scheduleStartDate&&Number(i.scheduleStartDate)>Date.now())||!(null==i||!i.errorCode||!u.has(i.errorCode)))},a=function(e,t){clearTimeout(i);var r=l(t);n.handleCountdownTimer(e,r,null);var u=o.getPlayer(e);u&&!u.paused()&&u.pause()},c=function(e,n,i){var r=i[e];if(function(e){var t,n=null==e||null===(t=e.gist)||void 0===t?void 0:t.scheduleStartDate;return n&&Number(n)>Date.now()}(r))return Promise.reject(function(e){var t,n,o;return{response:{data:{errorMessage:null!=e&&null!==(t=e.gist)&&void 0!==t&&t.scheduleStartDate?"Coming soon":"Content not available",scheduleStartDate:null==e||null===(n=e.gist)||void 0===n?void 0:n.scheduleStartDate,scheduleEndDate:null==e||null===(o=e.gist)||void 0===o?void 0:o.scheduleEndDate,gist:null==e?void 0:e.gist}}}}(r));if(!o.getPlayer(n)){var u={status:!1,msg:"Player not initialised for next episode load",response:{playerId:n,episode:r}};return console.error("[autoNextVideo] player not found before trying next episode load",u),Promise.reject(u)}return t.load(n,r.id)},v=[],g=function e(n,i,u,l){r=n,n>u.length-1||(t.setVideoIdx(r+1),c(n,i,u).then(function(e){o.highlightVideo(r,i),r++,h(e)}).catch(function(t){h(s(t,u[n])),d(t)?a(i,t):setTimeout(function(){o.highlightVideo(r,i),r++,e(r,i,u)},5e3)}))},h=function(t){e&&e(t)};exports.autoPlayNext=function(u){clearTimeout(i),v=(null==u?void 0:u.content)||[],e=null==u?void 0:u.cb;var l=u.playerId;n.onVideoEnded(l,function(){var e=o.getPlayer(l);0!==(null==e?void 0:e.currentTime())&&((r=t.getVideoIdx())>v.length-1||(t.setVideoIdx(r+1),c(r,l,v).then(function(e){o.highlightVideo(r,l),t.setCurrentVideo(e.response),r++,h(e)}).catch(function(e){h(s(e,v[idx])),o.highlightVideo(r,l),d(e)?a(l,e):(r++,i=setTimeout(function(){t.isPaused(l)&&g(r,l,v)},5e3))})))})},exports.switchToNext=g,exports.updateContent=function(e){v=e||[]};
|
package/cjs/bundle.css
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
4
|
.video-js.skin_news .vjs-button>.vjs-icon-placeholder:before {
|
|
7
5
|
font-size: 2.2em;
|
|
8
6
|
line-height: 2.6;
|
|
@@ -531,7 +529,6 @@
|
|
|
531
529
|
|
|
532
530
|
|
|
533
531
|
|
|
534
|
-
|
|
535
532
|
.video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
|
|
536
533
|
height: 0.7em !important;
|
|
537
534
|
position: absolute !important;
|
|
@@ -740,6 +737,9 @@
|
|
|
740
737
|
text-decoration: underline;
|
|
741
738
|
}
|
|
742
739
|
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
|
|
743
743
|
.video-js.skin_cn_news .vjs-control-bar {
|
|
744
744
|
z-index: 1 !important;
|
|
745
745
|
height: auto !important;
|
|
@@ -2360,6 +2360,7 @@
|
|
|
2360
2360
|
}
|
|
2361
2361
|
|
|
2362
2362
|
|
|
2363
|
+
|
|
2363
2364
|
/* Watch in Vertical View Button */
|
|
2364
2365
|
.video-js .vjs-control.vjs-vertical-view-button {
|
|
2365
2366
|
width: auto !important;
|
|
@@ -2447,7 +2448,6 @@
|
|
|
2447
2448
|
}
|
|
2448
2449
|
}
|
|
2449
2450
|
|
|
2450
|
-
|
|
2451
2451
|
/* nextep — up-next card (centered in player, scales with player size) */
|
|
2452
2452
|
.video-js:has(.next-ep-preview),
|
|
2453
2453
|
.video-js:has(.next-ep-preview-player-thumb) {
|
|
@@ -2889,6 +2889,10 @@
|
|
|
2889
2889
|
.video-js.skin_news,
|
|
2890
2890
|
.video-js.skin_news_live { --vlp-caption-bottom: 5.2em; }
|
|
2891
2891
|
.video-js.skin_defaultv2 { --vlp-caption-bottom: 6.2em; }
|
|
2892
|
+
.video-js.skin_cn_news { --vlp-caption-bottom: 14em; }
|
|
2893
|
+
@media (max-width: 576px) {
|
|
2894
|
+
.video-js.skin_cn_news { --vlp-caption-bottom: 4em; }
|
|
2895
|
+
}
|
|
2892
2896
|
|
|
2893
2897
|
|
|
2894
2898
|
.video-js .vjs-text-track-display-ttml span {
|
|
@@ -2907,6 +2911,19 @@
|
|
|
2907
2911
|
transform: translateY(0) !important;
|
|
2908
2912
|
}
|
|
2909
2913
|
|
|
2914
|
+
.video-js.skin_cn_news video::-webkit-media-text-track-display {
|
|
2915
|
+
transform: translateY(-150px);
|
|
2916
|
+
}
|
|
2917
|
+
.video-js.skin_cn_news.vjs-controls-disabled video::-webkit-media-text-track-display,
|
|
2918
|
+
.video-js.skin_cn_news.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display {
|
|
2919
|
+
transform: translateY(-1.5em);
|
|
2920
|
+
}
|
|
2921
|
+
@media (max-width: 576px) {
|
|
2922
|
+
.video-js.skin_cn_news video::-webkit-media-text-track-display {
|
|
2923
|
+
transform: translateY(-3em);
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2910
2927
|
.video-js .vjs-text-track-settings select {
|
|
2911
2928
|
box-sizing: border-box;
|
|
2912
2929
|
padding-right: 1.4em;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),r=require("./icons-437e83c9.js"),c=require("./captions-0f7e5504.js"),l=require("./skin-66dce245.js");function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("./manager-2b3a6487.js"),require("@babel/runtime/helpers/defineProperty");var d=i.getComponent("Component"),p=function(){n(v,d);var p,u,m=(p=v,u=s(),function(){var e,t=o(p);if(u){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function v(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,v),(i=m.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(v,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"caption-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"caption-selector-icon",innerHTML:"".concat(r.CaptionsSvgV2())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./caption-settings-67212c17.js")}).then(function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=c.getCaptions(this.playerId);null==t||t.map(function(t){return c.disableCaptions(e.playerId,t.id)});var n=this.el(),a=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var t;null!==(t=a.classList)&&void 0!==t&&t.contains("hidden")?(l.closeOpenDrawers(),a.classList.remove("hidden"),n.classList.add("open"),a.style.right="0px",l.setUpdatedElHeight(e.playerId,a)):(a.classList.add("hidden"),n.classList.remove("open"),a.style.right="-350px")};var o=document.getElementById(this.playerId);if(o){var r=window.getComputedStyle(o,null).getPropertyValue("height");a.style.height="".concat(r),i.dom.appendContent(n,a),o.style.overflow="hidden",this.addFunctionality(a),l.detectOrientationChange(this.playerId,a)}}},{key:"addFunctionality",value:function(e){var t=this.el(),n=i.dom.createEl("div",{className:"caption-selector-head"}),a=i.dom.createEl("div",{className:"caption-selector-cross-icon",innerHTML:"".concat(r.crossIconSvg())});a.onclick=function(){e.classList.add("hidden"),t.classList.remove("open"),e.style.right="-350px"};var o=i.dom.createEl("div",{className:"caption-selector-title",innerHTML:"Captions"}),c=i.dom.createEl("div",{className:"caption-selector-content"}),s=i.dom.createEl("div",{className:"caption-container"}),d=this.createLanguageContanier();i.dom.appendContent(s,d),i.dom.appendContent(n,a),i.dom.appendContent(n,o),i.dom.appendContent(e,n),i.dom.appendContent(e,c),i.dom.appendContent(c,s),l.handleDrawerResizing(this.playerId,e)}},{key:"createLanguageContanier",value:function(){var e=this,t=i.dom.createEl("div",{className:"caption-language-container"}),n=i.dom.createEl("div",{className:"caption-language-container-title",innerHTML:"Language"});i.dom.appendContent(t,n);var a=document.createElement("label");a.setAttribute("for","radio-off"),a.className="caption-language-holder";var o=document.createElement("div");o.className="caption",o.textContent=c.resolveCaptionOffLabel()||"Off";var r=i.dom.createEl("input",{className:"radio - off",id:"radio-off",name:"language-radio",checked:"true"});r.setAttribute("type","radio"),r.onchange=function(t){var n,a,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important")),c.getCaptions(e.playerId).map(function(t){return c.disableCaptions(e.playerId,t.id)})},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var l=c.getCaptions(this.playerId),s=function(n){var a=document.createElement("label");a.className="caption-language-holder",a.setAttribute("for","language-radio-".concat(n));var o=document.createElement("div");o.className="caption - ".concat(n),o.textContent=c.resolveTrackCaptionLabel(null==l?void 0:l[n]);var r=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});r.onchange=function(t){c.enableCaptions(e.playerId,l[n].id)},r.setAttribute("type","radio"),i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a)},d=0;d<l.length;d++)s(d);return t}},{key:"createFontSizeContainer",value:function(){var e=i.dom.createEl("div",{className:"caption-font-container"}),t=i.dom.createEl("div",{className:"caption-font-container-title",innerHTML:"Font Size"});i.dom.appendContent(e,t);for(var n=[{size:14},{size:18},{size:24}],a=0;a<n.length;a++){var o,r=document.createElement("label");r.className="caption-font-holder",r.setAttribute("for","font".concat(a));var c=document.createElement("div");c.className="fontsize - ".concat(a),c.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var l=i.dom.createEl("input",{className:"radio - ".concat(a),id:"font".concat(a),name:"font-size-radio",size:"".concat(n[a].size),checked:"".concat(a==n.length-1)});l.setAttribute("type","radio"),l.onchange=function(e){var t=e.target.size;if(document.getElementById("caption-size")){document.getElementById("caption-size").textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}")}else{var n=document.createElement("style");n.textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}"),n.id="caption-size",document.head.append(n)}},i.dom.appendContent(r,l),i.dom.appendContent(r,c),i.dom.appendContent(e,r)}return e}}]),v}();exports.default=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("video.js"),a=require("./skin-66dce245.js"),r=require("./manager-2b3a6487.js"),i={en:"English",eng:"English",es:"Spanish",spa:"Spanish",fr:"French",fre:"French",fra:"French",de:"German",ger:"German",deu:"German",pt:"Portuguese",por:"Portuguese",it:"Italian",ita:"Italian",nl:"Dutch",nld:"Dutch",dut:"Dutch",ru:"Russian",rus:"Russian",zh:"Chinese",zho:"Chinese",chi:"Chinese",ja:"Japanese",jpn:"Japanese",ko:"Korean",kor:"Korean",ar:"Arabic",ara:"Arabic",hi:"Hindi",hin:"Hindi",sv:"Swedish",swe:"Swedish",no:"Norwegian",nor:"Norwegian",da:"Danish",dan:"Danish",fi:"Finnish",fin:"Finnish",pl:"Polish",pol:"Polish",tr:"Turkish",tur:"Turkish",el:"Greek",ell:"Greek",gre:"Greek",he:"Hebrew",heb:"Hebrew",th:"Thai",tha:"Thai",vi:"Vietnamese",vie:"Vietnamese",id:"Indonesian",ind:"Indonesian",ms:"Malay",msa:"Malay",may:"Malay",cs:"Czech",ces:"Czech",cze:"Czech",sk:"Slovak",slk:"Slovak",slo:"Slovak",hu:"Hungarian",hun:"Hungarian",ro:"Romanian",ron:"Romanian",rum:"Romanian",uk:"Ukrainian",ukr:"Ukrainian"},o=function(e){return e&&i[e.trim().toLowerCase()]||e},l=function(){var e,t;return(null===(e=r.playerConfigManager.getConfig())||void 0===e||null===(t=e.localisation)||void 0===t?void 0:t.caption)||{}},s=function(e){return o(String(e).trim()).toLowerCase()},u=function(e,n){var a,r,i=new Map(Object.entries(l()).filter(function(e){var n=t(e,2),a=n[0],r=n[1];return"off"!==a&&r}).map(function(e){var n=t(e,2),a=n[0],r=n[1];return[s(a),r]})),u=function(e){return e?i.get(s(e)):void 0};return null!==(a=null!==(r=u(e))&&void 0!==r?r:u(n))&&void 0!==a?a:o(e||n)},c=function(){return l().off||null},d=new WeakMap,p=function(e){return(null==e?void 0:e.language)||d.get(e)},v=n.getComponent("TextTrackMenuItem"),h=n.getComponent("OffTextTrackMenuItem");if(v&&!v.prototype.__vlLanguageLabelPatched){var f=v.prototype.localize;v.prototype.localize=function(e){for(var t,n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];if(e!==(null===(t=this.options_)||void 0===t?void 0:t.label))return f.call.apply(f,[this,e].concat(a));var i=h&&this instanceof h?c()||e:u(e,p(this.options_.track));return f.call.apply(f,[this,i].concat(a))},v.prototype.__vlLanguageLabelPatched=!0}exports.addCaptions=function(e,t){var n=a.getPlayer(e);n.remoteTextTracks().tracks_.map(function(e){n.removeRemoteTextTrack(e)}),t.map(function(e){var t=n.addRemoteTextTrack({src:e.url,srclang:e.srclang,label:o(e.label||(null==e?void 0:e.language))});null!=t&&t.track&&null!=e&&e.language&&d.set(t.track,e.language)})},exports.disableCaptions=function(e,t){for(var n=a.getPlayer(e).textTracks(),r=0;r<n.length;r++){var i=n[r];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==t||(i.mode="hidden")}},exports.enableCaptions=function(e,t){var n,r,i;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(r=n[0])||void 0===r||null===(i=r.style)||void 0===i||i.setProperty("display","flex"));for(var o=a.getPlayer(e).textTracks(),l=0;l<o.length;l++){var s=o[l];"subtitles"!==s.kind&&"captions"!==s.kind||s.id!=t||(s.mode="showing")}},exports.getCaptions=function(e){var t,n=a.getPlayer(e),r=null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter(function(e){return"subtitles"==e.kind||"captions"===e.kind});return function(){var e,t=null===(e=document)||void 0===e?void 0:e.querySelector(".vjs-texttrack-settings"),n=null==t?void 0:t.querySelector(".vjs-control-text");t&&n&&(n.textContent="opens captions settings");var a=document.querySelectorAll(".vjs-subtitles-menu-item");(null==a?void 0:a.length)>0&&a.forEach(function(e,t){var n=e.querySelector(".vjs-menu-item-text");"en"==n.textContent?n.setAttribute("aria-label","English"):"es"==n.textContent?n.setAttribute("aria-label","Espanol"):n.setAttribute("aria-label",n.textContent)})}(),r||[]},exports.removeCaptions=function(e){var t=a.getPlayer(e);t.remoteTextTracks().tracks_.map(function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)})},exports.removeDuplicateCaptions=function(t){var n,r,i=a.getPlayer(t);if(i){var o=e((null===(n=i.textTracks())||void 0===n?void 0:n.tracks_)||[]).filter(function(e){return"subtitles"===e.kind||"captions"===e.kind}),l=new Set((null===(r=i.remoteTextTracks())||void 0===r?void 0:r.tracks_)||[]),s=new Map;o.forEach(function(e){var t="".concat(e.kind,"|").concat(e.language||"","|").concat(e.label||"");s.has(t)||s.set(t,[]),s.get(t).push(e)}),s.forEach(function(e){if(!(e.length<2)){var t=e.find(function(e){return"showing"===e.mode})||e[0];e.forEach(function(e){e!==t&&l.has(e)&&i.removeRemoteTextTrack(e)})}})}},exports.resolveCaptionOffLabel=c,exports.resolveTrackCaptionLabel=function(e){return u(null==e?void 0:e.label,p(e))},exports.syncTtmlDisplay=function(e){var t,n=a.getPlayer(e),r=null==n||null===(t=n.el())||void 0===t?void 0:t.querySelector(".vjs-text-track-display-ttml");r&&(Array.from(n.textTracks()).some(function(e){return("captions"===e.kind||"subtitles"===e.kind)&&"showing"===e.mode})?r.style.setProperty("display","flex"):(r.style.setProperty("display","none","important"),r.innerHTML=""))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-932cd9bd.js"),s=require("./renditions-627bdfad.js"),d=require("./skin-66dce245.js"),u=require("./localisation-9b9539fb.js"),c=require("./playerControlEvents-4bae757e.js");function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function p(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?h(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function v(e){var t=g();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}exports.addBigMuteButton=function(e,t){Promise.resolve().then(function(){return require("./index-58f88daa.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("MuteButton",n),o.addChild("MuteButton",p({playerId:e},t))})},exports.addCaptionButton=function(e,t){Promise.resolve().then(function(){return require("./caption-settings-6976214c.js")}).then(function(r){var n,o,l,a,s=r.default,u=d.getPlayer(e);i.registerComponent("captionSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),u&&u.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},u.controlBar.children().length-3)})},exports.addDBClickFullScreen=function(e){var t=d.getPlayer(e).el(),r=0,n=d.getPlayer(e);n.addChild("fullscreenToggle");var o=function(){var e,r=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];r&&r.click()};n.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;n.el().addEventListener("touchend",function(){var e=(new Date).getTime(),n=e-r;if(n<300&&n>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}r=e}),window._multiplayer_dbTapHandler=o},exports.addMulticamSelector=function(e,t){Promise.resolve().then(function(){return require("./multicamv2-a9521b14.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},exports.addMulticamSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./multicamv2-b7debdd6.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then(function(){return require("./nextEpisodeButton-03a032ed.js")}).then(function(n){var o=n.default,l=d.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)})},exports.addOutputtingOverlay=function(e,t){var r=d.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then(function(){return require("./playlist-0345be6a.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},exports.addResolutionModule=function(e,t,r){Promise.resolve().then(function(){return require("./resolution-4741809a.js")}).then(function(e){return e.resolution}).then(function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d.getPlayer(e),a=s.getRenditions(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:a},l.controlBar.children().length-4))})},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=v(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-rewind-button"),o.setAttribute("aria-label","Backward 10 seconds");var a=d.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){c.triggerPlayerAction(this.player_,c.PLAYER_ACTIONS.REPLAY),a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then(function(){return require("./series-5b8f294c.js")}).then(function(n){var o=n.seriesModule,l=d.getPlayer(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",function(){t[e]&&n.handleSeasonChange(t[e],e,l,r)})},u=0;u<a.length;u++)s(u)})},exports.addSeriesSelectorV2=function(e,t){Promise.resolve().then(function(){return require("./series-v2-849ce280.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",p({playerId:e},t),o.controlBar.children().length-3)})},exports.addSeriesSelectorV2_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./series-v2-71e53ab6.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",p({playerId:e},t),o.controlBar.children().length-3)})},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then(function(){return require("./settings-icon-3da03cb8.js")}).then(function(r){var n,o,l,a,s=r.default,u=d.getPlayer(e);i.registerComponent("settingsSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),u&&u.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},u.controlBar.children().length-3)})},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=v(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-skip-button"),o.setAttribute("aria-label","Forward 10 seconds");var a=d.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=v(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u.getLocalisation("slowMoText")||"Slow Mo",n}return r(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},exports.addVerticalViewButton=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0===(null==r||null===(t=r.ui)||void 0===t?void 0:t.showVerticalViewButton)&&Promise.resolve().then(function(){return require("./index-63a67aa1.js")}).then(function(t){var n=t.default,o=d.getPlayer(e);o&&(i.registerComponent("VerticalViewButton",n),o.getChild("VerticalViewButton")||o.addChild("VerticalViewButton",p({playerId:e},r)))})},exports.addVideoSelector=function(e,t){Promise.resolve().then(function(){return require("./videoSelector-9129264f.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},exports.addVideoSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./videoSelector-f1f19a68.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("video.js"),i=require("axios"),o=require("./manager-2b3a6487.js"),a=require("./skin-66dce245.js"),l=require("./browser-3670a923.js"),s=require("md5"),u=require("js-cookie"),d=require("./captions-0f7e5504.js"),c=require("@babel/runtime/helpers/typeof"),v=require("./playerControlEvents-4bae757e.js"),f=require("@babel/runtime/helpers/toConsumableArray"),p=require("@babel/runtime/helpers/slicedToArray"),m=require("@viewlift/comscore/index.js"),h=require("@babel/runtime/helpers/classCallCheck"),g=require("@babel/runtime/helpers/createClass"),y=require("@babel/runtime/helpers/objectWithoutProperties"),I={name:"@viewlift/player",version:"2.1.73",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant","test:chromecast":"mocha -- 'remote/chromecast/tests/**/*.test.js'","test:airplay":"mocha -- 'remote/airplay/tests/**/*.test.js'"},dependencies:{"@viewlift/sse":"^0.0.3","broadcast-channel":"^7.3.0","@viewlift/comscore":"^1.0.19",axios:"^1.18.1",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","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","webcomponents.js":"git+https://git@github.com/webcomponents/webcomponentsjs.git#v0.7.24"},devDependencies:{"expect.js":"^0.3.1",mocha:"^10.8.2",sinon:"^2.4.1"},overrides:{"min-document":"^2.19.1"}},b={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"},E=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},T=null;function _(){return{set:function(e){e&&(T=e)},get:function(){return T}}}var w=function(){var e=n(t.mark(function e(){var n,r,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=_().get(),r=ue.get(),n){e.next=4;break}throw new Error("Missing refresh token");case 4:return e.prev=4,e.next=7,i({method:"GET",url:"".concat(r,"/identity/refresh/").concat(n),headers:ne("refreshToken"),params:te("refreshToken")});case 7:return o=e.sent,e.abrupt("return",o);case 11:throw e.prev=11,e.t0=e.catch(4),e.t0;case 14:case"end":return e.stop()}},e,null,[[4,11]])}));return function(){return e.apply(this,arguments)}}(),S=null,k=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!E(n)){e.next=6;break}return S||(S=w().then(function(e){var t,r,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,o=null==e||null===(r=e.data)||void 0===r?void 0:r.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),o&&_().set(o),i||n}).catch(function(e){return 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 e.apply(this,arguments)}}(),A=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},O=function(){return"undefined"!=typeof window&&window.sessionStorage?window.sessionStorage.getItem("uid"):null},P=function(e){return!!e&&"drm"===function(e){var n;if(5===Number(null==e?void 0:e.code))return"drm";var t="".concat(null!==(n=null==e?void 0:e.code)&&void 0!==n?n:""," ").concat(function(e){var n,t,r,i,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(e)).toLowerCase();return/(drm|license|widevine|playready|fairplay|eme|key|hdcp)/.test(t)?"drm":/(network|manifest|segment|playlist|http|xhr|fetch|timeout)/.test(t)?"network":/(decode|mediaerror|mediasource|appendbuffer|sourcebuffer)/.test(t)?"decode":"player"}(e)},L=new Set(["license","key","server_certificate"]);function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var C="asset_not_found",N="geo_blocking_issue",R="entitlement_mismatch",x="DRM/License Failures",j=new Set(["contentgeorestricted","contentgeorestrictedbyhba","content_not_available_for_country"]),F=[/geo[\s_-]?block/i,/geo[\s_-]?restrict/i,/geographic/i,/not available in your/i,/outside.*(?:region|country|territory)/i,/\bcountry\b/i,/\bterritory\b/i],V=[/entitlement/i,/not entitled/i,/subscription/i,/not subscribed/i,/access denied/i,/\bunauthorized\b/i,/\bforbidden\b/i,/\bpremium\b/i,/upgrade required/i,/tv[\s_-]?provider/i,/\bprovider\b/i],M=[/not found/i,/no content/i,/does not exist/i,/\bmissing\b/i,/not available currently/i,/not available/i],U=function(e,n,t,r){var i=Number(e),o=String(n||"");return P(r)?x:j.has(function(e){return String(e||"").toLowerCase().replace(/[\s-]/g,"_")}(t))||F.some(function(e){return e.test(o)})?N:V.some(function(e){return e.test(o)})?R:M.some(function(e){return e.test(o)})||404===i?C:451===i?N:R},B=function(n,t,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};console.log("emitApiErrorEvent",{apiName:n,error:t,errorCategory:r,meta:a});var l,s,u,d,c,v=(null==(c=o.playerConfigManager.getConfig()||{})?void 0:c.apiErrorCb)||(null==c?void 0:c.onApiError)||(null==c||null===(l=c.customData)||void 0===l?void 0:l.apiErrorCb)||(null==c||null===(s=c.customData)||void 0===s?void 0:s.onApiError)||(null==c||null===(u=c.customData)||void 0===u||null===(d=u.callbacks)||void 0===d?void 0:d.onApiError)||null;if("function"==typeof v){console.log("emitApiErrorEvent",t);var f=(null==t||null===(i=t.response)||void 0===i?void 0:i.status)||(null==t?void 0:t.status)||0,p=function(e){var n,t,r,i,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(t),m=function(e){var n,t,r,i,o,a;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorCode)||(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.error_code)||(null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.code)||(null==e?void 0:e.errorCode)||null}(t),h=U(f,p,m,t),g=function(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}({errorcode:f||m,errormessage:p,errorcategory:r||h},a);n&&(g.apiPath=n);try{v(h,g)}catch(e){console.warn("[VLPlayer] apiError callback failed:",e)}}};function W(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function G(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var H=I;window.vl_player_version=H.version;var q,Y,z,K,Q,$,X,J,Z=["videoDetails","linearChannel","series","entitlementData"],ee=function(e,n){var t,r,i;return null!==(t=null==e||null===(r=e.endpoints)||void 0===r||null===(i=r[n])||void 0===i?void 0:i.useGlobal)&&void 0!==t?t:Z.includes(n)},ne=function(e){var n,t,r,i=null===(n=o.playerConfigManager.getConfig())||void 0===n?void 0:n.api;return G(G({},ee(i,e)&&(null==i?void 0:i.headers)),null==i||null===(t=i.endpoints)||void 0===t||null===(r=t[e])||void 0===r?void 0:r.headers)},te=function(e){var n,t,r,i=null===(n=o.playerConfigManager.getConfig())||void 0===n?void 0:n.api;return G(G({},ee(i,e)&&(null==i?void 0:i.params)),null==i||null===(t=i.endpoints)||void 0===t||null===(r=t[e])||void 0===r?void 0:r.params)},re=function(){var e,n,t,r;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.overrideEntitlementBaseUrl)+"/video/status":ue.get()+"".concat(null==b?void 0:b.getVideoDetails)},ie=function(e,n){var t,r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(r=t.customData)&&void 0!==r&&r.overrideEntitlementResponse)return new Promise(function(e,n){var t,r;return e({data:null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.overrideEntitlementResponse})});var a,l,s,u,d=re();return i({url:re(),params:G(G({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:o},null===(a=window)||void 0===a||null===(l=a.customData)||void 0===l?void 0:l.entitlement),te("videoDetails")),method:"GET",headers:G({Authorization:n,"Sdk-Version":H.version,"x-player-name":"videojs",adbTempToken:null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.adbTempToken},ne("videoDetails")),withCredentials:!0}).catch(function(n){throw B(d,n,"content",{videoId:e}),n})},oe=function(e,n){var t,r,o,a,l,s,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(r=t.customData)&&void 0!==r&&r.overrideEntitlementResponse)return new Promise(function(e,n){var t,r;return e({data:null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.overrideEntitlementResponse})});var d=ue.get()+b.getLinearChannelDetails;return i({url:d,params:G(G(G(G(G(G({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(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===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),te("linearChannel")),method:"GET",headers:G({Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken},ne("linearChannel"))}).catch(function(n){throw B(d,n,"content",{videoId:null==e?void 0:e.id,channelId:null==e?void 0:e.channelId,programId:null==e?void 0:e.programId}),n})},ae=function(){var e=n(t.mark(function e(n){var r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k();case 2:return r=e.sent,e.abrupt("return",i({url:ue.get()+"".concat(null==b?void 0:b.saveWatchHistoryV2),method:"POST",headers:G({Authorization:r},ne("saveWatchHistory")),data:G({},n),params:G(G({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId}),te("saveWatchHistory"))}).catch(function(e){throw B("saveWatchHistory",e,"content",{videoId:null==n?void 0:n.videoId,profileId:null==n?void 0:n.profileId}),e}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),le=function(e,n){var t,r,o=window.contentType,a=ue.get()+"".concat(null==b?void 0:b.getVideoInfoV2,"/").concat(o,"/").concat(e);return i({method:"GET",url:a,headers:G({Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(r=t.watchHistory)||void 0===r?void 0:r.xApiKey},ne("videoInfo")),params:te("videoInfo"),timeout:15e3}).catch(function(n){throw B(a,n,"content",{videoId:e,contentType:o}),n})},se=function(e){var n=e.videoId,t=ue.get()+"".concat(null==b?void 0:b.getSeriesWatchHistoryV2,"/").concat(n);return i({method:"GET",url:t,headers:G({Authorization:e.token},ne("seriesWatchHistory")),params:te("seriesWatchHistory"),timeout:15e3}).catch(function(r){throw B(t,r,"content",{seriesId:n,videoId:null==e?void 0:e.videoId}),r})},ue=(q=null==b?void 0:b.apiBaseUrl,{set:function(e){e&&(q=e)},get:function(){return q}}),de=(X=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;X.set(t,(X.get(t)||0)+1)},get:function(e){return X.get(e)},clear:function(){X.clear()}}),ce=function(e){z=e},ve=function(){return z},fe=function(){return Y},pe=function(e){K=e},me=function(e){if(Q){var n=Q.get(e);pe(n+1)}},he=(J=0,{set:function(e){e>=0&&(J=e)},get:function(){return J}}),ge=function(){var e=he.get();return e>=0?e+1:1},ye=function(){var e,n,t,r=fe(),i=ve(),o=null==i||null===(e=i.video)||void 0===e?void 0:e.id,a=he.get(),l=null==r||null===(n=r[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===o});return l>=0?l+1:1};function Ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function be(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var Ee=s,Te=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},_e=function(e){var n=we(e,"video.tags",[]),t=we(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},we=function(e,n,t){for(var r=0,i=(n=n.split(".")).length;r<i;r++){var o;e=null===(o=e)||void 0===o?void 0:o[n[r]]}return e||t},Se=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID";return e?n:n.includes("browser-")?n.replace("browser-",""):n},ke=function(){var e,n,t,r,i,o,l,s,d,c,v,f,p,m,h,g,y,I,b,E,T,_,w,S,k,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",O=arguments.length>1?arguments[1]:void 0,P=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return A;var L=(null==P?void 0:P.siteName)||(null==P?void 0:P.site)||"",D=(null==P?void 0:P.contentType)||"video",C=(null==P||null===(t=P[D])||void 0===t?void 0:t.metadata)||(null==P||null===(r=P[D])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.metadata),N=a.getPlayer(O);if(!A.includes("VIEWLIFT_"))return A;var R,x=window.getComputedStyle(document.getElementById(O),null),j=Math.trunc(x.getPropertyValue("height").slice(0,-2)),F=Math.trunc(x.getPropertyValue("width").slice(0,-2)),V="linearchannel"===D?null==P||null===(o=P.linearchannel)||void 0===o||null===(l=o.channels)||void 0===l||null===(s=l.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===s||null===(d=s.content)||void 0===d?void 0:d.id:we(P,"video.gist.id",""),M="linearchannel"===D?null==P||null===(c=P.linearchannel)||void 0===c||null===(v=c.channels)||void 0===v||null===(f=v.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===f?void 0:f.title:we(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,B=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",function(e){U=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var W=u.get("us_privacy")||u.get("usprivacy"),G=void 0!==W?W:"1YNN",H=null!==(p=null===(m=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===m?void 0:m.fwIdentifier)&&void 0!==p?p:null,q=be(be({},Ae(C)),{},{VIEWLIFT_WIDTH:F,VIEWLIFT_HEIGHT:j,VIEWLIFT_SIZE:Te(F,j),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===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:we(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:we(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:we(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==N||null===(g=N.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==N||null===(y=N.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L||"golfchannel"==L?"":Se(!1),VIEWLIFT_DID:"spinco"==L||"usanetwork"==L||"golfchannel"==L?"":Se(),VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:_e(P),VIEWLIFT_MEDIA_ID:V,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(we(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:V,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+we(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:we(null===(I=window)||void 0===I||null===(b=I.app_data)||void 0===b||null===(E=b.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==L||"usanetwork"==L||"golfchannel"==L?"":we(null===(T=window)||void 0===T||null===(_=T.app_data)||void 0===_||null===(w=_.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:G,VIEWLIFT_TVE_PROVIDER:H?Ee(H):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*we(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:we(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:V,VIEWLIFT_CONTENT_TITLE:M,VIEWLIFT_CONTENT_SERIES_TITLE:we(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:we(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ye(),VIEWLIFT_SEASON_NUMBER:ge(),VIEWLIFT_CONTENT_TAGS:_e(P),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(k=S.customData)||void 0===k?void 0:k.macros);for(var Y in q){var z=new RegExp(Y,"g");A=A.replace(z,q[Y])}return A},Ae=function(e){var n,t,r,i,o,a,s,u,d,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var f=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(r=t.subscription)||void 0===r?void 0:r.SVOD)||!1,p=(null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o||null===(a=o.subscription)||void 0===a?void 0:a.TVE)||!1;return f||p?(l.isMobile()?f?c=be(be({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):p&&(c=be(be({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):f?c=be(be({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):p&&(c=be(be({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),f?c=be(be({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(l.isMobile()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}):p&&(c=be(be({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||"",VIEWLIFT_SFID_CSAI:v.get(l.isMobile()?"sfid.mweb.tve.csai":"sfid.web.tve.csai")||""})),c=l.isMobile()?be(be({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):be(be({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=be(be({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(l.isMobile()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}),c=l.isMobile()?be(be({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):be(be({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})),c=be(be({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:we(null===(s=window)||void 0===s||null===(u=s.app_data)||void 0===u||null===(d=u.appcmsMain)||void 0===d?void 0:d.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},Oe="SW_SECURE_CRYPTO",Pe=["HW_SECURE_ALL","HW_SECURE_DECODE"],Le=Oe,De=null,Ce=function(e){return[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:Oe}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.4d401f"',robustness:e}],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]}]},Ne=function(){return Le},Re=function(){return Oe};De||(De=function(){var e;if("undefined"==typeof navigator)return!1;var n=(null===(e=navigator.userAgentData)||void 0===e?void 0:e.platform)||navigator.platform||"";return/win/i.test(n)&&/Chrome|Edg/.test(navigator.userAgent)}()&&navigator.requestMediaKeySystemAccess?n(t.mark(function e(){var n,r,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=0,r=Pe;case 1:if(!(n<r.length)){e.next=15;break}return i=r[n],e.prev=3,e.next=6,navigator.requestMediaKeySystemAccess("com.widevine.alpha",Ce(i));case 6:return Le=i,e.abrupt("return",Le);case 10:e.prev=10,e.t0=e.catch(3);case 12:n++,e.next=1;break;case 15:return e.abrupt("return",Le);case 16:case"end":return e.stop()}},e,null,[[3,10]])}))():Promise.resolve(Le));var xe=function(e,n){var t,r,i,o,a,s,u,d,c,v,f,p,m,h=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[h])||void 0===t?void 0:t.drmEnabled,y=null==e||null===(r=e[h])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.videoAssets,I=null==e||null===(o=e[h])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.audioAssets,b=(null==e||null===(s=e[h])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(c=e[h])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var E=(null==e||null===(f=e[h])||void 0===f||null===(p=f.streamingInfo)||void 0===p||null===(m=p.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=I&&I.hls)return Fe(I);if(g){var T=Ve(y,n);return T.src=ke(T.src,n,e),T}if("Safari"!==l.detectBrowser()&&E)return je(y);if(b){var _=Fe(y);return _.src=ke(_.src,n,e),_}if(null!=y&&y.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(y);return w.src=ke(w.src,n,e),w}return null},je=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Fe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ve=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,o=e.widevine,s=e.playReady,u=l.detectBrowser();if(a.getPlayer(n),"Safari"===u){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",__vlLicenseUrl:(null==e?void 0:e.licenseUrl)||"",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};r.xhr(i,function(e,n,r){console.log(e),e&&t(e),t(null,new Uint8Array(r))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,o){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};r.xhr(a,function(e,n,t){console.log(e),e&&o(e),o(null,t)})}}}}}(i);return Me(n),d}var c,v={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(Me(n),v.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:Ne(),audioRobustness:Re()},"com.microsoft.playready":{url:null==s?void 0:s.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==s?void 0:s.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:Ne(),audioRobustness:Re()}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==s?void 0:s.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:Ne(),audioRobustness:Re()}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==s?void 0:s.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==s?void 0:s.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var Me=function(e){var n=a.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==l.detectBrowser()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}};function Ue(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}var Be=function(e,n){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var r=document.getElementById(e);if(r){var i=document.createElement("div");i.className="error-container";var o=document.createElement("div");o.className="error-message",o.innerHTML="".concat(n),i.appendChild(o),r.append(i)}}},We=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Ge=!1,He=function(e,n,t){var r=ke(n,e,t),i=a.getPlayer(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==c(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,r,i,o=a.getPlayer(e);if(null!==o.el_){Ge=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),Ge&&null!==o.el_&&("function"==typeof o.ima?o.ima(l):setTimeout(function(){o.ima.setContentWithAdTag(null,n,!0),o.ima.requestAds()},1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var u="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,u="touchend"),o.one(u,function(){d&&o.ima.initializeAdDisplayContainer()}),function(e){if(!e._adVolumeSynced){e._adVolumeSynced=!0;var n=function(){try{var n=e.ima&&e.ima.getAdsManager&&e.ima.getAdsManager();if(!n||"function"!=typeof n.setVolume)return;n.setVolume(e.muted()?0:e.volume())}catch(e){}};e.on(["volumechange","advolumechange"],n),e.on("ads-manager",n)}}(o);var c=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.adEventHandler)||null;o.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),o.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),o.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,r)}};function qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Ye(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var ze=Object.freeze({PLAY:"PLAY",FIRST_FRAME:"FIRST_FRAME",PING:"PING",PAUSE:"PAUSE",RESUME:"RESUME",BUFFERING:"BUFFERING",SEEK_FORWARD:"SEEK_FORWARD",SEEK_BACKWARD:"SEEK_BACKWARD",FAILED_TO_START:"FAILED_TO_START",DROPPED_STREAM:"DROPPED_STREAM",AD_REQUEST:"AD_REQUEST",AD_IMPRESSION:"AD_IMPRESSION",WATCH_LIVE:"WATCH_LIVE",START_FROM_BEGINNING:"START_FROM_BEGINNING",RESUME_PLAYBACK:"RESUME_PLAYBACK",MV_SELECTION:"MV_SELECTION"}),Ke=[ze.WATCH_LIVE,ze.START_FROM_BEGINNING,ze.RESUME_PLAYBACK,ze.MV_SELECTION],Qe=[ze.WATCH_LIVE,ze.START_FROM_BEGINNING,ze.RESUME_PLAYBACK],$e=[ze.PING,ze.MV_SELECTION],Xe=Object.freeze({LOADED:"loaded",STARTED:"start"}),Je="WEBSITE",Ze=function(e){return(null==e?void 0:e.contentType)||"video"},en=function(e){return"linearchannel"===Ze(e)},nn=function(e){var n,t,r,i,o,a,l;return en(e)?null==e||null===(n=e.linearchannel)||void 0===n||null===(t=n.channels)||void 0===t||null===(r=t.find(function(n){return(null==n?void 0:n.id)===(null==e?void 0:e.channelId)}))||void 0===r||null===(i=r.content)||void 0===i?void 0:i.id:(null==e||null===(o=e.video)||void 0===o||null===(a=o.gist)||void 0===a?void 0:a.id)||(null==e||null===(l=e.video)||void 0===l?void 0:l.id)||(null==e?void 0:e.id)},tn=function(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return en(e)?r.title:(null==e||null===(n=e.video)||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||r.title},rn=function(e){return Array.from({length:e},function(){return Math.floor(16*Math.random()).toString(16)}).join("")},on=function(e){return en(e)&&(null==e?void 0:e.channelId)||null},an=function(e,n){return Boolean(null==e?void 0:e.key)&&e.key===on(n)},ln=function(e,n,t){var r=e.lastCountedAt,i=null===r?0:Math.min(Math.max(n-r,0),1e3);return{seconds:e.seconds+i/1e3,lastCountedAt:t?n:null}},sn=function(e){var n,t,r,i,o,a,l,s,u,d=e.site,c=e.profid,v=e.context,f=e.event;return[Ye(Ye(Ye(Ye({aid:d.name,cid:d.id,pfm:Je},v.params),{},{uid:v.uid,vid:v.vid,url:v.url,ref:v.ref,pa:f.eventName,vpos:null!==(n=f.videoPosition)&&void 0!==n?n:null,environment:"production",dp1:"",dp2:"",dp3:"",dp4:"",dp5:"",apos:f.isAdEvent?f.videoPosition:null,apod:f.isAdEvent?(u=f.adPosition,u?String(u):""):"",profid:c,player:"native",media_type:"VIDEO",stream_id:v.streamId,embedurl:"",ttfirstframe:null!==(t=f.ttFirstFrame)&&void 0!==t?t:null,bitrate:null!==(r=f.bitrate)&&void 0!==r?r:null,connectionspeed:null,resolutionheight:null!==(i=f.resHeight)&&void 0!==i?i:null,resolutionwidth:null!==(o=f.resWidth)&&void 0!==o?o:null,bufferhealth:null!==(a=f.bufferHealth)&&void 0!==a?a:null,networkname:null!==(l=v.network)&&void 0!==l?l:null,brandname:null!==(s=d.name)&&void 0!==s?s:null},f.duration&&{duration:f.duration}),v.params),v.title&&{title:v.title})]};function un(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function dn(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?un(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var cn=["localhost","127.0.0.1"],vn=["adend","adskip","adtimeout","adserror"],fn=["pause","waiting","seeking","ended","error","adstart"],pn=new Map,mn=function(){return performance.now()},hn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var t;return null!==(t=e())&&void 0!==t?t:n}catch(e){return n}},gn=function(e){return function(){try{e.apply(void 0,arguments)}catch(e){console.error("[BEACON]",e)}}},yn=function(e){return hn(function(){return Math.floor(e.currentTime())},0)},In=function(e){return{resHeight:hn(function(){return e.videoHeight()}),resWidth:hn(function(){return e.videoWidth()})}},bn=function(e){return hn(function(){var n=e.currentTime(),t=e.buffered(),r=Array.from({length:t.length},function(e,n){return n}).find(function(e){return n>=t.start(e)&&n<=t.end(e)});return void 0===r?null:Math.round(t.end(r)-n)})},En=function(e){return hn(function(){var n,t,r,i,o,a,l,s,u,d,c,v=null!==(n=null===(t=e.tech_)||void 0===t||null===(r=t.vhs)||void 0===r||null===(i=r.playlists)||void 0===i||null===(o=i.media)||void 0===o||null===(a=o.call(i))||void 0===a||null===(l=a.attributes)||void 0===l?void 0:l.BANDWIDTH)&&void 0!==n?n:null===(s=e.dash)||void 0===s||null===(u=s.mediaPlayer)||void 0===u||null===(d=u.getCurrentRepresentationForType)||void 0===d||null===(c=d.call(u,"video"))||void 0===c?void 0:c.bandwidth;return v?Math.round(v/1e3):null})},Tn=function(e,n){return dn(dn({duration:n},In(e)),{},{bufferHealth:bn(e),bitrate:En(e)})},_n=function(e){return hn(function(){return e.hasClass("vjs-waiting")&&!e.paused()},!1)},wn=function(e,n){return!n.adPlaying&&hn(function(){return!e.paused()&&!e.seeking()&&!e.hasClass("vjs-waiting")},!1)},Sn=function(){var e;return cn.includes(null===(e=globalThis.location)||void 0===e?void 0:e.hostname)},kn=function(){var e,n;return Boolean(null===(e=o.playerConfigManager.getConfig())||void 0===e||null===(n=e.debugConfig)||void 0===n?void 0:n.beacon)},An=function(e){var n,t,r,i,o,a,l,s,u=null!==(o="undefined"!=typeof window?null===(a=window.customData)||void 0===a?void 0:a.beacon:void 0)&&void 0!==o?o:{},d=u.params||{};return{playerId:e.playerId,beaconUrl:u.url,params:dn({},d),uid:e.userId||O(),vid:nn(e.content),title:tn(e.content,d),network:(l=e.content,(null==l||null===(s=l[Ze(l)])||void 0===s?void 0:s.network)||null),streamId:e.streamId,url:null!==(n=null===(t=globalThis.location)||void 0===t?void 0:t.href)&&void 0!==n?n:"",ref:null!==(r=null===(i=globalThis.document)||void 0===i?void 0:i.referrer)&&void 0!==r?r:""}},On=function(e,n){return!e||null!=n&&n.anonymousId?"guest-user":null==n?void 0:n.userId},Pn=function(){var e=n(t.mark(function e(n,r){var a,l,s,u,d,c,v,f,p,m=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=(m.length>2&&void 0!==m[2]?m[2]:{}).keepalive,l=void 0!==a&&a,e.prev=1,e.next=4,k();case 4:if(v=e.sent,f=A(v),p=sn({site:{name:null==f?void 0:f.site,id:null==f?void 0:f.siteId},profid:On(v,f),context:n,event:r}),kn()&&console.log("%c[BEACON] ".concat(r.eventName),"color:#fff;background:#7a1010;padding:1px 4px;border-radius:3px",n.playerId,p[0]),!Sn()){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,i(dn({url:(null===(s=o.playerConfigManager.getConfig())||void 0===s||null===(u=s.api)||void 0===u||null===(d=u.endpoints)||void 0===d||null===(c=d.beacon)||void 0===c?void 0:c.url)||n.beaconUrl||ue.get()+b.getBeaconUrl,method:"post",headers:dn({Authorization:v},ne("beacon")),params:te("beacon"),data:p},l&&{adapter:"fetch",fetchOptions:{keepalive:!0}}));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),console.error("[BEACON]",e.t0);case 17:case"end":return e.stop()}},e,null,[[1,14]])}));return function(n,t){return e.apply(this,arguments)}}(),Ln=function(e,n){var t,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0,a=dn({eventName:n,videoPosition:yn(e.player),isAdEvent:!1},i),l=An(e);$e.includes(n)||(t=n,r=function(e,n){return Ye(Ye({},n),{},{pfm:Je,uid:e.uid,vid:e.vid},e.params)}(l,a),Ue("event",t,r)),Pn(l,a,o)},Dn=function(e,n){var t=e.player,r=e.state;if(!r.adPlaying){var i=Math.round(ln(r.watchTime,mn(),!1).seconds);r.watchTime={seconds:0,lastCountedAt:null},i<1||Ln(e,ze.PING,Tn(t,i),n)}},Cn=function(e,n){var t=e.state;t.pendingFailure&&(Ln(e,t.pendingFailure,{},n),t.pendingFailure=null,t.failed=!0),Dn(e,n)},Nn=function(e,n){Qe.includes(n)&&(e.state.ignoreSeeksUntil=mn()+5e3),Ln(e,n,In(e.player))},Rn=[function(e){var n=e.player,t=e.getContent,r=e.state,i=e.analytics,o=e.on,a=e.track;o("play",function(){r.playSent||(r.playSent=!0,r.playStartedAt=mn(),a(ze.PLAY),"function"==typeof i.callback&&i.callback("started_video_playback",dn({"Video ID":nn(t()),watchTime:yn(n)},i.params)))}),o("timeupdate",function(){if(r.playSent&&!r.firstFrameSent&&wn(n,r)){r.firstFrameSent=!0;var e=(mn()-r.playStartedAt)/1e3;a(ze.FIRST_FRAME,{ttFirstFrame:parseFloat(e.toFixed(2)),bufferHealth:bn(n)})}}),o(v.PLAYER_CONTROL_EVENT,function(e,n){r.firstFrameSent&&((null==n?void 0:n.playeraction)!==v.PLAYER_ACTIONS.PAUSE||r.paused?(null==n?void 0:n.playeraction)===v.PLAYER_ACTIONS.RESUME&&r.paused&&(r.paused=!1,a(ze.RESUME)):(r.paused=!0,a(ze.PAUSE)))})},function(e){var n=e.player,t=e.state,r=e.on,i=e.track,o=null,a=function(){if(o&&!hn(function(){return n.scrubbing()||n.seeking()},!1)){var e=o,r=e.from,a=e.programmatic;o=null;var l=yn(n);t.lastPosition=l,!a&&t.firstFrameSent&&l!==r&&i(l>r?ze.SEEK_FORWARD:ze.SEEK_BACKWARD)}};r("seeking",function(){o||(o={from:t.lastPosition,programmatic:mn()<=t.ignoreSeeksUntil})}),r("seeked",a),r("playing",function(){t.ignoreSeeksUntil===1/0&&(t.ignoreSeeksUntil=mn()+5e3)}),r("timeupdate",function(){o?a():hn(function(){return n.seeking()},!1)||(t.lastPosition=yn(n))})},function(e){var n=e.player,t=e.state,r=e.on,i=e.timeout,o=e.interval,a=e.track,l=e.flushPing,s=null,u=null,d=null,c=0,v=0,f=0,p=function(){var e;null===(e=u)||void 0===e||e(),u=null},m=function(){var e;null===(e=d)||void 0===e||e(),d=null,t.pendingFailure=null},h=function(e){var n;t.failed||(t.failed=!0,m(),null===(n=s)||void 0===n||n(),p(),a(e),e===ze.DROPPED_STREAM&&l())},g=function(){d||(v=mn(),d=i(function(){return h(t.pendingFailure)},c))},y=function(){var e;null===(e=s)||void 0===e||e(),s=i(function(){t.firstFrameSent||n.paused()||h(ze.FAILED_TO_START)},3e4)};r("play",function(){t.firstFrameSent||t.adPlaying||y()}),r("adstart",function(){var e;return null===(e=s)||void 0===e?void 0:e()}),r(vn,function(){t.playSent&&!t.firstFrameSent&&y()}),r("waiting",function(){var e,r,l=!t.adPlaying&&!t.failed&&!t.pendingFailure;t.firstFrameSent&&l&&!u&&(e=i(function(){return _n(n)&&h(ze.DROPPED_STREAM)},45e3),r=o(function(){return _n(n)?a(ze.BUFFERING):p()},5e3),u=function(){r(),e()})}),r(["playing","pause"],p),r("playing",function(){t.failed=!1}),r("error",function(){t.failed||t.pendingFailure||(t.pendingFailure=t.firstFrameSent?ze.DROPPED_STREAM:ze.FAILED_TO_START,f=hn(function(){return n.currentTime()},0),c=45e3,p(),hn(function(){return n.paused()},!1)||g())}),r("timeupdate",function(){if(t.pendingFailure){var e=hn(function(){return n.currentTime()},0),r=e>f;f=e,r&&wn(n,t)&&m()}}),r("pause",function(){return t.pendingFailure&&void(d&&(d(),d=null,c=Math.max(c-(mn()-v),0)))}),r("play",function(){return t.pendingFailure&&g()})},function(e){var n=e.player,t=e.state,r=e.on,i=e.cleanup,o=e.track,a=null,l=function(e){return dn({isAdEvent:!0,adPosition:hn(function(){return e.getAd().getAdPodInfo().getAdPosition()},1)},In(n))},s=gn(function(e){return o(ze.AD_REQUEST,l(e))}),u=gn(function(e){return o(ze.AD_IMPRESSION,l(e))}),d=function(){var e,n;null===(e=a)||void 0===e||e.removeEventListener(Xe.LOADED,s),null===(n=a)||void 0===n||n.removeEventListener(Xe.STARTED,u),a=null},c=function(e){e&&e!==a&&(d(),e.addEventListener(Xe.LOADED,s),e.addEventListener(Xe.STARTED,u),a=e)};r("ads-manager",function(e){return c(null==e?void 0:e.adsManager)}),r("adstart",function(){t.adPlaying=!0}),r(vn,function(){t.adPlaying=!1}),c(hn(function(){return n.ima.getAdsManager()})),i(d)},function(e){var n=e.player,t=e.state,r=e.on,i=e.track;r("timeupdate",function(){var e=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,t=Math.floor(e.seconds/n);return{pings:t,watchTime:Ye(Ye({},e),{},{seconds:e.seconds-t*n})}}(ln(t.watchTime,mn(),wn(n,t))),r=e.pings,o=e.watchTime;t.watchTime=o,Array.from({length:r}).forEach(function(){return i(ze.PING,Tn(n,30))})}),r(fn,function(){t.watchTime=ln(t.watchTime,mn(),!1)})},function(e){var n=e.player,t=e.on,r=e.reportUserAction;t(v.PLAYER_CONTROL_EVENT,function(e,t){(null==t?void 0:t.playeraction)===v.PLAYER_ACTIONS.GO_LIVE&&function(e){return!hn(function(){return e.liveTracker.atLiveEdge()},!1)}(n)&&r(ze.WATCH_LIVE)})}],xn=function(e){return dn({playSent:!1,firstFrameSent:!1,playStartedAt:null,paused:!1,adPlaying:!1,failed:!1,pendingFailure:null,lastPosition:0,ignoreSeeksUntil:0,watchTime:{seconds:0,lastCountedAt:null}},e)},jn=function(e,n){n.flush&&Cn(e),e.teardowns.forEach(function(e){return gn(e)()}),e.teardowns.clear()},Fn=function(e){var n,t=null===(n=pn.get(e))||void 0===n?void 0:n.session;t&&jn(t,{flush:!0}),pn.delete(e)},Vn=!1,Mn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.content,r=n.analyticsCb,i=n.analyticsEventParams,s=n.userId,u=a.getPlayer(e);if(!(!u||Sn()&&!kn()||l.isBotUserAgent()||null!==(d=o.playerConfigManager.getConfig())&&void 0!==d&&d.disableBeacon)){var d,c=pn.get(e),v=function(e,n){var t,r,i,o=an(e,n);return{stream:o?e:{key:on(n),id:null!==(t=null===(r=globalThis.crypto)||void 0===r||null===(i=r.randomUUID)||void 0===i?void 0:i.call(r))&&void 0!==t?t:[rn(8),rn(4),rn(4),rn(4),rn(12)].join("-")},reused:o}}(null==c?void 0:c.stream,t),f=v.stream,p=v.reused;null!=c&&c.session&&jn(c.session,{flush:!p});var m,h,g=function(e){var n=e.playerId,t=e.player,r=e.content,i=e.streamId,o=e.userId,a=e.analyticsCb,l=e.analyticsEventParams,s=e.inherited,u=new Set,d={playerId:n,player:t,content:r,streamId:i,userId:o,state:xn(s),teardowns:u},c=function(e,n){var r=gn(n);t.on(e,r),u.add(function(){return t.off(e,r)})},v=function(e){return u.add(e),e},f={player:t,getContent:function(){return d.content},state:d.state,analytics:{callback:a,params:l},on:c,timeout:function(e,n){var t=v(function(){clearTimeout(r),u.delete(t)}),r=setTimeout(function(){u.delete(t),gn(e)()},n);return t},interval:function(e,n){var t=setInterval(gn(e),n),r=v(function(){clearInterval(t),u.delete(r)});return r},cleanup:v,track:function(e,n){return Ln(d,e,n)},flushPing:function(){return Dn(d)},reportUserAction:function(e){return Nn(d,e)}};return Rn.forEach(function(e){return e(f)}),c("dispose",function(){return Fn(n)}),d}({playerId:e,player:u,content:t,userId:s,analyticsCb:r,analyticsEventParams:i,streamId:f.id,inherited:p&&null!=c&&c.session?(m=c.session.state,{playSent:m.playSent,firstFrameSent:m.firstFrameSent,playStartedAt:m.playStartedAt,paused:m.paused,watchTime:m.watchTime,ignoreSeeksUntil:1/0}):{}});pn.set(e,{stream:f,session:g}),Vn||(Vn=!0,null===(h=globalThis.addEventListener)||void 0===h||h.call(globalThis,"pagehide",function(){return pn.forEach(function(e){var n=e.session;return n&&Cn(n,{keepalive:!0})})}))}},Un=function(e,n){var t=pn.get(e);null!=t&&t.session&&an(t.stream,n)&&(t.session.content=n)},Bn=function(e,n){var t,r=null===(t=pn.get(e))||void 0===t?void 0:t.session;return!(!r||!Ke.includes(n))&&(Nn(r,n),!0)};var Wn,Gn=(Wn=!0,{enable:function(){Wn=!0},disable:function(){Wn=!1},get enabled(){return Wn}}),Hn="ssai-breakStart",qn="ssai-adImpression",Yn="ssai-firstQuartile",zn="ssai-midpoint",Kn="ssai-thirdQuartile",Qn="ssai-complete",$n="ssai-breakEnd",Xn={breakStart:Hn,impression:qn,firstQuartile:Yn,midpoint:zn,thirdQuartile:Kn,complete:Qn,breakEnd:$n};function Jn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=a.getPlayer(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var r=n.eventType,i=Xn[r];i&&t.trigger(i,n)}function Zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function et(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var nt,tt=(nt={},{get:function(){return nt},set:function(e){nt=e}});function rt(e,n){var t,r,i,o,l,s,u,d,c,v,f,p,h,g,y,I,b,E,T,_,w,S=null==e?void 0:e.playerId,k=a.getPlayer(S);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var A=ve(),O=(null==A||null===(r=A.video)||void 0===r?void 0:r.metadata)||[],P=(null==O?void 0:O.length)&&O.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=P)&&void 0!==i&&i.length){var L=P.map(function(e){return e.value});P=null==L?void 0:L.join(",")}m.destroyComscoreTag();var D,C,N,R=null===(o=window)||void 0===o?void 0:o.lcProgrammeDetails,x=Array.isArray(null==R?void 0:R.category)?null==R||null===(l=R.category)||void 0===l?void 0:l.join(","):(null==R?void 0:R.category)||null,j=et(et(et({},null==A?void 0:A.video),null==A?void 0:A.linearchannel),{},{siteName:(null==e||null===(s=e.comscore)||void 0===s?void 0:s.applicationName)||(null==e||null===(u=e.comscore)||void 0===u||null===(d=u.metadata)||void 0===d?void 0:d.siteName)||(null==A?void 0:A.site)||null,programId:(null==R?void 0:R.videotmsid)||null,programTitle:(null==R?void 0:R.lcProgrammeName)||null,episodeId:(null==R?void 0:R.videotmsid)||null,seasonNumber:(null==A||null===(c=A.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==R||null===(f=R.seriesDetails)||void 0===f?void 0:f.season)||null,episodeNumber:(null==A||null===(p=A.video)||void 0===p||null===(h=p.series)||void 0===h?void 0:h.episodeNumber)||(null==R||null===(g=R.seriesDetails)||void 0===g?void 0:g.episode)||null,episodeTitle:(null==R?void 0:R.lcSubTitle)||null,isCompleteEpisode:!!(null!=A&&null!==(y=A.video)&&void 0!==y&&y.series||null!=R&&null!==(I=R.seriesDetails)&&void 0!==I&&I.episode),genre:P||x,comscoreConfig:{implementationId:(null==e||null===(b=e.comscore)||void 0===b?void 0:b.implementationId)||null,projectId:(null==e||null===(E=e.comscore)||void 0===E?void 0:E.projectId)||null}}),F=null==e||null===(T=e.comscore)||void 0===T||null===(_=T.metadata)||void 0===_?void 0:_.contentType;if(null!=j&&null!==(w=j.streamingInfo)&&void 0!==w&&w.isLiveStream?j.contentType="Live":j.contentType=F||"LongFormOnDemand",null==j||!j.network){var V,M=(null==j?void 0:j.metadata)||[],U=null==M||null===(V=M.find(function(e){return"network"===e.name}))||void 0===V?void 0:V.value;j.network=U||null}null!=j&&j.network&&null!=j&&j.genre&&(j.customGenre="".concat(j.network,"_").concat((null==j?void 0:j.programTitle)||(D=j,null!=D&&D.series?null==D||null===(N=D.series)||void 0===N?void 0:N.title:null==D||null===(C=D.gist)||void 0===C?void 0:C.title),"_").concat(j.genre)),null!=R&&R.airDate&&(j.publishDate=R.airDate),null!=j&&j.runtime&&"function"==typeof k.duration&&(j.runtime=1e3*Math.ceil(k.duration()));var B=m.formulateComscorePayload(j,k);console.log("comscoreOptions player data",B),m.createComscoreStreamingTag(et({playerName:"Video.js"},B)),m.setComscorePlayerInstance(k)}}function it(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ot(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}function at(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 lt(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)?lt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function lt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var st=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}();function ut(e,n){return dt.apply(this,arguments)}function dt(){return(dt=n(t.mark(function e(n,r){var i,o,l,s,u,d,c,v,f,m,h,g,y,I,b,E,T,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.getPlayer(n),l=xe(r,n),s=l.src,u=(null==r?void 0:r.contentType)||"video",null==r||null===(i=r[u])||void 0===i||null===(o=i.streamingInfo)||void 0===o||o.isLiveStream,d=s.replace("/dash/","/session/").replace("/master/","/session/"),d=ke(d,n,r),c=vt(d),v=p(c,2),f=v[0],m=v[1],h=ct(m)||{},d=new URL(d.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var n=p(e,2),t=n[0],r=n[1];d.searchParams.set(t,r)}),e.prev=11,e.next=14,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ot({adsParams:ot({},f)},h))});case 14:return g=e.sent,e.next=17,g.json();case 17:return y=e.sent,I="https://"+new URL(d).hostname,b=y.trackingUrl,E=y.manifestUrl,T=I+b,_=I+E,st.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),l.src=_,e.abrupt("return",l);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",l);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function ct(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=p(e,2),t=n[0],r=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(r)]}))||{}}function vt(e){var n={};if(!e.split("?")[1])return[{},{}];var t,r=new URL(e,window.location.origin),i=at((null==r?void 0:r.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var o=p(t.value,2),a=o[0],l=o[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){i.e(e)}finally{i.f()}for(var s={},u={},d=0,c=Object.entries(n);d<c.length;d++){var v=p(c[d],2),f=v[0],m=v[1];if(f.startsWith("ads."))s[f.replace(/^ads\./,"")]=m;else u[f]=m}return[s,u]}var ft,pt,mt,ht=new Map;function gt(e,n){return yt.apply(this,arguments)}function yt(){return yt=n(t.mark(function e(r,i){var o,l,s,u,d,c,v,p,m,h,g,y,I,b,E,T,_,w,S,k,A,O,P,L,D;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:D=function(e,n,t,i,o,l){var s,u,d=a.getPlayer(r);if(!d.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<P&&O.clear(),P=e;var v=(null==n||null===(s=n.ads)||void 0===s||null===(u=s[i])||void 0===u?void 0:u.adId)||c;Math.floor(d.currentTime());var f,p=at(t);try{for(p.s();!(f=p.n()).done;){var m,h,g,y=f.value,I=y.eventType,b=y.beaconUrls,E=y.startTimeInSeconds,T=y.startTime,_=y.durationInSeconds,w=E||0,S=b,k=(null===(m=window)||void 0===m||null===(h=m.customData)||void 0===h||null===(g=h.ads)||void 0===g?void 0:g.adEventHandler)||null,A="".concat(w,"_").concat(I),D=ht.get("pod-".concat(o))||[];if(console.warn(e,w,"map:",I,"condition1:",e>=w,"map:",ht),e>=w&&!D.includes(A)){D.push(A),ht.set("pod-".concat(o),D);try{L(I,n,S,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,I,n)}if("function"==typeof k)try{var C,N={eventType:I,startTimeInSeconds:E,startTime:T,durationInSeconds:_,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[i],adIndex:i};k({adsData:N}),Jn(r,N)}catch(e){console.error("Error when calling ads callback:",e)}var R=tt.get();if(R&&0!==Object.keys(R).length){var x=R.formulateComscoreAdPayload,j=R.startComscoreAdTracking,F=R.finishComscoreAdTracking,V=R.endComscoreAdTracking,M="".concat(w,"_").concat(v,"_").concat(I);if(!O.has(M))if(O.set(M,!0),"impression"===I){var U,B=st.get();j(x(ot(ot({},null==n||null===(U=n.ads)||void 0===U?void 0:U[i]),{},{trackingUrl:B})))}else"complete"===I?F():"breakEnd"===I&&V()}}}}catch(e){p.e(e)}finally{p.f()}}},L=function(e,n,t,r){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},ht.clear(),window.isAdPlaying=!1,m=st.get(),(h=a.getPlayer(r)).one("loadeddata",function(){m&&k(m)}),g=new Map,y=new Map,I=-1,b=(null===(o=document)||void 0===o||null===(l=o.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,E=(null==h||null===(s=h.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,T=(null==h||null===(u=h.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,_=(null==h||null===(d=h.el())||void 0===d||null===(c=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,w=(null==h||null===(v=h.el())||void 0===v||null===(p=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,S=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return f(r);var i=[],o=null==r?void 0:r.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&a){var d=null==s?void 0:s.map(function(e){return ot(ot({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=d&&d[0]&&i.push(null==d?void 0:d[0])}return i},k=function(){var e=n(t.mark(function e(n){var o,l,s,u,d,c,v,p,m,h,k,O,P,L,C,N,R,x,j,F,V,M,U,B,W,G;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return M=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",M),0===e.button&&x(R)},V=function(e){},F=function(e){if(null!=e){var n,t=null,r=at(p);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.startTimeInSeconds,a=i.ads;Array.isArray(a)&&(null==a?void 0:a.length)>0&&(o>e||g.has(o)||(null===t||o>t.startTimeInSeconds)&&(t=i))}}catch(e){r.e(e)}finally{r.f()}t?(console.log("Resume: seeking back to recent ad break:",t.startTimeInSeconds,"then resuming to",e),m={position:e,podStart:t.startTimeInSeconds,podEndTime:t.startTimeInSeconds+t.durationInSeconds,entered:!1},setTimeout(function(){h.currentTime(t.startTimeInSeconds+.4)},100)):(m=null,h.currentTime(e),j(e))}},j=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.currentTime(),t=null,r=at(p);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=i.startTimeInSeconds,a=i.durationInSeconds,l=(i.ads,Math.floor(o+a));n>=o&&n<=l&&(t=l,g.set(o,!0))}}catch(e){r.e(e)}finally{r.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},x=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.currentTime();if(!(null==e||e<0||n<=e)){var t,r=null,i=at(p);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=o.startTimeInSeconds,l=o.ads;Array.isArray(l)&&(null==l?void 0:l.length)>0&&(g.has(a)||a>e&&a<=n&&(null===r||a>r.startTimeInSeconds)&&(r=o))}}catch(e){i.e(e)}finally{i.f()}null!==r&&(g.set(r.startTimeInSeconds,!0),y.set(r.startTimeInSeconds,!0),m={position:n,podStart:r.startTimeInSeconds,podEndTime:r.startTimeInSeconds+r.durationInSeconds,entered:!1},console.log("Seeking back to ad pod:",r.startTimeInSeconds,"then resuming to",n),setTimeout(function(){h.currentTime(r.startTimeInSeconds+.4)},100))}},e.next=8,fetch(n);case 8:return d=e.sent,e.next=11,d.json();case 11:c=e.sent,v=c.avails,p=[],m=null,h=a.getPlayer(r),k=h.controlBar.progressControl,O=k.seekBar.el(),null===(o=document)||void 0===o||o.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),v.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t||t.length),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:S(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),i&&F(i),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p,"function"==typeof(N=(null===(P=window)||void 0===P||null===(L=P.customData)||void 0===L||null===(C=L.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&N(p)),console.log(p,"data"),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,r=h.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(i,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(i,"%"),o.style.pointerEvents="none",O.appendChild(o)}}),h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=a.throttle(function(){var e=h.currentTime();if(e!==I){I=e;for(var n=!1,t=function(){var t=p[r],i=t.startTimeInSeconds,o=t.durationInSeconds,a=t.ads,l=i+o;if(e>=i-1.2&&e<=l+1.2){var s;e>=i&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&g.set(i,!0),Gn.disable(),b&&b.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),w&&(w.style.pointerEvents="none",w.classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),k.el().classList.add("hide-progress-bar");for(var u=e-i,d=0,c=0,v=0;v<a.length;v++){var m,h=null==a||null===(m=a[v])||void 0===m?void 0:m.durationInSeconds;if(u<d+h){c=v;break}d+=h}a[c];var I=Math.max(0,o-u),S=Math.round(I);U.style.display="block",G.textContent="".concat(c+1," of ").concat(a.length," • ").concat(A(S));var O=[];return null==a||a.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,f(n))}),(null==t||null===(s=t.podSlotImpressionBeacon)||void 0===s?void 0:s.length)>0&&O.push.apply(O,f(null==t?void 0:t.podSlotImpressionBeacon)),D(e,t,O,c,r),"break"}y.delete(i)},r=0;r<p.length;r++){if("break"===t())break}if(window.isAdPlaying=n,m&&!h.seeking()&&(e>=m.podStart&&e<=m.podEndTime&&(m.entered=!0),m.entered&&e>=m.podEndTime)){var i=m.position;m=null,setTimeout(function(){h.currentTime(i),j(i)},300)}n||(U.style.display="none",k.el().classList.remove("hide-progress-bar"),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),w&&(w.style.pointerEvents="auto",w.classList.remove("vjs-hidden")),Gn.enable())}},1e3),h.on("timeupdate",h._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",function(e){if(Gn.enabled&&"ArrowRight"==e.key){var n=h.currentTime();Ti(r,10),x(n,n+10),e.stopPropagation()}}),R=-1,k.el().addEventListener("pointerdown",function(e){0===e.button&&(R=h.currentTime(),document.addEventListener("pointermove",V),document.addEventListener("pointerup",M))}),null===(s=document)||void 0===s||null===(u=s.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach(function(e){return null==e?void 0:e.remove()}),(U=document.createElement("div")).className="ssai-ad-container",(B=document.createElement("div")).className="sponsored-adbox",(W=document.createElement("div")).className="sponsored-text",W.textContent="Sponsored Ad",B.append(W),(G=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",U.append(B),U.append(G),h.el().appendChild(U);case 47:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),O=new Map,P=-1;case 21:case"end":return e.stop()}},e)})),yt.apply(this,arguments)}function It(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 bt(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)?bt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function bt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Et(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Tt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var _t={},wt=(null===(ft=window)||void 0===ft||null===(pt=ft.location)||void 0===pt||null===(mt=pt.search)||void 0===mt?void 0:mt.includes("debug=true"))||!1,St=null;function kt(e){return At.apply(this,arguments)}function At(){return At=n(t.mark(function e(r){var i,o,l,s,u,d,c,v,p,m,h,g,y,I,b,E,T,_,w,S,k,A,O,P,L,D,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,i,o){var l,s,u=a.getPlayer(r);if(!u.seeking()){var d=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(l=n.ads)||void 0===l||null===(s=l[i])||void 0===s?void 0:s.adId)||d;Math.floor(u.currentTime());var v,f=It(t);try{for(f.s();!(v=f.n()).done;){var p,m,h,g=v.value,y=g.eventType,I=g.beaconUrls,b=g.startTimeInSeconds,E=g.startTime,T=g.durationInSeconds,_=(g.eventId,b||d),w=I,S=(null===(p=window)||void 0===p||null===(m=p.customData)||void 0===m||null===(h=m.ads)||void 0===h?void 0:h.adEventHandler)||null,k="".concat(c,"_").concat(y),A="pod-".concat(d);P.has(A)||P.set(A,new Set);var O=P.get(A);if(wt&&console.warn(e,_,"map:",y,"condition1:",e>=_,"map:",P),e>=_&&e<=_+L&&!O.has(k)){O.add(k);try{D(y,n,w,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof S)try{var C,N={eventType:y,startTimeInSeconds:b,startTime:E,durationInSeconds:T,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[i],adIndex:i};S({adsData:N}),Jn(r,N)}catch(e){console.error("Error when calling ads callback:",e)}var R=tt.get();if(R&&0!==Object.keys(R).length){var x=R.formulateComscoreAdPayload,j=R.startComscoreAdTracking,F=R.finishComscoreAdTracking,V=R.endComscoreAdTracking;if("impression"===y){var M,U=st.get();j(x(Tt(Tt({},null==n||null===(M=n.ads)||void 0===M?void 0:M[i]),{},{trackingUrl:U})))}else"complete"===y?F():"breakEnd"===y&&V()}}}}catch(e){f.e(e)}finally{f.f()}}},D=function(e,n,t,r){var i,o,a;"breakEnd"===e&&(null===(i=_t)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(o=_t)||void 0===o?void 0:o.totalAds)&&(null==n||null===(a=n.ads)||void 0===a?void 0:a.length)>0||(wt&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},h=function(){St&&clearInterval(St)},p=st.get(),(m=a.getPlayer(r)).one("loadeddata",function(){h(),St=setInterval(function(){p&&!m.paused()&&O(p)},2e3)}),m.on("dispose",function(){h()}),g=new Map,y=new Map,I=-1,b=null,E=(null===(i=document)||void 0===i||null===(o=i.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])||null,T=(null==m||null===(l=m.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,_=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,w=(null==m||null===(u=m.el())||void 0===u||null===(d=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===d?void 0:d[0])||null,S=(null==m||null===(c=m.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,k=!1,A=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return f(r);var i=[],o=null==r?void 0:r.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&a){var d=null==s?void 0:s.map(function(e){return Tt(Tt({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=d&&d[0]&&i.push(null==d?void 0:d[0])}return i},O=function(){var e=n(t.mark(function e(n){var i,o,l,s,u,d,c,v,p,m,h,O;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=new URL(n),b&&s.searchParams.append("nextToken",b),e.next=4,fetch(s.toString(),{method:"GET"});case 4:return u=e.sent,e.next=7,u.json();case 7:d=e.sent,c=d.avails,v=d.nextToken||null,b=v,p=[],m=a.getPlayer(r),h=null==m||null===(i=m.controlBar)||void 0===i?void 0:i.progressControl,O=null==h||null===(o=h.seekBar)||void 0===o?void 0:o.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),c.map(function(e,n){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:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),wt&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),null!=p&&p.length&&(window.adsQueueList=p),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,r=m.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(i,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(i,"%"),o.style.pointerEvents="none",O.appendChild(o)}}),m._timeUpdateHandler&&m.off("timeupdate",null==m?void 0:m._timeUpdateHandler),m._timeUpdateHandler=a.throttle(function(){if(wi(r)){var e=null==m?void 0:m.currentTime();if(e!==I){I=e;for(var n=function(){var n=p[t],r=n.startTimeInSeconds,i=n.durationInSeconds,o=n.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){var l;k=!!(e>=r&&e<=a&&Array.isArray(o)&&(null==o?void 0:o.length)>0),e>a&&g.set(r,!0),Gn.disable(),E&&E.classList.add("vjs-hidden"),w&&(w.style.pointerEvents="none",w.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),h.el().classList.add("hide-progress-bar");for(var s=e-r,u=0,d=0,c=0;c<o.length;c++){var v,m=null==o||null===(v=o[c])||void 0===v?void 0:v.durationInSeconds;if(s<u+m){d=c;break}u+=m}setTimeout(function(){_t.totalAds=null==o?void 0:o.length,_t.currentAdIndex=d},1e3);var I=[];return null==o||o.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});I.push.apply(I,f(n))}),(null==n||null===(l=n.podSlotImpressionBeacon)||void 0===l?void 0:l.length)>0&&I.push.apply(I,f(null==n?void 0:n.podSlotImpressionBeacon)),C(e,n,I,d),"break"}y.delete(r)},t=0;t<p.length;t++){if("break"===n())break}k||(_t={},h.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),E&&E.classList.remove("vjs-hidden"),w&&(w.style.pointerEvents="auto",w.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Gn.enable())}}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=new Map,L=2.5;case 22:case"end":return e.stop()}},e)})),At.apply(this,arguments)}var Ot=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function Pt(e){return JSON.stringify((e||[]).map(function(e){return{availId:e.availId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds,ads:(e.ads||[]).map(function(e){return{adId:e.adId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds}})}}))}var Lt=function(){function e(n,t,r,i){h(this,e),this.video_=i,this.ad_=n,this.skipOffset_=function(e){if(!e)return null;var n=new RegExp(Ot.source,"g");n.lastIndex=0;var t=n.exec(e);if(!t)return null;var r=Number(t[1])||0,i=Number(t[2]),o=Number(t[3]),a=Number(t[6])||0;return i>59||o>59?null:a/1e3+o+60*i+3600*r}(null==n?void 0:n.skipOffset),this.adPosition_=t,this.totalAds_=r,this.isSkipped_=!1}return g(e,[{key:"isClientRendering",value:function(){return!1}},{key:"getDuration",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.durationInSeconds)&&void 0!==e?e:0}},{key:"getRemainingTime",value:function(){var e,n,t,r,i,o;return(null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0)+(null!==(t=null===(r=this.ad_)||void 0===r?void 0:r.durationInSeconds)&&void 0!==t?t:0)-(null!==(i=null===(o=this.video_)||void 0===o?void 0:o.currentTime)&&void 0!==i?i:0)}},{key:"isSkippable",value:function(){return"number"==typeof this.skipOffset_}},{key:"getTimeUntilSkippable",value:function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var e=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(e,0)}},{key:"canSkipNow",value:function(){return 0===this.getTimeUntilSkippable()}},{key:"skip",value:function(){this.isSkipped_=!0,this.video_&&(this.video_.currentTime+=this.getRemainingTime())}},{key:"isLinear",value:function(){return!0}},{key:"getSequenceLength",value:function(){return this.totalAds_||1}},{key:"getPositionInSequence",value:function(){return this.adPosition_||1}},{key:"getTitle",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adTitle)||""}},{key:"getVastAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.vastAdId)||""}},{key:"getAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adId)||""}},{key:"getCreativeAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.creativeId)||""}},{key:"getTimeOffset",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0}},{key:"release",value:function(){this.ad_=null,this.adPosition_=null,this.totalAds_=null}},{key:"isSkipped",value:function(){return this.isSkipped_}}]),e}(),Dt="impression",Ct="start",Nt="mute",Rt="unmute",xt="resume",jt="pause",Ft="firstQuartile",Vt="midpoint",Mt="thirdQuartile",Ut="complete",Bt="skip",Wt="breakStart",Gt="breakEnd",Ht="skipStateChanged",qt="ad_impression",Yt="ad_started",zt="ad_muted",Kt="ad_volume_changed",Qt="ad_resumed",$t="ad_paused",Xt="ad_first_quartile",Jt="ad_midpoint",Zt="ad_third_quartile",er="ad_complete",nr="ad_stopped",tr="ad_skipped",rr="ad_skip_state_changed",ir="ad_break_started",or="ad_break_ended",ar="ads_loaded",lr="ad_cuepoints_changed";function sr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ur(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sr(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):sr(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}function dr(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 cr(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)?cr(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function cr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var vr="[Transmit]";function fr(e){var n,t,r;if(null==e)return{avails:[],nextToken:null,dashAvailabilityStartTime:null};var i=null!==(n=e.dashAvailabilityStartTime)&&void 0!==n?n:null,o=null!==(t=e.nextToken)&&void 0!==t?t:null,a=[];if(Array.isArray(e.avails))a=e.avails;else if(Array.isArray(e)){var l,s,u,d,c=e[0];if(c&&Array.isArray(c.avails))a=c.avails,i=null!==(l=null!==(s=i)&&void 0!==s?s:c.dashAvailabilityStartTime)&&void 0!==l?l:null,o=null!==(u=null!==(d=o)&&void 0!==d?d:c.nextToken)&&void 0!==u?u:null;else a=e}else if(Array.isArray(null==e||null===(r=e.data)||void 0===r?void 0:r.avails)){var v,f,p,m;a=e.data.avails,o=null!==(v=null!==(f=o)&&void 0!==f?f:e.data.nextToken)&&void 0!==v?v:null,i=null!==(p=null!==(m=i)&&void 0!==m?m:e.data.dashAvailabilityStartTime)&&void 0!==p?p:null}else Array.isArray(null==e?void 0:e.data)&&(a=e.data);return{avails:a,nextToken:o,dashAvailabilityStartTime:i}}var pr=function(){function e(n,t,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};h(this,e),this.video_=n,this.player_=t,this.onEvent_="function"==typeof r?r:function(){},this.dashManifestUrl_=o.dashManifestUrl||null,this.config_=null,this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.pollIntervalMs_=2e3,this.pollId_=null,this.adBreaks_=[],this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null,this.eventsSent_=new Set,this.firedBeacons_=new Set,this.adBreakListenersAttached_=!1,this.globalListeners_=[],this.adListeners_=[],this.videoTimeupdate_=null,this.lastMutedForAd_=null,this.onDispose_=function(){return i.release()},this.apiTimelineAbsolute_=!1}var r,i,o;return g(e,[{key:"configure",value:function(e){this.config_=e}},{key:"addTrackingUrl",value:function(e){this.trackingUrl_=e||"",this.onEvent_({type:ar,loadTime:0})}},{key:"getCuePoints",value:function(){var e,n=new Map,t=dr(this.adBreaks_);try{for(t.s();!(e=t.n()).done;){var r,i=dr(e.value.ads||[]);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.startTimeInSeconds,l=a+o.durationInSeconds;if(isFinite(a)&&isFinite(l)&&!(l<=a)){var s="".concat(a.toFixed(1),"|").concat(l.toFixed(1));n.has(s)||n.set(s,{start:a,end:l})}}}catch(e){i.e(e)}finally{i.f()}}}catch(e){t.e(e)}finally{t.f()}return Array.from(n.values()).sort(function(e,n){return e.start-n.start})}},{key:"onManifestUpdated",value:function(){this.trackingUrl_&&(this.requestTrackingInfo_(this.firstTrackingRequest_),this.firstTrackingRequest_=!1,this.ensurePolling_())}},{key:"stop",value:function(){this.onEnded_(),this.detachAllListeners_(),this.eventsSent_.clear(),this.firedBeacons_.clear(),this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.apiTimelineAbsolute_=!1,this.adBreaks_=[],this.adBreakListenersAttached_=!1,this.pollId_&&(clearInterval(this.pollId_),this.pollId_=null)}},{key:"release",value:function(){this.stop()}},{key:"ensurePolling_",value:function(){var e=this;this.pollId_||(this.pollId_=setInterval(function(){var n,t;e.trackingUrl_&&(null!==(n=e.player_)&&void 0!==n&&null!==(t=n.paused)&&void 0!==t&&t.call(n)||e.requestTrackingInfo_(!1))},this.pollIntervalMs_))}},{key:"requestTrackingInfo_",value:(o=n(t.mark(function e(n){var r,i,o,a,l,s,u,d,c,v,f,p,m,h,g,y,I;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,i=new Map,o=0,a=null;case 4:if(!(o<10)){e.next=25;break}return l=new URL(this.trackingUrl_),this.nextToken_&&l.searchParams.set("nextToken",this.nextToken_),e.next=9,fetch(l.toString(),{method:"GET"});case 9:return s=e.sent,e.next=12,s.json();case 12:u=e.sent,o++,(d=fr(u)).dashAvailabilityStartTime&&!a&&(a=d.dashAvailabilityStartTime),c=dr(d.avails);try{for(c.s();!(v=c.n()).done;)f=v.value,p=(null==f?void 0:f.availId)||"".concat(null==f?void 0:f.startTimeInSeconds),i.set(p,f)}catch(e){c.e(e)}finally{c.f()}if((m=d.nextToken||null)&&m!==this.nextToken_){e.next=22;break}return this.nextToken_=m,e.abrupt("break",25);case 22:this.nextToken_=m,e.next=4;break;case 25:if(h=Array.from(i.values()),this.updateApiTimelineAbsoluteFlag_(h),g=(null==h||null===(r=h[0])||void 0===r?void 0:r.startTimeInSeconds)||0,this.apiTimelineAbsolute_){e.next=33;break}return e.next=31,this.resolveDashAvailabilityStartTime_(a,g);case 31:e.next=35;break;case 33:this.dashAvailabilityStartTimeResolved_=!0,this.dashAvailabilityStartTime_=0;case 35:h.length?(y=this.normalizeAvails_(h),Pt(this.adBreaks_)!==Pt(y)&&(this.adBreaks_=y,I=this.getCuePoints(),this.onEvent_({type:lr,cuepoints:I}))):this.adBreaks_.length&&(this.onEvent_({type:lr,cuepoints:[]}),this.onEnded_(),this.adBreaks_=[]),n&&this.setupAdBreakListeners_(),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(0),console.warn(vr,"tracking info fetch failed",e.t0);case 42:case"end":return e.stop()}},e,this,[[0,39]])})),function(e){return o.apply(this,arguments)})},{key:"updateApiTimelineAbsoluteFlag_",value:function(e){this.apiTimelineAbsolute_=!1;var n,t=1e6,r=dr(e||[]);try{for(r.s();!(n=r.n()).done;){var i,o=n.value;if((null!==(i=null==o?void 0:o.startTimeInSeconds)&&void 0!==i?i:0)>t)return void(this.apiTimelineAbsolute_=!0);var a,l=dr((null==o?void 0:o.ads)||[]);try{for(l.s();!(a=l.n()).done;){var s,u=a.value;if((null!==(s=null==u?void 0:u.startTimeInSeconds)&&void 0!==s?s:0)>t)return void(this.apiTimelineAbsolute_=!0)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){r.e(e)}finally{r.f()}}},{key:"normalizeAvails_",value:function(e){var n=this,t=this.apiTimelineAbsolute_?0:this.dashAvailabilityStartTime_||0;return e.map(function(e){var r=n.resolveAbsoluteStart_(e,t,null);return ur(ur({},e),{},{startTimeInSeconds:r,ads:(e.ads||[]).map(function(i){return ur(ur({},i),{},{startTimeInSeconds:n.resolveAbsoluteStart_(i,t,e,r)})})})})}},{key:"resolveAbsoluteStart_",value:function(e,n,t,r){var i=null==e?void 0:e.adProgramDateTime;if(i){var o=new Date(i).getTime()/1e3;if(isFinite(o)&&o>0)return o}return null!=t&&t.adProgramDateTime&&"number"==typeof r?r+((e.startTimeInSeconds||0)-(t.startTimeInSeconds||0)):(e.startTimeInSeconds||0)+n}},{key:"resolveDashAvailabilityStartTime_",value:(i=n(t.mark(function e(n,r){var i,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.dashAvailabilityStartTimeResolved_){e.next=2;break}return e.abrupt("return");case 2:if(!n){e.next=8;break}if(i=new Date(n).getTime()/1e3,!(isFinite(i)&&i>0)){e.next=8;break}return this.dashAvailabilityStartTime_=i,this.dashAvailabilityStartTimeResolved_=!0,e.abrupt("return");case 8:if(!(r>0)){e.next=13;break}return e.next=11,this.fetchDashAvailabilityStartTimeFromMpd_();case 11:(o=e.sent)>0&&(this.dashAvailabilityStartTime_=o,this.dashAvailabilityStartTimeResolved_=!0);case 13:case"end":return e.stop()}},e,this)})),function(e,n){return i.apply(this,arguments)})},{key:"fetchDashAvailabilityStartTimeFromMpd_",value:(r=n(t.mark(function e(){var n,r,i,o,a,l;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(r=this.dashManifestUrl_||this.getCurrentSourceUrl_())&&r.includes(".mpd")){e.next=4;break}return e.abrupt("return",0);case 4:return e.next=6,fetch(r);case 6:return i=e.sent,e.next=9,i.text();case 9:return o=e.sent,a=(new DOMParser).parseFromString(o,"application/xml"),l=null===(n=a.querySelector("MPD"))||void 0===n?void 0:n.getAttribute("availabilityStartTime"),e.abrupt("return",l?new Date(l).getTime()/1e3:0);case 15:return e.prev=15,e.t0=e.catch(0),console.warn(vr,"MPD availabilityStartTime parse failed",e.t0),e.abrupt("return",0);case 19:case"end":return e.stop()}},e,this,[[0,15]])})),function(){return r.apply(this,arguments)})},{key:"getCurrentSourceUrl_",value:function(){try{var e,n,t,r,i=(null===(e=this.player_)||void 0===e||null===(n=e.currentSrc)||void 0===n?void 0:n.call(e))||(null===(t=this.player_)||void 0===t||null===(r=t.src)||void 0===r?void 0:r.call(t));return"string"==typeof i?i:(null==i?void 0:i.src)||""}catch(e){return""}}},{key:"setupAdBreakListeners_",value:function(){var e=this;if(!this.adBreakListenersAttached_){this.adBreakListenersAttached_=!0,this.onTimeupdate_();this.attachGlobalListener_("timeupdate",function(){return e.onTimeupdate_()}),this.attachGlobalListener_("dispose",this.onDispose_),this.video_&&(this.videoTimeupdate_=function(){return e.onTimeupdate_()},this.video_.addEventListener("timeupdate",this.videoTimeupdate_))}}},{key:"isHlsSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase(),r=((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase();return t.includes(".m3u8")||"application/x-mpegurl"===r||"application/vnd.apple.mpegurl"===r}},{key:"isDashSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase();return"application/dash+xml"===((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase()||t.includes(".mpd")}},{key:"getDashMediaPlayerTimelineSeconds_",value:function(){try{var e,n,t=null===(e=this.player_)||void 0===e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer;if(!t||"function"!=typeof t.time)return null;var r=t.time();return"number"==typeof r&&isFinite(r)&&r>1e6?r:null}catch(e){return null}}},{key:"getCurrentTime_",value:function(){var e,n,t,r=null!==(e=null===(n=this.video_)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:0,i=l.detectBrowser();if(this.isHlsSource_()){var o,a,s=r,u=null===(o=this.player_)||void 0===o||null===(a=o.seekable)||void 0===a?void 0:a.call(o);return u&&u.length>0&&(s=u.end(u.length-1)),Date.now()/1e3-(s-r)}if(this.isDashSource_()){var d,c,v,f=this.getDashMediaPlayerTimelineSeconds_();if(null!=f)return f;var p=null===(d=this.player_)||void 0===d||null===(c=d.seekable)||void 0===c?void 0:c.call(d),m="function"==typeof(null===(v=this.player_)||void 0===v?void 0:v.currentTime)?this.player_.currentTime():r;if(p&&p.length>0){var h=p.start(0);if(h>1e6&&h+m>1e6)return h+m}if(this.apiTimelineAbsolute_&&(this.dashAvailabilityStartTime_||0)>1e9)return(this.dashAvailabilityStartTime_||0)+m}return"Safari"===i?r:"function"==typeof(null===(t=this.player_)||void 0===t?void 0:t.currentTime)?this.player_.currentTime():r}},{key:"onTimeupdate_",value:function(){if(this.ad_||this.adBreaks_.length){var e=this.getCurrentTime_();if(this.ad_){var n,t;this.sendInProgressEvents_(e,this.transmitAd_);var r=this.ad_.getDuration(),i=(null!==(n=null===(t=this.transmitAd_)||void 0===t?void 0:t.startTimeInSeconds)&&void 0!==n?n:0)+r,o=i-e;this.ad_.canSkipNow()&&o>0&&r>0&&this.sendTrackingEvent_(Ht),r>0&&e>=i&&this.onEnded_()}this.ad_||this.checkLinearAds_(e)}}},{key:"sendInProgressEvents_",value:function(e,n){if(n){var t=n.startTimeInSeconds+.25*n.durationInSeconds,r=n.startTimeInSeconds+.5*n.durationInSeconds,i=n.startTimeInSeconds+.75*n.durationInSeconds;e>=t&&!this.eventsSent_.has(Ft)&&(this.eventsSent_.add(Ft),this.sendTrackingEvent_(Ft)),e>=r&&!this.eventsSent_.has(Vt)&&(this.eventsSent_.add(Vt),this.sendTrackingEvent_(Vt)),e>=i&&!this.eventsSent_.has(Mt)&&(this.eventsSent_.add(Mt),this.sendTrackingEvent_(Mt))}}},{key:"flushPendingQuartiles_",value:function(){for(var e=0,n=[Ft,Vt,Mt];e<n.length;e++){var t=n[e];this.eventsSent_.has(t)||(this.eventsSent_.add(t),this.sendTrackingEvent_(t))}}},{key:"checkLinearAds_",value:function(e){var n,t=dr(this.adBreaks_);try{for(t.s();!(n=t.n()).done;){var r=n.value;if(this.ad_)break;for(var i=r.ads||[],o=0;o<i.length;o++){var a=i[o],l=a.startTimeInSeconds,s=l+a.durationInSeconds;if(l<=e&&s>e){this.onEnded_(),this.transmitAdBreak_=r,this.transmitAd_=a,this.ad_=new Lt(a,o+1,i.length,this.video_),0===o&&this.sendTrackingEvent_(Wt),this.setupCurrentAdListeners_();break}}}}catch(e){t.e(e)}finally{t.f()}}},{key:"onEnded_",value:function(){this.ad_&&this.transmitAd_&&(this.ad_.isSkipped()||this.flushPendingQuartiles_(),this.removeCurrentAdListeners_(this.ad_.isSkipped()),this.ad_.getPositionInSequence()===this.ad_.getSequenceLength()&&this.sendTrackingEvent_(Gt),this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null)}},{key:"setupCurrentAdListeners_",value:function(){var e,n,t,r,i,o=this,a=!1;null!==(e=this.player_)&&void 0!==e&&null!==(n=e.paused)&&void 0!==n&&n.call(e)?a=!0:(this.sendTrackingEvent_(Dt),this.sendTrackingEvent_(Ct)),this.lastMutedForAd_=null!==(t=null===(r=this.player_)||void 0===r||null===(i=r.muted)||void 0===i?void 0:i.call(r))&&void 0!==t&&t,this.attachAdListener_("volumechange",function(){var e,n,t,r=null!==(e=null===(n=o.player_)||void 0===n||null===(t=n.muted)||void 0===t?void 0:t.call(n))&&void 0!==e&&e;r!==o.lastMutedForAd_&&(o.lastMutedForAd_=r,r?o.sendTrackingEvent_(Nt):o.sendTrackingEvent_(Rt))}),this.attachAdListener_("play",function(){a?(o.sendTrackingEvent_(Dt),o.sendTrackingEvent_(Ct),a=!1):o.sendTrackingEvent_(xt)}),this.attachAdListener_("pause",function(){o.sendTrackingEvent_(jt)})}},{key:"removeCurrentAdListeners_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.sendTrackingEvent_(e?Bt:Ut),this.detachAdListeners_(),this.eventsSent_.clear()}},{key:"attachGlobalListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.globalListeners_.push({event:e,handler:n}))}},{key:"attachAdListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.adListeners_.push({event:e,handler:n}))}},{key:"detachAdListeners_",value:function(){var e,n=dr(this.adListeners_);try{for(n.s();!(e=n.n()).done;){var t,r,i=e.value,o=i.event,a=i.handler;null===(t=this.player_)||void 0===t||null===(r=t.off)||void 0===r||r.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.adListeners_=[]}},{key:"detachAllListeners_",value:function(){this.detachAdListeners_();var e,n=dr(this.globalListeners_);try{for(n.s();!(e=n.n()).done;){var t,r,i=e.value,o=i.event,a=i.handler;null===(t=this.player_)||void 0===t||null===(r=t.off)||void 0===r||r.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.globalListeners_=[],this.video_&&this.videoTimeupdate_&&(this.video_.removeEventListener("timeupdate",this.videoTimeupdate_),this.videoTimeupdate_=null)}},{key:"startComscoreForCurrentAd_",value:function(){try{var e=tt.get();if(!e||0===Object.keys(e).length)return;var n=e.formulateComscoreAdPayload,t=e.startComscoreAdTracking,r=st.get();t(n(ur(ur({},this.transmitAd_),{},{trackingUrl:r})))}catch(e){console.warn(vr,"comscore start failed",e)}}},{key:"sendTrackingEvent_",value:function(e){var n,t=this;if(this.transmitAd_&&this.transmitAdBreak_){var r=(this.transmitAd_.trackingEvents||[]).find(function(n){return n.eventType===e});if(r||(r=(this.transmitAdBreak_.adBreakTrackingEvents||[]).find(function(n){return n.eventType===e})),r&&(null===(n=this.config_)||void 0===n||!n.disableTrackingEvents)){var i,o,a,l=(null===(i=this.transmitAd_)||void 0===i?void 0:i.adId)||(null===(o=this.transmitAdBreak_)||void 0===o?void 0:o.availId)||"unknown",s=dr(r.beaconUrls||[]);try{var u=function(){var n=a.value;if(!n)return"continue";var r="".concat(l,"|").concat(e,"|").concat(n);if(t.firedBeacons_.has(r))return"continue";t.firedBeacons_.add(r),fetch(n,{mode:"no-cors"}).catch(function(e){console.warn(vr,"beacon failed",n,e)})};for(s.s();!(a=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}var d=tt.get(),c=d&&Object.keys(d).length?d:null;switch(e){case Dt:this.onEvent_({type:qt}),this.startComscoreForCurrentAd_();break;case Ct:this.onEvent_({type:Yt,ad:this.ad_});break;case Nt:this.onEvent_({type:zt});break;case Rt:this.onEvent_({type:Kt});break;case xt:this.onEvent_({type:Qt});break;case jt:this.onEvent_({type:$t});break;case Ft:this.onEvent_({type:Xt});break;case Vt:this.onEvent_({type:Jt});break;case Mt:this.onEvent_({type:Zt});break;case Ut:this.onEvent_({type:er}),this.onEvent_({type:nr}),null!=c&&c.finishComscoreAdTracking&&c.finishComscoreAdTracking();break;case Bt:this.onEvent_({type:tr}),this.onEvent_({type:nr});break;case Wt:this.onEvent_({type:ir});break;case Gt:this.onEvent_({type:or}),null!=c&&c.endComscoreAdTracking&&c.endComscoreAdTracking();break;case Ht:this.onEvent_({type:rr})}}else console.warn(vr,"sendTrackingEvent_ skipped — no active ad",{eventType:e})}}]),e}();function mr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function hr(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mr(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var gr={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function yr(e){if(null==e||!e.src)return null;var n=(e.type||"").toLowerCase(),t=String(e.src).toLowerCase();return"application/dash+xml"===n||t.includes(".mpd")?"dash":"application/x-mpegurl"===n||"application/vnd.apple.mpegurl"===n||t.includes(".m3u8")?"hls":null}function Ir(e,n,t){return br.apply(this,arguments)}function br(){return(br=n(t.mark(function e(n,r,i){var o,a,l,s,u,d,c,v,f,p,m;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=yr(n)){e.next=3;break}return e.abrupt("return",n);case 3:return a=ke(n.src,i,r),l=a.replace(o,gr[o]),console.log("[Transmit] session init →",l),e.prev=6,e.next=9,fetch(l,{method:"GET",redirect:"follow"});case 9:return s=e.sent,e.next=12,s.json();case 12:if(u=e.sent,console.log("[Transmit] session response",u),d="dash"===o?null==u?void 0:u.dashUrl:null==u?void 0:u.hlsUrl,c=null==u?void 0:u.trackingUrl,d&&c){e.next=18;break}return e.abrupt("return",n);case 18:return v=new URL(l),f=v.hostname,p="https://".concat(f).concat(d),m="https://".concat(f).concat(c),st.set(m),console.log("[Transmit] session ready",{manifestUrl:p,trackingUrl:m}),e.abrupt("return",hr(hr({},n),{},{src:p}));case 26:return e.prev=26,e.t0=e.catch(6),console.warn("[Transmit] session init failed",e.t0),e.abrupt("return",n);case 30:case"end":return e.stop()}},e,null,[[6,26]])}))).apply(this,arguments)}var Er,Tr=null;function _r(e,n){var t;if(Tr)return console.log("[Transmit] initializeTransmit skipped — manager already initialised"),Tr;var r=st.get();if(!r)return console.warn("[Transmit] initializeTransmit skipped — no tracking URL"),null;var i=a.getPlayer(e);if(!i)return console.warn("[Transmit] initializeTransmit skipped — no player"),null;var o=(null===(t=i.el())||void 0===t?void 0:t.querySelector("video"))||null,l=function(e){try{var n="function"==typeof(null==e?void 0:e.currentSrc)&&e.currentSrc()||"function"==typeof(null==e?void 0:e.src)&&e.src()||"";if("application/dash+xml"===("function"==typeof(null==e?void 0:e.currentType)&&e.currentType()||"")||String(n).includes(".mpd"))return n}catch(e){}return null}(i);return(Tr=new pr(o,i,function(e){var t,r;console.log("[Transmit] ad event",e);var i=null==n||null===(t=n.customData)||void 0===t||null===(r=t.ads)||void 0===r?void 0:r.adEventHandler;if("function"==typeof i)try{i(e)}catch(e){console.warn("[Transmit] adEventHandler threw",e)}},{dashManifestUrl:l})).configure({disableTrackingEvents:!1}),Tr.addTrackingUrl(r),Tr.onManifestUpdated(),Tr}function wr(){Tr&&(Tr.release(),Tr=null)}function Sr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function kr(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sr(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var Ar=[],Or=0,Pr=null;function Lr(){Er=null,Ar=[],Or=0,Pr=null}function Dr(n,t,r){var i,o,a,l,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===(o=t.watchHistory)||void 0===o?void 0:o.profileId,c=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(a=t.watchHistory)||void 0===a||a.xapiKey;var f=(null==t||null===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,p=(null==t||null===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(n.currentTime()),h=u?100:Math.floor(c/v*100),g={};p?function(n,t,r){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(r),o=Cr(i),a=(new Date).getTime(),l=ve(),s=(null==l?void 0:l.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(n,t){return kr(kr({},n),{},e({},t,s[t]))},{}),d=o.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Er});d<0?o.push(kr(kr({content:u},n),{},{addedDate:a,updateDate:a})):o[d]=kr(kr(kr({},o[d]),n),{},{updateDate:a});localStorage.setItem("".concat(i),JSON.stringify(o))}(g={completed:u,watchedTime:m,watchedPercentage:h},d,t.siteOwner):(g=kr(kr({videoId:Er,watchedTime:m,watchedPercentage:h,doneWatching:u,profileId:d},Pr&&{seriesId:Pr}),f&&{originalObjectId:f}),ae(g).then(function(e){}).catch(function(e){})),Or=c+r}function Cr(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Nr(e,n){Bn(e.id(),ze.RESUME_PLAYBACK),setTimeout(function(){e.currentTime(n)},0),e.one("playing",function(){e.currentTime()<n-1&&e.currentTime(n)})}function Rr(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 xr(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)?xr(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function xr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var jr=function(e){var n=Date.parse(null==e?void 0:e.eventStartUtc),t=Number.isFinite(n)?n/1e3:0;return{start:t+(Number(null==e?void 0:e.startTime)||0),end:t+(Number(null==e?void 0:e.endTime)||0)}},Fr=function(e){var n;try{var t,r,i=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(i))return i}catch(e){}var o=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return o&&o.length?o.end(o.length-1):NaN};function Vr(e){var n=null,t=null,r="none",i=null,o=null,l=function(e){var n=e&&e.data||[],t=n.find(function(e){return e&&"encoder"===e.type})||n[0];t&&Number.isFinite(t.ntpTimestamp)&&Number.isFinite(t.mediaTime)&&(o=t)},s=function(r){var i=a.getPlayer(e);if(!i)return null;if(null!=n&&null!=t)return t+(r-n);var o=Fr(i);return Number.isFinite(o)?o-(Date.now()/1e3-r):null},u=function(r){var i=a.getPlayer(e);if(!i)return null;if(null!=n&&null!=t)return n+(r-t);var o=Fr(i);return Number.isFinite(o)?Date.now()/1e3-(o-r):null},d=function(){var n=a.getPlayer(e),t=n&&n.seekable();return t&&t.length?{start:t.start(0),end:t.end(t.length-1)}:{start:0,end:0}},c=function(){var n=a.getPlayer(e),t=n&&n.liveTracker;try{if(t&&"function"==typeof t.isLive&&t.isLive()){var r=t.seekableStart(),i=t.liveWindow();if(Number.isFinite(r)&&Number.isFinite(i)&&i>0)return{start:r,end:r+i}}}catch(e){}return d()};return{refreshAnchor:function(){var s=a.getPlayer(e);if(s){var u=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,i=r&&"function"==typeof r.media&&r.media();return i&&i.segments||null}catch(e){return null}}(s),d=s.currentTime()||0;if(u&&u.length){var c,v=null,f=1/0,p=Rr(u);try{for(p.s();!(c=p.n()).done;){var m=c.value;if(m&&"number"==typeof m.programDateTime&&"number"==typeof m.start&&Number.isFinite(m.start)){var h=Math.abs(m.start-d);h<f&&(f=h,v=m)}}}catch(e){p.e(e)}finally{p.f()}if(v)return n=v.programDateTime/1e3,t=v.start,void(r="pdt")}var g=function(e){var n=e&&e.dash&&e.dash.mediaPlayer;if(!n||"function"!=typeof n.on)return null;if(n!==i){try{i&&"function"==typeof i.off&&i.off("inbandPrft",l);var t="function"==typeof n.getSettings?n.getSettings():null;t&&t.streaming&&t.streaming.parseInbandPrft||n.updateSettings({streaming:{parseInbandPrft:!0}}),n.on("inbandPrft",l)}catch(e){}i=n,o=null}return o}(s);if(g&&function(e,n){var t=e.seekable();return!(!t||!t.length)&&n>=t.start(0)-60&&n<=t.end(t.length-1)+60}(s,g.mediaTime))return n=g.ntpTimestamp/1e3,t=g.mediaTime,void(r="prft");var y=s.dash?null:function(e){try{var n=e.tech(!0),t=n&&"function"==typeof n.el?n.el():null,r=t&&"function"==typeof t.getStartDate?t.getStartDate():null,i=r?r.getTime():NaN;return Number.isFinite(i)?i/1e3:null}catch(e){return null}}(s);if(null!=y)return n=y,t=0,void(r="startDate");n=null,t=null,r="now"}},anchorInfo:function(){return{anchorPdtSec:n,anchorPlayerT:t,source:r}},playerTimeToUtc:u,utcToPlayerTime:s,chapterToPlayerTime:function(e){return s(jr(e).start)},chapterStartPercent:function(e){return function(e){var n=c(),t=n.start,r=n.end;if(!(r>t))return null;var i=s(e);return null==i||i<t||i>r?null:(i-t)/(r-t)*100}(jr(e).start)},playerTimeToChapterIndex:function(e,n){var t=u(e);if(null==t)return-1;for(var r=-1,i=0;i<n.length;i++){var o=jr(n[i]),a=o.start,l=o.end,s=Math.max(l,a+.001);t>=a&&t<s&&(r=i)}return r},windowBounds:d,displayBounds:c}}function Mr(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?Vr(e):function(e){var n=function(e){return Number(null==e?void 0:e.startTime)||0},t=function(e){var t=Number(null==e?void 0:e.endTime);return Number.isFinite(t)?t:n(e)};return{chapterToPlayerTime:function(e){return n(e)},chapterStartPercent:function(t){var r=a.getPlayer(e),i=r&&r.duration();if(!Number.isFinite(i)||i<=0)return null;var o,l=n(t);return l<0||l>i?null:100*((o=l/i)<0?0:o>1?1:o)},playerTimeToChapterIndex:function(e,r){for(var i=-1,o=0;o<r.length;o++){var a=n(r[o]),l=Math.max(t(r[o]),a+.001);e>=a&&e<l&&(i=o)}return i},windowBounds:function(){var n=a.getPlayer(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}},playerTimeToUtc:function(){return null}}}(e)}var Ur=Object.freeze({PENDING_SELECTION:"PENDING_SELECTION",PENDING_RESUME:"PENDING_RESUME",PLAYING_LIVE:"PLAYING_LIVE",PLAYING_DVR:"PLAYING_DVR"}),Br=Object.freeze({LIVE:"live",BEGINNING:"beginning",RESUME:"resume"}),Wr=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/,Gr=/^\d+(\.\d+)?$/,Hr=function(e){if(null==e||""===e)return null;if(e instanceof Date){var n=e.getTime();return Number.isFinite(n)?n/1e3:null}var t=String(e).trim();if("number"==typeof e||Gr.test(t)){var r=Number(e);return!Number.isFinite(r)||r<=0?null:r>1e12?r/1e3:r}var i=Date.parse(Wr.test(t)?"".concat(t.replace(" ","T"),"Z"):t);return Number.isFinite(i)?i/1e3:null},qr=function(e){return(null==e?void 0:e.contentType)||"video"},Yr=function(e){return"linearchannel"===qr(e)},zr=function(){for(var e,n,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.config,a=i.content,l=0,s=[null==o||null===(e=o.dvrStartOverConfig)||void 0===e?void 0:e.startOverTime,Yr(a)?null==o||null===(n=o.epg)||void 0===n?void 0:n.programStartTime:null,null==a||null===(t=a[qr(a)])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.scheduleStartDate];l<s.length;l++){var u=Hr(s[l]);if(null!=u)return u}return null},Kr=function(e,n){var t,r,i=Yr(e)?null==e?void 0:e.channelId:null==e||null===(t=e[qr(e)])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.id;return"vl_dvr_resume_utc_".concat(i||n)},Qr=function(e){var n,t,r=Number(null==e||null===(n=e[qr(e)])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.startOverTime);return r>0?r:21600},$r=function(e,n){return e===Br.LIVE?Ur.PLAYING_LIVE:e===Br.BEGINNING?Ur.PLAYING_DVR:e===Br.RESUME?n?Ur.PLAYING_DVR:Ur.PENDING_SELECTION:n?Ur.PENDING_RESUME:Ur.PENDING_SELECTION},Xr=function(e){return e===Ur.PENDING_SELECTION||e===Ur.PENDING_RESUME},Jr=function(e){var n=e.start,t=e.end;return Number.isFinite(n)&&Number.isFinite(t)&&t-n>=30},Zr=function(e,n){var t=e.start,r=e.end;if(!(Number.isFinite(t)&&Number.isFinite(r)&&r>t))return null;var i=Math.min(t+5,r);return Number.isFinite(n)?Math.min(Math.max(n,i),r):i},ei=["config"];function ni(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ti(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ni(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):ni(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var ri=["loadedmetadata","durationchange","canplay","progress"],ii=["timeupdate","seeked","pause","playing"],oi=["chromecastConnected","chromecastDisconnected"],ai="vl-dvr-hidden",li='<svg width="16" height="15" viewBox="0 0 10 12" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true"><path d="M0.5 10.2539C0.5 11.0268 1.33937 11.5076 2.00601 11.1165L9.06227 6.9768C9.71345 6.59477 9.72265 5.65656 9.07908 5.26184L2.02283 0.934003C1.35652 0.525331 0.5 1.00479 0.5 1.78644V10.2539Z"></path></svg>',si='<svg width="16" height="14" viewBox="0 0 16 14" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true"><path d="M1.22392e-06 0.109374L4 0.109374L4 14.1094L0 14.1094L1.22392e-06 0.109374ZM16 13.7549C16 13.904 15.8322 13.9917 15.71 13.9062L6.21582 7.26074C6.11093 7.18732 6.11093 7.03143 6.21582 6.95801L15.71 0.3125C15.8322 0.227075 16 0.314702 16 0.463867L16 13.7549Z"></path></svg>',ui=new Map,di=function(e){try{return window.localStorage.getItem(e)}catch(e){return null}},ci=function(e,n){try{window.localStorage.setItem(e,n)}catch(e){}},vi=function(e){try{window.localStorage.removeItem(e)}catch(e){}},fi=function(e,n){var t,r,i,o=Number(di(e));return t=o,r=Date.now()/1e3,i=n,Number.isFinite(t)&&t<=r&&r-t<=i?o:(vi(e),null)},pi=function(e,n,t){var i=r.dom.createEl("button",{className:"vl-dvr-btn ".concat(e),type:"button"});return i.appendChild(r.dom.createEl("span",{className:"vl-dvr-icon",innerHTML:n})),i.appendChild(r.dom.createEl("span",{className:"vl-dvr-label"})),mi(i,t),i},mi=function(e,n){var t=e.querySelector(".vl-dvr-label");t.textContent!==n&&(t.textContent=n,e.setAttribute("aria-label",n))},hi=function(e){e&&"function"==typeof e.catch&&e.catch(function(){})};function gi(e,n,t){var i,o=t.config,a=t.content,l=(null==o?void 0:o.dvrStartOverConfig)||{},s=function(){var e,n,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{watchLive:(null==i||null===(e=i.watchLive)||void 0===e?void 0:e.text)||"Watch Live",startFromBeginning:(null==i||null===(n=i.startFromBeginning)||void 0===n?void 0:n.text)||(null==i||null===(t=i.startFromBegining)||void 0===t?void 0:t.text)||"Watch from Beginning",resume:(null==i||null===(r=i.resume)||void 0===r?void 0:r.text)||"Resume"}}(l.localisation),u=Mr(e,{timeMode:"livedvr"}),d=zr({config:o,content:a}),c=null==a?void 0:a.channelId,f=Kr(a,e),p=fi(f,Qr(a)),m=$r(l.dvrPlayFrom,null!=p),h=!1,g=function(e,n){return e===Ur.PLAYING_LIVE?Br.LIVE:e===Ur.PLAYING_DVR?n===Br.RESUME?Br.RESUME:Br.BEGINNING:null}(m,l.dvrPlayFrom),y=null,I=new Set,b=[],E=n.autoplay();Xr(m)&&n.autoplay(!1);var T=function(){try{var e=n.seekable();if(e&&e.length)return{start:e.start(0),end:e.end(e.length-1)}}catch(e){}return{start:NaN,end:NaN}},_=function(e){return null==e?null:(u.refreshAnchor(),u.utcToPlayerTime(e))},w=function(){return h&&"Chromecast"!==n.techName_&&Jr(T())},S=function(e){var t,r,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).starting,a=void 0!==o&&o;if(e===Br.LIVE)a||function(){var e=n.liveTracker;if(e&&e.isTracking())e.seekToLiveEdge();else{var t=T().end;Number.isFinite(t)&&n.currentTime(t)}}();else{var l=e===Br.RESUME&&null!=p?p:d;t=_(l),null!=(r=Zr(T(),t))&&n.currentTime(r),a&&(i=l)}e!==Br.RESUME&&vi(f),p=null},k=function(){var e=T(),t=e.start,r=e.end;if(null!=g&&n.hasStarted()&&r>t){var i=g;g=null,S(i,{starting:!0})}},A=function(){if(h)if(m!==Ur.PLAYING_LIVE){if(m===Ur.PLAYING_DVR){u.refreshAnchor();var e=u.playerTimeToUtc(n.currentTime());Number.isFinite(e)&&ci(f,String(Math.floor(e)))}}else vi(f)},O=function(){y||(y=setInterval(A,5e3))},P=function(e){if(e!==m){var n=m;m=e,U(),I.forEach(function(t){try{t(e,n)}catch(e){console.error("[DVR START OVER]",e)}})}},L=function(){h&&!Xr(m)&&P(function(){var e=n.liveTracker;if(e&&e.isTracking())return e.atLiveEdge();var t=T().end;return!(n.paused()||t-n.currentTime()>15)}()?Ur.PLAYING_LIVE:Ur.PLAYING_DVR)},D=function(t){return!(!Object.values(Br).includes(t)||!function(e){return e===Br.LIVE||!h||w()}(t))&&(function(t,r){t===Br.BEGINNING?(v.triggerPlayerAction(n,v.PLAYER_ACTIONS.START_FROM_BEGINNING),Bn(e,ze.START_FROM_BEGINNING)):t===Br.RESUME?Bn(e,ze.RESUME_PLAYBACK):r?Bn(e,ze.WATCH_LIVE):v.triggerPlayerAction(n,v.PLAYER_ACTIONS.GO_LIVE)}(t,Xr(m)),P(t===Br.LIVE?Ur.PLAYING_LIVE:Ur.PLAYING_DVR),n.hasStarted()?S(t):g=t,hi(n.play()),O(),!0)},C=pi("vl-dvr-btn--primary",li,s.watchLive),N=pi("vl-dvr-btn--secondary",si,s.startFromBeginning),R=r.dom.createEl("div",{className:"vl-dvr-overlay ".concat(ai)}),x=r.dom.createEl("div",{className:"vl-dvr-overlay-actions"});x.append(C,N),R.appendChild(x);var j=pi("vl-dvr-control vl-dvr-control--live",li,s.watchLive),F=pi("vl-dvr-control vl-dvr-control--beginning",si,s.startFromBeginning),V=r.dom.createEl("div",{className:"vl-dvr-controls ".concat(ai)});V.append(j,F),n.el().append(R,V);var M=null;function U(){var e,t,r=Xr(m),i={pending:r,primaryLabel:m===Ur.PENDING_RESUME?s.resume:s.watchLive,controlsHidden:r||!w(),liveHidden:m!==Ur.PLAYING_DVR};(t=i,(e=M)&&Object.keys(t).every(function(n){return e[n]===t[n]}))||(M=i,n.toggleClass("vl-dvr-pending",i.pending),R.classList.toggle(ai,!i.pending),mi(C,i.primaryLabel),V.classList.toggle(ai,i.controlsHidden),j.classList.toggle(ai,i.liveHidden))}var B=function(e,n,t){e.on(n,t),b.push(function(){return e.off(n,t)})},W=function(e,n){var t=function(e){e.stopPropagation(),n()};e.addEventListener("click",t),b.push(function(){return e.removeEventListener("click",t)})};W(C,function(){return D(m===Ur.PENDING_RESUME?Br.RESUME:Br.LIVE)}),W(N,function(){return D(Br.BEGINNING)}),W(j,function(){return D(Br.LIVE)}),W(F,function(){return D(Br.BEGINNING)}),B(n,ri,function(){var e;e=T(),!h&&e.end>e.start&&(h=!0,u.refreshAnchor(),Xr(m)&&!Jr(e)&&(P(Ur.PLAYING_LIVE),n.autoplay(E),E&&hi(n.play())),Xr(m)||O(),U()),k()}),B(n,"play",function(){Xr(m)&&(P(Ur.PLAYING_LIVE),O()),n.setTimeout(k,0)}),B(n,"playing",function(){if(void 0!==i){var e=Zr(T(),_(i));i=void 0,null!=e&&Math.abs(n.currentTime()-e)>10&&n.currentTime(e)}}),B(n,ii,function(){L(),U()}),B(n,oi,U),n.liveTracker&&B(n.liveTracker,"liveedgechange",L);var G=function(){Xr(m)&&n.autoplay(E),clearInterval(y),y=null,b.splice(0).forEach(function(e){return e()}),I.clear(),R.remove(),V.remove(),n.removeClass("vl-dvr-pending"),ui.get(e)===H&&ui.delete(e)};B(n,"dispose",G);var H={manager:{getState:function(){return m},onStateChange:function(e){return I.add(e),function(){return I.delete(e)}},isAvailable:w,hasResume:function(){return null!=p},selectAction:D,seekToLive:function(){return D(Br.LIVE)},seekToBeginning:function(){return D(Br.BEGINNING)},setStartOverTime:function(e){d=Hr(e)},getStartOverTime:function(){return d},destroy:G},updateContent:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.params,r=n.content,o=n.sourceReloaded,a=void 0!==o&&o,l=zr({config:{epg:t},content:r}),s=!(null==r||!r.channelId)&&r.channelId!==c;(s||null!=l)&&(d=l),a&&(h=!1,i=void 0),s&&(c=r.channelId,f=Kr(r,e),p=fi(f,Qr(r)),P(Xr(m)?$r(null,null!=p):Ur.PLAYING_LIVE),Xr(m)||(p=null)),U()},destroy:G};return U(),H}function yi(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.config,o=r.content,l=r.liveVideo,s=r.isDvrEnabled;null===(n=ui.get(e))||void 0===n||n.destroy();var u=a.getPlayer(e);if(!u||!function(e){var n,t=e.config,r=e.content,i=e.liveVideo,o=e.isDvrEnabled;return!(null==t||null===(n=t.dvrStartOverConfig)||void 0===n||!n.enable)&&!!i&&(!!o||Yr(r))}({config:i,content:o,liveVideo:l,isDvrEnabled:s}))return null;var d=gi(e,u,{config:i,content:o});ui.set(e,d);var c=null==i||null===(t=i.dvrStartOverConfig)||void 0===t?void 0:t.getDvrManager;return"function"==typeof c&&c(d.manager),d.manager}function Ii(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.config,r=y(n,ei),i=ti(ti({},null==t?void 0:t.dvrStartOverConfig),{},{startOverTime:void 0,dvrPlayFrom:void 0});return yi(e,ti(ti({},r),{},{config:ti(ti({},t),{},{epg:void 0,dvrStartOverConfig:i})}))}function bi(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.params,i=t.content,o=t.sourceReloaded;Yr(i)&&(null===(n=ui.get(e))||void 0===n||n.updateContent({params:r,content:i,sourceReloaded:o}))}function Ei(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var Ti=function(e,n){var t=r(e),i=t.currentTime()+n;t.currentTime(i)},_i=function(e,n){var t=r(e),i=t.currentTime(),o=i<=n?0:i-n;t.currentTime(o)},wi=function(e){return!!r.getPlayer("".concat(e))},Si=function(){var e=n(t.mark(function e(r,i){var l,s,u,d,c=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=c.length>2&&void 0!==c[2]&&c[2],e.next=3,k();case 3:return s=e.sent,u=a.getPlayer(r),d=o.playerConfigManager.getConfig(),e.abrupt("return",new Promise(function(e,o){oe(i,s).then(function(){var o=n(t.mark(function n(o){var a,s,c,v,f,p,m,h,g,y,I;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(wr(),(p=null==o?void 0:o.data).contentType="linearchannel",p.channelId=null==i?void 0:i.channelId,m=(null===(a=window.customData)||void 0===a?void 0:a.ads)||(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v?void 0:v.adsConfig)||{},h=!(null==p||null===(f=p.linearchannel)||void 0===f||!f.isSSAIEnabled),g=h&&"MEDIA_TAILOR"==(null==m?void 0:m.vodAdSticherProvider),y=h&&"TRANSMIT"==(null==m?void 0:m.liveAdSticherProvider)&&!(null==m||!m.liveAdClientSideTracking),I=xe(p,r),!g){n.next=16;break}return n.next=12,ut(r,p);case 12:I=n.sent,l=!0,n.next=21;break;case 16:if(!y){n.next=21;break}return n.next=19,Ir(I,p,r);case 19:I=n.sent,l=!0;case 21:ce(p),bi(r,{params:i,content:p,sourceReloaded:Boolean(I&&l)}),I&&l?(Mn(r,{content:p,analyticsCb:null==d?void 0:d.analyticsCb,analyticsEventParams:null==d?void 0:d.analyticsEventParams,userId:null==d?void 0:d.userId}),Oi(r,I),y?_r(r,{customData:window.customData||{ads:m}}):g&&kt(r),u.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:p})})):(Un(r,p),tt.get()&&0!==Object.keys(tt.get()).length&&rt({playerId:r,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:p}));case 24:case"end":return n.stop()}},n)}));return function(e){return o.apply(this,arguments)}}()).catch(function(e){o({status:!1,msg:"Cannot load feed",response:e})})}));case 7:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),ki=function(){var e=n(t.mark(function e(r,i,l){var s,u,c,v,f,p,m,h;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k();case 2:return v=e.sent,f=o.playerConfigManager.getConfig(),console.log("load video"),(fe()||null)&&me(i),p=0,m=0,h=null,null!==(s=window)&&void 0!==s&&s.watchHistory&&null!==(u=window)&&void 0!==u&&null!==(c=u.watchHistory)&&void 0!==c&&c.enable&&le(i,v).then(function(e){var n,t,r,i,o,a,l,s,u;(null===(n=window)||void 0===n||null===(t=n.watchHistory)||void 0===t||!t.cb||null!==(r=window)&&void 0!==r&&null!==(i=r.watchHistory)&&void 0!==i&&i.isExternal||null===(o=window)||void 0===o||null===(a=o.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data),p=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,(m=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedPercentage)||null)<95)&&(h=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedTime)||null)}).catch(function(){}),e.abrupt("return",new Promise(function(e,o){ie(i,v).then(function(){var i=n(t.mark(function n(i){var l,s,u,c,v,g,y,I,b,E,T,_,w,S,k,A,O,P,L,D,C,N,R,x,j,F,V,M,U,B,W,G,H,q,Y,z,K,Q,$,X,J,Z,ee,ne;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(A=null==i?void 0:i.data,O=(null==A?void 0:A.contentType)||"video",P=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(s=window)||void 0===s||null===(u=s.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c?void 0:c.adsConfig)||{},L=!(null==A||null===(v=A[O])||void 0===v||!v.isSSAIEnabled),D=L&&"MEDIA_TAILOR"==(null==P?void 0:P.vodAdSticherProvider),C=L&&"TRANSMIT"==(null==P?void 0:P.liveAdSticherProvider)&&!(null==P||!P.liveAdClientSideTracking),N=!(null==A||null===(g=A[O])||void 0===g||null===(y=g.streamingInfo)||void 0===y||!y.isLiveStream)||"linearchannel"===O,ce(i.data),(R=(null==A||null===(I=A.ads)||void 0===I||null===(b=I.preRoll)||void 0===b||null===(E=b.adTags)||void 0===E||null===(T=E.web)||void 0===T?void 0:T.active)&&(null==A||null===(_=A.ads)||void 0===_||null===(w=_.preRoll)||void 0===w||null===(S=w.adTags)||void 0===S||null===(k=S.web)||void 0===k?void 0:k.url))&&He(r,R,A),x=xe(A,r),!D){n.next=17;break}return n.next=14,ut(r,A);case 14:x=n.sent,n.next=22;break;case 17:if(!C||!N){n.next=22;break}return wr(),n.next=21,Ir(x,A,r);case 21:x=n.sent;case 22:if(!x){n.next=40;break}if(Y=(null==A||null===(j=A.video)||void 0===j||null===(F=j.gist)||void 0===F?void 0:F.videoImageUrl)||(null==A||null===(V=A.video)||void 0===V||null===(M=V.gist)||void 0===M||null===(U=M.imageGist)||void 0===U?void 0:U.r16x9),z=a.getPlayer(r)){n.next=28;break}return console.error("[VL][player-core] player not found for id=".concat(r),{player:z}),n.abrupt("return",o({status:!1,msg:"Player not found",response:{}}));case 28:z.poster(Y),Mn(r,{content:A,analyticsCb:null==f?void 0:f.analyticsCb,analyticsEventParams:null==f?void 0:f.analyticsEventParams,userId:null==f?void 0:f.userId}),null!=f&&f.disableControls||($=!(null==A||null===(K=A[O])||void 0===K||null===(Q=K.liveDetails)||void 0===Q||!Q.isDvrEnabled),Ii(r,{config:f,content:A,liveVideo:N,isDvrEnabled:$})),Oi(r,x),C&&N?_r(r,{customData:window.customData||{ads:P}}):D&>(r,h),z.on("loadstart",function(){N&&e({status:!0,msg:"Video Loaded",response:A})}),z.on("loadeddata",function(){We(),e({status:!0,msg:"Video Loaded",response:A})}),z.one("play",function(){!p||D||C&&N||m<95&&Nr(z,p)}),z.one("error",function(){var e;o({status:!1,msg:(null==z||null===(e=z.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==A||null===(B=A.video)||void 0===B||null===(W=B.contentDetails)||void 0===W||null===(G=W.closedCaptions)||void 0===G?void 0:G.length)>0||(null==A||null===(H=A.video)||void 0===H||null===(q=H.closedCaptions)||void 0===q?void 0:q.length)>0?(ne=(null==A||null===(J=A.video)||void 0===J||null===(Z=J.contentDetails)||void 0===Z?void 0:Z.closedCaptions)||(null==A||null===(ee=A.video)||void 0===ee?void 0:ee.closedCaptions),X=ne.filter(function(e){return"VTT"===e.format}),d.addCaptions(r,X)):d.removeCaptions(r),n.next=42;break;case 40:Be(r,"Incompatible Source, only hls,mp4,drm content is allowed"),o("Incompatible Source, only hls,mp4,drm content is allowed");case 42:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){Pi(e,r,o,i)})}));case 12:case"end":return e.stop()}},e)}));return function(n,t,r){return e.apply(this,arguments)}}(),Ai=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()},Oi=function(e,n){console.log("load video in core",n);var t=a.getPlayer(e);t&&t.src(n)},Pi=function(n,t,r,i){var o,a,l,s,u,d,c=null==n||null===(o=n.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);wi(t)&&Be(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(d=window)||void 0===d?void 0:d.customErrors[c])||"".concat(v)),r&&r(function(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ei(Object(r),!0).forEach(function(t){e(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ei(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))};exports.authenticateLC=Si,exports.baseUrlManager=ue,exports.chapterUtcBounds=jr,exports.classifyRequestKind=function(e,n){var t=String(n||"").toLowerCase();if(t.includes("license"))return"license";if(t.includes("certificate"))return"server_certificate";if(t.includes("manifest"))return"manifest";if(t.includes("key"))return"key";if(t.includes("segment")||t.includes("media"))return"segment";var r=String(e||"").split("?")[0].toLowerCase();return r.endsWith(".mpd")||r.endsWith(".m3u8")||r.endsWith(".ism/manifest")?"manifest":/\.(m4s|mp4|m4a|m4v|ts|aac|webm|cmf[av]|mp4a)$/.test(r)?"segment":/license|widevine|playready|fairplay|drm/.test(r)?"license":/cert|certificate/.test(r)?"server_certificate":/\.key($|\?)/.test(r)||/\/key\//.test(r)?"key":"other"},exports.clearError=We,exports.comscoreInstanceManager=tt,exports.createIdxMapping=function(e){Q=new Map,e.map(function(e,n){Q.set(e.id,n)})},exports.createSeriesWatchMap=function(e,n){var t=new Map;se({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),$=t}).catch(function(e){return console.log(e)})},exports.createTimelineMapper=Mr,exports.disableControls=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var r=n.getElementsByClassName("vjs-big-play-button")[0];r&&(r.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")},exports.dispose=function(e){wr();var n=a.getPlayer(e),t=(tt.get()||{}).destroyComscoreTag;if(Ai(),t&&t(),a.clearEventListeners(),window.onresize=null,n)n.dispose();else{var r=document.getElementById(e);r&&r.remove()}Fn(e)},exports.emitApiErrorEvent=B,exports.extractStatusCode=function(e,n){for(var t=0,r=[null==e?void 0:e.statusCode,null==e?void 0:e.status,null==e?void 0:e.code,null==n?void 0:n.statusCode,null==n?void 0:n.status,null==n?void 0:n.code];t<r.length;t++){var i=Number(r[t]);if(Number.isFinite(i)&&i>0)return i}return null},exports.fireBeaconEvent=Bn,exports.getCurrentSeries=fe,exports.getCurrentVideo=ve,exports.getDecodedToken=A,exports.getDvrManager=function(e){var n;return(null===(n=ui.get(e))||void 0===n?void 0:n.manager)||null},exports.getEntitlementData=function(e,n,t,r){var o,a;return i({url:t,params:G({id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==r?void 0:r.latitude,longitude:null==r?void 0:r.longitude},te("entitlementData")),method:"GET",headers:G({Authorization:n,adbTempToken:null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.adbTempToken},ne("entitlementData")),withCredentials:!0}).catch(function(n){throw B(t,n,"content",{videoId:e,url:t}),n})},exports.getEpisodeNumber=ye,exports.getLinearChannelDetails=oe,exports.getSGAIEnabledSource=ut,exports.getSeasonNumber=ge,exports.getSeriesDetails=function(e,n){var t,r,o=A(n),a=(null==o?void 0:o.site)||null;if(null!==(t=window)&&void 0!==t&&null!==(r=t.customData)&&void 0!==r&&r.seriesData)return new Promise(function(e,n){var t,r;return e({data:null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.seriesData})});var l=ue.get()+"/v3/content/series/".concat(e);return i({url:l,params:G({site:a},te("series")),method:"GET",headers:G({Authorization:n},ne("series"))}).catch(function(n){throw B(l,n,"content",{videoId:e}),n})},exports.getSeriesWatchHistory=se,exports.getSeriesWatchMap=function(){return $},exports.getSource=xe,exports.getSsaiEvents=function(e){var n=a.getPlayer(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{adBreakStart:function(e){return t(Hn,e)},adImpression:function(e){return t(qn,e)},adFirstQuartile:function(e){return t(Yn,e)},adMidpoint:function(e){return t(zn,e)},adThirdQuartile:function(e){return t(Kn,e)},adComplete:function(e){return t(Qn,e)},adBreakEnd:function(e){return t($n,e)}}},exports.getToken=k,exports.getTransmitEnabledSource=Ir,exports.getUpdatedClusterSource=function(e,n){var t=e.src,r=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:r};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:r}},exports.getUserId=O,exports.getVideoDetails=ie,exports.getVideoIdx=function(){return K},exports.getVideoInfo=le,exports.getWatchHistoryByIdFromStorage=function(e,n,t){var r=Cr(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i},exports.handleError=Be,exports.initDvrStartOver=yi,exports.initialiseAdvertisement=He,exports.initialiseComscoreStreamingTracking=rt,exports.initialiseKeyboardEvents=function(e,n){var t,r,i,o=a.getPlayer(e),l=null==o||null===(t=o.controlBar)||void 0===t||null===(r=t.playToggle)||void 0===r?void 0:r.el_,s=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var r,i,a,u,d,c,v,f,p,m,h;if(Gn.enabled&&(!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName&&!(null===(r=t.target)||void 0===r||null===(i=r.closest)||void 0===i?void 0:i.call(r,'.vjs-control-bar button, .vjs-control-bar [role="button"]')))){var g=t.key,y=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(g)&&(t.preventDefault(),null==s||s.focus()),g){case" ":null==l||l.click();break;case"m":case"M":o.muted(!o.muted());break;case"f":case"F":null===(a=document.querySelector(".vjs-fullscreen-control"))||void 0===a||a.click();break;case"ArrowLeft":y&&!1===n.liveui||_i(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(d=u.app_data)||void 0===d||null===(c=d.appcmsMain)||void 0===c||null===(v=c.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)&&null!==(f=window)&&void 0!==f&&null!==(p=f.app_data)&&void 0!==p&&null!==(m=p.appcmsMain)&&void 0!==m&&null!==(h=m.adsConfig)&&void 0!==h&&h.vodAdClientSideTracking)return;y||Ti(e,10)}}},!0)},exports.initializeTransmit=_r,exports.initiateErrorHandling=Pi,exports.initiateWatchHistoryHandling=function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(Pr=null==n||null===(i=n.series)||void 0===i?void 0:i.id),Ar=[],Or=0,Er=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,s=a.getPlayer(e);s&&(s.on("dispose",Lr),s.on("timeupdate",function(){if(!s.seeking()&&!window.isAdPlaying){var e=Math.floor(s.currentTime());Ar.includes(Or)||(e!=Or||e<l?e>Or&&(Or=e+l):(Ar.push(e),Dr(s,n,l)))}}),s.on("seeked",function(){var e=Math.floor(s.currentTime());Or=e+l,Ar=[]}),s.one("ended",function(){Dr(s,n,l,!0)}))},exports.initiateWatchHistoryHandlingExternal=function(e,n){var t,r,i;if(null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&"function"==typeof(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.cb)){var o,a,l,s=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,u=(null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.completionThreshold)||95,d=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.cb,c=-1;e.on("seeked",function(){if(!window.isAdPlaying){var n=Math.floor(e.currentTime()),t=n-n%s;if(c=t,t>0){var r=Math.floor(n/e.duration()*100);d({watchedTime:n,watchedPercentage:r,doneWatching:r>=u})}}}),e.on("timeupdate",function(){if(!window.isAdPlaying){var n=Math.floor(e.currentTime()),t=n-n%s;if(n%s===0&&t!==c){c=t;var r=Math.floor(n/e.duration()*100);d({watchedTime:n,watchedPercentage:r,doneWatching:r>=u||!1})}}}),e.on("ended",function(){d({watchedTime:Math.floor(e.duration()),watchedPercentage:100,doneWatching:!0})})}},exports.inititateBeacon=Mn,exports.isDrmError=P,exports.isDrmRequestKind=function(e){return L.has(e)},exports.isHttpOk=function(e){return null==e||e>=200&&e<400},exports.isPaused=function(e){return r(e).paused()},exports.isPlayerInitialised=wi,exports.isTokenExpired=E,exports.load=ki,exports.loadVideo=Oi,exports.loadVideoInstantly=function(e,n,t){var r=a.getPlayer(e);return r.src(n),new Promise(function(e,n){var i=0;r.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),r.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},exports.pause=function(e){var n=r(e);n.paused()||v.markPlayerInitiated(e,{pause:1}),n.pause()},exports.play=function(e){var n=r(e);n.paused()&&v.markPlayerInitiated(e,{play:1}),n.play()},exports.refreshTokenManager=_,exports.rewind=_i,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],Ue("js",new Date),Ue("config",e)},exports.seasonIdxManager=he,exports.seekToResumeTime=Nr,exports.setCurrentSeries=function(e){Y=e},exports.setCurrentVideo=ce,exports.setUserId=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},exports.setVideoIdx=pe,exports.setVideoIdxById=me,exports.setupAdvertisementMarkers=gt,exports.setupAdvertisementMarkersForLinear=kt,exports.skip=Ti,exports.token_authentication_enabled=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,r=null==e?void 0:e.asat;return t&&!r&&(n=!1),n},exports.trackMap=ht,exports.trackingUrlManager=st,exports.videoReplayTracker=de;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("./index-b5636b86.js");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("./skin-66dce245.js"),n=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/slicedToArray"),a=require("./generic-932cd9bd.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s="my-player";function l(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function c(){return(c=e(t.mark(function e(r){var n,a,u,o,s,l,c,p,d,f,m,b,g,v,h,x,y,k,w,E,j,N,T,A;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return a=e.sent,e.next=11,createImageBitmap(a);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=i(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,f=[],m=0;m<l;m++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,m*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),f.push({uri:v,duration:r.duration}),r._tiles=f;return e.abrupt("return",f);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=i(h,2),y=x[0],k=x[1],w=[],E=0;E<y*k;E++)w.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(T=N.appcmsMain)||void 0===T||null===(A=T.images)||void 0===A?void 0:A.placeholderCover,duration:r.duration});return e.abrupt("return",w);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function p(e,t){return d.apply(this,arguments)}function d(){return(d=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",l(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function f(e,t,n){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=r.getPlayer(s);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,l=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),n),p=t[l];p&&!p.loading&&(p.loading=!0,function(e){return c.apply(this,arguments)}(p).then(function(e){var t=e[p.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),p.loading=!1,p.src=t.uri}))}}function m(e){return b.apply(this,arguments)}function b(){return(b=e(t.mark(function e(a){var u,s,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},a.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),a=i(r,2),s=a[0]*a[1],l=e.duration,c=0;c<s;c++){var p,d=Math.round((t*s+c)*l);u[d]=o(o({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},n(p,"left","-60px"),n(p,"border","1px solid transparent"),n(p,"borderRadius","4px"),p)})}}),s=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r.throttle(function(e){return f(e,u,s)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r.throttle(function(e){return f(e,u,s)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var g=function(){var r=e(t.mark(function e(r,n){var a,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return a=e.sent,e.next=5,a.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=i(t,2),n=r[0],a=r[1];n&&a&&(l[n.trim().toLowerCase()]=a.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function v(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function h(e,t){return x.apply(this,arguments)}function x(){return(x=e(t.mark(function e(n,u){var o,l,c,p,d,f,m,b,g,h,x,w,E,j,N,T,A,O,I,S,P,M,R,q,$,B,L,D,C,U,X,_,F,W,z,G,K,V,H,J,Q,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,fe,me;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=u,o=r.getPlayer(u),l=n.split("/"),c=l.findIndex(function(e){return"dash"===e.toLowerCase()}),p=v(-1!==c?l.slice(0,c+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,h=new DOMParser,x=h.parseFromString(g,"application/xml"),w=(null==o?void 0:o.duration())||(null===(d=a.getCurrentVideo())||void 0===d||null===(f=d.video)||void 0===f?void 0:f.runtime),E=(null==x||null===(m=x.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||p+"/",j=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<j.length)){e.next=72;break}if(("image"!==(T=j[N]).getAttribute("contentType")||"image/png"!==T.getAttribute("mimeType"))&&"image/jpeg"!==T.getAttribute("mimeType")){e.next=69;break}if(O=T.getElementsByTagName("SegmentTemplate")[0],I=null===(A=O.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!O||!I){e.next=48;break}if(M=I.getElementsByTagName("S"),R=parseInt(null===(S=M[0])||void 0===S?void 0:S.getAttribute("t")),q=parseInt(null===(P=M[0])||void 0===P?void 0:P.getAttribute("d")),$=T.getElementsByTagName("Representation")[0],B=$.getElementsByTagName("EssentialProperty")[0],L=B.getAttribute("value"),D=null==L?void 0:L.split("x"),C=i(D,2),U=C[0],X=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?q/_:q)/(U*X),W=$.getAttribute("id"),z=Math.round(w/F),G=Math.ceil(z/(U*X)),K=O.getAttribute("media"),parseInt(O.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(V=[],N=0;N<G;N++)J="/"==(H=K)[0]?new URL(p).origin:p+"/",V.push({duration:F,layout:L,uri:J+H.replace("$Time$",R+N*q).replace("$RepresentationID$",W)});return e.abrupt("return",V);case 46:e.next=69;break;case 48:if(Q=T.getElementsByTagName("Representation")[0],Y=Q.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=i(ee,2),re=te[0],ne=te[1],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=Q.getAttribute("id"),se=Math.round(w/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],fe=y(ce),N=0;N<le;N++)me=fe?k(fe,N+pe):ce,de.push({duration:ue,layout:Z,uri:E+me.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function y(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function w(){return(w=e(t.mark(function e(n){var i,a,u,o,s,l,c,d,f,b,v,x,y,k,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=r.getPlayer(n),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,p(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return f=(null==d?void 0:d[0])||null,b=f.uri,v=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,g(v,b);case 12:return x=e.sent,e.next=15,m(x);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,h(c,n);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,m(k);case 26:w=e.sent,s.thumbnails(w);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.initiateTrickplay=function(e){return w.apply(this,arguments)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("webcomponents.js/webcomponents-lite.js");var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),i=require("@babel/runtime/helpers/assertThisInitialized"),s=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),n=require("@babel/runtime/helpers/defineProperty");function o(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(i){if("default"!==i&&!(i in e)){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})}),Object.freeze(e)}function c(e){return"string"==typeof window.navigator.userAgent&&window.navigator.userAgent.indexOf(e)>=0}var l=e,u=t,h=i,d=s,m=r,v=a;function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}var y=e,g=t,C=n,f=function(){function e(t){y(this,e),this.player=t,this._sessionListener=this._onSessionStateChange.bind(this),this._castListener=this._onCastStateChange.bind(this),this._addCastContextEventListeners(),this._preserveSourceCacheOnMediaSourceAttach(),this._resumeExistingSession(),this.player.on("dispose",this._removeCastContextEventListeners.bind(this)),this._notifyPlayerOfDevicesAvailabilityChange(this.getCastContext().getCastState()),this.remotePlayer=new cast.framework.RemotePlayer,this.remotePlayerController=new cast.framework.RemotePlayerController(this.remotePlayer)}return g(e,[{key:"_addCastContextEventListeners",value:function(){var e=cast.framework.CastContextEventType.SESSION_STATE_CHANGED,t=cast.framework.CastContextEventType.CAST_STATE_CHANGED;this.getCastContext().addEventListener(e,this._sessionListener),this.getCastContext().addEventListener(t,this._castListener)}},{key:"_preserveSourceCacheOnMediaSourceAttach",value:function(){var e=this.player,t=e.handleTechSourceset_;"function"==typeof t&&(e.handleTechSourceset_=function(i){var s=e.currentSource().src;return!e.changingSrc_&&s&&!/^blob:/.test(s)&&/^blob:/.test(i.src)&&(e.lastSource_=null),t.call(e,i)})}},{key:"_removeCastContextEventListeners",value:function(){var e=cast.framework.CastContextEventType.SESSION_STATE_CHANGED,t=cast.framework.CastContextEventType.CAST_STATE_CHANGED;this.getCastContext().removeEventListener(e,this._sessionListener),this.getCastContext().removeEventListener(t,this._castListener)}},{key:"_onSessionStateChange",value:function(e){e.sessionState===cast.framework.SessionState.SESSION_ENDED&&(this.player.trigger("chromecastDisconnected"),this._reloadTech()),e.sessionState===cast.framework.SessionState.SESSION_RESUMED&&this._resumeExistingSession()}},{key:"_resumeExistingSession",value:function(){var t=this.getCastContext().getCurrentSession(),i=t&&t.getMediaSession();!e.hasConnected&&i&&this._isPlayingCurrentSource(i)&&(e.hasConnected=!0,this.player.trigger("chromecastConnected"),this._reloadTech({currentTime:i.getEstimatedTime(),paused:i.playerState===chrome.cast.media.PlayerState.PAUSED,resumeSession:!0}))}},{key:"_isPlayingCurrentSource",value:function(e){var t=this.player.currentSource(),i=e.media&&e.media.contentId;return!!(i&&t&&t.src)&&i===t.src}},{key:"_onCastStateChange",value:function(e){this._notifyPlayerOfDevicesAvailabilityChange(e.castState)}},{key:"_notifyPlayerOfDevicesAvailabilityChange",value:function(e){this.hasAvailableDevices(e)?this.player.trigger("chromecastDevicesAvailable"):this.player.trigger("chromecastDevicesUnavailable")}},{key:"hasAvailableDevices",value:function(e){return(e=e||this.getCastContext().getCastState())===cast.framework.CastState.NOT_CONNECTED||e===cast.framework.CastState.CONNECTING||e===cast.framework.CastState.CONNECTED}},{key:"openCastMenu",value:function(){var t;this.player.currentSource()&&(t=function(){e.hasConnected=!0,this.player.trigger("chromecastConnected"),this._reloadTech()}.bind(this),this.getCastContext().requestSession().then(t,function(){}))}},{key:"_reloadTech",value:function(e){var t=this.player,i=e&&void 0!==e.currentTime?e.currentTime:t.currentTime(),s=e&&void 0!==e.paused?e.paused:t.paused(),r=t.currentSources();this._resumingSession=!(!e||!e.resumeSession),t.src(r),t.ready(function(){var e=this._resumingSession;this._resumingSession=!1,s?t.pause():t.play(),e||t.currentTime(i||0)}.bind(this))}},{key:"isResumingSession",value:function(){return!!this._resumingSession}},{key:"getCastContext",value:function(){return cast.framework.CastContext.getInstance()}},{key:"getRemotePlayer",value:function(){return this.remotePlayer}},{key:"getRemotePlayerController",value:function(){return this.remotePlayerController}}],[{key:"isChromecastAPIAvailable",value:function(){return window.chrome&&window.chrome.cast&&window.cast}},{key:"isChromecastConnected",value:function(){return e.isChromecastAPIAvailable()&&cast.framework.CastContext.getInstance().getCastState()===cast.framework.CastState.CONNECTED&&e.hasConnected}}]),e}();C(f,"hasConnected",!1);var S,p,E=f;var P=e,b=t,k=i,T=s,A=r,L=a;function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}var I=E,M=function(){if(p)return S;p=1;var i=e,s=t;return S=function(){function e(){i(this,e),this._el=this._createDOMElement()}return s(e,[{key:"_createDOMElement",value:function(){var e=this._createElement("div","vjs-tech vjs-tech-chromecast"),t=this._createElement("div","vjs-tech-chromecast-poster"),i=this._createElement("img","vjs-tech-chromecast-poster-img"),s=this._createElement("div","vjs-tech-chromecast-title"),r=this._createElement("div","vjs-tech-chromecast-subtitle"),a=this._createElement("div","vjs-tech-chromecast-title-container");return t.appendChild(i),a.appendChild(s),a.appendChild(r),e.appendChild(a),e.appendChild(t),e}},{key:"_createElement",value:function(e,t){var i=document.createElement(e);return i.className=t,i}},{key:"getDOMElement",value:function(){return this._el}},{key:"_findPosterEl",value:function(){return this._el.querySelector(".vjs-tech-chromecast-poster")}},{key:"_findPosterImageEl",value:function(){return this._el.querySelector(".vjs-tech-chromecast-poster-img")}},{key:"_findTitleEl",value:function(){return this._el.querySelector(".vjs-tech-chromecast-title")}},{key:"_findSubtitleEl",value:function(){return this._el.querySelector(".vjs-tech-chromecast-subtitle")}},{key:"updatePoster",value:function(e){var t=this._findPosterImageEl();this._poster=e||null,e?(t.setAttribute("src",e),t.classList.remove("vjs-tech-chromecast-poster-img-empty")):(t.removeAttribute("src"),t.classList.add("vjs-tech-chromecast-poster-img-empty"))}},{key:"getPoster",value:function(){return this._poster}},{key:"updateTitle",value:function(e){var t=this._findTitleEl();this._title=e,e?(t.innerHTML=e,t.classList.remove("vjs-tech-chromecast-title-empty")):t.classList.add("vjs-tech-chromecast-title-empty")}},{key:"updateSubtitle",value:function(e){var t=this._findSubtitleEl();this._subtitle=e,e?(t.innerHTML=e,t.classList.remove("vjs-tech-chromecast-subtitle-empty")):t.classList.add("vjs-tech-chromecast-subtitle-empty")}}]),e}()}(),w=E;function R(e){e.chromecastSessionManager.openCastMenu()}function j(e,t){!function(e){cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:e.receiverAppID||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED})}(t),function(e){e.chromecastSessionManager||(e.chromecastSessionManager=new w(e))}(e),function(e,t){var i;t.addButtonToControlBar&&!e.controlBar.getChild("chromecastButton")&&(i=e.controlBar.children().length,void 0!==t.buttonPositionIndex&&(i=t.buttonPositionIndex>=0?t.buttonPositionIndex:e.controlBar.children().length+t.buttonPositionIndex),e.controlBar.addChild("chromecastButton",t,i)),e.on("chromecastRequested",R.bind(null,e))}(e,t)}var x=function(){c("CriOS"),c("Android")&&c("Chrome/")&&window.navigator.presentation},O=function(e){var t=e.getComponent("Button"),i=function(e){d(a,e);var i,s,r=(i=a,s=_(),function(){var e,t=v(i);if(s){var r=v(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return m(this,e)});function a(e,t){var i;return l(this,a),i=r.call(this,e,t),e.on("chromecastConnected",i._onChromecastConnected.bind(h(i))),e.on("chromecastDisconnected",i._onChromecastDisconnected.bind(h(i))),e.on("chromecastDevicesAvailable",i._onChromecastDevicesAvailable.bind(h(i))),e.on("chromecastDevicesUnavailable",i._onChromecastDevicesUnavailable.bind(h(i))),e.chromecastSessionManager&&e.chromecastSessionManager.hasAvailableDevices()?i._onChromecastDevicesAvailable():i._onChromecastDevicesUnavailable(),t.addCastLabelToButton?(i.el().classList.add("vjs-chromecast-button-lg"),i._labelEl=document.createElement("span"),i._labelEl.classList.add("vjs-chromecast-button-label"),i._updateCastLabelText(),i.el().appendChild(i._labelEl)):i.controlText("Open Chromecast menu"),i}return u(a,[{key:"buildCSSClass",value:function(){return"vjs-chromecast-button "+(this._isChromecastConnected?"vjs-chromecast-casting-state ":"")+(this.options_.addCastLabelToButton?"vjs-chromecast-button-lg ":"")+t.prototype.buildCSSClass()}},{key:"handleClick",value:function(){this.player().trigger("chromecastRequested")}},{key:"_onChromecastConnected",value:function(){this._isChromecastConnected=!0,this._reloadCSSClasses(),this._updateCastLabelText()}},{key:"_onChromecastDisconnected",value:function(){this._isChromecastConnected=!1,this._reloadCSSClasses(),this._updateCastLabelText()}},{key:"_onChromecastDevicesAvailable",value:function(){this.show()}},{key:"_onChromecastDevicesUnavailable",value:function(){this.hide()}},{key:"_reloadCSSClasses",value:function(){this.el_&&(this.el_.className=this.buildCSSClass())}},{key:"_updateCastLabelText",value:function(){this._labelEl&&(this._labelEl.textContent=this._isChromecastConnected?this.localize("Disconnect Cast"):this.localize("Cast"))}}]),a}(t);e.registerComponent("chromecastButton",i)},N=function(e){var t=e.getComponent("Tech"),i=function(t){T(a,t);var i,s,r=(i=a,s=D(),function(){var e,t=L(i);if(s){var r=L(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return A(this,e)});function a(t){var i;return P(this,a),(i=r.call(this,t)).featuresVolumeControl=!0,i.featuresPlaybackRate=!1,i.movingMediaElementInDOM=!1,i.featuresFullscreenResize=!0,i.featuresTimeupdateEvents=!0,i.featuresProgressEvents=!1,i.featuresNativeTextTracks=!1,i.featuresNativeAudioTracks=!1,i.featuresNativeVideoTracks=!1,i.videojs=e,i._eventListeners=[],i.videojsPlayer=i.videojs(t.playerId),i._chromecastSessionManager=i.videojsPlayer.chromecastSessionManager,i._ui.updatePoster(i.videojsPlayer.poster()),i._remotePlayer=i._chromecastSessionManager.getRemotePlayer(),i._remotePlayerController=i._chromecastSessionManager.getRemotePlayerController(),i._listenToPlayerControllerEvents(),i.on("dispose",i._removeAllEventListeners.bind(k(i))),i._hasPlayedAnyItem=!1,i._requestTitle=t.requestTitleFn||function(){},i._requestSubtitle=t.requestSubtitleFn||function(){},i._requestCustomData=t.requestCustomDataFn||function(){},i._modifyLoadRequestFn=t.modifyLoadRequestFn||function(e){return e},i._initialStartTime=t.startTime||0,i._chromecastSessionManager.isResumingSession&&i._chromecastSessionManager.isResumingSession()?i._adoptCurrentMediaSession():i._playSource(t.source,i._initialStartTime),i.ready(function(){this.setMuted(t.muted)}.bind(k(i))),i}return b(a,[{key:"createEl",value:function(){return this._ui=this._ui||new M,this._ui.getDOMElement()}},{key:"play",value:function(){this.paused()&&(this.ended()&&!this._isMediaLoading?this._playSource(this.videojsPlayer.currentSource(),0):this._remotePlayerController.playOrPause())}},{key:"pause",value:function(){!this.paused()&&this._remotePlayer.canPause&&this._remotePlayerController.playOrPause()}},{key:"paused",value:function(){return this._isAwaitingRemotePlayerSync()?this._adoptedPlayerState===chrome.cast.media.PlayerState.PAUSED:this._remotePlayer.isPaused||this.ended()||null===this._remotePlayer.playerState}},{key:"setSource",value:function(e){this._currentSource&&this._currentSource.src===e.src&&this._currentSource.type===e.type||(this._currentSource=e,this._playSource(e,0))}},{key:"_playSource",value:function(e,t){var i,s=this._getCastSession(),r=new chrome.cast.media.MediaInfo(e.src,e.type),a=this._requestTitle(e),n=this._requestSubtitle(e),o=this.poster(),c=this._requestCustomData(e);this.trigger("waiting"),this._clearSessionTimeout(),r.metadata=new chrome.cast.media.GenericMediaMetadata,r.metadata.metadataType=chrome.cast.media.MetadataType.GENERIC,r.metadata.title=a,r.metadata.subtitle=n,r.streamType=this.videojsPlayer.liveTracker&&this.videojsPlayer.liveTracker.isLive()?chrome.cast.media.StreamType.LIVE:chrome.cast.media.StreamType.BUFFERED,o&&(r.metadata.images=[{url:o}]),c&&(r.customData=c),this._ui.updateTitle(a),this._ui.updateSubtitle(n),(i=new chrome.cast.media.LoadRequest(r)).autoplay=!0,i.currentTime=t,i=this._modifyLoadRequestFn(i),this._isMediaLoading=!0,this._hasPlayedCurrentItem=!1,s.loadMedia(i).then(function(){var e;this._clearSessionTimeout(),this._hasPlayedAnyItem||this.triggerReady(),this.trigger("loadstart"),this.trigger("loadeddata"),this.trigger("play"),this.trigger("playing"),this._hasPlayedAnyItem=!0,this._isMediaLoading=!1,(e=this._getMediaSession())&&e.addUpdateListener(this._onMediaSessionStatusChanged.bind(this))}.bind(this),this._triggerErrorEvent.bind(this))}},{key:"_adoptCurrentMediaSession",value:function(){var e=this._getMediaSession();e?(this._currentSource=this.videojsPlayer.currentSource(),this._isMediaLoading=!1,this._hasPlayedAnyItem=!0,this._hasPlayedCurrentItem=!0,this._initialStartTime=e.getEstimatedTime(),this._hasAdoptedMediaSession=!0,this._adoptedPlayerState=e.playerState,this._adoptedDuration=e.media&&e.media.duration,this._ui.updateTitle(this._requestTitle(this._currentSource)),this._ui.updateSubtitle(this._requestSubtitle(this._currentSource)),this.triggerReady(),this.setTimeout(function(){this.trigger("loadstart"),this.trigger("loadeddata"),this.trigger("canplay"),this.trigger("canplaythrough"),e.playerState!==chrome.cast.media.PlayerState.PAUSED?(this.trigger("play"),this.trigger("playing")):this.trigger("pause"),this._triggerTimeUpdateEvent(),this._triggerDurationChangeEvent()}.bind(this),1),e.addUpdateListener(this._onMediaSessionStatusChanged.bind(this))):this._playSource(this._currentSource||this.videojsPlayer.currentSource(),this._initialStartTime)}},{key:"setCurrentTime",value:function(e){var t=this.duration();e>t||!this._remotePlayer.canSeek||(this._remotePlayer.currentTime=Math.min(t-1,e),this._remotePlayerController.seek(),this._triggerTimeUpdateEvent())}},{key:"currentTime",value:function(){return!this._hasPlayedAnyItem||this._isAwaitingRemotePlayerSync()?this._initialStartTime:this._remotePlayer.currentTime}},{key:"_isAwaitingRemotePlayerSync",value:function(){var e=chrome.cast.media.PlayerState;return!!this._hasAdoptedMediaSession&&(this._remotePlayer.playerState!==e.PLAYING&&this._remotePlayer.playerState!==e.PAUSED||(this._hasAdoptedMediaSession=!1,!1))}},{key:"duration",value:function(){return this._hasPlayedAnyItem?this._isAwaitingRemotePlayerSync()&&this._adoptedDuration?this._adoptedDuration:this._remotePlayer.duration:this.videojsPlayer.duration()}},{key:"ended",value:function(){var e=this._getMediaSession();return!(e||!this._hasMediaSessionEnded)||!!e&&e.idleReason===chrome.cast.media.IdleReason.FINISHED}},{key:"volume",value:function(){return this._remotePlayer.volumeLevel}},{key:"setVolume",value:function(e){this._remotePlayer.volumeLevel=e,this._remotePlayerController.setVolumeLevel(),this._triggerVolumeChangeEvent()}},{key:"muted",value:function(){return this._remotePlayer.isMuted}},{key:"setMuted",value:function(e){(this._remotePlayer.isMuted&&!e||!this._remotePlayer.isMuted&&e)&&this._remotePlayerController.muteOrUnmute()}},{key:"poster",value:function(){return this._ui.getPoster()}},{key:"setPoster",value:function(e){this._ui.updatePoster(e)}},{key:"buffered",value:function(){}},{key:"seekable",value:function(){return this.videojs.createTimeRange(0,this.duration())}},{key:"controls",value:function(){return!1}},{key:"playsinline",value:function(){return!0}},{key:"supportsFullScreen",value:function(){return!0}},{key:"setAutoplay",value:function(){}},{key:"playbackRate",value:function(){var e=this._getMediaSession();return e?e.playbackRate:1}},{key:"setPlaybackRate",value:function(){}},{key:"preload",value:function(){}},{key:"load",value:function(){}},{key:"readyState",value:function(){return this._isAwaitingRemotePlayerSync()?4:"IDLE"===this._remotePlayer.playerState||"BUFFERING"===this._remotePlayer.playerState?0:4}},{key:"_listenToPlayerControllerEvents",value:function(){var e=cast.framework.RemotePlayerEventType;this._addEventListener(this._remotePlayerController,e.PLAYER_STATE_CHANGED,this._onPlayerStateChanged,this),this._addEventListener(this._remotePlayerController,e.VOLUME_LEVEL_CHANGED,this._triggerVolumeChangeEvent,this),this._addEventListener(this._remotePlayerController,e.IS_MUTED_CHANGED,this._triggerVolumeChangeEvent,this),this._addEventListener(this._remotePlayerController,e.CURRENT_TIME_CHANGED,this._triggerTimeUpdateEvent,this),this._addEventListener(this._remotePlayerController,e.DURATION_CHANGED,this._triggerDurationChangeEvent,this)}},{key:"_addEventListener",value:function(e,t,i,s){var r;r={target:e,type:t,callback:i,context:s,listener:i.bind(s)},e.addEventListener(t,r.listener),this._eventListeners.push(r)}},{key:"_removeAllEventListeners",value:function(){for(;this._eventListeners.length>0;)this._removeEventListener(this._eventListeners[0]);this._eventListeners=[]}},{key:"_removeEventListener",value:function(e){var t,i=-1;for(e.target.removeEventListener(e.type,e.listener),t=0;t<this._eventListeners.length;t++)if(this._eventListeners[t].target===e.target&&this._eventListeners[t].type===e.type&&this._eventListeners[t].callback===e.callback&&this._eventListeners[t].context===e.context){i=t;break}-1!==i&&this._eventListeners.splice(i,1)}},{key:"_onPlayerStateChanged",value:function(){var e=chrome.cast.media.PlayerState,t=this._remotePlayer.playerState;t===e.PLAYING?(this._hasPlayedCurrentItem=!0,this.trigger("play"),this.trigger("playing")):t===e.PAUSED?this.trigger("pause"):t===e.IDLE&&this.ended()||null===t&&this._hasPlayedCurrentItem?(this._hasPlayedCurrentItem=!1,this._closeSessionOnTimeout(),this.trigger("ended"),this._triggerTimeUpdateEvent()):t===e.BUFFERING&&this.trigger("waiting")}},{key:"_onMediaSessionStatusChanged",value:function(e){this._hasMediaSessionEnded=!!e}},{key:"_closeSessionOnTimeout",value:function(){this._clearSessionTimeout(),this._sessionTimeoutID=setTimeout(function(){var e=this._getCastSession();e&&e.endSession(!0),this._clearSessionTimeout()}.bind(this),1e4)}},{key:"_clearSessionTimeout",value:function(){this._sessionTimeoutID&&(clearTimeout(this._sessionTimeoutID),this._sessionTimeoutID=!1)}},{key:"_getCastContext",value:function(){return this._chromecastSessionManager.getCastContext()}},{key:"_getCastSession",value:function(){return this._getCastContext().getCurrentSession()}},{key:"_getMediaSession",value:function(){var e=this._getCastSession();return e?e.getMediaSession():null}},{key:"_triggerVolumeChangeEvent",value:function(){this.trigger("volumechange")}},{key:"_triggerTimeUpdateEvent",value:function(){this.trigger("timeupdate")}},{key:"_triggerDurationChangeEvent",value:function(){this.trigger("durationchange")}},{key:"_triggerErrorEvent",value:function(){this.trigger("error")}}]),a}(t);i.canPlaySource=function(){return I.isChromecastConnected()},i.isSupported=function(){return I.isChromecastConnected()},e.registerTech("chromecast",i)},q=function(e){e.registerPlugin("chromecast",function(e){var t=Object.assign({addButtonToControlBar:!0},e||{});this.ready(function(){this.controlBar&&(w.isChromecastAPIAvailable()?j(this,t):function(e,t){var i,s=1;i=setInterval(function(){s>30?clearInterval(i):(w.isChromecastAPIAvailable()&&(clearInterval(i),j(e,t)),s+=1)},1e3)}(this,t))}.bind(this))})},U=function(e,t){Object.assign({preloadWebComponents:!1},t).preloadWebComponents&&x(),e=e||window.videojs,O(e),N(e),q(e)},B=o({__proto__:null,default:U},[U]);exports.index=B;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/get"),a=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),l=require("./playerControlEvents-4bae757e.js");function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("./skin-66dce245.js"),require("@babel/runtime/helpers/toConsumableArray");var u={startTime:0,timeLive:3600},c=0,p=u.timeLive,h=o.getComponent("Button"),d=o.getComponent("Component"),v=o.getComponent("ProgressControl"),m=v.getComponent("SeekBar"),f=v.getComponent("PlayProgressBar"),_=v.getComponent("LoadProgressBar"),y=o.getComponent("MouseTimeDisplay");_.prototype.update=function(e){var t=this.player_.buffered(),r=this.player_.duration(),a=this.player_.bufferedEnd(),n=this.partEls_,i=function(e,t){var r=e/t||0;return 100*(r>=1?1:r)+"%"};0!==i(a,r)&&(this.el_.style.width=i(a,r));for(var o=0;o<t.length;o++){var l=t.start(o),s=t.end(o),u=n[o];u||(u=this.el_.appendChild(document.createElement("div")),n[o]=u),0!==i(l,a)&&(u.style.left=i(l,a)),0!==i(s-l,a)&&(u.style.width=i(s-l,a))}for(var c=n.length;c>t.length;c--)this.el_.removeChild(n[c-1]);n.length=t.length},m.prototype.update_=function(e,t){var r=this.player_.duration(),a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),r!==Number.POSITIVE_INFINITY&&this.el_.setAttribute("aria-valuetext","-".concat(o.formatTime(r-a,r))),this.bar.update(o.dom.getBoundingClientRect(this.el_),t)},m.prototype.handleMouseMove=function(e){var t=1-this.calculateDistance(e),r=this.player_.seekable().end(0)-t*p;r===this.player_.duration()&&(r-=.1),this.player_.currentTime(r),this.update()},f.prototype.update=function(e,t){var r=this,a=this.player_.duration();this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var n=r.player_.scrubbing()?r.player_.getCache().currentTime:r.player_.currentTime(),i=o.formatTime(a-n,a);0!==t&&a!==Number.POSITIVE_INFINITY&&r.getChild("timeTooltip").update(e,t,"-".concat(i))})},y.prototype.update=function(e,t){var r=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var a=o.formatTime(p-t*p,p);r.el_.style.left="".concat(e.width*t,"px"),0!==t&&r.player_.duration()!==Number.POSITIVE_INFINITY&&r.getChild("timeTooltip").update(e,t,"-".concat(a))})};var b=function(e){var t=this;e||(e=u),this.on("timeupdate",function(e){var r,a;(a=(r=t).seekable())&&a.length&&(a.end(0)-r.currentTime()<20?r.controlBar.liveButton.addClass("onair"):r.controlBar.liveButton.removeClass("onair"),r.duration(r.seekable().end(0)),c||(c=p=r.seekable().end(0)))}),this.on("pause",function(e){t.controlBar.liveButton.removeClass("onair")}),this.ready(function(){var r;r=t,o.mergeOptions(u,e),r.addClass("vjs-dvr-seekbar"),r.controlBar.addClass("vjs-dvr-control-bar"),r.controlBar.progressControl.seekBar.__proto__.__proto__.update=function(){if(this.el_){var e;e="VolumeBar"===this.name_?this.getPercent():1-(this.player_.duration()-this.player_.currentTime())/p;var t=this.bar;if(t){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0),e>1&&(e=1);var r=(100*e).toFixed(2)+"%",a=t.el().style;return 0!==e&&(this.vertical()?a.height=r:a.width=r),e}}},r.controlBar.progressControl&&r.controlBar.progressControl.addClass("vjs-dvr-progress-control"),r.controlBar.liveButton=r.controlBar.addChild("liveButton"),r.controlBar.el().insertBefore(r.controlBar.liveButton.el(),r.controlBar.progressControl.el())})},C=function(){a(p,h);var o,u,c=(o=p,u=s(),function(){var e,t=i(o);if(u){var r=i(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return n(this,e)});function p(t,r){var a;e(this,p),(a=c.call(this,t,r)).controlText("Seek to live"),a.el().setAttribute("tabindex","0");var n=a.el().querySelector(".vjs-icon-placeholder");return n?n.outerHTML='<span class="liveCircle" aria-hidden="true"></span><span class="liveText" aria-hidden="true">LIVE</span>':a.el().insertAdjacentHTML("afterbegin",'<span class="liveCircle" aria-hidden="true"></span><span class="liveText" aria-hidden="true">LIVE</span>'),t.paused()||a.addClass("onair"),a}return t(p,[{key:"buildCSSClass",value:function(){return"vjs-live-button ".concat(function(e,t,a,n){var o=r(i(1&n?e.prototype:e),t,a);return 2&n&&"function"==typeof o?function(e){return o.apply(a,e)}:o}(p,"buildCSSClass",this,3)([]))}},{key:"handleClick",value:function(e){var t=this.player_.seekable().end(0);l.triggerPlayerAction(this.player_,l.PLAYER_ACTIONS.GO_LIVE),this.player_.currentTime(t),this.player_.play()}}]),p}();d.registerComponent("LiveButton",C),(o.registerPlugin||o.plugin)("dvrSeekbar",b),exports.default=b;
|