bitmovin-player 8.280.0 → 8.281.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.
Files changed (106) hide show
  1. package/bitmovinplayer-serviceworker.js +2 -2
  2. package/bitmovinplayer-serviceworker.prod.js +2 -2
  3. package/bitmovinplayer-ui.js +1 -1
  4. package/bitmovinplayer.js +2 -2
  5. package/bitmovinplayer.prod.js +2 -2
  6. package/modules/bitmovinplayer-abr.js +2 -2
  7. package/modules/bitmovinplayer-abr.prod.js +2 -2
  8. package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
  9. package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
  10. package/modules/bitmovinplayer-advertising-core.js +2 -2
  11. package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
  12. package/modules/bitmovinplayer-advertising-ima.js +2 -2
  13. package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
  14. package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
  15. package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
  16. package/modules/bitmovinplayer-analytics.js +2 -2
  17. package/modules/bitmovinplayer-analytics.prod.js +2 -2
  18. package/modules/bitmovinplayer-container-mp4.js +2 -2
  19. package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
  20. package/modules/bitmovinplayer-container-ts.js +2 -2
  21. package/modules/bitmovinplayer-container-ts.prod.js +2 -2
  22. package/modules/bitmovinplayer-container-webm.js +2 -2
  23. package/modules/bitmovinplayer-container-webm.prod.js +2 -2
  24. package/modules/bitmovinplayer-core.js +2 -2
  25. package/modules/bitmovinplayer-core.prod.js +2 -2
  26. package/modules/bitmovinplayer-crypto.js +2 -2
  27. package/modules/bitmovinplayer-crypto.prod.js +2 -2
  28. package/modules/bitmovinplayer-dash.js +2 -2
  29. package/modules/bitmovinplayer-dash.prod.js +2 -2
  30. package/modules/bitmovinplayer-drm.js +2 -2
  31. package/modules/bitmovinplayer-drm.prod.js +2 -2
  32. package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
  33. package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
  34. package/modules/bitmovinplayer-engine-native.js +2 -2
  35. package/modules/bitmovinplayer-engine-native.prod.js +2 -2
  36. package/modules/bitmovinplayer-engine-webrtc.js +2 -2
  37. package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
  38. package/modules/bitmovinplayer-envivio.js +1 -1
  39. package/modules/bitmovinplayer-envivio.prod.js +1 -1
  40. package/modules/bitmovinplayer-hls.js +2 -2
  41. package/modules/bitmovinplayer-hls.prod.js +2 -2
  42. package/modules/bitmovinplayer-lowlatency.js +2 -2
  43. package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
  44. package/modules/bitmovinplayer-mserenderer.js +2 -2
  45. package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
  46. package/modules/bitmovinplayer-patch.js +1 -1
  47. package/modules/bitmovinplayer-patch.prod.js +1 -1
  48. package/modules/bitmovinplayer-playstation4.js +2 -2
  49. package/modules/bitmovinplayer-playstation4.prod.js +2 -2
  50. package/modules/bitmovinplayer-playstation5.js +2 -2
  51. package/modules/bitmovinplayer-playstation5.prod.js +2 -2
  52. package/modules/bitmovinplayer-polyfill.js +1 -1
  53. package/modules/bitmovinplayer-polyfill.prod.js +1 -1
  54. package/modules/bitmovinplayer-reactnative.js +1 -1
  55. package/modules/bitmovinplayer-reactnative.prod.js +1 -1
  56. package/modules/bitmovinplayer-remotecontrol.js +2 -2
  57. package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
  58. package/modules/bitmovinplayer-serviceworker-client.js +2 -2
  59. package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
  60. package/modules/bitmovinplayer-serviceworker.js +2 -2
  61. package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
  62. package/modules/bitmovinplayer-sgai.js +2 -2
  63. package/modules/bitmovinplayer-sgai.prod.js +2 -2
  64. package/modules/bitmovinplayer-smooth.js +2 -2
  65. package/modules/bitmovinplayer-smooth.prod.js +2 -2
  66. package/modules/bitmovinplayer-style.js +2 -2
  67. package/modules/bitmovinplayer-style.prod.js +2 -2
  68. package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
  69. package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
  70. package/modules/bitmovinplayer-subtitles-native.js +2 -2
  71. package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
  72. package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
  73. package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
  74. package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
  75. package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
  76. package/modules/bitmovinplayer-subtitles.js +2 -2
  77. package/modules/bitmovinplayer-subtitles.prod.js +2 -2
  78. package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
  79. package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
  80. package/modules/bitmovinplayer-thumbnail.js +2 -2
  81. package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
  82. package/modules/bitmovinplayer-tizen.js +2 -2
  83. package/modules/bitmovinplayer-tizen.prod.js +2 -2
  84. package/modules/bitmovinplayer-ui.js +2 -2
  85. package/modules/bitmovinplayer-ui.prod.js +2 -2
  86. package/modules/bitmovinplayer-vidaa.js +2 -2
  87. package/modules/bitmovinplayer-vidaa.prod.js +2 -2
  88. package/modules/bitmovinplayer-vr.js +2 -2
  89. package/modules/bitmovinplayer-vr.prod.js +2 -2
  90. package/modules/bitmovinplayer-webos.js +2 -2
  91. package/modules/bitmovinplayer-webos.prod.js +2 -2
  92. package/modules/bitmovinplayer-wpe.js +2 -2
  93. package/modules/bitmovinplayer-wpe.prod.js +2 -2
  94. package/modules/bitmovinplayer-xml.js +1 -1
  95. package/modules/bitmovinplayer-xml.prod.js +1 -1
  96. package/package.json +1 -1
  97. package/types/advertising/API.d.ts +9 -0
  98. package/types/advertising/ConfigAPI.d.ts +6 -5
  99. package/types/core/BufferSettings.d.ts +58 -0
  100. package/types/core/LogLevels.d.ts +54 -0
  101. package/types/core/Logger.d.ts +51 -0
  102. package/types/core/Settings.d.ts +856 -0
  103. package/types/core/network/ManifestMimeType.d.ts +5 -0
  104. package/types/core/util/MimeTypeHelper.d.ts +52 -0
  105. package/types/sgai/SgaiConfigAPI.d.ts +1 -1
  106. package/types/sgai/SgaiErrorCode.d.ts +6 -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.280.0
12
+ * Bitmovin Player Version 8.281.0
13
13
  *
14
14
  ****************************************************************************/
15
15
 
