@flowplayer/player 3.34.3 → 3.35.0-rc

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 (97) hide show
  1. package/core.js +1 -1
  2. package/default.js +1 -1
  3. package/embed.js +2 -2
  4. package/flowplayer.css +1 -1
  5. package/package/core/events.d.ts +710 -0
  6. package/package/core/events.js +403 -0
  7. package/package/core.js +1 -0
  8. package/package/default.js +1 -0
  9. package/package/embed.js +7 -0
  10. package/package/flowplayer.css +1 -0
  11. package/package/index.d.ts +2238 -0
  12. package/package/plugins/ads.d.ts +4468 -0
  13. package/package/plugins/ads.js +7 -0
  14. package/package/plugins/airplay.d.ts +2152 -0
  15. package/package/plugins/airplay.js +1 -0
  16. package/package/plugins/analytics.d.ts +2146 -0
  17. package/package/plugins/analytics.js +1 -0
  18. package/package/plugins/asel.d.ts +2293 -0
  19. package/package/plugins/asel.js +1 -0
  20. package/package/plugins/audio.d.ts +2146 -0
  21. package/package/plugins/audio.js +1 -0
  22. package/package/plugins/chapters.d.ts +2155 -0
  23. package/package/plugins/chapters.js +1 -0
  24. package/package/plugins/chromecast.d.ts +2221 -0
  25. package/package/plugins/chromecast.js +1 -0
  26. package/package/plugins/comscore.d.ts +2146 -0
  27. package/package/plugins/comscore.js +1 -0
  28. package/package/plugins/consent.d.ts +2194 -0
  29. package/package/plugins/consent.js +1 -0
  30. package/package/plugins/context-menu.d.ts +2160 -0
  31. package/package/plugins/context-menu.js +1 -0
  32. package/package/plugins/cuepoints.d.ts +2270 -0
  33. package/package/plugins/cuepoints.js +1 -0
  34. package/package/plugins/dash.d.ts +2302 -0
  35. package/package/plugins/dash.js +2 -0
  36. package/package/plugins/drm.d.ts +2271 -0
  37. package/package/plugins/drm.js +1 -0
  38. package/package/plugins/endscreen.d.ts +2165 -0
  39. package/package/plugins/endscreen.js +1 -0
  40. package/package/plugins/fas.d.ts +2200 -0
  41. package/package/plugins/fas.js +1 -0
  42. package/package/plugins/float-on-scroll.d.ts +2234 -0
  43. package/package/plugins/float-on-scroll.js +1 -0
  44. package/package/plugins/ga4.d.ts +2146 -0
  45. package/package/plugins/ga4.js +1 -0
  46. package/package/plugins/gemius.d.ts +2171 -0
  47. package/package/plugins/gemius.js +1 -0
  48. package/package/plugins/google-analytics.d.ts +2146 -0
  49. package/package/plugins/google-analytics.js +1 -0
  50. package/package/plugins/hls.d.ts +2271 -0
  51. package/package/plugins/hls.js +1 -0
  52. package/package/plugins/id3.d.ts +2212 -0
  53. package/package/plugins/id3.js +1 -0
  54. package/package/plugins/iframe.d.ts +2147 -0
  55. package/package/plugins/iframe.js +1 -0
  56. package/package/plugins/keyboard.d.ts +2146 -0
  57. package/package/plugins/keyboard.js +1 -0
  58. package/package/plugins/media-session.d.ts +2146 -0
  59. package/package/plugins/media-session.js +1 -0
  60. package/package/plugins/message.d.ts +2205 -0
  61. package/package/plugins/message.js +1 -0
  62. package/package/plugins/ovp.d.ts +2208 -0
  63. package/package/plugins/ovp.js +1 -0
  64. package/package/plugins/playlist.d.ts +2465 -0
  65. package/package/plugins/playlist.js +1 -0
  66. package/package/plugins/preview.d.ts +2236 -0
  67. package/package/plugins/preview.js +1 -0
  68. package/package/plugins/qsel.d.ts +2236 -0
  69. package/package/plugins/qsel.js +1 -0
  70. package/package/plugins/qul.d.ts +2161 -0
  71. package/package/plugins/qul.js +1 -0
  72. package/package/plugins/rts.d.ts +2551 -0
  73. package/package/plugins/rts.js +25 -0
  74. package/package/plugins/share.d.ts +2181 -0
  75. package/package/plugins/share.js +1 -0
  76. package/package/plugins/speed.d.ts +2173 -0
  77. package/package/plugins/speed.js +1 -0
  78. package/package/plugins/ssai.d.ts +2502 -0
  79. package/package/plugins/ssai.js +7 -0
  80. package/package/plugins/subtitles.d.ts +2287 -0
  81. package/package/plugins/subtitles.js +1 -0
  82. package/package/plugins/thumbnails.d.ts +2164 -0
  83. package/package/plugins/thumbnails.js +1 -0
  84. package/package/plugins/tizen.d.ts +2152 -0
  85. package/package/plugins/tizen.js +1 -0
  86. package/package/plugins/vtsel.d.ts +2250 -0
  87. package/package/plugins/vtsel.js +1 -0
  88. package/package/plugins/webos.d.ts +2152 -0
  89. package/package/plugins/webos.js +1 -0
  90. package/package/util/loader.d.ts +2163 -0
  91. package/package/util/loader.js +63 -0
  92. package/package.json +2364 -1
  93. package/plugins/ads.js +1 -1
  94. package/plugins/analytics.js +1 -1
  95. package/plugins/ovp.js +1 -1
  96. package/plugins/rts.js +1 -1
  97. package/plugins/ssai.js +1 -1
package/plugins/ads.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * https://github.com/lancedikson/bowser
5
5
  * MIT License | (c) Dustin Diaz 2012-2015
6
6
  * MIT License | (c) Denis Demchenko 2015-2019
