bitmovin-player 8.281.0 → 8.282.0
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/bitmovinplayer-serviceworker.js +2 -2
- package/bitmovinplayer-serviceworker.prod.js +2 -2
- package/bitmovinplayer-ui.js +1 -1
- package/bitmovinplayer.js +2 -2
- package/bitmovinplayer.prod.js +2 -2
- package/modules/bitmovinplayer-abr.js +2 -2
- package/modules/bitmovinplayer-abr.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-core.js +2 -2
- package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
- package/modules/bitmovinplayer-analytics.js +1 -1
- package/modules/bitmovinplayer-analytics.prod.js +1 -1
- package/modules/bitmovinplayer-container-mp4.js +2 -2
- package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
- package/modules/bitmovinplayer-container-ts.js +2 -2
- package/modules/bitmovinplayer-container-ts.prod.js +2 -2
- package/modules/bitmovinplayer-container-webm.js +2 -2
- package/modules/bitmovinplayer-container-webm.prod.js +2 -2
- package/modules/bitmovinplayer-core.js +2 -2
- package/modules/bitmovinplayer-core.prod.js +2 -2
- package/modules/bitmovinplayer-crypto.js +2 -2
- package/modules/bitmovinplayer-crypto.prod.js +2 -2
- package/modules/bitmovinplayer-dash.js +2 -2
- package/modules/bitmovinplayer-dash.prod.js +2 -2
- package/modules/bitmovinplayer-drm.js +2 -2
- package/modules/bitmovinplayer-drm.prod.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-engine-native.js +2 -2
- package/modules/bitmovinplayer-engine-native.prod.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
- package/modules/bitmovinplayer-envivio.js +1 -1
- package/modules/bitmovinplayer-envivio.prod.js +1 -1
- package/modules/bitmovinplayer-hls.js +2 -2
- package/modules/bitmovinplayer-hls.prod.js +2 -2
- package/modules/bitmovinplayer-lowlatency.js +2 -2
- package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
- package/modules/bitmovinplayer-mserenderer.js +2 -2
- package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
- package/modules/bitmovinplayer-patch.js +1 -1
- package/modules/bitmovinplayer-patch.prod.js +1 -1
- package/modules/bitmovinplayer-playstation4.js +2 -2
- package/modules/bitmovinplayer-playstation4.prod.js +2 -2
- package/modules/bitmovinplayer-playstation5.js +2 -2
- package/modules/bitmovinplayer-playstation5.prod.js +2 -2
- package/modules/bitmovinplayer-polyfill.js +1 -1
- package/modules/bitmovinplayer-polyfill.prod.js +1 -1
- package/modules/bitmovinplayer-reactnative.js +1 -1
- package/modules/bitmovinplayer-reactnative.prod.js +1 -1
- package/modules/bitmovinplayer-remotecontrol.js +2 -2
- package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker.js +2 -2
- package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
- package/modules/bitmovinplayer-sgai.js +2 -2
- package/modules/bitmovinplayer-sgai.prod.js +2 -2
- package/modules/bitmovinplayer-smooth.js +2 -2
- package/modules/bitmovinplayer-smooth.prod.js +2 -2
- package/modules/bitmovinplayer-style.js +2 -2
- package/modules/bitmovinplayer-style.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles.js +2 -2
- package/modules/bitmovinplayer-subtitles.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail.js +2 -2
- package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
- package/modules/bitmovinplayer-tizen.js +2 -2
- package/modules/bitmovinplayer-tizen.prod.js +2 -2
- package/modules/bitmovinplayer-ui.js +2 -2
- package/modules/bitmovinplayer-ui.prod.js +2 -2
- package/modules/bitmovinplayer-vidaa.js +2 -2
- package/modules/bitmovinplayer-vidaa.prod.js +2 -2
- package/modules/bitmovinplayer-vr.js +2 -2
- package/modules/bitmovinplayer-vr.prod.js +2 -2
- package/modules/bitmovinplayer-webos.js +2 -2
- package/modules/bitmovinplayer-webos.prod.js +2 -2
- package/modules/bitmovinplayer-wpe.js +2 -2
- package/modules/bitmovinplayer-wpe.prod.js +2 -2
- package/modules/bitmovinplayer-xml.js +1 -1
- package/modules/bitmovinplayer-xml.prod.js +1 -1
- package/package.json +1 -1
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.282.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sgai=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.sgai=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[283],{70600:function(t,e){var i=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.AssetListError=void 0,e.isAssetListError=function(t){return t instanceof Error&&"number"==typeof t.sgaiErrorCode};var n=function(t){function e(e,i){var n=t.call(this,i)||this;return n.sgaiErrorCode=e,n.message=null!=i?i:"",n}return i(e,t),e}(Error);e.AssetListError=n},41906:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsAssetListLoader=void 0;var o=i(20213),s=i(4129),a=i(77401),l=i(70600),u=i(6505),c=i(10619);function d(t,e){var i,n;try{n=JSON.parse(e)}catch(e){throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_INVALID,"Invalid asset list from ".concat(t,": malformed JSON (").concat(null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"unknown reason",")"))}if(!n||!Array.isArray(n.ASSETS))throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_INVALID,"Invalid asset list from ".concat(t,": missing or invalid ASSETS array"));return{assets:n.ASSETS.map(function(t){return{uri:t.URI,duration:t.DURATION,customAttributes:(0,u.extractUnknownAttributes)(t,["URI","DURATION"])}}),customAttributes:(0,u.extractUnknownAttributes)(n,["ASSETS"])}}var f=function(){function t(t){this.T9=new s.DefaultContentLoader(t,{maxRetries:t.settings.MAX_RETRIES,retryDelay:t.settings.RETRY_DELAY,requestType:o.HttpRequestType.HLS_INTERSTITIALS_ASSET_LIST})}return t.prototype.load=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(i){switch(i.label){case 0:this.U9=t,e=this.W9(t),this.V9=e,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,e];case 2:return[2,i.sent()];case 3:return this.V9===e&&(this.V9=void 0,this.U9=void 0),[7];case 4:return[2]}})})},t.prototype.W9=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(i){switch(i.label){case 0:return[4,this.X9(t)];case 1:return null===(e=i.sent())?[2,{assets:[]}]:[2,d(t,e)]}})})},t.prototype.X9=function(t){return n(this,void 0,void 0,function(){var e,i,n,o;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.T9.load(t)];case 1:return e=r.sent(),[3,3];case 2:if((null==(i=r.sent())?void 0:i.message)===a.RequestError.Canceled)throw i;throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_LOAD_FAILED,"Failed to load asset list from ".concat(t,": ").concat(function(t){var e,i=t;if("number"==typeof(null==i?void 0:i.status)){var n=i.statusText?" ".concat(i.statusText):"";return"HTTP ".concat(i.status).concat(n)}return null!==(e=null==t?void 0:t.message)&&void 0!==e?e:"network or HTTP error"}(i)));case 3:if(null==(n=e.body))return[2,null];if("string"!=typeof n)throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_INVALID,"Invalid asset list from ".concat(t,": unexpected response body of type ").concat(typeof n));return[2,(o=n.trim()).length>0?o:null]}})})},t.prototype.isLoading=function(){return void 0!==this.V9||this.T9.isLoading()},t.prototype.getCurrentLoadingUrl=function(){return this.U9},t.prototype.getCurrentLoadingPromise=function(){return this.V9},t.prototype.cancel=function(){this.T9.cancel(),this.U9=void 0},t.prototype.dispose=function(){this.V9=void 0,this.U9=void 0,this.T9.dispose()},t}();e.HlsAssetListLoader=f},57562:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsAssetLoader=void 0;var o=i(80813),s=i(20213),a=i(4129),l=function(){function t(t){this.context=t,this.Y9=new a.DefaultContentLoader(t,{maxRetries:t.settings.MAX_MPD_RETRIES,retryDelay:t.settings.MPD_RETRY_DELAY,requestType:s.HttpRequestType.MANIFEST_HLS_MASTER})}return t.prototype.load=function(t){return n(this,void 0,void 0,function(){var e,i;return r(this,function(n){switch(n.label){case 0:return(e=this.context.serviceManager.maybeCall(o.ServiceName.ManifestCachingService,function(e){return e.getHttpResponse(t)}))?[2,e]:[4,this.Y9.load(t)];case 1:return i=n.sent(),this.context.serviceManager.maybeCall(o.ServiceName.ManifestCachingService,function(e){return e.cacheHttpResponse(i,t)}),[2,i]}})})},t.prototype.isLoading=function(){return this.Y9.isLoading()},t.prototype.dispose=function(){this.Y9.dispose()},t}();e.HlsAssetLoader=l},62843:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialCustomAttributesMappingRegistry=void 0;var i=function(){function t(t){this.trackingRegistry=t}return Object.defineProperty(t.prototype,"tracking",{get:function(){return this.trackingRegistry},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clickThroughUrl",{get:function(){return this.Hfb},set:function(t){this.Hfb=t},enumerable:!1,configurable:!0}),t}();e.HlsInterstitialCustomAttributesMappingRegistry=i},59990:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialMappingRegistry=void 0;var i=function(){function t(){this.Ifb=new Map}return t.prototype.register=function(t,e){var i=this.Ifb.has(t)?this.Ifb.get(t):[];i.push.apply(i,e),this.Ifb.set(t,i)},t.prototype.getTrackingEventsForTrigger=function(t){var e;return null!==(e=this.Ifb.get(t))&&void 0!==e?e:[]},t.prototype.removeTrackingEventForTrigger=function(t,e){var i=this.Ifb.get(t);i&&this.Ifb.set(t,i.filter(function(t){return t!==e}))},t.prototype.clearTrackingEventsForTrigger=function(t){this.Ifb.delete(t)},t.prototype.clear=function(){this.Ifb.clear()},t}();e.HlsInterstitialMappingRegistry=i},10603:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialsAdTracker=void 0;var r=i(89927),o=i(70850),s=i(62843),a=i(59990),l=i(39521),u=i(1951),c=i(28038),d=i(13117),f=1/0,h=function(t){function e(e,i){var n=t.call(this,i)||this;return n.context=e,n.playerDelegate=i,n.registry=new a.HlsInterstitialMappingRegistry,n.c9=new s.HlsInterstitialCustomAttributesMappingRegistry(n.registry),n}return n(e,t),e.prototype.getClickThroughUrl=function(){return this.c9.clickThroughUrl},e.prototype.startTrackingAd=function(e,i){var n=this;t.prototype.startTrackingAd.call(this,e,i),this.c9.clickThroughUrl=void 0;var r=(0,l.getHlsCustomAttributesMappingFunction)(this.context);if(r){var s=(0,l.prepareInterstitialDataForMapping)(e);s&&(0,o.safeUserCallback)(function(){return r(s,n.c9)},this.context.logger);var a=(0,l.prepareInterstitialAssetDataForMapping)(i);a&&(0,o.safeUserCallback)(function(){return r(a,n.c9)},this.context.logger)}this.e9(i.duration)},e.prototype.started=function(){var e;t.prototype.started.call(this),null===(e=this.d9)||void 0===e||e.start()},e.prototype.reset=function(){var e;null===(e=this.d9)||void 0===e||e.reset(),this.d9=void 0,t.prototype.reset.call(this)},e.prototype.dispose=function(){var e;null===(e=this.d9)||void 0===e||e.dispose(),this.d9=void 0,t.prototype.dispose.call(this)},e.prototype.e9=function(t){var e,i,n=this;if(this.f9()&&this.g9()){var r=null===(i=null===(e=this.context.config.hls)||void 0===e?void 0:e.interstitials)||void 0===i?void 0:i.viewability;this.d9=new d.ViewabilityTracker(this.context,{viewableDurationMs:g(null==r?void 0:r.viewableDuration,2),decisionTimeoutMs:g(null==r?void 0:r.decisionTimeout,t||f)},function(t){n.pingTrackingUrls(t)})}},e.prototype.f9=function(){var t,e;return Boolean(null===(e=null===(t=this.context.config.style)||void 0===t?void 0:t.visibility)||void 0===e?void 0:e.enableTracking)},e.prototype.g9=function(){var t=this;return[c.AdTrackingEventTrigger.VIEWABLE,c.AdTrackingEventTrigger.NOT_VIEWABLE,c.AdTrackingEventTrigger.VIEW_UNDETERMINED].some(function(e){return t.registry.getTrackingEventsForTrigger(e).length>0})},e}(u.SgaiAdTracker);function g(t,e){var i="number"==typeof t&&Number.isFinite(t)?t:e;return(0,r.toMilliSeconds)(Math.max(0,i))}e.HlsInterstitialsAdTracker=h},39521:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.shouldEnableHlsAdTracking=function(t){var e,i,n,o,a=null===(i=null===(e=t.config.hls)||void 0===e?void 0:e.interstitials)||void 0===i?void 0:i.customAttributesMapping;if((0,r.isDefined)(a))return!0;var l=null===(o=null===(n=t.config.hls)||void 0===n?void 0:n.interstitials)||void 0===o?void 0:o.customAttributesMappingPreset;return!!(0,r.isDefined)(l)&&l!==s.CustomAttributesMappingPresets.NONE},e.getHlsCustomAttributesMappingFunction=function(t){var e,i=null===(e=t.config.hls)||void 0===e?void 0:e.interstitials;return(null==i?void 0:i.customAttributesMapping)&&"function"==typeof i.customAttributesMapping?i.customAttributesMapping:(null==i?void 0:i.customAttributesMappingPreset)===s.CustomAttributesMappingPresets.AD_CREATIVE_SIGNALING?o.defaultCustomAttributesMapping:null},e.prepareInterstitialDataForMapping=function(t){if((0,r.isDefined)(t.adCreativeSignaling)||(0,r.isDefined)(t.customAdTrackingInfo)){var e={id:t.id,customAttributes:n({},t.customAdTrackingInfo)};return t.adCreativeSignaling&&(e.customAttributes[a.AD_CREATIVE_SIGNALING_KEY]=t.adCreativeSignaling),e}},e.prepareInterstitialAssetDataForMapping=function(t){var e;if((0,r.isDefined)(t.adCreativeSignaling)||(0,r.isDefined)(t.customAdTrackingInfo)){var i={duration:t.duration,uri:null!==(e=t.mediaFileUrl)&&void 0!==e?e:"",customAttributes:n({},t.customAdTrackingInfo)};return t.adCreativeSignaling&&(i.customAttributes[a.AD_CREATIVE_SIGNALING_KEY]=t.adCreativeSignaling),i}};var r=i(23068),o=i(22705),s=i(6742),a=i(61933)},6742:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.CustomAttributesMappingPresets=void 0,function(t){t.NONE="NONE",t.AD_CREATIVE_SIGNALING="AD-CREATIVE-SIGNALING"}(i||(e.CustomAttributesMappingPresets=i={}))},2423:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},s=this&&this.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialsProvider=void 0;var a=i(6365),l=i(4224),u=i(3714),c=i(58735),d=i(85625),f=i(77401),h=i(44468),g=i(81199),p=i(85434),v=i(23068),y=i(70850),b=i(70600),T=i(3093),A=i(68856),E=i(41906),S=i(57562),I=i(65007),P=i(61933),m=i(6505),M=i(60841),k=i(43661),N=function(){function t(t){var e,i,n=this;this.context=t,this.bM=new Map([["ASSET-LIST",new Map],["ASSET",new Map]]),this.mM=function(t){if(n.nM(t)){var e=function(t){var e,i=(0,m.resolveRestrictValue)(t.metadata.clientAttributes.restrict),n=(0,m.resolveTriggerPolicy)(t.metadata.cue);return{id:t.metadata.id,start:t.start,end:null!==(e=t.end)&&void 0!==e?e:t.start+1,duration:t.metadata.duration,plannedDuration:t.metadata.plannedDuration,assetUri:t.metadata.clientAttributes.assetUri,assetListUri:t.metadata.clientAttributes.assetList,playoutLimit:t.metadata.clientAttributes.playoutLimit,resumeOffset:t.metadata.clientAttributes.resumeOffset,restrict:i,hasBeenPlayed:!1,jumpPolicy:(0,m.convertRestrictionToJumpPolicy)(i),seekingRestriction:(0,m.convertRestrictionToSeekingRestriction)(i),triggerPolicy:n,customAttributes:_(t)}}(t);n.ZM.add(e)}},this.ZM=new I.HlsInterstitialsQueue(t),this.aM=null===(i=null===(e=t.config)||void 0===e?void 0:e.hls)||void 0===i?void 0:i.interstitials,this.context.eventHandler.on(u.PlayerEvent.MetadataParsed,this.mM)}return t.prototype.getAdPosition=function(t){var e,i;return(0,m.isHlsInterstitialAd)(t)&&(null===(e=t.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.PRE))?M.SgaiAdPosition.PREROLL:(0,m.isHlsInterstitialAd)(t)&&(null===(i=t.triggerPolicy)||void 0===i?void 0:i.includes(P.TriggerPolicy.POST))?M.SgaiAdPosition.POSTROLL:M.SgaiAdPosition.MIDROLL},t.prototype.getDueAds=function(t){return this.ZM.getForTime(t)},t.prototype.getPreRollAds=function(){return this.ZM.getUnplayedInterstitials().filter(function(t){var e;return null===(e=t.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.PRE)})},t.prototype.getPostRollAds=function(){return this.ZM.getUnplayedInterstitials().filter(function(t){var e;return null===(e=t.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.POST)})},t.prototype.handleSkippedAds=function(t,e){var i=this.ZM.getAdsInRange(t,e);if(0===i.length)return[];var n=(0,m.shouldPlayJumpedOverInterstitials)(i,t,e,this.context);n.length>0&&this.context.logger.debug("Playing ".concat(n.length," jump-restricted ads"));for(var r=0,o=i;r<o.length;r++){var s=o[r];n.includes(s)||this.markAdAsPlayed(s)}return n},t.prototype.listUnplayedAds=function(){return this.ZM.getUnplayedInterstitials().map(R)},t.prototype.markAdAsPlayed=function(t){t.hasBeenPlayed=!0},t.prototype.markPastAdsAsPlayed=function(t){var e=this.ZM.getAdsInRange(0,t-2);if(0!==e.length){this.context.logger.debug("Marking ".concat(e.length," past interstitials as played on playback start"));for(var i=0,n=e;i<n.length;i++){var r=n[i];r.hasBeenPlayed||this.markAdAsPlayed(r)}}},t.prototype.reinsertAds=function(t){for(var e,i,n=0,r=this.ZM.getAll();n<r.length;n++){var o=r[n];o.hasBeenPlayed&&o.start>t&&!(null===(e=o.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.ONCE))&&(o.hasBeenPlayed=!1,o.assetList=void 0,o.isLoadAllowed=void 0,null===(i=this.bM.get("ASSET-LIST"))||void 0===i||i.delete(o.id),this.context.logger.debug("Reinserting interstitial ".concat(o.id," at ").concat(o.start," after backward seek to ").concat(t)))}},t.prototype.resolveRestrictions=function(t){return(0,m.isHlsInterstitialAd)(t)&&t.seekingRestriction===P.SeekingRestriction.NO_SEEKING?{seeking:!0,playbackRate:!0}:{}},t.prototype.clearDroppedOutAds=function(){var t=this,e=(0,k.getDvrWindowStart)(this.context.internalPlayer);isFinite(e)&&this.ZM.clearUntil(e).forEach(function(e){t.context.logger.debug("Interstitial with id ".concat(e.id," dropped out of the DVR window"))})},t.prototype.resolveAdCreativeSignaling=function(t){var e;return(0,v.isDefined)(t.assetList)?(0,m.extractUnknownAttributes)(t.assetList,["assets"])[P.AD_CREATIVE_SIGNALING_KEY]:(null===(e=t.customAttributes)||void 0===e?void 0:e.adCreativeSignaling)?JSON.parse(atob(t.customAttributes.adCreativeSignaling)):void 0},t.prototype.eM=function(t){var e;return(0,v.isDefined)(t.assetListUri)&&!t.assetList&&!1!==t.isLoadAllowed&&!(null===(e=this.bM.get("ASSET-LIST"))||void 0===e?void 0:e.get(t.id))},t.prototype.fM=function(t){var e;return(0,v.isDefined)(t)&&(0,k.isHlsManifestUri)(t)&&!(null===(e=this.bM.get("ASSET"))||void 0===e?void 0:e.get(t))},t.prototype.getUpcomingAds=function(t){var e=Math.min((0,g.getPlayableBufferLevel)(this.context.internalPlayer),60);return this.ZM.getAdsInRange(t,t+e)},t.prototype.preloadUpcomingAds=function(t){var e,i;if(!(null===(e=this.cM)||void 0===e?void 0:e.isLoading())&&!(null===(i=this.dM)||void 0===i?void 0:i.isLoading()))for(var n=0,r=this.getUpcomingAds(t);n<r.length;n++){var o=r[n];if(this.gM(o))return}},t.prototype.gM=function(t){return this.eM(t)?this.hM(t):this.context.internalPlayer.getPlayerType()!==h.PlayerType.Native&&this.iM(t)},t.prototype.hM=function(t){var e,i=this;return this.context.logger.debug("Preloading ASSET-LIST for upcoming interstitial for time ".concat(t.start,", id ").concat(t.id,", uri ").concat(t.assetListUri)),null===(e=this.bM.get("ASSET-LIST"))||void 0===e||e.set(t.id,!0),this.kM(t).then(function(){return i.context.logger.debug("Preloaded asset list ".concat(t.assetListUri))}).catch(function(e){var n;(null==e?void 0:e.message)!==f.RequestError.Canceled&&(t.assetList={assets:[]}),i.context.logger.debug("Could not preload asset list ".concat(t.assetListUri,": ").concat(null!==(n=null==e?void 0:e.message)&&void 0!==n?n:"Unknown reason"))}),!0},t.prototype.iM=function(t){var e,i,n,r=this;return(0,v.isDefined)(t.assetList)?n=null===(e=t.assetList.assets.find(function(t){return r.fM(t.uri)}))||void 0===e?void 0:e.uri:this.fM(t.assetUri)&&(n=t.assetUri),!!(0,v.isDefined)(n)&&(this.context.logger.debug("Preloading ASSET for upcoming interstitial for time ".concat(t.start,", id ").concat(t.id,", uri ").concat(n)),null===(i=this.bM.get("ASSET"))||void 0===i||i.set(n,!0),this.jM(n).then(function(){return r.context.logger.debug("Preloaded asset URI ".concat(n))}).catch(function(t){var e;r.context.logger.debug("Could not preload asset URI ".concat(n,": ").concat(null!==(e=null==t?void 0:t.message)&&void 0!==e?e:"Unknown reason"))}),!0)},t.prototype.jM=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(i){switch(i.label){case 0:return null!==(e=this.dM)&&void 0!==e||(this.dM=new S.HlsAssetLoader(this.context)),[4,this.dM.load(t)];case 1:return i.sent(),[2]}})})},t.prototype.kM=function(t){return r(this,void 0,void 0,function(){var e,i,r,s,a,u,c,d;return o(this,function(o){switch(o.label){case 0:if(!(0,v.isDefined)(t.assetListUri))throw new Error("Cannot load asset list without assetListUri");if((0,v.isDefined)(t.isLoadAllowed)||(t.isLoadAllowed=function(t,e,i){var r;return!(null==i?void 0:i.shouldLoadInterstitial)||null===(r=(0,y.safeUserCallback)(function(){return i.shouldLoadInterstitial(n({},t))},e))||void 0===r||r}(t,this.context.logger,this.aM)),!t.isLoadAllowed)throw new Error("Not allowed to load based on user feedback");return null!==(d=this.cM)&&void 0!==d||(this.cM=new E.HlsAssetListLoader(this.context)),e=this.cM.getCurrentLoadingUrl(),i=this.cM.getCurrentLoadingPromise(),r=void 0!==i,s=e===t.assetListUri,r&&s?(this.context.logger.debug("The asset list for the interstitial with id ".concat(t.id," was already preloading")),a=t,[4,i]):[3,2];case 1:return a.assetList=o.sent(),[2,t.assetList];case 2:return!r||s?[3,4]:(this.context.logger.debug("Interrupting preloading of outdated asset list ".concat(e)),this.cM.cancel(),[4,null==i?void 0:i.catch(function(){})]);case 3:o.sent(),o.label=4;case 4:return o.trys.push([4,6,,7]),u=t,[4,this.cM.load(t.assetListUri)];case 5:return u.assetList=o.sent(),0===t.assetList.assets.length&&(0,A.fireSgaiWarning)(this.context,l.WarningCode.MODULE_SGAI_WARNING,"Asset list for interstitial ".concat(t.id," contained no ads")),[2,t.assetList];case 6:throw c=o.sent(),this.lM(t,c),c;case 7:return[2]}})})},t.prototype.resolveNestedAds=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(i){switch(i.label){case 0:if(!(0,v.isDefined)(t.assetListUri))return[3,6];i.label=1;case 1:return i.trys.push([1,4,,5]),(0,v.isDefined)(t.assetList)?[3,3]:(this.context.logger.debug("Loading asset list with id ".concat(t.id," from URI ").concat(t.assetListUri)),[4,this.kM(t)]);case 2:i.sent(),this.context.logger.debug("Asset list loaded for ".concat(t.id)),i.label=3;case 3:return[3,5];case 4:return(null==(e=i.sent())?void 0:e.message)!==f.RequestError.Canceled&&(t.assetList={assets:[]}),[2,[]];case 5:return[2,L(t)];case 6:return(0,v.isDefined)(t.assetUri)?[2,L(t)]:(this.context.logger.debug("No assetUri or assetListUri found for interstitial with id ".concat(t.id)),[2,[]]);case 7:return[2]}})})},t.prototype.shouldPlayAd=function(t){var e=function(t,e,i){var r;return!(null==i?void 0:i.shouldPlayInterstitial)||null===(r=(0,y.safeUserCallback)(function(){return i.shouldPlayInterstitial(n({},t))},e))||void 0===r||r}(t,this.context.logger,this.aM);return e||this.context.logger.debug("Skipping playing interstitial with id ".concat(t.id," based on user feedback")),e},t.prototype.lM=function(t,e){var i;(0,b.isAssetListError)(e)?(this.context.logger.debug("Failed to resolve asset list for interstitial with id ".concat(t.id),e),(0,T.fireSgaiAdError)(this.context,e.sgaiErrorCode,e.message)):this.context.logger.debug("Could not resolve asset list with id ".concat(t.id,", uri ").concat(t.assetListUri,": ").concat(null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"Unknown reason"))},t.prototype.getReplaceContentDuration=function(t,e){return(0,v.isDefined)(t.resumeOffset)?t.resumeOffset:this.getTotalPlannedDuration(t,e)},t.prototype.getTotalPlannedDuration=function(t,e){return(0,v.isDefined)(t.playoutLimit)?t.playoutLimit:(0,m.calculateInterstitialDuration)(t,e)},t.prototype.getTotalPlayoutLimit=function(t){if((0,v.isDefined)(t.playoutLimit))return t.playoutLimit},t.prototype.nM=function(t){return(0,c.isDateRangeMetadata)(t)&&"com.apple.hls.interstitial"===t.metadata.class},t.prototype.getQueuedInterstitials=function(){return this.ZM.getAll()},t.prototype.dispose=function(){var t,e,i,n;this.context.eventHandler.off(u.PlayerEvent.MetadataParsed,this.mM),null===(t=this.cM)||void 0===t||t.dispose(),null===(e=this.dM)||void 0===e||e.dispose(),null===(i=this.bM.get("ASSET-LIST"))||void 0===i||i.clear(),null===(n=this.bM.get("ASSET"))||void 0===n||n.clear()},t}();function _(t){for(var e={},i=0,n=Object.entries(t.metadata.clientAttributes);i<n.length;i++){var r=n[i],o=r[0],s=r[1];P.KNOWN_CLIENT_ATTRIBUTES.includes(o)||(e[o]=s)}return e}function L(t){return(0,v.isDefined)(t.assetList)?t.assetList.assets.map(function(e,i){var n;return w("".concat(t.id,"-").concat(i),e.uri,e.duration,null===(n=e.customAttributes)||void 0===n?void 0:n[P.AD_CREATIVE_SIGNALING_KEY])}):(0,v.isDefined)(t.assetUri)?[w("".concat(t.id,"-0"),t.assetUri,t.end-t.start)]:[]}function w(t,e,i,n){var r=e.toLowerCase(),o=(0,k.isProgressiveMediaUrl)(r);return{id:t,isLinear:!0,width:0,height:0,duration:i,mediaFileUrl:e,adCreativeSignaling:n,data:{delivery:o?a.MediaFileDeliveryType.Progressive:a.MediaFileDeliveryType.Streaming,mimeType:o?p.MimeType.VideoMp4:d.ManifestMimeType.Hls}}}function R(t){var e=t;return e.isLoadAllowed,e.hasBeenPlayed,s(e,["isLoadAllowed","hasBeenPlayed"])}e.HlsInterstitialsProvider=N},65007:function(t,e,i){var n=this&&this.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i},r=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r<o;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialsQueue=void 0;var o=i(74853),s=i(61933),a=function(){function t(t){this.context=t,this.Z9=[]}return t.prototype.add=function(t){this.b9(t)?this.a9(t):(this.context.logger.debug("Adding HLS interstitial to queue at start time ".concat(t.start),t),o.ArrayHelper.insertInSortedArray(this.Z9,t,function(e){return e.start>t.start}))},t.prototype.a9=function(t){var e=this.Z9.findIndex(function(e){return e.id===t.id});if(-1!==e){this.context.logger.debug("Updating HLS interstitial with id at start time ".concat(t.start),t);var i=this.Z9[e],r=(t.id,t.start,t.hasBeenPlayed,t.isLoadAllowed,n(t,["id","start","hasBeenPlayed","isLoadAllowed"]));Object.assign(i,r)}else this.context.logger.debug("Interstitial to update was not found")},t.prototype.clearUntil=function(t){return o.ArrayHelper.removeUntilInSortedArray(this.Z9,function(e){return e.end>t})},t.prototype.hasDueAds=function(t){var e=this.getUnplayedInterstitials();return e.length>0&&e[0].start<=t},t.prototype.getForTime=function(t){for(var e=[],i=function(i){return i.start>t?"break":[s.TriggerPolicy.PRE,s.TriggerPolicy.POST].some(function(t){var e;return null===(e=i.triggerPolicy)||void 0===e?void 0:e.includes(t)})?"continue":void(t>=i.start&&t<=i.end&&e.push(i))},n=0,r=this.getUnplayedInterstitials();n<r.length&&"break"!==i(r[n]);n++);return e},t.prototype.getAdsInRange=function(t,e){for(var i=[],n=function(n){return n.start>e?"break":[s.TriggerPolicy.PRE,s.TriggerPolicy.POST].some(function(t){var e;return null===(e=n.triggerPolicy)||void 0===e?void 0:e.includes(t)})?"continue":void(n.start>=t&&n.start<=e&&i.push(n))},r=0,o=this.getUnplayedInterstitials();r<o.length&&"break"!==n(o[r]);r++);return i},t.prototype.getAll=function(){return r([],this.Z9,!0)},t.prototype.getUnplayedInterstitials=function(){return this.Z9.filter(function(t){return!t.hasBeenPlayed})},t.prototype.b9=function(t){return this.Z9.some(function(e){return e.id===t.id})},t}();e.HlsInterstitialsQueue=a},61933:function(t,e){var i,n,r,o;Object.defineProperty(e,"__esModule",{value:!0}),e.TriggerPolicy=e.JumpPolicy=e.SeekingRestriction=e.RestrictValue=e.KNOWN_CLIENT_ATTRIBUTES=e.AD_CREATIVE_SIGNALING_KEY=void 0,e.AD_CREATIVE_SIGNALING_KEY="X-AD-CREATIVE-SIGNALING",e.KNOWN_CLIENT_ATTRIBUTES=["assetUri","assetList","playoutLimit","resumeOffset","restrict"],function(t){t.SKIP="SKIP",t.JUMP="JUMP"}(i||(e.RestrictValue=i={})),function(t){t.NO_SEEKING="NO_SEEKING"}(n||(e.SeekingRestriction=n={})),function(t){t.ALLOW="ALLOW",t.RESTRICT="RESTRICT"}(r||(e.JumpPolicy=r={})),function(t){t.PRE="PRE",t.POST="POST",t.ONCE="ONCE"}(o||(e.TriggerPolicy=o={}))},6505:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.extractUnknownAttributes=void 0,e.calculateInterstitialDuration=function(t,e){if(t.duration&&t.duration>0)return t.duration;if(t.plannedDuration&&t.plannedDuration>0)return t.plannedDuration;var i=e.reduce(function(t,e){return t+e.duration},0);if(i>0)return i;var n=t.end-t.start;return Math.max(n,0)},e.resolveRestrictValue=function(t){if(t){var e=(Array.isArray(t)?t.map(function(t){return t.trim().toUpperCase()}):t.split(",").map(function(t){return t.trim().toUpperCase()})).map(function(t){return Object.values(o.RestrictValue).find(function(e){return e===t})}).filter(function(t){return void 0!==t});return e.length>0?e:void 0}},e.convertRestrictionToSeekingRestriction=function(t){if(null==t?void 0:t.includes(o.RestrictValue.SKIP))return o.SeekingRestriction.NO_SEEKING},e.convertRestrictionToJumpPolicy=function(t){return(null==t?void 0:t.includes(o.RestrictValue.JUMP))?o.JumpPolicy.RESTRICT:o.JumpPolicy.ALLOW},e.resolveTriggerPolicy=function(t){if(!t)return[];var e=t.split(","),i=[];return e.includes("PRE")&&i.push(o.TriggerPolicy.PRE),e.includes("POST")&&i.push(o.TriggerPolicy.POST),e.includes("ONCE")&&i.push(o.TriggerPolicy.ONCE),i},e.isHlsInterstitialAd=s,e.getJumpRestrictedHlsInterstitials=a,e.shouldPlayJumpedOverInterstitials=function(t,e,i,o){var s,l,u=null===(l=null===(s=o.config)||void 0===s?void 0:s.hls)||void 0===l?void 0:l.interstitials;if(null==u?void 0:u.shouldPlayJumpedOverInterstitials){var c=t.map(function(t){return n({},t)}),d=(0,r.safeUserCallback)(function(){return u.shouldPlayJumpedOverInterstitials(c,e,i)},o.logger);if(d){var f=d.map(function(t){return t.id});return o.logger.debug("Playing interstitials selected by shouldPlayJumpedOverInterstitials: ".concat(f)),t.filter(function(t){return f.includes(t.id)})}}var h=function(t){return t[t.length-1]}(a(t));return h?[h]:[]};var r=i(70850),o=i(61933);function s(t){return"object"==typeof t&&null!==t&&"id"in t&&("scheduleTime"in t||"start"in t)}function a(t){return function(t){return t.filter(s)}(t).filter(function(t){return t.jumpPolicy===o.JumpPolicy.RESTRICT})}e.extractUnknownAttributes=function(t,e){return Object.keys(t).reduce(function(i,n){return e.includes(n)||(i[n]=t[n]),i},{})}},60047:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SGAIModuleDefinition=void 0;var n=i(62756),r=i(91135);e.SGAIModuleDefinition={name:n.ModuleName.SGAI,module:function(){return{SgaiService:r.SgaiService}},dependencies:[n.ModuleName.AdvertisingCore]},e.default=e.SGAIModuleDefinition},84770:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.PausableTimeout=void 0;var i=function(){function t(t,e){var i=this;this.durationMs=t,this.callback=e,this.oib=null,this.pib=null,this.rib=!1,this.sib=function(){i.rib||(i.oib=null,i.pib=null,i.qib=0,i.callback())},this.qib=Math.max(0,t)}return t.prototype.start=function(){this.rib||null!==this.oib||(this.qib<=0?this.sib():(this.pib=Date.now(),this.oib=window.setTimeout(this.sib,this.qib)))},t.prototype.pause=function(){if(null!==this.oib&&null!==this.pib){var t=Date.now()-this.pib;this.qib=Math.max(0,this.qib-t),window.clearTimeout(this.oib),this.oib=null,this.pib=null}},t.prototype.resume=function(){this.start()},t.prototype.reset=function(t){void 0===t&&(t=this.durationMs),null!==this.oib&&window.clearTimeout(this.oib),this.oib=null,this.pib=null,this.qib=Math.max(0,t)},t.prototype.dispose=function(){this.reset(),this.rib=!0},t}();e.PausableTimeout=i},71734:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiAdPlayer=e.DEFAULT_ASSET_LOAD_TIMEOUT=void 0;var o=i(43255),s=i(86969),a=i(3714),l=i(90408),u=i(34841),c=i(89927),d=i(88844),f=i(23068),h=i(3093),g=i(10603),p=i(39521),v=i(10619),y=i(43661);e.DEFAULT_ASSET_LOAD_TIMEOUT=10;var b=function(){function t(t){var e=this;this.context=t,this.AN=null,this.BN=null,this.CN=null,this.DN=null,this.EN=null,this.FN=0,this.GN=null,this.HN=null,this.JN=!1,this.QN=function(){var t;e.MN(),null===(t=e.pM)||void 0===t||t.setPaused(!1)},this.RN=function(){var t;e.MN(),null===(t=e.pM)||void 0===t||t.setPaused(!0)},this.SN=function(t){return n(e,void 0,void 0,function(){var e;return r(this,function(i){return null===(e=this.pM)||void 0===e||e.progress(t.time),this.TN(t.time)&&this.PN(!0),[2]})})},this.XN=function(){return n(e,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return this.context.logger.debug("Finished SGAI ad playback"),null===(t=this.pM)||void 0===t||t.complete(),[4,this.PN()];case 1:return e.sent(),[2]}})})},this.YN=function(t){e.context.logger.debug("SGAI ad player error",t),e.ZN(v.SgaiErrorCode.INTERSTITIAL_ASSET_PLAYBACK_FAILED,t)},this.oM=new o.AdPlayerDelegate({context:t,internalPlayer:t.internalPlayer,restoreContentDeferred:new u.Deferred}),(0,y.isPlayingHls)(t)&&(0,p.shouldEnableHlsAdTracking)(t)&&(this.pM=new g.HlsInterstitialsAdTracker(this.context,this.oM))}return t.prototype.playAdBreak=function(t,e){return n(this,void 0,void 0,function(){var i,n,o,s,a,l,u;return r(this,function(r){switch(r.label){case 0:return[4,this.NN(!1,this.BN)];case 1:r.sent(),this.GN=t,this.EN=e,r.label=2;case 2:return r.trys.push([2,10,11,13]),i=this,[4,this.oM.requestAdPlayback(t)];case 3:i.BN=r.sent(),n=0,o=t.ads,r.label=4;case 4:if(!(n<o.length))return[3,9];if(s=o[n],this.JN)return[3,9];if(null==s.id)return this.context.logger.debug("SGAI ad without id detected - skipping playback",s),[3,8];if(this.TN())return[3,8];null===(u=this.pM)||void 0===u||u.startTrackingAd(t,s),this.context.logger.debug("Triggering playback of SGAI ad ".concat(s.id," at time ").concat(t.scheduleTime),s),r.label=5;case 5:return r.trys.push([5,7,,8]),[4,this.KN(s,t.restrictions)];case 6:return r.sent(),this.FN+=s.duration,[3,8];case 7:return a=r.sent(),this.context.logger.debug("Failed to play SGAI ad ".concat(s.id),a),[3,8];case 8:return n++,[3,4];case 9:return[3,13];case 10:return l=r.sent(),this.context.logger.debug("Failed to play SGAI ad break with id ".concat(t.id),l),[3,13];case 11:return[4,this.NN(e.isLastAdBreak,this.BN)];case 12:return r.sent(),[7];case 13:return[2]}})})},t.prototype.skipActiveAd=function(){return this.AN?(this.context.logger.debug("Skipping currently active SGAI ad"),this.PN()):(this.context.logger.debug("No active SGAI ad to skip"),Promise.resolve())},t.prototype.getActiveAd=function(){return this.HN},t.prototype.KN=function(t,e){return n(this,void 0,void 0,function(){var i,n,o,s=this;return r(this,function(r){switch(r.label){case 0:if(!this.BN||this.JN)throw new Error("No active AdPlaybackAPI available for playback");r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,this.BN.requestPlayer()];case 2:return i=r.sent(),this.AN=i,[4,new Promise(function(n,r){var o;s.CN=n,s.DN=r;var l=function(){return s.DN===r},u=null===(o=s.pM)||void 0===o?void 0:o.getClickThroughUrl();return t.clickThroughUrl=u,t.clickThroughUrlOpened=u?function(){var t;return null===(t=s.pM)||void 0===t?void 0:t.click()}:void 0,i.on(a.PlayerEvent.TimeChanged,s.SN),i.on(a.PlayerEvent.Playing,s.QN),i.on(a.PlayerEvent.Paused,s.RN),i.on(a.PlayerEvent.Muted,function(){var t;return null===(t=s.pM)||void 0===t?void 0:t.setMuted(!0)}),i.on(a.PlayerEvent.Unmuted,function(){var t;return null===(t=s.pM)||void 0===t?void 0:t.setMuted(!1)}),i.on(a.PlayerEvent.PlaybackFinished,s.XN),i.on(a.PlayerEvent.Error,s.YN),s.context.logger.debug("Loading ad ".concat(t.id)),s.HN=t,s.LN(t,l),i.load(t,e).then(function(){s.pM&&l()&&(s.pM.loaded(),s.pM.trackImpression(),s.pM.started())}).catch(function(t){l()&&s.YN(t)})})];case 3:return r.sent(),[3,6];case 4:throw n=r.sent(),o="Error during SGAI ad playback for ".concat(t.id,": ").concat(null==n?void 0:n.message),this.context.logger.debug(o,n),n;case 5:return this.MN(),this.AN=null,this.HN=null,[7];case 6:return[2]}})})},t.prototype.LN=function(t,i){var n=this;this.IN=window.setTimeout(function(){if(n.IN=void 0,i()){var r="SGAI ad ".concat(t.id," did not start playing within ").concat(e.DEFAULT_ASSET_LOAD_TIMEOUT,"s");n.ZN(v.SgaiErrorCode.INTERSTITIAL_ASSET_LOAD_TIMEOUT,new Error(r))}},(0,c.toMilliSeconds)(e.DEFAULT_ASSET_LOAD_TIMEOUT))},t.prototype.MN=function(){(0,d.clearTimeoutIfDefined)(this.IN),this.IN=void 0},t.prototype.NN=function(t,e){return n(this,void 0,void 0,function(){var i;return r(this,function(n){switch(n.label){case 0:if(!e)return[3,6];n.label=1;case 1:return n.trys.push([1,4,5,6]),this.JN?[3,3]:[4,e.done(t)];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:return i=n.sent(),this.context.logger.debug("Error finishing current ad playback",i),[3,6];case 5:return this.AN=null,this.HN=null,this.BN=null,this.CN=null,this.DN=null,[7];case 6:return this.WN(),[2]}})})},t.prototype.ON=function(){return n(this,arguments,void 0,function(t){var e,i;return void 0===t&&(t=!1),r(this,function(n){switch(n.label){case 0:if(this.MN(),!this.AN)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.AN.done(t)];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),this.context.logger.debug("Error calling adPlayer.done()",e),[3,4];case 4:this.AN=null,this.HN=null,n.label=5;case 5:return null===(i=this.pM)||void 0===i||i.reset(),[2]}})})},t.prototype.PN=function(){return n(this,arguments,void 0,function(t){var e;return void 0===t&&(t=!1),r(this,function(i){switch(i.label){case 0:return[4,this.ON(t)];case 1:return i.sent(),e=this.CN,this.CN=null,this.DN=null,null==e||e(),[2]}})})},t.prototype.TN=function(t){var e;void 0===t&&(t=0);var i=null===(e=this.EN)||void 0===e?void 0:e.getPlayoutLimit();if(!(0,f.isDefined)(i))return!1;this.VN(i),this.UN(i);var n=this.FN+t>=i;return n&&this.context.logger.debug("Playout limit (".concat(i,"s) reached for current SGAI ad break")),n},t.prototype.UN=function(t){var e,i=null===(e=this.EN)||void 0===e?void 0:e.getReplaceContentDuration();if(this.GN&&(0,f.isDefined)(i)){var n=this.GN.totalPlannedDuration!==t,r=this.GN.replaceContentDuration!==i;(n||r)&&(this.GN.replaceContentDuration=i,this.GN.totalPlannedDuration=t,this.oM.updateAdRestoreState({adBreakDuration:t,replaceContentDuration:i}))}},t.prototype.VN=function(t){var e,i,n=null!==(i=null===(e=this.HN)||void 0===e?void 0:e.duration)&&void 0!==i?i:0,r=t-this.FN,o=r>0&&r<n;this.HN&&o&&(this.context.logger.debug("Current Ad duration changed from (".concat(n,"s) to (").concat(r,"s) due to playout limit")),(0,l.maybeFireDurationChangedEvent)(n,r,this.context.eventHandler),this.HN.duration=r)},t.prototype.WN=function(){this.GN=null,this.EN=null,this.FN=0},t.prototype.ZN=function(t,e){var i,n,r=this.DN;if(!r)return Promise.resolve();this.CN=null,this.DN=null;var o=null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"string"==typeof e?e:void 0;return(0,h.fireSgaiAdError)(this.context,t,o,e),null===(n=this.pM)||void 0===n||n.errorWithCode(String(t)),this.ON().then(function(){return r(e instanceof s.PlayerError||e instanceof Error?e:new Error("AdPlayer failed: ".concat(JSON.stringify(e))))})},t.prototype.dispose=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return this.JN=!0,this.AN?(this.context.logger.debug("Source was unloaded while SGAI ad was playing"),[4,this.PN()]):[3,2];case 1:e.sent(),e.label=2;case 2:return this.oM.reset(),null===(t=this.pM)||void 0===t||t.dispose(),this.WN(),[2]}})})},t}();e.SgaiAdPlayer=b},1951:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiAdTracker=void 0;var n=i(95217),r=i(3714),o=i(23068),s=i(28038),a=function(){function t(t){this.playerDelegate=t,this.Jfb=0,this.Kfb=[]}return t.prototype.click=function(){var t=this.getClickThroughUrl();t&&this.playerDelegate.adClicked(t),this.pingTrackingUrls(s.AdTrackingEventTrigger.CLICKED)},t.prototype.close=function(){},t.prototype.trackOverlayViewDuration=function(){},t.prototype.complete=function(){this.Lfb(100),this.pingTrackingUrls(s.AdTrackingEventTrigger.COMPLETE)},t.prototype.errorWithCode=function(t){this.pingTrackingUrls(s.AdTrackingEventTrigger.ERROR)},t.prototype.loaded=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.LOADED)},t.prototype.progress=function(t){var e=Math.round(100*t)/this.Jfb;this.Lfb(e),this.pingTrackingUrls(s.AdTrackingEventTrigger.PROGRESS,t)},t.prototype.setDuration=function(t){this.Jfb=t},t.prototype.setFullscreen=function(t){},t.prototype.setMuted=function(t){this.pingTrackingUrls(t?s.AdTrackingEventTrigger.MUTE:s.AdTrackingEventTrigger.UNMUTE)},t.prototype.setPaused=function(t){this.pingTrackingUrls(t?s.AdTrackingEventTrigger.PAUSE:s.AdTrackingEventTrigger.RESUME)},t.prototype.skip=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.SKIP)},t.prototype.started=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.START)},t.prototype.trackImpression=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.IMPRESSION)},t.prototype.volumeChanged=function(t){},t.prototype.Lfb=function(t){var e=this;[r.AdQuartile.FIRST_QUARTILE,r.AdQuartile.MIDPOINT,r.AdQuartile.THIRD_QUARTILE].forEach(function(i){!e.Kfb.includes(i)&&t>=function(t){switch(t){case r.AdQuartile.FIRST_QUARTILE:return 25;case r.AdQuartile.MIDPOINT:return 50;case r.AdQuartile.THIRD_QUARTILE:return 75;default:return 100}}(i)&&(e.playerDelegate.onQuartile(i),e.Kfb.push(i),e.pingTrackingUrls(i))})},t.prototype.pingTrackingUrls=function(t,e){var i=this;this.registry.getTrackingEventsForTrigger(t).filter(function(t){return!(0,o.isDefined)(e)||!(0,o.isDefined)(t.offset)||Math.round(t.offset)===Math.round(e)}).forEach(function(r){r.urls.forEach(function(t){return(0,n.pingUrl)(t)}),(0,o.isDefined)(e)&&i.registry.removeTrackingEventForTrigger(t,r)})},t.prototype.startTrackingAd=function(t,e){this.Jfb=e.duration,this.registry.clear(),this.Kfb=[]},t.prototype.getClickThroughUrl=function(){},t.prototype.setupWasSuccessful=function(){return(0,o.isDefined)(this.registry)},t.prototype.reset=function(){this.Jfb=0,this.registry.clear(),this.Kfb=[]},t.prototype.dispose=function(){this.reset()},t}();e.SgaiAdTracker=a},28038:function(t,e){var i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AdTrackingEventTrigger=e.SgaiAdType=void 0,function(t){t.LINEAR="linear"}(i||(e.SgaiAdType=i={})),function(t){t.IMPRESSION="impression",t.PAUSE="pause",t.MUTE="mute",t.UNMUTE="unmute",t.RESUME="resume",t.LOADED="loaded",t.START="start",t.PROGRESS="progress",t.FIRST_QUARTILE="firstQuartile",t.MIDPOINT="midpoint",t.THIRD_QUARTILE="thirdQuartile",t.COMPLETE="complete",t.ERROR="error",t.CLICKED="clickTracking",t.SKIP="skip",t.VIEWABLE="viewable",t.NOT_VIEWABLE="notViewable",t.VIEW_UNDETERMINED="viewUndetermined"}(n||(e.AdTrackingEventTrigger=n={}))},10619:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiErrorCode=void 0,function(t){t[t.INTERSTITIAL_ASSET_LIST_INVALID=111]="INTERSTITIAL_ASSET_LIST_INVALID",t[t.INTERSTITIAL_ASSET_LIST_LOAD_FAILED=406]="INTERSTITIAL_ASSET_LIST_LOAD_FAILED",t[t.INTERSTITIAL_ASSET_PLAYBACK_FAILED=407]="INTERSTITIAL_ASSET_PLAYBACK_FAILED",t[t.INTERSTITIAL_ASSET_LOAD_TIMEOUT=408]="INTERSTITIAL_ASSET_LOAD_TIMEOUT"}(i||(e.SgaiErrorCode=i={}))},91135:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiService=void 0;var s=i(80813),a=i(56481),l=i(3714),u=i(44468),c=i(34841),d=i(23068),f=i(2423),h=i(71734),g=i(60841),p=i(43661),v=function(){function t(t){var e=this;this.context=t,this.Oj=!1,this.Pj=!1,this.Qj=void 0,this.Rj=!1,this.Uj=function(){var t;null!==(t=e.Sj)&&void 0!==t||(e.Sj=new c.Deferred),e.Sj.resolve()},this.Vj=function(){!e.Mj||e.Oj||e.Qj||e.Mj.markPastAdsAsPlayed(e.context.internalPlayer.getCurrentTime())},this.Wj=function(t){if(e.Mj&&!e.Oj){e.Mj.clearDroppedOutAds();var i=e.context.settings.SGAI_TRIGGER_DELAY_COMPENSATION,n=e.Mj.getDueAds(t.time+i);0===n.length?e.bj(t.time):(e.context.logger.debug("Scheduling playback of SGAI ads at time ".concat(t.time),n),e.ej(n))}},this.Xj=function(t){var i=n(n({},t),{seekTarget:t.target});e.Zj(i)},this.Yj=function(t){e.aj(t)},this.Zj=function(t){var i,r;e.Mj&&!e.Oj&&(e.dj(),e.Qj=n(n(n({},e.Qj),t),{position:null!==(r=null===(i=e.Qj)||void 0===i?void 0:i.position)&&void 0!==r?r:t.position}),t.seekTarget>=t.position||e.Mj.reinsertAds(t.seekTarget))},this.aj=function(t){if(e.Mj&&!e.Oj&&e.Qj){var i=e.Qj,n=i.position,r=i.seekTarget;if(e.Qj=void 0,!(r<=n)){var o=e.Mj.handleSkippedAds(n,r);if(0!==o.length){e.context.logger.debug("Scheduling playback of ".concat(o.length," SGAI ads on seeking"),o);var s=t.type===l.PlayerEvent.Seeked?0:void 0;e.ej(o,s)}}}},this.context.logger.debug("Creating SGAI service")}return t.prototype.initialize=function(){this.Pj=!1,this.context.logger.debug("Initializing SGAI service"),(0,p.isPlayingHls)(this.context)&&(this.Mj=new f.HlsInterstitialsProvider(this.context),this.context.eventHandler.on(l.PlayerEvent.SourceLoaded,this.Uj),this.context.eventHandler.on(l.PlayerEvent.Playing,this.Vj),this.context.eventHandler.on(l.PlayerEvent.TimeChanged,this.Wj),this.context.eventHandler.on(l.PlayerEvent.Seek,this.Zj),this.context.eventHandler.on(l.PlayerEvent.Seeked,this.aj),this.context.eventHandler.on(l.PlayerEvent.TimeShift,this.Xj),this.context.eventHandler.on(l.PlayerEvent.TimeShifted,this.Yj))},t.prototype.getSgaiPlayerAPI=function(){var t=this;return{list:function(){var e,i;return null!==(i=null===(e=t.Mj)||void 0===e?void 0:e.listUnplayedAds())&&void 0!==i?i:[]},skip:function(){var e,i;return null!==(i=null===(e=t.Nj)||void 0===e?void 0:e.skipActiveAd())&&void 0!==i?i:Promise.resolve()},getActiveAd:function(){var e,i;return null!==(i=null===(e=t.Nj)||void 0===e?void 0:e.getActiveAd())&&void 0!==i?i:void 0}}},t.prototype.bj=function(t){var e,i=this,n=this.Mj;if(!n||this.Qj||this.Tj)return Promise.resolve();var r=null===(e=this.context.serviceManager)||void 0===e?void 0:e.get(s.ServiceName.AdPreloadingService);if(!r||this.context.internalPlayer.getPlayerType()===u.PlayerType.Native)return n.preloadUpcomingAds(t),Promise.resolve();if(r.hasTrackedAds())return Promise.resolve();var o=n.getUpcomingAds(t);if(0===o.length)return Promise.resolve();for(var a=this.Tj={},l=function(){return i.Tj===a&&!i.Oj&&!i.Pj},c=Promise.resolve(!1),d=function(t){c=c.then(function(e){return e||!l()?e:n.resolveNestedAds(t).then(function(t){return!!l()&&r.preloadAds(t)})}).catch(function(e){return i.context.logger.debug("Failed to prepare upcoming SGAI ad break ".concat(t.id),e),!1})},f=0,h=o;f<h.length;f++)d(h[f]);return c.then(function(){}).finally(function(){i.Tj===a&&(i.Tj=void 0)})},t.prototype.cj=function(){this.Tj=void 0},t.prototype.dj=function(){var t,e;this.cj(),null===(e=null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(s.ServiceName.AdPreloadingService))||void 0===e||e.cancel()},t.prototype.shouldPlayPreRollAds=function(){return Boolean(this.Mj)&&!this.Rj},t.prototype.playPreRollAds=function(){return r(this,void 0,void 0,function(){var t,e,i=this;return o(this,function(n){switch(n.label){case 0:return this.Mj?(null!==(e=this.Sj)&&void 0!==e||(this.Sj=new c.Deferred),[4,this.Sj.promise.catch(function(){})]):[2];case 1:return n.sent(),this.Pj?(this.context.logger.debug("Source loading failed or was aborted, skipping SGAI pre-roll playback"),[2]):(this.Rj=!0,0===(t=this.Mj.getPreRollAds()).length?(this.context.logger.debug("No SGAI pre-rolls found"),[2]):(this.context.logger.debug("Scheduling playback of ".concat(t.length," SGAI pre-roll ads"),t),[2,this.ej(t).finally(function(){return i.Vj()})]))}})})},t.prototype.ej=function(t,e){return r(this,void 0,void 0,function(){var i,n,r,a,l,u,c,f,g,p=this;return o(this,function(v){switch(v.label){case 0:return this.cj(),this.Oj=!0,[4,this.fj(t)];case 1:i=v.sent(),n=i.reduce(function(t,e){var i;return t+(null!==(i=e.replaceContentDuration)&&void 0!==i?i:0)},0)+this.context.settings.SGAI_TRIGGER_DELAY_COMPENSATION,r=null===(f=this.context.serviceManager)||void 0===f?void 0:f.get(s.ServiceName.AdPreloadingService),a=i.filter(function(t){return t.ads.length>0}).pop(),l=function(s){var l,c;return o(this,function(o){switch(o.label){case 0:if(0===(l=i[s]).ads.length)return u.context.logger.debug("No ads found for SGAI with id ".concat(l.id,", skipping playback")),u.dj(),[2,"continue"];if(u.Pj||!u.Mj)return[2,"break"];l.replaceContentDuration=null!=e?e:n,u.context.logger.debug("Scheduling playback of SGAI ad break with ".concat(l.ads.length," ads"),l),r&&!r.hasTrackedAds()&&r.trackAds(l.ads),o.label=1;case 1:return o.trys.push([1,3,4,5]),null!==(g=u.Nj)&&void 0!==g||(u.Nj=new h.SgaiAdPlayer(u.context)),[4,u.Nj.playAdBreak(l,{isLastAdBreak:l===a,getPlayoutLimit:function(){var e;return null===(e=p.Mj)||void 0===e?void 0:e.getTotalPlayoutLimit(t[s])},getReplaceContentDuration:function(){var i;if((0,d.isDefined)(e))return e;var n=null===(i=p.Mj)||void 0===i?void 0:i.getReplaceContentDuration(t[s],l.ads);return(0,d.isDefined)(n)?n+p.context.settings.SGAI_TRIGGER_DELAY_COMPENSATION:void 0}})];case 2:return o.sent(),[3,5];case 3:return c=o.sent(),u.context.logger.debug("Failed to play SGAI ad break with id ".concat(l.id),c),[3,5];case 4:return u.dj(),[7];case 5:return[2]}})},u=this,c=0,v.label=2;case 2:return c<i.length?[5,l(c)]:[3,5];case 3:if("break"===v.sent())return[3,5];v.label=4;case 4:return c++,[3,2];case 5:return this.Oj=!1,this.Qj=void 0,[2]}})})},t.prototype.fj=function(t){for(var e=this,i=[],n=Promise.resolve(),r=function(t){n=n.then(function(){if(e.Pj)throw new Error("SGAI service is shutting down");return e.gj(t).then(function(t){i.push(t)})})},o=0,s=t;o<s.length;o++)r(s[o]);return n.then(function(){return i}).catch(function(t){return e.context.logger.debug("Failed to prepare SGAI ad breaks",t),[]})},t.prototype.gj=function(t){return r(this,void 0,void 0,function(){var e,i,n,r,s,a,l,u,c,d,f,h,p;return o(this,function(o){switch(o.label){case 0:return this.Mj?[4,this.Mj.resolveNestedAds(t)]:[3,2];case 1:return i=o.sent(),[3,3];case 2:i=[],o.label=3;case 3:return(e=i).length>0&&!(null===(a=this.Mj)||void 0===a?void 0:a.shouldPlayAd(t))&&(e=[]),n=null===(l=this.Mj)||void 0===l?void 0:l.getReplaceContentDuration(t,e),r=null===(u=this.Mj)||void 0===u?void 0:u.getTotalPlannedDuration(t,e),s=e.length>0,null===(c=this.Mj)||void 0===c||c.markAdAsPlayed(t),[2,{id:t.id,position:null!==(f=null===(d=this.Mj)||void 0===d?void 0:d.getAdPosition(t))&&void 0!==f?f:g.SgaiAdPosition.MIDROLL,scheduleTime:t.start,replaceContentDuration:s?n:void 0,totalPlannedDuration:s?r:void 0,ads:e,adCreativeSignaling:null===(h=this.Mj)||void 0===h?void 0:h.resolveAdCreativeSignaling(t),restrictions:null===(p=this.Mj)||void 0===p?void 0:p.resolveRestrictions(t)}]}})})},t.prototype.playPostRollAds=function(){if(!this.Mj)return Promise.resolve();var t=this.Mj.getPostRollAds();return 0===t.length?Promise.resolve():(this.context.logger.debug("Scheduling playback of post-roll SGAI ads with id ".concat(t.map(function(t){return t.id}).join(", ")),t),this.ej(t))},t.prototype.reset=function(){return r(this,void 0,void 0,function(){var t,e;return o(this,function(i){switch(i.label){case 0:return this.context.logger.debug("Resetting SGAI service"),this.Pj=!0,this.Rj=!1,this.Qj=void 0,this.context.eventHandler.off(l.PlayerEvent.Playing,this.Vj),this.context.eventHandler.off(l.PlayerEvent.TimeChanged,this.Wj),this.context.eventHandler.off(l.PlayerEvent.TimeShift,this.Xj),this.context.eventHandler.off(l.PlayerEvent.TimeShifted,this.Yj),this.context.eventHandler.off(l.PlayerEvent.Seek,this.Zj),this.context.eventHandler.off(l.PlayerEvent.Seeked,this.aj),this.context.eventHandler.off(l.PlayerEvent.SourceLoaded,this.Uj),null===(t=this.Sj)||void 0===t||t.reject(),this.Sj=void 0,this.dj(),this.Mj=(0,a.dispose)(this.Mj),[4,null===(e=this.Nj)||void 0===e?void 0:e.dispose()];case 1:return i.sent(),this.Nj=void 0,this.Oj=!1,[2]}})})},t.prototype.dispose=function(){},t}();e.SgaiService=v},60841:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiAdPosition=void 0,function(t){t.PREROLL="pre",t.MIDROLL="mid",t.POSTROLL="post"}(i||(e.SgaiAdPosition=i={}))},43661:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.getDvrWindowStart=function(t){return t.isLive()?t.getCurrentTime()-t.getTimeShift()+t.getMaxTimeShift():-1/0},e.isPlayingHls=function(t){return t.sourceContext.technology.streaming===n.StreamType.Hls},e.isHlsManifestUri=r,e.isProgressiveMediaUrl=function(t){return!r(t)&&t.toLowerCase().includes(".mp4")};var n=i(20213);function r(t){return t.toLowerCase().includes(".m3u8")}},13117:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ViewabilityTracker=void 0;var n=i(3714),r=i(84770),o=i(28038),s=function(){function t(t,e,i){var n=this;this.context=t,this.config=e,this.onDecision=i,this.Mfb=!1,this.Nfb=!1,this.Ofb=!0,this.Pfb=0,this.Qfb=null,this.Sfb={paused:!1,stalled:!1},this.Tfb=null,this.egb=function(t){n.Nfb=Boolean(t.isVisible),n.ngb()},this.fgb=function(){n.Ofb=n.ogb(),n.ngb()},this.ggb=function(){n.Mfb||n.sgb(o.AdTrackingEventTrigger.NOT_VIEWABLE)},this.hgb=function(){n.qgb("paused")},this.igb=function(){n.rgb("paused")},this.jgb=function(){n.qgb("stalled")},this.kgb=function(){n.rgb("stalled")},this.mgb=function(){var t,e=Date.now();n.Mfb||!n.lgb()||n.ugb()?n.Tfb=e:(n.Pfb+=e-(null!==(t=n.Tfb)&&void 0!==t?t:e),n.Tfb=e,n.Pfb>=n.config.viewableDurationMs&&n.sgb(o.AdTrackingEventTrigger.VIEWABLE))},this.Rfb=new r.PausableTimeout(this.config.decisionTimeoutMs,this.ggb)}return t.prototype.start=function(){this.Mfb||(this.pgb()?(this.Ofb=this.ogb(),this.Nfb=Boolean(this.context.internalPlayer.getVisibility().isVisible),this.ngb(),this.context.eventHandler.on(n.PlayerEvent.VisibilityChanged,this.egb),this.context.eventHandler.on(n.PlayerEvent.Paused,this.hgb),this.context.eventHandler.on(n.PlayerEvent.Playing,this.igb),this.context.eventHandler.on(n.PlayerEvent.StallStarted,this.jgb),this.context.eventHandler.on(n.PlayerEvent.StallEnded,this.kgb),document.addEventListener("visibilitychange",this.fgb,{passive:!0}),this.Rfb.start(),this.Tfb=Date.now(),this.Pfb=0,this.Qfb=window.setInterval(this.mgb,250)):this.sgb(o.AdTrackingEventTrigger.VIEW_UNDETERMINED))},t.prototype.lgb=function(){return this.Nfb&&this.Ofb},t.prototype.ngb=function(){this.Nfb&&this.Ofb||(this.Pfb=0)},t.prototype.ogb=function(){return"string"==typeof document.visibilityState?"visible"===document.visibilityState:"boolean"==typeof document.hidden&&!document.hidden},t.prototype.pgb=function(){var t,e;return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.addEventListener&&"function"==typeof document.removeEventListener&&("string"==typeof document.visibilityState||"boolean"==typeof document.hidden)&&Boolean(null===(t=this.context.eventHandler)||void 0===t?void 0:t.on)&&Boolean(null===(e=this.context.eventHandler)||void 0===e?void 0:e.off)},t.prototype.qgb=function(t){if(!this.Sfb[t]){var e=!this.ugb();this.Sfb[t]=!0,e&&this.Rfb.pause()}},t.prototype.rgb=function(t){this.Sfb[t]&&(this.Sfb[t]=!1,this.ugb()||this.Rfb.resume())},t.prototype.sgb=function(t){this.Mfb||(this.Mfb=!0,this.tgb(),this.onDecision(t))},t.prototype.tgb=function(){this.context.eventHandler.off(n.PlayerEvent.VisibilityChanged,this.egb),this.context.eventHandler.off(n.PlayerEvent.Paused,this.hgb),this.context.eventHandler.off(n.PlayerEvent.Playing,this.igb),this.context.eventHandler.off(n.PlayerEvent.StallStarted,this.jgb),this.context.eventHandler.off(n.PlayerEvent.StallEnded,this.kgb),document.removeEventListener("visibilitychange",this.fgb),null!==this.Qfb&&(window.clearInterval(this.Qfb),this.Qfb=null,this.Tfb=null),this.Rfb.pause()},t.prototype.reset=function(){this.tgb(),this.Mfb=!1,this.Pfb=0,this.Sfb.paused=!1,this.Sfb.stalled=!1,this.Rfb.reset()},t.prototype.ugb=function(){return this.Sfb.paused||this.Sfb.stalled},t.prototype.dispose=function(){this.tgb(),this.Rfb.dispose()},t}();e.ViewabilityTracker=s},22705:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultCustomAttributesMapping=void 0;var n=i(61933),r=i(28038),o=function(t,e){if(e&&0!==e.length)for(var i=function(e,i){i.urls&&i.urls.length>0&&t.tracking.register(e,[{urls:i.urls,offset:i.offset}])},n=0,o=e;n<o.length;n++){var s=o[n];switch(s.type){case r.AdTrackingEventTrigger.CLICKED:i(r.AdTrackingEventTrigger.CLICKED,s);break;case r.AdTrackingEventTrigger.IMPRESSION:i(r.AdTrackingEventTrigger.IMPRESSION,s);break;case r.AdTrackingEventTrigger.COMPLETE:i(r.AdTrackingEventTrigger.COMPLETE,s);break;case r.AdTrackingEventTrigger.START:i(r.AdTrackingEventTrigger.START,s);break;case r.AdTrackingEventTrigger.FIRST_QUARTILE:i(r.AdTrackingEventTrigger.FIRST_QUARTILE,s);break;case r.AdTrackingEventTrigger.MIDPOINT:i(r.AdTrackingEventTrigger.MIDPOINT,s);break;case r.AdTrackingEventTrigger.THIRD_QUARTILE:i(r.AdTrackingEventTrigger.THIRD_QUARTILE,s);break;case r.AdTrackingEventTrigger.PAUSE:i(r.AdTrackingEventTrigger.PAUSE,s);break;case r.AdTrackingEventTrigger.RESUME:i(r.AdTrackingEventTrigger.RESUME,s);break;case r.AdTrackingEventTrigger.MUTE:i(r.AdTrackingEventTrigger.MUTE,s);break;case r.AdTrackingEventTrigger.UNMUTE:i(r.AdTrackingEventTrigger.UNMUTE,s);break;case r.AdTrackingEventTrigger.ERROR:i(r.AdTrackingEventTrigger.ERROR,s);break;case r.AdTrackingEventTrigger.LOADED:i(r.AdTrackingEventTrigger.LOADED,s);break;case r.AdTrackingEventTrigger.PROGRESS:i(r.AdTrackingEventTrigger.PROGRESS,s);break;case r.AdTrackingEventTrigger.SKIP:i(r.AdTrackingEventTrigger.SKIP,s);break;case r.AdTrackingEventTrigger.VIEWABLE:i(r.AdTrackingEventTrigger.VIEWABLE,s);break;case r.AdTrackingEventTrigger.NOT_VIEWABLE:i(r.AdTrackingEventTrigger.NOT_VIEWABLE,s);break;case r.AdTrackingEventTrigger.VIEW_UNDETERMINED:i(r.AdTrackingEventTrigger.VIEW_UNDETERMINED,s)}}};e.defaultCustomAttributesMapping=function(t,e){var i,r=null===(i=t.customAttributes)||void 0===i?void 0:i[n.AD_CREATIVE_SIGNALING_KEY];if(r){o(e,r.tracking);for(var s=0,a=function(t){return t?Array.isArray(t)?t:[t]:[]}(r.payload);s<a.length;s++){var l=a[s];l.clickThrough&&!e.clickThroughUrl&&(e.clickThroughUrl=l.clickThrough),o(e,l.tracking)}}}},3093:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.fireSgaiAdError=function(t,e,i,a){var l={code:e};i&&(l.message=i);var u=function(t){if(t instanceof r.PlayerError||(null==t?void 0:t.type)===o.PlayerEvent.Error){var e=t;return{code:e.code,name:e.name,message:e.message,data:e.data}}}(a);u&&(l.deficiencyData=u),t.internalPlayer.fireEvent(o.PlayerEvent.AdError,{code:n.ErrorCode.MODULE_SGAI_ERROR,name:n.ErrorCode[n.ErrorCode.MODULE_SGAI_ERROR],data:l,message:i,troubleShootLink:(0,s.generateTroubleshootUrl)(n.ErrorCode.MODULE_SGAI_ERROR)})};var n=i(40306),r=i(3336),o=i(3714),s=i(51289)},68856:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.fireSgaiWarning=function(t,e,i){t.internalPlayer.fireEvent(r.PlayerEvent.Warning,new n.PlayerWarning(e,i))};var n=i(25926),r=i(3714)}},function(t){return function(){return t(60047)}()}])});
|
|
17
|
+
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sgai=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.sgai=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[283],{70600:function(t,e){var i=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.AssetListError=void 0,e.isAssetListError=function(t){return t instanceof Error&&"number"==typeof t.sgaiErrorCode};var n=function(t){function e(e,i){var n=t.call(this,i)||this;return n.sgaiErrorCode=e,n.message=null!=i?i:"",n}return i(e,t),e}(Error);e.AssetListError=n},41906:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsAssetListLoader=void 0;var o=i(20213),s=i(4129),a=i(77401),l=i(70600),u=i(6505),c=i(10619);function d(t,e){var i,n;try{n=JSON.parse(e)}catch(e){throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_INVALID,"Invalid asset list from ".concat(t,": malformed JSON (").concat(null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"unknown reason",")"))}if(!n||!Array.isArray(n.ASSETS))throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_INVALID,"Invalid asset list from ".concat(t,": missing or invalid ASSETS array"));return{assets:n.ASSETS.map(function(t){return{uri:t.URI,duration:t.DURATION,customAttributes:(0,u.extractUnknownAttributes)(t,["URI","DURATION"])}}),customAttributes:(0,u.extractUnknownAttributes)(n,["ASSETS"])}}var g=function(){function t(t){this.y8=new s.DefaultContentLoader(t,{maxRetries:t.settings.MAX_RETRIES,retryDelay:t.settings.RETRY_DELAY,requestType:o.HttpRequestType.HLS_INTERSTITIALS_ASSET_LIST})}return t.prototype.load=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(i){switch(i.label){case 0:this.z8=t,e=this.B8(t),this.A8=e,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,e];case 2:return[2,i.sent()];case 3:return this.A8===e&&(this.A8=void 0,this.z8=void 0),[7];case 4:return[2]}})})},t.prototype.B8=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(i){switch(i.label){case 0:return[4,this.M9(t)];case 1:return null===(e=i.sent())?[2,{assets:[]}]:[2,d(t,e)]}})})},t.prototype.M9=function(t){return n(this,void 0,void 0,function(){var e,i,n,o;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.y8.load(t)];case 1:return e=r.sent(),[3,3];case 2:if((null==(i=r.sent())?void 0:i.message)===a.RequestError.Canceled)throw i;throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_LOAD_FAILED,"Failed to load asset list from ".concat(t,": ").concat(function(t){var e,i=t;if("number"==typeof(null==i?void 0:i.status)){var n=i.statusText?" ".concat(i.statusText):"";return"HTTP ".concat(i.status).concat(n)}return null!==(e=null==t?void 0:t.message)&&void 0!==e?e:"network or HTTP error"}(i)));case 3:if(null==(n=e.body))return[2,null];if("string"!=typeof n)throw new l.AssetListError(c.SgaiErrorCode.INTERSTITIAL_ASSET_LIST_INVALID,"Invalid asset list from ".concat(t,": unexpected response body of type ").concat(typeof n));return[2,(o=n.trim()).length>0?o:null]}})})},t.prototype.isLoading=function(){return void 0!==this.A8||this.y8.isLoading()},t.prototype.getCurrentLoadingUrl=function(){return this.z8},t.prototype.getCurrentLoadingPromise=function(){return this.A8},t.prototype.cancel=function(){this.y8.cancel(),this.z8=void 0},t.prototype.dispose=function(){this.A8=void 0,this.z8=void 0,this.y8.dispose()},t}();e.HlsAssetListLoader=g},57562:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsAssetLoader=void 0;var o=i(80813),s=i(20213),a=i(4129),l=function(){function t(t){this.context=t,this.Q9=new a.DefaultContentLoader(t,{maxRetries:t.settings.MAX_MPD_RETRIES,retryDelay:t.settings.MPD_RETRY_DELAY,requestType:s.HttpRequestType.MANIFEST_HLS_MASTER})}return t.prototype.load=function(t){return n(this,void 0,void 0,function(){var e,i;return r(this,function(n){switch(n.label){case 0:return(e=this.context.serviceManager.maybeCall(o.ServiceName.ManifestCachingService,function(e){return e.getHttpResponse(t)}))?[2,e]:[4,this.Q9.load(t)];case 1:return i=n.sent(),this.context.serviceManager.maybeCall(o.ServiceName.ManifestCachingService,function(e){return e.cacheHttpResponse(i,t)}),[2,i]}})})},t.prototype.isLoading=function(){return this.Q9.isLoading()},t.prototype.dispose=function(){this.Q9.dispose()},t}();e.HlsAssetLoader=l},62843:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialCustomAttributesMappingRegistry=void 0;var i=function(){function t(t){this.trackingRegistry=t}return Object.defineProperty(t.prototype,"tracking",{get:function(){return this.trackingRegistry},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clickThroughUrl",{get:function(){return this.Sfb},set:function(t){this.Sfb=t},enumerable:!1,configurable:!0}),t}();e.HlsInterstitialCustomAttributesMappingRegistry=i},59990:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialMappingRegistry=void 0;var i=function(){function t(){this.Tfb=new Map}return t.prototype.register=function(t,e){var i=this.Tfb.has(t)?this.Tfb.get(t):[];i.push.apply(i,e),this.Tfb.set(t,i)},t.prototype.getTrackingEventsForTrigger=function(t){var e;return null!==(e=this.Tfb.get(t))&&void 0!==e?e:[]},t.prototype.removeTrackingEventForTrigger=function(t,e){var i=this.Tfb.get(t);i&&this.Tfb.set(t,i.filter(function(t){return t!==e}))},t.prototype.clearTrackingEventsForTrigger=function(t){this.Tfb.delete(t)},t.prototype.clear=function(){this.Tfb.clear()},t}();e.HlsInterstitialMappingRegistry=i},10603:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialsAdTracker=void 0;var r=i(89927),o=i(70850),s=i(62843),a=i(59990),l=i(39521),u=i(1951),c=i(28038),d=i(13117),g=1/0,h=function(t){function e(e,i){var n=t.call(this,i)||this;return n.context=e,n.playerDelegate=i,n.registry=new a.HlsInterstitialMappingRegistry,n.R9=new s.HlsInterstitialCustomAttributesMappingRegistry(n.registry),n}return n(e,t),e.prototype.getClickThroughUrl=function(){return this.R9.clickThroughUrl},e.prototype.startTrackingAd=function(e,i){var n=this;t.prototype.startTrackingAd.call(this,e,i),this.R9.clickThroughUrl=void 0;var r=(0,l.getHlsCustomAttributesMappingFunction)(this.context);if(r){var s=(0,l.prepareInterstitialDataForMapping)(e);s&&(0,o.safeUserCallback)(function(){return r(s,n.R9)},this.context.logger);var a=(0,l.prepareInterstitialAssetDataForMapping)(i);a&&(0,o.safeUserCallback)(function(){return r(a,n.R9)},this.context.logger)}this.T9(i.duration)},e.prototype.started=function(){var e;t.prototype.started.call(this),null===(e=this.S9)||void 0===e||e.start()},e.prototype.reset=function(){var e;null===(e=this.S9)||void 0===e||e.reset(),this.S9=void 0,t.prototype.reset.call(this)},e.prototype.dispose=function(){var e;null===(e=this.S9)||void 0===e||e.dispose(),this.S9=void 0,t.prototype.dispose.call(this)},e.prototype.T9=function(t){var e,i,n=this;if(this.U9()&&this.V9()){var r=null===(i=null===(e=this.context.config.hls)||void 0===e?void 0:e.interstitials)||void 0===i?void 0:i.viewability;this.S9=new d.ViewabilityTracker(this.context,{viewableDurationMs:f(null==r?void 0:r.viewableDuration,2),decisionTimeoutMs:f(null==r?void 0:r.decisionTimeout,t||g)},function(t){n.pingTrackingUrls(t)})}},e.prototype.U9=function(){var t,e;return Boolean(null===(e=null===(t=this.context.config.style)||void 0===t?void 0:t.visibility)||void 0===e?void 0:e.enableTracking)},e.prototype.V9=function(){var t=this;return[c.AdTrackingEventTrigger.VIEWABLE,c.AdTrackingEventTrigger.NOT_VIEWABLE,c.AdTrackingEventTrigger.VIEW_UNDETERMINED].some(function(e){return t.registry.getTrackingEventsForTrigger(e).length>0})},e}(u.SgaiAdTracker);function f(t,e){var i="number"==typeof t&&Number.isFinite(t)?t:e;return(0,r.toMilliSeconds)(Math.max(0,i))}e.HlsInterstitialsAdTracker=h},39521:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.shouldEnableHlsAdTracking=function(t){var e,i,n,o,a=null===(i=null===(e=t.config.hls)||void 0===e?void 0:e.interstitials)||void 0===i?void 0:i.customAttributesMapping;if((0,r.isDefined)(a))return!0;var l=null===(o=null===(n=t.config.hls)||void 0===n?void 0:n.interstitials)||void 0===o?void 0:o.customAttributesMappingPreset;return!!(0,r.isDefined)(l)&&l!==s.CustomAttributesMappingPresets.NONE},e.getHlsCustomAttributesMappingFunction=function(t){var e,i=null===(e=t.config.hls)||void 0===e?void 0:e.interstitials;return(null==i?void 0:i.customAttributesMapping)&&"function"==typeof i.customAttributesMapping?i.customAttributesMapping:(null==i?void 0:i.customAttributesMappingPreset)===s.CustomAttributesMappingPresets.AD_CREATIVE_SIGNALING?o.defaultCustomAttributesMapping:null},e.prepareInterstitialDataForMapping=function(t){if((0,r.isDefined)(t.adCreativeSignaling)||(0,r.isDefined)(t.customAdTrackingInfo)){var e={id:t.id,customAttributes:n({},t.customAdTrackingInfo)};return t.adCreativeSignaling&&(e.customAttributes[a.AD_CREATIVE_SIGNALING_KEY]=t.adCreativeSignaling),e}},e.prepareInterstitialAssetDataForMapping=function(t){var e;if((0,r.isDefined)(t.adCreativeSignaling)||(0,r.isDefined)(t.customAdTrackingInfo)){var i={duration:t.duration,uri:null!==(e=t.mediaFileUrl)&&void 0!==e?e:"",customAttributes:n({},t.customAdTrackingInfo)};return t.adCreativeSignaling&&(i.customAttributes[a.AD_CREATIVE_SIGNALING_KEY]=t.adCreativeSignaling),i}};var r=i(23068),o=i(22705),s=i(6742),a=i(61933)},6742:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.CustomAttributesMappingPresets=void 0,function(t){t.NONE="NONE",t.AD_CREATIVE_SIGNALING="AD-CREATIVE-SIGNALING"}(i||(e.CustomAttributesMappingPresets=i={}))},2423:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},s=this&&this.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialsProvider=void 0;var a=i(6365),l=i(4224),u=i(3714),c=i(58735),d=i(85625),g=i(77401),h=i(44468),f=i(81199),p=i(85434),v=i(23068),y=i(70850),b=i(70600),T=i(3093),A=i(68856),E=i(41906),S=i(57562),I=i(65007),P=i(61933),N=i(6505),m=i(60841),k=i(43661),_=function(){function t(t){var e,i,n=this;this.context=t,this.BN=new Map([["ASSET-LIST",new Map],["ASSET",new Map]]),this.MN=function(t){if(n.NN(t)){var e=function(t){var e,i=(0,N.resolveRestrictValue)(t.metadata.clientAttributes.restrict),n=(0,N.resolveTriggerPolicy)(t.metadata.cue);return{id:t.metadata.id,start:t.start,end:null!==(e=t.end)&&void 0!==e?e:t.start+1,duration:t.metadata.duration,plannedDuration:t.metadata.plannedDuration,assetUri:t.metadata.clientAttributes.assetUri,assetListUri:t.metadata.clientAttributes.assetList,playoutLimit:t.metadata.clientAttributes.playoutLimit,resumeOffset:t.metadata.clientAttributes.resumeOffset,restrict:i,hasBeenPlayed:!1,jumpPolicy:(0,N.convertRestrictionToJumpPolicy)(i),seekingRestriction:(0,N.convertRestrictionToSeekingRestriction)(i),triggerPolicy:n,customAttributes:L(t)}}(t);n.pM.add(e)}},this.pM=new I.HlsInterstitialsQueue(t),this.AN=null===(i=null===(e=t.config)||void 0===e?void 0:e.hls)||void 0===i?void 0:i.interstitials,this.context.eventHandler.on(u.PlayerEvent.MetadataParsed,this.MN)}return t.prototype.getAdPosition=function(t){var e,i;return(0,N.isHlsInterstitialAd)(t)&&(null===(e=t.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.PRE))?m.SgaiAdPosition.PREROLL:(0,N.isHlsInterstitialAd)(t)&&(null===(i=t.triggerPolicy)||void 0===i?void 0:i.includes(P.TriggerPolicy.POST))?m.SgaiAdPosition.POSTROLL:m.SgaiAdPosition.MIDROLL},t.prototype.getDueAds=function(t){return this.pM.getForTime(t)},t.prototype.getPreRollAds=function(){return this.pM.getUnplayedInterstitials().filter(function(t){var e;return null===(e=t.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.PRE)})},t.prototype.getPostRollAds=function(){return this.pM.getUnplayedInterstitials().filter(function(t){var e;return null===(e=t.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.POST)})},t.prototype.handleSkippedAds=function(t,e){var i=this.pM.getAdsInRange(t,e);if(0===i.length)return[];var n=(0,N.shouldPlayJumpedOverInterstitials)(i,t,e,this.context);n.length>0&&this.context.logger.debug("Playing ".concat(n.length," jump-restricted ads"));for(var r=0,o=i;r<o.length;r++){var s=o[r];n.includes(s)||this.markAdAsPlayed(s)}return n},t.prototype.listUnplayedAds=function(){return this.pM.getUnplayedInterstitials().map(x)},t.prototype.markAdAsPlayed=function(t){t.hasBeenPlayed=!0},t.prototype.markPastAdsAsPlayed=function(t){var e=this.pM.getAdsInRange(0,t-2);if(0!==e.length){this.context.logger.debug("Marking ".concat(e.length," past interstitials as played on playback start"));for(var i=0,n=e;i<n.length;i++){var r=n[i];r.hasBeenPlayed||this.markAdAsPlayed(r)}}},t.prototype.reinsertAds=function(t){for(var e,i,n=0,r=this.pM.getAll();n<r.length;n++){var o=r[n];o.hasBeenPlayed&&o.start>t&&!(null===(e=o.triggerPolicy)||void 0===e?void 0:e.includes(P.TriggerPolicy.ONCE))&&(o.hasBeenPlayed=!1,o.assetList=void 0,o.isLoadAllowed=void 0,null===(i=this.BN.get("ASSET-LIST"))||void 0===i||i.delete(o.id),this.context.logger.debug("Reinserting interstitial ".concat(o.id," at ").concat(o.start," after backward seek to ").concat(t)))}},t.prototype.resolveRestrictions=function(t){return(0,N.isHlsInterstitialAd)(t)&&t.seekingRestriction===P.SeekingRestriction.NO_SEEKING?{seeking:!0,playbackRate:!0}:{}},t.prototype.clearDroppedOutAds=function(){var t=this,e=(0,k.getDvrWindowStart)(this.context.internalPlayer);isFinite(e)&&this.pM.clearUntil(e).forEach(function(e){t.context.logger.debug("Interstitial with id ".concat(e.id," dropped out of the DVR window"))})},t.prototype.resolveAdCreativeSignaling=function(t){var e;return(0,v.isDefined)(t.assetList)?(0,N.extractUnknownAttributes)(t.assetList,["assets"])[P.AD_CREATIVE_SIGNALING_KEY]:(null===(e=t.customAttributes)||void 0===e?void 0:e.adCreativeSignaling)?JSON.parse(atob(t.customAttributes.adCreativeSignaling)):void 0},t.prototype.EN=function(t){var e;return(0,v.isDefined)(t.assetListUri)&&!t.assetList&&!1!==t.isLoadAllowed&&!(null===(e=this.BN.get("ASSET-LIST"))||void 0===e?void 0:e.get(t.id))},t.prototype.FN=function(t){var e;return(0,v.isDefined)(t)&&(0,k.isHlsManifestUri)(t)&&!(null===(e=this.BN.get("ASSET"))||void 0===e?void 0:e.get(t))},t.prototype.getUpcomingAds=function(t){var e=Math.min((0,f.getPlayableBufferLevel)(this.context.internalPlayer),60);return this.pM.getAdsInRange(t,t+e)},t.prototype.preloadUpcomingAds=function(t){var e,i;if(!(null===(e=this.CN)||void 0===e?void 0:e.isLoading())&&!(null===(i=this.DN)||void 0===i?void 0:i.isLoading()))for(var n=0,r=this.getUpcomingAds(t);n<r.length;n++){var o=r[n];if(this.GN(o))return}},t.prototype.GN=function(t){return this.EN(t)?this.HN(t):this.context.internalPlayer.getPlayerType()!==h.PlayerType.Native&&this.IN(t)},t.prototype.HN=function(t){var e,i=this;return this.context.logger.debug("Preloading ASSET-LIST for upcoming interstitial for time ".concat(t.start,", id ").concat(t.id,", uri ").concat(t.assetListUri)),null===(e=this.BN.get("ASSET-LIST"))||void 0===e||e.set(t.id,!0),this.KN(t).then(function(){return i.context.logger.debug("Preloaded asset list ".concat(t.assetListUri))}).catch(function(e){var n;(null==e?void 0:e.message)!==g.RequestError.Canceled&&(t.assetList={assets:[]}),i.context.logger.debug("Could not preload asset list ".concat(t.assetListUri,": ").concat(null!==(n=null==e?void 0:e.message)&&void 0!==n?n:"Unknown reason"))}),!0},t.prototype.IN=function(t){var e,i,n,r=this;return(0,v.isDefined)(t.assetList)?n=null===(e=t.assetList.assets.find(function(t){return r.FN(t.uri)}))||void 0===e?void 0:e.uri:this.FN(t.assetUri)&&(n=t.assetUri),!!(0,v.isDefined)(n)&&(this.context.logger.debug("Preloading ASSET for upcoming interstitial for time ".concat(t.start,", id ").concat(t.id,", uri ").concat(n)),null===(i=this.BN.get("ASSET"))||void 0===i||i.set(n,!0),this.JN(n).then(function(){return r.context.logger.debug("Preloaded asset URI ".concat(n))}).catch(function(t){var e;r.context.logger.debug("Could not preload asset URI ".concat(n,": ").concat(null!==(e=null==t?void 0:t.message)&&void 0!==e?e:"Unknown reason"))}),!0)},t.prototype.JN=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(i){switch(i.label){case 0:return null!==(e=this.DN)&&void 0!==e||(this.DN=new S.HlsAssetLoader(this.context)),[4,this.DN.load(t)];case 1:return i.sent(),[2]}})})},t.prototype.KN=function(t){return r(this,void 0,void 0,function(){var e,i,r,s,a,u,c,d;return o(this,function(o){switch(o.label){case 0:if(!(0,v.isDefined)(t.assetListUri))throw new Error("Cannot load asset list without assetListUri");if((0,v.isDefined)(t.isLoadAllowed)||(t.isLoadAllowed=function(t,e,i){var r;return!(null==i?void 0:i.shouldLoadInterstitial)||null===(r=(0,y.safeUserCallback)(function(){return i.shouldLoadInterstitial(n({},t))},e))||void 0===r||r}(t,this.context.logger,this.AN)),!t.isLoadAllowed)throw new Error("Not allowed to load based on user feedback");return null!==(d=this.CN)&&void 0!==d||(this.CN=new E.HlsAssetListLoader(this.context)),e=this.CN.getCurrentLoadingUrl(),i=this.CN.getCurrentLoadingPromise(),r=void 0!==i,s=e===t.assetListUri,r&&s?(this.context.logger.debug("The asset list for the interstitial with id ".concat(t.id," was already preloading")),a=t,[4,i]):[3,2];case 1:return a.assetList=o.sent(),[2,t.assetList];case 2:return!r||s?[3,4]:(this.context.logger.debug("Interrupting preloading of outdated asset list ".concat(e)),this.CN.cancel(),[4,null==i?void 0:i.catch(function(){})]);case 3:o.sent(),o.label=4;case 4:return o.trys.push([4,6,,7]),u=t,[4,this.CN.load(t.assetListUri)];case 5:return u.assetList=o.sent(),0===t.assetList.assets.length&&(0,A.fireSgaiWarning)(this.context,l.WarningCode.MODULE_SGAI_WARNING,"Asset list for interstitial ".concat(t.id," contained no ads")),[2,t.assetList];case 6:throw c=o.sent(),this.LN(t,c),c;case 7:return[2]}})})},t.prototype.resolveNestedAds=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(i){switch(i.label){case 0:if(!(0,v.isDefined)(t.assetListUri))return[3,6];i.label=1;case 1:return i.trys.push([1,4,,5]),(0,v.isDefined)(t.assetList)?[3,3]:(this.context.logger.debug("Loading asset list with id ".concat(t.id," from URI ").concat(t.assetListUri)),[4,this.KN(t)]);case 2:i.sent(),this.context.logger.debug("Asset list loaded for ".concat(t.id)),i.label=3;case 3:return[3,5];case 4:return(null==(e=i.sent())?void 0:e.message)!==g.RequestError.Canceled&&(t.assetList={assets:[]}),[2,[]];case 5:return[2,w(t)];case 6:return(0,v.isDefined)(t.assetUri)?[2,w(t)]:(this.context.logger.debug("No assetUri or assetListUri found for interstitial with id ".concat(t.id)),[2,[]]);case 7:return[2]}})})},t.prototype.shouldPlayAd=function(t){var e=function(t,e,i){var r;return!(null==i?void 0:i.shouldPlayInterstitial)||null===(r=(0,y.safeUserCallback)(function(){return i.shouldPlayInterstitial(n({},t))},e))||void 0===r||r}(t,this.context.logger,this.AN);return e||this.context.logger.debug("Skipping playing interstitial with id ".concat(t.id," based on user feedback")),e},t.prototype.LN=function(t,e){var i;(0,b.isAssetListError)(e)?(this.context.logger.debug("Failed to resolve asset list for interstitial with id ".concat(t.id),e),(0,T.fireSgaiAdError)(this.context,e.sgaiErrorCode,e.message)):this.context.logger.debug("Could not resolve asset list with id ".concat(t.id,", uri ").concat(t.assetListUri,": ").concat(null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"Unknown reason"))},t.prototype.getReplaceContentDuration=function(t,e){return(0,v.isDefined)(t.resumeOffset)?t.resumeOffset:this.getTotalPlannedDuration(t,e)},t.prototype.getTotalPlannedDuration=function(t,e){return(0,v.isDefined)(t.playoutLimit)?t.playoutLimit:(0,N.calculateInterstitialDuration)(t,e)},t.prototype.getTotalPlayoutLimit=function(t){if((0,v.isDefined)(t.playoutLimit))return t.playoutLimit},t.prototype.NN=function(t){return(0,c.isDateRangeMetadata)(t)&&"com.apple.hls.interstitial"===t.metadata.class},t.prototype.getQueuedInterstitials=function(){return this.pM.getAll()},t.prototype.dispose=function(){var t,e,i,n;this.context.eventHandler.off(u.PlayerEvent.MetadataParsed,this.MN),null===(t=this.CN)||void 0===t||t.dispose(),null===(e=this.DN)||void 0===e||e.dispose(),null===(i=this.BN.get("ASSET-LIST"))||void 0===i||i.clear(),null===(n=this.BN.get("ASSET"))||void 0===n||n.clear()},t}();function L(t){for(var e={},i=0,n=Object.entries(t.metadata.clientAttributes);i<n.length;i++){var r=n[i],o=r[0],s=r[1];P.KNOWN_CLIENT_ATTRIBUTES.includes(o)||(e[o]=s)}return e}function w(t){return(0,v.isDefined)(t.assetList)?t.assetList.assets.map(function(e,i){var n;return R("".concat(t.id,"-").concat(i),e.uri,e.duration,null===(n=e.customAttributes)||void 0===n?void 0:n[P.AD_CREATIVE_SIGNALING_KEY])}):(0,v.isDefined)(t.assetUri)?[R("".concat(t.id,"-0"),t.assetUri,t.end-t.start)]:[]}function R(t,e,i,n){var r=e.toLowerCase(),o=(0,k.isProgressiveMediaUrl)(r);return{id:t,isLinear:!0,width:0,height:0,duration:i,mediaFileUrl:e,adCreativeSignaling:n,data:{delivery:o?a.MediaFileDeliveryType.Progressive:a.MediaFileDeliveryType.Streaming,mimeType:o?p.MimeType.VideoMp4:d.ManifestMimeType.Hls}}}function x(t){var e=t;return e.isLoadAllowed,e.hasBeenPlayed,s(e,["isLoadAllowed","hasBeenPlayed"])}e.HlsInterstitialsProvider=_},65007:function(t,e,i){var n=this&&this.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i},r=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r<o;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.HlsInterstitialsQueue=void 0;var o=i(74853),s=i(61933),a=function(){function t(t){this.context=t,this.N9=[]}return t.prototype.add=function(t){this.P9(t)?this.O9(t):(this.context.logger.debug("Adding HLS interstitial to queue at start time ".concat(t.start),t),o.ArrayHelper.insertInSortedArray(this.N9,t,function(e){return e.start>t.start}))},t.prototype.O9=function(t){var e=this.N9.findIndex(function(e){return e.id===t.id});if(-1!==e){this.context.logger.debug("Updating HLS interstitial with id at start time ".concat(t.start),t);var i=this.N9[e],r=(t.id,t.start,t.hasBeenPlayed,t.isLoadAllowed,n(t,["id","start","hasBeenPlayed","isLoadAllowed"]));Object.assign(i,r)}else this.context.logger.debug("Interstitial to update was not found")},t.prototype.clearUntil=function(t){return o.ArrayHelper.removeUntilInSortedArray(this.N9,function(e){return e.end>t})},t.prototype.hasDueAds=function(t){var e=this.getUnplayedInterstitials();return e.length>0&&e[0].start<=t},t.prototype.getForTime=function(t){for(var e=[],i=function(i){return i.start>t?"break":[s.TriggerPolicy.PRE,s.TriggerPolicy.POST].some(function(t){var e;return null===(e=i.triggerPolicy)||void 0===e?void 0:e.includes(t)})?"continue":void(t>=i.start&&t<=i.end&&e.push(i))},n=0,r=this.getUnplayedInterstitials();n<r.length&&"break"!==i(r[n]);n++);return e},t.prototype.getAdsInRange=function(t,e){for(var i=[],n=function(n){return n.start>e?"break":[s.TriggerPolicy.PRE,s.TriggerPolicy.POST].some(function(t){var e;return null===(e=n.triggerPolicy)||void 0===e?void 0:e.includes(t)})?"continue":void(n.start>=t&&n.start<=e&&i.push(n))},r=0,o=this.getUnplayedInterstitials();r<o.length&&"break"!==n(o[r]);r++);return i},t.prototype.getAll=function(){return r([],this.N9,!0)},t.prototype.getUnplayedInterstitials=function(){return this.N9.filter(function(t){return!t.hasBeenPlayed})},t.prototype.P9=function(t){return this.N9.some(function(e){return e.id===t.id})},t}();e.HlsInterstitialsQueue=a},61933:function(t,e){var i,n,r,o;Object.defineProperty(e,"__esModule",{value:!0}),e.TriggerPolicy=e.JumpPolicy=e.SeekingRestriction=e.RestrictValue=e.KNOWN_CLIENT_ATTRIBUTES=e.AD_CREATIVE_SIGNALING_KEY=void 0,e.AD_CREATIVE_SIGNALING_KEY="X-AD-CREATIVE-SIGNALING",e.KNOWN_CLIENT_ATTRIBUTES=["assetUri","assetList","playoutLimit","resumeOffset","restrict"],function(t){t.SKIP="SKIP",t.JUMP="JUMP"}(i||(e.RestrictValue=i={})),function(t){t.NO_SEEKING="NO_SEEKING"}(n||(e.SeekingRestriction=n={})),function(t){t.ALLOW="ALLOW",t.RESTRICT="RESTRICT"}(r||(e.JumpPolicy=r={})),function(t){t.PRE="PRE",t.POST="POST",t.ONCE="ONCE"}(o||(e.TriggerPolicy=o={}))},6505:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.extractUnknownAttributes=void 0,e.calculateInterstitialDuration=function(t,e){if(t.duration&&t.duration>0)return t.duration;if(t.plannedDuration&&t.plannedDuration>0)return t.plannedDuration;var i=e.reduce(function(t,e){return t+e.duration},0);if(i>0)return i;var n=t.end-t.start;return Math.max(n,0)},e.resolveRestrictValue=function(t){if(t){var e=(Array.isArray(t)?t.map(function(t){return t.trim().toUpperCase()}):t.split(",").map(function(t){return t.trim().toUpperCase()})).map(function(t){return Object.values(o.RestrictValue).find(function(e){return e===t})}).filter(function(t){return void 0!==t});return e.length>0?e:void 0}},e.convertRestrictionToSeekingRestriction=function(t){if(null==t?void 0:t.includes(o.RestrictValue.SKIP))return o.SeekingRestriction.NO_SEEKING},e.convertRestrictionToJumpPolicy=function(t){return(null==t?void 0:t.includes(o.RestrictValue.JUMP))?o.JumpPolicy.RESTRICT:o.JumpPolicy.ALLOW},e.resolveTriggerPolicy=function(t){if(!t)return[];var e=t.split(","),i=[];return e.includes("PRE")&&i.push(o.TriggerPolicy.PRE),e.includes("POST")&&i.push(o.TriggerPolicy.POST),e.includes("ONCE")&&i.push(o.TriggerPolicy.ONCE),i},e.isHlsInterstitialAd=s,e.getJumpRestrictedHlsInterstitials=a,e.shouldPlayJumpedOverInterstitials=function(t,e,i,o){var s,l,u=null===(l=null===(s=o.config)||void 0===s?void 0:s.hls)||void 0===l?void 0:l.interstitials;if(null==u?void 0:u.shouldPlayJumpedOverInterstitials){var c=t.map(function(t){return n({},t)}),d=(0,r.safeUserCallback)(function(){return u.shouldPlayJumpedOverInterstitials(c,e,i)},o.logger);if(d){var g=d.map(function(t){return t.id});return o.logger.debug("Playing interstitials selected by shouldPlayJumpedOverInterstitials: ".concat(g)),t.filter(function(t){return g.includes(t.id)})}}var h=function(t){return t[t.length-1]}(a(t));return h?[h]:[]};var r=i(70850),o=i(61933);function s(t){return"object"==typeof t&&null!==t&&"id"in t&&("scheduleTime"in t||"start"in t)}function a(t){return function(t){return t.filter(s)}(t).filter(function(t){return t.jumpPolicy===o.JumpPolicy.RESTRICT})}e.extractUnknownAttributes=function(t,e){return Object.keys(t).reduce(function(i,n){return e.includes(n)||(i[n]=t[n]),i},{})}},60047:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SGAIModuleDefinition=void 0;var n=i(62756),r=i(91135);e.SGAIModuleDefinition={name:n.ModuleName.SGAI,module:function(){return{SgaiService:r.SgaiService}},dependencies:[n.ModuleName.AdvertisingCore]},e.default=e.SGAIModuleDefinition},84770:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.PausableTimeout=void 0;var i=function(){function t(t,e){var i=this;this.durationMs=t,this.callback=e,this.nib=null,this.oib=null,this.qib=!1,this.rib=function(){i.qib||(i.nib=null,i.oib=null,i.pib=0,i.callback())},this.pib=Math.max(0,t)}return t.prototype.start=function(){this.qib||null!==this.nib||(this.pib<=0?this.rib():(this.oib=Date.now(),this.nib=window.setTimeout(this.rib,this.pib)))},t.prototype.pause=function(){if(null!==this.nib&&null!==this.oib){var t=Date.now()-this.oib;this.pib=Math.max(0,this.pib-t),window.clearTimeout(this.nib),this.nib=null,this.oib=null}},t.prototype.resume=function(){this.start()},t.prototype.reset=function(t){void 0===t&&(t=this.durationMs),null!==this.nib&&window.clearTimeout(this.nib),this.nib=null,this.oib=null,this.pib=Math.max(0,t)},t.prototype.dispose=function(){this.reset(),this.qib=!0},t}();e.PausableTimeout=i},71734:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiAdPlayer=e.DEFAULT_ASSET_LOAD_TIMEOUT=void 0;var o=i(43255),s=i(86969),a=i(3714),l=i(90408),u=i(34841),c=i(89927),d=i(88844),g=i(23068),h=i(3093),f=i(10603),p=i(39521),v=i(10619),y=i(43661);e.DEFAULT_ASSET_LOAD_TIMEOUT=10;var b=function(){function t(t){var e=this;this.context=t,this.QN=null,this.RN=null,this.SN=null,this.TN=null,this.UN=null,this.VN=0,this.WN=null,this.XN=null,this.ZN=!1,this.gN=function(){var t;e.cN(),null===(t=e.PN)||void 0===t||t.setPaused(!1)},this.hN=function(){var t;e.cN(),null===(t=e.PN)||void 0===t||t.setPaused(!0)},this.iN=function(t){return n(e,void 0,void 0,function(){var e;return r(this,function(i){return null===(e=this.PN)||void 0===e||e.progress(t.time),this.jN(t.time)&&this.fN(!0),[2]})})},this.nN=function(){return n(e,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return this.context.logger.debug("Finished SGAI ad playback"),null===(t=this.PN)||void 0===t||t.complete(),[4,this.fN()];case 1:return e.sent(),[2]}})})},this.oN=function(t){e.context.logger.debug("SGAI ad player error",t),e.pN(v.SgaiErrorCode.INTERSTITIAL_ASSET_PLAYBACK_FAILED,t)},this.ON=new o.AdPlayerDelegate({context:t,internalPlayer:t.internalPlayer,restoreContentDeferred:new u.Deferred}),(0,y.isPlayingHls)(t)&&(0,p.shouldEnableHlsAdTracking)(t)&&(this.PN=new f.HlsInterstitialsAdTracker(this.context,this.ON))}return t.prototype.playAdBreak=function(t,e){return n(this,void 0,void 0,function(){var i,n,o,s,a,l,u;return r(this,function(r){switch(r.label){case 0:return[4,this.dN(!1,this.RN)];case 1:r.sent(),this.WN=t,this.UN=e,r.label=2;case 2:return r.trys.push([2,10,11,13]),i=this,[4,this.ON.requestAdPlayback(t)];case 3:i.RN=r.sent(),n=0,o=t.ads,r.label=4;case 4:if(!(n<o.length))return[3,9];if(s=o[n],this.ZN)return[3,9];if(null==s.id)return this.context.logger.debug("SGAI ad without id detected - skipping playback",s),[3,8];if(this.jN())return[3,8];null===(u=this.PN)||void 0===u||u.startTrackingAd(t,s),this.context.logger.debug("Triggering playback of SGAI ad ".concat(s.id," at time ").concat(t.scheduleTime),s),r.label=5;case 5:return r.trys.push([5,7,,8]),[4,this.aN(s,t.restrictions)];case 6:return r.sent(),this.VN+=s.duration,[3,8];case 7:return a=r.sent(),this.context.logger.debug("Failed to play SGAI ad ".concat(s.id),a),[3,8];case 8:return n++,[3,4];case 9:return[3,13];case 10:return l=r.sent(),this.context.logger.debug("Failed to play SGAI ad break with id ".concat(t.id),l),[3,13];case 11:return[4,this.dN(e.isLastAdBreak,this.RN)];case 12:return r.sent(),[7];case 13:return[2]}})})},t.prototype.skipActiveAd=function(){return this.QN?(this.context.logger.debug("Skipping currently active SGAI ad"),this.fN()):(this.context.logger.debug("No active SGAI ad to skip"),Promise.resolve())},t.prototype.getActiveAd=function(){return this.XN},t.prototype.aN=function(t,e){return n(this,void 0,void 0,function(){var i,n,o,s=this;return r(this,function(r){switch(r.label){case 0:if(!this.RN||this.ZN)throw new Error("No active AdPlaybackAPI available for playback");r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,this.RN.requestPlayer()];case 2:return i=r.sent(),this.QN=i,[4,new Promise(function(n,r){var o;s.SN=n,s.TN=r;var l=function(){return s.TN===r},u=null===(o=s.PN)||void 0===o?void 0:o.getClickThroughUrl();return t.clickThroughUrl=u,t.clickThroughUrlOpened=u?function(){var t;return null===(t=s.PN)||void 0===t?void 0:t.click()}:void 0,i.on(a.PlayerEvent.TimeChanged,s.iN),i.on(a.PlayerEvent.Playing,s.gN),i.on(a.PlayerEvent.Paused,s.hN),i.on(a.PlayerEvent.Muted,function(){var t;return null===(t=s.PN)||void 0===t?void 0:t.setMuted(!0)}),i.on(a.PlayerEvent.Unmuted,function(){var t;return null===(t=s.PN)||void 0===t?void 0:t.setMuted(!1)}),i.on(a.PlayerEvent.PlaybackFinished,s.nN),i.on(a.PlayerEvent.Error,s.oN),s.context.logger.debug("Loading ad ".concat(t.id)),s.XN=t,s.bN(t,l),i.load(t,e).then(function(){s.PN&&l()&&(s.PN.loaded(),s.PN.trackImpression(),s.PN.started())}).catch(function(t){l()&&s.oN(t)})})];case 3:return r.sent(),[3,6];case 4:throw n=r.sent(),o="Error during SGAI ad playback for ".concat(t.id,": ").concat(null==n?void 0:n.message),this.context.logger.debug(o,n),n;case 5:return this.cN(),this.QN=null,this.XN=null,[7];case 6:return[2]}})})},t.prototype.bN=function(t,i){var n=this;this.YN=window.setTimeout(function(){if(n.YN=void 0,i()){var r="SGAI ad ".concat(t.id," did not start playing within ").concat(e.DEFAULT_ASSET_LOAD_TIMEOUT,"s");n.pN(v.SgaiErrorCode.INTERSTITIAL_ASSET_LOAD_TIMEOUT,new Error(r))}},(0,c.toMilliSeconds)(e.DEFAULT_ASSET_LOAD_TIMEOUT))},t.prototype.cN=function(){(0,d.clearTimeoutIfDefined)(this.YN),this.YN=void 0},t.prototype.dN=function(t,e){return n(this,void 0,void 0,function(){var i;return r(this,function(n){switch(n.label){case 0:if(!e)return[3,6];n.label=1;case 1:return n.trys.push([1,4,5,6]),this.ZN?[3,3]:[4,e.done(t)];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:return i=n.sent(),this.context.logger.debug("Error finishing current ad playback",i),[3,6];case 5:return this.QN=null,this.XN=null,this.RN=null,this.SN=null,this.TN=null,[7];case 6:return this.mN(),[2]}})})},t.prototype.eN=function(){return n(this,arguments,void 0,function(t){var e,i;return void 0===t&&(t=!1),r(this,function(n){switch(n.label){case 0:if(this.cN(),!this.QN)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.QN.done(t)];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),this.context.logger.debug("Error calling adPlayer.done()",e),[3,4];case 4:this.QN=null,this.XN=null,n.label=5;case 5:return null===(i=this.PN)||void 0===i||i.reset(),[2]}})})},t.prototype.fN=function(){return n(this,arguments,void 0,function(t){var e;return void 0===t&&(t=!1),r(this,function(i){switch(i.label){case 0:return[4,this.eN(t)];case 1:return i.sent(),e=this.SN,this.SN=null,this.TN=null,null==e||e(),[2]}})})},t.prototype.jN=function(t){var e;void 0===t&&(t=0);var i=null===(e=this.UN)||void 0===e?void 0:e.getPlayoutLimit();if(!(0,g.isDefined)(i))return!1;this.lN(i),this.kN(i);var n=this.VN+t>=i;return n&&this.context.logger.debug("Playout limit (".concat(i,"s) reached for current SGAI ad break")),n},t.prototype.kN=function(t){var e,i=null===(e=this.UN)||void 0===e?void 0:e.getReplaceContentDuration();if(this.WN&&(0,g.isDefined)(i)){var n=this.WN.totalPlannedDuration!==t,r=this.WN.replaceContentDuration!==i;(n||r)&&(this.WN.replaceContentDuration=i,this.WN.totalPlannedDuration=t,this.ON.updateAdRestoreState({adBreakDuration:t,replaceContentDuration:i}))}},t.prototype.lN=function(t){var e,i,n=null!==(i=null===(e=this.XN)||void 0===e?void 0:e.duration)&&void 0!==i?i:0,r=t-this.VN,o=r>0&&r<n;this.XN&&o&&(this.context.logger.debug("Current Ad duration changed from (".concat(n,"s) to (").concat(r,"s) due to playout limit")),(0,l.maybeFireDurationChangedEvent)(n,r,this.context.eventHandler),this.XN.duration=r)},t.prototype.mN=function(){this.WN=null,this.UN=null,this.VN=0},t.prototype.pN=function(t,e){var i,n,r=this.TN;if(!r)return Promise.resolve();this.SN=null,this.TN=null;var o=null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"string"==typeof e?e:void 0;return(0,h.fireSgaiAdError)(this.context,t,o,e),null===(n=this.PN)||void 0===n||n.errorWithCode(String(t)),this.eN().then(function(){return r(e instanceof s.PlayerError||e instanceof Error?e:new Error("AdPlayer failed: ".concat(JSON.stringify(e))))})},t.prototype.dispose=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return this.ZN=!0,this.QN?(this.context.logger.debug("Source was unloaded while SGAI ad was playing"),[4,this.fN()]):[3,2];case 1:e.sent(),e.label=2;case 2:return this.ON.reset(),null===(t=this.PN)||void 0===t||t.dispose(),this.mN(),[2]}})})},t}();e.SgaiAdPlayer=b},1951:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiAdTracker=void 0;var n=i(95217),r=i(3714),o=i(23068),s=i(28038),a=function(){function t(t){this.playerDelegate=t,this.egb=0,this.fgb=[]}return t.prototype.click=function(){var t=this.getClickThroughUrl();t&&this.playerDelegate.adClicked(t),this.pingTrackingUrls(s.AdTrackingEventTrigger.CLICKED)},t.prototype.close=function(){},t.prototype.trackOverlayViewDuration=function(){},t.prototype.complete=function(){this.ggb(100),this.pingTrackingUrls(s.AdTrackingEventTrigger.COMPLETE)},t.prototype.errorWithCode=function(t){this.pingTrackingUrls(s.AdTrackingEventTrigger.ERROR)},t.prototype.loaded=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.LOADED)},t.prototype.progress=function(t){var e=Math.round(100*t)/this.egb;this.ggb(e),this.pingTrackingUrls(s.AdTrackingEventTrigger.PROGRESS,t)},t.prototype.setDuration=function(t){this.egb=t},t.prototype.setFullscreen=function(t){},t.prototype.setMuted=function(t){this.pingTrackingUrls(t?s.AdTrackingEventTrigger.MUTE:s.AdTrackingEventTrigger.UNMUTE)},t.prototype.setPaused=function(t){this.pingTrackingUrls(t?s.AdTrackingEventTrigger.PAUSE:s.AdTrackingEventTrigger.RESUME)},t.prototype.skip=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.SKIP)},t.prototype.started=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.START)},t.prototype.trackImpression=function(){this.pingTrackingUrls(s.AdTrackingEventTrigger.IMPRESSION)},t.prototype.volumeChanged=function(t){},t.prototype.ggb=function(t){var e=this;[r.AdQuartile.FIRST_QUARTILE,r.AdQuartile.MIDPOINT,r.AdQuartile.THIRD_QUARTILE].forEach(function(i){!e.fgb.includes(i)&&t>=function(t){switch(t){case r.AdQuartile.FIRST_QUARTILE:return 25;case r.AdQuartile.MIDPOINT:return 50;case r.AdQuartile.THIRD_QUARTILE:return 75;default:return 100}}(i)&&(e.playerDelegate.onQuartile(i),e.fgb.push(i),e.pingTrackingUrls(i))})},t.prototype.pingTrackingUrls=function(t,e){var i=this;this.registry.getTrackingEventsForTrigger(t).filter(function(t){return!(0,o.isDefined)(e)||!(0,o.isDefined)(t.offset)||Math.round(t.offset)===Math.round(e)}).forEach(function(r){r.urls.forEach(function(t){return(0,n.pingUrl)(t)}),(0,o.isDefined)(e)&&i.registry.removeTrackingEventForTrigger(t,r)})},t.prototype.startTrackingAd=function(t,e){this.egb=e.duration,this.registry.clear(),this.fgb=[]},t.prototype.getClickThroughUrl=function(){},t.prototype.setupWasSuccessful=function(){return(0,o.isDefined)(this.registry)},t.prototype.reset=function(){this.egb=0,this.registry.clear(),this.fgb=[]},t.prototype.dispose=function(){this.reset()},t}();e.SgaiAdTracker=a},28038:function(t,e){var i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AdTrackingEventTrigger=e.SgaiAdType=void 0,function(t){t.LINEAR="linear"}(i||(e.SgaiAdType=i={})),function(t){t.IMPRESSION="impression",t.PAUSE="pause",t.MUTE="mute",t.UNMUTE="unmute",t.RESUME="resume",t.LOADED="loaded",t.START="start",t.PROGRESS="progress",t.FIRST_QUARTILE="firstQuartile",t.MIDPOINT="midpoint",t.THIRD_QUARTILE="thirdQuartile",t.COMPLETE="complete",t.ERROR="error",t.CLICKED="clickTracking",t.SKIP="skip",t.VIEWABLE="viewable",t.NOT_VIEWABLE="notViewable",t.VIEW_UNDETERMINED="viewUndetermined"}(n||(e.AdTrackingEventTrigger=n={}))},10619:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiErrorCode=void 0,function(t){t[t.INTERSTITIAL_ASSET_LIST_INVALID=111]="INTERSTITIAL_ASSET_LIST_INVALID",t[t.INTERSTITIAL_ASSET_LIST_LOAD_FAILED=406]="INTERSTITIAL_ASSET_LIST_LOAD_FAILED",t[t.INTERSTITIAL_ASSET_PLAYBACK_FAILED=407]="INTERSTITIAL_ASSET_PLAYBACK_FAILED",t[t.INTERSTITIAL_ASSET_LOAD_TIMEOUT=408]="INTERSTITIAL_ASSET_LOAD_TIMEOUT"}(i||(e.SgaiErrorCode=i={}))},91135:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiService=void 0;var s=i(80813),a=i(56481),l=i(3714),u=i(44468),c=i(34841),d=i(23068),g=i(2423),h=i(71734),f=i(60841),p=i(43661),v=function(){function t(t){var e=this;this.context=t,this.zj=!1,this.Aj=!1,this.Bj=void 0,this.Cj=!1,this.Fj=function(){var t;null!==(t=e.Dj)&&void 0!==t||(e.Dj=new c.Deferred),e.Dj.resolve()},this.Gj=function(){!e.xj||e.zj||e.Bj||e.xj.markPastAdsAsPlayed(e.context.internalPlayer.getCurrentTime())},this.Hj=function(t){if(e.xj&&!e.zj){e.xj.clearDroppedOutAds();var i=e.context.settings.SGAI_TRIGGER_DELAY_COMPENSATION,n=e.xj.getDueAds(t.time+i);0===n.length?e.Wk(t.time):(e.context.logger.debug("Scheduling playback of SGAI ads at time ".concat(t.time),n),e.Zk(n))}},this.Ij=function(t){var i=n(n({},t),{seekTarget:t.target});e.Kj(i)},this.Jj=function(t){e.Lj(t)},this.Kj=function(t){var i,r;e.xj&&!e.zj&&(e.Yk(),e.Bj=n(n(n({},e.Bj),t),{position:null!==(r=null===(i=e.Bj)||void 0===i?void 0:i.position)&&void 0!==r?r:t.position}),t.seekTarget>=t.position||e.xj.reinsertAds(t.seekTarget))},this.Lj=function(t){if(e.xj&&!e.zj&&e.Bj){var i=e.Bj,n=i.position,r=i.seekTarget;if(e.Bj=void 0,!(r<=n)){var o=e.xj.handleSkippedAds(n,r);if(0!==o.length){e.context.logger.debug("Scheduling playback of ".concat(o.length," SGAI ads on seeking"),o);var s=t.type===l.PlayerEvent.Seeked?0:void 0;e.Zk(o,s)}}}},this.context.logger.debug("Creating SGAI service")}return t.prototype.initialize=function(){this.Aj=!1,this.context.logger.debug("Initializing SGAI service"),(0,p.isPlayingHls)(this.context)&&(this.xj=new g.HlsInterstitialsProvider(this.context),this.context.eventHandler.on(l.PlayerEvent.SourceLoaded,this.Fj),this.context.eventHandler.on(l.PlayerEvent.Playing,this.Gj),this.context.eventHandler.on(l.PlayerEvent.TimeChanged,this.Hj),this.context.eventHandler.on(l.PlayerEvent.Seek,this.Kj),this.context.eventHandler.on(l.PlayerEvent.Seeked,this.Lj),this.context.eventHandler.on(l.PlayerEvent.TimeShift,this.Ij),this.context.eventHandler.on(l.PlayerEvent.TimeShifted,this.Jj))},t.prototype.getSgaiPlayerAPI=function(){var t=this;return{list:function(){var e,i;return null!==(i=null===(e=t.xj)||void 0===e?void 0:e.listUnplayedAds())&&void 0!==i?i:[]},skip:function(){var e,i;return null!==(i=null===(e=t.yj)||void 0===e?void 0:e.skipActiveAd())&&void 0!==i?i:Promise.resolve()},getActiveAd:function(){var e,i;return null!==(i=null===(e=t.yj)||void 0===e?void 0:e.getActiveAd())&&void 0!==i?i:void 0}}},t.prototype.Wk=function(t){var e,i=this,n=this.xj;if(!n||this.Bj||this.Ej)return Promise.resolve();var r=null===(e=this.context.serviceManager)||void 0===e?void 0:e.get(s.ServiceName.AdPreloadingService);if(!r||this.context.internalPlayer.getPlayerType()===u.PlayerType.Native)return n.preloadUpcomingAds(t),Promise.resolve();if(r.hasTrackedAds())return Promise.resolve();var o=n.getUpcomingAds(t);if(0===o.length)return Promise.resolve();var a=o.filter(function(t){return t.start===o[0].start}),l=this.Ej={},c=function(){return i.Ej===l&&!i.zj&&!i.Aj};return this.ak(a,c).then(function(t){c()&&r.preloadAdBreaks(t)}).catch(function(t){i.context.logger.debug("Failed to hand over upcoming SGAI ads for preloading",t)}).finally(function(){i.Ej===l&&(i.Ej=void 0)})},t.prototype.Xk=function(){this.Ej=void 0},t.prototype.Yk=function(){var t,e;this.Xk(),null===(e=null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(s.ServiceName.AdPreloadingService))||void 0===e||e.cancel()},t.prototype.shouldPlayPreRollAds=function(){return Boolean(this.xj)&&!this.Cj},t.prototype.playPreRollAds=function(){return r(this,void 0,void 0,function(){var t,e,i=this;return o(this,function(n){switch(n.label){case 0:return this.xj?(null!==(e=this.Dj)&&void 0!==e||(this.Dj=new c.Deferred),[4,this.Dj.promise.catch(function(){})]):[2];case 1:return n.sent(),this.Aj?(this.context.logger.debug("Source loading failed or was aborted, skipping SGAI pre-roll playback"),[2]):(this.Cj=!0,0===(t=this.xj.getPreRollAds()).length?(this.context.logger.debug("No SGAI pre-rolls found"),[2]):(this.context.logger.debug("Scheduling playback of ".concat(t.length," SGAI pre-roll ads"),t),[2,this.Zk(t).finally(function(){return i.Gj()})]))}})})},t.prototype.Zk=function(t,e){return r(this,void 0,void 0,function(){var i,n,r,a,l,u,c,g,f,p,v=this;return o(this,function(y){switch(y.label){case 0:return this.Xk(),this.zj=!0,[4,this.ak(t)];case 1:i=y.sent(),n=i.map(function(e,i){return v.ck(t[i],e)}),r=n.filter(function(t){return t.ads.length>0}).pop(),a=n.reduce(function(t,e){var i;return t+(null!==(i=e.replaceContentDuration)&&void 0!==i?i:0)},0)+this.context.settings.SGAI_TRIGGER_DELAY_COMPENSATION,l=null===(f=this.context.serviceManager)||void 0===f?void 0:f.get(s.ServiceName.AdPreloadingService),this.Aj||!l||l.hasTrackedAds()||l.trackAdBreaks(n),u=function(i){var s,l;return o(this,function(o){switch(o.label){case 0:if(0===(s=n[i]).ads.length)return c.context.logger.debug("No ads found for SGAI with id ".concat(s.id,", skipping playback")),[2,"continue"];if(c.Aj||!c.xj)return[2,"break"];s.replaceContentDuration=null!=e?e:a,c.context.logger.debug("Scheduling playback of SGAI ad break with ".concat(s.ads.length," ads"),s),o.label=1;case 1:return o.trys.push([1,3,,4]),null!==(p=c.yj)&&void 0!==p||(c.yj=new h.SgaiAdPlayer(c.context)),[4,c.yj.playAdBreak(s,{isLastAdBreak:s===r,getPlayoutLimit:function(){var e;return null===(e=v.xj)||void 0===e?void 0:e.getTotalPlayoutLimit(t[i])},getReplaceContentDuration:function(){var n;if((0,d.isDefined)(e))return e;var r=null===(n=v.xj)||void 0===n?void 0:n.getReplaceContentDuration(t[i],s.ads);return(0,d.isDefined)(r)?r+v.context.settings.SGAI_TRIGGER_DELAY_COMPENSATION:void 0}})];case 2:return o.sent(),[3,4];case 3:return l=o.sent(),c.context.logger.debug("Failed to play SGAI ad break with id ".concat(s.id),l),[3,4];case 4:return[2]}})},c=this,g=0,y.label=2;case 2:return g<n.length?[5,u(g)]:[3,5];case 3:if("break"===y.sent())return[3,5];y.label=4;case 4:return g++,[3,2];case 5:return this.Yk(),this.zj=!1,this.Bj=void 0,[2]}})})},t.prototype.ak=function(t,e){var i=this;void 0===e&&(e=function(){return!i.Aj});for(var n=[],r=Promise.resolve(),o=function(t){r=r.then(function(){if(!e())throw new Error("SGAI ad break preparation was canceled");return i.bk(t).then(function(t){n.push(t)})})},s=0,a=t;s<a.length;s++)o(a[s]);return r.then(function(){return e()?n:[]}).catch(function(t){return i.context.logger.debug("Failed to prepare SGAI ad breaks",t),[]})},t.prototype.bk=function(t){return r(this,void 0,void 0,function(){var e,i,n,r,s,a,l,u,c,d,g;return o(this,function(o){switch(o.label){case 0:return this.xj?[4,this.xj.resolveNestedAds(t)]:[3,2];case 1:return i=o.sent(),[3,3];case 2:i=[],o.label=3;case 3:return e=i,n=null===(a=this.xj)||void 0===a?void 0:a.getReplaceContentDuration(t,e),r=null===(l=this.xj)||void 0===l?void 0:l.getTotalPlannedDuration(t,e),s=e.length>0,[2,{id:t.id,position:null!==(c=null===(u=this.xj)||void 0===u?void 0:u.getAdPosition(t))&&void 0!==c?c:f.SgaiAdPosition.MIDROLL,scheduleTime:t.start,replaceContentDuration:s?n:void 0,totalPlannedDuration:s?r:void 0,ads:e,adCreativeSignaling:null===(d=this.xj)||void 0===d?void 0:d.resolveAdCreativeSignaling(t),restrictions:null===(g=this.xj)||void 0===g?void 0:g.resolveRestrictions(t)}]}})})},t.prototype.ck=function(t,e){var i,r;return e.ads.length>0&&!(null===(i=this.xj)||void 0===i?void 0:i.shouldPlayAd(t))&&(e=n(n({},e),{ads:[],replaceContentDuration:void 0,totalPlannedDuration:void 0})),null===(r=this.xj)||void 0===r||r.markAdAsPlayed(t),e},t.prototype.playPostRollAds=function(){if(!this.xj)return Promise.resolve();var t=this.xj.getPostRollAds();return 0===t.length?Promise.resolve():(this.context.logger.debug("Scheduling playback of post-roll SGAI ads with id ".concat(t.map(function(t){return t.id}).join(", ")),t),this.Zk(t))},t.prototype.reset=function(){return r(this,void 0,void 0,function(){var t,e;return o(this,function(i){switch(i.label){case 0:return this.context.logger.debug("Resetting SGAI service"),this.Aj=!0,this.Cj=!1,this.Bj=void 0,this.context.eventHandler.off(l.PlayerEvent.Playing,this.Gj),this.context.eventHandler.off(l.PlayerEvent.TimeChanged,this.Hj),this.context.eventHandler.off(l.PlayerEvent.TimeShift,this.Ij),this.context.eventHandler.off(l.PlayerEvent.TimeShifted,this.Jj),this.context.eventHandler.off(l.PlayerEvent.Seek,this.Kj),this.context.eventHandler.off(l.PlayerEvent.Seeked,this.Lj),this.context.eventHandler.off(l.PlayerEvent.SourceLoaded,this.Fj),null===(t=this.Dj)||void 0===t||t.reject(),this.Dj=void 0,this.Yk(),this.xj=(0,a.dispose)(this.xj),[4,null===(e=this.yj)||void 0===e?void 0:e.dispose()];case 1:return i.sent(),this.yj=void 0,this.zj=!1,[2]}})})},t.prototype.dispose=function(){},t}();e.SgaiService=v},60841:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SgaiAdPosition=void 0,function(t){t.PREROLL="pre",t.MIDROLL="mid",t.POSTROLL="post"}(i||(e.SgaiAdPosition=i={}))},43661:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.getDvrWindowStart=function(t){return t.isLive()?t.getCurrentTime()-t.getTimeShift()+t.getMaxTimeShift():-1/0},e.isPlayingHls=function(t){return t.sourceContext.technology.streaming===n.StreamType.Hls},e.isHlsManifestUri=r,e.isProgressiveMediaUrl=function(t){return!r(t)&&t.toLowerCase().includes(".mp4")};var n=i(20213);function r(t){return t.toLowerCase().includes(".m3u8")}},13117:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ViewabilityTracker=void 0;var n=i(3714),r=i(84770),o=i(28038),s=function(){function t(t,e,i){var n=this;this.context=t,this.config=e,this.onDecision=i,this.hgb=!1,this.igb=!1,this.jgb=!0,this.kgb=0,this.lgb=null,this.ngb={paused:!1,stalled:!1},this.ogb=null,this.pgb=function(t){n.igb=Boolean(t.isVisible),n.ygb()},this.qgb=function(){n.jgb=n.zgb(),n.ygb()},this.rgb=function(){n.hgb||n.Dgb(o.AdTrackingEventTrigger.NOT_VIEWABLE)},this.sgb=function(){n.Bgb("paused")},this.tgb=function(){n.Cgb("paused")},this.ugb=function(){n.Bgb("stalled")},this.vgb=function(){n.Cgb("stalled")},this.xgb=function(){var t,e=Date.now();n.hgb||!n.wgb()||n.Fgb()?n.ogb=e:(n.kgb+=e-(null!==(t=n.ogb)&&void 0!==t?t:e),n.ogb=e,n.kgb>=n.config.viewableDurationMs&&n.Dgb(o.AdTrackingEventTrigger.VIEWABLE))},this.mgb=new r.PausableTimeout(this.config.decisionTimeoutMs,this.rgb)}return t.prototype.start=function(){this.hgb||(this.Agb()?(this.jgb=this.zgb(),this.igb=Boolean(this.context.internalPlayer.getVisibility().isVisible),this.ygb(),this.context.eventHandler.on(n.PlayerEvent.VisibilityChanged,this.pgb),this.context.eventHandler.on(n.PlayerEvent.Paused,this.sgb),this.context.eventHandler.on(n.PlayerEvent.Playing,this.tgb),this.context.eventHandler.on(n.PlayerEvent.StallStarted,this.ugb),this.context.eventHandler.on(n.PlayerEvent.StallEnded,this.vgb),document.addEventListener("visibilitychange",this.qgb,{passive:!0}),this.mgb.start(),this.ogb=Date.now(),this.kgb=0,this.lgb=window.setInterval(this.xgb,250)):this.Dgb(o.AdTrackingEventTrigger.VIEW_UNDETERMINED))},t.prototype.wgb=function(){return this.igb&&this.jgb},t.prototype.ygb=function(){this.igb&&this.jgb||(this.kgb=0)},t.prototype.zgb=function(){return"string"==typeof document.visibilityState?"visible"===document.visibilityState:"boolean"==typeof document.hidden&&!document.hidden},t.prototype.Agb=function(){var t,e;return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.addEventListener&&"function"==typeof document.removeEventListener&&("string"==typeof document.visibilityState||"boolean"==typeof document.hidden)&&Boolean(null===(t=this.context.eventHandler)||void 0===t?void 0:t.on)&&Boolean(null===(e=this.context.eventHandler)||void 0===e?void 0:e.off)},t.prototype.Bgb=function(t){if(!this.ngb[t]){var e=!this.Fgb();this.ngb[t]=!0,e&&this.mgb.pause()}},t.prototype.Cgb=function(t){this.ngb[t]&&(this.ngb[t]=!1,this.Fgb()||this.mgb.resume())},t.prototype.Dgb=function(t){this.hgb||(this.hgb=!0,this.Egb(),this.onDecision(t))},t.prototype.Egb=function(){this.context.eventHandler.off(n.PlayerEvent.VisibilityChanged,this.pgb),this.context.eventHandler.off(n.PlayerEvent.Paused,this.sgb),this.context.eventHandler.off(n.PlayerEvent.Playing,this.tgb),this.context.eventHandler.off(n.PlayerEvent.StallStarted,this.ugb),this.context.eventHandler.off(n.PlayerEvent.StallEnded,this.vgb),document.removeEventListener("visibilitychange",this.qgb),null!==this.lgb&&(window.clearInterval(this.lgb),this.lgb=null,this.ogb=null),this.mgb.pause()},t.prototype.reset=function(){this.Egb(),this.hgb=!1,this.kgb=0,this.ngb.paused=!1,this.ngb.stalled=!1,this.mgb.reset()},t.prototype.Fgb=function(){return this.ngb.paused||this.ngb.stalled},t.prototype.dispose=function(){this.Egb(),this.mgb.dispose()},t}();e.ViewabilityTracker=s},22705:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultCustomAttributesMapping=void 0;var n=i(61933),r=i(28038),o=function(t,e){if(e&&0!==e.length)for(var i=function(e,i){i.urls&&i.urls.length>0&&t.tracking.register(e,[{urls:i.urls,offset:i.offset}])},n=0,o=e;n<o.length;n++){var s=o[n];switch(s.type){case r.AdTrackingEventTrigger.CLICKED:i(r.AdTrackingEventTrigger.CLICKED,s);break;case r.AdTrackingEventTrigger.IMPRESSION:i(r.AdTrackingEventTrigger.IMPRESSION,s);break;case r.AdTrackingEventTrigger.COMPLETE:i(r.AdTrackingEventTrigger.COMPLETE,s);break;case r.AdTrackingEventTrigger.START:i(r.AdTrackingEventTrigger.START,s);break;case r.AdTrackingEventTrigger.FIRST_QUARTILE:i(r.AdTrackingEventTrigger.FIRST_QUARTILE,s);break;case r.AdTrackingEventTrigger.MIDPOINT:i(r.AdTrackingEventTrigger.MIDPOINT,s);break;case r.AdTrackingEventTrigger.THIRD_QUARTILE:i(r.AdTrackingEventTrigger.THIRD_QUARTILE,s);break;case r.AdTrackingEventTrigger.PAUSE:i(r.AdTrackingEventTrigger.PAUSE,s);break;case r.AdTrackingEventTrigger.RESUME:i(r.AdTrackingEventTrigger.RESUME,s);break;case r.AdTrackingEventTrigger.MUTE:i(r.AdTrackingEventTrigger.MUTE,s);break;case r.AdTrackingEventTrigger.UNMUTE:i(r.AdTrackingEventTrigger.UNMUTE,s);break;case r.AdTrackingEventTrigger.ERROR:i(r.AdTrackingEventTrigger.ERROR,s);break;case r.AdTrackingEventTrigger.LOADED:i(r.AdTrackingEventTrigger.LOADED,s);break;case r.AdTrackingEventTrigger.PROGRESS:i(r.AdTrackingEventTrigger.PROGRESS,s);break;case r.AdTrackingEventTrigger.SKIP:i(r.AdTrackingEventTrigger.SKIP,s);break;case r.AdTrackingEventTrigger.VIEWABLE:i(r.AdTrackingEventTrigger.VIEWABLE,s);break;case r.AdTrackingEventTrigger.NOT_VIEWABLE:i(r.AdTrackingEventTrigger.NOT_VIEWABLE,s);break;case r.AdTrackingEventTrigger.VIEW_UNDETERMINED:i(r.AdTrackingEventTrigger.VIEW_UNDETERMINED,s)}}};e.defaultCustomAttributesMapping=function(t,e){var i,r=null===(i=t.customAttributes)||void 0===i?void 0:i[n.AD_CREATIVE_SIGNALING_KEY];if(r){o(e,r.tracking);for(var s=0,a=function(t){return t?Array.isArray(t)?t:[t]:[]}(r.payload);s<a.length;s++){var l=a[s];l.clickThrough&&!e.clickThroughUrl&&(e.clickThroughUrl=l.clickThrough),o(e,l.tracking)}}}},3093:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.fireSgaiAdError=function(t,e,i,a){var l={code:e};i&&(l.message=i);var u=function(t){if(t instanceof r.PlayerError||(null==t?void 0:t.type)===o.PlayerEvent.Error){var e=t;return{code:e.code,name:e.name,message:e.message,data:e.data}}}(a);u&&(l.deficiencyData=u),t.internalPlayer.fireEvent(o.PlayerEvent.AdError,{code:n.ErrorCode.MODULE_SGAI_ERROR,name:n.ErrorCode[n.ErrorCode.MODULE_SGAI_ERROR],data:l,message:i,troubleShootLink:(0,s.generateTroubleshootUrl)(n.ErrorCode.MODULE_SGAI_ERROR)})};var n=i(40306),r=i(3336),o=i(3714),s=i(51289)},68856:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.fireSgaiWarning=function(t,e,i){t.internalPlayer.fireEvent(r.PlayerEvent.Warning,new n.PlayerWarning(e,i))};var n=i(25926),r=i(3714)}},function(t){return function(){return t(60047)}()}])});
|
|
18
18
|
})();
|