16
16
  (function() {
17
- "use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["advertising-core"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["advertising-core"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[561],{28610:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VmapTrackingEventType=void 0,function(e){e.BreakStart="breakstart",e.BreakEnd="breakend",e.Error="error"}(r||(t.VmapTrackingEventType=r={}))},76713:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PAUSE_AD_POSITION=t.DEFAULT_AD_BREAK_POSITION=void 0,t.isPauseAdBreak=function(e){return(null==e?void 0:e.position)===t.PAUSE_AD_POSITION},t.DEFAULT_AD_BREAK_POSITION="pre",t.PAUSE_AD_POSITION="pause"},45392:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdManifestHelper=void 0,t.xmlToString=function(e){return(new XMLSerializer).serializeToString(e.documentElement)},t.toDataUri=function(e){return"data:text/xml,"+encodeURIComponent(e)},t.pingVmapTrackingUrls=function(e,t){void 0===e&&(e=[]),e.filter(function(e){return e.type===t}).forEach(function(e){return(0,i.pingUrl)(e.url)})};var n=r(70850),i=r(95217),o=r(88457),a=r(60326),s=r(47091),l=function(){function e(e,t,r,n){this.loader=e,this.videoLoadTimeout=t,this.withCredentials=r,this.disableStorage=n}return e.prototype.downloadVastManifest=function(e){var t,r=this;return null!==(t=this.EM)&&void 0!==t||(this.EM=new DOMParser),this.loader.load(e,void 0,void 0,void 0,void 0,this.withCredentials).catch(function(){return Promise.reject({code:o.AdvertisingModuleErrorCode.COULD_NOT_LOAD_AD_MANIFEST})}).then(function(e){var t;if(!e.body)return Promise.reject({code:s.VastErrorCode.XML_PARSING_ERROR});var n=r.EM.parseFromString(e.body,"text/xml"),i=null===(t=n.childNodes[0].childNodes[0])||void 0===t?void 0:t.nodeName.includes("Error"),a=void 0===i||i,l=n.childNodes[0].nodeName.includes("error");if(n.childNodes[0].nodeName.includes("VMAP"))return Promise.reject({code:o.AdvertisingModuleErrorCode.AD_TAG_TYPE_NOT_MATCHING});if(a)return Promise.reject({code:s.VastErrorCode.NO_ADS_VAST_RESPONSE});if(l)return Promise.reject({code:s.VastErrorCode.XML_PARSING_ERROR});var u={downloadTime:e.elapsedTime,timeToFirstByte:e.timeToFirstByte};return Promise.resolve({manifest:n,downloadTiming:u})})},e.prototype.downloadVmapManifest=function(e){return this.loader.load(e,void 0,void 0,void 0,void 0,this.withCredentials)},e.prototype.parseAdVerifications=function(e){var t;return null!==(t=this.FM)&&void 0!==t||(this.FM=new a.VastClientWrapper(this.videoLoadTimeout,this.withCredentials,this.disableStorage)),this.FM.parseManifest(e,!1).then(function(e){if(e.ads.length<1)return Promise.resolve([]);var t=e.ads.map(function(e){return{id:e.id||"adVerification-"+n.Util.generateUniqueId(),verifications:e.verifications}});return Promise.resolve(t)}).catch(function(e){return Promise.resolve([])})},e}();t.AdManifestHelper=l},63524:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlaybackFactory=void 0;var n=r(60937),i=r(52448),o=function(){function e(){}return e.create=function(e,t){var r=!1,o=function(){r=!1},a=function(e){var t="The current ad playback has to be finished by calling ".concat(e,".done(), before a new one can be requested.");return Promise.reject(t)};return new(function(){function s(){}return s.prototype.requestPlayer=function(){return r?a("AdPlayerAPI"):(r=!0,Promise.resolve(i.AdPlayerFactory.createAdPlayer(e,o)))},s.prototype.requestReporter=function(){return r?a("AdPlaybackReportingAPI"):(r=!0,Promise.resolve(new n.AdPlaybackReporter(e,o)))},s.prototype.done=function(e){return void 0===e&&(e=!0),t(e)},s}())},e}();t.AdPlaybackFactory=o},60937:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlaybackReporter=void 0;var n=r(9768),i=r(3714),o=r(19483),a=function(){return function(e,t){var r=this,a=new o.ArrayMap;this.videoElement=e.getVideoElement();var s=!1,l=function(){if(s)throw"AdPlaybackReporter is no longer usable. Request a new one."},u=this.videoElement.addEventListener;this.videoElement.addEventListener=function(e,t,n){a.add(e,t),u.apply(r.videoElement,[e,t,n])},this.started=function(t){if(l(),r.M4)throw"Ad playback is already in progress. A new one can not be started.";r.M4=t,r.N4=!1,e.hasCurrentSourcePlayedOnce()||e.fireEvent(i.PlayerEvent.Playing,{time:e.getCurrentTime(),issuer:n.ADVERTISING_ISSUER_NAME}),e.fireEvent(i.PlayerEvent.AdStarted,{ad:t})},this.paused=function(t){l(),e.fireEvent(i.PlayerEvent.Paused,{time:t,issuer:n.ADVERTISING_ISSUER_NAME})},this.resumed=function(t){l(),e.fireEvent(i.PlayerEvent.Play,{time:t,issuer:n.ADVERTISING_ISSUER_NAME}),e.fireEvent(i.PlayerEvent.Playing,{time:t,issuer:n.ADVERTISING_ISSUER_NAME})},this.timeupdate=function(t){l(),e.fireEvent(i.PlayerEvent.TimeChanged,{time:t,issuer:n.ADVERTISING_ISSUER_NAME})},this.skipped=function(){r.N4||(l(),e.fireEvent(i.PlayerEvent.AdSkipped,{ad:r.M4}),r.N4=!0,r.M4=null)},this.done=function(){return l(),a.forAll(function(e,t){r.videoElement.removeEventListener(e,t),r.videoElement.addEventListener=u}),!r.N4&&r.M4&&e.fireEvent(i.PlayerEvent.AdFinished,{ad:r.M4}),r.M4=null,t(),s=!0,Promise.resolve()}}}();t.AdPlaybackReporter=a},43255:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlayerDelegate=void 0;var i=r(40306),o=r(80813),a=r(9768),s=r(3714),l=r(51289),u=r(90408),c=r(20213),d=r(18192),p=r(94685),f=r(41138),h=r(63524),v=r(44202),g=r(65185),E=r(47091),A=function(){function e(t){var r,p=t.internalPlayer,f=new v.AdPlayerStateStore(t.context,p),A=Promise.resolve(),m=!1,R=!1,P=!1,_={width:0,height:0},S=[],N=function(e){e.code===c.WarningCode.PLAYBACK_COULD_NOT_BE_STARTED&&(R=!0)};p.onInternal(s.PlayerEvent.PlayerResized,function(e){var t=y(e.width),r=y(e.height);_={width:t,height:r}});var U=function(){R=!1};this.getVideoElement=function(){return p.getVideoElement()},this.getVolume=function(){return p.isMuted()?0:p.getVolume()},this.isContentPaused=function(){return p.isContentPaused()},this.isContentSeeking=function(){return p.isContentSeeking()},this.parsePosition=function(t){var r;return r=f.hasStoredState()?f.getStoredState().contentDuration:p.getDuration(),e.parsePosition(t,r)},this.selectMediaFile=function(e){var r=e.every(function(e){return e.bitrate||e.minBitrate&&e.maxBitrate}),n=p.getDownloadedVideoData(),i=p.getDownloadedAudioData(),a=Boolean(i&&n&&n.bitrate>0),s=t.context.serviceManager.get(o.ServiceName.AdaptationService);return r&&(s||a)?O(e,[n,i],s):function(e,t,r){return r&&r.width>0?(0,g.findMediaFileByResolution)(r.width,r.height,e):(0,g.findMediaFileByResolution)(t.width,t.height,e)}(e,_,n)};var O=function(e,t,r){var n=t[0],i=t[1];return r?r.selectQualityBasedOnBitrateMeasurement(e):(0,g.findMediaFileByBitrate)(n.bitrate+i.bitrate,e)};this.metadataLoaded=function(e,t){var r={adBreak:null,downloadTiming:t};e.hasOwnProperty("scheduleTime")&&(r.adBreak=e),r.adConfig=e,p.fireEvent(s.PlayerEvent.AdManifestLoaded,r)};var I=function(){S.forEach(function(e){return p.fireEvent(s.PlayerEvent.Error,{type:s.PlayerEvent.Error,code:e.code,name:e.name,message:e.message,data:e.data,troubleShootLink:(0,l.generateTroubleshootUrl)(e.code)})})},b=function(e){if(!f.hasStoredState())return Promise.resolve();var n=f.getStoredState().contentDuration,l=Promise.resolve();return m=!e,e&&(l=A=function(){return S.length?function(){return p.removeExternalEventFilter(k),f.clear(),p.off(s.PlayerEvent.Warning,N),p.off(s.PlayerEvent.Playing,U),p.unload().then(I)}():(p.fireEvent(s.PlayerEvent.RestoringContent),p.addExternalEventFilter(D),f.restore(a.ADVERTISING_RESTORE_ISSUER_NAME).then(function(e){if(p.removeExternalEventFilter(k),S.length)throw new Error("Background errors occurred during ad break");if(R)R=!1;else{if(e)return p.play(a.ADVERTISING_ISSUER_NAME).catch(function(e){P=!0});var r=t.context.serviceManager.get(o.ServiceName.PlayerStateService);null==r||r.transitionToStoppedState()}}).catch(function(){S.length?I():p.fireEvent(s.PlayerEvent.Error,{code:i.ErrorCode.UNKNOWN})}).finally(function(){f.clear(),p.removeExternalEventFilter(D),p.off(s.PlayerEvent.Warning,N),p.off(s.PlayerEvent.Playing,U)}))}().then(function(){t.restoreContentDeferred&&t.restoreContentDeferred.resolve()})),l.then(function(){var i=r?{adBreak:r}:void 0;p.fireEvent(s.PlayerEvent.AdBreakFinished,i),r=null,e&&(0,u.maybeFireDurationChangedEvent)(n,p.getDuration(),t.context.eventHandler),p.hasCurrentSourcePlayedOnce()||P||p.fireEvent(s.PlayerEvent.Playing,{time:p.getCurrentTime(),issuer:a.ADVERTISING_ISSUER_NAME}),P=!1})},C=[s.PlayerEvent.Error,s.PlayerEvent.SourceLoaded,s.PlayerEvent.SourceUnloaded,s.PlayerEvent.PlaybackFinished,s.PlayerEvent.Ready],k=function(e,r){var n=function(){var e=t.context.store.getState();return(null==e?void 0:e.sources)&&Object.keys(e.sources).find(function(t){var r;return e.sources&&e.sources[t]&&(null===(r=e.sources[t].playback)||void 0===r?void 0:r.kind)===d.PlaybackKind.Background})}();return T(e,r)&&n&&r.sourceIdentifier===n&&S.push(r),!C.includes(e)},L=[s.PlayerEvent.Play,s.PlayerEvent.Playing,s.PlayerEvent.Seek,s.PlayerEvent.Seeked,s.PlayerEvent.TimeShift,s.PlayerEvent.TimeShifted],D=function(e){return!L.includes(e)};this.requestAdPlayback=function(e){return r?Promise.reject("Ad break already in progress"):(r=e,A.then(function(){var t=m?Promise.resolve():M(e),r={adBreak:n(n({},JSON.parse(JSON.stringify(e))),{scheduleTime:e.scheduleTime})};return p.fireEvent(s.PlayerEvent.AdBreakStarted,r),p.onInternal(s.PlayerEvent.Warning,N),p.onInternal(s.PlayerEvent.Playing,U),t.then(function(){return p.unload(a.ADVERTISING_ISSUER_NAME)}).then(function(){return h.AdPlaybackFactory.create(p,b)})}))},this.updateAdRestoreState=function(e){r&&f.setAdRestoreState(e)};var M=function(r){var n=t.context,i=n.sourceContext.sourceIdentifier,s=n.adRestorationOptimizationService,l=n.serviceManager.get(o.ServiceName.ManifestService,i),u=s&&n.settings.OPTIMIZE_AD_RESTORATION,c=e.getAdBreakDuration(r),d=r.replaceContentDuration;return f.capture(a.ADVERTISING_ISSUER_NAME),f.setAdRestoreState({adBreakDuration:c,replaceContentDuration:d}),p.addExternalEventFilter(k),u&&l&&!l.isLive()?s.optimizeRestorationAfterUpcomingAdBreak():Promise.resolve()};this.overlayAdStarted=function(e){p.fireEvent(s.PlayerEvent.OverlayAdStarted,{ad:e})},this.nonLinearAdStarted=function(e,t){p.fireEvent(s.PlayerEvent.NonLinearAdStarted,{ad:e,position:t})},this.nonLinearAdFinished=function(e,t){p.fireEvent(s.PlayerEvent.NonLinearAdFinished,{ad:e,position:t})},this.nonLinearAdSkipped=function(e,t){p.fireEvent(s.PlayerEvent.NonLinearAdSkipped,{ad:e,position:t})},this.adClicked=function(e){p.fireEvent(s.PlayerEvent.AdClicked,{clickThroughUrl:e})},this.adInteraction=function(e,t){p.fireEvent(s.PlayerEvent.AdInteraction,{interactionType:e,id:t})},this.onQuartile=function(e){p.fireEvent(s.PlayerEvent.AdQuartile,{quartile:e})},this.onError=function(e,t,r){var n={code:e||E.VastErrorCode.UNDEFINED_ERROR};t&&(n.message=t),r&&(n.adConfig=r),p.fireEvent(s.PlayerEvent.AdError,{code:i.ErrorCode.MODULE_ADVERTISING_ERROR,data:n,name:i.ErrorCode[i.ErrorCode.MODULE_ADVERTISING_ERROR],message:t,troubleShootLink:(0,l.generateTroubleshootUrl)(i.ErrorCode.MODULE_ADVERTISING_ERROR)})},this.onWarning=function(e,t,r){p.fireEvent(s.PlayerEvent.Warning,new c.PlayerWarning(e,t,r))},this.reset=function(){var t=p.getVideoElement();m=!1,R=!1,f.clear(),p.removeExternalEventFilter(k),p.removeExternalEventFilter(D),r&&t instanceof HTMLVideoElement&&e.clearVideoElement(t),r=null}}return e.getAdBreakDuration=function(e){var t,r,n=e.totalPlannedDuration;return null!=n?n:null!==(r=null===(t=e.ads)||void 0===t?void 0:t.reduce(function(e,t){var r;return e+(t.isLinear&&null!==(r=t.duration)&&void 0!==r?r:0)},0))&&void 0!==r?r:0},e.parsePosition=function(e,t){var r=Number(e);return!isNaN(r)&&r<=0&&(e="pre"),e.includes("pre")||"0%"===e?0:e.includes("post")?1/0:this.parseNumericalPosition(e,t)},e.parseNumericalPosition=function(e,t){var r;if(/%/.test(e)){if(!t)return NaN;e=e.replace(/%/gi,""),r=parseFloat(e)/100*t}else if(e.indexOf(":")>-1){var n=e.split(":");r=3600*parseFloat(n[0])+60*parseFloat(n[1])+parseFloat(n[2])}else r=parseFloat(e);return r>=0?r:NaN},e.clearVideoElement=function(e){f.VideoElementUtil.removeSource(e),e.load()},e}();t.AdPlayerDelegate=A;var m=/(\d+)/;function y(e){return Number(e.match(m)?e.match(m)[0]:0)}var T=function(e,t){return e===s.PlayerEvent.Error&&(0,p.isObject)(t)}},52448:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlayerFactory=t.DEFAULT_AD_PLAYBACK_RATE=void 0,t.createSourceConfig=d;var n=r(40306),i=r(9768),o=r(3714),a=r(19483),s=r(85434),l=r(6365),u=r(7581);t.DEFAULT_AD_PLAYBACK_RATE=1;var c=function(){function e(){}return e.createAdPlayer=function(e,r){var s,l=new a.ArrayMap,c=!1,p=!1,f=[o.PlayerEvent.Play,o.PlayerEvent.Playing],h=function(){if(p)throw"AdPlayer is no longer usable. Request a new one."};return new(function(){function a(){this.adPlaybackStartEventFilter=function(t){return!e.hasCurrentSourcePlayedOnce()||!f.includes(t)}}return a.prototype.done=function(t){void 0===t&&(t=!1),h();var n=Promise.resolve();return c?n=e.unload(i.ADVERTISING_ISSUER_NAME):t||e.hasEnded()?function(e,t){e.fireEvent(o.PlayerEvent.AdFinished,{ad:t})}(e,s):function(e,t){e.fireEvent(o.PlayerEvent.AdSkipped,{ad:t})}(e,s),s=null,l.forAll(function(t,r){e.off(t,r)}),r(),p=!0,c=!1,n},a.prototype.on=function(t,r){h(),l.add(t,r),e.onInternal(t,r)},a.prototype.pause=function(){h(),e.pause(i.ADVERTISING_ISSUER_NAME)},a.prototype.play=function(){return h(),e.play(i.ADVERTISING_ISSUER_NAME)},a.prototype.load=function(r,a){var l=this;return h(),s=r,e.addExternalEventFilter(this.adPlaybackStartEventFilter),c=!0,e.load(d(r),void 0,null!=a?a:{seeking:!0},i.ADVERTISING_ISSUER_NAME).then(function(){return e.setPlaybackSpeed(t.DEFAULT_AD_PLAYBACK_RATE)}).then(function(){return e.play(i.ADVERTISING_ISSUER_NAME).catch(function(){})}).then(function(){c&&e.fireEvent(o.PlayerEvent.AdStarted,{ad:r})}).catch(function(t){if(t&&t.code===n.ErrorCode.MODULE_MISSING)throw{code:u.AdvertisingModuleErrorCode.REQUIRED_PLAYER_MODULE_MISSING,message:t.data.name};throw e.getLogger().debug("Failed to load Ad due to error: ".concat(null==t?void 0:t.message),t),t}).finally(function(){e.removeExternalEventFilter(l.adPlaybackStartEventFilter),c=!1})},Object.defineProperty(a.prototype,"duration",{get:function(){return h(),e.getDuration(i.ADVERTISING_ISSUER_NAME)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"currentTime",{get:function(){return h(),e.getCurrentTime(i.ADVERTISING_ISSUER_NAME)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"volume",{get:function(){return h(),e.getVolume()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"muted",{get:function(){return h(),e.isMuted()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"paused",{get:function(){h();var t=e.isContentPaused(),r=e.isContentPlaying();return!1===t&&!1===r||t},enumerable:!1,configurable:!0}),a}())},e}();function d(e){return e.data.delivery===l.MediaFileDeliveryType.Streaming?s.MimeTypeHelper.isDash(e.data.mimeType)?{dash:e.mediaFileUrl}:{hls:e.mediaFileUrl}:{progressive:e.mediaFileUrl}}t.AdPlayerFactory=c},44202:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?i(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlayerStateStore=void 0;var a=r(80813),s=r(3714),l=r(44468),u=r(29488),c=r(46922),d=r(81524),p=r(18192),f=r(15487),h=r(88844),v=r(93531),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.RK=null,t}return n(t,e),t.prototype.setAdRestoreState=function(e){this.hasStoredState()&&(this.RK=e,this.UK())},t.prototype.SK=function(){var e,t,r=null!==(t=null===(e=this.storedState)||void 0===e?void 0:e.sourceIdentifier)&&void 0!==t?t:this.context.sourceContext.sourceIdentifier;return this.context.serviceManager.get(a.ServiceName.SourceStoreService,r)},t.prototype.TK=function(){if(!this.storedState)return NaN;if(!this.RK)return this.storedState.playbackPosition;var e={adBreakDuration:this.RK.adBreakDuration,isLive:this.storedState.isLive,replaceContentDuration:this.RK.replaceContentDuration,playbackPosition:this.storedState.playbackPosition,resumeLiveContentAtPreviousPosition:this.context.settings.RESUME_LIVE_CONTENT_AT_PREVIOUS_POSITION_AFTER_AD_BREAK};return this.storedState.useTimeshiftForRestore?(0,v.calculateTimeshiftRestorationPosition)(e):(0,v.calculatePlaybackRestorationPosition)(e)},t.prototype.UK=function(){var e;if(this.storedState){var t=this.TK();null===(e=this.SK())||void 0===e||e.dispatch((0,c.setBackgroundPlaybackState)({kind:p.PlaybackKind.Background,position:t}))}},t.prototype.VK=function(e){var t,r,n,i,o=this,a=this.storedState;if(!a)return Promise.reject(new Error("no stored state to restore playback position"));if(a.isStartup)return Promise.resolve(!0);var u=null===(r=null===(t=this.SK())||void 0===t?void 0:t.getState())||void 0===r?void 0:r.playback;if(!u)return Promise.reject(new Error("no playback state available to restore playback position"));var c=(0,d.getPlaybackPosition)(u);if(a.useTimeshiftForRestore)return this.internalPlayer.timeShift(c,e),Promise.resolve(!0);if(this.internalPlayer.getPlayerType()===l.PlayerType.Native&&(0,f.isSafari)()&&c<.5)return Promise.resolve(!0);var p=(null===(n=this.context.renderer)||void 0===n?void 0:n.getDuration())||(null===(i=this.context.videoElement)||void 0===i?void 0:i.duration)||a.contentDuration||c;return c>=p?Promise.resolve(!1):new Promise(function(t,r){var n,i=function(){(0,h.clearTimeoutIfDefined)(n),o.internalPlayer.off(s.PlayerEvent.Seeked,a),o.internalPlayer.off(s.PlayerEvent.Error,u)},a=function(){i(),t(!0)},u=function(){i(),r(new Error("Error during playback restoration"))};o.internalPlayer.onInternal(s.PlayerEvent.Seeked,a),o.internalPlayer.onInternal(s.PlayerEvent.Error,u),o.internalPlayer.getPlayerType()===l.PlayerType.Native&&((0,f.isWebOS)()||(0,f.isPlayStation4)())&&(n=window.setTimeout(a,5e3)),o.internalPlayer.seek(c,e)||a()})},t.prototype.restore=function(e){return i(this,void 0,void 0,function(){var t,r,n;return o(this,function(i){switch(i.label){case 0:if(!(t=this.storedState))throw new Error("no stored state to restore");if(!t.source)throw new Error("stored state has no source to restore");return[4,this.loadSource(e)];case 1:return i.sent(),this.restoreBaseState(t),[4,this.VK(e)];case 2:return r=i.sent(),this.restoreSubtitles(t.subtitles),null===(n=this.SK())||void 0===n||n.dispatch((0,c.setMainContentPlaybackState)({kind:p.PlaybackKind.MainContent})),this.clear(),[2,r]}})})},t.prototype.clear=function(){e.prototype.clear.call(this),this.RK=null},t}(u.PlayerStateStore);t.AdPlayerStateStore=g},42163:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AdPreloadingService=t.AdPlaybackPhase=t.AdPreloadState=void 0;var i,o,a=r(80813),s=r(9768),l=r(3714),u=r(69251),c=r(15971),d=r(23068),p=r(52448);!function(e){e.None="none",e.Pending="pending",e.Done="done",e.Failed="failed"}(i||(t.AdPreloadState=i={})),function(e){e.Upcoming="upcoming",e.Playing="playing",e.Retired="retired"}(o||(t.AdPlaybackPhase=o={}));var f=function(){function e(e){var t=this;this.context=e,this.Of=[],this.Qf=!1,this.Sf=function(e){var r,n,i;if(!t.Qf){var a=t.Of.find(function(t){return t.id===String(e.ad.id)});if((null==a?void 0:a.phase)===o.Upcoming&&a.sourceIdentifier===(null===(r=t.context.sourceContext)||void 0===r?void 0:r.sourceIdentifier)){t.Vf(a.id);var s=(0,c.getSourceStore)(t.context);(null===(i=null===(n=null==s?void 0:s.getState())||void 0===n?void 0:n.buffer)||void 0===i?void 0:i.isLoadingRangeFinished)?t.Tf():(t.Uf(),t.Rf=null==s?void 0:s.subscribe(t.Tf,function(e,t){var r,n;return Boolean((null===(r=null==e?void 0:e.buffer)||void 0===r?void 0:r.isLoadingRangeFinished)&&!(null===(n=null==t?void 0:t.buffer)||void 0===n?void 0:n.isLoadingRangeFinished))}))}}},this.Tf=function(){var e,r=t.ig(o.Playing);!t.Qf&&r&&r.sourceIdentifier===(null===(e=t.context.sourceContext)||void 0===e?void 0:e.sourceIdentifier)&&(t.Wf(r.id),t.Uf())},e.eventHandler.on(l.PlayerEvent.AdStarted,this.Sf,!0)}return e.prototype.Uf=function(){var e;null===(e=this.Rf)||void 0===e||e.call(this),this.Rf=void 0},e.prototype.hasTrackedAds=function(){return this.Of.length>0},e.prototype.preloadAds=function(e){return!!this.trackAds(e)&&(this.jg(),!0)},e.prototype.trackAds=function(e){var t=this,r=function(e){return e.map(function(e){return{id:String(e.id),sourceConfig:(0,p.createSourceConfig)(e)}}).filter(function(e){return(0,d.isDefined)(e.sourceConfig.hls)||(0,d.isDefined)(e.sourceConfig.dash)})}(e);return!this.Qf&&0!==r.length&&!this.hasTrackedAds()&&(this.Of=this.Of.concat(r.map(function(e){return n(n({},e),{sourceIdentifier:(0,u.deriveSourceIdentifier)(e.sourceConfig,t.context.internalPlayerID),preload:i.None,phase:o.Upcoming})})),!0)},e.prototype.Vf=function(e){if(!this.Qf){var t=this.Of.find(function(t){return t.id===e&&t.phase!==o.Retired});t&&(this.Xf(t),this.Of.filter(function(e){return e.phase===o.Upcoming}).length)}},e.prototype.Wf=function(e){var t;this.Qf||(null===(t=this.ig(o.Playing))||void 0===t?void 0:t.id)!==e||(this.mg(function(e){return e.phase===o.Retired}),this.jg())},e.prototype.cancel=function(){this.Qf||(this.Of.length,this.mg(function(){return!0}),this.Uf())},e.prototype.dispose=function(){this.Qf||(this.cancel(),this.context.eventHandler.off(l.PlayerEvent.AdStarted,this.Sf),this.Qf=!0)},e.prototype.Xf=function(e){if(e.phase!==o.Playing){this.mg(function(e){return e.phase===o.Retired});for(var t=0,r=this.Of;t<r.length;t++){var n=r[t];if(n===e){n.phase=o.Playing;break}n.phase=o.Retired}this.Pf===e&&(this.Pf=void 0)}},e.prototype.ig=function(e){return this.Of.find(function(t){return t.phase===e})},e.prototype.jg=function(){var e=this.Of.find(function(e){return e.phase===o.Upcoming&&e.preload===i.None});!this.Pf&&e&&(e.preload=i.Pending,this.Pf=e,this.kg(e))},e.prototype.kg=function(e){var t,r=this,n=null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.PreloadingService);n?n.preloadSource(e.sourceConfig,s.ADVERTISING_ISSUER_NAME).then(function(){r.Pf===e&&(r.Pf=void 0),e.preload=i.Done,!r.Qf&&r.Of.includes(e)}).catch(function(t){r.lg(e)}):this.lg(e)},e.prototype.lg=function(e){e.preload=i.Failed,this.Pf===e&&(this.Pf=void 0),this.Of.includes(e)&&e.phase===o.Upcoming&&(this.ng(e),this.Qf||this.jg())},e.prototype.mg=function(e){var t=this.Of.filter(e);this.Of=this.Of.filter(function(t){return!e(t)}),this.Pf&&t.includes(this.Pf)&&(this.Pf=void 0);for(var r={},n=0,i=t;n<i.length;n++){var o=i[n];r[o.sourceIdentifier]||(r[o.sourceIdentifier]=!0,this.ng(o))}},e.prototype.ng=function(e){var t,r;this.Of.some(function(t){return t!==e&&t.sourceIdentifier===e.sourceIdentifier&&function(e){return e.phase!==o.Upcoming||e.preload===i.Pending||e.preload===i.Done}(t)})||null===(r=null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.PreloadingService))||void 0===r||r.cancelPreload(e.sourceIdentifier)},e}();t.AdPreloadingService=f},95217:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AdTrackingEvent=void 0,t.pingUrl=function(e){(new Image).src=e},function(e){e.FirstQuartile="firstQuartile",e.Midpoint="midpoint",e.ThirdQuartile="thirdQuartile"}(r||(t.AdTrackingEvent=r={}))},90176:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdvertisingController=t.adTagPlaceholderDefaults=void 0,t.applyModuleSpecificConfig=y,t.createPlayerAdvertisingApi=T;var n=r(4224),i=r(9768),o=r(3714),a=r(4129),s=r(29669),l=r(44468),u=r(87827),c=r(93204),d=r(94685),p=r(34841),f=r(88844),h=r(70850),v=r(88052),g=r(62756),E=r(45392),A={videoLoadTimeout:r(6365).DEFAULT_VIDEO_LOAD_TIMEOUT,strategy:{shouldLoadAdBreak:function(){return!0},shouldPlayAdBreak:function(){return!0},shouldPlaySkippedAdBreaks:function(e){var t=Math.max.apply(Math,e.map(function(e){return e.scheduleTime}));return[e.find(function(e){return e.scheduleTime===t})]}}};t.adTagPlaceholderDefaults={playbackTime:["[CONTENTPLAYHEAD]"],height:["[HEIGHT]"],width:["[WIDTH]"],domain:["[DOMAIN]"],page:["[SITE]"],referrer:["[REFERRER]"],random:["[random]","[CACHEBUSTING]"],timestamp:["[TIMESTAMP]"]};var m=function(){function e(e,t){var r=this;this.context=t,this.yg=function(e){r.og.isCastingToCAF()||r.ug.onTimeChanged(e.time)},this.zg=function(e){return r.ug.onSeek(e.position,e.seekTarget)},this.Ag=function(){var e,t;return null===(t=(e=r.ug).onSeeked)||void 0===t?void 0:t.call(e)},this.Bg=function(){var e,t;return null===(t=(e=r.ug).onPlay)||void 0===t?void 0:t.call(e)},this.Cg=function(e){return r.xg=e.position},this.Dg=function(){r.zg({position:r.xg,seekTarget:r.og.getCurrentTime(i.ADVERTISING_ISSUER_NAME)}),r.Ag()},this.Eg=function(e){r.tg&&e.code===n.WarningCode.PLAYBACK_COULD_NOT_BE_STARTED&&(r.tg=!1)},this.onVolumeChanged=function(e){return r.ug.onVolumeChanged(e)},this.Fg=function(){r.qg.length>0&&r.Hg(r.qg.splice(0,r.qg.length)),r.og.off(o.PlayerEvent.SourceLoaded,r.Fg)},this.onPlayerResize=function(e,t){r.ug.onResize(e,t,r.og.getViewMode()===l.ViewMode.Fullscreen)};var a=e.getConfig(!0);this.pg=a.advertising||{},this.og=e,this.qg=[],this.rg=null,this.sg=!0,this.tg=!1;var s=function(e,t){var r,n,i={},o={};return h.Util.deepCopy(o,e),delete o.adBreaks,h.Util.deepCopyMulti(i,A,o),i.hasOwnProperty("withCredentials")||(i.withCredentials=!0),i.hasOwnProperty("disableStorageApi")||(i.disableStorageApi=null!==(n=null===(r=t.storage)||void 0===r?void 0:r.disableStorageApi)&&void 0!==n&&n),i}(this.pg,a);y(a,s,t.logger),this.createAdvertisingModule(s),this.pg.adBreaks&&this.pg.adBreaks.length>0&&this.pg.adBreaks.splice(0).forEach(function(e){return r.scheduleAd(e).catch(function(e){})}),this.og.on(o.PlayerEvent.TimeChanged,this.yg),this.og.on(o.PlayerEvent.Seek,this.zg),this.og.on(o.PlayerEvent.Seeked,this.Ag),this.og.onInternal(o.PlayerEvent.Play,this.Bg),this.og.on(o.PlayerEvent.Warning,this.Eg),this.og.on(o.PlayerEvent.TimeShift,this.Cg),this.og.on(o.PlayerEvent.TimeShifted,this.Dg),this.playerAdvertisingApi=T(this,this.ug)}return e.prototype.createAdvertisingModule=function(e){var t,r,n=new E.AdManifestHelper(new a.DefaultContentLoader(this.context,{requestType:s.HttpRequestType.MANIFEST_ADS}),e.videoLoadTimeout,null===(t=e.withCredentials)||void 0===t||t,null!==(r=e.disableStorageApi)&&void 0!==r&&r);this.wg={internalPlayer:this.og,context:this.context,restoreContentDeferred:null};var i=v.ModuleManager.get(g.ModuleName.AdvertisingCore),o=v.ModuleManager.get(g.ModuleName.Advertising),l=new i.AdPlayerDelegate(this.wg);this.ug=new o(l,e,n),this.vg=l},e.prototype.updatePlayerContext=function(e){this.context=e,this.wg.context=e},e.prototype.initializeAdModule=function(){this.ug.initialize()},e.prototype.onContentPaused=function(e){var t,r;(0,i.isUserInitiatedPause)(e)&&!this.og.isCasting()&&this.og.getViewMode()!==l.ViewMode.PictureInPicture&&(null===(r=(t=this.ug).onContentPaused)||void 0===r||r.call(t))},e.prototype.scheduleAd=function(e){return R(e)&&(e.discardAfterPlayback=!1!==e.discardAfterPlayback,this.Gg(e)&&!this.Jg())?(this.qg.push(e),this.rg||(this.rg=new p.Deferred,this.og.on(o.PlayerEvent.SourceLoaded,this.Fg)),this.rg.promise):this.Ig(e)},e.prototype.Gg=function(e){return e.position.includes("%")&&"0%"!==e.position},e.prototype.Hg=function(e){var t=this,r=e.map(function(e){return t.Ig(e)});this.rg&&Promise.all(r).then(function(e){var r=[].concat.apply([],e);t.rg.resolve(r),t.rg=null}).catch(function(e){})},e.prototype.Ig=function(e){return R(e)&&this.og.isLive()&&this.Gg(e)?Promise.reject("percentage based ad break positions can not be used for live streams"):this.ug.schedule(e)},e.prototype.playPreRollAds=function(){var e,t,r=this,n=Promise.resolve();return this.tg=!0,this.sg&&(null===(t=null===(e=this.context)||void 0===e?void 0:e.videoElement)||void 0===t?void 0:t.prime)&&(n=this.context.videoElement.prime()),Promise.resolve(this.ug.beforeContent()).catch(function(e){(0,d.isContextAvailable)(r.context)}).then(function(){return n}).catch(function(e){(0,d.isContextAvailable)(r.context)})},e.prototype.playPostRollAds=function(){var e=this,t=!1,r=function(){t=!0,e.og.off(o.PlayerEvent.AdBreakStarted,r)};return this.og.on(o.PlayerEvent.AdBreakStarted,r),this.wg.restoreContentDeferred=new p.Deferred,Promise.resolve(this.ug.afterContent()).then(function(){return new Promise(function(r,n){if(t){var i,o=function(){e.wg.restoreContentDeferred.promise.then(r).catch(n),a(),(0,f.clearTimeoutIfDefined)(i)},a=(0,c.subscribe)(e.context.store)(function(e){return(0,u.getIsStopped)((0,u.getPlayerState)(e))},o,function(e){return e});i=window.setTimeout(o,1e3)}else r()})}).then(function(){return e.wg.restoreContentDeferred=null}).catch(function(t){e.wg.restoreContentDeferred=null})},e.prototype.hasAlreadyRequestedPreRollAds=function(){return this.tg},e.prototype.play=function(){return this.ug.resume(),Promise.resolve()},e.prototype.pause=function(){this.ug.pause()},e.prototype.getCurrentTime=function(){var e,t=null===(e=this.ug)||void 0===e?void 0:e.currentTime();return isNaN(t)?0:null!=t?t:0},e.prototype.getDuration=function(){return this.ug.duration()},e.prototype.isLinearAdActive=function(){return this.ug.isLinearAdActive()},e.prototype.isPlaying=function(){return this.ug.isLinearAdActive(!0)},e.prototype.isPaused=function(){return this.isLinearAdActive()&&!this.isPlaying()},e.prototype.Jg=function(){return this.og.getDuration()>0},e.prototype.reset=function(){return this.qg=[],this.tg=!1,this.vg.reset(),this.ug.reset()},e.prototype.dispose=function(){this.og.off(o.PlayerEvent.TimeChanged,this.yg),this.og.off(o.PlayerEvent.Seek,this.zg),this.og.off(o.PlayerEvent.Seeked,this.Ag),this.og.off(o.PlayerEvent.Play,this.Bg),this.og.off(o.PlayerEvent.Warning,this.Eg),this.og.off(o.PlayerEvent.TimeShift,this.Cg),this.og.off(o.PlayerEvent.TimeShifted,this.Dg),this.og=null,this.pg=null,this.ug.dispose(),this.ug=null,this.vg=null},e}();function y(e,t,r){Boolean(v.ModuleManager.get(g.ModuleName.Advertising).bitmovinMarker)?function(e,t){var r=t;e.playback&&Array.isArray(e.playback.preferredTech)?r.preferredTechnology=e.playback.preferredTech:r.preferredTechnology=[]}(e,t):Boolean(v.ModuleManager.get(g.ModuleName.Advertising).imaMarker)&&function(e,t){var r=t;r.sdkUrl||(r.sdkUrl=e.location.google_ima)}(e,t)}function T(e,t){return new(function(){function r(){}return r.prototype.schedule=function(t){return e.scheduleAd(t)},r.prototype.skip=function(){return t.skip()},r.prototype.list=function(){return t.list()},r.prototype.getActiveAdBreak=function(){return t.getActiveAdBreak()},r.prototype.getActiveAd=function(){return t.getActiveAd()},r.prototype.discardAdBreak=function(e){t.discardAdBreak(e)},r.prototype.isLinearAdActive=function(){return t.isLinearAdActive()},r.prototype.getModuleInfo=function(){return t.getModuleInfo()},r}())}function R(e){return Boolean(e.position)}t.AdvertisingController=m},28412:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AdvertisingModule=void 0;var r=function(){return function(e,t,r){this.player=e,this.config=t,this.adManifestHelper=r}}();t.AdvertisingModule=r},88457:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AdvertisingModuleErrorCode=void 0,function(e){e[e.AD_TAG_TYPE_NOT_MATCHING=110]="AD_TAG_TYPE_NOT_MATCHING",e[e.COULD_NOT_LOAD_AD_MANIFEST=404]="COULD_NOT_LOAD_AD_MANIFEST",e[e.REQUIRED_PLAYER_MODULE_MISSING=2e3]="REQUIRED_PLAYER_MODULE_MISSING"}(r||(t.AdvertisingModuleErrorCode=r={}))},23912:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AdTagType=void 0,function(e){e.VAST="vast",e.VMAP="vmap",e.VPAID="vpaid"}(r||(t.AdTagType=r={}))},93531:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.calculatePlaybackRestorationPosition=function(e){var t=e.adBreakDuration,r=e.isLive,n=e.playbackPosition,i=e.replaceContentDuration,o=e.resumeLiveContentAtPreviousPosition;return n+(null!=i?i:!r||o?0:t)},t.calculateTimeshiftRestorationPosition=function(e){var t=e.adBreakDuration,r=e.playbackPosition,i=e.replaceContentDuration,o=e.resumeLiveContentAtPreviousPosition?t:0,a=(0,n.isDefined)(i)?t-i:o;return Math.min(r-a,0)};var n=r(23068)},6365:function(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.VastApiFramework=t.MediaFileDeliveryType=t.DEFAULT_OVERLAY_AD_BOTTOM_POSITION=t.DEFAULT_VIDEO_LOAD_TIMEOUT=t.NON_SKIPPABLE_IDENTIFIER=t.DEFAULT_PRELOAD_OFFSET=t.DEFAULT_PAUSE_AD_ACTIVATION_DELAY=void 0,t.DEFAULT_PAUSE_AD_ACTIVATION_DELAY=1,t.DEFAULT_PRELOAD_OFFSET=0,t.NON_SKIPPABLE_IDENTIFIER=-1,t.DEFAULT_VIDEO_LOAD_TIMEOUT=8e3,t.DEFAULT_OVERLAY_AD_BOTTOM_POSITION="4.5em",function(e){e.Progressive="progressive",e.Streaming="streaming"}(r||(t.MediaFileDeliveryType=r={})),function(e){e.Vpaid="vpaid"}(n||(t.VastApiFramework=n={}))},65185:function(e,t){function r(e){return e.bitrate||(e.maxBitrate+e.minBitrate)/2}Object.defineProperty(t,"__esModule",{value:!0}),t.findMediaFileByResolution=function(e,t,r){return r.reduce(function(r,n){var i=Math.abs(e-r.width)+Math.abs(t-r.height);return Math.abs(e-n.width)+Math.abs(t-n.height)<i?n:r})},t.findMediaFileByBitrate=function(e,t){return t.reduce(function(t,n){var i=r(t),o=r(n),a=Math.abs(i-e);return Math.abs(o-e)<a?n:t})}},7581:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VastErrorCode=t.AdvertisingModuleErrorCode=t.AdTagType=t.AdvertisingCoreModuleDefinition=void 0;var n=r(62756),i=r(43255),o=r(42163),a=r(90176),s=r(88457);Object.defineProperty(t,"AdvertisingModuleErrorCode",{enumerable:!0,get:function(){return s.AdvertisingModuleErrorCode}});var l=r(23912);Object.defineProperty(t,"AdTagType",{enumerable:!0,get:function(){return l.AdTagType}});var u=r(47091);Object.defineProperty(t,"VastErrorCode",{enumerable:!0,get:function(){return u.VastErrorCode}}),t.AdvertisingCoreModuleDefinition={name:n.ModuleName.AdvertisingCore,module:function(){return{AdvertisingController:a.AdvertisingController,AdPlayerDelegate:i.AdPlayerDelegate,AdPreloadingService:o.AdPreloadingService}},dependencies:[n.ModuleName.XML],exports:{AdTagType:l.AdTagType,AdvertisingModuleErrorCode:s.AdvertisingModuleErrorCode,VastErrorCode:u.VastErrorCode}},t.default=t.AdvertisingCoreModuleDefinition},60326:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VastClientWrapper=void 0;var n=r(6036),i=r(6365),o=r(47091),a=function(){function e(e,t,r){this.VP=new n.VASTClient({allowUsingBrowserStorageApi:!r}),this.VP.vastParser.initParsingStatus(),this.WP=e||i.DEFAULT_VIDEO_LOAD_TIMEOUT,this.XP=t}return e.prototype.parseManifest=function(e,t){var r=this,n=[],i=function(e){n.push({code:e.ERRORCODE})};return this.VP.vastParser.addListener("VAST-error",i),this.VP.vastParser.parseVAST(e,{timeout:this.WP,withCredentials:this.XP,replaceUnavailableAdPodAds:!t}).catch(function(e){return r.VP.vastParser.removeListener("VAST-error",i),Promise.reject({code:e&&e.ERRORCODE||o.VastErrorCode.UNDEFINED_ERROR})}).then(function(e){var t;return r.VP.vastParser.removeListener("VAST-error",i),(null===(t=e.ads)||void 0===t?void 0:t.length)>0?e:n.length>0?Promise.reject(n[0]):Promise.reject({code:o.VastErrorCode.UNDEFINED_ERROR})})},e}();t.VastClientWrapper=a},47091:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VastErrorCode=void 0,function(e){e[e.XML_PARSING_ERROR=100]="XML_PARSING_ERROR",e[e.VAST_SCHEMA_VALIDATION_ERROR=101]="VAST_SCHEMA_VALIDATION_ERROR",e[e.VERSION_NOT_SUPPORTED=102]="VERSION_NOT_SUPPORTED",e[e.TRAFFICKING_ERROR=200]="TRAFFICKING_ERROR",e[e.EXPECTING_DIFFERENT_LINEARITY=201]="EXPECTING_DIFFERENT_LINEARITY",e[e.EXPECTING_DIFFERENT_DURATION=202]="EXPECTING_DIFFERENT_DURATION",e[e.EXPECTING_DIFFERENT_SIZE=203]="EXPECTING_DIFFERENT_SIZE",e[e.GENERAL_WRAPPER_ERROR=300]="GENERAL_WRAPPER_ERROR",e[e.WRAPPER_VAST_URI_TIMEOUT=301]="WRAPPER_VAST_URI_TIMEOUT",e[e.WRAPPER_LIMIT_REACHED=302]="WRAPPER_LIMIT_REACHED",e[e.NO_ADS_VAST_RESPONSE=303]="NO_ADS_VAST_RESPONSE",e[e.INLINE_AD_DISPLAY_TIMEOUT=304]="INLINE_AD_DISPLAY_TIMEOUT",e[e.GENERAL_LINEAR_ERROR=400]="GENERAL_LINEAR_ERROR",e[e.FILE_NOT_FOUND=401]="FILE_NOT_FOUND",e[e.MEDIAFILE_URI_TIMEOUT=402]="MEDIAFILE_URI_TIMEOUT",e[e.NO_SUPPORTED_MEDIAFILE=403]="NO_SUPPORTED_MEDIAFILE",e[e.PROBLEM_DISPLAYING_MEDIAFILE=405]="PROBLEM_DISPLAYING_MEDIAFILE",e[e.GENERAL_NONLINEARADS_ERROR=500]="GENERAL_NONLINEARADS_ERROR",e[e.NONLINEAR_AD_INVALID_DIMENSIONS=501]="NONLINEAR_AD_INVALID_DIMENSIONS",e[e.UNABLE_TO_FETCH_NONLINEAR_RESOURCE=502]="UNABLE_TO_FETCH_NONLINEAR_RESOURCE",e[e.NO_SUPPORTED_NONLINEAR_RESOURCE_TYPE=503]="NO_SUPPORTED_NONLINEAR_RESOURCE_TYPE",e[e.GENERAL_COMPANIONADS_ERROR=600]="GENERAL_COMPANIONADS_ERROR",e[e.COMPANION_AD_INVALID_DIMENSIONS=601]="COMPANION_AD_INVALID_DIMENSIONS",e[e.UNABLE_TO_DISPLAY_REQUIRED_COMPANION=602]="UNABLE_TO_DISPLAY_REQUIRED_COMPANION",e[e.UNABLE_TO_FETCH_COMPANION_RESOURCE=603]="UNABLE_TO_FETCH_COMPANION_RESOURCE",e[e.NO_SUPPORTED_COMPANION_RESOURCE_TYPE=604]="NO_SUPPORTED_COMPANION_RESOURCE_TYPE",e[e.UNDEFINED_ERROR=900]="UNDEFINED_ERROR",e[e.GENERAL_VPAID_ERROR=901]="GENERAL_VPAID_ERROR"}(r||(t.VastErrorCode=r={}))},5838:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VmapExtractor=void 0;var n=r(70850),i=r(88052),o=r(62756),a=r(45392),s=r(88457),l=r(23912),u=r(6365),c=r(47091),d=function(){function e(){}return e.xml2js=function(e){return(0,i.ModuleManager.get(o.ModuleName.XML).parseXML)(e,{decodeEntities:!1,useArrayRepresentationForChildren:!0})},e.js2xml=function(e){return(0,i.ModuleManager.get(o.ModuleName.XML).parseJSONtoXML)(e)},e.extractAdBreakConfigs=function(t,r){return e.getParsedManifest(t.tag.url,r).then(function(r){if(r.manifest.VMAP){var n=e.parseVmapAdBreaks(r.manifest,t);return Promise.resolve({adBreakConfigs:n,downloadTiming:r.downloadTiming})}return Promise.reject({code:s.AdvertisingModuleErrorCode.AD_TAG_TYPE_NOT_MATCHING})})},e.getParsedManifest=function(t,r){return r.downloadVmapManifest(t).catch(function(){return Promise.reject({code:s.AdvertisingModuleErrorCode.COULD_NOT_LOAD_AD_MANIFEST})}).then(function(t){if(!t.body)return Promise.reject({code:c.VastErrorCode.XML_PARSING_ERROR});try{var r=e.xml2js(t.body),n=r.success?r.parsed:{},i={downloadTime:t.elapsedTime,timeToFirstByte:t.timeToFirstByte};return Promise.resolve({manifest:n,downloadTiming:i})}catch(e){return Promise.reject({code:c.VastErrorCode.XML_PARSING_ERROR})}})},e.parseVmapAdBreaks=function(t,r){return e.extractAdBreaks(t).map(function(e){var t,i={id:e.id||n.Util.generateUniqueId(),tag:{url:e.tag,type:l.AdTagType.VAST},position:e.offset,preloadOffset:null!==(t=r.preloadOffset)&&void 0!==t?t:u.DEFAULT_PRELOAD_OFFSET};r.hasOwnProperty("replaceContentDuration")&&(i.replaceContentDuration=r.replaceContentDuration),r.passthroughMode&&(i.passthroughMode=r.passthroughMode);var o={publicAdBreakConfig:i};return e.trackingEvents&&Object.keys(e.trackingEvents).length>0&&(o.trackingEvents=e.trackingEvents),o})||[]},e.extractAdBreaks=function(t){return t.VMAP?t.VMAP.AdBreak.map(function(t){var r=t._breakId,n=t._timeOffset;switch(n){case"start":n="pre";break;case"end":n="post"}var i=e.getAdBreakUri(t),o=[];return t.TrackingEvents&&t.TrackingEvents[0]&&t.TrackingEvents[0].Tracking&&t.TrackingEvents[0].Tracking.forEach(function(e){var t=e._event.toLocaleLowerCase();o.push({type:t,url:e.toString()})}),{id:r,offset:n,tag:i,trackingEvents:o}}):[]},e.getAdBreakUri=function(t){var r,n,i,o=null===(r=t.AdSource)||void 0===r?void 0:r[0],s=null===(n=null==o?void 0:o.AdTagURI)||void 0===n?void 0:n[0],l=null===(i=null==o?void 0:o.VASTAdData)||void 0===i?void 0:i[0];return(null==s?void 0:s.toString)?s.toString():l?(0,a.toDataUri)(e.js2xml(l)):""},e}();t.VmapExtractor=d},63207:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Ad=void 0;var r=function(){return function(){this.id=null,this.wrapperAdIds=[],this.sequence=null,this.system=null,this.title=null,this.description=null,this.advertiser=null,this.pricing=null,this.survey=null,this.errorURLTemplates=[],this.impressionURLTemplates=[],this.creatives=[],this.extensions=[],this.verifications=[]}}();t.Ad=r},19637:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AdExtension=void 0;var r=function(){function e(){this.name=null,this.value=null,this.attributes={},this.children=[]}return e.prototype.isEmpty=function(){return null===this.value&&0===Object.keys(this.attributes).length&&0===this.children.length},e}();t.AdExtension=r},31472:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CompanionAd=void 0;var r=function(){return function(){this.id=null,this.width=0,this.height=0,this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.altText=null,this.companionClickThroughURLTemplate=null,this.companionClickTrackingURLTemplates=[],this.trackingEvents={}}}();t.CompanionAd=r},36828:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Creative=void 0;var r=function(){return function(e){void 0===e&&(e={}),this.id=e.id||null,this.adId=e.adId||null,this.universalAdId=e.universalAdId||null,this.sequence=e.sequence||null,this.apiFramework=e.apiFramework||null,this.trackingEvents={}}}();t.Creative=r},81214:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.CreativeCompanion=void 0;var i=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.type="companion",r.variations=[],r}return n(t,e),t}(r(36828).Creative);t.CreativeCompanion=i},77615:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.CreativeLinear=void 0;var i=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.type="linear",r.duration=0,r.skipDelay=null,r.mediaFiles=[],r.videoClickThroughURLTemplate=null,r.videoClickTrackingURLTemplates=[],r.videoCustomClickURLTemplates=[],r.adParameters=null,r.icons=[],r}return n(t,e),t}(r(36828).Creative);t.CreativeLinear=i},35475:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.CreativeNonLinear=void 0;var i=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.type="nonlinear",r.variations=[],r}return n(t,e),t}(r(36828).Creative);t.CreativeNonLinear=i},50199:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Icon=void 0;var r=function(){return function(){this.program=null,this.height=0,this.width=0,this.xPosition=0,this.yPosition=0,this.apiFramework=null,this.offset=null,this.duration=0,this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.iconClickThroughURLTemplate=null,this.iconClickTrackingURLTemplates=[],this.iconViewTrackingURLTemplate=null}}();t.Icon=r},36629:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaFile=void 0;var r=function(){return function(){this.id=null,this.fileURL=null,this.deliveryType="progressive",this.mimeType=null,this.codec=null,this.bitrate=0,this.minBitrate=0,this.maxBitrate=0,this.width=0,this.height=0,this.apiFramework=null,this.scalable=null,this.maintainAspectRatio=null}}();t.MediaFile=r},57219:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.NonLinearAd=void 0;var r=function(){return function(){this.id=null,this.width=0,this.height=0,this.expandedWidth=0,this.expandedHeight=0,this.scalable=!0,this.maintainAspectRatio=!0,this.minSuggestedDuration=0,this.apiFramework="static",this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.nonlinearClickThroughURLTemplate=null,this.nonlinearClickTrackingURLTemplates=[],this.adParameters=null}}();t.NonLinearAd=r},71119:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseAd=function(e){var t=e.childNodes;for(var r in t){var n=t[r];if(-1!==["Wrapper","InLine"].indexOf(n.nodeName)){if(l.parserUtils.copyNodeAttribute("id",e,n),l.parserUtils.copyNodeAttribute("sequence",e,n),"Wrapper"===n.nodeName)return c(n);if("InLine"===n.nodeName)return u(n)}}},t.parseExtensions=d;var n=r(63207),i=r(19637),o=r(93088),a=r(2035),s=r(64815),l=r(75065);function u(e){var t=e.childNodes,r=new n.Ad;for(var i in r.id=e.getAttribute("id")||null,r.sequence=e.getAttribute("sequence")||null,t){var u=t[i];switch(u.nodeName){case"Error":r.errorURLTemplates.push(l.parserUtils.parseNodeText(u));break;case"Impression":r.impressionURLTemplates.push(l.parserUtils.parseNodeText(u));break;case"Creatives":l.parserUtils.childrenByName(u,"Creative").forEach(function(e){var t={id:e.getAttribute("id")||null,adId:h(e),sequence:e.getAttribute("sequence")||null,apiFramework:e.getAttribute("apiFramework")||null};for(var n in e.childNodes){var i=e.childNodes[n];switch(i.nodeName){case"UniversalAdId":t.universalAdId=v(i);break;case"Linear":var l=(0,a.parseCreativeLinear)(i,t);l&&r.creatives.push(l);break;case"NonLinearAds":var u=(0,s.parseCreativeNonLinear)(i,t);u&&r.creatives.push(u);break;case"CompanionAds":var c=(0,o.parseCreativeCompanion)(i,t);c&&r.creatives.push(c)}}});break;case"Extensions":r.extensions=d(l.parserUtils.childrenByName(u,"Extension"),r);break;case"AdSystem":r.system={value:l.parserUtils.parseNodeText(u),version:u.getAttribute("version")||null};break;case"AdTitle":r.title=l.parserUtils.parseNodeText(u);break;case"Description":r.description=l.parserUtils.parseNodeText(u);break;case"Advertiser":r.advertiser={name:l.parserUtils.parseNodeText(u),id:u.getAttribute("id")||null};break;case"Pricing":r.pricing={value:l.parserUtils.parseNodeText(u),model:u.getAttribute("model")||null,currency:u.getAttribute("currency")||null};break;case"Survey":r.survey={uri:l.parserUtils.parseNodeText(u),type:u.getAttribute("type")||null};break;case"AdVerifications":f(r.verifications,l.parserUtils.childrenByName(u,"Verification"))}}return r}function c(e){var t=u(e),r=l.parserUtils.childByName(e,"VASTAdTagURI");if(r?t.nextWrapperURL=l.parserUtils.parseNodeText(r):(r=l.parserUtils.childByName(e,"VASTAdTagURL"))&&(t.nextWrapperURL=l.parserUtils.parseNodeText(l.parserUtils.childByName(r,"URL"))),t.creatives.forEach(function(e){if(-1!==["linear","nonlinear"].indexOf(e.type)){if(e.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[e.type]||(t.trackingEvents[e.type]={});var r=function(r){var n=e.trackingEvents[r];t.trackingEvents[e.type][r]||(t.trackingEvents[e.type][r]=[]),n.forEach(function(n){t.trackingEvents[e.type][r].push(n)})};for(var n in e.trackingEvents)r(n)}e.videoClickTrackingURLTemplates&&(t.videoClickTrackingURLTemplates||(t.videoClickTrackingURLTemplates=[]),e.videoClickTrackingURLTemplates.forEach(function(e){t.videoClickTrackingURLTemplates.push(e)})),e.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate),e.videoCustomClickURLTemplates&&(t.videoCustomClickURLTemplates||(t.videoCustomClickURLTemplates=[]),e.videoCustomClickURLTemplates.forEach(function(e){t.videoCustomClickURLTemplates.push(e)}))}}),t.nextWrapperURL)return t}function d(e,t){var r=[];return e.forEach(function(e){var n=p(e,t);n&&r.push(n)}),r}function p(e,t){if("#comment"===e.nodeName)return null;var r=new i.AdExtension,n=e.attributes,o=e.childNodes;if(r.name=e.nodeName,e.attributes)for(var a in n)if(n.hasOwnProperty(a)){var s=n[a];s.nodeName&&s.nodeValue&&(r.attributes[s.nodeName]=s.nodeValue)}for(var u in o)if(o.hasOwnProperty(u)){if("AdVerifications"===o[u].nodeName){f(t.verifications,l.parserUtils.childrenByName(o[u],"Verification"));continue}var c=p(o[u],t);c&&r.children.push(c)}if(0===r.children.length||1===r.children.length&&["#cdata-section","#text"].indexOf(r.children[0].name)>=0){var d=l.parserUtils.parseNodeText(e);""!==d&&(r.value=d),r.children=[]}return r.isEmpty()?null:r}function f(e,t){var r=["Verification","JavaScriptResource","ExecutableResource","TrackingEvents","Tracking","VerificationParameters"],n=function(e){var t={},i=l.parserUtils.parseNodeText(e);return Object.keys(e.attributes).forEach(function(r){var n=e.attributes[r].nodeName,i=e.attributes[r].nodeValue;n&&i&&(t[n]=i)}),"#comment"!==e.nodeName&&""!==i&&(e.children&&e.children.length>0?e.childNodes.forEach(function(e){r.includes(e.nodeName)&&(t[e.nodeName]||(t[e.nodeName]=[]),t[e.nodeName].push(n(e)))}):t.content=i),t};t.forEach(function(t){var r=n(t);e.push(r)})}function h(e){return e.getAttribute("AdID")||e.getAttribute("adID")||e.getAttribute("adId")||null}function v(e){return{idRegistry:e.getAttribute("idRegistry")||"unknown",value:l.parserUtils.parseNodeText(e)||"unknown"}}},93088:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCreativeCompanion=function(e,t){var r=new i.CreativeCompanion(t);return o.parserUtils.childrenByName(e,"Companion").forEach(function(e){var t=new n.CompanionAd;t.id=e.getAttribute("id")||null,t.width=e.getAttribute("width"),t.height=e.getAttribute("height"),t.companionClickTrackingURLTemplates=[],o.parserUtils.childrenByName(e,"HTMLResource").forEach(function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"IFrameResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"StaticResource").forEach(function(r){t.type=r.getAttribute("creativeType")||0,o.parserUtils.childrenByName(e,"AltText").forEach(function(e){t.altText=o.parserUtils.parseNodeText(e)}),t.staticResource=o.parserUtils.parseNodeText(r)}),o.parserUtils.childrenByName(e,"TrackingEvents").forEach(function(e){o.parserUtils.childrenByName(e,"Tracking").forEach(function(e){var r=e.getAttribute("event"),n=o.parserUtils.parseNodeText(e);r&&n&&(null==t.trackingEvents[r]&&(t.trackingEvents[r]=[]),t.trackingEvents[r].push(n))})}),o.parserUtils.childrenByName(e,"CompanionClickTracking").forEach(function(e){t.companionClickTrackingURLTemplates.push(o.parserUtils.parseNodeText(e))}),t.companionClickThroughURLTemplate=o.parserUtils.parseNodeText(o.parserUtils.childByName(e,"CompanionClickThrough")),t.companionClickTrackingURLTemplate=o.parserUtils.parseNodeText(o.parserUtils.childByName(e,"CompanionClickTracking")),r.variations.push(t)}),r};var n=r(31472),i=r(81214),o=r(75065)},2035:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCreativeLinear=function(e,t){var r,s=new n.CreativeLinear(t);s.duration=a.parserUtils.parseDuration(a.parserUtils.parseNodeText(a.parserUtils.childByName(e,"Duration")));var l=e.getAttribute("skipoffset");if(null==l)s.skipDelay=null;else if("%"===l.charAt(l.length-1)&&-1!==s.duration){var u=parseInt(l,10);s.skipDelay=s.duration*(u/100)}else s.skipDelay=a.parserUtils.parseDuration(l);var c=a.parserUtils.childByName(e,"VideoClicks");c&&(s.videoClickThroughURLTemplate=a.parserUtils.parseNodeText(a.parserUtils.childByName(c,"ClickThrough")),a.parserUtils.childrenByName(c,"ClickTracking").forEach(function(e){s.videoClickTrackingURLTemplates.push(a.parserUtils.parseNodeText(e))}),a.parserUtils.childrenByName(c,"CustomClick").forEach(function(e){s.videoCustomClickURLTemplates.push(a.parserUtils.parseNodeText(e))}));var d=a.parserUtils.childByName(e,"AdParameters");d&&(s.adParameters=a.parserUtils.parseNodeText(d)),a.parserUtils.childrenByName(e,"TrackingEvents").forEach(function(e){a.parserUtils.childrenByName(e,"Tracking").forEach(function(e){var t=e.getAttribute("event"),n=a.parserUtils.parseNodeText(e);if(t&&n){if("progress"===t){if(!(r=e.getAttribute("offset")))return;t="%"===r.charAt(r.length-1)?"progress-".concat(r):"progress-".concat(Math.round(a.parserUtils.parseDuration(r)))}null==s.trackingEvents[t]&&(s.trackingEvents[t]=[]),s.trackingEvents[t].push(n)}})}),a.parserUtils.childrenByName(e,"MediaFiles").forEach(function(e){a.parserUtils.childrenByName(e,"MediaFile").forEach(function(e){var t=new o.MediaFile;t.id=e.getAttribute("id"),t.fileURL=a.parserUtils.parseNodeText(e),t.deliveryType=e.getAttribute("delivery"),t.codec=e.getAttribute("codec"),t.mimeType=e.getAttribute("type"),t.apiFramework=e.getAttribute("apiFramework"),t.bitrate=parseInt(e.getAttribute("bitrate")||0),t.minBitrate=parseInt(e.getAttribute("minBitrate")||0),t.maxBitrate=parseInt(e.getAttribute("maxBitrate")||0),t.width=parseInt(e.getAttribute("width")||0),t.height=parseInt(e.getAttribute("height")||0);var r=e.getAttribute("scalable");r&&"string"==typeof r&&("true"===(r=r.toLowerCase())?t.scalable=!0:"false"===r&&(t.scalable=!1));var n=e.getAttribute("maintainAspectRatio");n&&"string"==typeof n&&("true"===(n=n.toLowerCase())?t.maintainAspectRatio=!0:"false"===n&&(t.maintainAspectRatio=!1)),s.mediaFiles.push(t)})});var p=a.parserUtils.childByName(e,"Icons");return p&&a.parserUtils.childrenByName(p,"Icon").forEach(function(e){var t=new i.Icon;t.program=e.getAttribute("program"),t.height=parseInt(e.getAttribute("height")||0),t.width=parseInt(e.getAttribute("width")||0),t.xPosition=function(e){return-1!==["left","right"].indexOf(e)?e:parseInt(e||0)}(e.getAttribute("xPosition")),t.yPosition=function(e){return-1!==["top","bottom"].indexOf(e)?e:parseInt(e||0)}(e.getAttribute("yPosition")),t.apiFramework=e.getAttribute("apiFramework"),t.offset=a.parserUtils.parseDuration(e.getAttribute("offset")),t.duration=a.parserUtils.parseDuration(e.getAttribute("duration")),a.parserUtils.childrenByName(e,"HTMLResource").forEach(function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=a.parserUtils.parseNodeText(e)}),a.parserUtils.childrenByName(e,"IFrameResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=a.parserUtils.parseNodeText(e)}),a.parserUtils.childrenByName(e,"StaticResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.staticResource=a.parserUtils.parseNodeText(e)});var r=a.parserUtils.childByName(e,"IconClicks");r&&(t.iconClickThroughURLTemplate=a.parserUtils.parseNodeText(a.parserUtils.childByName(r,"IconClickThrough")),a.parserUtils.childrenByName(r,"IconClickTracking").forEach(function(e){t.iconClickTrackingURLTemplates.push(a.parserUtils.parseNodeText(e))})),t.iconViewTrackingURLTemplate=a.parserUtils.parseNodeText(a.parserUtils.childByName(e,"IconViewTracking")),s.icons.push(t)}),s};var n=r(77615),i=r(50199),o=r(36629),a=r(75065)},64815:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCreativeNonLinear=function(e,t){var r=new n.CreativeNonLinear(t);return o.parserUtils.childrenByName(e,"TrackingEvents").forEach(function(e){var t,n;o.parserUtils.childrenByName(e,"Tracking").forEach(function(e){t=e.getAttribute("event"),n=o.parserUtils.parseNodeText(e),t&&n&&(null==r.trackingEvents[t]&&(r.trackingEvents[t]=[]),r.trackingEvents[t].push(n))})}),o.parserUtils.childrenByName(e,"NonLinear").forEach(function(e){var t=new i.NonLinearAd;t.id=e.getAttribute("id")||null,t.width=e.getAttribute("width"),t.height=e.getAttribute("height"),t.expandedWidth=e.getAttribute("expandedWidth"),t.expandedHeight=e.getAttribute("expandedHeight"),t.scalable=o.parserUtils.parseBoolean(e.getAttribute("scalable")),t.maintainAspectRatio=o.parserUtils.parseBoolean(e.getAttribute("maintainAspectRatio")),t.minSuggestedDuration=o.parserUtils.parseDuration(e.getAttribute("minSuggestedDuration")),t.apiFramework=e.getAttribute("apiFramework"),o.parserUtils.childrenByName(e,"HTMLResource").forEach(function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"IFrameResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"StaticResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.staticResource=o.parserUtils.parseNodeText(e)});var n=o.parserUtils.childByName(e,"AdParameters");n&&(t.adParameters=o.parserUtils.parseNodeText(n)),t.nonlinearClickThroughURLTemplate=o.parserUtils.parseNodeText(o.parserUtils.childByName(e,"NonLinearClickThrough")),o.parserUtils.childrenByName(e,"NonLinearClickTracking").forEach(function(e){t.nonlinearClickTrackingURLTemplates.push(o.parserUtils.parseNodeText(e))}),r.variations.push(t)}),r};var n=r(35475),i=r(57219),o=r(75065)},75065:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parserUtils=void 0;var n=r(11417);t.parserUtils={childByName:function(e,t){var r=e.childNodes;for(var n in r){var i=r[n];if(i.nodeName===t)return i}},childrenByName:function(e,t){var r=[],n=e.childNodes;for(var i in n){var o=n[i];o.nodeName===t&&r.push(o)}return r},resolveVastAdTagURI:function(e,t){if(!t)return e;if(0===e.indexOf("//")){var r=location.protocol;return"".concat(r).concat(e)}if(-1===e.indexOf("://")){var n=t.slice(0,t.lastIndexOf("/"));return"".concat(n,"/").concat(e)}return e},parseBoolean:function(e){return-1!==["true","TRUE","1"].indexOf(e)},parseNodeText:function(e){return e&&(e.textContent||e.text||"").trim()},copyNodeAttribute:function(e,t,r){var n=t.getAttribute(e);n&&r.setAttribute(e,n)},parseDuration:function(e){if(null==e)return-1;if(n.util.isNumeric(e))return parseInt(e);var t=e.split(":");if(3!==t.length)return-1;var r=t[2].split("."),i=parseInt(r[0]);2===r.length&&(i+=parseFloat("0.".concat(r[1])));var o=parseInt(60*t[1]),a=parseInt(60*t[0]*60);return isNaN(a)||isNaN(o)||isNaN(i)||o>3600||i>60?-1:a+o+i},splitVAST:function(e){var t=[],r=null;return e.forEach(function(n,i){if(n.sequence&&(n.sequence=parseInt(n.sequence,10)),n.sequence>1){var o=e[i-1];if(o&&o.sequence===n.sequence-1)return void(r&&r.push(n));delete n.sequence}r=[n],t.push(r)}),t},mergeWrapperAdData:function(e,t){if(e.errorURLTemplates=t.errorURLTemplates.concat(e.errorURLTemplates),e.impressionURLTemplates=t.impressionURLTemplates.concat(e.impressionURLTemplates),e.extensions=t.extensions.concat(e.extensions),e.verifications=t.verifications.concat(e.verifications),e.wrapperAdIds.push(t.id),e.creatives.forEach(function(e){if(t.trackingEvents&&t.trackingEvents[e.type])for(var r in t.trackingEvents[e.type]){var n=t.trackingEvents[e.type][r];e.trackingEvents[r]||(e.trackingEvents[r]=[]),e.trackingEvents[r]=e.trackingEvents[r].concat(n)}}),t.videoClickTrackingURLTemplates&&t.videoClickTrackingURLTemplates.length&&e.creatives.forEach(function(e){"linear"===e.type&&(e.videoClickTrackingURLTemplates=e.videoClickTrackingURLTemplates.concat(t.videoClickTrackingURLTemplates))}),t.videoCustomClickURLTemplates&&t.videoCustomClickURLTemplates.length&&e.creatives.forEach(function(e){"linear"===e.type&&(e.videoCustomClickURLTemplates=e.videoCustomClickURLTemplates.concat(t.videoCustomClickURLTemplates))}),t.videoClickThroughURLTemplate&&e.creatives.forEach(function(e){"linear"===e.type&&null==e.videoClickThroughURLTemplate&&(e.videoClickThroughURLTemplate=t.videoClickThroughURLTemplate)}),e.fallbackAdSequence&&e.sequence!==e.fallbackAdSequence){if(!t.sequence&&!t.fallbackAdSequence)return;e.sequence=null,e.fallbackAdSequence=t.fallbackAdSequence||t.sequence}else if(t.fallbackAdSequence)e.sequence=null,e.fallbackAdSequence=t.fallbackAdSequence||t.sequence;else{if(!t.sequence&&!t.fallbackAdSequence)return;e.sequence=t.sequence}}}},29902:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.VASTParser=void 0;var o=r(71119),a=r(37007),s=r(75065),l=r(27294),u=r(11417),c=r(71076),d={ERRORCODE:900,extensions:[]},p=function(e){function t(){var t=e.call(this)||this;return t.remainingAds=[],t.parentURLs=[],t.errorURLTemplates=[],t.rootErrorURLTemplates=[],t.maxWrapperDepth=null,t.URLTemplateFilters=[],t.fetchingOptions={},t.currentAdSequence=null,t}return n(t,e),t.prototype.addURLTemplateFilter=function(e){"function"==typeof e&&this.URLTemplateFilters.push(e)},t.prototype.removeURLTemplateFilter=function(){this.URLTemplateFilters.pop()},t.prototype.countURLTemplateFilters=function(){return this.URLTemplateFilters.length},t.prototype.clearURLTemplateFilters=function(){this.URLTemplateFilters=[]},t.prototype.trackVastError=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this.emit("VAST-error",Object.assign.apply(Object,i([d,t],r,!1))),u.util.track(e,t)},t.prototype.getErrorURLTemplates=function(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates)},t.prototype.fetchVAST=function(e,t,r){var n=this;return new Promise(function(i,o){n.URLTemplateFilters.forEach(function(t){e=t(e)}),n.parentURLs.push(e),n.emit("VAST-resolving",{url:e,wrapperDepth:t,originalUrl:r}),n.urlHandler.get(e,n.fetchingOptions,function(t,r){n.emit("VAST-resolved",{url:e,error:t}),t?o(t):i(r)})})},t.prototype.initParsingStatus=function(e){void 0===e&&(e={}),this.rootURL="",this.remainingAds=[],this.parentURLs=[],this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.maxWrapperDepth=e.wrapperLimit||10,this.fetchingOptions={timeout:e.timeout,withCredentials:e.withCredentials},this.urlHandler=e.urlhandler||l.urlHandler},t.prototype.getRemainingAds=function(e){var t=this;if(0===this.remainingAds.length)return Promise.reject(new Error("No more ads are available for the given VAST"));var r=e?u.util.flatten(this.remainingAds):this.remainingAds.shift();return this.errorURLTemplates=[],this.parentURLs=[],this.resolveAds(r,{wrapperDepth:0,originalUrl:this.rootURL}).then(function(e){return t.buildVASTResponse(e)})},t.prototype.getAndParseVAST=function(e,t){var r=this;return void 0===t&&(t={}),this.initParsingStatus(t),this.rootURL=e,this.fetchVAST(e).then(function(n){return t.originalUrl=e,t.isRootVAST=!0,r.parse(n,t).then(function(e){return r.buildVASTResponse(e,t)})})},t.prototype.parseVAST=function(e,t){var r=this;return void 0===t&&(t={}),this.initParsingStatus(t),t.isRootVAST=!0,this.parse(e,t).then(function(e){return r.buildVASTResponse(e,t)})},t.prototype.getPodAds=function(e){return e.filter(function(e){return null!=e.sequence})},t.prototype.getStandaloneAds=function(e){return e.filter(function(e){return null==e.sequence})},t.prototype.hasMediaFiles=function(e){return!(!e||null!=e.errorCode)&&(Array.isArray(e.creatives)?e.creatives:[]).some(function(e){return e.mediaFiles&&e.mediaFiles.length>0})},t.prototype.replaceUnavailableAdPodAds=function(e){var t=this,r=this.getPodAds(e),n=this.getStandaloneAds(e).filter(this.hasMediaFiles);return 0===r.length||0===n.length?e:(r=r.map(function(e){return t.hasMediaFiles(e)?e:n.shift()}).filter(Boolean),n.forEach(function(e){return e.isFallback=!0}),r.concat(n))},t.prototype.markFallbackAds=function(e){return this.getPodAds(e).length>0&&this.getStandaloneAds(e).forEach(function(e){return e.isFallback=!0}),e},t.prototype.buildVASTResponse=function(e,t){void 0===t&&(t={});var r=new c.VASTResponse;return r.errorURLTemplates=this.getErrorURLTemplates(),e.forEach(function(e){return e.isFallback=!1}),r.ads=t.replaceUnavailableAdPodAds?this.replaceUnavailableAdPodAds(e):this.markFallbackAds(e),this.completeWrapperResolving(r),r},t.prototype.parse=function(e,t){var r=this,n=t.resolveAll,i=void 0===n||n,a=t.wrapperSequence,l=void 0===a?null:a,u=t.originalUrl,c=void 0===u?null:u,d=t.wrapperDepth,p=void 0===d?0:d,f=t.isRootVAST,h=void 0!==f&&f,v=t.parentAdSequence,g=void 0===v?null:v;if(!e||!e.documentElement||"VAST"!==e.documentElement.nodeName)return Promise.reject(new Error("Invalid VAST XMLDocument"));var E=[],A=e.documentElement.childNodes;for(var m in A){var y=A[m];if("Error"===y.nodeName){var T=s.parserUtils.parseNodeText(y);h?this.rootErrorURLTemplates.push(T):this.errorURLTemplates.push(T)}if("Ad"===y.nodeName){var R=(0,o.parseAd)(y);R?E.push(R):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}var P=E.length,_=E[P-1];return 1===P&&null!=l&&_&&!_.sequence&&(_.sequence=l),E.forEach(function(e){return r.handleFallbackAdSequence(e,g)}),!1===i&&(this.remainingAds=s.parserUtils.splitVAST(E),E=this.remainingAds.shift()),this.resolveAds(E,{wrapperDepth:p,originalUrl:c})},t.prototype.handleFallbackAdSequence=function(e,t){null==e.sequence?e.fallbackAdSequence=t||this.currentAdSequence:this.currentAdSequence=e.sequence},t.prototype.resolveAds=function(e,t){var r=this;void 0===e&&(e=[]);var n=t.wrapperDepth,i=t.originalUrl,o=[];return e.forEach(function(e){var t=r.resolveWrappers(e,n,i);o.push(t)}),Promise.all(o).then(function(e){var t=u.util.flatten(e);if(!t&&r.remainingAds.length>0){var o=r.remainingAds.shift();return r.resolveAds(o,{wrapperDepth:n,originalUrl:i})}return t})},t.prototype.resolveWrappers=function(e,t,r){var n=this;return new Promise(function(i){if(t++,!e.nextWrapperURL)return delete e.nextWrapperURL,i(e);if(t>=n.maxWrapperDepth||-1!==n.parentURLs.indexOf(e.nextWrapperURL))return e.errorCode=302,delete e.nextWrapperURL,i(e);e.nextWrapperURL=s.parserUtils.resolveVastAdTagURI(e.nextWrapperURL,r);var o=e.sequence;r=e.nextWrapperURL,n.fetchVAST(e.nextWrapperURL,t,r).then(function(a){return n.parse(a,{originalUrl:r,wrapperSequence:o,wrapperDepth:t,parentAdSequence:e.sequence||e.fallbackAdSequence}).then(function(t){if(delete e.nextWrapperURL,0===t.length)return e.creatives=[],i(e);t.forEach(function(t){t&&s.parserUtils.mergeWrapperAdData(t,e)}),i(t)})}).catch(function(t){e.errorCode=301,e.errorMessage=t.message,i(e)})})},t.prototype.completeWrapperResolving=function(e){if(0===e.ads.length)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(var t=e.ads.length-1;t>=0;t--){var r=e.ads[t];(r.errorCode||0===r.creatives.length)&&(this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:r.errorCode||303},{ERRORMESSAGE:r.errorMessage||""},{extensions:r.extensions},{system:r.system}),e.ads.splice(t,1))}},t}(a.EventEmitter);t.VASTParser=p},27294:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.urlHandler=void 0;var n=r(82664),i=r(13769),o=r(2860);t.urlHandler={get:function(e,t,r){return r||("function"==typeof t&&(r=t),t={}),"undefined"==typeof window||null===window?i.nodeURLHandler.get(e,t,r):o.XHRURLHandler.supported()?o.XHRURLHandler.get(e,t,r):n.flashURLHandler.supported()?n.flashURLHandler.get(e,t,r):r(new Error("Current context is not supported by any of the default URLHandlers. Please provide a custom URLHandler"))}}},82664:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.flashURLHandler=void 0,t.flashURLHandler={get:function(e,t,r){var n="function"==typeof window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLDOM"):void 0;if(!n)return r(new Error("FlashURLHandler: Microsoft.XMLDOM format not supported"));n.async=!1;var i=i();request.open("GET",e),request.timeout=t.timeout||0,request.withCredentials=t.withCredentials||!1,request.send(),request.onprogress=function(){},request.onload=function(){n.loadXML(request.responseText),r(null,n)}},supported:function(){return!!function(){var e;return window.XDomainRequest&&(e=new XDomainRequest),e}()}}},13769:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.nodeURLHandler=void 0,t.nodeURLHandler={get:function(e,t,r){r(new Error("Please bundle the library for node to use the node urlHandler"))}}},2860:function(e,t){function r(){try{var e=new window.XMLHttpRequest;return"withCredentials"in e?e:null}catch(e){return console.log("Error in XHRURLHandler support check:",e),null}}Object.defineProperty(t,"__esModule",{value:!0}),t.XHRURLHandler=void 0,t.XHRURLHandler={get:function(e,t,n){if("https:"===window.location.protocol&&0===e.indexOf("http://"))return n(new Error("XHRURLHandler: Cannot go from HTTPS to HTTP."));try{var i=r();i.open("GET",e),i.timeout=t.timeout||0,i.withCredentials=t.withCredentials||!1,i.overrideMimeType&&i.overrideMimeType("text/xml"),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?n(null,i.responseXML):n(new Error("XHRURLHandler: ".concat(i.statusText))))},i.send()}catch(e){n(new Error("XHRURLHandler: Unexpected error"))}},supported:function(){return!!r()}}},1100:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;var r=null,n={data:{},length:0,getItem:function(e){return this.data[e]},setItem:function(e,t){this.data[e]=t,this.length=Object.keys(this.data).length},removeItem:function(e){delete data[e],this.length=Object.keys(this.data).length},clear:function(){this.data={},this.length=0}},i=function(){function e(e){this.storage=this.initStorage(e)}return e.prototype.initStorage=function(e){if(r&&("undefined"==typeof window||null===window||Object.getPrototypeOf(r)!==window.Storage.prototype||e))return r;try{r="undefined"!=typeof window&&null!==window?window.localStorage||window.sessionStorage:null}catch(e){r=null}return r&&e&&!this.isStorageDisabled(r)||(r=n).clear(),r},e.prototype.isStorageDisabled=function(e){var t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0}catch(e){return!0}return e.removeItem(t),!1},e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.setItem=function(e,t){return this.storage.setItem(e,t)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.clear=function(){return this.storage.clear()},e}();t.Storage=i},11417:function(e,t){function r(e,t){void 0===t&&(t={});var r=[];t.ASSETURI&&(t.ASSETURI=n(t.ASSETURI)),t.CONTENTPLAYHEAD&&(t.CONTENTPLAYHEAD=n(t.CONTENTPLAYHEAD)),t.ERRORCODE&&!/^[0-9]{3}$/.test(t.ERRORCODE)&&(t.ERRORCODE=900),t.CACHEBUSTING=i(Math.round(1e8*Math.random()).toString()),t.TIMESTAMP=n((new Date).toISOString()),t.RANDOM=t.random=t.CACHEBUSTING;for(var o=0,a=e;o<a.length;o++){var s=a[o];if("string"==typeof s){for(var l in t){var u=t[l],c="[".concat(l,"]"),d="%%".concat(l,"%%");s=(s=s.replace(c,u)).replace(d,u)}r.push(s)}}return r}function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%".concat(e.charCodeAt(0).toString(16))})}function i(e){return e.length<8?o(0,8-e.length,!1).map(function(e){return"0"}).join("")+e:e}function o(e,t,r){for(var n=[],i=e<t,o=r?i?t+1:t-1:t,a=e;i?a<o:a>o;i?a++:a--)n.push(a);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.util=void 0,t.util={track:function(e,t){r(e,t).forEach(function(e){"undefined"!=typeof window&&null!==window&&((new Image).src=e)})},resolveURLTemplates:r,encodeURIComponentRFC3986:n,leftpad:i,range:o,isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},flatten:function e(t){return t.reduce(function(t,r){return t.concat(Array.isArray(r)?e(r):r)},[])}}},6036:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VASTClient=void 0;var n=r(1100),i=r(29902),o=function(){function e(e){e=e||{},this.cappingFreeLunch=e.cappingFreeLunch||0,this.cappingMinimumTimeInterval=e.cappingMinimumTimeInterval||0,this.defaultOptions={withCredentials:!1,timeout:0},this.vastParser=new i.VASTParser;var t=null==e.allowUsingBrowserStorageApi||e.allowUsingBrowserStorageApi;this.storage=e.customStorage||new n.Storage(t),void 0===this.lastSuccessfulAd&&(this.lastSuccessfulAd=0),void 0===this.totalCalls&&(this.totalCalls=0),void 0===this.totalCallsTimeout&&(this.totalCallsTimeout=0)}return e.prototype.getParser=function(){return this.vastParser},Object.defineProperty(e.prototype,"lastSuccessfulAd",{get:function(){return this.storage.getItem("vast-client-last-successful-ad")},set:function(e){this.storage.setItem("vast-client-last-successful-ad",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalCalls",{get:function(){return this.storage.getItem("vast-client-total-calls")},set:function(e){this.storage.setItem("vast-client-total-calls",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalCallsTimeout",{get:function(){return this.storage.getItem("vast-client-total-calls-timeout")},set:function(e){this.storage.setItem("vast-client-total-calls-timeout",e)},enumerable:!1,configurable:!0}),e.prototype.hasRemainingAds=function(){return this.vastParser.remainingAds.length>0},e.prototype.getNextAds=function(e){return this.vastParser.getRemainingAds(e)},e.prototype.get=function(e,t){var r=this;void 0===t&&(t={});var n=Date.now();return(t=Object.assign(this.defaultOptions,t)).hasOwnProperty("resolveAll")||(t.resolveAll=!1),this.totalCallsTimeout<n?(this.totalCalls=1,this.totalCallsTimeout=n+36e5):this.totalCalls++,new Promise(function(i,o){if(r.cappingFreeLunch>=r.totalCalls)return o(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(r.totalCalls,"/").concat(r.cappingFreeLunch)));var a=n-r.lastSuccessfulAd;if(a<0)r.lastSuccessfulAd=0;else if(a<r.cappingMinimumTimeInterval)return o(new Error("VAST call canceled – (".concat(r.cappingMinimumTimeInterval,")ms minimum interval reached")));r.vastParser.getAndParseVAST(e,t).then(function(e){return i(e)}).catch(function(e){return o(e)})})},e}();t.VASTClient=o},71076:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.VASTResponse=void 0;var r=function(){return function(){this.ads=[],this.errorURLTemplates=[]}}();t.VASTResponse=r}},function(e){return function(){return e(7581)}()}])});
17
+ "use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["advertising-core"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["advertising-core"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[561],{28610:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VmapTrackingEventType=void 0,function(e){e.BreakStart="breakstart",e.BreakEnd="breakend",e.Error="error"}(r||(t.VmapTrackingEventType=r={}))},76713:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PAUSE_AD_POSITION=t.DEFAULT_AD_BREAK_POSITION=void 0,t.isPauseAdBreak=function(e){return(null==e?void 0:e.position)===t.PAUSE_AD_POSITION},t.DEFAULT_AD_BREAK_POSITION="pre",t.PAUSE_AD_POSITION="pause"},45392:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdManifestHelper=void 0,t.xmlToString=function(e){return(new XMLSerializer).serializeToString(e.documentElement)},t.toDataUri=function(e){return"data:text/xml,"+encodeURIComponent(e)},t.pingVmapTrackingUrls=function(e,t){void 0===e&&(e=[]),e.filter(function(e){return e.type===t}).forEach(function(e){return(0,i.pingUrl)(e.url)})};var n=r(70850),i=r(95217),o=r(88457),a=r(60326),s=r(47091),l=function(){function e(e,t,r,n){this.loader=e,this.videoLoadTimeout=t,this.withCredentials=r,this.disableStorage=n}return e.prototype.downloadVastManifest=function(e){var t,r=this;return null!==(t=this.FM)&&void 0!==t||(this.FM=new DOMParser),this.loader.load(e,void 0,void 0,void 0,void 0,this.withCredentials).catch(function(){return Promise.reject({code:o.AdvertisingModuleErrorCode.COULD_NOT_LOAD_AD_MANIFEST})}).then(function(e){var t;if(!e.body)return Promise.reject({code:s.VastErrorCode.XML_PARSING_ERROR});var n=r.FM.parseFromString(e.body,"text/xml"),i=null===(t=n.childNodes[0].childNodes[0])||void 0===t?void 0:t.nodeName.includes("Error"),a=void 0===i||i,l=n.childNodes[0].nodeName.includes("error");if(n.childNodes[0].nodeName.includes("VMAP"))return Promise.reject({code:o.AdvertisingModuleErrorCode.AD_TAG_TYPE_NOT_MATCHING});if(a)return Promise.reject({code:s.VastErrorCode.NO_ADS_VAST_RESPONSE});if(l)return Promise.reject({code:s.VastErrorCode.XML_PARSING_ERROR});var u={downloadTime:e.elapsedTime,timeToFirstByte:e.timeToFirstByte};return Promise.resolve({manifest:n,downloadTiming:u})})},e.prototype.downloadVmapManifest=function(e){return this.loader.load(e,void 0,void 0,void 0,void 0,this.withCredentials)},e.prototype.parseAdVerifications=function(e){var t;return null!==(t=this.GM)&&void 0!==t||(this.GM=new a.VastClientWrapper(this.videoLoadTimeout,this.withCredentials,this.disableStorage)),this.GM.parseManifest(e,!1).then(function(e){if(e.ads.length<1)return Promise.resolve([]);var t=e.ads.map(function(e){return{id:e.id||"adVerification-"+n.Util.generateUniqueId(),verifications:e.verifications}});return Promise.resolve(t)}).catch(function(e){return Promise.resolve([])})},e}();t.AdManifestHelper=l},63524:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlaybackFactory=void 0;var n=r(60937),i=r(52448),o=function(){function e(){}return e.create=function(e,t){var r=!1,o=function(){r=!1},a=function(e){var t="The current ad playback has to be finished by calling ".concat(e,".done(), before a new one can be requested.");return Promise.reject(t)};return new(function(){function s(){}return s.prototype.requestPlayer=function(){return r?a("AdPlayerAPI"):(r=!0,Promise.resolve(i.AdPlayerFactory.createAdPlayer(e,o)))},s.prototype.requestReporter=function(){return r?a("AdPlaybackReportingAPI"):(r=!0,Promise.resolve(new n.AdPlaybackReporter(e,o)))},s.prototype.done=function(e){return void 0===e&&(e=!0),t(e)},s}())},e}();t.AdPlaybackFactory=o},60937:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlaybackReporter=void 0;var n=r(9768),i=r(3714),o=r(19483),a=function(){return function(e,t){var r=this,a=new o.ArrayMap;this.videoElement=e.getVideoElement();var s=!1,l=function(){if(s)throw"AdPlaybackReporter is no longer usable. Request a new one."},u=this.videoElement.addEventListener;this.videoElement.addEventListener=function(e,t,n){a.add(e,t),u.apply(r.videoElement,[e,t,n])},this.started=function(t){if(l(),r.d5)throw"Ad playback is already in progress. A new one can not be started.";r.d5=t,r.e5=!1,e.hasCurrentSourcePlayedOnce()||e.fireEvent(i.PlayerEvent.Playing,{time:e.getCurrentTime(),issuer:n.ADVERTISING_ISSUER_NAME}),e.fireEvent(i.PlayerEvent.AdStarted,{ad:t})},this.paused=function(t){l(),e.fireEvent(i.PlayerEvent.Paused,{time:t,issuer:n.ADVERTISING_ISSUER_NAME})},this.resumed=function(t){l(),e.fireEvent(i.PlayerEvent.Play,{time:t,issuer:n.ADVERTISING_ISSUER_NAME}),e.fireEvent(i.PlayerEvent.Playing,{time:t,issuer:n.ADVERTISING_ISSUER_NAME})},this.timeupdate=function(t){l(),e.fireEvent(i.PlayerEvent.TimeChanged,{time:t,issuer:n.ADVERTISING_ISSUER_NAME})},this.skipped=function(){r.e5||(l(),e.fireEvent(i.PlayerEvent.AdSkipped,{ad:r.d5}),r.e5=!0,r.d5=null)},this.done=function(){return l(),a.forAll(function(e,t){r.videoElement.removeEventListener(e,t),r.videoElement.addEventListener=u}),!r.e5&&r.d5&&e.fireEvent(i.PlayerEvent.AdFinished,{ad:r.d5}),r.d5=null,t(),s=!0,Promise.resolve()}}}();t.AdPlaybackReporter=a},43255:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlayerDelegate=void 0;var i=r(40306),o=r(80813),a=r(9768),s=r(3714),l=r(51289),u=r(90408),c=r(20213),d=r(18192),p=r(94685),f=r(41138),h=r(63524),v=r(44202),g=r(65185),E=r(47091),A=function(){function e(t){this.logger=t.context.logger;var r,p=t.internalPlayer,f=new v.AdPlayerStateStore(t.context,p),A=Promise.resolve(),y=!1,R=!1,P=!1,_={width:0,height:0},S=[],N=function(e){e.code===c.WarningCode.PLAYBACK_COULD_NOT_BE_STARTED&&(R=!0)};p.onInternal(s.PlayerEvent.PlayerResized,function(e){var t=m(e.width),r=m(e.height);_={width:t,height:r}});var U=function(){R=!1};this.getVideoElement=function(){return p.getVideoElement()},this.getVolume=function(){return p.isMuted()?0:p.getVolume()},this.isContentPaused=function(){return p.isContentPaused()},this.isContentSeeking=function(){return p.isContentSeeking()},this.parsePosition=function(t){var r;return r=f.hasStoredState()?f.getStoredState().contentDuration:p.getDuration(),e.parsePosition(t,r)},this.selectMediaFile=function(e){var r=e.every(function(e){return e.bitrate||e.minBitrate&&e.maxBitrate}),n=p.getDownloadedVideoData(),i=p.getDownloadedAudioData(),a=Boolean(i&&n&&n.bitrate>0),s=t.context.serviceManager.get(o.ServiceName.AdaptationService);return r&&(s||a)?O(e,[n,i],s):function(e,t,r){return r&&r.width>0?(0,g.findMediaFileByResolution)(r.width,r.height,e):(0,g.findMediaFileByResolution)(t.width,t.height,e)}(e,_,n)};var O=function(e,t,r){var n=t[0],i=t[1];return r?r.selectQualityBasedOnBitrateMeasurement(e):(0,g.findMediaFileByBitrate)(n.bitrate+i.bitrate,e)};this.metadataLoaded=function(e,t){var r={adBreak:null,downloadTiming:t};e.hasOwnProperty("scheduleTime")&&(r.adBreak=e),r.adConfig=e,p.fireEvent(s.PlayerEvent.AdManifestLoaded,r)};var I=function(){S.forEach(function(e){return p.fireEvent(s.PlayerEvent.Error,{type:s.PlayerEvent.Error,code:e.code,name:e.name,message:e.message,data:e.data,troubleShootLink:(0,l.generateTroubleshootUrl)(e.code)})})},b=function(e){if(!f.hasStoredState())return Promise.resolve();var n=f.getStoredState().contentDuration,l=Promise.resolve();return y=!e,e&&(l=A=function(){return S.length?function(){return p.removeExternalEventFilter(C),f.clear(),p.off(s.PlayerEvent.Warning,N),p.off(s.PlayerEvent.Playing,U),p.unload().then(I)}():(p.fireEvent(s.PlayerEvent.RestoringContent),p.addExternalEventFilter(D),f.restore(a.ADVERTISING_RESTORE_ISSUER_NAME).then(function(e){if(p.removeExternalEventFilter(C),S.length)throw new Error("Background errors occurred during ad break");if(R)R=!1;else{if(e)return p.play(a.ADVERTISING_ISSUER_NAME).catch(function(e){P=!0});var r=t.context.serviceManager.get(o.ServiceName.PlayerStateService);null==r||r.transitionToStoppedState()}}).catch(function(){S.length?I():p.fireEvent(s.PlayerEvent.Error,{code:i.ErrorCode.UNKNOWN})}).finally(function(){f.clear(),p.removeExternalEventFilter(D),p.off(s.PlayerEvent.Warning,N),p.off(s.PlayerEvent.Playing,U)}))}().then(function(){t.restoreContentDeferred&&t.restoreContentDeferred.resolve()})),l.then(function(){var i=r?{adBreak:r}:void 0;p.fireEvent(s.PlayerEvent.AdBreakFinished,i),r=null,e&&(0,u.maybeFireDurationChangedEvent)(n,p.getDuration(),t.context.eventHandler),p.hasCurrentSourcePlayedOnce()||P||p.fireEvent(s.PlayerEvent.Playing,{time:p.getCurrentTime(),issuer:a.ADVERTISING_ISSUER_NAME}),P=!1})},k=[s.PlayerEvent.Error,s.PlayerEvent.SourceLoaded,s.PlayerEvent.SourceUnloaded,s.PlayerEvent.PlaybackFinished,s.PlayerEvent.Ready],C=function(e,r){var n=function(){var e=t.context.store.getState();return(null==e?void 0:e.sources)&&Object.keys(e.sources).find(function(t){var r;return e.sources&&e.sources[t]&&(null===(r=e.sources[t].playback)||void 0===r?void 0:r.kind)===d.PlaybackKind.Background})}();return T(e,r)&&n&&r.sourceIdentifier===n&&S.push(r),!k.includes(e)},L=[s.PlayerEvent.Play,s.PlayerEvent.Playing,s.PlayerEvent.Seek,s.PlayerEvent.Seeked,s.PlayerEvent.TimeShift,s.PlayerEvent.TimeShifted],D=function(e){return!L.includes(e)};this.requestAdPlayback=function(e){return r?Promise.reject("Ad break already in progress"):(r=e,A.then(function(){var t=y?Promise.resolve():M(e),r={adBreak:n(n({},JSON.parse(JSON.stringify(e))),{scheduleTime:e.scheduleTime})};return p.fireEvent(s.PlayerEvent.AdBreakStarted,r),p.onInternal(s.PlayerEvent.Warning,N),p.onInternal(s.PlayerEvent.Playing,U),t.then(function(){return p.unload(a.ADVERTISING_ISSUER_NAME)}).then(function(){return h.AdPlaybackFactory.create(p,b)})}))},this.updateAdRestoreState=function(e){r&&f.setAdRestoreState(e)};var M=function(r){var n=t.context,i=n.sourceContext.sourceIdentifier,s=n.adRestorationOptimizationService,l=n.serviceManager.get(o.ServiceName.ManifestService,i),u=s&&n.settings.OPTIMIZE_AD_RESTORATION,c=e.getAdBreakDuration(r),d=r.replaceContentDuration;return f.capture(a.ADVERTISING_ISSUER_NAME),f.setAdRestoreState({adBreakDuration:c,replaceContentDuration:d}),p.addExternalEventFilter(C),u&&l&&!l.isLive()?s.optimizeRestorationAfterUpcomingAdBreak():Promise.resolve()};this.overlayAdStarted=function(e){p.fireEvent(s.PlayerEvent.OverlayAdStarted,{ad:e})},this.nonLinearAdStarted=function(e,t){p.fireEvent(s.PlayerEvent.NonLinearAdStarted,{ad:e,position:t})},this.nonLinearAdFinished=function(e,t){p.fireEvent(s.PlayerEvent.NonLinearAdFinished,{ad:e,position:t})},this.nonLinearAdSkipped=function(e,t){p.fireEvent(s.PlayerEvent.NonLinearAdSkipped,{ad:e,position:t})},this.adClicked=function(e){p.fireEvent(s.PlayerEvent.AdClicked,{clickThroughUrl:e})},this.adInteraction=function(e,t){p.fireEvent(s.PlayerEvent.AdInteraction,{interactionType:e,id:t})},this.onQuartile=function(e){p.fireEvent(s.PlayerEvent.AdQuartile,{quartile:e})},this.onError=function(e,t,r){var n={code:e||E.VastErrorCode.UNDEFINED_ERROR};t&&(n.message=t),r&&(n.adConfig=r),p.fireEvent(s.PlayerEvent.AdError,{code:i.ErrorCode.MODULE_ADVERTISING_ERROR,data:n,name:i.ErrorCode[i.ErrorCode.MODULE_ADVERTISING_ERROR],message:t,troubleShootLink:(0,l.generateTroubleshootUrl)(i.ErrorCode.MODULE_ADVERTISING_ERROR)})},this.onWarning=function(e,t,r){p.fireEvent(s.PlayerEvent.Warning,new c.PlayerWarning(e,t,r))},this.reset=function(){var t=p.getVideoElement();y=!1,R=!1,f.clear(),p.removeExternalEventFilter(C),p.removeExternalEventFilter(D),r&&t instanceof HTMLVideoElement&&e.clearVideoElement(t),r=null}}return e.getAdBreakDuration=function(e){var t,r,n=e.totalPlannedDuration;return null!=n?n:null!==(r=null===(t=e.ads)||void 0===t?void 0:t.reduce(function(e,t){var r;return e+(t.isLinear&&null!==(r=t.duration)&&void 0!==r?r:0)},0))&&void 0!==r?r:0},e.parsePosition=function(e,t){var r=Number(e);return!isNaN(r)&&r<=0&&(e="pre"),e.includes("pre")||"0%"===e?0:e.includes("post")?1/0:this.parseNumericalPosition(e,t)},e.parseNumericalPosition=function(e,t){var r;if(/%/.test(e)){if(!t)return NaN;e=e.replace(/%/gi,""),r=parseFloat(e)/100*t}else if(e.indexOf(":")>-1){var n=e.split(":");r=3600*parseFloat(n[0])+60*parseFloat(n[1])+parseFloat(n[2])}else r=parseFloat(e);return r>=0?r:NaN},e.clearVideoElement=function(e){f.VideoElementUtil.removeSource(e),e.load()},e}();t.AdPlayerDelegate=A;var y=/(\d+)/;function m(e){return Number(e.match(y)?e.match(y)[0]:0)}var T=function(e,t){return e===s.PlayerEvent.Error&&(0,p.isObject)(t)}},52448:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlayerFactory=t.DEFAULT_AD_PLAYBACK_RATE=void 0,t.createSourceConfig=d;var n=r(40306),i=r(9768),o=r(3714),a=r(19483),s=r(85434),l=r(6365),u=r(7581);t.DEFAULT_AD_PLAYBACK_RATE=1;var c=function(){function e(){}return e.createAdPlayer=function(e,r){var s,l=new a.ArrayMap,c=!1,p=!1,f=[o.PlayerEvent.Play,o.PlayerEvent.Playing],h=function(){if(p)throw"AdPlayer is no longer usable. Request a new one."};return new(function(){function a(){this.adPlaybackStartEventFilter=function(t){return!e.hasCurrentSourcePlayedOnce()||!f.includes(t)}}return a.prototype.done=function(t){void 0===t&&(t=!1),h();var n=Promise.resolve();return c?n=e.unload(i.ADVERTISING_ISSUER_NAME):t||e.hasEnded()?function(e,t){e.fireEvent(o.PlayerEvent.AdFinished,{ad:t})}(e,s):function(e,t){e.fireEvent(o.PlayerEvent.AdSkipped,{ad:t})}(e,s),s=null,l.forAll(function(t,r){e.off(t,r)}),r(),p=!0,c=!1,n},a.prototype.on=function(t,r){h(),l.add(t,r),e.onInternal(t,r)},a.prototype.pause=function(){h(),e.pause(i.ADVERTISING_ISSUER_NAME)},a.prototype.play=function(){return h(),e.play(i.ADVERTISING_ISSUER_NAME)},a.prototype.load=function(r,a){var l=this;return h(),s=r,e.addExternalEventFilter(this.adPlaybackStartEventFilter),c=!0,e.load(d(r),void 0,null!=a?a:{seeking:!0},i.ADVERTISING_ISSUER_NAME).then(function(){return e.setPlaybackSpeed(t.DEFAULT_AD_PLAYBACK_RATE)}).then(function(){return e.play(i.ADVERTISING_ISSUER_NAME).catch(function(){})}).then(function(){c&&e.fireEvent(o.PlayerEvent.AdStarted,{ad:r})}).catch(function(e){if(e&&e.code===n.ErrorCode.MODULE_MISSING)throw{code:u.AdvertisingModuleErrorCode.REQUIRED_PLAYER_MODULE_MISSING,message:e.data.name};throw e}).finally(function(){e.removeExternalEventFilter(l.adPlaybackStartEventFilter),c=!1})},Object.defineProperty(a.prototype,"duration",{get:function(){return h(),e.getDuration(i.ADVERTISING_ISSUER_NAME)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"currentTime",{get:function(){return h(),e.getCurrentTime(i.ADVERTISING_ISSUER_NAME)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"volume",{get:function(){return h(),e.getVolume()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"muted",{get:function(){return h(),e.isMuted()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"paused",{get:function(){h();var t=e.isContentPaused(),r=e.isContentPlaying();return!1===t&&!1===r||t},enumerable:!1,configurable:!0}),a}())},e}();function d(e){return e.data.delivery===l.MediaFileDeliveryType.Streaming?s.MimeTypeHelper.isDash(e.data.mimeType)?{dash:e.mediaFileUrl}:{hls:e.mediaFileUrl}:{progressive:e.mediaFileUrl}}t.AdPlayerFactory=c},44202:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?i(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdPlayerStateStore=void 0;var a=r(80813),s=r(3714),l=r(44468),u=r(29488),c=r(46922),d=r(81524),p=r(18192),f=r(15487),h=r(88844),v=r(93531),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.SK=null,t}return n(t,e),t.prototype.setAdRestoreState=function(e){this.hasStoredState()&&(this.SK=e,this.VK())},t.prototype.TK=function(){var e,t,r=null!==(t=null===(e=this.storedState)||void 0===e?void 0:e.sourceIdentifier)&&void 0!==t?t:this.context.sourceContext.sourceIdentifier;return this.context.serviceManager.get(a.ServiceName.SourceStoreService,r)},t.prototype.UK=function(){if(!this.storedState)return NaN;if(!this.SK)return this.storedState.playbackPosition;var e={adBreakDuration:this.SK.adBreakDuration,isLive:this.storedState.isLive,replaceContentDuration:this.SK.replaceContentDuration,playbackPosition:this.storedState.playbackPosition,resumeLiveContentAtPreviousPosition:this.context.settings.RESUME_LIVE_CONTENT_AT_PREVIOUS_POSITION_AFTER_AD_BREAK};return this.storedState.useTimeshiftForRestore?(0,v.calculateTimeshiftRestorationPosition)(e):(0,v.calculatePlaybackRestorationPosition)(e)},t.prototype.VK=function(){var e;if(this.storedState){var t=this.UK();null===(e=this.TK())||void 0===e||e.dispatch((0,c.setBackgroundPlaybackState)({kind:p.PlaybackKind.Background,position:t}))}},t.prototype.gL=function(e){var t,r,n,i,o=this,a=this.storedState;if(!a)return Promise.reject(new Error("no stored state to restore playback position"));if(a.isStartup)return Promise.resolve(!0);var u=null===(r=null===(t=this.TK())||void 0===t?void 0:t.getState())||void 0===r?void 0:r.playback;if(!u)return Promise.reject(new Error("no playback state available to restore playback position"));var c=(0,d.getPlaybackPosition)(u);if(a.useTimeshiftForRestore)return this.internalPlayer.timeShift(c,e),Promise.resolve(!0);if(this.internalPlayer.getPlayerType()===l.PlayerType.Native&&(0,f.isSafari)()&&c<.5)return Promise.resolve(!0);var p=(null===(n=this.context.renderer)||void 0===n?void 0:n.getDuration())||(null===(i=this.context.videoElement)||void 0===i?void 0:i.duration)||a.contentDuration||c;return c>=p?Promise.resolve(!1):new Promise(function(t,r){var n,i=function(){(0,h.clearTimeoutIfDefined)(n),o.internalPlayer.off(s.PlayerEvent.Seeked,a),o.internalPlayer.off(s.PlayerEvent.Error,u)},a=function(){i(),t(!0)},u=function(){i(),r(new Error("Error during playback restoration"))};o.internalPlayer.onInternal(s.PlayerEvent.Seeked,a),o.internalPlayer.onInternal(s.PlayerEvent.Error,u),o.internalPlayer.getPlayerType()===l.PlayerType.Native&&((0,f.isWebOS)()||(0,f.isPlayStation4)())&&(n=window.setTimeout(a,5e3)),o.internalPlayer.seek(c,e)||a()})},t.prototype.restore=function(e){return i(this,void 0,void 0,function(){var t,r,n;return o(this,function(i){switch(i.label){case 0:if(!(t=this.storedState))throw new Error("no stored state to restore");if(!t.source)throw new Error("stored state has no source to restore");return[4,this.loadSource(e)];case 1:return i.sent(),this.restoreBaseState(t),[4,this.gL(e)];case 2:return r=i.sent(),this.restoreSubtitles(t.subtitles),null===(n=this.TK())||void 0===n||n.dispatch((0,c.setMainContentPlaybackState)({kind:p.PlaybackKind.MainContent})),this.clear(),[2,r]}})})},t.prototype.clear=function(){e.prototype.clear.call(this),this.SK=null},t}(u.PlayerStateStore);t.AdPlayerStateStore=g},42163:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AdPreloadingService=t.AdPlaybackPhase=t.AdPreloadState=void 0;var i,o,a=r(80813),s=r(9768),l=r(3714),u=r(69251),c=r(15971),d=r(23068),p=r(52448);!function(e){e.None="none",e.Pending="pending",e.Done="done",e.Failed="failed"}(i||(t.AdPreloadState=i={})),function(e){e.Upcoming="upcoming",e.Playing="playing",e.Retired="retired"}(o||(t.AdPlaybackPhase=o={}));var f=function(){function e(e){var t=this;this.context=e,this.Of=[],this.Qf=!1,this.Sf=function(e){var r,n,i;if(!t.Qf){var a=t.Of.find(function(t){return t.id===String(e.ad.id)});if((null==a?void 0:a.phase)===o.Upcoming&&a.sourceIdentifier===(null===(r=t.context.sourceContext)||void 0===r?void 0:r.sourceIdentifier)){t.Vf(a.id);var s=(0,c.getSourceStore)(t.context);(null===(i=null===(n=null==s?void 0:s.getState())||void 0===n?void 0:n.buffer)||void 0===i?void 0:i.isLoadingRangeFinished)?t.Tf():(t.Uf(),t.Rf=null==s?void 0:s.subscribe(t.Tf,function(e,t){var r,n;return Boolean((null===(r=null==e?void 0:e.buffer)||void 0===r?void 0:r.isLoadingRangeFinished)&&!(null===(n=null==t?void 0:t.buffer)||void 0===n?void 0:n.isLoadingRangeFinished))}))}}},this.Tf=function(){var e,r=t.ig(o.Playing);!t.Qf&&r&&r.sourceIdentifier===(null===(e=t.context.sourceContext)||void 0===e?void 0:e.sourceIdentifier)&&(t.Wf(r.id),t.Uf())},e.eventHandler.on(l.PlayerEvent.AdStarted,this.Sf,!0)}return e.prototype.Uf=function(){var e;null===(e=this.Rf)||void 0===e||e.call(this),this.Rf=void 0},e.prototype.hasTrackedAds=function(){return this.Of.length>0},e.prototype.preloadAds=function(e){return!!this.trackAds(e)&&(this.jg(),!0)},e.prototype.trackAds=function(e){var t=this,r=function(e){return e.map(function(e){return{id:String(e.id),sourceConfig:(0,p.createSourceConfig)(e)}}).filter(function(e){return(0,d.isDefined)(e.sourceConfig.hls)||(0,d.isDefined)(e.sourceConfig.dash)})}(e);return!this.Qf&&0!==r.length&&!this.hasTrackedAds()&&(this.Of=this.Of.concat(r.map(function(e){return n(n({},e),{sourceIdentifier:(0,u.deriveSourceIdentifier)(e.sourceConfig,t.context.internalPlayerID),preload:i.None,phase:o.Upcoming})})),!0)},e.prototype.Vf=function(e){if(!this.Qf){var t=this.Of.find(function(t){return t.id===e&&t.phase!==o.Retired});t&&(this.Xf(t),this.Of.filter(function(e){return e.phase===o.Upcoming}).length)}},e.prototype.Wf=function(e){var t;this.Qf||(null===(t=this.ig(o.Playing))||void 0===t?void 0:t.id)!==e||(this.mg(function(e){return e.phase===o.Retired}),this.jg())},e.prototype.cancel=function(){this.Qf||(this.Of.length,this.mg(function(){return!0}),this.Uf())},e.prototype.dispose=function(){this.Qf||(this.cancel(),this.context.eventHandler.off(l.PlayerEvent.AdStarted,this.Sf),this.Qf=!0)},e.prototype.Xf=function(e){if(e.phase!==o.Playing){this.mg(function(e){return e.phase===o.Retired});for(var t=0,r=this.Of;t<r.length;t++){var n=r[t];if(n===e){n.phase=o.Playing;break}n.phase=o.Retired}this.Pf===e&&(this.Pf=void 0)}},e.prototype.ig=function(e){return this.Of.find(function(t){return t.phase===e})},e.prototype.jg=function(){var e=this.Of.find(function(e){return e.phase===o.Upcoming&&e.preload===i.None});!this.Pf&&e&&(e.preload=i.Pending,this.Pf=e,this.kg(e))},e.prototype.kg=function(e){var t,r=this,n=null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.PreloadingService);n?n.preloadSource(e.sourceConfig,s.ADVERTISING_ISSUER_NAME).then(function(){r.Pf===e&&(r.Pf=void 0),e.preload=i.Done,!r.Qf&&r.Of.includes(e)}).catch(function(t){r.lg(e)}):this.lg(e)},e.prototype.lg=function(e){e.preload=i.Failed,this.Pf===e&&(this.Pf=void 0),this.Of.includes(e)&&e.phase===o.Upcoming&&(this.ng(e),this.Qf||this.jg())},e.prototype.mg=function(e){var t=this.Of.filter(e);this.Of=this.Of.filter(function(t){return!e(t)}),this.Pf&&t.includes(this.Pf)&&(this.Pf=void 0);for(var r={},n=0,i=t;n<i.length;n++){var o=i[n];r[o.sourceIdentifier]||(r[o.sourceIdentifier]=!0,this.ng(o))}},e.prototype.ng=function(e){var t,r;this.Of.some(function(t){return t!==e&&t.sourceIdentifier===e.sourceIdentifier&&function(e){return e.phase!==o.Upcoming||e.preload===i.Pending||e.preload===i.Done}(t)})||null===(r=null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.PreloadingService))||void 0===r||r.cancelPreload(e.sourceIdentifier)},e}();t.AdPreloadingService=f},95217:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AdTrackingEvent=void 0,t.pingUrl=function(e){(new Image).src=e},function(e){e.FirstQuartile="firstQuartile",e.Midpoint="midpoint",e.ThirdQuartile="thirdQuartile"}(r||(t.AdTrackingEvent=r={}))},90176:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AdvertisingController=t.adTagPlaceholderDefaults=void 0,t.applyModuleSpecificConfig=T,t.createPlayerAdvertisingApi=R;var n=r(4224),i=r(9768),o=r(3714),a=r(4129),s=r(29669),l=r(44468),u=r(87827),c=r(93204),d=r(94685),p=r(34841),f=r(88844),h=r(70850),v=r(88052),g=r(62756),E=r(45392),A=r(50205),y={videoLoadTimeout:r(6365).DEFAULT_VIDEO_LOAD_TIMEOUT,strategy:A.defaultAdvertisingStrategy};t.adTagPlaceholderDefaults={playbackTime:["[CONTENTPLAYHEAD]"],height:["[HEIGHT]"],width:["[WIDTH]"],domain:["[DOMAIN]"],page:["[SITE]"],referrer:["[REFERRER]"],random:["[random]","[CACHEBUSTING]"],timestamp:["[TIMESTAMP]"]};var m=function(){function e(e,t){var r=this;this.context=t,this.yg=function(e){r.og.isCastingToCAF()||r.ug.onTimeChanged(e.time)},this.zg=function(e){return r.ug.onSeek(e.position,e.seekTarget)},this.Ag=function(){var e,t;return null===(t=(e=r.ug).onSeeked)||void 0===t?void 0:t.call(e)},this.Bg=function(){var e,t;return null===(t=(e=r.ug).onPlay)||void 0===t?void 0:t.call(e)},this.Cg=function(e){return r.xg=e.position},this.Dg=function(){r.zg({position:r.xg,seekTarget:r.og.getCurrentTime(i.ADVERTISING_ISSUER_NAME)}),r.Ag()},this.Eg=function(e){r.tg&&e.code===n.WarningCode.PLAYBACK_COULD_NOT_BE_STARTED&&(r.tg=!1)},this.onVolumeChanged=function(e){return r.ug.onVolumeChanged(e)},this.Fg=function(){r.qg.length>0&&r.Hg(r.qg.splice(0,r.qg.length)),r.og.off(o.PlayerEvent.SourceLoaded,r.Fg)},this.onPlayerResize=function(e,t){r.ug.onResize(e,t,r.og.getViewMode()===l.ViewMode.Fullscreen)};var a=e.getConfig(!0);this.pg=a.advertising||{},this.og=e,this.qg=[],this.rg=null,this.sg=!0,this.tg=!1;var s=function(e,t){var r,n,i={},o={};return h.Util.deepCopy(o,e),delete o.adBreaks,h.Util.deepCopyMulti(i,y,o),i.hasOwnProperty("withCredentials")||(i.withCredentials=!0),i.hasOwnProperty("disableStorageApi")||(i.disableStorageApi=null!==(n=null===(r=t.storage)||void 0===r?void 0:r.disableStorageApi)&&void 0!==n&&n),i}(this.pg,a);T(a,s,t.logger),this.createAdvertisingModule(s),this.pg.adBreaks&&this.pg.adBreaks.length>0&&this.pg.adBreaks.splice(0).forEach(function(e){return r.scheduleAd(e).catch(function(e){})}),this.og.on(o.PlayerEvent.TimeChanged,this.yg),this.og.on(o.PlayerEvent.Seek,this.zg),this.og.on(o.PlayerEvent.Seeked,this.Ag),this.og.onInternal(o.PlayerEvent.Play,this.Bg),this.og.on(o.PlayerEvent.Warning,this.Eg),this.og.on(o.PlayerEvent.TimeShift,this.Cg),this.og.on(o.PlayerEvent.TimeShifted,this.Dg),this.playerAdvertisingApi=R(this,this.ug)}return e.prototype.createAdvertisingModule=function(e){var t,r,n=new E.AdManifestHelper(new a.DefaultContentLoader(this.context,{requestType:s.HttpRequestType.MANIFEST_ADS}),e.videoLoadTimeout,null===(t=e.withCredentials)||void 0===t||t,null!==(r=e.disableStorageApi)&&void 0!==r&&r);this.wg={internalPlayer:this.og,context:this.context,restoreContentDeferred:null};var i=v.ModuleManager.get(g.ModuleName.AdvertisingCore),o=v.ModuleManager.get(g.ModuleName.Advertising),l=new i.AdPlayerDelegate(this.wg);this.ug=new o(l,e,n),this.vg=l},e.prototype.updatePlayerContext=function(e){this.context=e,this.wg.context=e},e.prototype.initializeAdModule=function(){this.ug.initialize()},e.prototype.onContentPaused=function(e){var t,r;(0,i.isUserInitiatedPause)(e)&&!this.og.isCasting()&&this.og.getViewMode()!==l.ViewMode.PictureInPicture&&(null===(r=(t=this.ug).onContentPaused)||void 0===r||r.call(t))},e.prototype.scheduleAd=function(e){return P(e)&&(e.discardAfterPlayback=!1!==e.discardAfterPlayback,this.Gg(e)&&!this.Jg())?(this.qg.push(e),this.rg||(this.rg=new p.Deferred,this.og.on(o.PlayerEvent.SourceLoaded,this.Fg)),this.rg.promise):this.Ig(e)},e.prototype.Gg=function(e){return e.position.includes("%")&&"0%"!==e.position},e.prototype.Hg=function(e){var t=this,r=e.map(function(e){return t.Ig(e)});this.rg&&Promise.all(r).then(function(e){var r=[].concat.apply([],e);t.rg.resolve(r),t.rg=null}).catch(function(e){})},e.prototype.Ig=function(e){return P(e)&&this.og.isLive()&&this.Gg(e)?Promise.reject("percentage based ad break positions can not be used for live streams"):this.ug.schedule(e)},e.prototype.playPreRollAds=function(){var e,t,r=this,n=Promise.resolve();return this.tg=!0,this.sg&&(null===(t=null===(e=this.context)||void 0===e?void 0:e.videoElement)||void 0===t?void 0:t.prime)&&(n=this.context.videoElement.prime()),Promise.resolve(this.ug.beforeContent()).catch(function(e){(0,d.isContextAvailable)(r.context)}).then(function(){return n}).catch(function(e){(0,d.isContextAvailable)(r.context)})},e.prototype.playPostRollAds=function(){var e=this,t=!1,r=function(){t=!0,e.og.off(o.PlayerEvent.AdBreakStarted,r)};return this.og.on(o.PlayerEvent.AdBreakStarted,r),this.wg.restoreContentDeferred=new p.Deferred,Promise.resolve(this.ug.afterContent()).then(function(){return new Promise(function(r,n){if(t){var i,o=function(){e.wg.restoreContentDeferred.promise.then(r).catch(n),a(),(0,f.clearTimeoutIfDefined)(i)},a=(0,c.subscribe)(e.context.store)(function(e){return(0,u.getIsStopped)((0,u.getPlayerState)(e))},o,function(e){return e});i=window.setTimeout(o,1e3)}else r()})}).then(function(){return e.wg.restoreContentDeferred=null}).catch(function(t){e.wg.restoreContentDeferred=null})},e.prototype.hasAlreadyRequestedPreRollAds=function(){return this.tg},e.prototype.play=function(){return this.ug.resume(),Promise.resolve()},e.prototype.pause=function(){this.ug.pause()},e.prototype.getCurrentTime=function(){var e,t=null===(e=this.ug)||void 0===e?void 0:e.currentTime();return isNaN(t)?0:null!=t?t:0},e.prototype.getDuration=function(){return this.ug.duration()},e.prototype.isLinearAdActive=function(){return this.ug.isLinearAdActive()},e.prototype.isPlaying=function(){return this.ug.isLinearAdActive(!0)},e.prototype.isPaused=function(){return this.isLinearAdActive()&&!this.isPlaying()},e.prototype.Jg=function(){return this.og.getDuration()>0},e.prototype.reset=function(){return this.qg=[],this.tg=!1,this.vg.reset(),this.ug.reset()},e.prototype.dispose=function(){this.og.off(o.PlayerEvent.TimeChanged,this.yg),this.og.off(o.PlayerEvent.Seek,this.zg),this.og.off(o.PlayerEvent.Seeked,this.Ag),this.og.off(o.PlayerEvent.Play,this.Bg),this.og.off(o.PlayerEvent.Warning,this.Eg),this.og.off(o.PlayerEvent.TimeShift,this.Cg),this.og.off(o.PlayerEvent.TimeShifted,this.Dg),this.og=null,this.pg=null,this.ug.dispose(),this.ug=null,this.vg=null},e}();function T(e,t,r){Boolean(v.ModuleManager.get(g.ModuleName.Advertising).bitmovinMarker)?function(e,t){var r=t;e.playback&&Array.isArray(e.playback.preferredTech)?r.preferredTechnology=e.playback.preferredTech:r.preferredTechnology=[]}(e,t):Boolean(v.ModuleManager.get(g.ModuleName.Advertising).imaMarker)&&function(e,t){var r=t;r.sdkUrl||(r.sdkUrl=e.location.google_ima)}(e,t)}function R(e,t){return new(function(){function r(){}return r.prototype.schedule=function(t){return e.scheduleAd(t)},r.prototype.skip=function(){return t.skip()},r.prototype.list=function(){return t.list()},r.prototype.getActiveAdBreak=function(){return t.getActiveAdBreak()},r.prototype.getActiveAd=function(){return t.getActiveAd()},r.prototype.discardAdBreak=function(e){t.discardAdBreak(e)},r.prototype.isLinearAdActive=function(){return t.isLinearAdActive()},r.prototype.getModuleInfo=function(){return t.getModuleInfo()},r}())}function P(e){return Boolean(e.position)}t.AdvertisingController=m},28412:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AdvertisingModule=void 0;var r=function(){return function(e,t,r){this.player=e,this.config=t,this.adManifestHelper=r}}();t.AdvertisingModule=r},88457:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AdvertisingModuleErrorCode=void 0,function(e){e[e.AD_TAG_TYPE_NOT_MATCHING=110]="AD_TAG_TYPE_NOT_MATCHING",e[e.COULD_NOT_LOAD_AD_MANIFEST=404]="COULD_NOT_LOAD_AD_MANIFEST",e[e.REQUIRED_PLAYER_MODULE_MISSING=2e3]="REQUIRED_PLAYER_MODULE_MISSING"}(r||(t.AdvertisingModuleErrorCode=r={}))},50205:function(e,t,r){var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultAdvertisingStrategy=void 0,t.shouldLoadAdBreak=function(e,r,n){var o;return null!==(o=(0,i.safeUserCallback)(function(){var t;return null===(t=null==e?void 0:e.shouldLoadAdBreak)||void 0===t?void 0:t.call(e,r)},n))&&void 0!==o?o:t.defaultAdvertisingStrategy.shouldLoadAdBreak()},t.shouldPlayAdBreak=function(e,r,n){var o;return null!==(o=(0,i.safeUserCallback)(function(){var t;return null===(t=null==e?void 0:e.shouldPlayAdBreak)||void 0===t?void 0:t.call(e,r)},n))&&void 0!==o?o:t.defaultAdvertisingStrategy.shouldPlayAdBreak()},t.shouldPlaySkippedAdBreaks=function(e,r,o,a,s){var l=(0,i.safeUserCallback)(function(){var t;return null===(t=null==e?void 0:e.shouldPlaySkippedAdBreaks)||void 0===t?void 0:t.call(e,n([],r,!0),o,a)},s);return null!=l?l:t.defaultAdvertisingStrategy.shouldPlaySkippedAdBreaks(r)};var i=r(70850);t.defaultAdvertisingStrategy={shouldLoadAdBreak:function(){return!0},shouldPlayAdBreak:function(){return!0},shouldPlaySkippedAdBreaks:function(e){var t=Math.max.apply(Math,e.map(function(e){return e.scheduleTime})),r=e.find(function(e){return e.scheduleTime===t});return r?[r]:[]}}},23912:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AdTagType=void 0,function(e){e.VAST="vast",e.VMAP="vmap",e.VPAID="vpaid"}(r||(t.AdTagType=r={}))},93531:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.calculatePlaybackRestorationPosition=function(e){var t=e.adBreakDuration,r=e.isLive,n=e.playbackPosition,i=e.replaceContentDuration,o=e.resumeLiveContentAtPreviousPosition;return n+(null!=i?i:!r||o?0:t)},t.calculateTimeshiftRestorationPosition=function(e){var t=e.adBreakDuration,r=e.playbackPosition,i=e.replaceContentDuration,o=e.resumeLiveContentAtPreviousPosition?t:0,a=(0,n.isDefined)(i)?t-i:o;return Math.min(r-a,0)};var n=r(23068)},6365:function(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.VastApiFramework=t.MediaFileDeliveryType=t.DEFAULT_OVERLAY_AD_BOTTOM_POSITION=t.DEFAULT_VIDEO_LOAD_TIMEOUT=t.NON_SKIPPABLE_IDENTIFIER=t.DEFAULT_PRELOAD_OFFSET=t.DEFAULT_PAUSE_AD_ACTIVATION_DELAY=void 0,t.DEFAULT_PAUSE_AD_ACTIVATION_DELAY=1,t.DEFAULT_PRELOAD_OFFSET=0,t.NON_SKIPPABLE_IDENTIFIER=-1,t.DEFAULT_VIDEO_LOAD_TIMEOUT=8e3,t.DEFAULT_OVERLAY_AD_BOTTOM_POSITION="4.5em",function(e){e.Progressive="progressive",e.Streaming="streaming"}(r||(t.MediaFileDeliveryType=r={})),function(e){e.Vpaid="vpaid"}(n||(t.VastApiFramework=n={}))},65185:function(e,t){function r(e){return e.bitrate||(e.maxBitrate+e.minBitrate)/2}Object.defineProperty(t,"__esModule",{value:!0}),t.findMediaFileByResolution=function(e,t,r){return r.reduce(function(r,n){var i=Math.abs(e-r.width)+Math.abs(t-r.height);return Math.abs(e-n.width)+Math.abs(t-n.height)<i?n:r})},t.findMediaFileByBitrate=function(e,t){return t.reduce(function(t,n){var i=r(t),o=r(n),a=Math.abs(i-e);return Math.abs(o-e)<a?n:t})}},7581:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VastErrorCode=t.AdvertisingModuleErrorCode=t.AdTagType=t.AdvertisingCoreModuleDefinition=void 0;var n=r(62756),i=r(43255),o=r(42163),a=r(90176),s=r(88457);Object.defineProperty(t,"AdvertisingModuleErrorCode",{enumerable:!0,get:function(){return s.AdvertisingModuleErrorCode}});var l=r(23912);Object.defineProperty(t,"AdTagType",{enumerable:!0,get:function(){return l.AdTagType}});var u=r(47091);Object.defineProperty(t,"VastErrorCode",{enumerable:!0,get:function(){return u.VastErrorCode}}),t.AdvertisingCoreModuleDefinition={name:n.ModuleName.AdvertisingCore,module:function(){return{AdvertisingController:a.AdvertisingController,AdPlayerDelegate:i.AdPlayerDelegate,AdPreloadingService:o.AdPreloadingService}},dependencies:[n.ModuleName.XML],exports:{AdTagType:l.AdTagType,AdvertisingModuleErrorCode:s.AdvertisingModuleErrorCode,VastErrorCode:u.VastErrorCode}},t.default=t.AdvertisingCoreModuleDefinition},60326:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VastClientWrapper=void 0;var n=r(6036),i=r(6365),o=r(47091),a=function(){function e(e,t,r){this.JN=new n.VASTClient({allowUsingBrowserStorageApi:!r}),this.JN.vastParser.initParsingStatus(),this.KN=e||i.DEFAULT_VIDEO_LOAD_TIMEOUT,this.LN=t}return e.prototype.parseManifest=function(e,t){var r=this,n=[],i=function(e){n.push({code:e.ERRORCODE})};return this.JN.vastParser.addListener("VAST-error",i),this.JN.vastParser.parseVAST(e,{timeout:this.KN,withCredentials:this.LN,replaceUnavailableAdPodAds:!t}).catch(function(e){return r.JN.vastParser.removeListener("VAST-error",i),Promise.reject({code:e&&e.ERRORCODE||o.VastErrorCode.UNDEFINED_ERROR})}).then(function(e){var t;return r.JN.vastParser.removeListener("VAST-error",i),(null===(t=e.ads)||void 0===t?void 0:t.length)>0?e:n.length>0?Promise.reject(n[0]):Promise.reject({code:o.VastErrorCode.UNDEFINED_ERROR})})},e}();t.VastClientWrapper=a},47091:function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VastErrorCode=void 0,function(e){e[e.XML_PARSING_ERROR=100]="XML_PARSING_ERROR",e[e.VAST_SCHEMA_VALIDATION_ERROR=101]="VAST_SCHEMA_VALIDATION_ERROR",e[e.VERSION_NOT_SUPPORTED=102]="VERSION_NOT_SUPPORTED",e[e.TRAFFICKING_ERROR=200]="TRAFFICKING_ERROR",e[e.EXPECTING_DIFFERENT_LINEARITY=201]="EXPECTING_DIFFERENT_LINEARITY",e[e.EXPECTING_DIFFERENT_DURATION=202]="EXPECTING_DIFFERENT_DURATION",e[e.EXPECTING_DIFFERENT_SIZE=203]="EXPECTING_DIFFERENT_SIZE",e[e.GENERAL_WRAPPER_ERROR=300]="GENERAL_WRAPPER_ERROR",e[e.WRAPPER_VAST_URI_TIMEOUT=301]="WRAPPER_VAST_URI_TIMEOUT",e[e.WRAPPER_LIMIT_REACHED=302]="WRAPPER_LIMIT_REACHED",e[e.NO_ADS_VAST_RESPONSE=303]="NO_ADS_VAST_RESPONSE",e[e.INLINE_AD_DISPLAY_TIMEOUT=304]="INLINE_AD_DISPLAY_TIMEOUT",e[e.GENERAL_LINEAR_ERROR=400]="GENERAL_LINEAR_ERROR",e[e.FILE_NOT_FOUND=401]="FILE_NOT_FOUND",e[e.MEDIAFILE_URI_TIMEOUT=402]="MEDIAFILE_URI_TIMEOUT",e[e.NO_SUPPORTED_MEDIAFILE=403]="NO_SUPPORTED_MEDIAFILE",e[e.PROBLEM_DISPLAYING_MEDIAFILE=405]="PROBLEM_DISPLAYING_MEDIAFILE",e[e.GENERAL_NONLINEARADS_ERROR=500]="GENERAL_NONLINEARADS_ERROR",e[e.NONLINEAR_AD_INVALID_DIMENSIONS=501]="NONLINEAR_AD_INVALID_DIMENSIONS",e[e.UNABLE_TO_FETCH_NONLINEAR_RESOURCE=502]="UNABLE_TO_FETCH_NONLINEAR_RESOURCE",e[e.NO_SUPPORTED_NONLINEAR_RESOURCE_TYPE=503]="NO_SUPPORTED_NONLINEAR_RESOURCE_TYPE",e[e.GENERAL_COMPANIONADS_ERROR=600]="GENERAL_COMPANIONADS_ERROR",e[e.COMPANION_AD_INVALID_DIMENSIONS=601]="COMPANION_AD_INVALID_DIMENSIONS",e[e.UNABLE_TO_DISPLAY_REQUIRED_COMPANION=602]="UNABLE_TO_DISPLAY_REQUIRED_COMPANION",e[e.UNABLE_TO_FETCH_COMPANION_RESOURCE=603]="UNABLE_TO_FETCH_COMPANION_RESOURCE",e[e.NO_SUPPORTED_COMPANION_RESOURCE_TYPE=604]="NO_SUPPORTED_COMPANION_RESOURCE_TYPE",e[e.UNDEFINED_ERROR=900]="UNDEFINED_ERROR",e[e.GENERAL_VPAID_ERROR=901]="GENERAL_VPAID_ERROR"}(r||(t.VastErrorCode=r={}))},5838:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VmapExtractor=void 0;var n=r(70850),i=r(88052),o=r(62756),a=r(45392),s=r(88457),l=r(23912),u=r(6365),c=r(47091),d=function(){function e(){}return e.xml2js=function(e){return(0,i.ModuleManager.get(o.ModuleName.XML).parseXML)(e,{decodeEntities:!1,useArrayRepresentationForChildren:!0})},e.js2xml=function(e){return(0,i.ModuleManager.get(o.ModuleName.XML).parseJSONtoXML)(e)},e.extractAdBreakConfigs=function(t,r){return e.getParsedManifest(t.tag.url,r).then(function(r){if(r.manifest.VMAP){var n=e.parseVmapAdBreaks(r.manifest,t);return Promise.resolve({adBreakConfigs:n,downloadTiming:r.downloadTiming})}return Promise.reject({code:s.AdvertisingModuleErrorCode.AD_TAG_TYPE_NOT_MATCHING})})},e.getParsedManifest=function(t,r){return r.downloadVmapManifest(t).catch(function(){return Promise.reject({code:s.AdvertisingModuleErrorCode.COULD_NOT_LOAD_AD_MANIFEST})}).then(function(t){if(!t.body)return Promise.reject({code:c.VastErrorCode.XML_PARSING_ERROR});try{var r=e.xml2js(t.body),n=r.success?r.parsed:{},i={downloadTime:t.elapsedTime,timeToFirstByte:t.timeToFirstByte};return Promise.resolve({manifest:n,downloadTiming:i})}catch(e){return Promise.reject({code:c.VastErrorCode.XML_PARSING_ERROR})}})},e.parseVmapAdBreaks=function(t,r){return e.extractAdBreaks(t).map(function(e){var t,i={id:e.id||n.Util.generateUniqueId(),tag:{url:e.tag,type:l.AdTagType.VAST},position:e.offset,preloadOffset:null!==(t=r.preloadOffset)&&void 0!==t?t:u.DEFAULT_PRELOAD_OFFSET};r.hasOwnProperty("replaceContentDuration")&&(i.replaceContentDuration=r.replaceContentDuration),r.passthroughMode&&(i.passthroughMode=r.passthroughMode);var o={publicAdBreakConfig:i};return e.trackingEvents&&Object.keys(e.trackingEvents).length>0&&(o.trackingEvents=e.trackingEvents),o})||[]},e.extractAdBreaks=function(t){return t.VMAP?t.VMAP.AdBreak.map(function(t){var r=t._breakId,n=t._timeOffset;switch(n){case"start":n="pre";break;case"end":n="post"}var i=e.getAdBreakUri(t),o=[];return t.TrackingEvents&&t.TrackingEvents[0]&&t.TrackingEvents[0].Tracking&&t.TrackingEvents[0].Tracking.forEach(function(e){var t=e._event.toLocaleLowerCase();o.push({type:t,url:e.toString()})}),{id:r,offset:n,tag:i,trackingEvents:o}}):[]},e.getAdBreakUri=function(t){var r,n,i,o=null===(r=t.AdSource)||void 0===r?void 0:r[0],s=null===(n=null==o?void 0:o.AdTagURI)||void 0===n?void 0:n[0],l=null===(i=null==o?void 0:o.VASTAdData)||void 0===i?void 0:i[0];return(null==s?void 0:s.toString)?s.toString():l?(0,a.toDataUri)(e.js2xml(l)):""},e}();t.VmapExtractor=d},63207:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Ad=void 0;var r=function(){return function(){this.id=null,this.wrapperAdIds=[],this.sequence=null,this.system=null,this.title=null,this.description=null,this.advertiser=null,this.pricing=null,this.survey=null,this.errorURLTemplates=[],this.impressionURLTemplates=[],this.creatives=[],this.extensions=[],this.verifications=[]}}();t.Ad=r},19637:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AdExtension=void 0;var r=function(){function e(){this.name=null,this.value=null,this.attributes={},this.children=[]}return e.prototype.isEmpty=function(){return null===this.value&&0===Object.keys(this.attributes).length&&0===this.children.length},e}();t.AdExtension=r},31472:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CompanionAd=void 0;var r=function(){return function(){this.id=null,this.width=0,this.height=0,this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.altText=null,this.companionClickThroughURLTemplate=null,this.companionClickTrackingURLTemplates=[],this.trackingEvents={}}}();t.CompanionAd=r},36828:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Creative=void 0;var r=function(){return function(e){void 0===e&&(e={}),this.id=e.id||null,this.adId=e.adId||null,this.universalAdId=e.universalAdId||null,this.sequence=e.sequence||null,this.apiFramework=e.apiFramework||null,this.trackingEvents={}}}();t.Creative=r},81214:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.CreativeCompanion=void 0;var i=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.type="companion",r.variations=[],r}return n(t,e),t}(r(36828).Creative);t.CreativeCompanion=i},77615:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.CreativeLinear=void 0;var i=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.type="linear",r.duration=0,r.skipDelay=null,r.mediaFiles=[],r.videoClickThroughURLTemplate=null,r.videoClickTrackingURLTemplates=[],r.videoCustomClickURLTemplates=[],r.adParameters=null,r.icons=[],r}return n(t,e),t}(r(36828).Creative);t.CreativeLinear=i},35475:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.CreativeNonLinear=void 0;var i=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.type="nonlinear",r.variations=[],r}return n(t,e),t}(r(36828).Creative);t.CreativeNonLinear=i},50199:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Icon=void 0;var r=function(){return function(){this.program=null,this.height=0,this.width=0,this.xPosition=0,this.yPosition=0,this.apiFramework=null,this.offset=null,this.duration=0,this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.iconClickThroughURLTemplate=null,this.iconClickTrackingURLTemplates=[],this.iconViewTrackingURLTemplate=null}}();t.Icon=r},36629:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaFile=void 0;var r=function(){return function(){this.id=null,this.fileURL=null,this.deliveryType="progressive",this.mimeType=null,this.codec=null,this.bitrate=0,this.minBitrate=0,this.maxBitrate=0,this.width=0,this.height=0,this.apiFramework=null,this.scalable=null,this.maintainAspectRatio=null}}();t.MediaFile=r},57219:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.NonLinearAd=void 0;var r=function(){return function(){this.id=null,this.width=0,this.height=0,this.expandedWidth=0,this.expandedHeight=0,this.scalable=!0,this.maintainAspectRatio=!0,this.minSuggestedDuration=0,this.apiFramework="static",this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.nonlinearClickThroughURLTemplate=null,this.nonlinearClickTrackingURLTemplates=[],this.adParameters=null}}();t.NonLinearAd=r},71119:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseAd=function(e){var t=e.childNodes;for(var r in t){var n=t[r];if(-1!==["Wrapper","InLine"].indexOf(n.nodeName)){if(l.parserUtils.copyNodeAttribute("id",e,n),l.parserUtils.copyNodeAttribute("sequence",e,n),"Wrapper"===n.nodeName)return c(n);if("InLine"===n.nodeName)return u(n)}}},t.parseExtensions=d;var n=r(63207),i=r(19637),o=r(93088),a=r(2035),s=r(64815),l=r(75065);function u(e){var t=e.childNodes,r=new n.Ad;for(var i in r.id=e.getAttribute("id")||null,r.sequence=e.getAttribute("sequence")||null,t){var u=t[i];switch(u.nodeName){case"Error":r.errorURLTemplates.push(l.parserUtils.parseNodeText(u));break;case"Impression":r.impressionURLTemplates.push(l.parserUtils.parseNodeText(u));break;case"Creatives":l.parserUtils.childrenByName(u,"Creative").forEach(function(e){var t={id:e.getAttribute("id")||null,adId:h(e),sequence:e.getAttribute("sequence")||null,apiFramework:e.getAttribute("apiFramework")||null};for(var n in e.childNodes){var i=e.childNodes[n];switch(i.nodeName){case"UniversalAdId":t.universalAdId=v(i);break;case"Linear":var l=(0,a.parseCreativeLinear)(i,t);l&&r.creatives.push(l);break;case"NonLinearAds":var u=(0,s.parseCreativeNonLinear)(i,t);u&&r.creatives.push(u);break;case"CompanionAds":var c=(0,o.parseCreativeCompanion)(i,t);c&&r.creatives.push(c)}}});break;case"Extensions":r.extensions=d(l.parserUtils.childrenByName(u,"Extension"),r);break;case"AdSystem":r.system={value:l.parserUtils.parseNodeText(u),version:u.getAttribute("version")||null};break;case"AdTitle":r.title=l.parserUtils.parseNodeText(u);break;case"Description":r.description=l.parserUtils.parseNodeText(u);break;case"Advertiser":r.advertiser={name:l.parserUtils.parseNodeText(u),id:u.getAttribute("id")||null};break;case"Pricing":r.pricing={value:l.parserUtils.parseNodeText(u),model:u.getAttribute("model")||null,currency:u.getAttribute("currency")||null};break;case"Survey":r.survey={uri:l.parserUtils.parseNodeText(u),type:u.getAttribute("type")||null};break;case"AdVerifications":f(r.verifications,l.parserUtils.childrenByName(u,"Verification"))}}return r}function c(e){var t=u(e),r=l.parserUtils.childByName(e,"VASTAdTagURI");if(r?t.nextWrapperURL=l.parserUtils.parseNodeText(r):(r=l.parserUtils.childByName(e,"VASTAdTagURL"))&&(t.nextWrapperURL=l.parserUtils.parseNodeText(l.parserUtils.childByName(r,"URL"))),t.creatives.forEach(function(e){if(-1!==["linear","nonlinear"].indexOf(e.type)){if(e.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[e.type]||(t.trackingEvents[e.type]={});var r=function(r){var n=e.trackingEvents[r];t.trackingEvents[e.type][r]||(t.trackingEvents[e.type][r]=[]),n.forEach(function(n){t.trackingEvents[e.type][r].push(n)})};for(var n in e.trackingEvents)r(n)}e.videoClickTrackingURLTemplates&&(t.videoClickTrackingURLTemplates||(t.videoClickTrackingURLTemplates=[]),e.videoClickTrackingURLTemplates.forEach(function(e){t.videoClickTrackingURLTemplates.push(e)})),e.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate),e.videoCustomClickURLTemplates&&(t.videoCustomClickURLTemplates||(t.videoCustomClickURLTemplates=[]),e.videoCustomClickURLTemplates.forEach(function(e){t.videoCustomClickURLTemplates.push(e)}))}}),t.nextWrapperURL)return t}function d(e,t){var r=[];return e.forEach(function(e){var n=p(e,t);n&&r.push(n)}),r}function p(e,t){if("#comment"===e.nodeName)return null;var r=new i.AdExtension,n=e.attributes,o=e.childNodes;if(r.name=e.nodeName,e.attributes)for(var a in n)if(n.hasOwnProperty(a)){var s=n[a];s.nodeName&&s.nodeValue&&(r.attributes[s.nodeName]=s.nodeValue)}for(var u in o)if(o.hasOwnProperty(u)){if("AdVerifications"===o[u].nodeName){f(t.verifications,l.parserUtils.childrenByName(o[u],"Verification"));continue}var c=p(o[u],t);c&&r.children.push(c)}if(0===r.children.length||1===r.children.length&&["#cdata-section","#text"].indexOf(r.children[0].name)>=0){var d=l.parserUtils.parseNodeText(e);""!==d&&(r.value=d),r.children=[]}return r.isEmpty()?null:r}function f(e,t){var r=["Verification","JavaScriptResource","ExecutableResource","TrackingEvents","Tracking","VerificationParameters"],n=function(e){var t={},i=l.parserUtils.parseNodeText(e);return Object.keys(e.attributes).forEach(function(r){var n=e.attributes[r].nodeName,i=e.attributes[r].nodeValue;n&&i&&(t[n]=i)}),"#comment"!==e.nodeName&&""!==i&&(e.children&&e.children.length>0?e.childNodes.forEach(function(e){r.includes(e.nodeName)&&(t[e.nodeName]||(t[e.nodeName]=[]),t[e.nodeName].push(n(e)))}):t.content=i),t};t.forEach(function(t){var r=n(t);e.push(r)})}function h(e){return e.getAttribute("AdID")||e.getAttribute("adID")||e.getAttribute("adId")||null}function v(e){return{idRegistry:e.getAttribute("idRegistry")||"unknown",value:l.parserUtils.parseNodeText(e)||"unknown"}}},93088:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCreativeCompanion=function(e,t){var r=new i.CreativeCompanion(t);return o.parserUtils.childrenByName(e,"Companion").forEach(function(e){var t=new n.CompanionAd;t.id=e.getAttribute("id")||null,t.width=e.getAttribute("width"),t.height=e.getAttribute("height"),t.companionClickTrackingURLTemplates=[],o.parserUtils.childrenByName(e,"HTMLResource").forEach(function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"IFrameResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"StaticResource").forEach(function(r){t.type=r.getAttribute("creativeType")||0,o.parserUtils.childrenByName(e,"AltText").forEach(function(e){t.altText=o.parserUtils.parseNodeText(e)}),t.staticResource=o.parserUtils.parseNodeText(r)}),o.parserUtils.childrenByName(e,"TrackingEvents").forEach(function(e){o.parserUtils.childrenByName(e,"Tracking").forEach(function(e){var r=e.getAttribute("event"),n=o.parserUtils.parseNodeText(e);r&&n&&(null==t.trackingEvents[r]&&(t.trackingEvents[r]=[]),t.trackingEvents[r].push(n))})}),o.parserUtils.childrenByName(e,"CompanionClickTracking").forEach(function(e){t.companionClickTrackingURLTemplates.push(o.parserUtils.parseNodeText(e))}),t.companionClickThroughURLTemplate=o.parserUtils.parseNodeText(o.parserUtils.childByName(e,"CompanionClickThrough")),t.companionClickTrackingURLTemplate=o.parserUtils.parseNodeText(o.parserUtils.childByName(e,"CompanionClickTracking")),r.variations.push(t)}),r};var n=r(31472),i=r(81214),o=r(75065)},2035:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCreativeLinear=function(e,t){var r,s=new n.CreativeLinear(t);s.duration=a.parserUtils.parseDuration(a.parserUtils.parseNodeText(a.parserUtils.childByName(e,"Duration")));var l=e.getAttribute("skipoffset");if(null==l)s.skipDelay=null;else if("%"===l.charAt(l.length-1)&&-1!==s.duration){var u=parseInt(l,10);s.skipDelay=s.duration*(u/100)}else s.skipDelay=a.parserUtils.parseDuration(l);var c=a.parserUtils.childByName(e,"VideoClicks");c&&(s.videoClickThroughURLTemplate=a.parserUtils.parseNodeText(a.parserUtils.childByName(c,"ClickThrough")),a.parserUtils.childrenByName(c,"ClickTracking").forEach(function(e){s.videoClickTrackingURLTemplates.push(a.parserUtils.parseNodeText(e))}),a.parserUtils.childrenByName(c,"CustomClick").forEach(function(e){s.videoCustomClickURLTemplates.push(a.parserUtils.parseNodeText(e))}));var d=a.parserUtils.childByName(e,"AdParameters");d&&(s.adParameters=a.parserUtils.parseNodeText(d)),a.parserUtils.childrenByName(e,"TrackingEvents").forEach(function(e){a.parserUtils.childrenByName(e,"Tracking").forEach(function(e){var t=e.getAttribute("event"),n=a.parserUtils.parseNodeText(e);if(t&&n){if("progress"===t){if(!(r=e.getAttribute("offset")))return;t="%"===r.charAt(r.length-1)?"progress-".concat(r):"progress-".concat(Math.round(a.parserUtils.parseDuration(r)))}null==s.trackingEvents[t]&&(s.trackingEvents[t]=[]),s.trackingEvents[t].push(n)}})}),a.parserUtils.childrenByName(e,"MediaFiles").forEach(function(e){a.parserUtils.childrenByName(e,"MediaFile").forEach(function(e){var t=new o.MediaFile;t.id=e.getAttribute("id"),t.fileURL=a.parserUtils.parseNodeText(e),t.deliveryType=e.getAttribute("delivery"),t.codec=e.getAttribute("codec"),t.mimeType=e.getAttribute("type"),t.apiFramework=e.getAttribute("apiFramework"),t.bitrate=parseInt(e.getAttribute("bitrate")||0),t.minBitrate=parseInt(e.getAttribute("minBitrate")||0),t.maxBitrate=parseInt(e.getAttribute("maxBitrate")||0),t.width=parseInt(e.getAttribute("width")||0),t.height=parseInt(e.getAttribute("height")||0);var r=e.getAttribute("scalable");r&&"string"==typeof r&&("true"===(r=r.toLowerCase())?t.scalable=!0:"false"===r&&(t.scalable=!1));var n=e.getAttribute("maintainAspectRatio");n&&"string"==typeof n&&("true"===(n=n.toLowerCase())?t.maintainAspectRatio=!0:"false"===n&&(t.maintainAspectRatio=!1)),s.mediaFiles.push(t)})});var p=a.parserUtils.childByName(e,"Icons");return p&&a.parserUtils.childrenByName(p,"Icon").forEach(function(e){var t=new i.Icon;t.program=e.getAttribute("program"),t.height=parseInt(e.getAttribute("height")||0),t.width=parseInt(e.getAttribute("width")||0),t.xPosition=function(e){return-1!==["left","right"].indexOf(e)?e:parseInt(e||0)}(e.getAttribute("xPosition")),t.yPosition=function(e){return-1!==["top","bottom"].indexOf(e)?e:parseInt(e||0)}(e.getAttribute("yPosition")),t.apiFramework=e.getAttribute("apiFramework"),t.offset=a.parserUtils.parseDuration(e.getAttribute("offset")),t.duration=a.parserUtils.parseDuration(e.getAttribute("duration")),a.parserUtils.childrenByName(e,"HTMLResource").forEach(function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=a.parserUtils.parseNodeText(e)}),a.parserUtils.childrenByName(e,"IFrameResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=a.parserUtils.parseNodeText(e)}),a.parserUtils.childrenByName(e,"StaticResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.staticResource=a.parserUtils.parseNodeText(e)});var r=a.parserUtils.childByName(e,"IconClicks");r&&(t.iconClickThroughURLTemplate=a.parserUtils.parseNodeText(a.parserUtils.childByName(r,"IconClickThrough")),a.parserUtils.childrenByName(r,"IconClickTracking").forEach(function(e){t.iconClickTrackingURLTemplates.push(a.parserUtils.parseNodeText(e))})),t.iconViewTrackingURLTemplate=a.parserUtils.parseNodeText(a.parserUtils.childByName(e,"IconViewTracking")),s.icons.push(t)}),s};var n=r(77615),i=r(50199),o=r(36629),a=r(75065)},64815:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCreativeNonLinear=function(e,t){var r=new n.CreativeNonLinear(t);return o.parserUtils.childrenByName(e,"TrackingEvents").forEach(function(e){var t,n;o.parserUtils.childrenByName(e,"Tracking").forEach(function(e){t=e.getAttribute("event"),n=o.parserUtils.parseNodeText(e),t&&n&&(null==r.trackingEvents[t]&&(r.trackingEvents[t]=[]),r.trackingEvents[t].push(n))})}),o.parserUtils.childrenByName(e,"NonLinear").forEach(function(e){var t=new i.NonLinearAd;t.id=e.getAttribute("id")||null,t.width=e.getAttribute("width"),t.height=e.getAttribute("height"),t.expandedWidth=e.getAttribute("expandedWidth"),t.expandedHeight=e.getAttribute("expandedHeight"),t.scalable=o.parserUtils.parseBoolean(e.getAttribute("scalable")),t.maintainAspectRatio=o.parserUtils.parseBoolean(e.getAttribute("maintainAspectRatio")),t.minSuggestedDuration=o.parserUtils.parseDuration(e.getAttribute("minSuggestedDuration")),t.apiFramework=e.getAttribute("apiFramework"),o.parserUtils.childrenByName(e,"HTMLResource").forEach(function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"IFrameResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=o.parserUtils.parseNodeText(e)}),o.parserUtils.childrenByName(e,"StaticResource").forEach(function(e){t.type=e.getAttribute("creativeType")||0,t.staticResource=o.parserUtils.parseNodeText(e)});var n=o.parserUtils.childByName(e,"AdParameters");n&&(t.adParameters=o.parserUtils.parseNodeText(n)),t.nonlinearClickThroughURLTemplate=o.parserUtils.parseNodeText(o.parserUtils.childByName(e,"NonLinearClickThrough")),o.parserUtils.childrenByName(e,"NonLinearClickTracking").forEach(function(e){t.nonlinearClickTrackingURLTemplates.push(o.parserUtils.parseNodeText(e))}),r.variations.push(t)}),r};var n=r(35475),i=r(57219),o=r(75065)},75065:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parserUtils=void 0;var n=r(11417);t.parserUtils={childByName:function(e,t){var r=e.childNodes;for(var n in r){var i=r[n];if(i.nodeName===t)return i}},childrenByName:function(e,t){var r=[],n=e.childNodes;for(var i in n){var o=n[i];o.nodeName===t&&r.push(o)}return r},resolveVastAdTagURI:function(e,t){if(!t)return e;if(0===e.indexOf("//")){var r=location.protocol;return"".concat(r).concat(e)}if(-1===e.indexOf("://")){var n=t.slice(0,t.lastIndexOf("/"));return"".concat(n,"/").concat(e)}return e},parseBoolean:function(e){return-1!==["true","TRUE","1"].indexOf(e)},parseNodeText:function(e){return e&&(e.textContent||e.text||"").trim()},copyNodeAttribute:function(e,t,r){var n=t.getAttribute(e);n&&r.setAttribute(e,n)},parseDuration:function(e){if(null==e)return-1;if(n.util.isNumeric(e))return parseInt(e);var t=e.split(":");if(3!==t.length)return-1;var r=t[2].split("."),i=parseInt(r[0]);2===r.length&&(i+=parseFloat("0.".concat(r[1])));var o=parseInt(60*t[1]),a=parseInt(60*t[0]*60);return isNaN(a)||isNaN(o)||isNaN(i)||o>3600||i>60?-1:a+o+i},splitVAST:function(e){var t=[],r=null;return e.forEach(function(n,i){if(n.sequence&&(n.sequence=parseInt(n.sequence,10)),n.sequence>1){var o=e[i-1];if(o&&o.sequence===n.sequence-1)return void(r&&r.push(n));delete n.sequence}r=[n],t.push(r)}),t},mergeWrapperAdData:function(e,t){if(e.errorURLTemplates=t.errorURLTemplates.concat(e.errorURLTemplates),e.impressionURLTemplates=t.impressionURLTemplates.concat(e.impressionURLTemplates),e.extensions=t.extensions.concat(e.extensions),e.verifications=t.verifications.concat(e.verifications),e.wrapperAdIds.push(t.id),e.creatives.forEach(function(e){if(t.trackingEvents&&t.trackingEvents[e.type])for(var r in t.trackingEvents[e.type]){var n=t.trackingEvents[e.type][r];e.trackingEvents[r]||(e.trackingEvents[r]=[]),e.trackingEvents[r]=e.trackingEvents[r].concat(n)}}),t.videoClickTrackingURLTemplates&&t.videoClickTrackingURLTemplates.length&&e.creatives.forEach(function(e){"linear"===e.type&&(e.videoClickTrackingURLTemplates=e.videoClickTrackingURLTemplates.concat(t.videoClickTrackingURLTemplates))}),t.videoCustomClickURLTemplates&&t.videoCustomClickURLTemplates.length&&e.creatives.forEach(function(e){"linear"===e.type&&(e.videoCustomClickURLTemplates=e.videoCustomClickURLTemplates.concat(t.videoCustomClickURLTemplates))}),t.videoClickThroughURLTemplate&&e.creatives.forEach(function(e){"linear"===e.type&&null==e.videoClickThroughURLTemplate&&(e.videoClickThroughURLTemplate=t.videoClickThroughURLTemplate)}),e.fallbackAdSequence&&e.sequence!==e.fallbackAdSequence){if(!t.sequence&&!t.fallbackAdSequence)return;e.sequence=null,e.fallbackAdSequence=t.fallbackAdSequence||t.sequence}else if(t.fallbackAdSequence)e.sequence=null,e.fallbackAdSequence=t.fallbackAdSequence||t.sequence;else{if(!t.sequence&&!t.fallbackAdSequence)return;e.sequence=t.sequence}}}},29902:function(e,t,r){var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.VASTParser=void 0;var o=r(71119),a=r(37007),s=r(75065),l=r(27294),u=r(11417),c=r(71076),d={ERRORCODE:900,extensions:[]},p=function(e){function t(){var t=e.call(this)||this;return t.remainingAds=[],t.parentURLs=[],t.errorURLTemplates=[],t.rootErrorURLTemplates=[],t.maxWrapperDepth=null,t.URLTemplateFilters=[],t.fetchingOptions={},t.currentAdSequence=null,t}return n(t,e),t.prototype.addURLTemplateFilter=function(e){"function"==typeof e&&this.URLTemplateFilters.push(e)},t.prototype.removeURLTemplateFilter=function(){this.URLTemplateFilters.pop()},t.prototype.countURLTemplateFilters=function(){return this.URLTemplateFilters.length},t.prototype.clearURLTemplateFilters=function(){this.URLTemplateFilters=[]},t.prototype.trackVastError=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this.emit("VAST-error",Object.assign.apply(Object,i([d,t],r,!1))),u.util.track(e,t)},t.prototype.getErrorURLTemplates=function(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates)},t.prototype.fetchVAST=function(e,t,r){var n=this;return new Promise(function(i,o){n.URLTemplateFilters.forEach(function(t){e=t(e)}),n.parentURLs.push(e),n.emit("VAST-resolving",{url:e,wrapperDepth:t,originalUrl:r}),n.urlHandler.get(e,n.fetchingOptions,function(t,r){n.emit("VAST-resolved",{url:e,error:t}),t?o(t):i(r)})})},t.prototype.initParsingStatus=function(e){void 0===e&&(e={}),this.rootURL="",this.remainingAds=[],this.parentURLs=[],this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.maxWrapperDepth=e.wrapperLimit||10,this.fetchingOptions={timeout:e.timeout,withCredentials:e.withCredentials},this.urlHandler=e.urlhandler||l.urlHandler},t.prototype.getRemainingAds=function(e){var t=this;if(0===this.remainingAds.length)return Promise.reject(new Error("No more ads are available for the given VAST"));var r=e?u.util.flatten(this.remainingAds):this.remainingAds.shift();return this.errorURLTemplates=[],this.parentURLs=[],this.resolveAds(r,{wrapperDepth:0,originalUrl:this.rootURL}).then(function(e){return t.buildVASTResponse(e)})},t.prototype.getAndParseVAST=function(e,t){var r=this;return void 0===t&&(t={}),this.initParsingStatus(t),this.rootURL=e,this.fetchVAST(e).then(function(n){return t.originalUrl=e,t.isRootVAST=!0,r.parse(n,t).then(function(e){return r.buildVASTResponse(e,t)})})},t.prototype.parseVAST=function(e,t){var r=this;return void 0===t&&(t={}),this.initParsingStatus(t),t.isRootVAST=!0,this.parse(e,t).then(function(e){return r.buildVASTResponse(e,t)})},t.prototype.getPodAds=function(e){return e.filter(function(e){return null!=e.sequence})},t.prototype.getStandaloneAds=function(e){return e.filter(function(e){return null==e.sequence})},t.prototype.hasMediaFiles=function(e){return!(!e||null!=e.errorCode)&&(Array.isArray(e.creatives)?e.creatives:[]).some(function(e){return e.mediaFiles&&e.mediaFiles.length>0})},t.prototype.replaceUnavailableAdPodAds=function(e){var t=this,r=this.getPodAds(e),n=this.getStandaloneAds(e).filter(this.hasMediaFiles);return 0===r.length||0===n.length?e:(r=r.map(function(e){return t.hasMediaFiles(e)?e:n.shift()}).filter(Boolean),n.forEach(function(e){return e.isFallback=!0}),r.concat(n))},t.prototype.markFallbackAds=function(e){return this.getPodAds(e).length>0&&this.getStandaloneAds(e).forEach(function(e){return e.isFallback=!0}),e},t.prototype.buildVASTResponse=function(e,t){void 0===t&&(t={});var r=new c.VASTResponse;return r.errorURLTemplates=this.getErrorURLTemplates(),e.forEach(function(e){return e.isFallback=!1}),r.ads=t.replaceUnavailableAdPodAds?this.replaceUnavailableAdPodAds(e):this.markFallbackAds(e),this.completeWrapperResolving(r),r},t.prototype.parse=function(e,t){var r=this,n=t.resolveAll,i=void 0===n||n,a=t.wrapperSequence,l=void 0===a?null:a,u=t.originalUrl,c=void 0===u?null:u,d=t.wrapperDepth,p=void 0===d?0:d,f=t.isRootVAST,h=void 0!==f&&f,v=t.parentAdSequence,g=void 0===v?null:v;if(!e||!e.documentElement||"VAST"!==e.documentElement.nodeName)return Promise.reject(new Error("Invalid VAST XMLDocument"));var E=[],A=e.documentElement.childNodes;for(var y in A){var m=A[y];if("Error"===m.nodeName){var T=s.parserUtils.parseNodeText(m);h?this.rootErrorURLTemplates.push(T):this.errorURLTemplates.push(T)}if("Ad"===m.nodeName){var R=(0,o.parseAd)(m);R?E.push(R):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}var P=E.length,_=E[P-1];return 1===P&&null!=l&&_&&!_.sequence&&(_.sequence=l),E.forEach(function(e){return r.handleFallbackAdSequence(e,g)}),!1===i&&(this.remainingAds=s.parserUtils.splitVAST(E),E=this.remainingAds.shift()),this.resolveAds(E,{wrapperDepth:p,originalUrl:c})},t.prototype.handleFallbackAdSequence=function(e,t){null==e.sequence?e.fallbackAdSequence=t||this.currentAdSequence:this.currentAdSequence=e.sequence},t.prototype.resolveAds=function(e,t){var r=this;void 0===e&&(e=[]);var n=t.wrapperDepth,i=t.originalUrl,o=[];return e.forEach(function(e){var t=r.resolveWrappers(e,n,i);o.push(t)}),Promise.all(o).then(function(e){var t=u.util.flatten(e);if(!t&&r.remainingAds.length>0){var o=r.remainingAds.shift();return r.resolveAds(o,{wrapperDepth:n,originalUrl:i})}return t})},t.prototype.resolveWrappers=function(e,t,r){var n=this;return new Promise(function(i){if(t++,!e.nextWrapperURL)return delete e.nextWrapperURL,i(e);if(t>=n.maxWrapperDepth||-1!==n.parentURLs.indexOf(e.nextWrapperURL))return e.errorCode=302,delete e.nextWrapperURL,i(e);e.nextWrapperURL=s.parserUtils.resolveVastAdTagURI(e.nextWrapperURL,r);var o=e.sequence;r=e.nextWrapperURL,n.fetchVAST(e.nextWrapperURL,t,r).then(function(a){return n.parse(a,{originalUrl:r,wrapperSequence:o,wrapperDepth:t,parentAdSequence:e.sequence||e.fallbackAdSequence}).then(function(t){if(delete e.nextWrapperURL,0===t.length)return e.creatives=[],i(e);t.forEach(function(t){t&&s.parserUtils.mergeWrapperAdData(t,e)}),i(t)})}).catch(function(t){e.errorCode=301,e.errorMessage=t.message,i(e)})})},t.prototype.completeWrapperResolving=function(e){if(0===e.ads.length)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(var t=e.ads.length-1;t>=0;t--){var r=e.ads[t];(r.errorCode||0===r.creatives.length)&&(this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:r.errorCode||303},{ERRORMESSAGE:r.errorMessage||""},{extensions:r.extensions},{system:r.system}),e.ads.splice(t,1))}},t}(a.EventEmitter);t.VASTParser=p},27294:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.urlHandler=void 0;var n=r(82664),i=r(13769),o=r(2860);t.urlHandler={get:function(e,t,r){return r||("function"==typeof t&&(r=t),t={}),"undefined"==typeof window||null===window?i.nodeURLHandler.get(e,t,r):o.XHRURLHandler.supported()?o.XHRURLHandler.get(e,t,r):n.flashURLHandler.supported()?n.flashURLHandler.get(e,t,r):r(new Error("Current context is not supported by any of the default URLHandlers. Please provide a custom URLHandler"))}}},82664:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.flashURLHandler=void 0,t.flashURLHandler={get:function(e,t,r){var n="function"==typeof window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLDOM"):void 0;if(!n)return r(new Error("FlashURLHandler: Microsoft.XMLDOM format not supported"));n.async=!1;var i=i();request.open("GET",e),request.timeout=t.timeout||0,request.withCredentials=t.withCredentials||!1,request.send(),request.onprogress=function(){},request.onload=function(){n.loadXML(request.responseText),r(null,n)}},supported:function(){return!!function(){var e;return window.XDomainRequest&&(e=new XDomainRequest),e}()}}},13769:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.nodeURLHandler=void 0,t.nodeURLHandler={get:function(e,t,r){r(new Error("Please bundle the library for node to use the node urlHandler"))}}},2860:function(e,t){function r(){try{var e=new window.XMLHttpRequest;return"withCredentials"in e?e:null}catch(e){return console.log("Error in XHRURLHandler support check:",e),null}}Object.defineProperty(t,"__esModule",{value:!0}),t.XHRURLHandler=void 0,t.XHRURLHandler={get:function(e,t,n){if("https:"===window.location.protocol&&0===e.indexOf("http://"))return n(new Error("XHRURLHandler: Cannot go from HTTPS to HTTP."));try{var i=r();i.open("GET",e),i.timeout=t.timeout||0,i.withCredentials=t.withCredentials||!1,i.overrideMimeType&&i.overrideMimeType("text/xml"),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?n(null,i.responseXML):n(new Error("XHRURLHandler: ".concat(i.statusText))))},i.send()}catch(e){n(new Error("XHRURLHandler: Unexpected error"))}},supported:function(){return!!r()}}},1100:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;var r=null,n={data:{},length:0,getItem:function(e){return this.data[e]},setItem:function(e,t){this.data[e]=t,this.length=Object.keys(this.data).length},removeItem:function(e){delete data[e],this.length=Object.keys(this.data).length},clear:function(){this.data={},this.length=0}},i=function(){function e(e){this.storage=this.initStorage(e)}return e.prototype.initStorage=function(e){if(r&&("undefined"==typeof window||null===window||Object.getPrototypeOf(r)!==window.Storage.prototype||e))return r;try{r="undefined"!=typeof window&&null!==window?window.localStorage||window.sessionStorage:null}catch(e){r=null}return r&&e&&!this.isStorageDisabled(r)||(r=n).clear(),r},e.prototype.isStorageDisabled=function(e){var t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0}catch(e){return!0}return e.removeItem(t),!1},e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.setItem=function(e,t){return this.storage.setItem(e,t)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.clear=function(){return this.storage.clear()},e}();t.Storage=i},11417:function(e,t){function r(e,t){void 0===t&&(t={});var r=[];t.ASSETURI&&(t.ASSETURI=n(t.ASSETURI)),t.CONTENTPLAYHEAD&&(t.CONTENTPLAYHEAD=n(t.CONTENTPLAYHEAD)),t.ERRORCODE&&!/^[0-9]{3}$/.test(t.ERRORCODE)&&(t.ERRORCODE=900),t.CACHEBUSTING=i(Math.round(1e8*Math.random()).toString()),t.TIMESTAMP=n((new Date).toISOString()),t.RANDOM=t.random=t.CACHEBUSTING;for(var o=0,a=e;o<a.length;o++){var s=a[o];if("string"==typeof s){for(var l in t){var u=t[l],c="[".concat(l,"]"),d="%%".concat(l,"%%");s=(s=s.replace(c,u)).replace(d,u)}r.push(s)}}return r}function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%".concat(e.charCodeAt(0).toString(16))})}function i(e){return e.length<8?o(0,8-e.length,!1).map(function(e){return"0"}).join("")+e:e}function o(e,t,r){for(var n=[],i=e<t,o=r?i?t+1:t-1:t,a=e;i?a<o:a>o;i?a++:a--)n.push(a);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.util=void 0,t.util={track:function(e,t){r(e,t).forEach(function(e){"undefined"!=typeof window&&null!==window&&((new Image).src=e)})},resolveURLTemplates:r,encodeURIComponentRFC3986:n,leftpad:i,range:o,isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},flatten:function e(t){return t.reduce(function(t,r){return t.concat(Array.isArray(r)?e(r):r)},[])}}},6036:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VASTClient=void 0;var n=r(1100),i=r(29902),o=function(){function e(e){e=e||{},this.cappingFreeLunch=e.cappingFreeLunch||0,this.cappingMinimumTimeInterval=e.cappingMinimumTimeInterval||0,this.defaultOptions={withCredentials:!1,timeout:0},this.vastParser=new i.VASTParser;var t=null==e.allowUsingBrowserStorageApi||e.allowUsingBrowserStorageApi;this.storage=e.customStorage||new n.Storage(t),void 0===this.lastSuccessfulAd&&(this.lastSuccessfulAd=0),void 0===this.totalCalls&&(this.totalCalls=0),void 0===this.totalCallsTimeout&&(this.totalCallsTimeout=0)}return e.prototype.getParser=function(){return this.vastParser},Object.defineProperty(e.prototype,"lastSuccessfulAd",{get:function(){return this.storage.getItem("vast-client-last-successful-ad")},set:function(e){this.storage.setItem("vast-client-last-successful-ad",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalCalls",{get:function(){return this.storage.getItem("vast-client-total-calls")},set:function(e){this.storage.setItem("vast-client-total-calls",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalCallsTimeout",{get:function(){return this.storage.getItem("vast-client-total-calls-timeout")},set:function(e){this.storage.setItem("vast-client-total-calls-timeout",e)},enumerable:!1,configurable:!0}),e.prototype.hasRemainingAds=function(){return this.vastParser.remainingAds.length>0},e.prototype.getNextAds=function(e){return this.vastParser.getRemainingAds(e)},e.prototype.get=function(e,t){var r=this;void 0===t&&(t={});var n=Date.now();return(t=Object.assign(this.defaultOptions,t)).hasOwnProperty("resolveAll")||(t.resolveAll=!1),this.totalCallsTimeout<n?(this.totalCalls=1,this.totalCallsTimeout=n+36e5):this.totalCalls++,new Promise(function(i,o){if(r.cappingFreeLunch>=r.totalCalls)return o(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(r.totalCalls,"/").concat(r.cappingFreeLunch)));var a=n-r.lastSuccessfulAd;if(a<0)r.lastSuccessfulAd=0;else if(a<r.cappingMinimumTimeInterval)return o(new Error("VAST call canceled – (".concat(r.cappingMinimumTimeInterval,")ms minimum interval reached")));r.vastParser.getAndParseVAST(e,t).then(function(e){return i(e)}).catch(function(e){return o(e)})})},e}();t.VASTClient=o},71076:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.VASTResponse=void 0;var r=function(){return function(){this.ads=[],this.errorURLTemplates=[]}}();t.VASTResponse=r}},function(e){return function(){return e(7581)}()}])});
18
18
  })();