7
- */const Ee=class Bowser{static getParser(t,e=!1){if("string"!=typeof t)throw new Error("UserAgent should be a string");return new Parser(t,e)}static parse(t){return new Parser(t).getResult()}static get BROWSER_MAP(){return ge}static get ENGINE_MAP(){return fe}static get OS_MAP(){return _e}static get PLATFORMS_MAP(){return me}}.parse(window.navigator.userAgent),{platform:Se,os:Te,browser:Le}=Ee,Oe=t=>t&&t.toLowerCase();var Re={rnd:Math.random().toString(36).substr(2,32),os:Oe(Te.name+(Te.versionName?` ${Te.versionName}`:"")),device:Oe(Se.type),browser:Oe(Le.name),browser_version:(Le&&Le.version?Le.version:"unknown").split(".").shift(),plugin_version:"3.34.3"};const Me="https://fp-eu-w1-aai.flowplayer.com/in",Pe="POST",ke=[y,v,A,E,w,q,O],De=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],Ie=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],Ce=yt("ads/analytics"),Ne=RequestQueue.of(),Ue=(...t)=>Object.assign({},...t);class Analytics{static of(t,e){return new Analytics(t,e)}static ensure_required_keys(t,e){return t.required_keys.filter(t=>!(t in e))}static pluck_valid_keys(t,e){return((t,...e)=>Object.keys(t).filter(t=>~e.indexOf(t)).reduce((e,s)=>Object.assign(e,{[s]:t[s]}),{}))(e,...t.valid_keys)}static mergeMetadata(t,e={}){return t.metadata=Analytics.pluck_valid_keys(t,Ue(t.metadata,e,{player_version:"3.34.3"})),t}constructor(t,e={}){this.emitter=t,this.metadata=Ue(Re,e.metadata||{}),this.emitter=t,this.events=e.events||[],this.required_keys=e.required_keys||[],this.optional_keys=e.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),Ce(this),this.wireup()}wireup(){this.events.forEach(t=>{this.emitter.on(t,e=>{const s=e.detail,i=Ue(this.metadata,{event_type:t},s),r=Analytics.pluck_valid_keys(this,i),a=Analytics.ensure_required_keys(this,r);if(Ce(`Event[${t}]`,{payload:r,observation:s}),a.length)return Ce(`Analytics.validate_metadata() failed for\n Event[${t}]\n missing keys: ${a}`,r);RequestQueue.rpush(Ne,[Me,Pe,r])})})}destroy(){const t=this;t.emitter=t.metadata=t.events=t.required_keys=t.optional_keys=t.valid_keys=void 0}}class EventBus{constructor(t=document.createElement("div"),e=[]){this._bus=t,this._listeners=e}removeAllListeners(){this._listeners.length=0,this._bus=document.createElement("div")}emit(t,e){const s=new CustomEvent(t,{detail:e||{}});this._bus.dispatchEvent(s)}on(t,e){this._listeners.push([t,e]),this._bus.addEventListener(t,e,{passive:!0})}once(t,e){this._bus.addEventListener(t,e,{once:!0})}removeListener(t,e){this._bus.removeEventListener(t,e)}}const xe=yt("ads/controller"),Fe={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10};class AdsController extends EventBus{constructor(t={}){var e;super(),this.adapter=function(t,e){return t.adapter?new t.adapter(e):new IMA(e)}(t,this),this.opts=Object.assign(Object.assign({},Fe),t),this.analytics=(e=this,Analytics.of(e,{required_keys:De,optional_keys:Ie,events:ke})),this._state=AdsState.of(),this._schedule=void 0,this._lastAd=void 0,this._macros=new Macros(t.parameters||{}),this.wireup(),this.content_processing_src=!1}reset(){return this.removeAllListeners(),this.wireup(),this.analytics&&this.analytics.wireup(),this._state.reset(),this.adapter.reset(),this}destroy(){this.removeAllListeners(),this.analytics&&this.analytics.destroy(),this.adapter&&this.adapter.destroy();const t=this;t.analytics=void 0,t.opts=void 0,t.adapter=void 0,t._state=void 0,t._schedule=void 0,t._lastAd=void 0,t._macros=void 0}stop(){this.adapter&&this.adapter.stop()}onContentNewSrc(){this._state.reset(),this.adapter.destroyManager(),this.adapter.contentComplete()}wireup(){const t=()=>{var t,e;this.adapter.onAdRequestEnd(),null===(t=this.videoTag)||void 0===t||t.setState("ad-paused",!1),null===(e=this.videoTag)||void 0===e||e.setState("ad-playing",!0),this._state.toggleState(ue.PLAYING,!0)};this.on(B,t),this.on(w,t),this.on(T,t);const e=t=>{var e,s;(null==t?void 0:t.type)!==v&&this.adapter.onAdRequestEnd(),null===(e=this.videoTag)||void 0===e||e.setState("ad-paused",(null==t?void 0:t.type)===S),null===(s=this.videoTag)||void 0===s||s.setState("ad-playing",!1),this.adPlaying&&this._state.toggleState(ue.PLAYING,!1)};this.on(k,e),this.on(_,e),this.on(m,e),this.on(v,e),this.on(S,e),this.on(O,e),this.on(E,e),this.on(k,()=>{requestAnimationFrame(()=>{this._state.toggleState(ue.BREAK_ACTIVE,!1)})}),this.on(F,()=>{console.error("Adapter init failed"),e(),this._state.toggleState(ue.FATAL_ERROR,!0)}),this.on(j,async t=>{if(xe("Ads.on(RELOAD_AD_REQUESTED)",t),this._schedule){if(e(),t)return this._schedule.reset(this._schedule.getAds());this._state.hasAny(ue.AD_AVAILABLE)&&(this._schedule.decrement(),this._state.toggleState(ue.AD_AVAILABLE,!1))}})}async initialize(t,e={},s){return xe("Ads.initialize():",t,e,s),this._state.toggleState(ue.INITIALIZING,!0),Object.assign(this.opts,e),Array.isArray(t)&&this.setSchedule(t),await this.adapter.init(this.opts),this._macros=this._macros.fork(Object.assign({},e.parameters||{},{autoplay:e.autoplay,muted:e.muted})),this.adapter.isReady()&&await this.adapterInitialized(s),this}get videoTag(){return this.adapter.getVideoTag()}get adInfo(){return this.adapter.getAdInfo()}async setVideoTag(t){xe("Ads.setVideoTag():",t),await this.adapter.setVideoTag(t),this.trigger(f,t),this.adapter.isReady()&&await this.adapterInitialized(),t.on(H,()=>this.adapter.pause()),t.on(V,()=>this.adapter.resume()),t.on(z,()=>t.toggleMute()),t.on(Z,()=>{this.adapter.volume(t.muted?0:0==t.volume?.1:t.volume)}),t.on("src",()=>t.hasState("ad-playing")||t.hasState("ad-paused")?(this.stop(),this.adapter.isLinearAd()?(this.setIsContentProcessingNewSrc(!0),void this.once(k,()=>{setTimeout(()=>{this.setIsContentProcessingNewSrc(!1),this.onContentNewSrc()},0)})):this.onContentNewSrc()):this.onContentNewSrc())}waitForVideoTag(){return new Promise(t=>{const e=this.adapter.getVideoTag();if(e)return t(e);this.on(f,e=>{this.once(g,()=>t(e))})})}async adapterInitialized(t){xe("Ads.adapterInitialized()"),this._state.toggleState(ue.INITIALIZING,!1),this._state.toggleState(ue.BREAK_ACTIVE,!!this.hasPreroll()),await this.setCurrentTime(0,t),this.checkIfBreakComplete(),this.adapter.isAdPod()||t&&!this.opts.autoplay||this.trigger(_)}async fetchNextAd(t,e=0){var s,i;if(!this._schedule)return;if(!this.adapter.isReady())return;if(e>50)throw this._state.toggleState(ue.FATAL_ERROR,!0),this._state.toggleState(ue.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");const r=(null===(s=this._schedule)||void 0===s?void 0:s.getNextAd())||(null===(i=this._schedule)||void 0===i?void 0:i.getPostroll());if(!r||this.adapter.canDismissNonLinear()||-1===t)if(this._schedule.waitForLoad(t,r,this.opts.preload_ads))this._state.toggleState(ue.FETCHING_AD,!1);else if(r!==this._schedule.getPostroll()||(this._schedule.setPostrollActive(),-1===t))if(this._schedule.isDrained()||this._schedule.increment(),r){xe("Ads.fetchNextAd",r),this._state.toggleState(ue.FETCHING_AD,!0);try{return await this.requestAd(r),this._state.toggleState(ue.AD_AVAILABLE,!0),void this._state.toggleState(ue.FETCHING_AD,!1)}catch(s){return xe("Ads.fetchNextAd(err: %o, ad: %o)",s,r),this.setLastAd(r),r!==this._schedule.getPostroll()?await this.fetchNextAd(t,++e):void this._state.toggleState(ue.FETCHING_AD,!1)}}else this._state.toggleState(ue.FETCHING_AD,!1);else this._state.toggleState(ue.FETCHING_AD,!1)}skipAdsOnSeek(t){if(!this._schedule)return;let e=this._schedule.getNextAd();for(;e&&e.time<t;)this._schedule.increment(),e=this._schedule.getNextAd()}async setCurrentTime(t,e=!1,s=!1){if(!this._schedule)return;if(!this.adapter.isReady())return;if(this._state.hasAny(ue.FETCHING_AD))return;if(this._state.hasAny(ue.PLAYING)&&this.adapter.isLinearAd())return;const i=0===t&&0===this._schedule.getNextIndex();try{if(s&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(t),this._state.hasAny(ue.AD_AVAILABLE)||await this.fetchNextAd(t),!this._state.hasAny(ue.AD_AVAILABLE)||!this.shallPlayAd(t)||e)return;await this.playAd(),await this.setCurrentTime(t),this.checkIfBreakComplete()}catch(t){xe("setCurrentTime: Error(from: setCurrentTime, message: %s)",t.message)}finally{i&&this.trigger(I)}}async playAd(){var t;if(!this._state.hasAny(ue.AD_AVAILABLE))return;this._state.toggleState(ue.AD_AVAILABLE,!1),this._state.toggleState(ue.BREAK_ACTIVE,!0);const e=null===(t=this._schedule)||void 0===t?void 0:t.getCurrentAd();try{await this.adapter.playAd()}catch(t){console.error("Ads.playAd: error",t)}finally{e&&this.setLastAd(e)}}checkIfBreakComplete(){if(!this._state.hasAny(ue.BREAK_ACTIVE))return xe("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());xe("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(ue.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger(k)}resetScheduleCounter(){this._schedule&&this._schedule.resetCounter()}setSchedule(t,e){if(e&&!isNaN(e)&&this._schedule&&this._schedule.updateContentDuration(e),this._schedule&&this._schedule.getNextIndex()>0)return this._schedule.setAds(t);this._schedule=new Schedule(t,{preload_advance:this.opts.preload_advance,content_duration:e?0:e})}toJSON(){return this._schedule?this._schedule.toJSON():[]}trigger(t,e={}){var s;if(!this.adapter.getVideoTag())return;if(!this._state)return;if(t===k&&this._state.hasAny(ue.BREAK_ACTIVE)&&!this.adapter.isAdPod()&&!e.force)return xe("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if(null===(i=e)||"object"!=typeof i||le(i)!==de)return this.dispatch(t,e);var i;const r=Object.assign({},this.adapter.getOpts()||{},(null===(s=this._schedule)||void 0===s?void 0:s.getCurrentAd())||{},{ad_type:this.ad_type},e);return this.dispatch(t,r)}dispatch(t,e){const s=this.adapter.getVideoTag();if(s){xe(":dispatch",t,e),this.adapter.isAdPod()&&"object"==typeof e&&"time"in e&&"preroll"!==e.ad_type&&(e.time=this.adapter.getAdBreakTime());try{const i={event:"ads/"+t,detail:{outstream:e.outstream,ad_type:e.ad_type,ad_break_time:e.time,ad_remaining_seconds:e.remaining,ad_muted:e.muted,ad_duration_seconds:e.duration,ad_error_reason:e.reason,ad_vast_error:e.vast_error,ad_vast_error_type:e.vast_error_type,ad_request_load_type:e.request_load_time}};s.dispatchEvent(new CustomEvent("health:record",{detail:i}))}catch(t){xe(":error",t)}ct(s,t,e),this.emit(t,e)}}get ad_type(){if(!this.videoTag)return;if(!this.adapter.isAdPod())return this._schedule&&this._schedule.getCurrentType();const t=this.adapter.getAdBreakTime();return-1===t?"postroll":this.videoTag.hasState(nt)||t<1?"preroll":"midroll"}shouldRestartContent(){if(this.getIsContentProcessingNewSrc())return!1;if(this.adapter.isAdPod())return!0;const t=this.getLastAd();return!t||!t.outstream&&!1!==t.restart}async finished(t){if(this._schedule&&(xe("Ads.finished"),!(this.adapter.isCustomPlaybackEnabled()&&this._state.hasAny(ue.PLAYING)&&this.adapter.isLinearAd()))){xe("Ads.finished: trying to play postroll");try{if(!this._schedule.getPostroll())return xe("Ads.finished: no postroll found"),await this.adapter.contentComplete();this._state.hasAny(ue.AD_AVAILABLE)||await this.fetchNextAd(-1),await this.playAd(),this.adapter.contentComplete()}catch(t){xe("Ads.finished: postroll failed:",t)}finally{this.trigger(D),this.checkIfBreakComplete(),"function"==typeof t&&t()}}}hasPreroll(){return this._schedule&&Schedule.hasPreroll(this._schedule.getAds())}shallPlayAd(t){var e;return(!this.adapter||!this.adapter.isAdPod())&&(!(!this._state||this._state.hasAny(ue.FATAL_ERROR))&&!!(null===(e=this._schedule)||void 0===e?void 0:e.shallPlayAd(t)))}setLastAd(t){return this._lastAd=t,this}setIsContentProcessingNewSrc(t){this.content_processing_src=t}getLastAd(){return this._lastAd}getIsContentProcessingNewSrc(){return this.content_processing_src}mergeMacros(t={}){return this._macros=this._macros.fork(Object.assign({},t)),this}get paused(){return this.adapter&&this.adapter.isPaused()}pause(){this.adapter&&this.adapter.pause()}resume(){this.adapter&&this.adapter.resume()}resize(t){this.adapter&&this.adapter.onResize(t)}async requestAd(t,e=0,s=this.opts.timeout){if(!this._state)return;xe("Ads.requestAd(ad: %o)",{ad:t,timeout:s,idx:e});const i=await oe(t);if(void 0===i[e])return setTimeout(()=>this.trigger(_),0),Promise.reject(new Error("Ad failed, no fallbacks left"));if(!i[e])return await this.requestAd(i,e+1,s);this.trigger(y,t);const r=this._macros.compile(i[e],re(this.opts,this.adapter.getDimensions()));try{return void await this.adapter.initAd(r,s)}catch(t){return xe(`Ads.requestAd(:fallback, idx: ${e}, length: ${i.length}, adTag: ${i[e]})\nError `,{adTag:i,err:t}),this.requestAd(i,e+1,s)}}resetSchedule(t){this._schedule&&this._schedule.reset(t)}get adPlaying(){return this._state&&this._state.hasAny(ue.PLAYING)}get adBreak(){return this._state&&this._state.hasAny(ue.BREAK_ACTIVE)}get adRequesting(){return this._state.hasAny(ue.FETCHING_AD)}get adLinear(){return this.adBreak&&this.adapter.isLinearAd()}}var Be=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),je=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function qe(t){return Object.assign({muted:!1,timeout:250,inline:!1},t)}function He(t,e){var s=t.muted,i=t.timeout,r=t.inline,a=e(),n=a.element,o=a.source,d=void 0,l=void 0,c=void 0;return n.muted=s,!0===s&&n.setAttribute("muted","muted"),!0===r&&n.setAttribute("playsinline","playsinline"),n.src=o,new Promise(function(t){d=n.play(),l=setTimeout(function(){c(!1,new Error("Timeout "+i+" ms has been reached"))},i),c=function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.remove(),n.srcObject=null,clearTimeout(l),t({result:e,error:s})},void 0!==d?d.then(function(){return c(!0)}).catch(function(t){return c(!1,t)}):c(!0)})}var Ve={audio:function(t){return He(t=qe(t),function(){return{element:document.createElement("audio"),source:URL.createObjectURL(Be)}})},video:function(t){return He(t=qe(t),function(){return{element:document.createElement("video"),source:URL.createObjectURL(je)}})}};let ze;async function Ge(t=!0){return ze||(ze=await Ve.video({timeout:500,muted:t}),ze)}var We=Object.freeze({__proto__:null,STICKY_CONTROLS:1,NO_FULLSCREEN:2,NO_AD_INDICATOR:4,AD_ATTRIBUTION:8,AD_CHOICES:16,REMAINING_TIME:32,VOLUME_BAR:64});const Qe=["progress","duration","remaining"];class AdUI extends HTMLElement{static get observedAttributes(){return Qe}constructor(t){super(),this.player=t,this.className="fp-ad-ui",this.append(...t.createComponents(Et,St)),t.on(Q,t=>{let{ui_flags:e}=t.detail;if(e=e||0,(8&e)>0){const t=document.createElement("div");t.classList.add("ad-attribution"),t.textContent=this.player.i18n("ads.advertisement","Advertisement"),this.append(t)}})}}const $e=yt("fpads:native:outstream"),Ke={OUTSTREAM:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"};var Ye,Ze;!function(t){t.OUTSTREAM_VISIBLE="ads-outstream-visible",t.OUTSTREAM_VIEWPORT_UPDATE="ads-outstream-viewport-update",t.OUTSTREAM_TEARDOWN="ads-outstream-teardown",t.OUTSTREAM_ENDSCREEN_READY="ads-outstream-endscreen-ready"}(Ye||(Ye={})),function(t){t[t.None=0]="None",t[t.Booting=1]="Booting",t[t.Ready=2]="Ready",t[t.Disposed=3]="Disposed"}(Ze||(Ze={}));class Outstream{constructor({ads:t,root:e,content:s,ima:i}){this.state=Ze.None,$e("creating Outstream instance"),this.content=s,this.ads=t,this.root=e,this.ima=i,this.aspectRatio=s.videoHeight/s.videoWidth,this.dimensions=function(t){if(t.clientWidth>0||t.clientHeight)return h(t);const e={height:t.style.height};p(t,"opacity",0),p(t,"display","absolute"),p(t,"display","inline-block"),p(t,"height","auto");const s=h(t);return p(t,"height",e.height),p(t,"opacity",1),s}(this.root),this.adUi=new AdUI(s),this.initialVolumeState={},e.classList.add(Ke.OUTSTREAM),e.append(this.adUi),this.hide(),this.ads.on(b,t=>{var e;if(this.state==Ze.Disposed)return;const s=!!(null===(e=t.detail)||void 0===e?void 0:e.linear);this.ads.resize(Object.assign(Object.assign({},this.dimensions),{linear:s}))}),s.on(Y,t=>{if(this.state==Ze.Disposed)return;const e=t.detail;e&&(this.dimensions={width:e.contentRect.width,height:e.contentRect.height},this.ads.resize(this.dimensions))});let r=1,a=!0;s.on("intersectionchange",t=>{if(this.state==Ze.Disposed)return;const e=t.detail;if(e)switch(this.state){case Ze.Booting:return $e(":boot skipping intersectionchange");case Ze.None:return this.state=Ze.Booting,this.begin_life_cycle();case Ze.Ready:if(r=e.ratio,e.ratio>=.5&&this.ads.adPlaying)return;e.ratio>=.5&&a&&this.ads.resume(),e.ratio<.5&&this.ads.pause()}}),this.content.on(S,()=>a=r<.5),this.setup(),setTimeout(()=>(this.state=Ze.Booting,this.begin_life_cycle()),0)}hide(){return this}restore_aspect_ratio(){return $e(`Outstream.restore_aspect_ratio(${this.aspectRatio})`),this.content.setOpts({ratio:this.aspectRatio}),this}show(){this.root.classList.remove(Outstream.CLASS.HIDDEN),this.root.classList.add(Outstream.CLASS.SHOWING),this.content.setState("ad-linear",!0)}async begin_life_cycle(){var t;this.state=Ze.Ready;const{error:e,result:s}=await Ge(!1),{result:i}=await Ge(!0);this.content.emit(Q,{ui_flags:null===(t=this.content.opts.ads)||void 0===t?void 0:t.ui}),this.attach_ad_listeners(),this.initialVolumeState={can_autoplay:!(!s&&!i),muted:!s},$e(`Outstream.show() :autoplay >> sound=${s}`),e&&this.content&&!s&&(this.content.muted=!0,this.content.volume=0),await this.ads.setVideoTag(this.content),await Dt({ads:this.ads,content:this.content,adContainer:this.adUi,ima:this.ima,state:{listening:!1},config:this.content.opts}),xt({content:this.content,ads:this.ads}),this.state=Ze.Ready}attach_ad_listeners(){this.ads.once(b,()=>{this.show(),this.ads.adPlaying&&this.ads.pause()});const t=()=>{Pt.forEach(e=>this.ads.removeListener(e,t));const e=new CustomEvent(Ye.OUTSTREAM_TEARDOWN);$e("Outstream(:teardown)",e),this.content.dispatchEvent(e)};Pt.forEach(e=>this.ads.once(e,t)),this.content.once(Ye.OUTSTREAM_TEARDOWN,t=>{setTimeout(()=>{if(t.defaultPrevented)return this.handle_endscreen();this.dispose()},0)})}handle_endscreen(){this.reset_ui(),this.ads.reset(),Nt({config:this.content.opts,ui:this.adUi,ads:this.ads,adContainer:this.adUi,ima:this.ima,content:this.content,root:this.content.root,state:{started:!0,listening:!1},initial:{muted:!0,volume:1}})}empty_src(){this.content.setSrc({type:"video/mp4",src:URL.createObjectURL(Lt)})}setup(){this.root.classList.add(Outstream.CLASS.OUTSTREAM),this.root.classList.add(Outstream.CLASS.HIDDEN),this.content.setState("ad-linear",!1),this.empty_src()}reset_ui(){const t=this.root;t.classList.remove(Outstream.CLASS.SHOWING),t.classList.remove(Outstream.CLASS.OUTSTREAM)}dispose(){if(this.state==Ze.Disposed)return;const t=this.root,e=this.content;this.reset_ui(),t.classList.add(Outstream.CLASS.OUTSTREAM),t.classList.add(Outstream.CLASS.DONE);const s=this;s.video=s.container=s.ads=0,this.state=Ze.Disposed,e.destroy(),t.innerHTML=""}}function Je(t){return t&&"number"==typeof t.time}function Xe(t){return t&&"number"==typeof t.percentage&&"number"!=typeof t.time}Outstream.CLASS=Ke;const ts=yt("ads/ima/sdk");var es,ss;async function is(t,e){var s;const i=null===(s=null===window||void 0===window?void 0:window.google)||void 0===s?void 0:s.ima;if(e?null==i?void 0:i.dai:i)return void ts(":noop");const r=e?"https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js":t._storage.getItem("ima/debug")?"https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"https://imasdk.googleapis.com/js/sdkloader/ima3.js";try{return await async function(t){return new Promise((e,s)=>{let i=document.querySelector(`script[src='${t}']`);if(i)return rs(i,e,s);i=document.createElement("script"),i.setAttribute("state",es.LOADING),rs(i,e,s),i.src=t,document.head.appendChild(i)})}(r),void ts(":loaded")}catch(t){ts(`:error ${t.message}`,t)}}function rs(t,e,s){const i=t.getAttribute("state");if(i&&[es.ERROR,es.LOADED].includes(i))return e(void 0);t.addEventListener("load",()=>{t.setAttribute("state",es.LOADED),e(void 0)},{once:!0}),["error","abort"].forEach(e=>{t.addEventListener(e,()=>{t.setAttribute("state",es.ERROR),s("script failed to load")},{once:!0})})}!function(t){t.LOADING="loading",t.LOADED="loaded",t.ERROR="error"}(es||(es={})),function(t){t.LOADING="loading",t.LOADED="loaded",t.ERROR="error"}(ss||(ss={}));const as=yt("ads/ima/sdk"),ns="https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js",os=ns;async function ds(t){var e;const s=t._storage.getItem("prebid/debug")?ns:os;if(null===(e=null===window||void 0===window?void 0:window.pbjs)||void 0===e?void 0:e.version)as(":noop");else if(!document.querySelector(`script[src='${s}']`))try{return await async function(t){return new Promise((e,s)=>{let i=document.querySelector(`script[src='${t}']`);i||(i=document.createElement("script")),i.setAttribute("state",ss.LOADING);const r=i.getAttribute("state");if(r&&[ss.ERROR,ss.LOADED].includes(r))return e(void 0);i.addEventListener("load",()=>{i.setAttribute("state",ss.LOADED),e(void 0)},{once:!0}),["error","abort"].forEach(t=>{i.addEventListener(t,()=>{i.setAttribute("state",ss.ERROR),s("script failed to load")},{once:!0})}),i.src=t,document.head.appendChild(i)})}(s),void as(":loaded")}catch(t){console.warn(`:error / failed to load prebid.js / ${t.message}`,t)}}const ls=window.pbjs=window.pbjs||{};ls.que=ls.que||[];class PrebidAdController{constructor(t,e){this.player=t,this.config=e,this.player=t,this.bestOffer="",ls.que.push(()=>{var s,i;const r=this.createAdUnit();ls.addAdUnits(r);const a=(null===(i=null===(s=e.ads)||void 0===s?void 0:s.prebid)||void 0===i?void 0:i.pbjs)||{};ls.setConfig(Object.assign({enableSendAllBids:!0},a)),t.emit($,{pbjs:ls}),ls.requestBids({bidsBackHandler:t=>{var s,i,a,n,o;const d=null===(s=t[this.prebidCode()])||void 0===s?void 0:s.bids;if(!d)return;if(0==d.length)return;const l=d[0];if(l&&l.vastUrl)return this.bestOffer=l.vastUrl;const c=ls.adServers.dfp.buildVideoUrl({adUnit:r,params:{iu:null===(a=null===(i=e.ads)||void 0===i?void 0:i.prebid)||void 0===a?void 0:a.iu,cust_params:null===(o=null===(n=e.ads)||void 0===n?void 0:n.prebid)||void 0===o?void 0:o.custom_params,output:"vast"}});this.bestOffer=c}})})}prebidCode(){var t,e;return(null===(e=null===(t=this.config.ads)||void 0===t?void 0:t.prebid)||void 0===e?void 0:e.code)||this.player.root.id}videoInfo(){var t,e;return(null===(e=null===(t=this.config.ads)||void 0===t?void 0:t.prebid)||void 0===e?void 0:e.video)||{context:"instream",playerSize:[[this.player.videoWidth||640,this.player.videoHeight||480]]}}createAdUnit(){var t,e;return{code:this.prebidCode(),mediaTypes:{video:this.videoInfo()},bids:null===(e=null===(t=this.config.ads)||void 0===t?void 0:t.prebid)||void 0===e?void 0:e.bidders}}vastGenerator(){return async()=>this.bestOffer}}function cs(t,e){var s,i;const r=null===(s=e.ads)||void 0===s?void 0:s.prebid;if(!r)return;if((null===(i=t.prebidController)||void 0===i?void 0:i.config)===e)return;!function(t,{feature_name:e,behavior:s,sample_rate:i}){e&&(i||(i=_t),t.emit("flowplayer:feature",{feature_name:e,behavior:s,sample_rate:i}))}(t,{feature_name:"prebid",behavior:"used"}),t.prebidController||(t.prebidController=new PrebidAdController(t,e),ds(t));const a=t.prebidController;if(a){const e=r.breaks.map(t=>({adTag:a.vastGenerator(),time:t}));t.setOpts({ima:{ads:e}})}}const us=yt("ads/index");async function hs(t,e,s){var i;let r;if(s.on("config",()=>{var e,i,a;void 0===r&&t.autoplay&&(Gt(a=t.ima)&&(null==a?void 0:a.ads.find(t=>!t.time||"percentage"in t&&0===t.percentage)))&&!s.currentSrc&&(i=t.autoplay,r=!0===i?ut.ON:!1===i?ut.OFF:i,t.autoplay=0),(null===(e=t.ads)||void 0===e?void 0:e.prebid)&&cs(s,t),Gt(t.ima)&&zt(s)&&Object.assign(t,{hls:{native:!0}}),s.ads&&d()}),s.once("loadstart",()=>{setTimeout(async()=>{if(void 0!==r&&(await is(s),!("google"in window))){if(t.autoplay=r,s.setState(dt,!0),!s.hasState(lt))return s.once(st,()=>s.togglePlay(!0));s.togglePlay(!0)}},0)}),await is(s),!("google"in window))return console.warn("google.ima unavailable");let a=!1;const n=s.ads=new AdsController,o=n.analytics;function d(){if(!Gt(t.ima))return;const i=t.ima,d=t.duration||s.duration;if(i.ads=function(t,e){return Array.isArray(t)?t.filter(t=>Je(t)||Xe(t)).reduce((t,s)=>{if(Je(s))return t.push(s),t;if(s.lazy)return t.push(s),t;if(Xe(s)){const i=Object.assign({},s),r=s.percentage?s.percentage*e:0;return isNaN(r)||(i.time=r<0||r===e?-1:r),t.push(i),t}return t},[]):(console.warn("AdSchedule was not an Array"),[])}(i.ads,d),n.setSchedule(i.ads,d),t.metadata&&Analytics.mergeMetadata(o,t.metadata),t.metadata&&n.mergeMacros(t.metadata),t.metadata&&i.parameters&&(i.parameters=Object.assign(Object.assign({},i.parameters),t.metadata)),Analytics.mergeMetadata(o,{muted:t.muted||!1,autoplay:t.autoplay||!1}),!a){if(a=!0,t.lang&&!i.Locale&&(i.Locale=t.lang),Schedule.isOutstream(i.ads))return us("is outstream, returning"),new Outstream({root:e,content:s,ads:n,ima:i});kt({config:Object.assign(Object.assign({},t),{autoplay:r}),root:e,content:s,ads:n,ima:i})}}n.resize(h(e)),n.on(D,()=>{n.adapter.isCustomPlaybackEnabled()&&n.once(k,()=>{s.src=s.original_src,s.once("canplay",()=>{s.togglePlay(!1)}),s.webkitExitFullscreen()})}),s.on("reap",function(){n&&n.destroy()}),(null===(i=t.ads)||void 0===i?void 0:i.prebid)&&cs(s,t),d()}class AdControls extends HTMLElement{constructor(t){super(),this.player=t,this.classList.add("fp-ad-controls"),this.append(this.adRemainingTime(),At(this.player,Tt),this.playbackButtons(),this.volumeBtn(),At(this.player,"flowplayer-volume-bar"),...this.fullscreenIcons(),this.adChoices()),t.on(Q,this.applyStyleFlags.bind(this))}fullscreenIcons(){return this.player.createComponents("flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon").map(t=>(t.onclick=()=>this.player.toggleFullScreen(),t))}volumeBtn(){const t=At(this.player,"flowplayer-volume-icon");return t.onclick=()=>this.player.emit(z),t}playbackButtons(){const t=document.createElement("div");t.classList.add("ad-playback-controls");const e=At(this.player,"flowplayer-small-play-icon"),s=At(this.player,"flowplayer-small-pause-icon");return e.addEventListener("click",()=>{this.player.emit(V),setTimeout(function(){s.focus&&s.focus()},100)}),s.addEventListener("click",()=>{this.player.emit(H),setTimeout(function(){e.focus&&e.focus()},100)}),t.append(e,s),t}adChoices(){const t=document.createElement("div");return t.classList.add("fp-ad-choices"),t.textContent=this.player.i18n("ads.adchoices","AdChoices"),t.addEventListener("click",t=>{t.preventDefault(),this.player.togglePlay(!1),window.open("https://adssettings.google.com","_blank")}),t}adRemainingTime(){const t=document.createElement("div");return t.classList.add("fp-ad-remaining","fp-color-text"),this.prepend(t),this.player.on(L,e=>{const s=e.detail.remaining;t.textContent=function(t){if(isNaN(t)||t>=Number.MAX_SAFE_INTEGER)return"";const e=t<0?"-":"";t=Math.round(Math.abs(t));const s=Math.floor(t/3600);let i=Math.floor(t/60);return t-=60*i,s>=1?(i-=60*s,e+s+":"+ht(i)+":"+ht(t)):e+ht(i)+":"+ht(t)}(parseFloat(s+""))}),t}applyStyleFlags(t){var e;const s=null!==(e=t.detail.ui_flags)&&void 0!==e?e:0;this.classList.toggle("is-ad-controls-sticky",(1&s)>0),this.classList.toggle("no-indicator",(4&s)>0),this.classList.toggle("is-ad-choices",(16&s)>0),this.classList.toggle("no-volume-bar",!(64&s)),this.classList.toggle("is-ad-remaining",(32&s)>0),this.classList.toggle("no-fullscreen",(2&s)>0)}}class AdCountdown extends HTMLElement{static get observedAttributes(){return["remaining"]}constructor(t){super(),this.player=t,this.className="fp-ad-countdown",t.on(L,t=>{const{duration:e,remaining:s}=t.detail;this.setAttribute("duration",e+""),this.setAttribute("remaining",s+"")}),t.on(w,t=>{t.detail.linear&&(this.style.setProperty("--ad-percent-previous","0"),this.style.setProperty("--ad-percent-complete","0"))}),this.addEventListener("animationend",()=>{const t=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",t)})}attributeChangedCallback(t,e,s){if("remaining"===t)return this.onRemaining(s)}onRemaining(t){const e=parseFloat(this.getAttribute("duration")||"0");t||(t=e+"");const s=parseFloat(t),i=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",i),this.classList.remove("go");const r=((e-s)/e*100).toFixed(3);requestAnimationFrame(()=>{this.style.setProperty("--ad-percent-complete",r),this.classList.add("go")})}}class AdIndicator extends HTMLElement{static get observedAttributes(){return["position","totals"]}constructor(t){super(),this.player=t,this.render(),t.on(w,t=>{const{position:e,totals:s}=t.detail.ad;this.setAttribute("position",e+""),this.setAttribute("totals",s+"")})}attributeChangedCallback(t,e){switch(t){case"position":case"totals":return this.updateText()}}updateText(){if(!this.element)return;const t=parseFloat(this.getAttribute("position")||"0"),e=parseFloat(this.getAttribute("totals")||"0");this.element.textContent=`${this.player.i18n("ads.indicator","ADS")} ${t} / ${e}`}render(){this.element=document.createElement("div"),this.element.classList.add("ad-indicator","fp-color-text"),this.element.textContent=this.player.i18n("ads.indicator","ADS"),this.append(this.element)}}var ps,gs=Object.freeze({__proto__:null,SINGlE_INLINE_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_SKIPPABLE_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirectlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_ERROR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_BROKEN:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&nofb=1&correlator=",SINGLE_VPAID_20_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinearvpaid2js&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_VPAID_20_NON_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dnonlinearvpaid2js&ciu_szs=728x90%2C300x250&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_NON_LINEAR_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/nonlinear_ad_samples&sz=480x70&cust_params=sample_ct%3Dnonlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_SESSION_AD_RULE_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sar%3Da0f2&ciu_szs=300x250&ad_rule=1&gdfp_req=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonly&ciu_szs=300x250%2C728x90&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonly&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator="});const{samsung_tv:ms}=u(),_s=(ps=class Ads{constructor(t){this.umd=t,bt(t,wt,AdUI),bt(t,Et,AdControls),bt(t,St,AdCountdown),bt(t,Tt,AdIndicator)}init(t,e,s){if(c.from_token(t.token||"").is_granted(c.permissions.ADS)&&!ms)return hs(t,e,s)}},ps.pluginName="ads",ps.events=K,ps.ui=We,ps.tags=gs,ps);return function(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;if(null===document.currentScript)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const s=t.flowplayer;return"function"==typeof s?(s(e),e):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(e)||s.extensions.push(e),e)}(window,_s)});
7
+ */const Ee=class Bowser{static getParser(t,e=!1){if("string"!=typeof t)throw new Error("UserAgent should be a string");return new Parser(t,e)}static parse(t){return new Parser(t).getResult()}static get BROWSER_MAP(){return ge}static get ENGINE_MAP(){return fe}static get OS_MAP(){return _e}static get PLATFORMS_MAP(){return me}}.parse(window.navigator.userAgent),{platform:Se,os:Te,browser:Le}=Ee,Oe=t=>t&&t.toLowerCase();var Re={rnd:Math.random().toString(36).substr(2,32),os:Oe(Te.name+(Te.versionName?` ${Te.versionName}`:"")),device:Oe(Se.type),browser:Oe(Le.name),browser_version:(Le&&Le.version?Le.version:"unknown").split(".").shift(),plugin_version:"3.35.0-rc"};const Me="https://fp-eu-w1-aai.flowplayer.com/in",Pe="POST",ke=[y,v,A,E,w,q,O],De=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],Ie=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],Ce=yt("ads/analytics"),Ne=RequestQueue.of(),Ue=(...t)=>Object.assign({},...t);class Analytics{static of(t,e){return new Analytics(t,e)}static ensure_required_keys(t,e){return t.required_keys.filter(t=>!(t in e))}static pluck_valid_keys(t,e){return((t,...e)=>Object.keys(t).filter(t=>~e.indexOf(t)).reduce((e,s)=>Object.assign(e,{[s]:t[s]}),{}))(e,...t.valid_keys)}static mergeMetadata(t,e={}){return t.metadata=Analytics.pluck_valid_keys(t,Ue(t.metadata,e,{player_version:"3.35.0-rc"})),t}constructor(t,e={}){this.emitter=t,this.metadata=Ue(Re,e.metadata||{}),this.emitter=t,this.events=e.events||[],this.required_keys=e.required_keys||[],this.optional_keys=e.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),Ce(this),this.wireup()}wireup(){this.events.forEach(t=>{this.emitter.on(t,e=>{const s=e.detail,i=Ue(this.metadata,{event_type:t},s),r=Analytics.pluck_valid_keys(this,i),a=Analytics.ensure_required_keys(this,r);if(Ce(`Event[${t}]`,{payload:r,observation:s}),a.length)return Ce(`Analytics.validate_metadata() failed for\n Event[${t}]\n missing keys: ${a}`,r);RequestQueue.rpush(Ne,[Me,Pe,r])})})}destroy(){const t=this;t.emitter=t.metadata=t.events=t.required_keys=t.optional_keys=t.valid_keys=void 0}}class EventBus{constructor(t=document.createElement("div"),e=[]){this._bus=t,this._listeners=e}removeAllListeners(){this._listeners.length=0,this._bus=document.createElement("div")}emit(t,e){const s=new CustomEvent(t,{detail:e||{}});this._bus.dispatchEvent(s)}on(t,e){this._listeners.push([t,e]),this._bus.addEventListener(t,e,{passive:!0})}once(t,e){this._bus.addEventListener(t,e,{once:!0})}removeListener(t,e){this._bus.removeEventListener(t,e)}}const xe=yt("ads/controller"),Fe={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10};class AdsController extends EventBus{constructor(t={}){var e;super(),this.adapter=function(t,e){return t.adapter?new t.adapter(e):new IMA(e)}(t,this),this.opts=Object.assign(Object.assign({},Fe),t),this.analytics=(e=this,Analytics.of(e,{required_keys:De,optional_keys:Ie,events:ke})),this._state=AdsState.of(),this._schedule=void 0,this._lastAd=void 0,this._macros=new Macros(t.parameters||{}),this.wireup(),this.content_processing_src=!1}reset(){return this.removeAllListeners(),this.wireup(),this.analytics&&this.analytics.wireup(),this._state.reset(),this.adapter.reset(),this}destroy(){this.removeAllListeners(),this.analytics&&this.analytics.destroy(),this.adapter&&this.adapter.destroy();const t=this;t.analytics=void 0,t.opts=void 0,t.adapter=void 0,t._state=void 0,t._schedule=void 0,t._lastAd=void 0,t._macros=void 0}stop(){this.adapter&&this.adapter.stop()}onContentNewSrc(){this._state.reset(),this.adapter.destroyManager(),this.adapter.contentComplete()}wireup(){const t=()=>{var t,e;this.adapter.onAdRequestEnd(),null===(t=this.videoTag)||void 0===t||t.setState("ad-paused",!1),null===(e=this.videoTag)||void 0===e||e.setState("ad-playing",!0),this._state.toggleState(ue.PLAYING,!0)};this.on(B,t),this.on(w,t),this.on(T,t);const e=t=>{var e,s;(null==t?void 0:t.type)!==v&&this.adapter.onAdRequestEnd(),null===(e=this.videoTag)||void 0===e||e.setState("ad-paused",(null==t?void 0:t.type)===S),null===(s=this.videoTag)||void 0===s||s.setState("ad-playing",!1),this.adPlaying&&this._state.toggleState(ue.PLAYING,!1)};this.on(k,e),this.on(_,e),this.on(m,e),this.on(v,e),this.on(S,e),this.on(O,e),this.on(E,e),this.on(k,()=>{requestAnimationFrame(()=>{this._state.toggleState(ue.BREAK_ACTIVE,!1)})}),this.on(F,()=>{console.error("Adapter init failed"),e(),this._state.toggleState(ue.FATAL_ERROR,!0)}),this.on(j,async t=>{if(xe("Ads.on(RELOAD_AD_REQUESTED)",t),this._schedule){if(e(),t)return this._schedule.reset(this._schedule.getAds());this._state.hasAny(ue.AD_AVAILABLE)&&(this._schedule.decrement(),this._state.toggleState(ue.AD_AVAILABLE,!1))}})}async initialize(t,e={},s){return xe("Ads.initialize():",t,e,s),this._state.toggleState(ue.INITIALIZING,!0),Object.assign(this.opts,e),Array.isArray(t)&&this.setSchedule(t),await this.adapter.init(this.opts),this._macros=this._macros.fork(Object.assign({},e.parameters||{},{autoplay:e.autoplay,muted:e.muted})),this.adapter.isReady()&&await this.adapterInitialized(s),this}get videoTag(){return this.adapter.getVideoTag()}get adInfo(){return this.adapter.getAdInfo()}async setVideoTag(t){xe("Ads.setVideoTag():",t),await this.adapter.setVideoTag(t),this.trigger(f,t),this.adapter.isReady()&&await this.adapterInitialized(),t.on(H,()=>this.adapter.pause()),t.on(V,()=>this.adapter.resume()),t.on(z,()=>t.toggleMute()),t.on(Z,()=>{this.adapter.volume(t.muted?0:0==t.volume?.1:t.volume)}),t.on("src",()=>t.hasState("ad-playing")||t.hasState("ad-paused")?(this.stop(),this.adapter.isLinearAd()?(this.setIsContentProcessingNewSrc(!0),void this.once(k,()=>{setTimeout(()=>{this.setIsContentProcessingNewSrc(!1),this.onContentNewSrc()},0)})):this.onContentNewSrc()):this.onContentNewSrc())}waitForVideoTag(){return new Promise(t=>{const e=this.adapter.getVideoTag();if(e)return t(e);this.on(f,e=>{this.once(g,()=>t(e))})})}async adapterInitialized(t){xe("Ads.adapterInitialized()"),this._state.toggleState(ue.INITIALIZING,!1),this._state.toggleState(ue.BREAK_ACTIVE,!!this.hasPreroll()),await this.setCurrentTime(0,t),this.checkIfBreakComplete(),this.adapter.isAdPod()||t&&!this.opts.autoplay||this.trigger(_)}async fetchNextAd(t,e=0){var s,i;if(!this._schedule)return;if(!this.adapter.isReady())return;if(e>50)throw this._state.toggleState(ue.FATAL_ERROR,!0),this._state.toggleState(ue.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");const r=(null===(s=this._schedule)||void 0===s?void 0:s.getNextAd())||(null===(i=this._schedule)||void 0===i?void 0:i.getPostroll());if(!r||this.adapter.canDismissNonLinear()||-1===t)if(this._schedule.waitForLoad(t,r,this.opts.preload_ads))this._state.toggleState(ue.FETCHING_AD,!1);else if(r!==this._schedule.getPostroll()||(this._schedule.setPostrollActive(),-1===t))if(this._schedule.isDrained()||this._schedule.increment(),r){xe("Ads.fetchNextAd",r),this._state.toggleState(ue.FETCHING_AD,!0);try{return await this.requestAd(r),this._state.toggleState(ue.AD_AVAILABLE,!0),void this._state.toggleState(ue.FETCHING_AD,!1)}catch(s){return xe("Ads.fetchNextAd(err: %o, ad: %o)",s,r),this.setLastAd(r),r!==this._schedule.getPostroll()?await this.fetchNextAd(t,++e):void this._state.toggleState(ue.FETCHING_AD,!1)}}else this._state.toggleState(ue.FETCHING_AD,!1);else this._state.toggleState(ue.FETCHING_AD,!1)}skipAdsOnSeek(t){if(!this._schedule)return;let e=this._schedule.getNextAd();for(;e&&e.time<t;)this._schedule.increment(),e=this._schedule.getNextAd()}async setCurrentTime(t,e=!1,s=!1){if(!this._schedule)return;if(!this.adapter.isReady())return;if(this._state.hasAny(ue.FETCHING_AD))return;if(this._state.hasAny(ue.PLAYING)&&this.adapter.isLinearAd())return;const i=0===t&&0===this._schedule.getNextIndex();try{if(s&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(t),this._state.hasAny(ue.AD_AVAILABLE)||await this.fetchNextAd(t),!this._state.hasAny(ue.AD_AVAILABLE)||!this.shallPlayAd(t)||e)return;await this.playAd(),await this.setCurrentTime(t),this.checkIfBreakComplete()}catch(t){xe("setCurrentTime: Error(from: setCurrentTime, message: %s)",t.message)}finally{i&&this.trigger(I)}}async playAd(){var t;if(!this._state.hasAny(ue.AD_AVAILABLE))return;this._state.toggleState(ue.AD_AVAILABLE,!1),this._state.toggleState(ue.BREAK_ACTIVE,!0);const e=null===(t=this._schedule)||void 0===t?void 0:t.getCurrentAd();try{await this.adapter.playAd()}catch(t){console.error("Ads.playAd: error",t)}finally{e&&this.setLastAd(e)}}checkIfBreakComplete(){if(!this._state.hasAny(ue.BREAK_ACTIVE))return xe("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());xe("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(ue.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger(k)}resetScheduleCounter(){this._schedule&&this._schedule.resetCounter()}setSchedule(t,e){if(e&&!isNaN(e)&&this._schedule&&this._schedule.updateContentDuration(e),this._schedule&&this._schedule.getNextIndex()>0)return this._schedule.setAds(t);this._schedule=new Schedule(t,{preload_advance:this.opts.preload_advance,content_duration:e?0:e})}toJSON(){return this._schedule?this._schedule.toJSON():[]}trigger(t,e={}){var s;if(!this.adapter.getVideoTag())return;if(!this._state)return;if(t===k&&this._state.hasAny(ue.BREAK_ACTIVE)&&!this.adapter.isAdPod()&&!e.force)return xe("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if(null===(i=e)||"object"!=typeof i||le(i)!==de)return this.dispatch(t,e);var i;const r=Object.assign({},this.adapter.getOpts()||{},(null===(s=this._schedule)||void 0===s?void 0:s.getCurrentAd())||{},{ad_type:this.ad_type},e);return this.dispatch(t,r)}dispatch(t,e){const s=this.adapter.getVideoTag();if(s){xe(":dispatch",t,e),this.adapter.isAdPod()&&"object"==typeof e&&"time"in e&&"preroll"!==e.ad_type&&(e.time=this.adapter.getAdBreakTime());try{const i={event:"ads/"+t,detail:{outstream:e.outstream,ad_type:e.ad_type,ad_break_time:e.time,ad_remaining_seconds:e.remaining,ad_muted:e.muted,ad_duration_seconds:e.duration,ad_error_reason:e.reason,ad_vast_error:e.vast_error,ad_vast_error_type:e.vast_error_type,ad_request_load_type:e.request_load_time}};s.dispatchEvent(new CustomEvent("health:record",{detail:i}))}catch(t){xe(":error",t)}ct(s,t,e),this.emit(t,e)}}get ad_type(){if(!this.videoTag)return;if(!this.adapter.isAdPod())return this._schedule&&this._schedule.getCurrentType();const t=this.adapter.getAdBreakTime();return-1===t?"postroll":this.videoTag.hasState(nt)||t<1?"preroll":"midroll"}shouldRestartContent(){if(this.getIsContentProcessingNewSrc())return!1;if(this.adapter.isAdPod())return!0;const t=this.getLastAd();return!t||!t.outstream&&!1!==t.restart}async finished(t){if(this._schedule&&(xe("Ads.finished"),!(this.adapter.isCustomPlaybackEnabled()&&this._state.hasAny(ue.PLAYING)&&this.adapter.isLinearAd()))){xe("Ads.finished: trying to play postroll");try{if(!this._schedule.getPostroll())return xe("Ads.finished: no postroll found"),await this.adapter.contentComplete();this._state.hasAny(ue.AD_AVAILABLE)||await this.fetchNextAd(-1),await this.playAd(),this.adapter.contentComplete()}catch(t){xe("Ads.finished: postroll failed:",t)}finally{this.trigger(D),this.checkIfBreakComplete(),"function"==typeof t&&t()}}}hasPreroll(){return this._schedule&&Schedule.hasPreroll(this._schedule.getAds())}shallPlayAd(t){var e;return(!this.adapter||!this.adapter.isAdPod())&&(!(!this._state||this._state.hasAny(ue.FATAL_ERROR))&&!!(null===(e=this._schedule)||void 0===e?void 0:e.shallPlayAd(t)))}setLastAd(t){return this._lastAd=t,this}setIsContentProcessingNewSrc(t){this.content_processing_src=t}getLastAd(){return this._lastAd}getIsContentProcessingNewSrc(){return this.content_processing_src}mergeMacros(t={}){return this._macros=this._macros.fork(Object.assign({},t)),this}get paused(){return this.adapter&&this.adapter.isPaused()}pause(){this.adapter&&this.adapter.pause()}resume(){this.adapter&&this.adapter.resume()}resize(t){this.adapter&&this.adapter.onResize(t)}async requestAd(t,e=0,s=this.opts.timeout){if(!this._state)return;xe("Ads.requestAd(ad: %o)",{ad:t,timeout:s,idx:e});const i=await oe(t);if(void 0===i[e])return setTimeout(()=>this.trigger(_),0),Promise.reject(new Error("Ad failed, no fallbacks left"));if(!i[e])return await this.requestAd(i,e+1,s);this.trigger(y,t);const r=this._macros.compile(i[e],re(this.opts,this.adapter.getDimensions()));try{return void await this.adapter.initAd(r,s)}catch(t){return xe(`Ads.requestAd(:fallback, idx: ${e}, length: ${i.length}, adTag: ${i[e]})\nError `,{adTag:i,err:t}),this.requestAd(i,e+1,s)}}resetSchedule(t){this._schedule&&this._schedule.reset(t)}get adPlaying(){return this._state&&this._state.hasAny(ue.PLAYING)}get adBreak(){return this._state&&this._state.hasAny(ue.BREAK_ACTIVE)}get adRequesting(){return this._state.hasAny(ue.FETCHING_AD)}get adLinear(){return this.adBreak&&this.adapter.isLinearAd()}}var Be=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),je=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function qe(t){return Object.assign({muted:!1,timeout:250,inline:!1},t)}function He(t,e){var s=t.muted,i=t.timeout,r=t.inline,a=e(),n=a.element,o=a.source,d=void 0,l=void 0,c=void 0;return n.muted=s,!0===s&&n.setAttribute("muted","muted"),!0===r&&n.setAttribute("playsinline","playsinline"),n.src=o,new Promise(function(t){d=n.play(),l=setTimeout(function(){c(!1,new Error("Timeout "+i+" ms has been reached"))},i),c=function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.remove(),n.srcObject=null,clearTimeout(l),t({result:e,error:s})},void 0!==d?d.then(function(){return c(!0)}).catch(function(t){return c(!1,t)}):c(!0)})}var Ve={audio:function(t){return He(t=qe(t),function(){return{element:document.createElement("audio"),source:URL.createObjectURL(Be)}})},video:function(t){return He(t=qe(t),function(){return{element:document.createElement("video"),source:URL.createObjectURL(je)}})}};let ze;async function Ge(t=!0){return ze||(ze=await Ve.video({timeout:500,muted:t}),ze)}var We=Object.freeze({__proto__:null,STICKY_CONTROLS:1,NO_FULLSCREEN:2,NO_AD_INDICATOR:4,AD_ATTRIBUTION:8,AD_CHOICES:16,REMAINING_TIME:32,VOLUME_BAR:64});const Qe=["progress","duration","remaining"];class AdUI extends HTMLElement{static get observedAttributes(){return Qe}constructor(t){super(),this.player=t,this.className="fp-ad-ui",this.append(...t.createComponents(Et,St)),t.on(Q,t=>{let{ui_flags:e}=t.detail;if(e=e||0,(8&e)>0){const t=document.createElement("div");t.classList.add("ad-attribution"),t.textContent=this.player.i18n("ads.advertisement","Advertisement"),this.append(t)}})}}const $e=yt("fpads:native:outstream"),Ke={OUTSTREAM:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"};var Ye,Ze;!function(t){t.OUTSTREAM_VISIBLE="ads-outstream-visible",t.OUTSTREAM_VIEWPORT_UPDATE="ads-outstream-viewport-update",t.OUTSTREAM_TEARDOWN="ads-outstream-teardown",t.OUTSTREAM_ENDSCREEN_READY="ads-outstream-endscreen-ready"}(Ye||(Ye={})),function(t){t[t.None=0]="None",t[t.Booting=1]="Booting",t[t.Ready=2]="Ready",t[t.Disposed=3]="Disposed"}(Ze||(Ze={}));class Outstream{constructor({ads:t,root:e,content:s,ima:i}){this.state=Ze.None,$e("creating Outstream instance"),this.content=s,this.ads=t,this.root=e,this.ima=i,this.aspectRatio=s.videoHeight/s.videoWidth,this.dimensions=function(t){if(t.clientWidth>0||t.clientHeight)return h(t);const e={height:t.style.height};p(t,"opacity",0),p(t,"display","absolute"),p(t,"display","inline-block"),p(t,"height","auto");const s=h(t);return p(t,"height",e.height),p(t,"opacity",1),s}(this.root),this.adUi=new AdUI(s),this.initialVolumeState={},e.classList.add(Ke.OUTSTREAM),e.append(this.adUi),this.hide(),this.ads.on(b,t=>{var e;if(this.state==Ze.Disposed)return;const s=!!(null===(e=t.detail)||void 0===e?void 0:e.linear);this.ads.resize(Object.assign(Object.assign({},this.dimensions),{linear:s}))}),s.on(Y,t=>{if(this.state==Ze.Disposed)return;const e=t.detail;e&&(this.dimensions={width:e.contentRect.width,height:e.contentRect.height},this.ads.resize(this.dimensions))});let r=1,a=!0;s.on("intersectionchange",t=>{if(this.state==Ze.Disposed)return;const e=t.detail;if(e)switch(this.state){case Ze.Booting:return $e(":boot skipping intersectionchange");case Ze.None:return this.state=Ze.Booting,this.begin_life_cycle();case Ze.Ready:if(r=e.ratio,e.ratio>=.5&&this.ads.adPlaying)return;e.ratio>=.5&&a&&this.ads.resume(),e.ratio<.5&&this.ads.pause()}}),this.content.on(S,()=>a=r<.5),this.setup(),setTimeout(()=>(this.state=Ze.Booting,this.begin_life_cycle()),0)}hide(){return this}restore_aspect_ratio(){return $e(`Outstream.restore_aspect_ratio(${this.aspectRatio})`),this.content.setOpts({ratio:this.aspectRatio}),this}show(){this.root.classList.remove(Outstream.CLASS.HIDDEN),this.root.classList.add(Outstream.CLASS.SHOWING),this.content.setState("ad-linear",!0)}async begin_life_cycle(){var t;this.state=Ze.Ready;const{error:e,result:s}=await Ge(!1),{result:i}=await Ge(!0);this.content.emit(Q,{ui_flags:null===(t=this.content.opts.ads)||void 0===t?void 0:t.ui}),this.attach_ad_listeners(),this.initialVolumeState={can_autoplay:!(!s&&!i),muted:!s},$e(`Outstream.show() :autoplay >> sound=${s}`),e&&this.content&&!s&&(this.content.muted=!0,this.content.volume=0),await this.ads.setVideoTag(this.content),await Dt({ads:this.ads,content:this.content,adContainer:this.adUi,ima:this.ima,state:{listening:!1},config:this.content.opts}),xt({content:this.content,ads:this.ads}),this.state=Ze.Ready}attach_ad_listeners(){this.ads.once(b,()=>{this.show(),this.ads.adPlaying&&this.ads.pause()});const t=()=>{Pt.forEach(e=>this.ads.removeListener(e,t));const e=new CustomEvent(Ye.OUTSTREAM_TEARDOWN);$e("Outstream(:teardown)",e),this.content.dispatchEvent(e)};Pt.forEach(e=>this.ads.once(e,t)),this.content.once(Ye.OUTSTREAM_TEARDOWN,t=>{setTimeout(()=>{if(t.defaultPrevented)return this.handle_endscreen();this.dispose()},0)})}handle_endscreen(){this.reset_ui(),this.ads.reset(),Nt({config:this.content.opts,ui:this.adUi,ads:this.ads,adContainer:this.adUi,ima:this.ima,content:this.content,root:this.content.root,state:{started:!0,listening:!1},initial:{muted:!0,volume:1}})}empty_src(){this.content.setSrc({type:"video/mp4",src:URL.createObjectURL(Lt)})}setup(){this.root.classList.add(Outstream.CLASS.OUTSTREAM),this.root.classList.add(Outstream.CLASS.HIDDEN),this.content.setState("ad-linear",!1),this.empty_src()}reset_ui(){const t=this.root;t.classList.remove(Outstream.CLASS.SHOWING),t.classList.remove(Outstream.CLASS.OUTSTREAM)}dispose(){if(this.state==Ze.Disposed)return;const t=this.root,e=this.content;this.reset_ui(),t.classList.add(Outstream.CLASS.OUTSTREAM),t.classList.add(Outstream.CLASS.DONE);const s=this;s.video=s.container=s.ads=0,this.state=Ze.Disposed,e.destroy(),t.innerHTML=""}}function Je(t){return t&&"number"==typeof t.time}function Xe(t){return t&&"number"==typeof t.percentage&&"number"!=typeof t.time}Outstream.CLASS=Ke;const ts=yt("ads/ima/sdk");var es,ss;async function is(t,e){var s;const i=null===(s=null===window||void 0===window?void 0:window.google)||void 0===s?void 0:s.ima;if(e?null==i?void 0:i.dai:i)return void ts(":noop");const r=e?"https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js":t._storage.getItem("ima/debug")?"https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"https://imasdk.googleapis.com/js/sdkloader/ima3.js";try{return await async function(t){return new Promise((e,s)=>{let i=document.querySelector(`script[src='${t}']`);if(i)return rs(i,e,s);i=document.createElement("script"),i.setAttribute("state",es.LOADING),rs(i,e,s),i.src=t,document.head.appendChild(i)})}(r),void ts(":loaded")}catch(t){ts(`:error ${t.message}`,t)}}function rs(t,e,s){const i=t.getAttribute("state");if(i&&[es.ERROR,es.LOADED].includes(i))return e(void 0);t.addEventListener("load",()=>{t.setAttribute("state",es.LOADED),e(void 0)},{once:!0}),["error","abort"].forEach(e=>{t.addEventListener(e,()=>{t.setAttribute("state",es.ERROR),s("script failed to load")},{once:!0})})}!function(t){t.LOADING="loading",t.LOADED="loaded",t.ERROR="error"}(es||(es={})),function(t){t.LOADING="loading",t.LOADED="loaded",t.ERROR="error"}(ss||(ss={}));const as=yt("ads/ima/sdk"),ns="https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js",os=ns;async function ds(t){var e;const s=t._storage.getItem("prebid/debug")?ns:os;if(null===(e=null===window||void 0===window?void 0:window.pbjs)||void 0===e?void 0:e.version)as(":noop");else if(!document.querySelector(`script[src='${s}']`))try{return await async function(t){return new Promise((e,s)=>{let i=document.querySelector(`script[src='${t}']`);i||(i=document.createElement("script")),i.setAttribute("state",ss.LOADING);const r=i.getAttribute("state");if(r&&[ss.ERROR,ss.LOADED].includes(r))return e(void 0);i.addEventListener("load",()=>{i.setAttribute("state",ss.LOADED),e(void 0)},{once:!0}),["error","abort"].forEach(t=>{i.addEventListener(t,()=>{i.setAttribute("state",ss.ERROR),s("script failed to load")},{once:!0})}),i.src=t,document.head.appendChild(i)})}(s),void as(":loaded")}catch(t){console.warn(`:error / failed to load prebid.js / ${t.message}`,t)}}const ls=window.pbjs=window.pbjs||{};ls.que=ls.que||[];class PrebidAdController{constructor(t,e){this.player=t,this.config=e,this.player=t,this.bestOffer="",ls.que.push(()=>{var s,i;const r=this.createAdUnit();ls.addAdUnits(r);const a=(null===(i=null===(s=e.ads)||void 0===s?void 0:s.prebid)||void 0===i?void 0:i.pbjs)||{};ls.setConfig(Object.assign({enableSendAllBids:!0},a)),t.emit($,{pbjs:ls}),ls.requestBids({bidsBackHandler:t=>{var s,i,a,n,o;const d=null===(s=t[this.prebidCode()])||void 0===s?void 0:s.bids;if(!d)return;if(0==d.length)return;const l=d[0];if(l&&l.vastUrl)return this.bestOffer=l.vastUrl;const c=ls.adServers.dfp.buildVideoUrl({adUnit:r,params:{iu:null===(a=null===(i=e.ads)||void 0===i?void 0:i.prebid)||void 0===a?void 0:a.iu,cust_params:null===(o=null===(n=e.ads)||void 0===n?void 0:n.prebid)||void 0===o?void 0:o.custom_params,output:"vast"}});this.bestOffer=c}})})}prebidCode(){var t,e;return(null===(e=null===(t=this.config.ads)||void 0===t?void 0:t.prebid)||void 0===e?void 0:e.code)||this.player.root.id}videoInfo(){var t,e;return(null===(e=null===(t=this.config.ads)||void 0===t?void 0:t.prebid)||void 0===e?void 0:e.video)||{context:"instream",playerSize:[[this.player.videoWidth||640,this.player.videoHeight||480]]}}createAdUnit(){var t,e;return{code:this.prebidCode(),mediaTypes:{video:this.videoInfo()},bids:null===(e=null===(t=this.config.ads)||void 0===t?void 0:t.prebid)||void 0===e?void 0:e.bidders}}vastGenerator(){return async()=>this.bestOffer}}function cs(t,e){var s,i;const r=null===(s=e.ads)||void 0===s?void 0:s.prebid;if(!r)return;if((null===(i=t.prebidController)||void 0===i?void 0:i.config)===e)return;!function(t,{feature_name:e,behavior:s,sample_rate:i}){e&&(i||(i=_t),t.emit("flowplayer:feature",{feature_name:e,behavior:s,sample_rate:i}))}(t,{feature_name:"prebid",behavior:"used"}),t.prebidController||(t.prebidController=new PrebidAdController(t,e),ds(t));const a=t.prebidController;if(a){const e=r.breaks.map(t=>({adTag:a.vastGenerator(),time:t}));t.setOpts({ima:{ads:e}})}}const us=yt("ads/index");async function hs(t,e,s){var i;let r;if(s.on("config",()=>{var e,i,a;void 0===r&&t.autoplay&&(Gt(a=t.ima)&&(null==a?void 0:a.ads.find(t=>!t.time||"percentage"in t&&0===t.percentage)))&&!s.currentSrc&&(i=t.autoplay,r=!0===i?ut.ON:!1===i?ut.OFF:i,t.autoplay=0),(null===(e=t.ads)||void 0===e?void 0:e.prebid)&&cs(s,t),Gt(t.ima)&&zt(s)&&Object.assign(t,{hls:{native:!0}}),s.ads&&d()}),s.once("loadstart",()=>{setTimeout(async()=>{if(void 0!==r&&(await is(s),!("google"in window))){if(t.autoplay=r,s.setState(dt,!0),!s.hasState(lt))return s.once(st,()=>s.togglePlay(!0));s.togglePlay(!0)}},0)}),await is(s),!("google"in window))return console.warn("google.ima unavailable");let a=!1;const n=s.ads=new AdsController,o=n.analytics;function d(){if(!Gt(t.ima))return;const i=t.ima,d=t.duration||s.duration;if(i.ads=function(t,e){return Array.isArray(t)?t.filter(t=>Je(t)||Xe(t)).reduce((t,s)=>{if(Je(s))return t.push(s),t;if(s.lazy)return t.push(s),t;if(Xe(s)){const i=Object.assign({},s),r=s.percentage?s.percentage*e:0;return isNaN(r)||(i.time=r<0||r===e?-1:r),t.push(i),t}return t},[]):(console.warn("AdSchedule was not an Array"),[])}(i.ads,d),n.setSchedule(i.ads,d),t.metadata&&Analytics.mergeMetadata(o,t.metadata),t.metadata&&n.mergeMacros(t.metadata),t.metadata&&i.parameters&&(i.parameters=Object.assign(Object.assign({},i.parameters),t.metadata)),Analytics.mergeMetadata(o,{muted:t.muted||!1,autoplay:t.autoplay||!1}),!a){if(a=!0,t.lang&&!i.Locale&&(i.Locale=t.lang),Schedule.isOutstream(i.ads))return us("is outstream, returning"),new Outstream({root:e,content:s,ads:n,ima:i});kt({config:Object.assign(Object.assign({},t),{autoplay:r}),root:e,content:s,ads:n,ima:i})}}n.resize(h(e)),n.on(D,()=>{n.adapter.isCustomPlaybackEnabled()&&n.once(k,()=>{s.src=s.original_src,s.once("canplay",()=>{s.togglePlay(!1)}),s.webkitExitFullscreen()})}),s.on("reap",function(){n&&n.destroy()}),(null===(i=t.ads)||void 0===i?void 0:i.prebid)&&cs(s,t),d()}class AdControls extends HTMLElement{constructor(t){super(),this.player=t,this.classList.add("fp-ad-controls"),this.append(this.adRemainingTime(),At(this.player,Tt),this.playbackButtons(),this.volumeBtn(),At(this.player,"flowplayer-volume-bar"),...this.fullscreenIcons(),this.adChoices()),t.on(Q,this.applyStyleFlags.bind(this))}fullscreenIcons(){return this.player.createComponents("flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon").map(t=>(t.onclick=()=>this.player.toggleFullScreen(),t))}volumeBtn(){const t=At(this.player,"flowplayer-volume-icon");return t.onclick=()=>this.player.emit(z),t}playbackButtons(){const t=document.createElement("div");t.classList.add("ad-playback-controls");const e=At(this.player,"flowplayer-small-play-icon"),s=At(this.player,"flowplayer-small-pause-icon");return e.addEventListener("click",()=>{this.player.emit(V),setTimeout(function(){s.focus&&s.focus()},100)}),s.addEventListener("click",()=>{this.player.emit(H),setTimeout(function(){e.focus&&e.focus()},100)}),t.append(e,s),t}adChoices(){const t=document.createElement("div");return t.classList.add("fp-ad-choices"),t.textContent=this.player.i18n("ads.adchoices","AdChoices"),t.addEventListener("click",t=>{t.preventDefault(),this.player.togglePlay(!1),window.open("https://adssettings.google.com","_blank")}),t}adRemainingTime(){const t=document.createElement("div");return t.classList.add("fp-ad-remaining","fp-color-text"),this.prepend(t),this.player.on(L,e=>{const s=e.detail.remaining;t.textContent=function(t){if(isNaN(t)||t>=Number.MAX_SAFE_INTEGER)return"";const e=t<0?"-":"";t=Math.round(Math.abs(t));const s=Math.floor(t/3600);let i=Math.floor(t/60);return t-=60*i,s>=1?(i-=60*s,e+s+":"+ht(i)+":"+ht(t)):e+ht(i)+":"+ht(t)}(parseFloat(s+""))}),t}applyStyleFlags(t){var e;const s=null!==(e=t.detail.ui_flags)&&void 0!==e?e:0;this.classList.toggle("is-ad-controls-sticky",(1&s)>0),this.classList.toggle("no-indicator",(4&s)>0),this.classList.toggle("is-ad-choices",(16&s)>0),this.classList.toggle("no-volume-bar",!(64&s)),this.classList.toggle("is-ad-remaining",(32&s)>0),this.classList.toggle("no-fullscreen",(2&s)>0)}}class AdCountdown extends HTMLElement{static get observedAttributes(){return["remaining"]}constructor(t){super(),this.player=t,this.className="fp-ad-countdown",t.on(L,t=>{const{duration:e,remaining:s}=t.detail;this.setAttribute("duration",e+""),this.setAttribute("remaining",s+"")}),t.on(w,t=>{t.detail.linear&&(this.style.setProperty("--ad-percent-previous","0"),this.style.setProperty("--ad-percent-complete","0"))}),this.addEventListener("animationend",()=>{const t=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",t)})}attributeChangedCallback(t,e,s){if("remaining"===t)return this.onRemaining(s)}onRemaining(t){const e=parseFloat(this.getAttribute("duration")||"0");t||(t=e+"");const s=parseFloat(t),i=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",i),this.classList.remove("go");const r=((e-s)/e*100).toFixed(3);requestAnimationFrame(()=>{this.style.setProperty("--ad-percent-complete",r),this.classList.add("go")})}}class AdIndicator extends HTMLElement{static get observedAttributes(){return["position","totals"]}constructor(t){super(),this.player=t,this.render(),t.on(w,t=>{const{position:e,totals:s}=t.detail.ad;this.setAttribute("position",e+""),this.setAttribute("totals",s+"")})}attributeChangedCallback(t,e){switch(t){case"position":case"totals":return this.updateText()}}updateText(){if(!this.element)return;const t=parseFloat(this.getAttribute("position")||"0"),e=parseFloat(this.getAttribute("totals")||"0");this.element.textContent=`${this.player.i18n("ads.indicator","ADS")} ${t} / ${e}`}render(){this.element=document.createElement("div"),this.element.classList.add("ad-indicator","fp-color-text"),this.element.textContent=this.player.i18n("ads.indicator","ADS"),this.append(this.element)}}var ps,gs=Object.freeze({__proto__:null,SINGlE_INLINE_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_SKIPPABLE_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirectlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_ERROR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_BROKEN:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&nofb=1&correlator=",SINGLE_VPAID_20_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinearvpaid2js&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_VPAID_20_NON_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dnonlinearvpaid2js&ciu_szs=728x90%2C300x250&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_NON_LINEAR_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/nonlinear_ad_samples&sz=480x70&cust_params=sample_ct%3Dnonlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_SESSION_AD_RULE_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sar%3Da0f2&ciu_szs=300x250&ad_rule=1&gdfp_req=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonly&ciu_szs=300x250%2C728x90&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonly&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator="});const{samsung_tv:ms}=u(),_s=(ps=class Ads{constructor(t){this.umd=t,bt(t,wt,AdUI),bt(t,Et,AdControls),bt(t,St,AdCountdown),bt(t,Tt,AdIndicator)}init(t,e,s){if(c.from_token(t.token||"").is_granted(c.permissions.ADS)&&!ms)return hs(t,e,s)}},ps.pluginName="ads",ps.events=K,ps.ui=We,ps.tags=gs,ps);return function(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;if(null===document.currentScript)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const s=t.flowplayer;return"function"==typeof s?(s(e),e):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(e)||s.extensions.push(e),e)}(window,_s)});
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.analytics=t())}(this,function(){"use strict";const e=(...e)=>e.reduce((e,t)=>Object.assign(Object.assign({},e),t),{}),t=(e,t)=>{const r=e.lastIndexOf(t);return~r&&e.splice(r,1),e};class RequestQueue{static of(){return new RequestQueue}static is_empty(e){return 0==e.pending.length}static is_high_water(e){return e.open.length==RequestQueue.MAX_OPEN_REQUESTS}static maybe_spawn_req(e){if(RequestQueue.is_empty(e))return e;if(RequestQueue.is_high_water(e))return e;try{const t=RequestQueue.lpop(e);t&&RequestQueue.request(e,t)}catch(e){}}static increment_failures(e){return e.stats.failures++,e.stats.failures>RequestQueue.MAX_FAILURE_COUNT&&(e.stats.ttl=Date.now()+RequestQueue.REQUEST_TTL_MS),e}static handle_error(e,t){RequestQueue.rm(e,t),RequestQueue.increment_failures(e)}static request(e,[t,r,n]){if(Date.now()<e.stats.ttl)return;const i=new XMLHttpRequest;e.open.push(i),i.timeout=RequestQueue.REQUEST_TIMEOUT_MS,i.ontimeout=function(){RequestQueue.handle_error(e,i)},i.onerror=function(t){RequestQueue.handle_error(e,i)},i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&RequestQueue.rm(e,i),Math.floor(i.status/100)},i.onload=function(){RequestQueue.rm(e,i),e.stats.failures&&e.stats.failures--},i.open(r,t),i.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{i.send(JSON.stringify(n))}catch(e){}}static rpush(e,...t){return t.forEach(t=>{e.pending.length>=RequestQueue.MAX_PENDING||(e.pending.push(t),RequestQueue.maybe_spawn_req(e))}),e}static lpop(e){return e.pending.shift()}static rm(e,r){return t(e.open,r),e}constructor(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}}RequestQueue.MAX_OPEN_REQUESTS=3,RequestQueue.MAX_PENDING=5,RequestQueue.REQUEST_TIMEOUT_MS=4e3,RequestQueue.REQUEST_TTL_MS=5e3,RequestQueue.MAX_FAILURE_COUNT=3;var r=RequestQueue.of();const n=/:([a-zA-Z_]+)/g;class Log{static prepare(e,t){const r=document.createEvent("Event");return r.initEvent(e,!1,!0),r.ns=e,r.data=t,r}static of(e){return new Log(e)}constructor(e){this.emitter=e}info(e){this.emitter.dispatchEvent(Log.prepare(Log.NAMESPACE.INFO,e))}error(e){this.emitter.dispatchEvent(Log.prepare(Log.NAMESPACE.ERROR,e))}warn(e){this.emitter.dispatchEvent(Log.prepare(Log.NAMESPACE.WARN,e))}}var i;Log.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},function(e){e.POST="POST",e.PUT="PUT",e.GET="GET"}(i||(i={}));class Tracker{static of(e,t){return new Tracker(e,t)}static ensure_required_keys(e,t){return e.required_keys.filter(e=>!(e in t))}static pluck_valid_keys(t,r){return((t,...r)=>Object.keys(t).filter(e=>~r.indexOf(e)).reduce((r,n)=>e(r,{[n]:t[n]}),{}))(r,...t.valid_keys)}static merge_metadata(t,r={}){return t.metadata=Tracker.pluck_valid_keys(t,e(t.metadata,r)),t}static assert_emitter_api(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")}static create_listener(e,t,r){var n;e.listeners.push([t,r]),null===(n=e.emitter)||void 0===n||n.addEventListener(t,r)}constructor(t,i={}){const o=this;if(this.emitter=t,this.url=i.url,this.log=Log.of(this.emitter),this.verb=i.verb,this.metadata=e({},i.metadata||{}),this.rq=i.rq||r,this.events=i.events||[],this.required_keys=i.required_keys||[],this.optional_keys=i.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),Tracker.assert_emitter_api(this.emitter),void 0===Tracker.verb[this.verb])throw new Error(`invalid HTTP verb[${this.verb}] passed`);if("string"!=typeof this.url)throw new Error(`invalid API url[${this.url}] passed`);Tracker.TRACKERS.push(this),o.events.forEach(t=>{Tracker.create_listener(this,t,(r={})=>{var i;if(null===(i=this.emitter)||void 0===i?void 0:i.hasState("consent-no-tracking"))return;const a=e(o.metadata,{event_type:t},r.data||r),s=function(e,t){return e.replace(n,e=>{const r=e.slice(1,e.length);return r in t?t[r].toString():e})}(o.url,a),u=Tracker.pluck_valid_keys(o,a),d=Tracker.ensure_required_keys(o,u);if(d.length)return o.log.error(`Tracker.validate_metadata() failed for\n Event[${t}]\n missing keys: ${d}\n payload:\n ${JSON.stringify(u,null,2)}`);this.rq&&RequestQueue.rpush(this.rq,[s,this.verb,u])})})}destroy(){this.listeners.forEach(([e,t])=>{var r;return null===(r=this.emitter)||void 0===r?void 0:r.removeEventListener(e,t)}),delete this.rq,delete this.emitter,t(Tracker.TRACKERS,this)}put(e={}){return Tracker.merge_metadata(this,e),this}}var o;Tracker.TRACKERS=[],Tracker.QUEUE=r,Tracker.verb=i,function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(o||(o={}));const a=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function s(e,t){return!!~a.indexOf(e)||e.indexOf(t)===e.length-t.length}s.check_whitelist=function(e){return!!~a.indexOf(e)};function u(e){this.message=e}u.prototype=new Error,u.prototype.name="InvalidCharacterError";var d="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new u("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,o=0,a="";n=t.charAt(o++);~n&&(r=i%4?64*r+n:n,i++%4)?a+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};var c=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(d(e).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return d(t)}};function l(e){this.message=e}l.prototype=new Error,l.prototype.name="InvalidTokenError";var f=function(e,t){if("string"!=typeof e)throw new l("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(c(e.split(".")[r]))}catch(e){throw new l("Invalid token specified: "+e.message)}};f.InvalidTokenError=l;const p="production";function _(e,t){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let n={c:"{}",exp:0};t=t||{};try{n=f(e),r.valid_jwt=!0}catch(e){}return r.raw=e,r.data=JSON.parse(n.c),r.exp=n.exp,t.require_valid_token&&_.validate(r),r}function h(e){return{grant:e,is_granted:t=>(e&t)===t}}function m(e,t,r){const n=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;n.length;){if(null==e)return r;const t=n.shift();if("string"!=typeof t)return r;e=e[t]}return null==e?r:e}_.validate=function(e){if("string"==typeof e&&(e=_(e)),!e||!e.raw){if(s.check_whitelist(window.location.hostname)||"dev"===p.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,r=s.bind(null,t);if("dev"!==p.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==p.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},_.id=function(e){if(e)return"string"==typeof e&&(e=_(e)),e.data.id},h.of=h,h.from_token=function(e){const t=_(e,{require_valid_token:!0});return h.of(t.data.acl)},h.permissions=o;var v="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var y="ping",k="display",g="view";const w=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],E=["created","position"],T=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];const R=100,q=1e3;function A(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/R;return{segment_duration:t,breakpoints:Array(...Array(R)).map(function(e,r){return Math.floor(r*t*q)/q})}}(e.duration))}function S(e,t,r){if(!t.segment_duration&&!A(e,t))return;const n=function(e,t,r){const n=t.last_idx,i=r?99:O(e,t);return t.last_idx=i,i<=n?[]:t.breakpoints.slice(n,99==i?100:i).map(function(e){return t.breakpoints.indexOf(e)})}(e,t,r);0!=n.length&&e.emit(y,{position:n})}function O(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}function b(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}var N;const Q="vod",x="live",L=[k,y,g];function I(e,t,r){switch(null==t?void 0:t.kind){case"live":return function(e,t){const r=Date.now();r-t.last_tracked_ts<6e4||(t.last_tracked_ts=r,++t.ticks,e.emit(y,{position:60*t.ticks}))}(e,t);case"vod":return S(e,t,"boolean"==typeof r&&r)}}function M(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}const P=((N=class Analytics{init(e,t,r){if(!h.from_token(e.token||"").is_granted(h.permissions.ANALYTICS))return;if(r.analytics)return;const n=r.analytics={ticker:void 0,last_media_id:"",ended:!1,played:!1},i={locked:void 0,ttl:6e3,task:()=>{I(r,n.ticker)}};const o={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:e.player_id,customer_user_id:e.customer_user_id,player_version:"3.34.3"},a=Tracker.of(r,{verb:Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:L,required_keys:w,optional_keys:T.concat(E).slice(0),metadata:o});r.on("reap",function(){a&&a.destroy()}),r.on("config",function(t){if(!a)return;const i=m(t,"data.metadata",{});if(!i.media_id&&i.stream_target_id&&(i.media_id=i.stream_target_id),!i.media_id)return n.last_media_id="";if(n.last_media_id===i.media_id)return;n.played=!1,n.last_media_id=i.media_id;const o=m(e,"analytics",{});a.put(i),a.put(o);const s=m(e,"metadata.live_start_time",e.live)?x:Q;a.put({video_type:s,source:e.source||b()||""}),n.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},n.ended=!1,r.emit(k)});let s=0;r.on("playing",function(){if(!a)return;if(s||n.played||!n.last_media_id)return;a.put({muted:r.muted});const e=M(r);if(e)return s=Promise.resolve(e).then(function(){n.played=!0,r.emit(g),s=0}).catch(function(){s=0});n.played=!0,r.emit(g)}),r.on("timeupdate",function(){var t;a&&(s||M(r)||n.ended||!n.last_media_id||(!e.live&&r.currentTime+.25>=r.duration&&I(r,n.ticker,!0),(t=i).locked||(t.locked=setTimeout(function(){return t.task(),function(e){return e.locked=void 0,e}(t)},t.ttl))))}),r.on("seeked",function(){a&&n.last_media_id&&n.ticker&&"vod"==n.ticker.kind&&function(e,t){A(e,t),t.last_idx=O(e,t)}(r,n.ticker)}),r.on("ended",function(){a&&n.last_media_id&&function(e,t){t.ended||(t.ended=!0,I(e,t.ticker))}(r,n)})}}).pluginName="analytics",N),C=function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const r=e.flowplayer;return"function"==typeof r?(r(t),t):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(t)||r.extensions.push(t),t)}("undefined"!=typeof window?window:void 0!==v?v:{},P);return C});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.analytics=t())}(this,function(){"use strict";const e=(...e)=>e.reduce((e,t)=>Object.assign(Object.assign({},e),t),{}),t=(e,t)=>{const r=e.lastIndexOf(t);return~r&&e.splice(r,1),e};class RequestQueue{static of(){return new RequestQueue}static is_empty(e){return 0==e.pending.length}static is_high_water(e){return e.open.length==RequestQueue.MAX_OPEN_REQUESTS}static maybe_spawn_req(e){if(RequestQueue.is_empty(e))return e;if(RequestQueue.is_high_water(e))return e;try{const t=RequestQueue.lpop(e);t&&RequestQueue.request(e,t)}catch(e){}}static increment_failures(e){return e.stats.failures++,e.stats.failures>RequestQueue.MAX_FAILURE_COUNT&&(e.stats.ttl=Date.now()+RequestQueue.REQUEST_TTL_MS),e}static handle_error(e,t){RequestQueue.rm(e,t),RequestQueue.increment_failures(e)}static request(e,[t,r,n]){if(Date.now()<e.stats.ttl)return;const i=new XMLHttpRequest;e.open.push(i),i.timeout=RequestQueue.REQUEST_TIMEOUT_MS,i.ontimeout=function(){RequestQueue.handle_error(e,i)},i.onerror=function(t){RequestQueue.handle_error(e,i)},i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&RequestQueue.rm(e,i),Math.floor(i.status/100)},i.onload=function(){RequestQueue.rm(e,i),e.stats.failures&&e.stats.failures--},i.open(r,t),i.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{i.send(JSON.stringify(n))}catch(e){}}static rpush(e,...t){return t.forEach(t=>{e.pending.length>=RequestQueue.MAX_PENDING||(e.pending.push(t),RequestQueue.maybe_spawn_req(e))}),e}static lpop(e){return e.pending.shift()}static rm(e,r){return t(e.open,r),e}constructor(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}}RequestQueue.MAX_OPEN_REQUESTS=3,RequestQueue.MAX_PENDING=5,RequestQueue.REQUEST_TIMEOUT_MS=4e3,RequestQueue.REQUEST_TTL_MS=5e3,RequestQueue.MAX_FAILURE_COUNT=3;var r=RequestQueue.of();const n=/:([a-zA-Z_]+)/g;class Log{static prepare(e,t){const r=document.createEvent("Event");return r.initEvent(e,!1,!0),r.ns=e,r.data=t,r}static of(e){return new Log(e)}constructor(e){this.emitter=e}info(e){this.emitter.dispatchEvent(Log.prepare(Log.NAMESPACE.INFO,e))}error(e){this.emitter.dispatchEvent(Log.prepare(Log.NAMESPACE.ERROR,e))}warn(e){this.emitter.dispatchEvent(Log.prepare(Log.NAMESPACE.WARN,e))}}var i;Log.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},function(e){e.POST="POST",e.PUT="PUT",e.GET="GET"}(i||(i={}));class Tracker{static of(e,t){return new Tracker(e,t)}static ensure_required_keys(e,t){return e.required_keys.filter(e=>!(e in t))}static pluck_valid_keys(t,r){return((t,...r)=>Object.keys(t).filter(e=>~r.indexOf(e)).reduce((r,n)=>e(r,{[n]:t[n]}),{}))(r,...t.valid_keys)}static merge_metadata(t,r={}){return t.metadata=Tracker.pluck_valid_keys(t,e(t.metadata,r)),t}static assert_emitter_api(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")}static create_listener(e,t,r){var n;e.listeners.push([t,r]),null===(n=e.emitter)||void 0===n||n.addEventListener(t,r)}constructor(t,i={}){const o=this;if(this.emitter=t,this.url=i.url,this.log=Log.of(this.emitter),this.verb=i.verb,this.metadata=e({},i.metadata||{}),this.rq=i.rq||r,this.events=i.events||[],this.required_keys=i.required_keys||[],this.optional_keys=i.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),Tracker.assert_emitter_api(this.emitter),void 0===Tracker.verb[this.verb])throw new Error(`invalid HTTP verb[${this.verb}] passed`);if("string"!=typeof this.url)throw new Error(`invalid API url[${this.url}] passed`);Tracker.TRACKERS.push(this),o.events.forEach(t=>{Tracker.create_listener(this,t,(r={})=>{var i;if(null===(i=this.emitter)||void 0===i?void 0:i.hasState("consent-no-tracking"))return;const a=e(o.metadata,{event_type:t},r.data||r),s=function(e,t){return e.replace(n,e=>{const r=e.slice(1,e.length);return r in t?t[r].toString():e})}(o.url,a),u=Tracker.pluck_valid_keys(o,a),d=Tracker.ensure_required_keys(o,u);if(d.length)return o.log.error(`Tracker.validate_metadata() failed for\n Event[${t}]\n missing keys: ${d}\n payload:\n ${JSON.stringify(u,null,2)}`);this.rq&&RequestQueue.rpush(this.rq,[s,this.verb,u])})})}destroy(){this.listeners.forEach(([e,t])=>{var r;return null===(r=this.emitter)||void 0===r?void 0:r.removeEventListener(e,t)}),delete this.rq,delete this.emitter,t(Tracker.TRACKERS,this)}put(e={}){return Tracker.merge_metadata(this,e),this}}var o;Tracker.TRACKERS=[],Tracker.QUEUE=r,Tracker.verb=i,function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(o||(o={}));const a=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function s(e,t){return!!~a.indexOf(e)||e.indexOf(t)===e.length-t.length}s.check_whitelist=function(e){return!!~a.indexOf(e)};function u(e){this.message=e}u.prototype=new Error,u.prototype.name="InvalidCharacterError";var d="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new u("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,o=0,a="";n=t.charAt(o++);~n&&(r=i%4?64*r+n:n,i++%4)?a+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};var c=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(d(e).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return d(t)}};function l(e){this.message=e}l.prototype=new Error,l.prototype.name="InvalidTokenError";var f=function(e,t){if("string"!=typeof e)throw new l("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(c(e.split(".")[r]))}catch(e){throw new l("Invalid token specified: "+e.message)}};f.InvalidTokenError=l;const p="production";function _(e,t){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let n={c:"{}",exp:0};t=t||{};try{n=f(e),r.valid_jwt=!0}catch(e){}return r.raw=e,r.data=JSON.parse(n.c),r.exp=n.exp,t.require_valid_token&&_.validate(r),r}function h(e){return{grant:e,is_granted:t=>(e&t)===t}}function m(e,t,r){const n=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;n.length;){if(null==e)return r;const t=n.shift();if("string"!=typeof t)return r;e=e[t]}return null==e?r:e}_.validate=function(e){if("string"==typeof e&&(e=_(e)),!e||!e.raw){if(s.check_whitelist(window.location.hostname)||"dev"===p.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,r=s.bind(null,t);if("dev"!==p.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==p.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},_.id=function(e){if(e)return"string"==typeof e&&(e=_(e)),e.data.id},h.of=h,h.from_token=function(e){const t=_(e,{require_valid_token:!0});return h.of(t.data.acl)},h.permissions=o;var v="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var y="ping",k="display",g="view";const w=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],E=["created","position"],T=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];const R=100,q=1e3;function A(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/R;return{segment_duration:t,breakpoints:Array(...Array(R)).map(function(e,r){return Math.floor(r*t*q)/q})}}(e.duration))}function S(e,t,r){if(!t.segment_duration&&!A(e,t))return;const n=function(e,t,r){const n=t.last_idx,i=r?99:O(e,t);return t.last_idx=i,i<=n?[]:t.breakpoints.slice(n,99==i?100:i).map(function(e){return t.breakpoints.indexOf(e)})}(e,t,r);0!=n.length&&e.emit(y,{position:n})}function O(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}function b(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}var N;const Q="vod",x="live",L=[k,y,g];function I(e,t,r){switch(null==t?void 0:t.kind){case"live":return function(e,t){const r=Date.now();r-t.last_tracked_ts<6e4||(t.last_tracked_ts=r,++t.ticks,e.emit(y,{position:60*t.ticks}))}(e,t);case"vod":return S(e,t,"boolean"==typeof r&&r)}}function M(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}const P=((N=class Analytics{init(e,t,r){if(!h.from_token(e.token||"").is_granted(h.permissions.ANALYTICS))return;if(r.analytics)return;const n=r.analytics={ticker:void 0,last_media_id:"",ended:!1,played:!1},i={locked:void 0,ttl:6e3,task:()=>{I(r,n.ticker)}};const o={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:e.player_id,customer_user_id:e.customer_user_id,player_version:"3.35.0-rc"},a=Tracker.of(r,{verb:Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:L,required_keys:w,optional_keys:T.concat(E).slice(0),metadata:o});r.on("reap",function(){a&&a.destroy()}),r.on("config",function(t){if(!a)return;const i=m(t,"data.metadata",{});if(!i.media_id&&i.stream_target_id&&(i.media_id=i.stream_target_id),!i.media_id)return n.last_media_id="";if(n.last_media_id===i.media_id)return;n.played=!1,n.last_media_id=i.media_id;const o=m(e,"analytics",{});a.put(i),a.put(o);const s=m(e,"metadata.live_start_time",e.live)?x:Q;a.put({video_type:s,source:e.source||b()||""}),n.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},n.ended=!1,r.emit(k)});let s=0;r.on("playing",function(){if(!a)return;if(s||n.played||!n.last_media_id)return;a.put({muted:r.muted});const e=M(r);if(e)return s=Promise.resolve(e).then(function(){n.played=!0,r.emit(g),s=0}).catch(function(){s=0});n.played=!0,r.emit(g)}),r.on("timeupdate",function(){var t;a&&(s||M(r)||n.ended||!n.last_media_id||(!e.live&&r.currentTime+.25>=r.duration&&I(r,n.ticker,!0),(t=i).locked||(t.locked=setTimeout(function(){return t.task(),function(e){return e.locked=void 0,e}(t)},t.ttl))))}),r.on("seeked",function(){a&&n.last_media_id&&n.ticker&&"vod"==n.ticker.kind&&function(e,t){A(e,t),t.last_idx=O(e,t)}(r,n.ticker)}),r.on("ended",function(){a&&n.last_media_id&&function(e,t){t.ended||(t.ended=!0,I(e,t.ticker))}(r,n)})}}).pluginName="analytics",N),C=function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const r=e.flowplayer;return"function"==typeof r?(r(t),t):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(t)||r.extensions.push(t),t)}("undefined"!=typeof window?window:void 0!==v?v:{},P);return C});
package/plugins/ovp.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.ovp=t())}(this,function(){"use strict";function e(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}const t=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),o=(...e)=>e.reduce((e,n)=>t(n)?(Object.keys(n).forEach(r=>{if(t(e[r])&&t(n[r]))return e[r]=o(e[r],n[r]);e[r]=n[r]}),e):e,{}),n="is-starting",r="is-source-processing",a="flowplayer:error";class Pipe{static of(e){return new Pipe(e)}static maybe(e,t,...o){return null==e?e:t.apply(e,[e,...o])}constructor(e){this.data=e}tap(e,...t){return e.apply(this,[this.data,...t]),new Pipe(this.data)}fmap(e,...t){const o=e.apply(this,[this.data,...t]);return new Pipe(o)}unwrap(){return this.data}}const i=window,s=i._flowplayerTimekeeper||(i._flowplayerTimekeeper={});function c(e){return fetch(e).then(e=>e.json())}function l(...e){let t=[].join.call(e,"/");return"/"!==t[0]&&(t="/"+t),d()+"/web/public/native/config"+t}const d=()=>"https://ljsp.lwcdn.com";function u(e){(async function(){const e=s.cachedServerOffset;if(e)return e;const t=s.pendingRequest||(s.pendingRequest=fetch("https://ljsp.lwcdn.com/web/public/countdown/time.json")),o=await t,n=parseInt(o.headers.get("age")||"0"),r=await o.json(),a=Date.now()-r.millisUtc-1e3*n;return s.cachedServerOffset=a,s.cachedServerOffset})().then(t=>Object.assign(e,{server_time_offset:t}))}function p(e,t){var n,r;t="object"==typeof t?t:{};const a={title:null===(n=null==e?void 0:e.metadata)||void 0===n?void 0:n.title,description:null===(r=null==e?void 0:e.metadata)||void 0===r?void 0:r.description},i={ima:{parameters:function({media_id:e,duration:t,title:o,tags:n,category_name:r,ad_keywords:a}){return{ad_keywords:a||"",media_id:e||"",category:r||"",media_name:o||"",media_tags:n||"",media_duration:t||-1}}((null==e?void 0:e.metadata)||{})}},s=t.embed||{};return delete s.src,o(i,a,e,(delete(c=t).src,delete c.metadata,delete c.title,delete c.description,delete c.duration,delete c.poster,c),s);var c}const f=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,m=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,y=/^[A-Za-z0-9]{8}$/,v=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/[A-Za-z0-9]{8}$/;function w(e){return"object"==typeof e&&"ovp/base64"==e.type}function h(e,t){return function(e,t){return!(!f.test(e)&&!m.test(e)||(t.type="video/ovp",0))}(e,t)||function(e,t){return!(!y.test(e)&&!v.test(e)||(t&&(t.type="video/ovp"),0))}(e,t)||w(t)}function b(e){try{return function(e){return null===e?{}:JSON.parse(e)}(decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(e){return{err:e.message}}}function k(e){const t=e.split(/[^0-9]/).map(e=>parseInt(e,10));return Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5])}function P(e){return e.live}const g="ovp:request:start",E="ovp:request:media:complete",C="ovp:request:playlist:complete",_="ovp:live:countdown:tick",A="ovp:live:countdown:start",N="ovp:live:countdown:complete",M="ovp:media:changed",S="ovp:message:realtime",O="ovp:config:finalized";var L=Object.freeze({__proto__:null,OVP_ERROR:"ovp:error",OVP_MEDIA_REQUEST_START:g,OVP_MEDIA_REQUEST_COMPLETE:E,OVP_PLAYLIST_REQUEST_COMPLETE:C,LIVE_COUNTDOWN_TICK:_,LIVE_COUNTDOWN_START:A,LIVE_COUNTDOWN_COMPLETE:N,OVP_MEDIA_CHANGED:M,OVP_REALTIME_MESSAGE:S,OVP_CONFIG_FINALIZED:O});const D={Unknown:"00-00",MediaUnknown:"01-00",MediaUnavailable:"01-01",MediaUnsupportedVideoFormat:"01-02",MediaUnsupportedAudioFormat:"01-03",MediaBitrateExceeded:"01-04",MediaBufferOverread:"01-05",MediaIntegerOverflow:"01-06",MediaQuotaExceeded:"01-07",MediaInvalidCompositionDuration:"01-08",MediaInvalidCompositionSourceDuration:"01-09",MediaInvalidCompositionSourceStartTime:"01-10",MediaMalformedDepth:"01-11",PlaybackUnknown:"02-00",PlaybackVideoBufferUnderRun:"02-01",PlaybackAudioBufferUnderRun:"02-02",PlaybackVideoBufferingTimeout:"02-03",PlaybackAudioBufferingTimeout:"02-04",PlaybackManifestParseError:"02-05",PlaybackVideoDecodeError:"02-06",PlaybackAudioDecodeError:"02-07",PlaybackDroppedFramesExceeded:"02-08",PlaybackPlayheadExceedsDuration:"02-09",PlaybackUnsupportedDevice:"02-10",PlaybackManifestLoadError:"02-11",PlaybackManifestLoadTimeout:"02-12",PlaybackManifestParsingError:"02-13",PlaybackManifestIncompatibleCodecs:"02-14",PlaybackLevelEmptyError:"02-15",PlaybackLevelLoadError:"02-16",PlaybackLevelLoadTimeout:"02-17",PlaybackLevelSwitchError:"02-18",PlaybackAudioTrackLoadError:"02-19",PlaybackAudioTrackLoadTimeout:"02-20",PlaybackFragLoadError:"02-21",PlaybackFragLoadTimeout:"02-22",PlaybackFragDecryptError:"02-23",PlaybackFragParsingError:"02-24",PlaybackFragGap:"02-25",PlaybackRemuxAllocError:"02-26",PlaybackBufferAddCodecError:"02-27",PlaybackBufferIncompatibleCodecs:"02-28",PlaybackBufferAppendError:"02-29",PlaybackBufferStalledError:"02-30",PlaybackBufferFullError:"02-31",PlaybackBufferSeekOverHole:"02-32",PlaybackBufferNudgeOnStall:"02-33",PlaybackInternalException:"02-34",PlaybackInternalAborted:"02-35",PlaybackManifestLoaderFailure:"02-36",PlaybackSegmentBaseLoaderError:"02-37",PlaybackTimeSyncFailed:"02-38",PlaybackFragmentLoaderFailure:"02-39",PlaybackAppendError:"02-40",PlaybackRemoveError:"02-41",PlaybackDataUpdateFailed:"02-42",PlaybackManifestNoStreams:"02-43",PlaybackUnknownManifestType:"02-44",PlaybackDashInsufficientSegmentInfo:"02-45",PlaybackDashNoRepresentations:"02-46",PlaybackDashNoAdaptationSets:"02-47",PlaybackDashNoInitSegment:"02-48",PlaybackDashUnsupportedContainerFormat:"02-49",PlaybackDashKeySystemMismatch:"02-50",PlaybackMultipleKeyIDs:"02-51",PlaybackDashConflictingKeyIDs:"02-52",PlaybackRestrictedStreams:"02-53",PlaybackHlsMasterAndMediaTags:"02-54",PlaybackRepresentationIdConflict:"02-55",PlaybackHlsUnsupportedKeyFormats:"02-56",PlaybackManifestNoVariants:"02-57",PlaybackHlsUndeclaredVariables:"02-58",PlaybackAes128InvalidKeyLength:"02-59",PlaybackDashConflictingAes128Keys:"02-60",PlaybackDashUnsupportedAes128Encryption:"02-61",PlaybackManifestPatchMismatch:"02-62",PlaybackEmptyMediaPlaylist:"02-63",PlaybackNonContiguousCompositionTrack:"02-64",PlaybackDecoderNotFound:"02-65",PlaybackDecoderTemporarilyUnavailable:"02-66",PlaybackIncompatibleAsset:"02-67",PlaybackNoCompatibleExternalDisplay:"02-69",PlaybackOutOfMemory:"02-70",PlaybackToneMappingFailed:"02-71",PlaybackVideoCompositorFailed:"02-72",NetworkUnknown:"03-00",NetworkNoInternet:"03-01",NetworkRequestTimeout:"03-02",NetworkUnableToResolveHost:"03-03",NetworkResourceNotFound:"03-04",NetworkExpiredUrl:"03-05",NetworkUrlResolutionFailed:"03-06",NetworkDownloadErrorIdManifest:"03-07",NetworkDownloadErrorIdSidx:"03-08",NetworkDownloadErrorIdContent:"03-09",NetworkDownloadErrorIdInitialization:"03-10",NetworkDownloadErrorIdXlink:"03-11",NetworkHttpRequestFailed:"03-12",NetworkMaxRetriesExceeded:"03-13",NetworkSegmentMissing:"03-14",NetworkHttp400BadRequest:"03-400",NetworkHttp401Unauthorized:"03-401",NetworkHttp402PaymentRequired:"03-402",NetworkHttp403Forbidden:"03-403",NetworkHttp404NotFound:"03-404",NetworkHttp405MethodNotAllowed:"03-405",NetworkHttp406NotAcceptable:"03-406",NetworkHttp407ProxyAuthenticationRequired:"03-407",NetworkHttp408RequestTimeout:"03-408",NetworkHttp409Conflict:"03-409",NetworkHttp410Gone:"03-410",NetworkHttp411LengthRequired:"03-411",NetworkHttp412PreconditionFailed:"03-412",NetworkHttp413PayloadTooLarge:"03-413",NetworkHttp414URITooLong:"03-414",NetworkHttp415UnsupportedMediaType:"03-415",NetworkHttp416RangeNotSatisfiable:"03-416",NetworkHttp417ExpectationFailed:"03-417",NetworkHttp418ImATeapot:"03-418",NetworkHttp421MisdirectedRequest:"03-421",NetworkHttp422UnprocessableEntity:"03-422",NetworkHttp423Locked:"03-423",NetworkHttp424FailedDependency:"03-424",NetworkHttp425TooEarly:"03-425",NetworkHttp426UpgradeRequired:"03-426",NetworkHttp428PreconditionRequired:"03-428",NetworkHttp429TooManyRequests:"03-429",NetworkHttp431RequestHeaderFieldsTooLarge:"03-431",NetworkHttp451UnavailableForLegalReasons:"03-451",NetworkHttp500InternalServerError:"03-500",NetworkHttp501NotImplemented:"03-501",NetworkHttp502BadGateway:"03-502",NetworkHttp503ServiceUnavailable:"03-503",NetworkHttp504GatewayTimeout:"03-504",NetworkHttp505HTTPVersionNotSupported:"03-505",NetworkHttp506VariantAlsoNegotiates:"03-506",NetworkHttp507InsufficientStorage:"03-507",NetworkHttp508LoopDetected:"03-508",NetworkHttp510NotExtended:"03-510",NetworkHttp511NetworkAuthenticationRequired:"03-511",ContentProtectionUnknown:"04-00",ContentProtectionConcurrentStreamLimitExceeded:"04-01",ContentProtectionEntitlementRefused:"04-02",ContentProtectionLicenseExpired:"04-03",ContentProtectionBadLicenseRequest:"04-04",ContentProtectionLicenseServerTimeout:"04-05",ContentProtectionInsufficientHDCPSupport:"04-06",ContentProtectionGeoRestricted:"04-07",ContentProtectionParentalControlRestricted:"04-08",ContentProtectionCDNUnauthorized:"04-09",ContentProtectionInvalidAccessToken:"04-10",ContentProtectionKeySystemNoKeys:"04-11",ContentProtectionKeySystemNoAccess:"04-12",ContentProtectionKeySystemNoSession:"04-13",ContentProtectionKeySystemNoConfiguredLicense:"04-14",ContentProtectionKeySystemCertificateRequestFailed:"04-15",ContentProtectionKeySystemCertificateUpdateFailed:"04-16",ContentProtectionKeySystemSessionUpdateFailed:"04-17",ContentProtectionKeySystemStatusOutputRestricted:"04-18",ContentProtectionKeySystemStatusInternalError:"04-19",ContentProtectionKeyLoadError:"04-20",ContentProtectionKeyLoadTimeout:"04-21",ContentProtectionCapabilityMediaKeysError:"04-22",ContentProtectionManifestKeySystemUnknown:"04-23",ContentProtectionKeySystemUnavailable:"04-24",ContentProtectionCDMCreationFailed:"04-25",ContentProtectionCDMAttachFailed:"04-26",ContentProtectionCDMServerCertificateRejected:"04-27",ContentProtectionCDMSessionCreationFailed:"04-28",ContentProtectionCDMLicenseRequestFailed:"04-29",ContentProtectionCDMLicenseResponseRejected:"04-30",ContentProtectionManifestMissingDRMInfo:"04-31",ContentProtectionLicenseServerMissing:"04-32",ContentProtectionOfflineSessionRemoved:"04-33",ContentProtectionInitDataTransformationError:"04-34",ContentProtectionServerCertificateRequestFailed:"04-35",ContentProtectionInsufficientHDCPVersion:"04-36",ContentProtectionHDCPVersionCheckFailed:"04-37",AdsUnknown:"08-00",AdsVastParseError:"08-100",AdsInvalidVastSchema:"08-101",AdsVastVersionNotSupported:"08-102",AdsUnexpectedAdType:"08-200",AdsCreativeLinearityMismatch:"08-201",AdsCreativeDurationMismatch:"08-202",AdsCreativeSizeMismatch:"08-203",AdsWrapperVastError:"08-300",AdsVastResponseRedirectTimeout:"08-301",AdsWrapperLimitReached:"08-302",AdsVastResponseEmpty:"08-303",AdsLinearAdDisplayError:"08-400",AdsMediaFileNotFound:"08-401",AdsMediaFileUnavailable:"08-402",AdsUnsupportedMimeType:"08-403",AdsUnableToDisplayMediaFile:"08-405",AdsMezzanineFileMissing:"08-406",AdsMezzanineFileDownloaded:"08-407",AdsRejectedAd:"08-408",AdsInteractiveCreativeError:"08-409",AdsVerificationNodeExecutionError:"08-410",AdsNonLinearAdDisplayError:"08-500",AdsNonLinearAdSizeMismatch:"08-501",AdsNonLinearAdFetchError:"08-502",AdsNonLinearUnsupportedType:"08-503",AdsCompanionAdDisplayError:"08-600",AdsCompanionAdSizeMismatch:"08-601",AdsRequiredCompanionAdError:"08-602",AdsCompanionAdFetchError:"08-603",AdsUndefinedVastError:"08-900",AdsUnknownVpaidError:"08-901",AdsVastDocumentEmpty:"08-999"},T=Object.fromEntries(Object.entries(D).map(([e,t])=>[t,e]));const F=[1e7]+""+-1e3+-4e3+-8e3+-1e11,R="off";class FlowplayerError extends Error{static getErrorKey(e){return e in T?T[e]:T["00-00"]}constructor(e,t,o={}){super(e),this.message=e,this.flowplayerErrorCode=t,this.config=o,this.id="undefined"==typeof crypto?"":F.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),this.isFatal=!!o.isFatal,this.errorKey=FlowplayerError.getErrorKey(this.flowplayerErrorCode)||"unknown"}toJSON(){return{message:this.message,flowplayer_error_code:this.flowplayerErrorCode,id:this.id,root_error_id:this.config.rootErrorId,resource:this.config.resource,is_fatal:this.isFatal,is_retry:!!this.config.isRetry}}}function I(e,t){const o=null==t?void 0:t.src;if(w(t))return function(e,t){const o=b(t.src||"");if(function(e){return"string"==typeof e.err}(o))return console.error(o.err);H(e,o)}(e,t);if(!o)return;e.setState(r,!0);const n=function(e){return~e.indexOf("/")?e:"/media/"+e}(o),i=l(n);fetch(i).then(async t=>t.ok?H(e,await t.json()):function(e,t,o,n){e.setState(r,!1);const i=new FlowplayerError(n.message||"error loading ovp source",function(e){const t=`03-${e}`;return t in T?t:D.NetworkUnknown}(o),{resource:t,isFatal:!0,retryOpts:{retry:R}});e.emit(a,{error:i})}(e,t.url,t.status,await t.json()))}function H(e,t){return e.emit(M,t),function(e){return Array.isArray(e.playlist)}(t)?function(e,t){e.emit(C,function(e,t){"number"!=typeof t.delay&&"number"!=typeof e.delay&&(t.delay=5);const n=Object.assign({},e),r=(null==e?void 0:e.playlist)||{},a=o(t,r),i=((null==a?void 0:a.playlist)||[]).map(e=>{t.ima&&Object.assign(e,{ima:t.ima});const o=p(e,n);return delete o.playlist,o});return delete a.ima,Object.assign(a,{playlist:i})}(e.opts,t))}(e,t):P(t)?function(e,t){var o,n;const r=(null===(o=null==t?void 0:t.metadata)||void 0===o?void 0:o.live_start_time)||(null===(n=null==t?void 0:t.metadata)||void 0===n?void 0:n.starttime);r&&(t.live_start_time=Pipe.of(r).fmap(k).unwrap());e.emit(A,Pipe.of(t).fmap(p,e.opts).unwrap())}(e,t):function(e,t){e.emit(E,Pipe.of(t).fmap(p,e.opts).unwrap())}(e,t)}const U={};function j(e,t,o){"object"!=typeof U[t]&&(U[t]=o);const n=e.opts,r=(null==n?void 0:n.metadata)||{};r.player_id=t,n.metadata=r,o.title&&delete o.title,o.description&&delete o.description;const a=Object.assign(n,o);e.setOpts(a),o.autoplay&&e.togglePlay(!0)}const x="recommendationsready";let V=!1;function K(e,t,o){q()||Pipe.of("recommendation").fmap(l,t,o).fmap(c).fmap(t=>t.then(t=>function(e,t){const o=t.playlist,n=e.opts;if(n.recommendations=o,!o.length)return;e.emit(x,{playlist:o.map(function(e){var t,o;return{poster:e.poster,src:e.src,title:null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.title,description:null===(o=null==e?void 0:e.metadata)||void 0===o?void 0:o.description,metadata:e.metadata||{},chapters:e.chapters,thumbnails:e.thumbnails,subtitles:e.subtitles}})})}(e,t)).catch(B))}function q(){return V}function B(e){V=!0,console.error("Failed to load recommendations: %j",e)}function z(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function W(e,t){const o=e._customElements.get(t);return o&&e.root.querySelector(o)||void 0}const $="flowplayer-live-countdown";function G(e){const t=Date.now()-(e.server_time_offset||0);return Math.floor(((e.live_start_time||0)-t)/1e3)}function Q(e,t){let o=0;function a(){const a=G(t);if(a<0||isNaN(a)||0===e.reaper||void 0===t.live_start_time)return clearInterval(o),function(e,t,o){e.emit(N);const n=W(e,$);if(n&&n.remove(),e.root.classList.remove("is-livecountdown"),o)return e.setState(r,!1);e.emit(E,t)}(e,t,void 0===t.live_start_time);var i,s,c;i=e,s=e.root,c=a,s.classList.add("is-livecountdown"),i.emit(_,{remaining_time:J(c+1)}),i.hasState(n)||i.setState(n,!0)}u(t),a(),o=setInterval(a,250)}function J(e){const t=function(e){"number"!=typeof e&&(e=parseInt(e,10)),e=Math.round(e);const t=Math.floor(e/86400);e-=86400*t;const o=Math.floor(e/3600);e-=3600*o;const n=Math.floor(e/60);return{days:t,hours:o,minutes:n,seconds:e-=60*n}}(e);let o="";return t.days&&(o+=t.days+":"),o+z(t.hours)+":"+z(t.minutes)+":"+z(t.seconds)}class WebsocketBridge{static of(e){return new WebsocketBridge(e)}constructor(e){this.manualDisconnect=!1,this.video=e,this.onClose=this.onClose.bind(this),this.onMessage=this.onMessage.bind(this)}connect(e){this.client=new WebSocket("wss://player.ws.flowplayer.com?mediaId="+e),this.current_media_id=e,this.wireup()}onClose(){this.manualDisconnect?this.manualDisconnect=!1:this.current_media_id&&this.reconnect(this.current_media_id)}onMessage(e){JSON.parse(e.data).forEach(e=>{this.video.emit(S,e)})}reconnect(e){this.cleanup(),this.connect(e)}wireup(){this.client&&(this.client.addEventListener("message",this.onMessage),this.client.addEventListener("close",this.onClose))}cleanup(){this.client&&(this.client.removeEventListener("message",this.onMessage),this.client.removeEventListener("close",this.onClose),this.client=void 0)}disconnect(){this.client&&(this.manualDisconnect=!0,this.client.close())}}const Z=(e,t)=>new(((e,t)=>{const o=e.get(t);if(!o)throw new Error(`no flowplayer component with the name ${t} exists`);const n=window.customElements.get(t);if(!n)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(o);return"function"!=typeof r?n:r})(e._customElements,t))(e);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerLiveCountdown extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-livecountdown");const t=function(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}("fp-inner");this.append(t);const o=document.createElement("p");o.innerText=e.i18n("ovp.starting_in"),t.append(o);const n=document.createElement("p");n.classList.add("fp-countdown"),t.append(n),e.on(_,t=>{const o=t.detail.remaining_time;e.root.classList.add("is-livecountdown"),n.innerText=o})}}const X=["*.lwcdn.com","*.flowplayer.com","*.wowza.com"];function Y(){try{return window.location.hostname!==window.parent.location.hostname?function(e){const t=document.createElement("a");return t.href=e,t}(document.referrer).hostname:document.location.hostname}catch(e){return window.location.hostname}}function ee(e){const t=document.createElement("a");t.href=e;const o=t.pathname&&t.pathname.split(".");return o.length>1&&o[o.length-1]}function te(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const oe=t=>{var{src:o}=t,n=e(t,["src"]);return[Object.assign({src:o,type:o?te("video/"+ee(o)):""},n)]};function ne(e){return oe({src:e})}function re(t){var{src:o,type:n}=t,r=e(t,["src","type"]);return o&&n?[Object.assign({src:o,type:n},r)]:n&&!o?[Object.assign({type:n},r)]:oe(Object.assign({src:o},r))}const ae=1;var ie,se;function ce(e){const t=[];e.on("health:ready",()=>{const o=e.opt("metadata.stream_target_id");o&&!t.includes(o)&&(t.push(o),function(e,{feature_name:t,behavior:o,sample_rate:n}){t&&(n||(n=ae),e.emit("flowplayer:feature",{feature_name:t,behavior:o,sample_rate:n}))}(e,{feature_name:"ewv",behavior:"used"}))})}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(ie||(ie={}));const le=((se=class OVP{constructor(e){((e,t,o)=>{window.customElements.get(t)||window.customElements.define(t,o),e.customElements.get(t)||e.customElements.set(t,t)})(e,$,FlowplayerLiveCountdown)}onload(e,t,o,n){if("string"==typeof(null==n?void 0:n.src))return"string"!=typeof e.player_id||0===n.src.indexOf(e.player_id)||w(n)||(n.src=[e.player_id,n.src].join("/")),I(o,n)}wants(e,t,o){return h(e,t)}init(t,n,a){const i=new WebsocketBridge(a);let s=Object.assign({},t);const d=function(e){if(!s)return e;t.autoplay!==s.autoplay&&(s.autoplay=t.autoplay),delete s.src;const n=o(e,s);return a.emit(O,n),n};a.on("src",()=>{(a.currentSrc||a.root.classList.contains("is-livecountdown"))&&(s=!1)}),a.on(g,function(){a.setState("is-waiting",!0),t.recommendations&&(t.recommendations=!1)}),a.on(M,function({data:e}){var t;const o=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.media_id;(null==e?void 0:e.live)&&o&&(i.disconnect(),i.connect(o))}),a.on(S,function({data:e}){var o;const n=null==e?void 0:e.event,r=null==e?void 0:e.value,i=a.opt("metadata",{live_start_time:""});switch(n){case"METADATA":{const e=Object.assign(i,r),n=Object.assign(t,{metadata:e});n.live&&(null===(o=null==n?void 0:n.metadata)||void 0===o?void 0:o.live_start_time)&&(n.live_start_time=k(n.metadata.live_start_time)),a.setOpts(n);break}}}),a.on("beforeplay",function(e){const o=t;if(P(o)){if(de(o))return;e.preventDefault()}}),a.on(E,function(e){const t=e.data;if(!t)return;var o;if(t.src&&(t.src=(o=t.src,"string"==typeof o?ne(o):Array.isArray(o)||"object"!=typeof o?o.reduce(function(e,t){return"string"==typeof t&&(t=ne(t)),"object"!=typeof t||Array.isArray(t)||(t=re(t)),e.concat(t)},[]):re(o)).map(e=>(e.src&&e.src.startsWith("//")&&(e.src="https:"+e.src),e))),0==a.reaper||"object"!=typeof t||G(t)>0)return;const n=d(t);a.setOpts(n),a.setAttrs(n),n.src&&a.setSrc(n.src),a.setState(r,!1)}),a.on("config",function({data:e}){var o,r;if("string"==typeof t.src&&h(t.src,{}))return;if((null==e?void 0:e.domains)&&(null==e?void 0:e.domains.length)&&!((e,t)=>{const o=e.split(".").reverse();return t.concat(X).some(e=>{const t=e.split(".").reverse(),n="*"===t[t.length-1];return n&&t.pop(),(n||t.length===o.length)&&t.every((e,t)=>o[t]===e)})})(Y(),e.domains))return function({root:e,video:t,data:o}){t&&t.destroy(),console.error(new Error(o.details||o.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.style.removeProperty("background-image");const n=document.createElement("h2");n.textContent="Playback Error";const r=document.createElement("p");r.textContent="Are you the site owner?";const a=document.createElement("a");a.classList.add("troubleshoot"),a.target="_blank",a.href="https://docs.flowplayer.com/troubleshooting/player#"+o.reason,a.textContent="Troubleshoot?";const i=document.createElement("img");i.src="https://flowplayer.com/user/pages/images/logo-white.png",i.alt="Flowplayer Logo",e.append(n,r,a,i)}({root:n,video:a,data:{details:`Hostname ${Y()} is not allowed to load player ${null===(o=e.metadata)||void 0===o?void 0:o.player_id}.`,reason:"domain"}});if(t.src&&ue(t.src))return;const i=null==e?void 0:e.brand_color;return i&&a.root.style.setProperty("--fp-brand-color","#"==i[0]?i:"#"+i),"string"==typeof t.player_id&&(null===(r=null==t?void 0:t.metadata)||void 0===r?void 0:r.player_id)!==t.player_id?function(e,t){if("object"==typeof U[t])return console.debug("using Cache(%s)",t),j(e,t,U[t]);Pipe.of(t).fmap(l).fmap(c).fmap(o=>o.then(o=>j(e,t,o)).catch(console.error))}(a,t.player_id):void 0}),a.on(C,function(t){var o;const n=t.data;if(!n||0==a.reaper)return;const{playlist:i}=n,s=e(n,["playlist"]),c=d(Object.assign(s,{playlist:Object.assign({},s)}));Array.isArray(c.playlist)&&(c.playlist=s),delete c.loop,c.playlist.playlist_title||(c.playlist.playlist_title=null===(o=s.metadata)||void 0===o?void 0:o.playlist_title),a.setOpts(c),a.setAttrs(c);const l={type:"flowplayer/playlist",items:i};a.setSrc(l),a.setState(r,!1)}),a.on(A,function(e){const o=e.data;if(!o||0==a.reaper)return;const r=d(o);if(a.setOpts(r),a.setAttrs(r),G(o)<=0)return a.emit(E,o);W(a,$)||(n.appendChild(Z(a,$)),Q(a,t))}),a.on("timeupdate",function(){var e,o,n;const r=t;P(r)?de(r)||(a.togglePlay(!1),a.emit("ended")):t.recommendations&&(null===(e=null==t?void 0:t.metadata)||void 0===e?void 0:e.media_id)&&(Array.isArray(t.recommendations)||a.currentTime/a.duration<.8||q()||(null===(o=null==t?void 0:t.metadata)||void 0===o?void 0:o.media_id)&&(null===(n=null==t?void 0:t.metadata)||void 0===n?void 0:n.player_id)&&K(a,t.metadata.media_id,t.metadata.player_id))}),a.on("reap",function(){i.disconnect()}),ce(a)}}).pluginName="ovp",se.events=L,se);function de(e){var t,o;const n=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.live_stop_time;if(!n)return!0;return!!(null===(o=null==e?void 0:e.metadata)||void 0===o?void 0:o.allow_after_stop_time)||k(n)>Date.now()}const ue=e=>{var t;if(e&&Array.isArray(e))return"object"==typeof e[0]&&"ovp/base64"===(null===(t=e[0])||void 0===t?void 0:t.type)};return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const o=e.flowplayer;return"function"==typeof o?(o(t),t):(Array.isArray(o.extensions)||(o.extensions=[]),~o.extensions.indexOf(t)||o.extensions.push(t),t)}(window,le)});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.ovp=t())}(this,function(){"use strict";function e(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}const t=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),o=(...e)=>e.reduce((e,n)=>t(n)?(Object.keys(n).forEach(r=>{if(t(e[r])&&t(n[r]))return e[r]=o(e[r],n[r]);e[r]=n[r]}),e):e,{}),n="is-starting",r="is-source-processing",a="flowplayer:error";class Pipe{static of(e){return new Pipe(e)}static maybe(e,t,...o){return null==e?e:t.apply(e,[e,...o])}constructor(e){this.data=e}tap(e,...t){return e.apply(this,[this.data,...t]),new Pipe(this.data)}fmap(e,...t){const o=e.apply(this,[this.data,...t]);return new Pipe(o)}unwrap(){return this.data}}const i=window,s=i._flowplayerTimekeeper||(i._flowplayerTimekeeper={});function c(e){return fetch(e).then(e=>e.json())}function l(...e){let t=[].join.call(e,"/");return"/"!==t[0]&&(t="/"+t),d()+"/web/public/native/config"+t}const d=()=>"https://ljsp.lwcdn.com";function u(e){(async function(){const e=s.cachedServerOffset;if(e)return e;const t=s.pendingRequest||(s.pendingRequest=fetch("https://ljsp.lwcdn.com/web/public/countdown/time.json")),o=await t,n=parseInt(o.headers.get("age")||"0"),r=await o.json(),a=Date.now()-r.millisUtc-1e3*n;return s.cachedServerOffset=a,s.cachedServerOffset})().then(t=>Object.assign(e,{server_time_offset:t}))}function p(e,t){var n,r;t="object"==typeof t?t:{};const a={title:null===(n=null==e?void 0:e.metadata)||void 0===n?void 0:n.title,description:null===(r=null==e?void 0:e.metadata)||void 0===r?void 0:r.description},i={ima:{parameters:function({media_id:e,duration:t,title:o,tags:n,category_name:r,ad_keywords:a}){return{ad_keywords:a||"",media_id:e||"",category:r||"",media_name:o||"",media_tags:n||"",media_duration:t||-1}}((null==e?void 0:e.metadata)||{})}},s=t.embed||{};return delete s.src,o(i,a,e,(delete(c=t).src,delete c.metadata,delete c.title,delete c.description,delete c.duration,delete c.poster,c),s);var c}const m=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,f=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,y=/^[A-Za-z0-9]{8}$/,v=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/[A-Za-z0-9]{8}$/;function w(e){return"object"==typeof e&&"ovp/base64"==e.type}function h(e,t){return function(e,t){return!(!m.test(e)&&!f.test(e)||(t.type="video/ovp",0))}(e,t)||function(e,t){return!(!y.test(e)&&!v.test(e)||(t&&(t.type="video/ovp"),0))}(e,t)||w(t)}function k(e){try{return function(e){return null===e?{}:JSON.parse(e)}(decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(e){return{err:e.message}}}function b(e){const t=e.split(/[^0-9]/).map(e=>parseInt(e,10));return Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5])}function P(e){return e.live}const g="ovp:request:start",E="ovp:request:media:complete",C="ovp:request:playlist:complete",_="ovp:live:countdown:tick",A="ovp:live:countdown:start",N="ovp:live:countdown:complete",M="ovp:media:changed",S="ovp:message:realtime",O="ovp:config:finalized";var D=Object.freeze({__proto__:null,OVP_ERROR:"ovp:error",OVP_MEDIA_REQUEST_START:g,OVP_MEDIA_REQUEST_COMPLETE:E,OVP_PLAYLIST_REQUEST_COMPLETE:C,LIVE_COUNTDOWN_TICK:_,LIVE_COUNTDOWN_START:A,LIVE_COUNTDOWN_COMPLETE:N,OVP_MEDIA_CHANGED:M,OVP_REALTIME_MESSAGE:S,OVP_CONFIG_FINALIZED:O});const L={Unknown:"00-00",MediaUnknown:"01-00",MediaUnavailable:"01-01",MediaUnsupportedVideoFormat:"01-02",MediaUnsupportedAudioFormat:"01-03",MediaBitrateExceeded:"01-04",MediaBufferOverread:"01-05",MediaIntegerOverflow:"01-06",MediaQuotaExceeded:"01-07",MediaInvalidCompositionDuration:"01-08",MediaInvalidCompositionSourceDuration:"01-09",MediaInvalidCompositionSourceStartTime:"01-10",MediaMalformedDepth:"01-11",PlaybackUnknown:"02-00",PlaybackVideoBufferUnderRun:"02-01",PlaybackAudioBufferUnderRun:"02-02",PlaybackVideoBufferingTimeout:"02-03",PlaybackAudioBufferingTimeout:"02-04",PlaybackManifestParseError:"02-05",PlaybackVideoDecodeError:"02-06",PlaybackAudioDecodeError:"02-07",PlaybackDroppedFramesExceeded:"02-08",PlaybackPlayheadExceedsDuration:"02-09",PlaybackUnsupportedDevice:"02-10",PlaybackManifestLoadError:"02-11",PlaybackManifestLoadTimeout:"02-12",PlaybackManifestParsingError:"02-13",PlaybackManifestIncompatibleCodecs:"02-14",PlaybackLevelEmptyError:"02-15",PlaybackLevelLoadError:"02-16",PlaybackLevelLoadTimeout:"02-17",PlaybackLevelSwitchError:"02-18",PlaybackAudioTrackLoadError:"02-19",PlaybackAudioTrackLoadTimeout:"02-20",PlaybackFragLoadError:"02-21",PlaybackFragLoadTimeout:"02-22",PlaybackFragDecryptError:"02-23",PlaybackFragParsingError:"02-24",PlaybackFragGap:"02-25",PlaybackRemuxAllocError:"02-26",PlaybackBufferAddCodecError:"02-27",PlaybackBufferIncompatibleCodecs:"02-28",PlaybackBufferAppendError:"02-29",PlaybackBufferStalledError:"02-30",PlaybackBufferFullError:"02-31",PlaybackBufferSeekOverHole:"02-32",PlaybackBufferNudgeOnStall:"02-33",PlaybackInternalException:"02-34",PlaybackInternalAborted:"02-35",PlaybackManifestLoaderFailure:"02-36",PlaybackSegmentBaseLoaderError:"02-37",PlaybackTimeSyncFailed:"02-38",PlaybackFragmentLoaderFailure:"02-39",PlaybackAppendError:"02-40",PlaybackRemoveError:"02-41",PlaybackDataUpdateFailed:"02-42",PlaybackManifestNoStreams:"02-43",PlaybackUnknownManifestType:"02-44",PlaybackDashInsufficientSegmentInfo:"02-45",PlaybackDashNoRepresentations:"02-46",PlaybackDashNoAdaptationSets:"02-47",PlaybackDashNoInitSegment:"02-48",PlaybackDashUnsupportedContainerFormat:"02-49",PlaybackDashKeySystemMismatch:"02-50",PlaybackMultipleKeyIDs:"02-51",PlaybackDashConflictingKeyIDs:"02-52",PlaybackRestrictedStreams:"02-53",PlaybackHlsMasterAndMediaTags:"02-54",PlaybackRepresentationIdConflict:"02-55",PlaybackHlsUnsupportedKeyFormats:"02-56",PlaybackManifestNoVariants:"02-57",PlaybackHlsUndeclaredVariables:"02-58",PlaybackAes128InvalidKeyLength:"02-59",PlaybackDashConflictingAes128Keys:"02-60",PlaybackDashUnsupportedAes128Encryption:"02-61",PlaybackManifestPatchMismatch:"02-62",PlaybackEmptyMediaPlaylist:"02-63",PlaybackNonContiguousCompositionTrack:"02-64",PlaybackDecoderNotFound:"02-65",PlaybackDecoderTemporarilyUnavailable:"02-66",PlaybackIncompatibleAsset:"02-67",PlaybackNoCompatibleExternalDisplay:"02-69",PlaybackOutOfMemory:"02-70",PlaybackToneMappingFailed:"02-71",PlaybackVideoCompositorFailed:"02-72",NetworkUnknown:"03-00",NetworkNoInternet:"03-01",NetworkRequestTimeout:"03-02",NetworkUnableToResolveHost:"03-03",NetworkResourceNotFound:"03-04",NetworkExpiredUrl:"03-05",NetworkUrlResolutionFailed:"03-06",NetworkDownloadErrorIdManifest:"03-07",NetworkDownloadErrorIdSidx:"03-08",NetworkDownloadErrorIdContent:"03-09",NetworkDownloadErrorIdInitialization:"03-10",NetworkDownloadErrorIdXlink:"03-11",NetworkHttpRequestFailed:"03-12",NetworkMaxRetriesExceeded:"03-13",NetworkSegmentMissing:"03-14",NetworkHttp400BadRequest:"03-400",NetworkHttp401Unauthorized:"03-401",NetworkHttp402PaymentRequired:"03-402",NetworkHttp403Forbidden:"03-403",NetworkHttp404NotFound:"03-404",NetworkHttp405MethodNotAllowed:"03-405",NetworkHttp406NotAcceptable:"03-406",NetworkHttp407ProxyAuthenticationRequired:"03-407",NetworkHttp408RequestTimeout:"03-408",NetworkHttp409Conflict:"03-409",NetworkHttp410Gone:"03-410",NetworkHttp411LengthRequired:"03-411",NetworkHttp412PreconditionFailed:"03-412",NetworkHttp413PayloadTooLarge:"03-413",NetworkHttp414URITooLong:"03-414",NetworkHttp415UnsupportedMediaType:"03-415",NetworkHttp416RangeNotSatisfiable:"03-416",NetworkHttp417ExpectationFailed:"03-417",NetworkHttp418ImATeapot:"03-418",NetworkHttp421MisdirectedRequest:"03-421",NetworkHttp422UnprocessableEntity:"03-422",NetworkHttp423Locked:"03-423",NetworkHttp424FailedDependency:"03-424",NetworkHttp425TooEarly:"03-425",NetworkHttp426UpgradeRequired:"03-426",NetworkHttp428PreconditionRequired:"03-428",NetworkHttp429TooManyRequests:"03-429",NetworkHttp431RequestHeaderFieldsTooLarge:"03-431",NetworkHttp451UnavailableForLegalReasons:"03-451",NetworkHttp500InternalServerError:"03-500",NetworkHttp501NotImplemented:"03-501",NetworkHttp502BadGateway:"03-502",NetworkHttp503ServiceUnavailable:"03-503",NetworkHttp504GatewayTimeout:"03-504",NetworkHttp505HTTPVersionNotSupported:"03-505",NetworkHttp506VariantAlsoNegotiates:"03-506",NetworkHttp507InsufficientStorage:"03-507",NetworkHttp508LoopDetected:"03-508",NetworkHttp510NotExtended:"03-510",NetworkHttp511NetworkAuthenticationRequired:"03-511",ContentProtectionUnknown:"04-00",ContentProtectionConcurrentStreamLimitExceeded:"04-01",ContentProtectionEntitlementRefused:"04-02",ContentProtectionLicenseExpired:"04-03",ContentProtectionBadLicenseRequest:"04-04",ContentProtectionLicenseServerTimeout:"04-05",ContentProtectionInsufficientHDCPSupport:"04-06",ContentProtectionGeoRestricted:"04-07",ContentProtectionParentalControlRestricted:"04-08",ContentProtectionCDNUnauthorized:"04-09",ContentProtectionInvalidAccessToken:"04-10",ContentProtectionKeySystemNoKeys:"04-11",ContentProtectionKeySystemNoAccess:"04-12",ContentProtectionKeySystemNoSession:"04-13",ContentProtectionKeySystemNoConfiguredLicense:"04-14",ContentProtectionKeySystemCertificateRequestFailed:"04-15",ContentProtectionKeySystemCertificateUpdateFailed:"04-16",ContentProtectionKeySystemSessionUpdateFailed:"04-17",ContentProtectionKeySystemStatusOutputRestricted:"04-18",ContentProtectionKeySystemStatusInternalError:"04-19",ContentProtectionKeyLoadError:"04-20",ContentProtectionKeyLoadTimeout:"04-21",ContentProtectionCapabilityMediaKeysError:"04-22",ContentProtectionManifestKeySystemUnknown:"04-23",ContentProtectionKeySystemUnavailable:"04-24",ContentProtectionCDMCreationFailed:"04-25",ContentProtectionCDMAttachFailed:"04-26",ContentProtectionCDMServerCertificateRejected:"04-27",ContentProtectionCDMSessionCreationFailed:"04-28",ContentProtectionCDMLicenseRequestFailed:"04-29",ContentProtectionCDMLicenseResponseRejected:"04-30",ContentProtectionManifestMissingDRMInfo:"04-31",ContentProtectionLicenseServerMissing:"04-32",ContentProtectionOfflineSessionRemoved:"04-33",ContentProtectionInitDataTransformationError:"04-34",ContentProtectionServerCertificateRequestFailed:"04-35",ContentProtectionInsufficientHDCPVersion:"04-36",ContentProtectionHDCPVersionCheckFailed:"04-37",AdsUnknown:"08-00",AdsVastParseError:"08-100",AdsInvalidVastSchema:"08-101",AdsVastVersionNotSupported:"08-102",AdsUnexpectedAdType:"08-200",AdsCreativeLinearityMismatch:"08-201",AdsCreativeDurationMismatch:"08-202",AdsCreativeSizeMismatch:"08-203",AdsWrapperVastError:"08-300",AdsVastResponseRedirectTimeout:"08-301",AdsWrapperLimitReached:"08-302",AdsVastResponseEmpty:"08-303",AdsLinearAdDisplayError:"08-400",AdsMediaFileNotFound:"08-401",AdsMediaFileUnavailable:"08-402",AdsUnsupportedMimeType:"08-403",AdsUnableToDisplayMediaFile:"08-405",AdsMezzanineFileMissing:"08-406",AdsMezzanineFileDownloaded:"08-407",AdsRejectedAd:"08-408",AdsInteractiveCreativeError:"08-409",AdsVerificationNodeExecutionError:"08-410",AdsNonLinearAdDisplayError:"08-500",AdsNonLinearAdSizeMismatch:"08-501",AdsNonLinearAdFetchError:"08-502",AdsNonLinearUnsupportedType:"08-503",AdsCompanionAdDisplayError:"08-600",AdsCompanionAdSizeMismatch:"08-601",AdsRequiredCompanionAdError:"08-602",AdsCompanionAdFetchError:"08-603",AdsUndefinedVastError:"08-900",AdsUnknownVpaidError:"08-901",AdsVastDocumentEmpty:"08-999"},T=Object.fromEntries(Object.entries(L).map(([e,t])=>[t,e]));const F=[1e7]+""+-1e3+-4e3+-8e3+-1e11,R="off";class FlowplayerError extends Error{static getErrorKey(e){return e in T?T[e]:T["00-00"]}constructor(e,t,o={}){super(e),this.message=e,this.flowplayerErrorCode=t,this.config=o,this.id="undefined"==typeof crypto?"":F.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),this.isFatal=!!o.isFatal,this.errorKey=FlowplayerError.getErrorKey(this.flowplayerErrorCode)||"unknown"}toJSON(){return{message:this.message,flowplayer_error_code:this.flowplayerErrorCode,id:this.id,root_error_id:this.config.rootErrorId,resource:this.config.resource,is_fatal:this.isFatal,is_retry:!!this.config.isRetry}}}function I(e,t){const o=null==t?void 0:t.src;if(w(t))return function(e,t){const o=k(t.src||"");if(function(e){return"string"==typeof e.err}(o))return console.error(o.err);H(e,o)}(e,t);if(!o)return;e.setState(r,!0);const n=function(e){return~e.indexOf("/")?e:"/media/"+e}(o),i=l(n);fetch(i).then(async t=>t.ok?H(e,await t.json()):function(e,t,o,n){e.setState(r,!1);const i=new FlowplayerError(n.message||"error loading ovp source",function(e){const t=`03-${e}`;return t in T?t:L.NetworkUnknown}(o),{resource:t,isFatal:!0,retryOpts:{retry:R}});e.emit(a,{error:i})}(e,t.url,t.status,await t.json()))}function H(e,t){return e.emit(M,t),function(e){return Array.isArray(e.playlist)}(t)?function(e,t){e.emit(C,function(e,t){"number"!=typeof t.delay&&"number"!=typeof e.delay&&(t.delay=5);const n=Object.assign({},e),r=(null==e?void 0:e.playlist)||{},a=o(t,r),i=((null==a?void 0:a.playlist)||[]).map(e=>{t.ima&&Object.assign(e,{ima:t.ima});const o=p(e,n);return delete o.playlist,o});return delete a.ima,Object.assign(a,{playlist:i})}(e.opts,t))}(e,t):P(t)?function(e,t){var o,n;const r=(null===(o=null==t?void 0:t.metadata)||void 0===o?void 0:o.live_start_time)||(null===(n=null==t?void 0:t.metadata)||void 0===n?void 0:n.starttime);r&&(t.live_start_time=Pipe.of(r).fmap(b).unwrap());e.emit(A,Pipe.of(t).fmap(p,e.opts).unwrap())}(e,t):function(e,t){e.emit(E,Pipe.of(t).fmap(p,e.opts).unwrap())}(e,t)}const U={};function j(e,t,o){"object"!=typeof U[t]&&(U[t]=o);const n=e.opts,r=(null==n?void 0:n.metadata)||{};r.player_id=t,n.metadata=r,o.title&&delete o.title,o.description&&delete o.description;const a=Object.assign(n,o);e.setOpts(a),o.autoplay&&e.togglePlay(!0)}const x="recommendationsready";let V=!1;function K(e,t,o){q()||Pipe.of("recommendation").fmap(l,t,o).fmap(c).fmap(t=>t.then(t=>function(e,t){const o=t.playlist,n=e.opts;if(n.recommendations=o,!o.length)return;e.emit(x,{playlist:o.map(function(e){var t,o;return{poster:e.poster,src:e.src,title:null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.title,description:null===(o=null==e?void 0:e.metadata)||void 0===o?void 0:o.description,metadata:e.metadata||{},chapters:e.chapters,thumbnails:e.thumbnails,subtitles:e.subtitles}})})}(e,t)).catch(B))}function q(){return V}function B(e){V=!0,console.error("Failed to load recommendations: %j",e)}function z(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function W(e,t){const o=e._customElements.get(t);return o&&e.root.querySelector(o)||void 0}const G="flowplayer-live-countdown";function $(e){const t=Date.now()-(e.server_time_offset||0);return Math.floor(((e.live_start_time||0)-t)/1e3)}function J(e,t){let o=0;function a(){const a=$(t);if(a<0||isNaN(a)||0===e.reaper||void 0===t.live_start_time)return clearInterval(o),function(e,t,o){e.emit(N);const n=W(e,G);if(n&&n.remove(),e.root.classList.remove("is-livecountdown"),o)return e.setState(r,!1);e.emit(E,t)}(e,t,void 0===t.live_start_time);var i,s,c;i=e,s=e.root,c=a,s.classList.add("is-livecountdown"),i.emit(_,{remaining_time:Q(c+1)}),i.hasState(n)||i.setState(n,!0)}u(t),a(),o=setInterval(a,250)}function Q(e){const t=function(e){"number"!=typeof e&&(e=parseInt(e,10)),e=Math.round(e);const t=Math.floor(e/86400);e-=86400*t;const o=Math.floor(e/3600);e-=3600*o;const n=Math.floor(e/60);return{days:t,hours:o,minutes:n,seconds:e-=60*n}}(e);let o="";return t.days&&(o+=t.days+":"),o+z(t.hours)+":"+z(t.minutes)+":"+z(t.seconds)}class WebsocketBridge{static of(e){return new WebsocketBridge(e)}constructor(e){this.manualDisconnect=!1,this.video=e,this.onClose=this.onClose.bind(this),this.onMessage=this.onMessage.bind(this)}connect(e){this.client=new WebSocket("wss://player.ws.flowplayer.com?mediaId="+e),this.current_media_id=e,this.wireup()}onClose(){this.manualDisconnect?this.manualDisconnect=!1:this.current_media_id&&this.reconnect(this.current_media_id)}onMessage(e){JSON.parse(e.data).forEach(e=>{this.video.emit(S,e)})}reconnect(e){this.cleanup(),this.connect(e)}wireup(){this.client&&(this.client.addEventListener("message",this.onMessage),this.client.addEventListener("close",this.onClose))}cleanup(){this.client&&(this.client.removeEventListener("message",this.onMessage),this.client.removeEventListener("close",this.onClose),this.client=void 0)}disconnect(){this.client&&(this.manualDisconnect=!0,this.client.close())}}const Z=(e,t)=>new(((e,t)=>{const o=e.get(t);if(!o)throw new Error(`no flowplayer component with the name ${t} exists`);const n=window.customElements.get(t);if(!n)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(o);return"function"!=typeof r?n:r})(e._customElements,t))(e);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerLiveCountdown extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-livecountdown");const t=function(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}("fp-inner");this.append(t);const o=document.createElement("p");o.innerText=e.i18n("ovp.starting_in"),t.append(o);const n=document.createElement("p");n.classList.add("fp-countdown"),t.append(n),e.on(_,t=>{const o=t.detail.remaining_time;e.root.classList.add("is-livecountdown"),n.innerText=o})}}const Y=["Expired token","No token provided in configuration","Invalid token provided","Domain not allowed"];function X({root:e,video:t,data:o}){t&&t.destroy(),console.error(new Error(o.details||o.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.style.removeProperty("background-image");const n=!!(r=o.details)&&Y.some(e=>r.includes(e));var r;const a=document.createElement("h2");a.textContent=n?"No Valid Token":"Playback Error";const i=document.createElement("p");i.textContent="Are you the site owner?";const s=document.createElement("a");s.classList.add("troubleshoot"),s.target="_blank",n?(s.href="https://form.typeform.com/to/YKJpmJSy",s.textContent="Get Trial Token (Beta)"):(s.href="https://docs.flowplayer.com/troubleshooting/player#"+o.reason,s.textContent="Troubleshoot?");const c=document.createElement("img");c.src="https://flowplayer.com/user/pages/images/logo-white.png",c.alt="Flowplayer Logo",e.append(a,i,s,c)}const ee=["*.lwcdn.com","*.flowplayer.com","*.wowza.com"];function te(){try{return window.location.hostname!==window.parent.location.hostname?function(e){const t=document.createElement("a");return t.href=e,t}(document.referrer).hostname:document.location.hostname}catch(e){return window.location.hostname}}function oe(e){const t=document.createElement("a");t.href=e;const o=t.pathname&&t.pathname.split(".");return o.length>1&&o[o.length-1]}function ne(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const re=t=>{var{src:o}=t,n=e(t,["src"]);return[Object.assign({src:o,type:o?ne("video/"+oe(o)):""},n)]};function ae(e){return re({src:e})}function ie(t){var{src:o,type:n}=t,r=e(t,["src","type"]);return o&&n?[Object.assign({src:o,type:n},r)]:n&&!o?[Object.assign({type:n},r)]:re(Object.assign({src:o},r))}const se=1;var ce,le;function de(e){const t=[];e.on("health:ready",()=>{const o=e.opt("metadata.stream_target_id");o&&!t.includes(o)&&(t.push(o),function(e,{feature_name:t,behavior:o,sample_rate:n}){t&&(n||(n=se),e.emit("flowplayer:feature",{feature_name:t,behavior:o,sample_rate:n}))}(e,{feature_name:"ewv",behavior:"used"}))})}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(ce||(ce={}));const ue=((le=class OVP{constructor(e){((e,t,o)=>{window.customElements.get(t)||window.customElements.define(t,o),e.customElements.get(t)||e.customElements.set(t,t)})(e,G,FlowplayerLiveCountdown)}onload(e,t,o,n){if("string"==typeof(null==n?void 0:n.src))return"string"!=typeof e.player_id||0===n.src.indexOf(e.player_id)||w(n)||(n.src=[e.player_id,n.src].join("/")),I(o,n)}wants(e,t,o){return h(e,t)}init(t,n,a){const i=new WebsocketBridge(a);let s=Object.assign({},t);const d=function(e){if(!s)return e;t.autoplay!==s.autoplay&&(s.autoplay=t.autoplay),delete s.src;const n=o(e,s);return a.emit(O,n),n};a.on("src",()=>{(a.currentSrc||a.root.classList.contains("is-livecountdown"))&&(s=!1)}),a.on(g,function(){a.setState("is-waiting",!0),t.recommendations&&(t.recommendations=!1)}),a.on(M,function({data:e}){var t;const o=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.media_id;(null==e?void 0:e.live)&&o&&(i.disconnect(),i.connect(o))}),a.on(S,function({data:e}){var o;const n=null==e?void 0:e.event,r=null==e?void 0:e.value,i=a.opt("metadata",{live_start_time:""});switch(n){case"METADATA":{const e=Object.assign(i,r),n=Object.assign(t,{metadata:e});n.live&&(null===(o=null==n?void 0:n.metadata)||void 0===o?void 0:o.live_start_time)&&(n.live_start_time=b(n.metadata.live_start_time)),a.setOpts(n);break}}}),a.on("beforeplay",function(e){const o=t;if(P(o)){if(pe(o))return;e.preventDefault()}}),a.on(E,function(e){const t=e.data;if(!t)return;var o;if(t.src&&(t.src=(o=t.src,"string"==typeof o?ae(o):Array.isArray(o)||"object"!=typeof o?o.reduce(function(e,t){return"string"==typeof t&&(t=ae(t)),"object"!=typeof t||Array.isArray(t)||(t=ie(t)),e.concat(t)},[]):ie(o)).map(e=>(e.src&&e.src.startsWith("//")&&(e.src="https:"+e.src),e))),0==a.reaper||"object"!=typeof t||$(t)>0)return;const n=d(t);a.setOpts(n),a.setAttrs(n),n.src&&a.setSrc(n.src),a.setState(r,!1)}),a.on("config",function({data:e}){var o,r;if("string"==typeof t.src&&h(t.src,{}))return;if((null==e?void 0:e.domains)&&(null==e?void 0:e.domains.length)&&!((e,t)=>{const o=e.split(".").reverse();return t.concat(ee).some(e=>{const t=e.split(".").reverse(),n="*"===t[t.length-1];return n&&t.pop(),(n||t.length===o.length)&&t.every((e,t)=>o[t]===e)})})(te(),e.domains))return X({root:n,video:a,data:{details:`Hostname ${te()} is not allowed to load player ${null===(o=e.metadata)||void 0===o?void 0:o.player_id}.`,reason:"domain"}});if(t.src&&me(t.src))return;const i=null==e?void 0:e.brand_color;return i&&a.root.style.setProperty("--fp-brand-color","#"==i[0]?i:"#"+i),"string"==typeof t.player_id&&(null===(r=null==t?void 0:t.metadata)||void 0===r?void 0:r.player_id)!==t.player_id?function(e,t){if("object"==typeof U[t])return console.debug("using Cache(%s)",t),j(e,t,U[t]);Pipe.of(t).fmap(l).fmap(c).fmap(o=>o.then(o=>j(e,t,o)).catch(console.error))}(a,t.player_id):void 0}),a.on(C,function(t){var o;const n=t.data;if(!n||0==a.reaper)return;const{playlist:i}=n,s=e(n,["playlist"]),c=d(Object.assign(s,{playlist:Object.assign({},s)}));Array.isArray(c.playlist)&&(c.playlist=s),delete c.loop,c.playlist.playlist_title||(c.playlist.playlist_title=null===(o=s.metadata)||void 0===o?void 0:o.playlist_title),a.setOpts(c),a.setAttrs(c);const l={type:"flowplayer/playlist",items:i};a.setSrc(l),a.setState(r,!1)}),a.on(A,function(e){const o=e.data;if(!o||0==a.reaper)return;const r=d(o);if(a.setOpts(r),a.setAttrs(r),$(o)<=0)return a.emit(E,o);W(a,G)||(n.appendChild(Z(a,G)),J(a,t))}),a.on("timeupdate",function(){var e,o,n;const r=t;P(r)?pe(r)||(a.togglePlay(!1),a.emit("ended")):t.recommendations&&(null===(e=null==t?void 0:t.metadata)||void 0===e?void 0:e.media_id)&&(Array.isArray(t.recommendations)||a.currentTime/a.duration<.8||q()||(null===(o=null==t?void 0:t.metadata)||void 0===o?void 0:o.media_id)&&(null===(n=null==t?void 0:t.metadata)||void 0===n?void 0:n.player_id)&&K(a,t.metadata.media_id,t.metadata.player_id))}),a.on("reap",function(){i.disconnect()}),de(a)}}).pluginName="ovp",le.events=D,le);function pe(e){var t,o;const n=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.live_stop_time;if(!n)return!0;return!!(null===(o=null==e?void 0:e.metadata)||void 0===o?void 0:o.allow_after_stop_time)||b(n)>Date.now()}const me=e=>{var t;if(e&&Array.isArray(e))return"object"==typeof e[0]&&"ovp/base64"===(null===(t=e[0])||void 0===t?void 0:t.type)};return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const o=e.flowplayer;return"function"==typeof o?(o(t),t):(Array.isArray(o.extensions)||(o.extensions=[]),~o.extensions.indexOf(t)||o.extensions.push(t),t)}(window,ue)});