@@ -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.280.0
12
+ * Bitmovin Player Version 8.281.0
13
13
  *
14
14
  ****************************************************************************/
15
15
 
16
16
  (function() {
17
- "use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["advertising-ima"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["advertising-ima"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[399],{93500:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ImaPassthroughMode=void 0,function(e){e.None="none",e.Vast="vast",e.VastAndVmap="vastandvmap"}(i||(t.ImaPassthroughMode=i={}))},39401:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ImaInternalAdbreakState=void 0,t.ImaInternalAdBreaksTracker=function(e,t){var n=null,r=e.getCuePoints(),o=r.map(function(e){return{state:i.SCHEDULED,position:e,ads:[]}}),a=function(e){var t=e.getAd();t&&E(t,i.PLAYING)},s=function(e){var t=e.getAd();t&&E(t,i.PLAYED)},g=function(e){var t=e.getAd();t&&E(t,i.SKIPPED)},d=function(e){var t=e.getAd();t&&E(t,i.LOADED)},h=function(e){var t=e.getAd();t&&(n=t)},l=function(e){var t,r,a=e.getAdData();if(a.adError&&n){var s=n.getAdPodInfo().getTimeOffset(),g=o.find(function(e){return e.position===s});g&&[i.SCHEDULED,i.LOADED].includes(g.state)&&E(n,i.PLAYED)}(null===(r=null===(t=a.adError)||void 0===t?void 0:t.data)||void 0===r?void 0:r.errorCode)===google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE&&o.forEach(function(e){return e.state=i.PLAYED})},u=function(e){var t=e.getError();if(t&&n){var r=n.getAdPodInfo().getTimeOffset(),a=o.find(function(e){return e.position===r});a&&[i.SCHEDULED,i.LOADED].includes(a.state)&&E(n,i.PLAYED)}(null==t?void 0:t.getErrorCode())===google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE&&o.forEach(function(e){return e.state=i.PLAYED})};function c(e){var t,n=e.getAd();if(n){var r=n.getAdPodInfo().getTimeOffset();void 0!==r&&n.isLinear()&&(null===(t=o.find(function(e){return e.position===r}))||void 0===t||t.ads.push({id:n.getAdId(),state:i.LOADED}))}}function E(e,t){var n=e.getAdPodInfo().getTimeOffset(),r=e.getAdId();if(void 0!==n){var a=o.find(function(e){return e.position===n});if(!a)return;var s=a.ads.findIndex(function(e){return e.id===r});-1!==s&&(a.ads[s].state=t,function(e){return e.every(function(e){return e.state===i.PLAYED||e.state===i.SKIPPED})}(a.ads)?(a.state=i.PLAYED,function(e){o.filter(function(t){return t.state===i.SCHEDULED&&t.position<e&&t.position>0}).forEach(function(e){e.state=i.MISSED})}(n),function(e){o.filter(function(t){return t.state===i.MISSED&&t.position>e}).forEach(function(e){e.state=i.SCHEDULED})}(n)):a.state=t)}}return e.addEventListener(google.ima.AdEvent.Type.LOADED,c),e.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,d),e.addEventListener(google.ima.AdEvent.Type.STARTED,a),e.addEventListener(google.ima.AdEvent.Type.COMPLETE,s),e.addEventListener(google.ima.AdEvent.Type.SKIPPED,g),e.addEventListener(google.ima.AdEvent.Type.LOG,l),e.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,u),e.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,h),{updateAdBreakState:E,reset:function(){n=null,o=[],r=[],e.removeEventListener(google.ima.AdEvent.Type.LOADED,c),e.removeEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,d),e.removeEventListener(google.ima.AdEvent.Type.STARTED,a),e.removeEventListener(google.ima.AdEvent.Type.COMPLETE,s),e.removeEventListener(google.ima.AdEvent.Type.SKIPPED,g),e.removeEventListener(google.ima.AdEvent.Type.LOG,l),e.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,u),e.removeEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,h)},hasAdBreaksToPlay:function(e){return o.some(function(n){var r=n.position,o=[i.SCHEDULED,i.LOADED].includes(n.state);return!(n.state===i.LOADED&&0===n.ads.length&&r<=e+2)&&(-1===r?o&&e>=t-2:o&&r<=e+2)})},getImaInternalAdBreaks:function(){return o}}},function(e){e.SCHEDULED="SCHEDULED",e.LOADED="LOADED",e.PLAYING="PLAYING",e.PLAYED="PLAYED",e.SKIPPED="SKIPPED",e.MISSED="MISSED"}(i||(t.ImaInternalAdbreakState=i={}))},5181:function(e,t,i){var n=this&&this.__extends||function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,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=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ImaModule=void 0;var a=i(45202),s=i(3714),g=i(34841),d=i(65348),h=i(43767),l=i(89927),u=i(88844),c=i(23068),E=i(70850),p=i(76713),f=i(45392),A=i(90176),v=i(28412),m=i(28610),T=i(23912),y=i(6365),S=i(47091),I=i(5838),L=i(93500),_=i(71751),R=i(39401),D=i(73134),P=i(62899);function O(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];e&&"function"==typeof e&&e.apply(void 0,t)}var M=function(e){function t(t,i,n){var o=e.call(this,t,i,n)||this;return o.Bh=!0,o.Eh=function(e){o.Zg.restoreCustomPlaybackStateOnAdBreakComplete=!1,o.Zg.loadVideoTimeout=o.fg,o.cg=e.getAdsManager(o.player.getVideoElement(),o.Zg);var t=o.player.getVideoElement().duration;o.dg=(0,R.ImaInternalAdBreaksTracker)(o.cg,t),o.cg.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,o.Jh),o.cg.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,o.Kh),o.cg.addEventListener(google.ima.AdEvent.Type.STARTED,o.Th),o.cg.addEventListener(google.ima.AdEvent.Type.LOADED,o.Ph),o.cg.addEventListener(google.ima.AdEvent.Type.SKIPPED,o.ah),o.cg.addEventListener(google.ima.AdEvent.Type.COMPLETE,o.bh),o.cg.addEventListener(google.ima.AdEvent.Type.PAUSED,o.fh),o.cg.addEventListener(google.ima.AdEvent.Type.RESUMED,o.gh),o.cg.addEventListener(google.ima.AdEvent.Type.CLICK,o.hh),o.cg.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,o.jh),o.cg.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,o.kh),o.cg.addEventListener(google.ima.AdEvent.Type.MIDPOINT,o.lh),o.cg.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,o.mh),o.cg.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,o.Gh),o.cg.addEventListener(google.ima.AdEvent.Type.INTERACTION,o.ih),o.cg.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,o.ch),O(o.config.onAdsManagerAvailable,o.cg),o.cg.init(o.Xg.clientWidth,o.Xg.clientHeight,google.ima.ViewMode.NORMAL),o.cg.setVolume(o.player.getVolume()/100),o.getActiveAdBreak()||o.Fh()},o.Gh=function(e){var t,i=o.getActiveAdBreak(),n=e.getError(),r=n.getInnerError(),a=n.getErrorCode(),s=null!=r&&Boolean(r.getErrorCode)?r:null;if(i){if(null===(t=o.Rg)||void 0===t||t.then(function(){return(0,f.pingVmapTrackingUrls)(i.trackingEvents,m.VmapTrackingEventType.Error)}),function(e){return e===google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE||e===google.ima.AdError.ErrorCode.VAST_NO_ADS_AFTER_WRAPPER}(a)&&!o.Rg&&((0,f.pingVmapTrackingUrls)(i.trackingEvents,m.VmapTrackingEventType.BreakStart),(0,f.pingVmapTrackingUrls)(i.trackingEvents,m.VmapTrackingEventType.Error),(0,f.pingVmapTrackingUrls)(i.trackingEvents,m.VmapTrackingEventType.BreakEnd)),s&&s.getErrorCode()===google.ima.AdError.ErrorCode.AUTOPLAY_DISALLOWED)return o.xh||(o.Kg=[i].concat(o.Mg,o.Kg),o.Mg=[]),void o.Ih(s);o.gg.includes(n.getErrorCode())?o.Ki(i).then(function(e){if(e.manifest)o.Ni(i,e.manifest,!0);else{if(i.passthroughMode===L.ImaPassthroughMode.None)return Promise.reject();o.Ni(i,null,!0)}}).catch(function(){return o.Ih(n)}):o.Ih(n)}else o.Ih(n)},o.Jh=function(e){o.Ah=!0,(o.Rg?o.dh(!1):Promise.resolve()).then(function(){var t=r({},o.getActiveAdBreak());if(o.Fi(t),!t){var i=o.player.getVideoElement().currentTime;t={tag:null,id:E.Util.generateUniqueId(),position:String(i),scheduleTime:i}}o.Rg=o.player.requestAdPlayback(o.Qh(e,t)),o.Sg=o.Rg.then(function(e){return e.requestReporter()}),o.Rg.then(function(){return(0,f.pingVmapTrackingUrls)(t.trackingEvents,m.VmapTrackingEventType.BreakStart)});var n=e.getAd();o.Wh(n.isLinear(),n.getWidth(),n.getHeight())})},o.Kh=function(){var e,t,i=null===(e=o.dg)||void 0===e?void 0:e.hasAdBreaksToPlay(o.Og),n=o.getActiveAdBreak();null===(t=o.Rg)||void 0===t||t.then(function(){return(0,f.pingVmapTrackingUrls)(null==n?void 0:n.trackingEvents,m.VmapTrackingEventType.BreakEnd)}),i||(o.Qg&&o.bh(),o.Ah=!1,o.zh&&(o.zh=!1,n&&delete n.currentFallbackIndex),o.Pg=null,o.yh=!1,o.Yg.style.display="none",o.Rg?o.Rg.then(function(e){o.Mg.length>0?o.Li(o.Mg.shift()):e.done().then(function(){o.Rg=null,o.Lh()})}):o.Lh())},o.Ph=function(e){var t=o.getActiveAdBreak();t&&o.Mh(o.Qh(e,t))},o.Th=function(e){o.Sh()&&(o.Wh(e.getAd().isLinear(),e.getAd().getWidth(),e.getAd().getHeight()),o.Qg||o.Rh(e),o.Pg&&(o.Pg.ads=o.Pg.ads||[],o.Pg.ads.includes(o.Qg)||o.Pg.ads.push(o.Qg)),o.config&&o.config.companionAdContainers&&o.Yh(o.config.companionAdContainers(),e),o.Qg.isLinear?o.Uh(e):o.Vh(e))},o.Zh=function(){if(o.Sg){var e=o.currentTime();e!==o.Ug&&e>0&&o.Sg.then(function(t){return t.timeupdate(e)}),o.Ug=e}},o.ah=function(){o.eh(),o.Sg&&o.Sg.then(function(e){return e.skipped()})},o.bh=function(){var e;o.nh(),o.eh(),o.Sg&&(o.Sg.then(function(e){return e.done()}),o.Sg=null===(e=o.Rg)||void 0===e?void 0:e.then(function(e){return e.requestReporter()}))},o.ch=function(){o.Bh||(o.cg.destroy(),o.bg.contentComplete())},o.fh=function(){o.Sh()&&(o.yh=!1,o.Sg.then(function(e){return e.paused(o.currentTime())}))},o.gh=function(){o.Sh()&&(o.yh=!0,o.Sg.then(function(e){return e.resumed(o.currentTime())}))},o.hh=function(){var e=o.Qg?o.Qg.clickThroughUrl:null;o.player.adClicked(e)},o.ih=function(e){var t;o.player.adInteraction(s.AdInteractionType.Vpaid,null===(t=e.getAdData())||void 0===t?void 0:t.id)},o.jh=function(e){o.eg=e.getAd().getDuration()},o.kh=function(){o.player.onQuartile(s.AdQuartile.FIRST_QUARTILE),o.Wg.push(s.AdQuartile.FIRST_QUARTILE)},o.lh=function(){o.player.onQuartile(s.AdQuartile.MIDPOINT),o.Wg.push(s.AdQuartile.MIDPOINT)},o.mh=function(){o.player.onQuartile(s.AdQuartile.THIRD_QUARTILE),o.Wg.push(s.AdQuartile.THIRD_QUARTILE)},o.oh=function(e){var t=o.config.strategy.shouldLoadAdBreak(e);return t||o.ph(e),t},o.Kg=[],o.Lg=[],o.Mg=[],o.Ng=[],o.Og=0,o.Pg=null,o.Qg=null,o.dg=null,o.fg=i.videoLoadTimeout,o.gg=[],o.Ah=!1,o.Wg=[],o.uh=!1,o.vh=!1,o.wh=Promise.resolve(null),o.yh=!1,o.zh=!1,o.config.placeholders=r(r({},A.adTagPlaceholderDefaults),o.config.placeholders),o.sh=new g.Deferred,o.hg=h.FileLoader.getInstance().loadScript(i.sdkUrl),o}return n(t,e),t.prototype.Ch=function(){"function"==typeof this.config.adContainer&&(this.Yg=this.config.adContainer(),this.Yg instanceof HTMLElement?this.uh=!0:this.player.onError(S.VastErrorCode.UNDEFINED_ERROR,"AdvertisingConfig.adContainer was defined but did not provide a valid HTMLElement.")),this.uh||(this.Yg=d.DOMHelper.createTag("div",{class:a.Environment.idPrefix+"ima-container"},{height:"100%",width:"100%",display:"none",border:"none",overflow:"hidden",position:"absolute",top:"0"}),this.Xg=this.player.getVideoElement().parentElement,this.Xg.appendChild(this.Yg)),O(this.config.onAdContainerAvailable,this.Yg)},t.prototype.initialize=function(){var e=this;this.hg.then(function(){e.Ch(),e.Dh(),e.vh=!0}).catch(function(){e.player.onError(D.ImaModuleErrorCode.FAILED_TO_REQUEST_IMA_SDK,"could not load the IMA SDK"),e.vh=!1,e.sh.resolve()})},t.prototype.Dh=function(){google.ima.settings.setPlayerType("bitmovin-player"),google.ima.settings.setNumRedirects(25),google.ima.settings.setCookiesEnabled(this.config.withCredentials),O(this.config.beforeInitialization,google.ima.settings),this.Zg=new google.ima.AdsRenderingSettings,this.config.allowedUiElements&&(this.Zg.uiElements=this.config.allowedUiElements),this.ag=new google.ima.AdDisplayContainer(this.Yg,this.player.getVideoElement()),this.ag.initialize(),this.bg=new google.ima.AdsLoader(this.ag),this.bg.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.Gh),this.bg.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Eh),this.gg=function(){return[100,404,google.ima.AdError.ErrorCode.COMPANION_REQUIRED_ERROR,google.ima.AdError.ErrorCode.FAILED_TO_REQUEST_ADS,google.ima.AdError.ErrorCode.NONLINEAR_DIMENSIONS_ERROR,google.ima.AdError.ErrorCode.UNKNOWN_AD_RESPONSE,google.ima.AdError.ErrorCode.UNKNOWN_ERROR,google.ima.AdError.ErrorCode.VAST_ASSET_NOT_FOUND,google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE,google.ima.AdError.ErrorCode.VAST_LINEAR_ASSET_MISMATCH,google.ima.AdError.ErrorCode.VAST_LOAD_TIMEOUT,google.ima.AdError.ErrorCode.VAST_MALFORMED_RESPONSE,google.ima.AdError.ErrorCode.VAST_NO_ADS_AFTER_WRAPPER,google.ima.AdError.ErrorCode.VAST_SCHEMA_VALIDATION_ERROR,google.ima.AdError.ErrorCode.VAST_TOO_MANY_REDIRECTS,google.ima.AdError.ErrorCode.VAST_TRAFFICKING_ERROR,google.ima.AdError.ErrorCode.VAST_UNSUPPORTED_VERSION,google.ima.AdError.ErrorCode.VAST_WRAPPER_ERROR,1012]}(),this.sh.resolve()},t.prototype.Fh=function(){this.Rg&&this.dh(),this.Vg=null},t.prototype.Hh=function(){this.Lh(),this.Ah||this.dh().catch(function(){})},t.prototype.Ih=function(e){this.player.onError(e.getErrorCode(),e.getMessage(),this.getActiveAdBreak()),this.eh(),this.Pg=null,this.Mg.length>0?this.Li(this.Mg.shift()):this.Hh()},t.prototype.Lh=function(){this.th&&(this.th.resolve(),this.th=null)},t.prototype.Mh=function(e){e.passthroughMode!==L.ImaPassthroughMode.None&&this.Nh(e),this.Vg=null,e.hasOwnProperty("ads")||(e.ads=[]),this.Oh(e)},t.prototype.Nh=function(e){var t=(0,c.isNumber)(e.currentFallbackIndex)&&e.currentFallbackIndex>=0?e.fallbackTags[e.currentFallbackIndex]:e.tag,i=this.Vg&&t.type!==T.AdTagType.VMAP?{downloadTime:(0,l.toSeconds)(Date.now()-this.Vg)}:null;this.player.metadataLoaded(e,i)},t.prototype.Oh=function(e){this.config.strategy.shouldPlayAdBreak(e)?this.cg.start():(this.Pg=null,this.Mg.length>0?this.Li(this.Mg.shift()):this.Lh())},t.prototype.Qh=function(e,t){var i,n=r({},t);n.ads=t.ads?o([],t.ads,!0):[];var a=this.Qg;return a||N(a={id:null===(i=e.getAd())||void 0===i?void 0:i.getAdId()},e),-1===n.ads.findIndex(function(t){var i;return t.id===(null===(i=e.getAd())||void 0===i?void 0:i.getAdId())})&&n.ads.push(a),n},t.prototype.Rh=function(e){var t=this.getActiveAdBreak();if(t&&t.ads){var i=e.getAd().getAdId(),n=t.ads.find(function(e){return e.id===i});n&&(this.Qg=n)}this.Qg=this.Qg||{id:e.getAd().getAdId()},N(this.Qg,e)},t.prototype.Sh=function(){return Boolean(this.Pg||this.Qg)},t.prototype.Uh=function(e){var t=this,i=e.getAd().getSkipTimeOffset();this.eg=e.getAd().getDuration(),-1===this.eg&&(this.eg=null),this.Qg.width=e.getAd().getVastMediaWidth(),this.Qg.height=e.getAd().getVastMediaHeight(),this.Qg.duration=this.eg,this.Qg.skippable=i!==y.NON_SKIPPABLE_IDENTIFIER,this.Qg.skippable&&(this.Qg.skippableAfter=i),this.yh=!0,this.Sg.then(function(e){e.started(t.Qg),t.Tg=window.setInterval(t.Zh,250)})},t.prototype.Vh=function(e){this.Mg.length>0?this.Li(this.Mg.shift()):(this.Qg.width=e.getAd().getWidth(),this.Qg.height=e.getAd().getHeight(),this.player.overlayAdStarted(this.Qg),this.th&&(this.th.resolve(),this.th=null)),this.Pg=null},t.prototype.Wh=function(e,t,i){this.Yg.style.display="block",this.uh||(e?(this.Yg.style.width="100%",this.Yg.style.height="100%",this.Yg.style.top="0",this.Yg.style.bottom="",this.Yg.style.left="",this.Yg.style.right="",this.Yg.style.marginLeft="",this.Yg.style.marginRight=""):(this.Yg.style.width=t+"px",this.Yg.style.height=i+"px",this.Yg.style.top="",this.Yg.style.bottom=y.DEFAULT_OVERLAY_AD_BOTTOM_POSITION,this.Yg.style.left="0",this.Yg.style.right="0",this.Yg.style.marginLeft="auto",this.Yg.style.marginRight="auto")),this.Xh(e,t,i)},t.prototype.Xh=function(e,t,i){var n=this.Yg.firstElementChild;n&&(e?(n.style.width="100%",n.style.height="100%"):(n.style.width=t+"px",n.style.height=i+"px"));var r=n.getElementsByTagName("iframe")[0];r&&(e?(r.style.width="100%",r.style.height="100%"):(r.style.width=t+"px",r.style.height=i+"px"))},t.prototype.Yh=function(e,t){var i=this,n=t.getAd();n&&e.forEach(function(e){var t=(0,P.selectCompanionAd)(e,n);"innerHTML"in e&&void 0!==t&&(i.Qg.hasOwnProperty("companionAds")||(i.Qg.companionAds=[]),i.Qg.companionAds.push({width:t.getWidth(),height:t.getHeight()}),e.innerHTML=t.getContent())})},t.prototype.dh=function(e){if(void 0===e&&(e=!0),!this.Rg)return Promise.resolve();var t=this.Rg.then(function(t){return t.done(e)});return this.Rg=null,t},t.prototype.eh=function(){this.Qg&&this.Qg.companionAds&&this.config.companionAdContainers().forEach(function(e){return e.innerHTML=""}),(0,u.clearIntervalIfDefined)(this.Tg),this.Tg=null,this.Qg=null,this.yh=!1,this.Ug=null,this.Wg=[]},t.prototype.nh=function(){var e=this;[s.AdQuartile.FIRST_QUARTILE,s.AdQuartile.MIDPOINT,s.AdQuartile.THIRD_QUARTILE].filter(function(t){return!e.Wg.includes(t)}).forEach(function(t){e.player.onQuartile(t)})},t.prototype.onTimeChanged=function(e){var t=this;if(!this.isLinearAdActive()){this.xh=!0,this.Og=e;var i=this.Kg.filter(function(t){return t.preloadOffset&&!t.vastResponse&&t.scheduleTime-t.preloadOffset<=e}),n=this.Kg.filter(function(t){return t.scheduleTime<=e&&!t.isScheduled});i.filter(this.oh).forEach(function(e){return t.Ji(e)}),n.filter(function(e){return!!e.vastResponse||t.oh(e)}).forEach(function(e){e.isScheduled=!0,t.Ji(e).then(function(){t.Kg.includes(e)&&t.Li(e)})})}},t.prototype.ph=function(e){e.discardAfterPlayback?this.discardAdBreak(e.id):e.isScheduled=!0},t.prototype.qh=function(e){this.Kg.forEach(function(t){return t.scheduleTime>=e&&(t.isScheduled=!1)})},t.prototype.onSeek=function(e,t){this.qh(t);var i=this.Kg.filter(function(e){return e.scheduleTime<=t&&!e.isScheduled});if(this.Kg=this.Kg.filter(function(e){return!i.includes(e)}),i.length>0){var n=this.config.strategy.shouldPlaySkippedAdBreaks(o([],i,!0),e,t);(i=i.filter(function(e){return!e.discardAfterPlayback||n.includes(e)})).forEach(function(e){return e.isScheduled=!0}),n.forEach(function(e){var t=i.findIndex(function(t){return t===e});t>-1&&(i[t].isScheduled=!1)}),this.Kg=i.concat(this.Kg)}},t.prototype.onResize=function(e,t,i){if(this.cg&&(!this.Qg||this.Qg.isLinear)){var n=i?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;this.cg.resize(e,t,n)}},t.prototype.onVolumeChanged=function(e){this.cg&&this.cg.setVolume(e/100)},t.prototype.beforeContent=function(){var e=this;return this.Gi(this.Lg.splice(0,this.Lg.length)),this.hg.then(function(){return e.vh?e.wh.catch(function(){}).then(function(){return e.Ii("pre")}):Promise.resolve()})},t.prototype.afterContent=function(){var e=this;return this.vh?(this.Qg&&!this.Qg.isLinear&&(this.eh(),this.Pg=null,this.cg.stop()),this.bg.contentComplete(),this.Ii("post").then(function(){return e.qh(0)})):Promise.resolve()},t.prototype.rh=function(e){return Object.keys(L.ImaPassthroughMode).some(function(t){return e===L.ImaPassthroughMode[t]})},t.prototype.Ci=function(e){e.fallbackTags&&e.fallbackTags.length>0&&(e.fallbackTags=e.fallbackTags.filter(function(e){return!!e.url})),this.rh(e.passthroughMode)||(e.passthroughMode=L.ImaPassthroughMode.Vast);var t=e;return t.position?t.position=String(t.position).toLowerCase():t.position=p.DEFAULT_AD_BREAK_POSITION,"number"!=typeof t.preloadOffset&&(t.preloadOffset=y.DEFAULT_PRELOAD_OFFSET),t},t.prototype.Di=function(e){return e.tag?e.tag.url?Object.keys(T.AdTagType).some(function(t){return e.tag.type===T.AdTagType[t]})?void 0:"The provided ad tag type is invalid":"No ad tag url was provided":"No ad tag was provided"},t.prototype.Ei=function(e,t){return e.map(function(e){var i=r(r({},e.publicAdBreakConfig),{isScheduled:!1,parentAdTag:t.tag});return e.trackingEvents&&(i.trackingEvents=e.trackingEvents),void 0===i.id&&(i.id=E.Util.generateUniqueId()),i})},t.prototype.Fi=function(e){return delete e.isScheduled,delete e.parentAdTag,e},t.prototype.schedule=function(e){var t=this;return this.wh=this.sh.promise.then(function(){if(!t.vh)return Promise.reject("The IMA SDK was not loaded and initialized properly");var i=t.Di(e);if(i)return Promise.reject(i);var n=t.Ci(e);return t.Hi(n).then(function(i){if(0===i.length&&n.fallbackTags&&n.fallbackTags.length>0)return n.tag=n.fallbackTags.shift(),t.schedule(n);var a=t.Ei(i,e);a.forEach(function(t){return t.discardAfterPlayback=!1!==e.discardAfterPlayback});var s=t.Gi(a),g=o([],s.map(function(e){var i=r({},e);return t.Fi(i),i}),!0);return Promise.resolve(g)})})},t.prototype.Gi=function(e){var t=this,i=[];e.forEach(function(e){var n=t.player.parsePosition(e.position);isNaN(n)?t.Lg.push(e):(e.scheduleTime=n,i.push(e))});var n=i.filter(function(e){return e.persistent});return this.Kg=this.Kg.concat(i),this.Ng=this.Ng.concat(n),this.Kg.sort(C),this.Ng.sort(C),i},t.prototype.Hi=function(e){var t=this;return new Promise(function(i){if(e.tag.type===T.AdTagType.VMAP&&e.passthroughMode!==L.ImaPassthroughMode.VastAndVmap){var n=e.tag.url;e.tag.url=t.Qi(e.tag.url),I.VmapExtractor.extractAdBreakConfigs(e,t.adManifestHelper).then(function(r){var o=r.adBreakConfigs.filter(function(e){var i=t.player.parsePosition(e.publicAdBreakConfig.position);return isNaN(i)||i>=t.Og});e.tag.url=n,t.player.metadataLoaded(e,r.downloadTiming),i(o)}).catch(function(r){e.tag.url=n,r?t.player.onError(r.code,null,e):t.player.onError(S.VastErrorCode.UNDEFINED_ERROR,null,e),i([])})}else i([{publicAdBreakConfig:e}])})},t.prototype.Ii=function(e){var t=this;return this.sh.promise.then(function(){if(!t.vh)return Promise.resolve();var i;i="post"===e?t.Kg.filter(function(t){return t.position.includes(e)||t.scheduleTime===1/0}):t.Kg.filter(function(t){return t.position.includes(e)||0===t.scheduleTime});var n=Promise.resolve();return(i=i.filter(t.oh)).length>0&&(t.th=new g.Deferred,n=t.th.promise,i.forEach(function(e){e.isScheduled=!0,t.Ji(e).then(function(){return t.Li(e)})})),n})},t.prototype.Ji=function(e,t){var i=this,n=e.tag;if(t&&(e.vastResponse=null,n=t),e.vastResponse&&!t)return e.vastResponse;var r=this.Qi(n.url);return e.passthroughMode!==L.ImaPassthroughMode.None?e.vastResponse=Promise.resolve({}):e.vastResponse=this.adManifestHelper.downloadVastManifest(r).then(function(t){var n=t.manifest,r={manifest:(0,f.xmlToString)(n)};return i.adManifestHelper.parseAdVerifications(n).then(function(n){return n&&n.length>0&&(e.ads=[],n.forEach(function(t){t.verifications&&t.verifications.length>0&&e.ads.push({id:t.id,verifications:t.verifications})})),i.player.metadataLoaded(e,t.downloadTiming),Promise.resolve(r)})}).catch(function(t){return i.Ki(e).catch(function(){return delete e.currentFallbackIndex,t?i.player.onError(t.code,null,e):i.player.onError(S.VastErrorCode.UNDEFINED_ERROR,null,e),Promise.resolve({})})}),e.vastResponse},t.prototype.Ki=function(e){return"number"!=typeof e.currentFallbackIndex?e.currentFallbackIndex=0:e.currentFallbackIndex++,e.fallbackTags&&e.fallbackTags[e.currentFallbackIndex]?this.Ji(e,e.fallbackTags[e.currentFallbackIndex]):Promise.reject()},t.prototype.Li=function(e){var t=this;this.sh.promise.then(function(){var i;if(t.vh)if(t.Kg.includes(e)&&e.discardAfterPlayback&&t.Kg.splice(t.Kg.indexOf(e),1),t.Pg)t.Mg.push(e);else{t.Qg&&!t.Qg.isLinear&&t.cg&&(t.ch(),t.eh()),t.Pg=e;var n=function(e){var i;return e.parentAdTag&&(null===(i=t.Pg)||void 0===i?void 0:i.parentAdTag)&&e.parentAdTag===t.Pg.parentAdTag};t.Bh=t.Kg.some(n)||t.Mg.some(n),null===(i=e.vastResponse)||void 0===i||i.then(function(i){return t.Ni(e,i.manifest)})}})},t.prototype.Mi=function(e){var t,i,n;return null!==(n=null===(i=null===(t=null==e?void 0:e.fallbackTags)||void 0===t?void 0:t[e.currentFallbackIndex])||void 0===i?void 0:i.url)&&void 0!==n?n:e.tag.url},t.prototype.Ni=function(e,t,i){var n=t?(0,f.toDataUri)(t):void 0,r=null!=n?n:this.Mi(e);r&&this.Oi(r,i)},t.prototype.Oi=function(e,t){var i,n=new google.ima.AdsRequest,r=e;0===r.indexOf("data:text/xml,")?n.adsResponse=decodeURIComponent(r.substring(14)):n.adTagUrl=this.Qi(e),this.Xg&&(n.linearAdSlotWidth=this.Xg.clientWidth,n.linearAdSlotHeight=this.Xg.clientHeight,n.nonLinearAdSlotWidth=this.Xg.clientWidth),(null===(i=this.config)||void 0===i?void 0:i.vastLoadTimeout)&&(n.vastLoadTimeout=this.config.vastLoadTimeout),this.Pi(n),n.nonLinearAdSlotHeight=150,this.zh=t,this.Vg=Date.now(),this.bg.requestAds(n)},t.prototype.Pi=function(e){var t,i,n=null===(i=null===(t=this.config.trackers)||void 0===t?void 0:t.omSdk)||void 0===i?void 0:i.onAccessMode;if(void 0!==n&&"function"==typeof n){var r=n(e);if(r){var o={},a=function(e,t){t&&t.forEach(function(t){if("string"==typeof t){var i=google.ima.OmidVerificationVendor[t];void 0!==i&&(o[i]=e)}})};a(google.ima.OmidAccessMode.FULL,r.full),a(google.ima.OmidAccessMode.DOMAIN,r.domain),a(google.ima.OmidAccessMode.LIMITED,r.limited),Object.keys(o).length>0&&(e.omidAccessModeRules=o)}}},t.prototype.Qi=function(e){var t=this,i={playbackTime:String(this.player.getVideoElement().currentTime),height:String(this.Xg.clientHeight),width:String(this.Xg.clientWidth),domain:encodeURIComponent(document.location.hostname),page:encodeURIComponent(document.location.href),referrer:encodeURIComponent(document.referrer),random:Math.floor(1e7+9e7*Math.random()).toString(),timestamp:String(Date.now())};return Object.keys(this.config.placeholders).forEach(function(n){t.config.placeholders[n].forEach(function(t){e=e.replace(t,i[n])})}),e},t.prototype.list=function(){var e=this,t=o(o([],this.Mg.map(function(e){return r({},e)}),!0),this.Kg.map(function(e){return r({},e)}),!0);return t.forEach(function(t){return e.Fi(t)}),t},t.prototype.getActiveAdBreak=function(){return this.Pg},t.prototype.getActiveAd=function(){return this.Qg},t.prototype.isLinearAdActive=function(e){return!!this.Qg&&(e?Boolean(this.Qg.isLinear)&&this.yh:Boolean(this.Qg.isLinear))},t.prototype.discardAdBreak=function(e){e&&(this.Pg&&this.Pg.id===e&&(this.ah(),this.Pg=null,this.cg.stop()),this.Kg=this.Kg.filter(function(t){return t.id!==e}),this.Mg=this.Mg.filter(function(t){return t.id!==e}))},t.prototype.currentTime=function(){return!isFinite(this.eg)||!this.cg||this.cg.getRemainingTime()<0?NaN:this.eg-this.cg.getRemainingTime()},t.prototype.duration=function(){return isFinite(this.eg)?this.eg:0},t.prototype.pause=function(){this.cg&&this.cg.pause()},t.prototype.resume=function(){this.cg&&this.cg.resume()},t.prototype.skip=function(){return this.cg&&(this.cg.skip(),this.Qg&&!this.Qg.isLinear&&(this.cg.stop(),this.Yg.style.display="none",this.eh())),Promise.resolve()},t.prototype.getModuleInfo=function(){return{name:"advertising-ima",version:a.Environment.VERSION_NUMBER}},t.prototype.Ri=function(){var e=this.Kg,t=this.Lg;this.reset(!1),this.Kg=e,this.Lg=t,this.cleanUpImaSdk(),this.sh=new g.Deferred,this.vh=!1},t.prototype.reset=function(e){var t;return void 0===e&&(e=!0),this.Rg=null,this.Sg=null,this.getActiveAdBreak()&&(null===(t=this.cg)||void 0===t||t.stop()),this.eh(),this.Kg=this.Ng,this.Mg=[],this.Og=0,this.eg=null,this.Pg=null,this.xh=!1,this.zh=!1,this.Vg=null,e&&(this.wh=Promise.resolve(null)),this.cleanUpImaSdk(),this.sh=new g.Deferred,this.vh=!1,Promise.resolve()},t.prototype.cleanUpImaSdk=function(){var e;this.bg&&(this.bg.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.Gh),this.bg.removeEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Eh),this.bg.destroy(),this.bg=null),this.cg&&(null===(e=this.dg)||void 0===e||e.reset(),this.dg=null,this.cg.removeEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.Jh),this.cg.removeEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.Kh),this.cg.removeEventListener(google.ima.AdEvent.Type.STARTED,this.Th),this.cg.removeEventListener(google.ima.AdEvent.Type.LOADED,this.Ph),this.cg.removeEventListener(google.ima.AdEvent.Type.SKIPPED,this.ah),this.cg.removeEventListener(google.ima.AdEvent.Type.COMPLETE,this.bh),this.cg.removeEventListener(google.ima.AdEvent.Type.PAUSED,this.fh),this.cg.removeEventListener(google.ima.AdEvent.Type.RESUMED,this.gh),this.cg.removeEventListener(google.ima.AdEvent.Type.CLICK,this.hh),this.cg.removeEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this.jh),this.cg.removeEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this.kh),this.cg.removeEventListener(google.ima.AdEvent.Type.MIDPOINT,this.lh),this.cg.removeEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this.mh),this.cg.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.Gh),this.cg.removeEventListener(google.ima.AdEvent.Type.INTERACTION,this.ih),this.cg.removeEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.ch),this.cg.destroy(),this.cg=null),this.ag&&(this.ag.destroy(),this.ag=null),this.Zg=null},t.prototype.dispose=function(){this.eh(),this.cleanUpImaSdk(),this.Xg&&this.Xg.removeChild(this.Yg),this.Yg=null,this.Pg=null,this.Qg=null},t.imaMarker=function(){},t}(v.AdvertisingModule);function C(e,t){return e.scheduleTime-e.preloadOffset-(t.scheduleTime-t.preloadOffset)}function N(e,t){var i=t.getAd();if(i){if(e.isLinear=i.isLinear(),1===Object.keys(i).length){var n=i[Object.keys(i)[0]].clickThroughUrl;n&&(e.clickThroughUrl=n)}var r=i.getMediaUrl();r&&(e.mediaFileUrl=r),e.data=(0,_.collectAdData)(t)}}t.ImaModule=M},73134:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ImaModuleErrorCode=void 0,function(e){e[e.FAILED_TO_REQUEST_IMA_SDK=103]="FAILED_TO_REQUEST_IMA_SDK",e[e.VAST_NO_ADS_AFTER_WRAPPER=303]="VAST_NO_ADS_AFTER_WRAPPER",e[e.FAILED_TO_REQUEST_ADS=1005]="FAILED_TO_REQUEST_ADS",e[e.VAST_ASSET_NOT_FOUND=1007]="VAST_ASSET_NOT_FOUND",e[e.VAST_EMPTY_RESPONSE=1009]="VAST_EMPTY_RESPONSE",e[e.UNKNOWN_AD_RESPONSE=1010]="UNKNOWN_AD_RESPONSE",e[e.UNSUPPORTED_LOCALE=1011]="UNSUPPORTED_LOCALE",e[e.ADS_REQUEST_NETWORK_ERROR=1012]="ADS_REQUEST_NETWORK_ERROR",e[e.INVALID_AD_TAG=1013]="INVALID_AD_TAG",e[e.STREAM_INITIALIZATION_FAILED=1020]="STREAM_INITIALIZATION_FAILED",e[e.ASSET_FALLBACK_FAILED=1021]="ASSET_FALLBACK_FAILED",e[e.INVALID_ARGUMENTS=1101]="INVALID_ARGUMENTS",e[e.AUTOPLAY_DISALLOWED=1205]="AUTOPLAY_DISALLOWED"}(i||(t.ImaModuleErrorCode=i={}))},61647:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.ImaPassthroughMode=t.ImaModuleErrorCode=t.AdvertisingImaModuleDefinition=void 0;var n=i(62756),r=i(93500);Object.defineProperty(t,"ImaPassthroughMode",{enumerable:!0,get:function(){return r.ImaPassthroughMode}});var o=i(5181),a=i(73134);Object.defineProperty(t,"ImaModuleErrorCode",{enumerable:!0,get:function(){return a.ImaModuleErrorCode}}),t.AdvertisingImaModuleDefinition={name:n.ModuleName.Advertising,module:function(){return o.ImaModule},dependencies:[n.ModuleName.AdvertisingCore],exports:{ImaModuleErrorCode:a.ImaModuleErrorCode,ImaPassthroughMode:r.ImaPassthroughMode}},t.default=t.AdvertisingImaModuleDefinition},71751:function(e,t,i){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.collectAdData=function(e){var t,i=e.getAd();return i?function(e){var t=n({},e);return Object.keys(t).forEach(function(e){var i=t[e],n=i&&"object"==typeof i&&!Object.keys(i).some(function(e){return Boolean(i[e])});((0,r.isNumber)(i)&&i<0||!(0,r.isNumber)(i)&&!i||n)&&delete t[e]}),t}({adTitle:i.getTitle(),adSystem:{name:i.getAdSystem()},mimeType:i.getContentType(),bitrate:i.getVastMediaBitrate&&i.getVastMediaBitrate()>0?i.getVastMediaBitrate():-1,wrapperAdIds:i.getWrapperAdIds(),adDescription:i.getDescription(),advertiser:{name:i.getAdvertiserName()},apiFramework:null!==(t=i.getApiFramework())&&void 0!==t?t:void 0,creative:{id:i.getCreativeId(),adId:i.getCreativeAdId(),universalAdId:{idRegistry:i.getUniversalAdIdRegistry(),value:i.getUniversalAdIdValue()}},dealId:i.getDealId(),minSuggestedDuration:i.isLinear()?o.NON_SKIPPABLE_IDENTIFIER:i.getMinSuggestedDuration(),survey:a(i),traffickingParameters:i.getTraffickingParameters()}):{}};var r=i(23068),o=i(6365);function a(e){var t=e.getSurveyUrl();return t?{uri:t}:void 0}},62899:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.selectCompanionAd=function(e,t){var i=e.clientWidth,n=e.clientHeight,r=t.getCompanionAds(i,n,function(){var e=new google.ima.CompanionAdSelectionSettings;return e.resourceType=google.ima.CompanionAdSelectionSettings.ResourceType.STATIC,e.creativeType=google.ima.CompanionAdSelectionSettings.CreativeType.IMAGE,e.sizeCriteria=google.ima.CompanionAdSelectionSettings.SizeCriteria.SELECT_NEAR_MATCH,e}());return r.length>0?r[0]:t.getCompanionAds(i,n,function(){var e=new google.ima.CompanionAdSelectionSettings;return e.resourceType=google.ima.CompanionAdSelectionSettings.ResourceType.STATIC,e.creativeType=google.ima.CompanionAdSelectionSettings.CreativeType.IMAGE,e.sizeCriteria=google.ima.CompanionAdSelectionSettings.SizeCriteria.IGNORE,e}())[0]}}},function(e){return function(){return e(61647)}()}])});
17
+ "use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["advertising-ima"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["advertising-ima"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[399],{93500:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ImaPassthroughMode=void 0,function(e){e.None="none",e.Vast="vast",e.VastAndVmap="vastandvmap"}(i||(t.ImaPassthroughMode=i={}))},39401:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ImaInternalAdbreakState=void 0,t.ImaInternalAdBreaksTracker=function(e,t){var n=null,r=e.getCuePoints(),o=r.map(function(e){return{state:i.SCHEDULED,position:e,ads:[]}}),a=function(e){var t=e.getAd();t&&c(t,i.PLAYING)},s=function(e){var t=e.getAd();t&&c(t,i.PLAYED)},g=function(e){var t=e.getAd();t&&c(t,i.SKIPPED)},d=function(e){var t=e.getAd();t&&c(t,i.LOADED)},l=function(e){var t=e.getAd();t&&(n=t)},h=function(e){var t,r,a=e.getAdData();if(a.adError&&n){var s=n.getAdPodInfo().getTimeOffset(),g=o.find(function(e){return e.position===s});g&&[i.SCHEDULED,i.LOADED].includes(g.state)&&c(n,i.PLAYED)}(null===(r=null===(t=a.adError)||void 0===t?void 0:t.data)||void 0===r?void 0:r.errorCode)===google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE&&o.forEach(function(e){return e.state=i.PLAYED})},u=function(e){var t=e.getError();if(t&&n){var r=n.getAdPodInfo().getTimeOffset(),a=o.find(function(e){return e.position===r});a&&[i.SCHEDULED,i.LOADED].includes(a.state)&&c(n,i.PLAYED)}(null==t?void 0:t.getErrorCode())===google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE&&o.forEach(function(e){return e.state=i.PLAYED})};function f(e){var t,n=e.getAd();if(n){var r=n.getAdPodInfo().getTimeOffset();void 0!==r&&n.isLinear()&&(null===(t=o.find(function(e){return e.position===r}))||void 0===t||t.ads.push({id:n.getAdId(),state:i.LOADED}))}}function c(e,t){var n=e.getAdPodInfo().getTimeOffset(),r=e.getAdId();if(void 0!==n){var a=o.find(function(e){return e.position===n});if(!a)return;var s=a.ads.findIndex(function(e){return e.id===r});-1!==s&&(a.ads[s].state=t,function(e){return e.every(function(e){return e.state===i.PLAYED||e.state===i.SKIPPED})}(a.ads)?(a.state=i.PLAYED,function(e){o.filter(function(t){return t.state===i.SCHEDULED&&t.position<e&&t.position>0}).forEach(function(e){e.state=i.MISSED})}(n),function(e){o.filter(function(t){return t.state===i.MISSED&&t.position>e}).forEach(function(e){e.state=i.SCHEDULED})}(n)):a.state=t)}}return e.addEventListener(google.ima.AdEvent.Type.LOADED,f),e.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,d),e.addEventListener(google.ima.AdEvent.Type.STARTED,a),e.addEventListener(google.ima.AdEvent.Type.COMPLETE,s),e.addEventListener(google.ima.AdEvent.Type.SKIPPED,g),e.addEventListener(google.ima.AdEvent.Type.LOG,h),e.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,u),e.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,l),{updateAdBreakState:c,reset:function(){n=null,o=[],r=[],e.removeEventListener(google.ima.AdEvent.Type.LOADED,f),e.removeEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,d),e.removeEventListener(google.ima.AdEvent.Type.STARTED,a),e.removeEventListener(google.ima.AdEvent.Type.COMPLETE,s),e.removeEventListener(google.ima.AdEvent.Type.SKIPPED,g),e.removeEventListener(google.ima.AdEvent.Type.LOG,h),e.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,u),e.removeEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,l)},hasAdBreaksToPlay:function(e){return o.some(function(n){var r=n.position,o=[i.SCHEDULED,i.LOADED].includes(n.state);return!(n.state===i.LOADED&&0===n.ads.length&&r<=e+2)&&(-1===r?o&&e>=t-2:o&&r<=e+2)})},getImaInternalAdBreaks:function(){return o}}},function(e){e.SCHEDULED="SCHEDULED",e.LOADED="LOADED",e.PLAYING="PLAYING",e.PLAYED="PLAYED",e.SKIPPED="SKIPPED",e.MISSED="MISSED"}(i||(t.ImaInternalAdbreakState=i={}))},5181:function(e,t,i){var n=this&&this.__extends||function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,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=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ImaModule=void 0;var a=i(45202),s=i(3714),g=i(34841),d=i(65348),l=i(43767),h=i(89927),u=i(88844),f=i(23068),c=i(70850),E=i(76713),p=i(45392),A=i(90176),v=i(28412),m=i(50205),T=i(28610),y=i(23912),S=i(6365),I=i(47091),O=i(5838),D=i(93500),_=i(71751),L=i(39401),R=i(73134),P=i(62899);function U(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];e&&"function"==typeof e&&e.apply(void 0,t)}var C=function(e){function t(t,i,n){var o=e.call(this,t,i,n)||this;return o.Fg=!0,o.Ig=function(e){o.ng.restoreCustomPlaybackStateOnAdBreakComplete=!1,o.ng.loadVideoTimeout=o.tg,o.qg=e.getAdsManager(o.player.getVideoElement(),o.ng);var t=o.player.getVideoElement().duration;o.rg=(0,L.ImaInternalAdBreaksTracker)(o.qg,t),o.qg.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,o.Ng),o.qg.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,o.Og),o.qg.addEventListener(google.ima.AdEvent.Type.STARTED,o.Xg),o.qg.addEventListener(google.ima.AdEvent.Type.LOADED,o.Tg),o.qg.addEventListener(google.ima.AdEvent.Type.SKIPPED,o.eg),o.qg.addEventListener(google.ima.AdEvent.Type.COMPLETE,o.fg),o.qg.addEventListener(google.ima.AdEvent.Type.PAUSED,o.th),o.qg.addEventListener(google.ima.AdEvent.Type.RESUMED,o.uh),o.qg.addEventListener(google.ima.AdEvent.Type.CLICK,o.vh),o.qg.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,o.xh),o.qg.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,o.yh),o.qg.addEventListener(google.ima.AdEvent.Type.MIDPOINT,o.zh),o.qg.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,o.Ah),o.qg.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,o.Kg),o.qg.addEventListener(google.ima.AdEvent.Type.INTERACTION,o.wh),o.qg.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,o.gg),U(o.config.onAdsManagerAvailable,o.qg),o.qg.init(o.lg.clientWidth,o.lg.clientHeight,google.ima.ViewMode.NORMAL),o.qg.setVolume(o.player.getVolume()/100),o.getActiveAdBreak()||o.Jg()},o.Kg=function(e){var t,i=o.getActiveAdBreak(),n=e.getError(),r=n.getInnerError(),a=n.getErrorCode(),s=null!=r&&Boolean(r.getErrorCode)?r:null;if(i){if(null===(t=o.Vf)||void 0===t||t.then(function(){return(0,p.pingVmapTrackingUrls)(i.trackingEvents,T.VmapTrackingEventType.Error)}),function(e){return e===google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE||e===google.ima.AdError.ErrorCode.VAST_NO_ADS_AFTER_WRAPPER}(a)&&!o.Vf&&((0,p.pingVmapTrackingUrls)(i.trackingEvents,T.VmapTrackingEventType.BreakStart),(0,p.pingVmapTrackingUrls)(i.trackingEvents,T.VmapTrackingEventType.Error),(0,p.pingVmapTrackingUrls)(i.trackingEvents,T.VmapTrackingEventType.BreakEnd)),s&&s.getErrorCode()===google.ima.AdError.ErrorCode.AUTOPLAY_DISALLOWED)return o.Bg||(o.Of=[i].concat(o.Qf,o.Of),o.Qf=[]),void o.Mg(s);o.ug.includes(n.getErrorCode())?o.Oh(i).then(function(e){if(e.manifest)o.Rh(i,e.manifest,!0);else{if(i.passthroughMode===D.ImaPassthroughMode.None)return Promise.reject();o.Rh(i,null,!0)}}).catch(function(){return o.Mg(n)}):o.Mg(n)}else o.Mg(n)},o.Ng=function(e){o.Eg=!0,(o.Vf?o.hg(!1):Promise.resolve()).then(function(){var t=r({},o.getActiveAdBreak());if(o.Jh(t),!t){var i=o.player.getVideoElement().currentTime;t={tag:null,id:c.Util.generateUniqueId(),position:String(i),scheduleTime:i}}o.Vf=o.player.requestAdPlayback(o.Ug(e,t)),o.Wf=o.Vf.then(function(e){return e.requestReporter()}),o.Vf.then(function(){return(0,p.pingVmapTrackingUrls)(t.trackingEvents,T.VmapTrackingEventType.BreakStart)});var n=e.getAd();o.ag(n.isLinear(),n.getWidth(),n.getHeight())})},o.Og=function(){var e,t,i=null===(e=o.rg)||void 0===e?void 0:e.hasAdBreaksToPlay(o.Sf),n=o.getActiveAdBreak();null===(t=o.Vf)||void 0===t||t.then(function(){return(0,p.pingVmapTrackingUrls)(null==n?void 0:n.trackingEvents,T.VmapTrackingEventType.BreakEnd)}),i||(o.Uf&&o.fg(),o.Eg=!1,o.Dg&&(o.Dg=!1,n&&delete n.currentFallbackIndex),o.Tf=null,o.Cg=!1,o.mg.style.display="none",o.Vf?o.Vf.then(function(e){o.Qf.length>0?o.Ph(o.Qf.shift()):e.done().then(function(){o.Vf=null,o.Pg()})}):o.Pg())},o.Tg=function(e){var t=o.getActiveAdBreak();t&&o.Qg(o.Ug(e,t))},o.Xg=function(e){o.Wg()&&(o.ag(e.getAd().isLinear(),e.getAd().getWidth(),e.getAd().getHeight()),o.Uf||o.Vg(e),o.Tf&&(o.Tf.ads=o.Tf.ads||[],o.Tf.ads.includes(o.Uf)||o.Tf.ads.push(o.Uf)),o.config&&o.config.companionAdContainers&&o.cg(o.config.companionAdContainers(),e),o.Uf.isLinear?o.Yg(e):o.Zg(e))},o.dg=function(){if(o.Wf){var e=o.currentTime();e!==o.ig&&e>0&&o.Wf.then(function(t){return t.timeupdate(e)}),o.ig=e}},o.eg=function(){o.sh(),o.Wf&&o.Wf.then(function(e){return e.skipped()})},o.fg=function(){var e;o.Bh(),o.sh(),o.Wf&&(o.Wf.then(function(e){return e.done()}),o.Wf=null===(e=o.Vf)||void 0===e?void 0:e.then(function(e){return e.requestReporter()}))},o.gg=function(){o.Fg||(o.qg.destroy(),o.pg.contentComplete())},o.th=function(){o.Wg()&&(o.Cg=!1,o.Wf.then(function(e){return e.paused(o.currentTime())}))},o.uh=function(){o.Wg()&&(o.Cg=!0,o.Wf.then(function(e){return e.resumed(o.currentTime())}))},o.vh=function(){var e=o.Uf?o.Uf.clickThroughUrl:null;o.player.adClicked(e)},o.wh=function(e){var t;o.player.adInteraction(s.AdInteractionType.Vpaid,null===(t=e.getAdData())||void 0===t?void 0:t.id)},o.xh=function(e){o.sg=e.getAd().getDuration()},o.yh=function(){o.player.onQuartile(s.AdQuartile.FIRST_QUARTILE),o.kg.push(s.AdQuartile.FIRST_QUARTILE)},o.zh=function(){o.player.onQuartile(s.AdQuartile.MIDPOINT),o.kg.push(s.AdQuartile.MIDPOINT)},o.Ah=function(){o.player.onQuartile(s.AdQuartile.THIRD_QUARTILE),o.kg.push(s.AdQuartile.THIRD_QUARTILE)},o.Ch=function(e){var t=(0,m.shouldLoadAdBreak)(o.config.strategy,e,o.player.logger);return t||o.Dh(e),t},o.Of=[],o.Pf=[],o.Qf=[],o.Rf=[],o.Sf=0,o.Tf=null,o.Uf=null,o.rg=null,o.tg=i.videoLoadTimeout,o.ug=[],o.Eg=!1,o.kg=[],o.yg=!1,o.zg=!1,o.Ag=Promise.resolve(null),o.Cg=!1,o.Dg=!1,o.config.placeholders=r(r({},A.adTagPlaceholderDefaults),o.config.placeholders),o.wg=new g.Deferred,o.vg=l.FileLoader.getInstance().loadScript(i.sdkUrl),o}return n(t,e),t.prototype.Gg=function(){"function"==typeof this.config.adContainer&&(this.mg=this.config.adContainer(),this.mg instanceof HTMLElement?this.yg=!0:this.player.onError(I.VastErrorCode.UNDEFINED_ERROR,"AdvertisingConfig.adContainer was defined but did not provide a valid HTMLElement.")),this.yg||(this.mg=d.DOMHelper.createTag("div",{class:a.Environment.idPrefix+"ima-container"},{height:"100%",width:"100%",display:"none",border:"none",overflow:"hidden",position:"absolute",top:"0"}),this.lg=this.player.getVideoElement().parentElement,this.lg.appendChild(this.mg)),U(this.config.onAdContainerAvailable,this.mg)},t.prototype.initialize=function(){var e=this;this.vg.then(function(){e.Gg(),e.Hg(),e.zg=!0}).catch(function(){e.player.onError(R.ImaModuleErrorCode.FAILED_TO_REQUEST_IMA_SDK,"could not load the IMA SDK"),e.zg=!1,e.wg.resolve()})},t.prototype.Hg=function(){google.ima.settings.setPlayerType("bitmovin-player"),google.ima.settings.setNumRedirects(25),google.ima.settings.setCookiesEnabled(this.config.withCredentials),U(this.config.beforeInitialization,google.ima.settings),this.ng=new google.ima.AdsRenderingSettings,this.config.allowedUiElements&&(this.ng.uiElements=this.config.allowedUiElements),this.og=new google.ima.AdDisplayContainer(this.mg,this.player.getVideoElement()),this.og.initialize(),this.pg=new google.ima.AdsLoader(this.og),this.pg.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.Kg),this.pg.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Ig),this.ug=function(){return[100,404,google.ima.AdError.ErrorCode.COMPANION_REQUIRED_ERROR,google.ima.AdError.ErrorCode.FAILED_TO_REQUEST_ADS,google.ima.AdError.ErrorCode.NONLINEAR_DIMENSIONS_ERROR,google.ima.AdError.ErrorCode.UNKNOWN_AD_RESPONSE,google.ima.AdError.ErrorCode.UNKNOWN_ERROR,google.ima.AdError.ErrorCode.VAST_ASSET_NOT_FOUND,google.ima.AdError.ErrorCode.VAST_EMPTY_RESPONSE,google.ima.AdError.ErrorCode.VAST_LINEAR_ASSET_MISMATCH,google.ima.AdError.ErrorCode.VAST_LOAD_TIMEOUT,google.ima.AdError.ErrorCode.VAST_MALFORMED_RESPONSE,google.ima.AdError.ErrorCode.VAST_NO_ADS_AFTER_WRAPPER,google.ima.AdError.ErrorCode.VAST_SCHEMA_VALIDATION_ERROR,google.ima.AdError.ErrorCode.VAST_TOO_MANY_REDIRECTS,google.ima.AdError.ErrorCode.VAST_TRAFFICKING_ERROR,google.ima.AdError.ErrorCode.VAST_UNSUPPORTED_VERSION,google.ima.AdError.ErrorCode.VAST_WRAPPER_ERROR,1012]}(),this.wg.resolve()},t.prototype.Jg=function(){this.Vf&&this.hg(),this.jg=null},t.prototype.Lg=function(){this.Pg(),this.Eg||this.hg().catch(function(){})},t.prototype.Mg=function(e){this.player.onError(e.getErrorCode(),e.getMessage(),this.getActiveAdBreak()),this.sh(),this.Tf=null,this.Qf.length>0?this.Ph(this.Qf.shift()):this.Lg()},t.prototype.Pg=function(){this.xg&&(this.xg.resolve(),this.xg=null)},t.prototype.Qg=function(e){e.passthroughMode!==D.ImaPassthroughMode.None&&this.Rg(e),this.jg=null,e.hasOwnProperty("ads")||(e.ads=[]),this.Sg(e)},t.prototype.Rg=function(e){var t=(0,f.isNumber)(e.currentFallbackIndex)&&e.currentFallbackIndex>=0?e.fallbackTags[e.currentFallbackIndex]:e.tag,i=this.jg&&t.type!==y.AdTagType.VMAP?{downloadTime:(0,h.toSeconds)(Date.now()-this.jg)}:null;this.player.metadataLoaded(e,i)},t.prototype.Sg=function(e){(0,m.shouldPlayAdBreak)(this.config.strategy,e,this.player.logger)?this.qg.start():(this.Tf=null,this.Qf.length>0?this.Ph(this.Qf.shift()):this.Pg())},t.prototype.Ug=function(e,t){var i,n=r({},t);n.ads=t.ads?o([],t.ads,!0):[];var a=this.Uf;return a||N(a={id:null===(i=e.getAd())||void 0===i?void 0:i.getAdId()},e),-1===n.ads.findIndex(function(t){var i;return t.id===(null===(i=e.getAd())||void 0===i?void 0:i.getAdId())})&&n.ads.push(a),n},t.prototype.Vg=function(e){var t=this.getActiveAdBreak();if(t&&t.ads){var i=e.getAd().getAdId(),n=t.ads.find(function(e){return e.id===i});n&&(this.Uf=n)}this.Uf=this.Uf||{id:e.getAd().getAdId()},N(this.Uf,e)},t.prototype.Wg=function(){return Boolean(this.Tf||this.Uf)},t.prototype.Yg=function(e){var t=this,i=e.getAd().getSkipTimeOffset();this.sg=e.getAd().getDuration(),-1===this.sg&&(this.sg=null),this.Uf.width=e.getAd().getVastMediaWidth(),this.Uf.height=e.getAd().getVastMediaHeight(),this.Uf.duration=this.sg,this.Uf.skippable=i!==S.NON_SKIPPABLE_IDENTIFIER,this.Uf.skippable&&(this.Uf.skippableAfter=i),this.Cg=!0,this.Wf.then(function(e){e.started(t.Uf),t.Xf=window.setInterval(t.dg,250)})},t.prototype.Zg=function(e){this.Qf.length>0?this.Ph(this.Qf.shift()):(this.Uf.width=e.getAd().getWidth(),this.Uf.height=e.getAd().getHeight(),this.player.overlayAdStarted(this.Uf),this.xg&&(this.xg.resolve(),this.xg=null)),this.Tf=null},t.prototype.ag=function(e,t,i){this.mg.style.display="block",this.yg||(e?(this.mg.style.width="100%",this.mg.style.height="100%",this.mg.style.top="0",this.mg.style.bottom="",this.mg.style.left="",this.mg.style.right="",this.mg.style.marginLeft="",this.mg.style.marginRight=""):(this.mg.style.width=t+"px",this.mg.style.height=i+"px",this.mg.style.top="",this.mg.style.bottom=S.DEFAULT_OVERLAY_AD_BOTTOM_POSITION,this.mg.style.left="0",this.mg.style.right="0",this.mg.style.marginLeft="auto",this.mg.style.marginRight="auto")),this.bg(e,t,i)},t.prototype.bg=function(e,t,i){var n=this.mg.firstElementChild;n&&(e?(n.style.width="100%",n.style.height="100%"):(n.style.width=t+"px",n.style.height=i+"px"));var r=n.getElementsByTagName("iframe")[0];r&&(e?(r.style.width="100%",r.style.height="100%"):(r.style.width=t+"px",r.style.height=i+"px"))},t.prototype.cg=function(e,t){var i=this,n=t.getAd();n&&e.forEach(function(e){var t=(0,P.selectCompanionAd)(e,n);"innerHTML"in e&&void 0!==t&&(i.Uf.hasOwnProperty("companionAds")||(i.Uf.companionAds=[]),i.Uf.companionAds.push({width:t.getWidth(),height:t.getHeight()}),e.innerHTML=t.getContent())})},t.prototype.hg=function(e){if(void 0===e&&(e=!0),!this.Vf)return Promise.resolve();var t=this.Vf.then(function(t){return t.done(e)});return this.Vf=null,t},t.prototype.sh=function(){this.Uf&&this.Uf.companionAds&&this.config.companionAdContainers().forEach(function(e){return e.innerHTML=""}),(0,u.clearIntervalIfDefined)(this.Xf),this.Xf=null,this.Uf=null,this.Cg=!1,this.ig=null,this.kg=[]},t.prototype.Bh=function(){var e=this;[s.AdQuartile.FIRST_QUARTILE,s.AdQuartile.MIDPOINT,s.AdQuartile.THIRD_QUARTILE].filter(function(t){return!e.kg.includes(t)}).forEach(function(t){e.player.onQuartile(t)})},t.prototype.onTimeChanged=function(e){var t=this;if(!this.isLinearAdActive()){this.Bg=!0,this.Sf=e;var i=this.Of.filter(function(t){return t.preloadOffset&&!t.vastResponse&&t.scheduleTime-t.preloadOffset<=e}),n=this.Of.filter(function(t){return t.scheduleTime<=e&&!t.isScheduled});i.filter(this.Ch).forEach(function(e){return t.Nh(e)}),n.filter(function(e){return!!e.vastResponse||t.Ch(e)}).forEach(function(e){e.isScheduled=!0,t.Nh(e).then(function(){t.Of.includes(e)&&t.Ph(e)})})}},t.prototype.Dh=function(e){e.discardAfterPlayback?this.discardAdBreak(e.id):e.isScheduled=!0},t.prototype.Eh=function(e){this.Of.forEach(function(t){return t.scheduleTime>=e&&(t.isScheduled=!1)})},t.prototype.onSeek=function(e,t){this.Eh(t);var i=this.Of.filter(function(e){return e.scheduleTime<=t&&!e.isScheduled});if(this.Of=this.Of.filter(function(e){return!i.includes(e)}),i.length>0){var n=(0,m.shouldPlaySkippedAdBreaks)(this.config.strategy,i,e,t,this.player.logger);(i=i.filter(function(e){return!e.discardAfterPlayback||n.includes(e)})).forEach(function(e){return e.isScheduled=!0}),n.forEach(function(e){var t=i.findIndex(function(t){return t===e});t>-1&&(i[t].isScheduled=!1)}),this.Of=i.concat(this.Of)}},t.prototype.onResize=function(e,t,i){if(this.qg&&(!this.Uf||this.Uf.isLinear)){var n=i?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;this.qg.resize(e,t,n)}},t.prototype.onVolumeChanged=function(e){this.qg&&this.qg.setVolume(e/100)},t.prototype.beforeContent=function(){var e=this;return this.Kh(this.Pf.splice(0,this.Pf.length)),this.vg.then(function(){return e.zg?e.Ag.catch(function(){}).then(function(){return e.Mh("pre")}):Promise.resolve()})},t.prototype.afterContent=function(){var e=this;return this.zg?(this.Uf&&!this.Uf.isLinear&&(this.sh(),this.Tf=null,this.qg.stop()),this.pg.contentComplete(),this.Mh("post").then(function(){return e.Eh(0)})):Promise.resolve()},t.prototype.Fh=function(e){return Object.keys(D.ImaPassthroughMode).some(function(t){return e===D.ImaPassthroughMode[t]})},t.prototype.Gh=function(e){e.fallbackTags&&e.fallbackTags.length>0&&(e.fallbackTags=e.fallbackTags.filter(function(e){return!!e.url})),this.Fh(e.passthroughMode)||(e.passthroughMode=D.ImaPassthroughMode.Vast);var t=e;return t.position?t.position=String(t.position).toLowerCase():t.position=E.DEFAULT_AD_BREAK_POSITION,"number"!=typeof t.preloadOffset&&(t.preloadOffset=S.DEFAULT_PRELOAD_OFFSET),t},t.prototype.Hh=function(e){return e.tag?e.tag.url?Object.keys(y.AdTagType).some(function(t){return e.tag.type===y.AdTagType[t]})?void 0:"The provided ad tag type is invalid":"No ad tag url was provided":"No ad tag was provided"},t.prototype.Ih=function(e,t){return e.map(function(e){var i=r(r({},e.publicAdBreakConfig),{isScheduled:!1,parentAdTag:t.tag});return e.trackingEvents&&(i.trackingEvents=e.trackingEvents),void 0===i.id&&(i.id=c.Util.generateUniqueId()),i})},t.prototype.Jh=function(e){return delete e.isScheduled,delete e.parentAdTag,e},t.prototype.schedule=function(e){var t=this;return this.Ag=this.wg.promise.then(function(){if(!t.zg)return Promise.reject("The IMA SDK was not loaded and initialized properly");var i=t.Hh(e);if(i)return Promise.reject(i);var n=t.Gh(e);return t.Lh(n).then(function(i){if(0===i.length&&n.fallbackTags&&n.fallbackTags.length>0)return n.tag=n.fallbackTags.shift(),t.schedule(n);var a=t.Ih(i,e);a.forEach(function(t){return t.discardAfterPlayback=!1!==e.discardAfterPlayback});var s=t.Kh(a),g=o([],s.map(function(e){var i=r({},e);return t.Jh(i),i}),!0);return Promise.resolve(g)})})},t.prototype.Kh=function(e){var t=this,i=[];e.forEach(function(e){var n=t.player.parsePosition(e.position);isNaN(n)?t.Pf.push(e):(e.scheduleTime=n,i.push(e))});var n=i.filter(function(e){return e.persistent});return this.Of=this.Of.concat(i),this.Rf=this.Rf.concat(n),this.Of.sort(M),this.Rf.sort(M),i},t.prototype.Lh=function(e){var t=this;return new Promise(function(i){if(e.tag.type===y.AdTagType.VMAP&&e.passthroughMode!==D.ImaPassthroughMode.VastAndVmap){var n=e.tag.url;e.tag.url=t.Uh(e.tag.url),O.VmapExtractor.extractAdBreakConfigs(e,t.adManifestHelper).then(function(r){var o=r.adBreakConfigs.filter(function(e){var i=t.player.parsePosition(e.publicAdBreakConfig.position);return isNaN(i)||i>=t.Sf});e.tag.url=n,t.player.metadataLoaded(e,r.downloadTiming),i(o)}).catch(function(r){e.tag.url=n,r?t.player.onError(r.code,null,e):t.player.onError(I.VastErrorCode.UNDEFINED_ERROR,null,e),i([])})}else i([{publicAdBreakConfig:e}])})},t.prototype.Mh=function(e){var t=this;return this.wg.promise.then(function(){if(!t.zg)return Promise.resolve();var i;i="post"===e?t.Of.filter(function(t){return t.position.includes(e)||t.scheduleTime===1/0}):t.Of.filter(function(t){return t.position.includes(e)||0===t.scheduleTime});var n=Promise.resolve();return(i=i.filter(t.Ch)).length>0&&(t.xg=new g.Deferred,n=t.xg.promise,i.forEach(function(e){e.isScheduled=!0,t.Nh(e).then(function(){return t.Ph(e)})})),n})},t.prototype.Nh=function(e,t){var i=this,n=e.tag;if(t&&(e.vastResponse=null,n=t),e.vastResponse&&!t)return e.vastResponse;var r=this.Uh(n.url);return e.passthroughMode!==D.ImaPassthroughMode.None?e.vastResponse=Promise.resolve({}):e.vastResponse=this.adManifestHelper.downloadVastManifest(r).then(function(t){var n=t.manifest,r={manifest:(0,p.xmlToString)(n)};return i.adManifestHelper.parseAdVerifications(n).then(function(n){return n&&n.length>0&&(e.ads=[],n.forEach(function(t){t.verifications&&t.verifications.length>0&&e.ads.push({id:t.id,verifications:t.verifications})})),i.player.metadataLoaded(e,t.downloadTiming),Promise.resolve(r)})}).catch(function(t){return i.Oh(e).catch(function(){return delete e.currentFallbackIndex,t?i.player.onError(t.code,null,e):i.player.onError(I.VastErrorCode.UNDEFINED_ERROR,null,e),Promise.resolve({})})}),e.vastResponse},t.prototype.Oh=function(e){return"number"!=typeof e.currentFallbackIndex?e.currentFallbackIndex=0:e.currentFallbackIndex++,e.fallbackTags&&e.fallbackTags[e.currentFallbackIndex]?this.Nh(e,e.fallbackTags[e.currentFallbackIndex]):Promise.reject()},t.prototype.Ph=function(e){var t=this;this.wg.promise.then(function(){var i;if(t.zg)if(t.Of.includes(e)&&e.discardAfterPlayback&&t.Of.splice(t.Of.indexOf(e),1),t.Tf)t.Qf.push(e);else{t.Uf&&!t.Uf.isLinear&&t.qg&&(t.gg(),t.sh()),t.Tf=e;var n=function(e){var i;return e.parentAdTag&&(null===(i=t.Tf)||void 0===i?void 0:i.parentAdTag)&&e.parentAdTag===t.Tf.parentAdTag};t.Fg=t.Of.some(n)||t.Qf.some(n),null===(i=e.vastResponse)||void 0===i||i.then(function(i){return t.Rh(e,i.manifest)})}})},t.prototype.Qh=function(e){var t,i,n;return null!==(n=null===(i=null===(t=null==e?void 0:e.fallbackTags)||void 0===t?void 0:t[e.currentFallbackIndex])||void 0===i?void 0:i.url)&&void 0!==n?n:e.tag.url},t.prototype.Rh=function(e,t,i){var n=t?(0,p.toDataUri)(t):void 0,r=null!=n?n:this.Qh(e);r&&this.Sh(r,i)},t.prototype.Sh=function(e,t){var i,n=new google.ima.AdsRequest,r=e;0===r.indexOf("data:text/xml,")?n.adsResponse=decodeURIComponent(r.substring(14)):n.adTagUrl=this.Uh(e),this.lg&&(n.linearAdSlotWidth=this.lg.clientWidth,n.linearAdSlotHeight=this.lg.clientHeight,n.nonLinearAdSlotWidth=this.lg.clientWidth),(null===(i=this.config)||void 0===i?void 0:i.vastLoadTimeout)&&(n.vastLoadTimeout=this.config.vastLoadTimeout),this.Th(n),n.nonLinearAdSlotHeight=150,this.Dg=t,this.jg=Date.now(),this.pg.requestAds(n)},t.prototype.Th=function(e){var t,i,n=null===(i=null===(t=this.config.trackers)||void 0===t?void 0:t.omSdk)||void 0===i?void 0:i.onAccessMode;if(void 0!==n&&"function"==typeof n){var r=n(e);if(r){var o={},a=function(e,t){t&&t.forEach(function(t){if("string"==typeof t){var i=google.ima.OmidVerificationVendor[t];void 0!==i&&(o[i]=e)}})};a(google.ima.OmidAccessMode.FULL,r.full),a(google.ima.OmidAccessMode.DOMAIN,r.domain),a(google.ima.OmidAccessMode.LIMITED,r.limited),Object.keys(o).length>0&&(e.omidAccessModeRules=o)}}},t.prototype.Uh=function(e){var t=this,i={playbackTime:String(this.player.getVideoElement().currentTime),height:String(this.lg.clientHeight),width:String(this.lg.clientWidth),domain:encodeURIComponent(document.location.hostname),page:encodeURIComponent(document.location.href),referrer:encodeURIComponent(document.referrer),random:Math.floor(1e7+9e7*Math.random()).toString(),timestamp:String(Date.now())};return Object.keys(this.config.placeholders).forEach(function(n){t.config.placeholders[n].forEach(function(t){e=e.replace(t,i[n])})}),e},t.prototype.list=function(){var e=this,t=o(o([],this.Qf.map(function(e){return r({},e)}),!0),this.Of.map(function(e){return r({},e)}),!0);return t.forEach(function(t){return e.Jh(t)}),t},t.prototype.getActiveAdBreak=function(){return this.Tf},t.prototype.getActiveAd=function(){return this.Uf},t.prototype.isLinearAdActive=function(e){return!!this.Uf&&(e?Boolean(this.Uf.isLinear)&&this.Cg:Boolean(this.Uf.isLinear))},t.prototype.discardAdBreak=function(e){e&&(this.Tf&&this.Tf.id===e&&(this.eg(),this.Tf=null,this.qg.stop()),this.Of=this.Of.filter(function(t){return t.id!==e}),this.Qf=this.Qf.filter(function(t){return t.id!==e}))},t.prototype.currentTime=function(){return!isFinite(this.sg)||!this.qg||this.qg.getRemainingTime()<0?NaN:this.sg-this.qg.getRemainingTime()},t.prototype.duration=function(){return isFinite(this.sg)?this.sg:0},t.prototype.pause=function(){this.qg&&this.qg.pause()},t.prototype.resume=function(){this.qg&&this.qg.resume()},t.prototype.skip=function(){return this.qg&&(this.qg.skip(),this.Uf&&!this.Uf.isLinear&&(this.qg.stop(),this.mg.style.display="none",this.sh())),Promise.resolve()},t.prototype.getModuleInfo=function(){return{name:"advertising-ima",version:a.Environment.VERSION_NUMBER}},t.prototype.Vh=function(){var e=this.Of,t=this.Pf;this.reset(!1),this.Of=e,this.Pf=t,this.cleanUpImaSdk(),this.wg=new g.Deferred,this.zg=!1},t.prototype.reset=function(e){var t;return void 0===e&&(e=!0),this.Vf=null,this.Wf=null,this.getActiveAdBreak()&&(null===(t=this.qg)||void 0===t||t.stop()),this.sh(),this.Of=this.Rf,this.Qf=[],this.Sf=0,this.sg=null,this.Tf=null,this.Bg=!1,this.Dg=!1,this.jg=null,e&&(this.Ag=Promise.resolve(null)),this.cleanUpImaSdk(),this.wg=new g.Deferred,this.zg=!1,Promise.resolve()},t.prototype.cleanUpImaSdk=function(){var e;this.pg&&(this.pg.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.Kg),this.pg.removeEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Ig),this.pg.destroy(),this.pg=null),this.qg&&(null===(e=this.rg)||void 0===e||e.reset(),this.rg=null,this.qg.removeEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.Ng),this.qg.removeEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.Og),this.qg.removeEventListener(google.ima.AdEvent.Type.STARTED,this.Xg),this.qg.removeEventListener(google.ima.AdEvent.Type.LOADED,this.Tg),this.qg.removeEventListener(google.ima.AdEvent.Type.SKIPPED,this.eg),this.qg.removeEventListener(google.ima.AdEvent.Type.COMPLETE,this.fg),this.qg.removeEventListener(google.ima.AdEvent.Type.PAUSED,this.th),this.qg.removeEventListener(google.ima.AdEvent.Type.RESUMED,this.uh),this.qg.removeEventListener(google.ima.AdEvent.Type.CLICK,this.vh),this.qg.removeEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this.xh),this.qg.removeEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this.yh),this.qg.removeEventListener(google.ima.AdEvent.Type.MIDPOINT,this.zh),this.qg.removeEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this.Ah),this.qg.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.Kg),this.qg.removeEventListener(google.ima.AdEvent.Type.INTERACTION,this.wh),this.qg.removeEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.gg),this.qg.destroy(),this.qg=null),this.og&&(this.og.destroy(),this.og=null),this.ng=null},t.prototype.dispose=function(){this.sh(),this.cleanUpImaSdk(),this.lg&&this.lg.removeChild(this.mg),this.mg=null,this.Tf=null,this.Uf=null},t.imaMarker=function(){},t}(v.AdvertisingModule);function M(e,t){return e.scheduleTime-e.preloadOffset-(t.scheduleTime-t.preloadOffset)}function N(e,t){var i=t.getAd();if(i){if(e.isLinear=i.isLinear(),1===Object.keys(i).length){var n=i[Object.keys(i)[0]].clickThroughUrl;n&&(e.clickThroughUrl=n)}var r=i.getMediaUrl();r&&(e.mediaFileUrl=r),e.data=(0,_.collectAdData)(t)}}t.ImaModule=C},73134:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ImaModuleErrorCode=void 0,function(e){e[e.FAILED_TO_REQUEST_IMA_SDK=103]="FAILED_TO_REQUEST_IMA_SDK",e[e.VAST_NO_ADS_AFTER_WRAPPER=303]="VAST_NO_ADS_AFTER_WRAPPER",e[e.FAILED_TO_REQUEST_ADS=1005]="FAILED_TO_REQUEST_ADS",e[e.VAST_ASSET_NOT_FOUND=1007]="VAST_ASSET_NOT_FOUND",e[e.VAST_EMPTY_RESPONSE=1009]="VAST_EMPTY_RESPONSE",e[e.UNKNOWN_AD_RESPONSE=1010]="UNKNOWN_AD_RESPONSE",e[e.UNSUPPORTED_LOCALE=1011]="UNSUPPORTED_LOCALE",e[e.ADS_REQUEST_NETWORK_ERROR=1012]="ADS_REQUEST_NETWORK_ERROR",e[e.INVALID_AD_TAG=1013]="INVALID_AD_TAG",e[e.STREAM_INITIALIZATION_FAILED=1020]="STREAM_INITIALIZATION_FAILED",e[e.ASSET_FALLBACK_FAILED=1021]="ASSET_FALLBACK_FAILED",e[e.INVALID_ARGUMENTS=1101]="INVALID_ARGUMENTS",e[e.AUTOPLAY_DISALLOWED=1205]="AUTOPLAY_DISALLOWED"}(i||(t.ImaModuleErrorCode=i={}))},61647:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.ImaPassthroughMode=t.ImaModuleErrorCode=t.AdvertisingImaModuleDefinition=void 0;var n=i(62756),r=i(93500);Object.defineProperty(t,"ImaPassthroughMode",{enumerable:!0,get:function(){return r.ImaPassthroughMode}});var o=i(5181),a=i(73134);Object.defineProperty(t,"ImaModuleErrorCode",{enumerable:!0,get:function(){return a.ImaModuleErrorCode}}),t.AdvertisingImaModuleDefinition={name:n.ModuleName.Advertising,module:function(){return o.ImaModule},dependencies:[n.ModuleName.AdvertisingCore],exports:{ImaModuleErrorCode:a.ImaModuleErrorCode,ImaPassthroughMode:r.ImaPassthroughMode}},t.default=t.AdvertisingImaModuleDefinition},71751:function(e,t,i){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.collectAdData=function(e){var t,i=e.getAd();return i?function(e){var t=n({},e);return Object.keys(t).forEach(function(e){var i=t[e],n=i&&"object"==typeof i&&!Object.keys(i).some(function(e){return Boolean(i[e])});((0,r.isNumber)(i)&&i<0||!(0,r.isNumber)(i)&&!i||n)&&delete t[e]}),t}({adTitle:i.getTitle(),adSystem:{name:i.getAdSystem()},mimeType:i.getContentType(),bitrate:i.getVastMediaBitrate&&i.getVastMediaBitrate()>0?i.getVastMediaBitrate():-1,wrapperAdIds:i.getWrapperAdIds(),adDescription:i.getDescription(),advertiser:{name:i.getAdvertiserName()},apiFramework:null!==(t=i.getApiFramework())&&void 0!==t?t:void 0,creative:{id:i.getCreativeId(),adId:i.getCreativeAdId(),universalAdId:{idRegistry:i.getUniversalAdIdRegistry(),value:i.getUniversalAdIdValue()}},dealId:i.getDealId(),minSuggestedDuration:i.isLinear()?o.NON_SKIPPABLE_IDENTIFIER:i.getMinSuggestedDuration(),survey:a(i),traffickingParameters:i.getTraffickingParameters()}):{}};var r=i(23068),o=i(6365);function a(e){var t=e.getSurveyUrl();return t?{uri:t}:void 0}},62899:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.selectCompanionAd=function(e,t){var i=e.clientWidth,n=e.clientHeight,r=t.getCompanionAds(i,n,function(){var e=new google.ima.CompanionAdSelectionSettings;return e.resourceType=google.ima.CompanionAdSelectionSettings.ResourceType.STATIC,e.creativeType=google.ima.CompanionAdSelectionSettings.CreativeType.IMAGE,e.sizeCriteria=google.ima.CompanionAdSelectionSettings.SizeCriteria.SELECT_NEAR_MATCH,e}());return r.length>0?r[0]:t.getCompanionAds(i,n,function(){var e=new google.ima.CompanionAdSelectionSettings;return e.resourceType=google.ima.CompanionAdSelectionSettings.ResourceType.STATIC,e.creativeType=google.ima.CompanionAdSelectionSettings.CreativeType.IMAGE,e.sizeCriteria=google.ima.CompanionAdSelectionSettings.SizeCriteria.IGNORE,e}())[0]}}},function(e){return function(){return e(61647)}()}])});
18
18
  })();