@flowplayer/player 3.7.1-rc.2 → 3.7.1-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/embed.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).flowplayer=e()}(this,(function(){"use strict";const t=[],e=[];function r(){const t="undefined"!=typeof document&&"undefined"!=typeof window,e=t?navigator.userAgent:"",r=/iP(hone|od)/i.test(e)&&!/iPad/.test(e)&&!/IEMobile/i.test(e),i=/Android/.test(e)&&!/Firefox/.test(e),n=/^((?!chrome|android).)*safari/i.test(e),s=/SamsungBrowser/.test(e),a=s&&/SMART-TV/.test(e);return{controls:!r,video:function(e){return t&&document.createElement("video").canPlayType(e)},lang:t&&window.navigator.language,android:i,iphone:r,safari:n,ios:t&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:s,samsung_tv:s&&a,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const i="error",n="click",s="dblclick",a="load",o="mouseenter",l="mouseleave",d="mousemove",u="touchmove",c="touchend",h="fullscreenenter",f="fullscreenexit",p="loadedmetadata",g="loadeddata",v="progress",m="loadstart",y="pause",E="playing",T="waiting",_="canplay",S="ended",b="seeked",A="seeking",L="recover",w="reap",D="config",R="landscape",I="portrait",k="retry";var O=Object.freeze({__proto__:null,MOUNT:"mount",ERROR:i,CONTEXT_MENU:"contextmenu",CLICK:n,DBL_CLICK:s,KEYUP:"keyup",KEYDOWN:"keydown",LOAD:a,MOUSE_ENTER:o,MOUSE_LEAVE:l,MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:d,TOUCH_START:"touchstart",TOUCH_MOVE:u,TOUCH_END:c,TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:h,FULLSCREEN_EXIT:f,FULLSCREEN_CHANGE:"fullscreenchange",WEBKIT_NEEDKEY:"webkitneedkey",METADATA:p,DATA:g,PROGRESS:v,TIME_UPDATE:"timeupdate",LOAD_START:m,VOLUME_CHANGE:"volumechange",PAUSE:y,PLAYING:E,PLAY:"play",WAITING:T,CAN_PLAY:_,ENDED:S,SEEKED:b,SEEKING:A,DURATION_CHANGE:"durationchange",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",STATE:"state",CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",RECOVER:L,REAP:w,CONFIG:D,QUALITIES:"qualities",SET_QUALITY:"quality:set",NON_RECOVERABLE_ERROR:"error:fatal",RECOMMENDATIONS_READY:"recommendationsready",AUDIO_ONLY_SOURCE:"audioonlysource",LANDSCAPE:R,PORTRAIT:I,RENDER_PLUGIN:"renderplugin",DVR:"dvr",LIVE:"live",SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange",RETRY:k});const C="flowplayer-ui",P="flowplayer-logo",x="flowplayer-control",M="flowplayer-live-status",N="flowplayer-elapsed-time",F="flowplayer-timeline-bar",U="flowplayer-volume-bar",B="flowplayer-header",G="flowplayer-header-right-zone",H="flowplayer-middle",j="flowplayer-middle-zone",V="flowplayer-wait",K="flowplayer-small-play-icon",q="flowplayer-small-pause-icon",W="flowplayer-play-icon",z="flowplayer-pause-icon",Y="flowplayer-rewind-icon",X="flowplayer-volume-icon",Q="flowplayer-live-countdown";var $=Object.freeze({__proto__:null,SUBTITLES_MENU:"flowplayer-subtitles-menu",SHARE_MENU:"flowplayer-share-menu",SPEED_MENU:"flowplayer-speed-menu",QUALITY_MENU:"flowplayer-quality-menu",AUDIO_MENU:"flowplayer-audio-menu",UI:C,LOGO:P,CONTROL:x,CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:M,ELAPSED:N,TIMELINE:F,CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:U,HEADER:B,HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:G,HEADER_DURATION:"flowplayer-header-duration",MIDDLE:H,MIDDLE_ZONE:j,WAIT:V,MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",ENDSCREEN_INTERSTITIAL:"flowplayer-endscreen-interstitial",ENDSCREEN_UP_NEXT:"flowplayer-endscreen-up-next",ENDSCREEN_GRID:"flowplayer-endscreen-grid",PLAYLIST_INTERSTITIAL:"flowplayer-playlist-interstitial",AIRPLAY_ICON:"flowplayer-airplay-icon",CHROMECAST_ICON:"flowplayer-chromecast-icon",SMALL_PLAY_ICON:K,SMALL_PAUSE_ICON:q,PLAY_ICON:W,PAUSE_ICON:z,FULLSCREEN_ENTER_ICON:"flowplayer-fullscreen-enter-icon",FULLSCREEN_EXIT_ICON:"flowplayer-fullscreen-exit-icon",SKIP_NEXT_ICON:"flowplayer-skip-next-icon",SKIP_PREVIOUS_ICON:"flowplayer-skip-previous-icon",FAST_FORWARD_ICON:"flowplayer-fast-forward-icon",REWIND_ICON:Y,SHARE_ICON:"flowplayer-share-icon",VOLUME_ICON:X,MUTE_ICON:"flowplayer-mute-icon",UNMUTE_ICON:"flowplayer-unmute-icon",CLOSE_ICON:"flowplayer-close-icon",FACEBOOK_ICON:"flowplayer-facebook-icon",TWITTER_ICON:"flowplayer-twitter-icon",LINK_ICON:"flowplayer-link-icon",EMBED_ICON:"flowplayer-embed-icon",LIVE_COUNTDOWN:Q,PLAYLIST_CONTROLS:"flowplayer-playlist-controls",THUMBNAILS_CAROUSEL:"flowplayer-thumbnails-carousel",ERROR_COMPONENT:"flowplayer-error",TV_MENU:"flowplayer-tv-menu",CUE_COMPONENT:"flowplayer-cue"});const Z="is-playing",J="is-paused",tt="is-loaded",et="is-loading",rt="is-starting",it="is-seeking",nt="is-ended",st="is-live",at="is-waiting",ot="is-live-seeked",lt="no-timeline",dt="will-play",ut="will-pause",ct="is-touched",ht="is-in-viewport",ft="is-source-processing";var pt=Object.freeze({__proto__:null,PLAYING:Z,FULLSCREEN:"is-fullscreen",PAUSED:J,MUTED:"is-muted",LOADED:tt,LOADING:et,STARTING:rt,SEEKING:it,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",TV:"is-tv",ENDED:nt,LIVE:st,ERRORED:"is-error",WAITING:at,AUTOPLAY:"is-autoplay",NO_AUTOPLAY:"no-autoplay",SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:ot,NO_DVR:lt,HAS_POSTER:"has-poster",WILL_PLAY:dt,WILL_PAUSE:ut,MENU_OPENED:"has-menu-opened",TOUCHED:ct,HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:ht,NO_CONTROLS:"no-controls",DESTROYED:"is-destroyed",IS_SOURCE_PROCESSING:ft});function gt(t){this.message=t}gt.prototype=new Error,gt.prototype.name="InvalidCharacterError";var vt="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new gt("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,i,n=0,s=0,a="";i=e.charAt(s++);~i&&(r=n%4?64*r+i:i,n++%4)?a+=String.fromCharCode(255&r>>(-2*n&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return a};var mt=function(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(vt(t).replace(/(.)/g,(function(t,e){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(e)}catch(t){return vt(e)}};function yt(t){this.message=t}yt.prototype=new Error,yt.prototype.name="InvalidTokenError";var Et=function(t,e){if("string"!=typeof t)throw new yt("Invalid token specified");var r=!0===(e=e||{}).header?0:1;try{return JSON.parse(mt(t.split(".")[r]))}catch(t){throw new yt("Invalid token specified: "+t.message)}};Et.InvalidTokenError=yt;const Tt=new Map,_t=(t,e)=>new(((t,e)=>{const r=t.get(e);if(!r)throw new Error(`no flowplayer component with the name ${e} exists`);const i=window.customElements.get(e);if(!i)throw new Error(`no default flowplayer component with the name ${e} exists`);const n=window.customElements.get(r);return"function"!=typeof n?i:n})(t._customElements,e))(t),St=(t,e,r)=>{window.customElements.get(e)||window.customElements.define(e,r),t.customElements.get(e)||t.customElements.set(e,e)};var bt,At;!function(t){t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=4]="HIGH"}(bt||(bt={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON",t[t.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(At||(At={}));function Lt(t,e,r){const i="boolean"==typeof r;if("boolean"!=typeof r&&(r=!!t.hasState(ut)||t.paused),function(t,e,r){const i=t.poll(e?"beforeplay":"beforepause",{forced:r});return i&&i.defaultPrevented}(t,r,i))return Promise.resolve();if(!r)return t.hasState(dt)?(t.setState(ut,!0),t.setState(dt,!1),Promise.resolve()):Promise.resolve(t.pause());if(0==t.reaper)return Promise.resolve();const n=t.reaper.get("__pending_play");return t.paused||n?n?(n.src!==Dt(t.original_src)&&wt(t),n):(function(t){return(0==t.networkState||0==t.readyState)&&t.currentSrc==Dt(t.original_src)}(t)&&wt(t),(t=>t.autoplay&&At.AUDIO_REQUIRED&t.autoplay)(e)?function(t){t.muted=!1,0==t.volume&&(t.volume=1);return t.play().catch(t=>{console.warn("[flowplayer/play] autoplay audio required\n%s",t.message)})}(t):t.play().then(()=>{t.hasState(ut)&&t.togglePlay(!1)}).catch(e=>(console.warn("[flowplayer/play] attempting muted autoplay\n%s",e.message),t.muted=!0,t.volume=0,t.play()))):(t.setState(ut,!1),!t.hasState(Z)&&t.setState(dt,!0),Promise.resolve())}function wt(t){t.currentSrc.match(/^blob:/)||t.load()}function Dt(t){const e=document.createElement("a");return e.href=t,e.href}function Rt(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}function It(t){const e=document.createElement("a");e.href=t;const r=e.pathname&&e.pathname.split(".");return r.length>1&&r[r.length-1]}function kt(t){switch(t){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return t}}const Ot=t=>{var{src:e}=t,r=Rt(t,["src"]);return[Object.assign({src:e,type:e?kt("video/"+It(e)):""},r)]};function Ct(t){return Ot({src:t})}function Pt(t){var{src:e,type:r}=t,i=Rt(t,["src","type"]);return e&&r?[Object.assign({src:e,type:r},i)]:r&&!e?[Object.assign({type:r},i)]:Ot(Object.assign({src:e},i))}var xt;function Mt(t,e,r,i={safari:!1}){const n=Nt(r);return function(t){[it,ut,dt,Z,J,et,tt,ot].forEach(e=>t.setState(e,!1)),t.setState(rt,!0)}(t),Array(...Array(n.length)).map((t,e)=>e).some(r=>{const s=n[r];if(xt.Ok==function(t,e,r){t.emit("src",r),"string"==typeof r.src&&(t.original_src=r.src);const i=function(t,e,r){return t.plugins.filter(t=>{return(e=t)&&"wants"in e;var e}).find(t=>t.wants(r.src||"",r,e))}(t,e,r);return t.setOpts({is_native:!i}),i?(i.onload(e,t.root,t,r),xt.Ok):xt.Err}(t,e,s)||xt.Ok==function(t,e,r,i={safari:!1}){var n;/^audio\//.test(r.type||"")&&t.emit("audioonlysource");e.start_time&&(r.src=r.src+"#t="+e.start_time);if(""==t.canPlayType(r.type||""))return xt.Err;if(r.drm&&(!r.drm["com.apple.fps.1_0"]||!i.safari))return xt.Err;"string"==typeof r.src&&(t.preload=e.autoplay?"auto":null!==(n=e.preload)&&void 0!==n?n:"auto",t.src=r.src,e.autoplay&&i.safari&&t.load(),"none"!==t.preload&&t.setState(et,!0));return xt.Ok}(t,e,s,i))return!0;r==n.length-1&&"string"==typeof s.src&&(t.src=s.src)}),function(t,e){!function(t,e){if(!t.currentSrc)return;if("none"==t.opt("preload"))return;if(e.autoplay&&e.autoplay>0)return;t.load()}(t,e)}(t,e),t}function Nt(t){return"string"==typeof t?Ct(t):Array.isArray(t)||"object"!=typeof t?t.reduce((function(t,e){return"string"==typeof e&&(e=Ct(e)),"object"!=typeof e||Array.isArray(e)||(e=Pt(e)),t.concat(e)}),[]):Pt(t)}!function(t){t[t.Err=0]="Err",t[t.Ok=1]="Ok"}(xt||(xt={}));const Ft=[w,A,"src","seek:cancel"];var Ut;function Bt(t,e,r){return isNaN(t.duration)||isNaN(t.currentTime)?{}:(e.offset+=r,0==e.offset?Gt(t,e):(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){0!=t.reaper&&(t.currentTime=function(t,e,r=0){return Math.max(Math.min(e,t),r)}(t.currentTime+e.offset,t.duration),e.timer=0,Gt(t,e))}),1e3),function(t,e){t.setState("will-seek",!0),t.setState(Ut.BACKWARD,e.offset<0),t.setState(Ut.FORWARD,e.offset>0)}(t,e),t.emit("seek:queued",e),e))}function Gt(t,e){e.timer&&clearTimeout(e.timer),e.timer=e.offset=0,function(t){t.setState(Ut.FORWARD,!1),t.setState(Ut.BACKWARD,!1),t.setState("will-seek",!1)}(t)}function Ht(t,e){const r=t._customElements.get(e);return r&&t.root.querySelector(r)||void 0}function jt(){if("undefined"==typeof document)return!1;const t=document.documentElement;return t&&"rtl"==t.getAttribute("dir")}function Vt(...t){const e=document.createElement("div");return 0==t.length||e.classList.add(...t),e}function Kt(t,e,r){const i=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(e);for(;i.length;){if(null==t)return r;const e=i.shift();if("string"!=typeof e)return r;t=t[e]}return null==t?r:t}function qt(t){const e="number"==typeof t?t:parseInt(t,10);return(e>9?"":"0")+e}function Wt(t){if(isNaN(t)||t>=Number.MAX_SAFE_INTEGER)return"";const e=t<0?"-":"";t=Math.round(Math.abs(t));const r=Math.floor(t/3600);let i=Math.floor(t/60);return t-=60*i,r>=1?(i-=60*r,e+r+":"+qt(i)+":"+qt(t)):e+qt(i)+":"+qt(t)}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(Ut||(Ut={}));const zt=navigator.languages||[navigator.language];function Yt(t,e,r){const i={};return r=e.lang||r,t[r]&&(i[r]=t[r]),function(){try{return zt.reduce((t,e)=>~e.indexOf("-")?t.concat(e,e.split("-")[0]):t.concat(e),[])}catch(t){return[]}}().forEach((function(e){t[e]&&!i[e]&&(i[e]=t[e])})),Object.values(i)}const Xt=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Qt=()=>"undefined"==typeof crypto?"":Xt.replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16));let $t="";!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}}();const Zt=["touchstart","touchmove"];function Jt(t,e){const r=new CustomEvent(t,{detail:e,cancelable:!0});return e&&Object.defineProperty(r,"data",{get:()=>e}),r}function te(t,e,r){const i=Jt(e,r);return t.dispatchEvent(i),t}function ee(t,e,r){const i=Jt(e,r);return t.dispatchEvent(i),i}function re(t,e,r,i){Array.isArray(e)?e.forEach(e=>ie(t,e,r,i)):ie(t,e,r,i)}function ie(t,e,r,i){if(n=e,!~Zt.indexOf(n))return t.addEventListener(e,r,i),t;var n;const s=Object.assign(i||{},{passive:!0});return t.addEventListener(e,r,s),t}function ne(t,e,r,i){return re(t,e,r,Object.assign(i||{},{once:!0}))}class PlayerStorage{constructor(t,e){this.implementation=t,e&&e.keys().forEach(t=>{"string"==typeof e.implementation[t]&&this.implementation.setItem(t,e.implementation[t])})}keys(){var t;const e=[];for(var r=0;r<this.implementation.length;r++)(null===(t=this.implementation.key(r))||void 0===t?void 0:t.startsWith("flowplayer/"))&&e.push(this.implementation.key(r));return e}removeItem(t){try{this.implementation.removeItem("flowplayer/"+t)}catch(t){}}getItem(t){try{return this.implementation.getItem("flowplayer/"+t)}catch(t){return null}}setItem(t,e){try{this.implementation.setItem("flowplayer/"+t,e)}catch(t){}}clear(){try{this.keys().forEach(t=>this.implementation.removeItem(t))}catch(t){}}get length(){try{return this.keys().length}catch(t){return 0}}key(t){try{return this.implementation.key(t)}catch(t){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(t){var e;return(null===(e=this.pairs.find(e=>e[0]===t))||void 0===e?void 0:e[1])||null}key(t){return this.pairs[t][0]||null}removeItem(t){this.pairs=this.pairs.filter(e=>e[0]!==t)}setItem(t,e){this.removeItem(t),this.pairs.push([t,e])}}const se={preload:"none",rtl:!1,controls:!0},ae=["loop","muted","preload"];function oe(t,i,n){let s;n.live_state={dvr_window:void 0,get dvr(){return s},set dvr(e){s=e;const r=!(!t.live||e);n.hasState(lt)!=r&&n.setState(lt,r)}},n._storage=new PlayerStorage(["localStorage","sessionStorage"].map(t=>{try{const e=window[t];return e.getItem(""),e}catch(e){return console.debug(`Access to window.${t} denied, trying next option`),null}}).find(t=>!!t)||new InMemoryStorage),n.toJSON=function(){return{duration:n.duration,volume:n.volume,currentTime:n.currentTime,states:n.root.className}},n.setSrc=function(e){return Mt(n,t,e,r())},n.playerState=n.playerState||{},n.setState=function(t,e){if(n.playerState[t]===!!e)return n;const r=Object.assign({},n.playerState,{[t]:e});return n.playerState=r,te(n,"state",n.playerState),n},n.createComponents=function(...t){return Array.from({length:t.length}).map((e,r)=>_t(this,t[r]))},n.hasState=function(t){return!!n.playerState[t]},n.transitionState=function(t,e,r){!n.hasState(t)&&n.hasState(e)||(r=0),r&&n.setState("is-toggling",!0),n.setState(e,!1),n.setState(t,!0),r&&setTimeout((function(){n.setState("is-toggling",!1)}),r)},n.emit=(t,e)=>(te(n,t,e),n),n.on=(t,e)=>(re(n,t,e),n),n.once=(t,e)=>(ne(n,t,e),n),n.off=(t,e)=>{var r,i;return r=t,i=e,n.removeEventListener(r,i),n},n.poll=(t,e)=>ee(n,t,e),n.togglePlay=function(e){return Lt(n,t,e)},n.toggleMute=function(t){t=null==t?!n.muted:!!t,n.muted=t,n.muted||n.volume||(n.volume=1),te(n,"volumechange")},n.toggleDisable=function(t){t=null==t?!n.disabled:!!t,n.setState("is-disabled",t),n.disabled=t},n.destroy=function(){n.pause();const t=e.indexOf(n);~t&&e.splice(t,1),setTimeout((function(){n.setSrc([]),n.reaper&&n.reaper.clear(),te(n,w),n.setState("is-destroyed",!0)}),0)},n.setAttrs=function(t){return ae.forEach(e=>{if(!(e in t))return;const r=t[e];r?n.setAttribute(e,r.toString()):n.removeAttribute(e)}),n},n.opt=function(e,r){return r=void 0===r?Kt(se,e):r,Kt(t,e,r)},n.i18n=function(t,e){if(!n.reaper)return"";const r=n.reaper.get("translations");return r?function t(e,r,i,n){return(n=n||0)>=e.length?i:Kt(e[n],r,t(e,r,i,n+1))}(r,t,e||""):e||""},n.setOpts=function(e){Object.assign(t,e),t.live&&!n.hasState(st)&&(n.setState(lt,!0),te(n,"live")),"disabled"in e&&void 0!==e.disabled&&n.toggleDisable(e.disabled),"muted"in e&&void 0!==e.muted&&n.toggleMute(e.muted),"dvr"in t&&(n.live_state.dvr=n.opt("dvr"));const r=!!t.autoplay&&!n.hasState("no-autoplay");n.setState("is-autoplay",r),n.setState("is-rtl",n.opt("rtl",function(t){if(!t)return jt();const e=t.getAttribute("dir");return e?"rtl"==e:jt()}(i))),n.setState(st,!!t.live),n.setState("has-poster","string"==typeof t.poster&&t.poster.length>0),n.setState("is-seekable",!!t.seekable),n.setState("no-controls",0==t.controls),i.style.backgroundImage=n.hasState("has-poster")?"url('"+t.poster+"')":"",te(n,D,t)},n.renderPlugin=function(t){ee(n,"renderplugin",t).defaultPrevented||n.root.appendChild(t)};const a={offset:0,timer:0};var o,l;l=a,(o=n).on(Ft,(function(){Gt(o,l)})),n.enqueueSeek=function(t){if(0!=n.opts.seekable&&!(1==n.opts.disabled&&t>0))return Bt(n,a,t)},n.deviceId=function(){return function(t){if($t)return $t;try{const e=t.getItem("flowplayer/uuid");if(e)return e;const r=Qt();return t.setItem("flowplayer/uuid",r),r}catch(t){return $t=Qt()}}(n._storage)}}function le(t,e){const r=e.querySelector("video"),i=r||(t._video_element_callback?t._video_element_callback(t):document.createElement("video"));return i.classList.add("fp-engine"),i.playsInline=!0,r||e.append(i),i}var de="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function ue(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;if(null===document.currentScript)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const r=t.flowplayer;return"function"==typeof r?(r(e),e):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(e)||r.extensions.push(e),e)}function ce(){return"undefined"!=typeof window?window:void 0!==de?de:{}}const he=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function fe(t,e){return!!~he.indexOf(t)||t.indexOf(e)===t.length-e.length}fe.check_whitelist=function(t){return!!~he.indexOf(t)};const pe="production";function ge(t,e){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let i={c:"{}",exp:0};e=e||{};try{i=Et(t),r.valid_jwt=!0}catch(t){}return r.raw=t,r.data=JSON.parse(i.c),r.exp=i.exp,e.require_valid_token&&ge.validate(r),r}function ve(t){try{return ge.validate(t),{success:!0,message:""}}catch(t){return{success:!1,message:t.message}}}var me;function ye(t){return{grant:t,is_granted:e=>(t&e)===e}}function Ee({root:t,video:e,data:r}){e&&e.destroy(),console.error(new Error(r.details||r.reason)),t.innerHTML="",t.classList.remove("flowplayer"),t.classList.add("flowplayer-fatal"),t.style.removeProperty("background-image");const i=document.createElement("h2");i.textContent="Playback Error";const n=document.createElement("p");n.textContent="Are you the site owner?";const s=document.createElement("a");s.classList.add("troubleshoot"),s.target="_blank",s.href="https://docs.flowplayer.com/troubleshooting/player#"+r.reason,s.textContent="Troubleshoot?";const a=document.createElement("img");a.src="https://flowplayer.com/user/pages/images/logo-white.png",t.append(i,n,s,a)}ge.validate=function(t){if("string"==typeof t&&(t=ge(t)),!t||!t.raw){if(fe.check_whitelist(window.location.hostname)||"dev"===pe.toString())return!0;throw new Error("No token provided in configuration")}if(!t.valid_jwt)throw new Error("Invalid token provided");const e=window.location.hostname,r=fe.bind(null,e);if("dev"!==pe.toString()&&t.data.domain&&t.data.domain.length&&!t.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==pe.toString()&&1e3*t.exp-Date.now()<0)throw new Error("Expired token");return!0},ge.id=function(t){if(t)return"string"==typeof t&&(t=ge(t)),t.data.id},function(t){t[t.ADS=2]="ADS",t[t.ANALYTICS=4]="ANALYTICS",t[t.NO_METERING=8]="NO_METERING",t[t.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",t[t.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(me||(me={})),ye.of=ye,ye.from_token=function(t){const e=ge(t,{require_valid_token:!0});return ye.of(e.data.acl)},ye.permissions=me;function Te(t,e){const r=e.clientWidth;e.classList.toggle("is-small",r<600),e.classList.toggle("is-tiny",r<400)}function _e(t,e,i){let n=!0;e.classList.add("flowplayer"),Te(0,e),re(i,[m,"resize"],(function(){Te(0,e)})),re(i,"state",(function(){Object.entries(i.playerState).forEach((function([t,r]){e.classList.toggle(t,r)}))})),re(i,"timeupdate",(function(){i.setState(at,!i.hasState("is-casting")&&!i.hasState(rt)&&i.readyState<3)})),re(i,S,(function(e){setTimeout((function(){if(!e.defaultPrevented){if(t.rewind&&!i.loop){const e=i.src;t.autoplay&&(t.autoplay=0,i.setState("is-autoplay",!1)),i.setState(it,!0),ne(i,b,(function(){e===i.src&&(i.setState(it,!1),i.pause(),i.setState(rt,!0))})),i.currentTime=0}ne(i,"timeupdate",(function(){i.setState(nt,!1)})),i.transitionState(nt,Z,t.loop||t.rewind?0:300)}}),0)})),re(i,[A,b],(function(t){i.setState(it,t.type==A)})),re(i,"remotesession:ended",(function(t){setTimeout(()=>i.currentTime=t.detail.currentTime,0)})),re(i,S,(function(){i.setState(Z,!1),n=!0})),re(i,v,()=>{if(!i.opts.live||!i.opts.is_native)return;const t=i.seekable;0!=t.length&&i.emit("dvr/window",t.end(t.length-1)-t.start(0))}),re(i,r().ios?p:g,(function(){var t,e;i.setState(tt,!0),i.setState(et,!1);const r=i;0===(null===(t=r.videoTracks)||void 0===t?void 0:t.length)&&(null===(e=r.audioTracks)||void 0===e?void 0:e.length)>0&&i.emit("audioonlysource")})),re(i,"play",()=>{i.setState(dt,!0)}),re(i,[T,_,m],(function(e){if(!i.hasState(it)&&(e.type!=_||t.autoplay||i.setState(at,!1),e.type!=m||"none"!=i.opt("preload")||t.autoplay)){if(e.type==m&&t.autoplay)return ne(i,E,(function(){i.setState(at,!1)}));e.type!=T||i.hasState(tt)||i.setState(et,!0),i.setState(nt,!1),i.setState(at,e.type==T)}})),re(i,[E,y],(function(e){setTimeout(()=>{const t=new CustomEvent("flowplayer/"+e.type,{detail:i});document.dispatchEvent(t)},0);const r=e.type==E,s=i.currentTime==i.duration,a=r&&n&&t.autoplay||i.hasState(at);if(r&&(i.started=!0,n=!1),i.setState(at,!1).setState(rt,!1).setState(dt,!1),!r&&i.setState(ut,!1),s)return;const o=r?Z:J,l=r?J:Z;i.transitionState(o,l,a?0:300),r&&i.setState("no-autoplay",!1)}))}const Se=[0].concat(Array.from({length:100}).map((t,e)=>(e+1)/100));function be(t,e,r){if(!window.IntersectionObserver)return;const i={should_resume:!!t.autoplay,has_user_gesture:!1,locked:!1};[c,n].forEach(t=>ne(r,t,()=>i.has_user_gesture=!0)),re(r,"play",(function(){i.locked||(i.should_resume=!0)})),re(r,"src",(function(){i.should_resume=!!t.autoplay})),re(r,y,(function(){i.locked||(i.should_resume=!1)}));const s=()=>{setTimeout(()=>{r.setState(rt,!0),r.setState("is-autoplay",!1)},100)};re(r,_,()=>{if(t.autoplay)return r.hasState(ht)&&i.should_resume?r.togglePlay(!0).catch(s):void(t.autopause||r.hasState(ht)||!i.should_resume||ne(r,"viewenter",()=>{t.autoplay&&i.should_resume&&r.togglePlay(!0).catch(s)}))});const a=new IntersectionObserver(t=>{t.forEach(t=>{setTimeout(()=>{const e=t.intersectionRatio,i=r.hasState(ht);if(r.setState(ht,e>=.2),r.emit("intersectionchange",{ratio:e}),i===r.hasState(ht))return;const n=r.hasState(ht)?"viewenter":"viewleave";r.emit(n)},0)})},{threshold:Se});a.observe(e),r.on(w,()=>a.disconnect()),re(r,"viewenter",(function(){i.should_resume&&t.autopause&&!Ae()&&r.togglePlay(!0)})),re(r,"viewleave",(function(){if(!t.autopause||Ae())return;const e=!r.paused;i.locked=!0,r.pause(),setTimeout((function(){i.should_resume=e,i.locked=!1}),0)}))}function Ae(){return e.find(t=>t.hasState("is-casting"))}function Le(t,e){if(!window.ResizeObserver)return;const r=new ResizeObserver(t=>{const r=t[t.length-1];e.emit("resize",r)});r.observe(t),e.on(w,()=>r.disconnect())}function we(t){if("number"==typeof t&&!isNaN(t))return Number(t);if("string"==typeof t){const e=t.split(":");return Number(e[1])/Number(e[0])}return t}function De(t,e,r){const i=!!t.ratio,n=document.createElement("div");n.classList.add("fp-ratio"),e.append(n);let s=we(t.ratio||.5625);n.style.paddingTop=100*s+"%";const a=[g,p];r.on(a,(function(){if(i)return;const t=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth;t&&r.setOpts({ratio:t})})),r.on(D,(function(){const e=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth,i=we((null==t?void 0:t.ratio)||e||.5625);s!==i&&(s=i,n.style.paddingTop=100*i+"%")}))}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(t,e,r){this.root=e,this.player=r,this.wireUp()}wireUp(){var t,e;this.cleanUp(),null===(t=this.player)||void 0===t||t.once(E,this.render),null===(e=this.player)||void 0===e||e.once(S,this.wireUp)}cleanUp(){var t,e,r,i;null===(e=null===(t=this._logo)||void 0===t?void 0:t.parentElement)||void 0===e||e.removeChild(this._logo),null===(r=this.player)||void 0===r||r.off(E,this.render),null===(i=this.player)||void 0===i||i.off(S,this.wireUp)}render(){var t,e,r;null===(e=null===(t=this._logo)||void 0===t?void 0:t.parentElement)||void 0===e||e.removeChild(this._logo);const i=(null===(r=this.root)||void 0===r?void 0:r.querySelector(".fp-ui"))||this.root;if(!i)return;const n=this._logo=document.createElement("a");n.href="https://explorer.flowplayer.com",n.target="_blank",Object.entries(Re).forEach(([t,e])=>{n.style.setProperty(t,e,"important")}),i.appendChild(n)}}const Re={display:"block",opacity:"1",visibility:"visible",width:"33%","padding-top":"9%",position:"absolute","z-index":"9999",bottom:"25%",left:"10%","background-size":"cover","background-image":"url(https://static.flowplayer.com/explorer/explorer.svg)"},Ie="flowplayer/"+E;function ke(t){const e=e=>{e.detail!==t&&!1===t.opt("multiplay")&&t.togglePlay(!1)};t.on(w,()=>document.removeEventListener(Ie,e)),document.addEventListener(Ie,e)}function Oe(t,e){const r=[];t.addEventListener("contextmenu",i=>{const n=i.timeStamp;for(r.push(n);r.length>3;)r.shift();r.length>=3&&r.every(t=>t-n<3e3)&&(console.debug("flowplayer/debug rendering info"),function(t,e){var r;!function(t){const e=t.querySelector(".debug-info");null==e||e.remove()}(t);const i=document.createElement("div");i.classList.add("debug-info");const n=Ce("flowplayer.version","3.7.1-rc.2");i.append(n);const s=null===(r=null==e?void 0:e.hls)||void 0===r?void 0:r.constructor;if(s&&s.version){const t=Ce("hls.version",s.version);i.append(t)}t.appendChild(i)}(t,e))})}const Ce=(t,e)=>{const r=document.createElement("div");r.classList.add("row",t);const i=document.createElement("span");i.classList.add("attr"),i.textContent=t;const n=document.createElement("span");return n.textContent=e,n.classList.add("value"),r.append(i,n),r};function Pe(t,e){const r=function(){try{return localStorage.getItem("flowplayer/debug")}catch(t){return""}}(),i=(i,...n)=>{try{const s=(null==e?void 0:e.debug)||r;s&&t.match(s)&&console.log(`flowplayer/${t} -- ${i}`,...n)}catch(t){console.warn(t)}};return i.log=i,i}function xe(t){return e=>{setTimeout((function(){if(!e.defaultPrevented)return t(e)}),0)}}const Me=Pe("core/retry");function Ne(t,e){const r={pending:void 0,count:0};t.on(i,i=>{e.retry&&void 0===r.pending&&(++r.count,r.pending=function(t,e){return setTimeout(()=>{t.hasState("is-destroyed")||(e.pending=void 0,[L,k].forEach(e=>t.emit(e)),Me("%s try",e.count))},3e3*e.count)}(t,r))}),t.on(E,()=>{r.count=0}),t.on(["src",L],()=>{r.pending&&(clearTimeout(r.pending),r.pending=void 0)}),t.on(k,xe(e=>{e.defaultPrevented||t.load()}))}const Fe=function(){const t=ce(),e=t.flowplayer?t.flowplayer:{extensions:[]};return Array.isArray(e.extensions)||(e.extensions=[]),e}();function Ue(r,i){if("function"==typeof r)return t.push(...[...arguments].filter(t=>"function"==typeof t)),Ue;"string"==typeof i&&(i={src:i}),i||(i={}),i.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(i.token=window.__FLOWPLAYER_TOKEN);const n="string"==typeof r?document.querySelector(r):r;if(!n)return console.error(new Error("Flowplayer: '"+r.toString()+"' not found"));const s=n.querySelector("video.fp-engine");if(s)return s;const a=ve(i.token);if(!a.success)return Ee({root:n,data:{reason:"token",details:a.message}});const o=new Map,l=le(i,n);l.reaper=o,l._customElements=Tt,Object.defineProperty(l,"token",{value:"string"==typeof i.token?ge.id(i.token):"",writable:!1}),l.addEventListener(w,()=>{o.clear(),l.reaper=0,delete l.root}),l.root=n,i.token&&ye.from_token(i.token).is_granted(ye.permissions.DEVELOPER_PLAN)&&t.push(ExplorerPlan),!~e.indexOf(l)&&e.push(l),oe(i,n,l),l.setAttrs(i),l.plugins=Ue.extensions.map(t=>new t(Ue,l)),_e(i,n,l),be(i,n,l),Le(n,l),De(i,n,l),ke(l),Oe(n,l),Ne(l,i),l.plugins.forEach(t=>{try{t.init(i,n,l)}catch(e){console.log("Error(plugin/%s)",t.constructor.name,e)}}),l.setOpts(i),l.opts=i,i.src&&l.setSrc(i.src);const d=l.readyState;return d>0&&l.currentSrc&&l.emit(p),d>2&&l.currentSrc&&l.emit(_),l.emit("mount"),l.on("error:fatal",(function(t){Ee({root:n,video:l,data:t.data||{}})})),setTimeout(te,0,document,"flowplayer:player:created",l),l}Object.assign(Ue,Fe),function(i){Array.isArray(i.extensions)&&i.extensions.forEach(e=>t.push(e)),i.customElements=Tt,i.defaultElements=$,i.version="3.7.1-rc.2",i.commit="608a8f70481e079d9229495e9578aa329c8772b8",i.instances=e,i.extensions=t,i.support=r,i.events=O,i.states=pt,i.jwt=Et,i.autoplay=At,i.quality=bt}(Ue),"object"==typeof document&&setTimeout(te,0,document,"flowplayer:umd",Ue);var Be="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ge(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function He(t){var e={exports:{}};return t(e,e.exports),e.exports}var je=He((function(t,e){var r=Be&&Be.__assign||function(){return(r=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};e.__esModule=!0,e.remove=e.downcase=e.pluck=e.merge=void 0,e.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return r(r({},t),e)}),{})},e.pluck=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return Object.keys(t).filter((function(t){return~r.indexOf(t)})).reduce((function(r,i){var n;return e.merge(r,((n={})[i]=t[i],n))}),{})},e.downcase=function(t){return(t||"").toString().toLowerCase()},e.remove=function(t,e){var r=t.lastIndexOf(e);return~r&&t.splice(r,1),t}})),Ve=He((function(t,e){var r=Be&&Be.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),i=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=Be&&Be.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};e.__esModule=!0;var s=n(je),a=function(){function t(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return t.of=function(){return new t},t.is_empty=function(t){return 0==t.pending.length},t.is_high_water=function(e){return e.open.length==t.MAX_OPEN_REQUESTS},t.maybe_spawn_req=function(e){if(t.is_empty(e))return e;if(t.is_high_water(e))return e;try{var r=t.lpop(e);r&&t.request(e,r)}catch(t){}},t.increment_failures=function(e){return e.stats.failures++,e.stats.failures>t.MAX_FAILURE_COUNT&&(e.stats.ttl=Date.now()+t.REQUEST_TTL_MS),e},t.handle_error=function(e,r){t.rm(e,r),t.increment_failures(e)},t.request=function(e,r){var i=r[0],n=r[1],s=r[2];if(!(Date.now()<e.stats.ttl)){var a=new XMLHttpRequest;e.open.push(a),a.timeout=t.REQUEST_TIMEOUT_MS,a.ontimeout=function(){t.handle_error(e,a)},a.onerror=function(r){t.handle_error(e,a)},a.onreadystatechange=function(){a.readyState==XMLHttpRequest.DONE&&t.rm(e,a),Math.floor(a.status/100)},a.onload=function(){t.rm(e,a),e.stats.failures&&e.stats.failures--},a.open(n,i),a.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{a.send(JSON.stringify(s))}catch(t){}}},t.rpush=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return r.forEach((function(r){e.pending.length>=t.MAX_PENDING||(e.pending.push(r),t.maybe_spawn_req(e))})),e},t.lpop=function(t){return t.pending.shift()},t.rm=function(t,e){return s.remove(t.open,e),t},t.MAX_OPEN_REQUESTS=3,t.MAX_PENDING=5,t.REQUEST_TIMEOUT_MS=4e3,t.REQUEST_TTL_MS=5e3,t.MAX_FAILURE_COUNT=3,t}();e.default=a})),Ke=He((function(t,e){var r=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var i=r(Ve);e.default=i.default.of()})),qe=He((function(t,e){e.__esModule=!0,e.prepare_url=e.URL_PARAM=void 0,e.URL_PARAM=/:([a-zA-Z_]+)/g,e.prepare_url=function(t,r){return t.url.replace(e.URL_PARAM,(function(e){if((e=e.slice(1,e.length))in r)return r[e].toString();t.log.error(new Error("\n preparing url["+t.url+"] failed\n \n parameter["+e+"] not detected in params:\n \n "+JSON.stringify(r,null,2)+"\n "))}))}})),We=He((function(t,e){e.__esModule=!0,e.Log=void 0;var r=function(){function t(t){this.emitter=t}return t.prepare=function(t,e){var r=document.createEvent("Event");return r.initEvent(t,!1,!0),r.ns=t,r.data=e,r},t.of=function(e){return new t(e)},t.prototype.info=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.INFO,e))},t.prototype.error=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.ERROR,e))},t.prototype.warn=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.WARN,e))},t.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},t}();e.Log=r})),ze=He((function(t,e){var r;e.__esModule=!0,e.Verb=void 0,(r=e.Verb||(e.Verb={})).POST="POST",r.PUT="PUT",r.GET="GET"})),Ye=He((function(t,e){var r=Be&&Be.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),i=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=Be&&Be.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=Be&&Be.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,n++)i[n]=s[a];return i},a=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var o=a(Ke),l=a(Ve),d=n(qe),u=n(je),c=function(){function t(e,r){var i=this;void 0===r&&(r={});var n=this;if(this.emitter=e,this.url=r.url,this.log=We.Log.of(this.emitter),this.verb=r.verb,this.metadata=u.merge({},r.metadata||{}),this.rq=r.rq||o.default,this.events=r.events||[],this.required_keys=r.required_keys||[],this.optional_keys=r.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),t.assert_emitter_api(this.emitter),void 0===t.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");t.TRACKERS.push(this),n.events.forEach((function(e){t.create_listener(i,e,(function(r){void 0===r&&(r={});var s=u.merge(n.metadata,{event_type:e},r.data||r),a=d.prepare_url(n,s),o=t.pluck_valid_keys(n,s),c=t.ensure_required_keys(n,o);if(c.length)return n.log.error("Tracker.validate_metadata() failed for \n Event["+e+"]\n missing keys: "+c+"\n payload:\n "+JSON.stringify(o,null,2));l.default.rpush(i.rq,[a,i.verb,o])}))}))}return t.of=function(e,r){return new t(e,r)},t.ensure_required_keys=function(t,e){return t.required_keys.filter((function(t){return!(t in e)}))},t.pluck_valid_keys=function(t,e){return u.pluck.apply(u,s([e],t.valid_keys))},t.merge_metadata=function(e,r){return void 0===r&&(r={}),e.metadata=t.pluck_valid_keys(e,u.merge(e.metadata,r)),e},t.assert_emitter_api=function(t){if("function"!=typeof(t||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(t||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},t.create_listener=function(t,e,r){t.listeners.push([e,r]),t.emitter.addEventListener(e,r)},t.prototype.destroy=function(){var e=this;this.listeners.forEach((function(t){var r=t[0],i=t[1];return e.emitter.removeEventListener(r,i)})),delete this.rq,delete this.emitter,u.remove(t.TRACKERS,this)},t.prototype.put=function(e){return void 0===e&&(e={}),t.merge_metadata(this,e),this},t.TRACKERS=[],t.QUEUE=o.default,t.verb=ze.Verb,t}();e.default=c})),Xe=He((function(t,e){var r=Be&&Be.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),i=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=Be&&Be.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.API=e.Tracker=void 0;var a=s(Ye);e.Tracker=a.default;var o=n(qe);e.API=o})),Qe="ping",$e="display",Ze="view";const Je=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],tr=["created","position"],er=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function rr(t,e){return t.duration/1===t.duration&&Object.assign(e,function(t){const e=t/100;return{segment_duration:e,breakpoints:Array(...Array(100)).map((function(t,r){return Math.floor(r*e*1e3)/1e3}))}}(t.duration))}function ir(t,e,r){if(!e.segment_duration&&!rr(t,e))return;const i=function(t,e,r){const i=e.last_idx,n=r?99:nr(t,e);return e.last_idx=n,n<=i?[]:e.breakpoints.slice(i,99==n?100:n).map((function(t){return e.breakpoints.indexOf(t)}))}(t,e,r);0!=i.length&&t.emit(Qe,{position:i})}function nr(t,e){return Math.min(Math.floor(t.currentTime/e.segment_duration),99)}function sr(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(t){return!1}}const ar="vod",or="live",lr=[$e,Qe,Ze];function dr(t,e,r){switch(null==e?void 0:e.kind){case"live":return function(t,e){const r=Date.now();r-e.last_tracked_ts<6e4||(e.last_tracked_ts=r,++e.ticks,t.emit(Qe,{position:60*e.ticks}))}(t,e);case"vod":return ir(t,e,"boolean"==typeof r&&r)}}function ur(t){const e=t.ads;return void 0!==e&&(void 0!==e.schedule&&("function"==typeof e.hasPreroll&&(e.currentRequests?e.currentRequests:!!e.adPlaying||!(!e.hasPreroll()||0!=e.nextIndex))))}class Analytics$1{init(t,e,r){if(!ye.from_token(t.token||"").is_granted(ye.permissions.ANALYTICS))return;if(r.hasState("consent-no-tracking"))return;if(r.analytics)return;const i=r.analytics={ticker:void 0,last_media_id:"",ended:!1},n={locked:!1,ttl:6e3,task:()=>{dr(r,i.ticker)}};const s={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:t.player_id,customer_user_id:t.customer_user_id,player_version:"3.7.1-rc.2"},a=Xe.Tracker.of(r,{verb:Xe.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:lr,required_keys:Je,optional_keys:er.concat(tr).slice(0),metadata:s});r.on(w,(function(){a&&a.destroy()})),r.on(D,(function(e){if(!a)return;const n=Kt(e,"data.metadata",{});if(!n.media_id)return;const s=Kt(a,"metadata.media_id");if(s&&n.media_id==s)return;const o=Kt(t,"analytics",{});a.put(n),a.put(o);const l=Kt(t,"metadata.live_start_time",t.live)?or:ar;a.put({video_type:l,source:t.source||sr()||""}),i.ticker=t.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},i.ended=!1,r.emit($e)}));let o=0;r.on(E,(function(){if(!a)return;if(o||function(t,e){return t.metadata.media_id&&t.metadata.media_id==e.last_media_id}(a,i))return;a.put({muted:r.muted});const t=ur(r);if(t)return o=Promise.resolve(t).then((function(){i.last_media_id=a.metadata.media_id,r.emit(Ze),o=0})).catch((function(){o=0}));i.last_media_id=a.metadata.media_id,r.emit(Ze)})),r.on("timeupdate",(function(){var e;a&&(o||ur(r)||i.ended||(!t.live&&r.currentTime+.25>=r.duration&&dr(r,i.ticker,!0),(e=n).locked||(e.locked=setTimeout((function(){return e.task(),function(t){return t.locked=!1,t}(e)}),e.ttl))))})),r.on(b,(function(){a&&i.ticker&&"vod"==i.ticker.kind&&function(t,e){rr(t,e),e.last_idx=nr(t,e)}(r,i.ticker)})),r.on(S,(function(){a&&function(t,e){e.ended||(e.ended=!0,dr(t,e.ticker))}(r,i)}))}}var cr;function hr(t){switch(t){case cr.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case cr.MEDIA_ERR_NETWORK:return"a network error occurred";case cr.MEDIA_ERR_DECODE:return"unable to decode media content";case cr.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case cr.NO_INTERNET:return"no internet connection detected";case cr.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function fr(){}function pr(){return"https:"===location.protocol}function gr(t){const e=document.createElement("a");return e.href=t,e}function vr(t){try{return!!new URL(t)}catch(t){return!1}}ue(ce(),Analytics$1),"undefined"!=typeof window&&window.matchMedia&&[R,I].forEach((function(t){window.matchMedia("(orientation: "+t+")").addListener((function(r){e.length&&e.forEach((function(e){r.matches&&e.emit(t)}))}))})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",t[t.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",t[t.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",t[t.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",t[t.MIXED_CONTENT=1001]="MIXED_CONTENT",t[t.NO_INTERNET=1002]="NO_INTERNET"}(cr||(cr={}));function mr(t,e){if(e.message)return e.message;if(e.stack)return e.stack;const r=e.code||-1,i=hr(r);return t.i18n("media_errors."+r,i)}const yr=()=>!0===(navigator||{}).onLine;function Er(t,e,r){const n=r.togglePlay;r.on(i,(function(t){const e=t.data||r.error,s="Error: %s\n"+(null===(a=(new Error).stack)||void 0===a?void 0:a.split("\n").slice(2).join("\n"));var a;setTimeout((function(){const a=Ht(r,C);if(t.defaultPrevented||!a||r.root.querySelector("#qul_error"))return;if("AbortError"==e.name)return;r.setState("is-error",!0),r.togglePlay=fr;const o=function(t,e){return{code:"http:0"===e.code?_r(t):e.code,message:mr(t,e)}}(r,e);console.error(s,o.message);let l=Ht(r,"flowplayer-error");l||(l=_t(r,"flowplayer-error"),a.append(l)),te(l,i,{data:e,formatted_data:o}),r.once(m,()=>{Tr(r,n)})}))})),r.on(L,()=>Tr(r,n))}function Tr(t,e){const r=Ht(t,"flowplayer-error");t.togglePlay=e,t.opt("retry")&&t.setState(at,!0),t.setState("is-error",!1),null==r||r.remove()}function _r(t){return function(t){try{return pr()&&"http:"==gr(t).protocol}catch(t){return!1}}(t.original_src)?{code:cr.MIXED_CONTENT}:yr()?{code:cr.MEDIA_ERR_NETWORK}:yr()?{code:cr.UNKNOWN}:{code:cr.NO_INTERNET}}var Sr=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384,LOGO_ON_BOTTOM:32768});function br(t,e,r){let i=()=>document.fullscreenElement,n="fullscreenchange";if(!Element.prototype.requestFullscreen){const t=Element.prototype,e=document;t.webkitRequestFullScreen&&(t.requestFullscreen=t.webkitRequestFullScreen,e.fullscreenEnabled=!0),e.webkitCancelFullScreen&&(document.exitFullscreen=e.webkitCancelFullScreen),n="webkit"+n,i=()=>e.webkitCurrentFullScreenElement}const a=()=>r.getFullsceenTarget?r.getFullsceenTarget():e;r.toggleFullScreen=function(t,e){if(r.ios_fullscreen_disabled)return;if("boolean"!=typeof t&&(t=!r.hasState("is-fullscreen")),Ar(r)&&(t?function(t){t.getAttribute("playsinline")&&t.removeAttribute("playsinline");t.getAttribute("webkit-playsinline")&&t.removeAttribute("webkit-playsinline");t.webkitEnterFullScreen()}(r):function(t,e){t.getAttribute("playsinline")||t.setAttribute("playsinline","");t.getAttribute("webkit-playsinline")||t.setAttribute("webkit-playsinline","");e||t.webkitExitFullScreen();t.togglePlay(!1),t.hasState(ct)||t.setState(ct,!0)}(r,e)),!document.fullscreenEnabled)return;const n=a();if(t)return n.requestFullscreen();i()===n&&document.exitFullscreen()},Ar(r)&&(r.ios_fullscreen_disabled=!0,r.once("beforeplay",(function(){r.ios_fullscreen_disabled=!1})),r.on("webkitendfullscreen",(function(){r.toggleFullScreen(!1,!0)}))),setTimeout(()=>{const t=a();t.addEventListener(n,(function(){const e=i(),n=e===t||e==r;r.emit(n?h:f),r.setState("is-fullscreen",n)}))},0),!1!==t.doubleclick&&e.addEventListener(s,(function(t){var e;t.target&&(null===(e=t.target)||void 0===e?void 0:e.classList.contains("fp-ui"))&&r.toggleFullScreen()}))}function Ar(t){return r().ios&&"function"==typeof t.webkitEnterFullScreen&&"function"==typeof t.webkitExitFullScreen}function Lr(t,e){const r=t.seekable;if("object"!=typeof t.opts||0==r.length)return{head:0,tail:0};const i=Rr(t),n=e||t.live_state.dvr_window;return{head:i,tail:"number"!=typeof n||i-n<0?r.start(0):i-n}}function wr(t){return t.opt("live",!1)||t.duration>=Number.MAX_SAFE_INTEGER}function Dr(t){return isFinite(t.duration)?t.duration:0==t.seekable.length?0:Lr(t).head}function Rr(t){var e;const r=t.seekable;return r.length?t.hasState("is-chromecast-playing")||!(null===(e=t.hls)||void 0===e?void 0:e.liveSyncPosition)?r.end(r.length-1):t.hls.liveSyncPosition:0}function Ir(t,e,r){if(!r.reaper)return;const i=document.createDocumentFragment(),n=_t(r,C),s=_t(r,P);e.append(s),i.append(n),r.reaper.set("ui",n),~e.className.indexOf("use-play-")||e.classList.add("use-play-1"),function(t,e,r){const i=Vt("fp-footer");e.append(i),r.on(D,(function(t){var e,r;const n=null===(e=t.data)||void 0===e?void 0:e.description,s=null===(r=t.data)||void 0===r?void 0:r.title;if(i.innerHTML="","string"==typeof s){const t=Vt("fp-title");t.innerText=s,i.append(t)}if("string"==typeof n){const t=n.split(" "),e=Vt("fp-desc");for(e.innerText=t.join(" "),i.append(e);t.length>1&&e.scrollHeight>e.offsetHeight;)t.pop(),e.innerText=t.join(" ")+"..."}}))}(0,e,r),Er(0,0,r),e.appendChild(i),[o,l].forEach(t=>{e.addEventListener(t,(function(t){r.setState("is-hovered",t.type==o),r.setState("is-accessibility",!1)}))}),br(t,e,r),r.on("volumechange",(function(){const t=0==r.volume||r.muted;r.setState("is-muted",t),r._storage.setItem("mute",t.toString())})),"true"==r._storage.getItem("mute")&&(r.muted=!0,r.setState("is-muted",r.muted));const a=r._storage.getItem("volume");a&&!isNaN(Number(a))&&(r.volume=Number(a)),r.emit("volumechange"),r.on("dvr/window",e=>{t.live&&(r.live_state.dvr=r.seekable.length>0&&function(t,e,r){if(0==e)return!0;const i=Lr(t,r);return i.head-i.tail>=e}(r,t.seconds_to_dvr||60,e.detail),r.live_state.dvr_window=e.detail)}),r.on("live",()=>{const t=setInterval(()=>{if(r.opts.live&&!r.hasState("is-error")&&0!=r.reaper||(r.setState(st,!1),clearInterval(t)),0==r.seekable.length)return;const e=function(t){const e=t.currentTime,r=Lr(t);return{progress:Math.min(100,Math.max(0,(e-r.tail)/(r.head-r.tail)*100)),is_live:e-r.head>=-10}}(r);r.hasState(ot)==e.is_live&&r.setState(ot,!e.is_live),r.live_state.dvr&&r.emit("dvr",e.progress)},200)}),r.on(p,(function(){r.setOpts({live:wr(r)})})),r.on("durationchange",(function(t){const e=wr(r),i=e?Dr(r):t.data||r.duration;isNaN(i)||r.setOpts({live:e,duration:i})})),r.on(["playlist/advance","src"],e=>{if(r.root.classList.contains("is-livecountdown"))return kr(r,t);r.currentSrc&&("src"===e.type&&["is-playlist",ft].some(t=>r.root.classList.contains(t))||kr(r,t))}),r.on(D,(function(r){var i,n;t.seekable=void 0===(null===(i=null==r?void 0:r.data)||void 0===i?void 0:i.seekable)||r.data.seekable;const s=null===(n=r.data)||void 0===n?void 0:n.ui;if("number"!=typeof s)return;const a=e.classList;a.toggle("use-play-1",!(32&s||64&s)),a.toggle("use-play-2",(32&s)>0),a.toggle("use-play-3",(64&s)>0),a.toggle("use-thin-controlbar",(128&s)>0),a.toggle("no-title",(256&s)>0),a.toggle("no-description",(512&s)>0),a.toggle("logo-on-right",(8&s)>0),a.toggle("logo-on-bottom",(32768&s)>0),a.toggle("use-drag-handle",(16&s)>0),a.toggle("no-controls",(1024&s)>0),a.toggle("no-duration",(2048&s)>0),a.toggle("no-header",(4096&s)>0),a.toggle("no-mute",(4&s)>0),a.toggle("no-volume",(2&s)>0),a.toggle("no-fullscreen",(1&s)>0),a.toggle("no-touch-zones",(16384&s)>0)}));let c=null;[d,u].forEach(t=>n.addEventListener(t,(function(t){r.hasState("is-touch-device")&&t.type===d||("number"==typeof c&&clearTimeout(c),r.setState("is-hovered",!0),c=0==r.paused&&setTimeout((function(){r.setState("is-hovered",!1)}),2e3))})))}function kr(t,e){delete e.live_start_time,t.setOpts({live:!1}),t.live_state.dvr=void 0,t.live_state.dvr_window=void 0,delete e.live,delete e.poster,delete e.duration,delete e.title,delete e.description}function Or(t,e,r){if(ye.from_token(t.token||"").is_granted(ye.permissions.NO_METERING))return;ge.id(t.token||"")&&r.once(E,async()=>await async function t(e,r){const i=ge.id(r||"");e.once("src",()=>{e.once(E,()=>t(e,r))}),function(t,e){if(!function(t){return ye.from_token(t).is_granted(ye.permissions.WOWZA_VIDEO)}(e))return;if(function(t){try{return new URL(t).hostname.endsWith(".wowza.com")}catch(t){return!1}}(t.original_src))return;t.emit("error:fatal",{reason:"token",details:"This token only allows wowza video sources"})}(e,r);if(401==(await fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:i,factor:1,rnd:Math.random().toString(36).substring(2)})})).status)return e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})}(r,t.token||""))}var Cr={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class I18n{init(t,e,r){r.reaper&&r.reaper.set("translations",Yt(I18n,t,"en"))}}I18n.en=Cr;const Pr="health:record",xr="rebuffer";var Mr=Object.freeze({__proto__:null,RECORD:Pr,REBUFFER:xr,DISPLAY:"display"});const Nr=navigator;function Fr(t){var e,r;const i=null===(e=t.hls)||void 0===e?void 0:e.bandwidthEstimate;return i?1e-6*i:(null===(r=Nr.connection)||void 0===r?void 0:r.downlink)||-1}function Ur(t,e){return async function(t,e){try{await fetch(t,{body:e,method:"POST",mode:"no-cors"})}catch(t){}}(t,JSON.stringify({events:e}))}const Br="https://ljsp.lwcdn.com".concat("/web/public/countdown/time.json"),Gr=window,Hr=Gr._flowplayerTimekeeper||(Gr._flowplayerTimekeeper={});async function jr(){const t=Hr.cachedServerOffset;if(t)return t;const e=Hr.pendingRequest||(Hr.pendingRequest=fetch(Br)),r=await e,i=parseInt(r.headers.get("age")||"0"),n=await r.json(),s=Date.now()-n.millisUtc-1e3*i;return Hr.cachedServerOffset=s,Hr.cachedServerOffset}const Vr=t=>{switch(t){case!0:return At.ON;case!1:return At.OFF;default:return t}},Kr=[],qr="https://ihi.flowplayer.com/v1/health/events";function Wr(t){if(t.suspended)return;const e=Kr.slice(0);Kr.length=0,0!=e.length&&(t.logger.log(`:dispatch events={${e.length}}`),Ur(function(){try{return"undefined"==typeof window?qr:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:qr}catch(t){return qr}}(),e))}async function zr(t,e,r){const i=await Xr();Kr.push(Object.assign(e,i)),t.logger.log(":enqueue",e.event,e),Kr.length<10&&!r||Wr(t)}const Yr=()=>{var t,e;try{const r=window;return null===(e=null===(t=null==r?void 0:r.google)||void 0===t?void 0:t.ima)||void 0===e?void 0:e.VERSION}catch(t){return}},Xr=async()=>{const t=Date.now();try{return{adjusted_time:t-await jr(),client_time:t}}catch(e){return{client_time:t}}},Qr=(t,e)=>Object.assign(t,{detail:e}),$r=(t,{event:e,media_session_id:r,session_id:i})=>({event:e,media_session_id:r,session_id:i,device_id:t.deviceId(),version:"3.7.1-rc.2",commit:"608a8f70481e079d9229495e9578aa329c8772b8",ima_sdk_version:Yr(),preload:t.opt("preload"),autoplay:Vr(t.opt("autoplay")),live:t.opt("live"),dvr:!!t.live_state.dvr,source:t.original_src,downlink_mbs:Fr(t),page_url:sr(),player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token,plugins:t.plugins.map(t=>t.constructor.name).sort((t,e)=>t.localeCompare(e)),current_time:t.currentTime,external_media_id:t.opt("external_media_id")}),Zr=t=>({bitrate:null==t?void 0:t.bitrate,resolution:null==t?void 0:t.attrs.RESOLUTION,frame_rate:null==t?void 0:t.attrs["FRAME-RATE"]});function Jr(t,e,r,i){const n=$r(e,t.eventInfo(r)),{before:s,after:a}=i;zr(t,((t,e,r)=>Object.assign(t,{state:{before:e,after:r}}))(n,Zr(s),Zr(a)))}const ti=(t,e)=>{let r=null;return(...i)=>{null!==r&&(clearTimeout(r),r=null),r=setTimeout(()=>e(...i),t)}},ei=Qt();class Health{constructor(t,e){this.session_id=ei,this.suspended=!1,this.logger=Pe("health",e.opts),this.media_session_id=Qt(),this.analyticsLoop=setInterval(()=>Wr(this),2e3),e.on(w,()=>clearInterval(this.analyticsLoop));const r=this;if(e.health={get media_session_id(){return r.media_session_id},set media_session_id(t){r.media_session_id=t},get session_id(){return r.session_id},set session_id(t){r.session_id=t},toggle(t){t?r.resume():r.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const e=e=>t.instances.forEach(t=>t.emit(e.type));document.addEventListener("visibilitychange",t=>{"hidden"==document.visibilityState&&e(t)}),window.addEventListener("pagehide",e)}}eventInfo(t){return{event:t,media_session_id:this.media_session_id,session_id:this.session_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>Wr(this),2e3)}init(t,e,r){!function(t){t.on(T,(function(e){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit(xr)}))}(r),r.on("display",t=>{zr(this,$r(r,this.eventInfo(t.type)),!0)}),r.on(Pr,({detail:t})=>{const e=$r(r,this.eventInfo(t.event));Object.assign(e,t.detail||{}),zr(this,e)}),[_,m,a,p,g,v,T,xr].forEach(t=>{r.on(t,t=>{zr(this,$r(r,this.eventInfo(t.type)))})}),[E,y,A,b,S,h,f].forEach(t=>{r.on(t,t=>{zr(this,$r(r,this.eventInfo(t.type)))})}),r.on("volumechange",ti(800,t=>{const e=$r(r,this.eventInfo(t.type));zr(this,Qr(e,{volume:parseFloat(r.volume.toFixed(2)),muted:r.muted}))})),r.on("resize",ti(800,t=>{const i=$r(r,this.eventInfo(t.type));zr(this,Qr(i,{height:e.clientHeight,width:e.clientWidth}))})),r.on("hls/failover",t=>{const e=$r(r,this.eventInfo(t.type)),i=t.detail,{reason:n,from:s}=i;zr(this,Qr(e,{reason:n,from:s}))}),r.on("qualitychange",({type:t,detail:e})=>{switch(e.kind){case"hls":return Jr(this,r,t,e)}});let n=Date.now()+5e3;r.on("timeupdate",t=>{if(Date.now()<n)return;n=Date.now()+5e3;const e=$r(r,this.eventInfo(t.type));var i;zr(this,Qr(e,{duration:(i=r.duration,Number.isFinite(i)?i:i===1/0?-1:void 0)}))}),r.addEventListener(i,t=>{const e=$r(r,this.eventInfo(t.type)),i=t.error||r.error;if(!i)return zr(this,e,!0);const n=i.code,s={error_message:i.message||hr(n),error_code:n,error_stack:i.stack||""};return zr(this,Qr(e,s),!0)}),r.on("src",t=>{var e;const i=null===(e=t.detail)||void 0===e?void 0:e.src;if("string"!=typeof i)return;if(!vr(r.original_src))return;if(!vr(i))return;if(i==r.original_src)return;this.media_session_id=Qt();zr(this,$r(r,this.eventInfo(t.type))),Wr(this)}),r.on("visibilitychange",t=>{zr(this,$r(r,this.eventInfo(t.type))),Wr(this)})}}Health.events=Mr,Health._UNLOAD_SUBSCRIBED=!1,ue(window,Health);class FlowplayerComponent extends HTMLElement{constructor(t){super(),this.player=t}}class FlowplayerLogo extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-logo");const e={logo:""};t.on(D,t=>{var r;const i=e.logo,n=(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.logo)||"";i!=n&&(e.logo=n,this.set_logo(n,t.detail.logo_alt_text,t.detail.logo_href))})}set_logo(t,e,r){this.innerHTML="";const i=document.createElement("img");if(!t)return;if(i.src=t,e&&(i.alt=e),!r)return this.append(i);const n=document.createElement("a");n.href=r,n.append(i),this.append(n)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-duration"),t.on(D,t=>{var e;const r=(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.duration)||NaN;this.innerText=isFinite(r)?Wt(r):""})}}const ri={name:"fp-fullscreen",translation_key:"core.fullscreen"},ii={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},ni={name:"fp-play",translation_key:"core.play"},si={name:"fp-pause",translation_key:"core.pause"},ai={translation_key:"core.mute",name:"fp-volume-mute-unmute"},oi={translation_key:"core.play",name:"fp-small-play"},li={translation_key:"core.pause",name:"fp-small-pause"},di={name:"fp-fast-forward"},ui={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(t,e){super(t),this.classList.add("fp-icon",e.name),e.title&&this.setAttribute("title",e.title),e.title&&this.setAttribute("aria-label",e.title),e.translation_key&&this.setAttribute("aria-label",t.i18n(e.translation_key)),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(n,(function(t){this.active_menu&&!t.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(t=>{var e;const r=t.root.querySelector("details[open].fp-menu-container");r&&(r.open=!1,null===(e=r.querySelector("summary"))||void 0===e||e.removeAttribute("aria-expanded"),t.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const ci={passive:!0};var hi;function fi(t,e){let r=0,i=-1,n=-1;const s=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),a=t.classList;t.id=s,a.remove(hi.GRABBING),a.remove(hi.TOUCHING);const o=e.onseek||fr,l=e.onstart||fr,h=e.onend||fr,f=e.onmouse||fr,p=e.ontouch||fr,g=e.ontouchend||fr;function v(e){!function(){const e=t.getBoundingClientRect();r=e.left,i=e.width}();let n=(function(t){return"function"==typeof window.TouchEvent&&t instanceof TouchEvent}(e)?e.changedTouches[0].pageX:e.pageX)-r;return n>i&&(n=i),n<0&&(n=0),n/i*100}function m(e){const r=v(e);r!=n&&(o(t,r),n=r)}return t.addEventListener("touchstart",(function(e){pi(t,e)&&(a.add(hi.TOUCHING),gi(t.parentElement)&&(a.add(hi.GRABBING),p(t,v(e)),l(t,v(e)),m(e)))}),ci),t.addEventListener(u,(function(e){m(e),f(t,v(e))}),ci),t.addEventListener(c,(function(e){setTimeout((function(){a.remove(hi.TOUCHING)}),500),pi(t,e)&&(a.remove(hi.GRABBING),g(t,v(e)),h(t,v(e)),i=0)}),ci),t.addEventListener("touchcancel",(function(){a.remove(hi.GRABBING,hi.TOUCHING),i=0}),ci),t.addEventListener("mousedown",(function(e){a.contains(hi.TOUCHING)||(document.addEventListener(d,m),a.add(hi.GRABBING),l(t,v(e)),e.preventDefault(),m(e))})),t.addEventListener(d,(function(e){a.contains(hi.TOUCHING)||f(t,v(e))})),document.addEventListener("mouseup",(function(e){a.contains(hi.TOUCHING)||(document.removeEventListener(d,m),a.contains(hi.GRABBING)&&(a.remove(hi.GRABBING),h(t,v(e)),i=0))})),t}function pi(t,e){const r=e.target;return!!r&&(r&&!r.closest(t.id)||!gi(t.parentElement)||!t.classList.contains(hi.TOUCHING))}function gi(t){if(!t)return!1;const e=window.getComputedStyle(t);return"0"!==e.width&&"0"!==e.height&&"0"!==e.opacity&&"none"!==e.display&&"hidden"!==e.visibility}!function(t){t.GRABBING="has-grab",t.TOUCHING="has-touch"}(hi||(hi={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(t){super(t),this.className="fp-volume";const e=t.root.classList,r=e.contains("is-tiny")?6:e.contains("is-small")?8:10,i=Array.from({length:r}).map(()=>{const t=document.createElement("i");return t.className="fp-tick",t});this.append(...i),fi(this,{onseek:(e,r)=>{r>0&&(t.muted=!1,t._storage.removeItem("mute")),t._storage.setItem("volume",(t.volume=r/100).toString()),this.adjustVolumeSlider(t.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",t.i18n("core.volume","volume")),t.on("volumechange",()=>{const e=0==t.volume||t.muted;e&&this.adjustVolumeSlider(0);const r=t.opt("ui");this.classList.contains(hi.GRABBING)||e&&"number"==typeof r&&(4&r)>0||this.adjustVolumeSlider(t.volume)})}adjustVolumeSlider(t){this.setAttribute("aria-valuenow",t.toString()),this.setAttribute("aria-valuetext",Math.round(100*t)+"%");const e=Array.from(this.querySelectorAll(".fp-tick")),r=Math.round(t*e.length);e.forEach((t,e)=>{t.classList.toggle("fp-color",e<r)})}}function vi(t,e){if(!t.parentElement)return;const r=t.clientWidth/t.parentElement.clientWidth*100/2;t.style.left=e-r+"%",t.style.display="block"}function mi(t,e){if(isNaN(t.duration))return;const r=t.buffered;r.length&&(e.style.width=Math.min(r.end(r.length-1)/t.duration*100,100)+"%")}function yi(t,e){t.style.width="0",e.style.display="none"}function Ei(t,e,r){if(!e.seekable||0==e.seekable.length)return;vi(r,t);const i=Lr(e),n=(100-Math.max(0,Math.min(t,100)))/100*(i.head-i.tail);r.innerText="-"+Wt(n)}function Ti(t){try{t.dvr_offset=0,t.currentTime=Rr(t)}catch(t){console.warn("failed to seek to now: %j",t)}}function _i(t,e){t/=100,e.currentTime=function(t,e){if(e>1||e<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;const r=Lr(t);return r.tail+e*(r.head-r.tail)}(e,t)}function Si(t,e){t.style.width="0",e.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(t){let e;super(t),this.bufferEle=Vt("fp-buffer"),this.progress=Vt("fp-progress","fp-color"),this.tooltipEle=Vt("fp-timestamp"),this.proposedSeekBar=Vt("fp-hover"),this.dragger=Vt("fp-dragger","fp-color"),this.classList.add("fp-timeline","fp-bar"),this.tooltipEle.style.display="none",this.setAttribute("role","slider"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",t.i18n("timeline","Timeline")),this.setAttribute("aria-valuenow","0"),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);const r=requestAnimationFrame;let i=void 0;const n=()=>{0==t.reaper||e.live||(!function(t,e){e.style.width=t.currentTime/t.duration*100+"%"}(t,this.progress),i=void 0,t.paused||this.classList.contains(hi.GRABBING)||i||(i=setTimeout(n,200)))},s=()=>!!this.player.opt("seekable",!0)&&!isNaN(this.player.duration);fi(this,{onseek:(r,i)=>{if(s())switch(!!e.live){case!0:Ei(i,t,this.tooltipEle);break;case!1:!function(t,e,r){const i=e.duration*(t/100);if(e.disabled&&i>e.currentTime)return!1;r.style.width=t+"%",e.currentTime=i}(i,t,this.progress),vi(this.tooltipEle,i)}},onstart:()=>{s()&&(t.emit("timeline/gesture/start"),!t.hasState("is-casting")&&t.setState(it,!0),e.live||function(t){t.style.display="block"}(this.tooltipEle))},onend:function(i,s){r(n),0!=e.seekable&&e.live&&_i(s,t)},ontouchend:()=>{e.live?Si(this.proposedSeekBar,this.tooltipEle):yi(this.proposedSeekBar,this.tooltipEle),setTimeout(()=>t.emit("timeline/gesture/end"),0)},onmouse:(r,i)=>{if(s()&&(t.emit("timeline/gesture/move",{percent:i}),!this.classList.contains(hi.GRABBING)))switch(!!e.live){case!0:!function(t,e){e.style.width=t+"%"}(i,this.proposedSeekBar),Ei(i,t,this.tooltipEle);break;case!1:!function(t,e){e.style.width=t+"%"}(i,this.proposedSeekBar),function(t,e,r){if(isNaN(t)||isNaN(e.duration))return;vi(r,t),r.innerHTML="";const i=document.createElement("span");i.innerText=Wt(t/100*e.duration),r.append(i)}(i,t,this.tooltipEle)}}}),t.on(D,(function(t){t.data&&(e=t.data)})),t.on(E,()=>r(n)),t.on(v,()=>{0==t.reaper||e.live||mi(t,this.bufferEle)}),t.on("dvr",t=>{this.progress.style.width=t.detail+"%"}),t.on("timeupdate",()=>{0!=t.reaper&&(r(n),this.setAttribute("aria-valuenow",t.currentTime+""),this.setAttribute("aria-valuetext",Math.round(t.currentTime)+t.i18n("core.sec","sec")),e.live||mi(t,this.bufferEle))}),t.on(p,()=>{0!=t.reaper&&(e.live||mi(t,this.bufferEle))}),t.on("durationchange",e=>{if(0==t.reaper)return;const r=wr(t)?Dr(t):e.data||t.duration;isNaN(r)||(this.setAttribute("aria-valuemax",r+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(l,()=>{t.emit("timeline/gesture/end"),e.live?Si(this.proposedSeekBar,this.tooltipEle):yi(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(t){super(t),this.handleChapters(t)}handleChapters(t){const e=document.createElement("div");let r;this.addEventListener("chapters:new",t=>{e.innerText="",this.querySelectorAll(".fp-chapter").forEach(t=>this.removeChild(t)),t.data&&t.data.forEach(t=>{const i=document.createElement("div");i.className="fp-chapter",i.style.left=t.left,i.style.bottom=i.style.top="0",i.style.width=t.width,i.title=t.title,i.onmouseover=()=>{e.innerText=t.title},i.onmouseleave=()=>{e.innerText=r||""},this.appendChild(i)})}),this.addEventListener("chapter:changed",i=>{var n;const s=i.data;s&&(e.parentNode||(null===(n=Ht(t,x))||void 0===n||n.insertAdjacentElement("beforebegin",e),e.classList.toggle("fp-togglable",!0),e.classList.toggle("fp-chapter-info",!0)),r=s,e.innerText=s)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-live-status");const e=Vt("fp-live-text"),r=Vt("fp-live-indicator","fp-color");e.textContent="live",this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.append(r,e),this.addEventListener(n,(function(){Ti(t)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(t){let e;super(t),this.classList.add("fp-duration"),this.setAttribute("aria-hidden","true"),t.on(D,r=>{if(0==t.reaper||!r.data)return;e=r.data;const i=wr(t)?NaN:r.data.duration||0;if(isNaN(i)||i>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Wt(i)}),t.on(p,()=>{0==t.reaper||e.live||function(t,e){t.duration&&(e.innerText=Wt(t.duration))}(t,this)})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(t){let e;super(t),this.classList.add("fp-elapsed"),this.innerText=Wt(0),this.setAttribute("aria-hidden","true"),t.on(D,t=>{t.data&&(e=t.data)}),t.on("timeupdate",()=>{0!=t.reaper&&(e.live?function(t,e){e.innerText=Wt(t.currentTime)}(t,this):function(t,e){e.innerText=Wt(t.currentTime)}(t,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-btns","fp-small-switch");const e=_t(t,q),r=_t(t,K);e.addEventListener("click",(function(){t.togglePlay(),setTimeout((function(){r.focus&&r.focus()}),100)})),r.addEventListener("click",(function(){t.togglePlay(),setTimeout((function(){e.focus&&e.focus()}),100)})),this.append(e,r)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(t,e){super(t),this.classList.add(e);const r=this.classList.contains("fp-left-zone")?-1:1,i=document.createElement("span"),n=_t(t,this.classList.contains("fp-left-zone")?Y:"flowplayer-fast-forward-icon");n.removeAttribute("tabindex"),i.classList.add("fp-zone-seconds"),this.append(i,n);t.on(b,()=>{i.innerText=""}),t.on("seek:queued",t=>{const e=t.data;if(!e)return;if("number"!=typeof e.offset)return;const r=e.offset;if(0==r)return this.reset_zone();r>0&&this.classList.contains("fp-right-zone")||r<0&&!this.classList.contains("fp-right-zone")?this.render_zone_state(r):this.reset_zone()}),t.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener(c,(function(e){isNaN(t.duration)||isNaN(t.currentTime)||16384&t.opt("ui")||t.hasState(lt)||!t.hasState("will-seek")&&!t.hasState(ct)||t.enqueueSeek(5*r)&&(e.stopPropagation(),e.preventDefault())}))}reset_zone(){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText="")}render_zone_state(t){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText=Math.abs(t)+"")}}class FlowplayerError extends FlowplayerComponent{constructor(t){super(t),this.className="fp-error",this.message=document.createElement("p"),this.message.className="error-message",this.append(this.message),this.addEventListener("error",t=>{const e=t.detail;e&&(this.message.textContent=e.formatted_data.message)})}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(t,e,...r){super(t),this.className=e;const i=t.createComponents(...r);this.append(...i),"fp-left"!==e&&i.forEach(e=>{e.addEventListener(n,()=>t.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-wait"),Array(...Array(4)).map((t,e)=>e).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-middle-zone");const e=t.createComponents(V,"flowplayer-middle-buttons");this.append(...e)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-switch"),[W,z].forEach(e=>{const r=_t(t,e);r.removeAttribute("tabindex"),this.append(r)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-volume-control");const e=_t(t,X);this.append(e),!r().ios&&this.append(_t(t,U)),e instanceof FlowplayerIcon&&e.addEventListener(n,(function(){t.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-header"),this.append(...t.createComponents("flowplayer-header-left-zone",G)),t.reaper&&t.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-controls","fp-togglable"),this.append(...t.createComponents("flowplayer-control-buttons",M,N,F,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(t,e){super(t,e),this.setAttribute("role","button")}}class FlowplayerMiddle extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-middle"),this.append(...t.createComponents("flowplayer-middle-left-zone",j,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),t.reaper&&t.reaper.set("middle",this),this.handleClick(t),this.handleTouch(t),t.once("beforeplay",()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")})}handleClick(t){[n,s].forEach(e=>this.addEventListener(e,(function(r){if(!(r.defaultPrevented||t.root.classList.contains("is-endscreen")||e===s&&t.root.classList.contains("no-fullscreen")))return r.preventDefault(),t.emit(r.type),!1}))),t.on(n,(function(e){setTimeout((function(){e.defaultPrevented||t.togglePlay()}),0)})),t.on(s,(function(e){setTimeout((function(){e.defaultPrevented||t.toggleFullScreen()}),0)}))}handleTouch(t){let e=!1;this.addEventListener(c,(function(e){e.cancelable&&!t.hasState("is-endscreen")&&(e.preventDefault(),t.emit(e.type,{source:e}))})),t.on(c,(function(r){setTimeout((function(){if(r.defaultPrevented)return;if(t.ended)return t.togglePlay(!0);const i=t.hasState(rt);e&&clearTimeout(e),(i||t.hasState(ct)||t.hasState("no-autoplay"))&&(t.hasState(ct)&&(t.setState(ct,!1),t.setState("is-hovered",!1)),t.togglePlay(),i)||(t.setState(ct,!0),t.paused||(e=setTimeout((function(){e=!1,t.setState(ct,!1),t.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-ui"),this.append(...t.createComponents(B,H,x))}}Ue.extensions.unshift.apply(Ue.extensions,[I18n,Analytics$1,Health,class Default{constructor(t){St(t,C,FlowplayerUi),St(t,"flowplayer-error",FlowplayerError),St(t,x,FlowplayerControls),St(t,M,FlowplayerLiveStatus),St(t,"flowplayer-control-duration",FlowplayerDuration),St(t,F,t.extensions.find(t=>"Chapters"===t.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),St(t,N,FlowplayerElapsedTime),St(t,U,FlowplayerVolumeBar),St(t,"flowplayer-volume-control",FlowplayerVolumeControl),St(t,"flowplayer-control-buttons",FlowplayerControlButtons),St(t,B,FlowplayerHeader),St(t,P,FlowplayerLogo),St(t,"flowplayer-header-duration",FlowplayerHeaderDuration),St(t,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(t){super(t,"fp-left","flowplayer-header-duration")}}),St(t,G,class extends FlowplayerHeaderLeftRight{constructor(t){super(t,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),St(t,H,FlowplayerMiddle),St(t,j,FlowplayerMiddleZone),St(t,V,FlowplayerMiddleWait),St(t,"flowplayer-middle-buttons",FlowplayerMiddleButtons),St(t,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(t){super(t,"fp-right-zone")}}),St(t,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(t){super(t,"fp-left-zone")}}),St(t,K,class extends FlowplayerIcon{constructor(t){super(t,oi),this.setAttribute("role","button")}}),St(t,q,class extends FlowplayerIcon{constructor(t){super(t,li),this.setAttribute("role","button")}}),St(t,W,class extends FlowplayerIcon{constructor(t){super(t,ni),this.setAttribute("role","button")}}),St(t,z,class extends FlowplayerIcon{constructor(t){super(t,si),this.setAttribute("role","button")}}),St(t,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(t){super(t,ri)}}),St(t,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(t){super(t,ii)}}),St(t,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(t){super(t,di)}}),St(t,Y,class extends FlowplayerIcon{constructor(t){super(t,ui)}}),St(t,X,class extends FlowplayerIcon{constructor(t){super(t,ai),this.classList.add("fp-volumebtn"),this.setAttribute("role","switch"),t.on("volumechange",()=>{const e=0==t.volume||t.muted;this.setAttribute("aria-label",t.i18n("core.muted","Muted")),this.setAttribute("aria-checked",e?"true":"false")})}})}init(t,e,r){Or(t,0,r),Ir(t,e,r),function(t,e,r){"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}(0,0,r)}}]);var bi=Object.assign(Ue,{ui:Sr,i18n:I18n}),Ai=Ge(He((function(t,e){var r;"undefined"!=typeof window&&(r=()=>(()=>{var t={"./src/config.ts":
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).flowplayer=e()}(this,(function(){"use strict";const t=[],e=[];function r(){const t="undefined"!=typeof document&&"undefined"!=typeof window,e=t?navigator.userAgent:"",r=/iP(hone|od)/i.test(e)&&!/iPad/.test(e)&&!/IEMobile/i.test(e),i=/Android/.test(e)&&!/Firefox/.test(e),n=/^((?!chrome|android).)*safari/i.test(e),s=/SamsungBrowser/.test(e),a=s&&/SMART-TV/.test(e);return{controls:!r,video:function(e){return t&&document.createElement("video").canPlayType(e)},lang:t&&window.navigator.language,android:i,iphone:r,safari:n,ios:t&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:s,samsung_tv:s&&a,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const i="error",n="click",s="dblclick",a="load",o="mouseenter",l="mouseleave",d="mousemove",u="touchmove",c="touchend",h="fullscreenenter",f="fullscreenexit",p="loadedmetadata",g="loadeddata",v="progress",m="loadstart",y="pause",E="playing",T="waiting",_="canplay",S="ended",b="seeked",A="seeking",L="recover",w="reap",D="config",R="landscape",I="portrait",k="retry";var O=Object.freeze({__proto__:null,MOUNT:"mount",ERROR:i,CONTEXT_MENU:"contextmenu",CLICK:n,DBL_CLICK:s,KEYUP:"keyup",KEYDOWN:"keydown",LOAD:a,MOUSE_ENTER:o,MOUSE_LEAVE:l,MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:d,TOUCH_START:"touchstart",TOUCH_MOVE:u,TOUCH_END:c,TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:h,FULLSCREEN_EXIT:f,FULLSCREEN_CHANGE:"fullscreenchange",WEBKIT_NEEDKEY:"webkitneedkey",METADATA:p,DATA:g,PROGRESS:v,TIME_UPDATE:"timeupdate",LOAD_START:m,VOLUME_CHANGE:"volumechange",PAUSE:y,PLAYING:E,PLAY:"play",WAITING:T,CAN_PLAY:_,ENDED:S,SEEKED:b,SEEKING:A,DURATION_CHANGE:"durationchange",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",STATE:"state",CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",RECOVER:L,REAP:w,CONFIG:D,QUALITIES:"qualities",SET_QUALITY:"quality:set",NON_RECOVERABLE_ERROR:"error:fatal",RECOMMENDATIONS_READY:"recommendationsready",AUDIO_ONLY_SOURCE:"audioonlysource",LANDSCAPE:R,PORTRAIT:I,RENDER_PLUGIN:"renderplugin",DVR:"dvr",LIVE:"live",SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange",RETRY:k});const C="flowplayer-ui",P="flowplayer-logo",x="flowplayer-control",M="flowplayer-live-status",N="flowplayer-elapsed-time",F="flowplayer-timeline-bar",U="flowplayer-volume-bar",B="flowplayer-header",G="flowplayer-header-right-zone",H="flowplayer-middle",j="flowplayer-middle-zone",V="flowplayer-wait",K="flowplayer-small-play-icon",q="flowplayer-small-pause-icon",W="flowplayer-play-icon",z="flowplayer-pause-icon",Y="flowplayer-rewind-icon",X="flowplayer-volume-icon",Q="flowplayer-live-countdown";var $=Object.freeze({__proto__:null,SUBTITLES_MENU:"flowplayer-subtitles-menu",SHARE_MENU:"flowplayer-share-menu",SPEED_MENU:"flowplayer-speed-menu",QUALITY_MENU:"flowplayer-quality-menu",AUDIO_MENU:"flowplayer-audio-menu",UI:C,LOGO:P,CONTROL:x,CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:M,ELAPSED:N,TIMELINE:F,CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:U,HEADER:B,HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:G,HEADER_DURATION:"flowplayer-header-duration",MIDDLE:H,MIDDLE_ZONE:j,WAIT:V,MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",ENDSCREEN_INTERSTITIAL:"flowplayer-endscreen-interstitial",ENDSCREEN_UP_NEXT:"flowplayer-endscreen-up-next",ENDSCREEN_GRID:"flowplayer-endscreen-grid",PLAYLIST_INTERSTITIAL:"flowplayer-playlist-interstitial",AIRPLAY_ICON:"flowplayer-airplay-icon",CHROMECAST_ICON:"flowplayer-chromecast-icon",SMALL_PLAY_ICON:K,SMALL_PAUSE_ICON:q,PLAY_ICON:W,PAUSE_ICON:z,FULLSCREEN_ENTER_ICON:"flowplayer-fullscreen-enter-icon",FULLSCREEN_EXIT_ICON:"flowplayer-fullscreen-exit-icon",SKIP_NEXT_ICON:"flowplayer-skip-next-icon",SKIP_PREVIOUS_ICON:"flowplayer-skip-previous-icon",FAST_FORWARD_ICON:"flowplayer-fast-forward-icon",REWIND_ICON:Y,SHARE_ICON:"flowplayer-share-icon",VOLUME_ICON:X,MUTE_ICON:"flowplayer-mute-icon",UNMUTE_ICON:"flowplayer-unmute-icon",CLOSE_ICON:"flowplayer-close-icon",FACEBOOK_ICON:"flowplayer-facebook-icon",TWITTER_ICON:"flowplayer-twitter-icon",LINK_ICON:"flowplayer-link-icon",EMBED_ICON:"flowplayer-embed-icon",LIVE_COUNTDOWN:Q,PLAYLIST_CONTROLS:"flowplayer-playlist-controls",THUMBNAILS_CAROUSEL:"flowplayer-thumbnails-carousel",ERROR_COMPONENT:"flowplayer-error",TV_MENU:"flowplayer-tv-menu",CUE_COMPONENT:"flowplayer-cue"});const Z="is-playing",J="is-paused",tt="is-loaded",et="is-loading",rt="is-starting",it="is-seeking",nt="is-ended",st="is-live",at="is-waiting",ot="is-live-seeked",lt="no-timeline",dt="will-play",ut="will-pause",ct="is-touched",ht="is-in-viewport",ft="is-source-processing";var pt=Object.freeze({__proto__:null,PLAYING:Z,FULLSCREEN:"is-fullscreen",PAUSED:J,MUTED:"is-muted",LOADED:tt,LOADING:et,STARTING:rt,SEEKING:it,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",TV:"is-tv",ENDED:nt,LIVE:st,ERRORED:"is-error",WAITING:at,AUTOPLAY:"is-autoplay",NO_AUTOPLAY:"no-autoplay",SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:ot,NO_DVR:lt,HAS_POSTER:"has-poster",WILL_PLAY:dt,WILL_PAUSE:ut,MENU_OPENED:"has-menu-opened",TOUCHED:ct,HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:ht,NO_CONTROLS:"no-controls",DESTROYED:"is-destroyed",IS_SOURCE_PROCESSING:ft});function gt(t){this.message=t}gt.prototype=new Error,gt.prototype.name="InvalidCharacterError";var vt="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new gt("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,i,n=0,s=0,a="";i=e.charAt(s++);~i&&(r=n%4?64*r+i:i,n++%4)?a+=String.fromCharCode(255&r>>(-2*n&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return a};var mt=function(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(vt(t).replace(/(.)/g,(function(t,e){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(e)}catch(t){return vt(e)}};function yt(t){this.message=t}yt.prototype=new Error,yt.prototype.name="InvalidTokenError";var Et=function(t,e){if("string"!=typeof t)throw new yt("Invalid token specified");var r=!0===(e=e||{}).header?0:1;try{return JSON.parse(mt(t.split(".")[r]))}catch(t){throw new yt("Invalid token specified: "+t.message)}};Et.InvalidTokenError=yt;const Tt=new Map,_t=(t,e)=>new(((t,e)=>{const r=t.get(e);if(!r)throw new Error(`no flowplayer component with the name ${e} exists`);const i=window.customElements.get(e);if(!i)throw new Error(`no default flowplayer component with the name ${e} exists`);const n=window.customElements.get(r);return"function"!=typeof n?i:n})(t._customElements,e))(t),St=(t,e,r)=>{window.customElements.get(e)||window.customElements.define(e,r),t.customElements.get(e)||t.customElements.set(e,e)};var bt,At;!function(t){t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=4]="HIGH"}(bt||(bt={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON",t[t.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(At||(At={}));function Lt(t,e,r){const i="boolean"==typeof r;if("boolean"!=typeof r&&(r=!!t.hasState(ut)||t.paused),function(t,e,r){const i=t.poll(e?"beforeplay":"beforepause",{forced:r});return i&&i.defaultPrevented}(t,r,i))return Promise.resolve();if(!r)return t.hasState(dt)?(t.setState(ut,!0),t.setState(dt,!1),Promise.resolve()):Promise.resolve(t.pause());if(0==t.reaper)return Promise.resolve();const n=t.reaper.get("__pending_play");return t.paused||n?n?(n.src!==Dt(t.original_src)&&wt(t),n):(function(t){return(0==t.networkState||0==t.readyState)&&t.currentSrc==Dt(t.original_src)}(t)&&wt(t),(t=>t.autoplay&&At.AUDIO_REQUIRED&t.autoplay)(e)?function(t){t.muted=!1,0==t.volume&&(t.volume=1);return t.play().catch(t=>{console.warn("[flowplayer/play] autoplay audio required\n%s",t.message)})}(t):t.play().then(()=>{t.hasState(ut)&&t.togglePlay(!1)}).catch(e=>(console.warn("[flowplayer/play] attempting muted autoplay\n%s",e.message),t.muted=!0,t.volume=0,t.play()))):(t.setState(ut,!1),!t.hasState(Z)&&t.setState(dt,!0),Promise.resolve())}function wt(t){t.currentSrc.match(/^blob:/)||t.load()}function Dt(t){const e=document.createElement("a");return e.href=t,e.href}function Rt(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}function It(t){const e=document.createElement("a");e.href=t;const r=e.pathname&&e.pathname.split(".");return r.length>1&&r[r.length-1]}function kt(t){switch(t){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return t}}const Ot=t=>{var{src:e}=t,r=Rt(t,["src"]);return[Object.assign({src:e,type:e?kt("video/"+It(e)):""},r)]};function Ct(t){return Ot({src:t})}function Pt(t){var{src:e,type:r}=t,i=Rt(t,["src","type"]);return e&&r?[Object.assign({src:e,type:r},i)]:r&&!e?[Object.assign({type:r},i)]:Ot(Object.assign({src:e},i))}var xt;function Mt(t,e,r,i={safari:!1}){const n=Nt(r);return function(t){[it,ut,dt,Z,J,et,tt,ot].forEach(e=>t.setState(e,!1)),t.setState(rt,!0)}(t),Array(...Array(n.length)).map((t,e)=>e).some(r=>{const s=n[r];if(xt.Ok==function(t,e,r){t.emit("src",r),"string"==typeof r.src&&(t.original_src=r.src);const i=function(t,e,r){return t.plugins.filter(t=>{return(e=t)&&"wants"in e;var e}).find(t=>t.wants(r.src||"",r,e))}(t,e,r);return t.setOpts({is_native:!i}),i?(i.onload(e,t.root,t,r),xt.Ok):xt.Err}(t,e,s)||xt.Ok==function(t,e,r,i={safari:!1}){var n;/^audio\//.test(r.type||"")&&t.emit("audioonlysource");e.start_time&&(r.src=r.src+"#t="+e.start_time);if(""==t.canPlayType(r.type||""))return xt.Err;if(r.drm&&(!r.drm["com.apple.fps.1_0"]||!i.safari))return xt.Err;"string"==typeof r.src&&(t.preload=e.autoplay?"auto":null!==(n=e.preload)&&void 0!==n?n:"auto",t.src=r.src,e.autoplay&&i.safari&&t.load(),"none"!==t.preload&&t.setState(et,!0));return xt.Ok}(t,e,s,i))return!0;r==n.length-1&&"string"==typeof s.src&&(t.src=s.src)}),function(t,e){!function(t,e){if(!t.currentSrc)return;if("none"==t.opt("preload"))return;if(e.autoplay&&e.autoplay>0)return;t.load()}(t,e)}(t,e),t}function Nt(t){return"string"==typeof t?Ct(t):Array.isArray(t)||"object"!=typeof t?t.reduce((function(t,e){return"string"==typeof e&&(e=Ct(e)),"object"!=typeof e||Array.isArray(e)||(e=Pt(e)),t.concat(e)}),[]):Pt(t)}!function(t){t[t.Err=0]="Err",t[t.Ok=1]="Ok"}(xt||(xt={}));const Ft=[w,A,"src","seek:cancel"];var Ut;function Bt(t,e,r){return isNaN(t.duration)||isNaN(t.currentTime)?{}:(e.offset+=r,0==e.offset?Gt(t,e):(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){0!=t.reaper&&(t.currentTime=function(t,e,r=0){return Math.max(Math.min(e,t),r)}(t.currentTime+e.offset,t.duration),e.timer=0,Gt(t,e))}),1e3),function(t,e){t.setState("will-seek",!0),t.setState(Ut.BACKWARD,e.offset<0),t.setState(Ut.FORWARD,e.offset>0)}(t,e),t.emit("seek:queued",e),e))}function Gt(t,e){e.timer&&clearTimeout(e.timer),e.timer=e.offset=0,function(t){t.setState(Ut.FORWARD,!1),t.setState(Ut.BACKWARD,!1),t.setState("will-seek",!1)}(t)}function Ht(t,e){const r=t._customElements.get(e);return r&&t.root.querySelector(r)||void 0}function jt(){if("undefined"==typeof document)return!1;const t=document.documentElement;return t&&"rtl"==t.getAttribute("dir")}function Vt(...t){const e=document.createElement("div");return 0==t.length||e.classList.add(...t),e}function Kt(t,e,r){const i=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(e);for(;i.length;){if(null==t)return r;const e=i.shift();if("string"!=typeof e)return r;t=t[e]}return null==t?r:t}function qt(t){const e="number"==typeof t?t:parseInt(t,10);return(e>9?"":"0")+e}function Wt(t){if(isNaN(t)||t>=Number.MAX_SAFE_INTEGER)return"";const e=t<0?"-":"";t=Math.round(Math.abs(t));const r=Math.floor(t/3600);let i=Math.floor(t/60);return t-=60*i,r>=1?(i-=60*r,e+r+":"+qt(i)+":"+qt(t)):e+qt(i)+":"+qt(t)}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(Ut||(Ut={}));const zt=navigator.languages||[navigator.language];function Yt(t,e,r){const i={};return r=e.lang||r,t[r]&&(i[r]=t[r]),function(){try{return zt.reduce((t,e)=>~e.indexOf("-")?t.concat(e,e.split("-")[0]):t.concat(e),[])}catch(t){return[]}}().forEach((function(e){t[e]&&!i[e]&&(i[e]=t[e])})),Object.values(i)}const Xt=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Qt=()=>"undefined"==typeof crypto?"":Xt.replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16));let $t="";!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}}();const Zt=["touchstart","touchmove"];function Jt(t,e){const r=new CustomEvent(t,{detail:e,cancelable:!0});return e&&Object.defineProperty(r,"data",{get:()=>e}),r}function te(t,e,r){const i=Jt(e,r);return t.dispatchEvent(i),t}function ee(t,e,r){const i=Jt(e,r);return t.dispatchEvent(i),i}function re(t,e,r,i){Array.isArray(e)?e.forEach(e=>ie(t,e,r,i)):ie(t,e,r,i)}function ie(t,e,r,i){if(n=e,!~Zt.indexOf(n))return t.addEventListener(e,r,i),t;var n;const s=Object.assign(i||{},{passive:!0});return t.addEventListener(e,r,s),t}function ne(t,e,r,i){return re(t,e,r,Object.assign(i||{},{once:!0}))}class PlayerStorage{constructor(t,e){this.implementation=t,e&&e.keys().forEach(t=>{"string"==typeof e.implementation[t]&&this.implementation.setItem(t,e.implementation[t])})}keys(){var t;const e=[];for(var r=0;r<this.implementation.length;r++)(null===(t=this.implementation.key(r))||void 0===t?void 0:t.startsWith("flowplayer/"))&&e.push(this.implementation.key(r));return e}removeItem(t){try{this.implementation.removeItem("flowplayer/"+t)}catch(t){}}getItem(t){try{return this.implementation.getItem("flowplayer/"+t)}catch(t){return null}}setItem(t,e){try{this.implementation.setItem("flowplayer/"+t,e)}catch(t){}}clear(){try{this.keys().forEach(t=>this.implementation.removeItem(t))}catch(t){}}get length(){try{return this.keys().length}catch(t){return 0}}key(t){try{return this.implementation.key(t)}catch(t){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(t){var e;return(null===(e=this.pairs.find(e=>e[0]===t))||void 0===e?void 0:e[1])||null}key(t){return this.pairs[t][0]||null}removeItem(t){this.pairs=this.pairs.filter(e=>e[0]!==t)}setItem(t,e){this.removeItem(t),this.pairs.push([t,e])}}const se={preload:"none",rtl:!1,controls:!0},ae=["loop","muted","preload"];function oe(t,i,n){let s;n.live_state={dvr_window:void 0,get dvr(){return s},set dvr(e){s=e;const r=!(!t.live||e);n.hasState(lt)!=r&&n.setState(lt,r)}},n._storage=new PlayerStorage(["localStorage","sessionStorage"].map(t=>{try{const e=window[t];return e.getItem(""),e}catch(e){return console.debug(`Access to window.${t} denied, trying next option`),null}}).find(t=>!!t)||new InMemoryStorage),n.toJSON=function(){return{duration:n.duration,volume:n.volume,currentTime:n.currentTime,states:n.root.className}},n.setSrc=function(e){return Mt(n,t,e,r())},n.playerState=n.playerState||{},n.setState=function(t,e){if(n.playerState[t]===!!e)return n;const r=Object.assign({},n.playerState,{[t]:e});return n.playerState=r,te(n,"state",n.playerState),n},n.createComponents=function(...t){return Array.from({length:t.length}).map((e,r)=>_t(this,t[r]))},n.hasState=function(t){return!!n.playerState[t]},n.transitionState=function(t,e,r){!n.hasState(t)&&n.hasState(e)||(r=0),r&&n.setState("is-toggling",!0),n.setState(e,!1),n.setState(t,!0),r&&setTimeout((function(){n.setState("is-toggling",!1)}),r)},n.emit=(t,e)=>(te(n,t,e),n),n.on=(t,e)=>(re(n,t,e),n),n.once=(t,e)=>(ne(n,t,e),n),n.off=(t,e)=>{var r,i;return r=t,i=e,n.removeEventListener(r,i),n},n.poll=(t,e)=>ee(n,t,e),n.togglePlay=function(e){return Lt(n,t,e)},n.toggleMute=function(t){t=null==t?!n.muted:!!t,n.muted=t,n.muted||n.volume||(n.volume=1),te(n,"volumechange")},n.toggleDisable=function(t){t=null==t?!n.disabled:!!t,n.setState("is-disabled",t),n.disabled=t},n.destroy=function(){n.pause();const t=e.indexOf(n);~t&&e.splice(t,1),setTimeout((function(){n.setSrc([]),n.reaper&&n.reaper.clear(),te(n,w),n.setState("is-destroyed",!0)}),0)},n.setAttrs=function(t){return ae.forEach(e=>{if(!(e in t))return;const r=t[e];r?n.setAttribute(e,r.toString()):n.removeAttribute(e)}),n},n.opt=function(e,r){return r=void 0===r?Kt(se,e):r,Kt(t,e,r)},n.i18n=function(t,e){if(!n.reaper)return"";const r=n.reaper.get("translations");return r?function t(e,r,i,n){return(n=n||0)>=e.length?i:Kt(e[n],r,t(e,r,i,n+1))}(r,t,e||""):e||""},n.setOpts=function(e){Object.assign(t,e),t.live&&!n.hasState(st)&&(n.setState(lt,!0),te(n,"live")),"disabled"in e&&void 0!==e.disabled&&n.toggleDisable(e.disabled),"muted"in e&&void 0!==e.muted&&n.toggleMute(e.muted),"dvr"in t&&(n.live_state.dvr=n.opt("dvr"));const r=!!t.autoplay&&!n.hasState("no-autoplay");n.setState("is-autoplay",r),n.setState("is-rtl",n.opt("rtl",function(t){if(!t)return jt();const e=t.getAttribute("dir");return e?"rtl"==e:jt()}(i))),n.setState(st,!!t.live),n.setState("has-poster","string"==typeof t.poster&&t.poster.length>0),n.setState("is-seekable",!!t.seekable),n.setState("no-controls",0==t.controls),i.style.backgroundImage=n.hasState("has-poster")?"url('"+t.poster+"')":"",te(n,D,t)},n.renderPlugin=function(t){ee(n,"renderplugin",t).defaultPrevented||n.root.appendChild(t)};const a={offset:0,timer:0};var o,l;l=a,(o=n).on(Ft,(function(){Gt(o,l)})),n.enqueueSeek=function(t){if(0!=n.opts.seekable&&!(1==n.opts.disabled&&t>0))return Bt(n,a,t)},n.deviceId=function(){return function(t){if($t)return $t;try{const e=t.getItem("flowplayer/uuid");if(e)return e;const r=Qt();return t.setItem("flowplayer/uuid",r),r}catch(t){return $t=Qt()}}(n._storage)}}function le(t,e){const r=e.querySelector("video"),i=r||(t._video_element_callback?t._video_element_callback(t):document.createElement("video"));return i.classList.add("fp-engine"),i.playsInline=!0,r||e.append(i),i}var de="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function ue(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;if(null===document.currentScript)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const r=t.flowplayer;return"function"==typeof r?(r(e),e):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(e)||r.extensions.push(e),e)}function ce(){return"undefined"!=typeof window?window:void 0!==de?de:{}}const he=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function fe(t,e){return!!~he.indexOf(t)||t.indexOf(e)===t.length-e.length}fe.check_whitelist=function(t){return!!~he.indexOf(t)};const pe="production";function ge(t,e){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let i={c:"{}",exp:0};e=e||{};try{i=Et(t),r.valid_jwt=!0}catch(t){}return r.raw=t,r.data=JSON.parse(i.c),r.exp=i.exp,e.require_valid_token&&ge.validate(r),r}function ve(t){try{return ge.validate(t),{success:!0,message:""}}catch(t){return{success:!1,message:t.message}}}var me;function ye(t){return{grant:t,is_granted:e=>(t&e)===e}}function Ee({root:t,video:e,data:r}){e&&e.destroy(),console.error(new Error(r.details||r.reason)),t.innerHTML="",t.classList.remove("flowplayer"),t.classList.add("flowplayer-fatal"),t.style.removeProperty("background-image");const i=document.createElement("h2");i.textContent="Playback Error";const n=document.createElement("p");n.textContent="Are you the site owner?";const s=document.createElement("a");s.classList.add("troubleshoot"),s.target="_blank",s.href="https://docs.flowplayer.com/troubleshooting/player#"+r.reason,s.textContent="Troubleshoot?";const a=document.createElement("img");a.src="https://flowplayer.com/user/pages/images/logo-white.png",t.append(i,n,s,a)}ge.validate=function(t){if("string"==typeof t&&(t=ge(t)),!t||!t.raw){if(fe.check_whitelist(window.location.hostname)||"dev"===pe.toString())return!0;throw new Error("No token provided in configuration")}if(!t.valid_jwt)throw new Error("Invalid token provided");const e=window.location.hostname,r=fe.bind(null,e);if("dev"!==pe.toString()&&t.data.domain&&t.data.domain.length&&!t.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==pe.toString()&&1e3*t.exp-Date.now()<0)throw new Error("Expired token");return!0},ge.id=function(t){if(t)return"string"==typeof t&&(t=ge(t)),t.data.id},function(t){t[t.ADS=2]="ADS",t[t.ANALYTICS=4]="ANALYTICS",t[t.NO_METERING=8]="NO_METERING",t[t.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",t[t.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(me||(me={})),ye.of=ye,ye.from_token=function(t){const e=ge(t,{require_valid_token:!0});return ye.of(e.data.acl)},ye.permissions=me;function Te(t,e){const r=e.clientWidth;e.classList.toggle("is-small",r<600),e.classList.toggle("is-tiny",r<400)}function _e(t,e,i){let n=!0;e.classList.add("flowplayer"),Te(0,e),re(i,[m,"resize"],(function(){Te(0,e)})),re(i,"state",(function(){Object.entries(i.playerState).forEach((function([t,r]){e.classList.toggle(t,r)}))})),re(i,"timeupdate",(function(){i.setState(at,!i.hasState("is-casting")&&!i.hasState(rt)&&i.readyState<3)})),re(i,S,(function(e){setTimeout((function(){if(!e.defaultPrevented){if(t.rewind&&!i.loop){const e=i.src;t.autoplay&&(t.autoplay=0,i.setState("is-autoplay",!1)),i.setState(it,!0),ne(i,b,(function(){e===i.src&&(i.setState(it,!1),i.pause(),i.setState(rt,!0))})),i.currentTime=0}ne(i,"timeupdate",(function(){i.setState(nt,!1)})),i.transitionState(nt,Z,t.loop||t.rewind?0:300)}}),0)})),re(i,[A,b],(function(t){i.setState(it,t.type==A)})),re(i,"remotesession:ended",(function(t){setTimeout(()=>i.currentTime=t.detail.currentTime,0)})),re(i,S,(function(){i.setState(Z,!1),n=!0})),re(i,v,()=>{if(!i.opts.live||!i.opts.is_native)return;const t=i.seekable;0!=t.length&&i.emit("dvr/window",t.end(t.length-1)-t.start(0))}),re(i,r().ios?p:g,(function(){var t,e;i.setState(tt,!0),i.setState(et,!1);const r=i;0===(null===(t=r.videoTracks)||void 0===t?void 0:t.length)&&(null===(e=r.audioTracks)||void 0===e?void 0:e.length)>0&&i.emit("audioonlysource")})),re(i,"play",()=>{i.setState(dt,!0)}),re(i,[T,_,m],(function(e){if(!i.hasState(it)&&(e.type!=_||t.autoplay||i.setState(at,!1),e.type!=m||"none"!=i.opt("preload")||t.autoplay)){if(e.type==m&&t.autoplay)return ne(i,E,(function(){i.setState(at,!1)}));e.type!=T||i.hasState(tt)||i.setState(et,!0),i.setState(nt,!1),i.setState(at,e.type==T)}})),re(i,[E,y],(function(e){setTimeout(()=>{const t=new CustomEvent("flowplayer/"+e.type,{detail:i});document.dispatchEvent(t)},0);const r=e.type==E,s=i.currentTime==i.duration,a=r&&n&&t.autoplay||i.hasState(at);if(r&&(i.started=!0,n=!1),i.setState(at,!1).setState(rt,!1).setState(dt,!1),!r&&i.setState(ut,!1),s)return;const o=r?Z:J,l=r?J:Z;i.transitionState(o,l,a?0:300),r&&i.setState("no-autoplay",!1)}))}const Se=[0].concat(Array.from({length:100}).map((t,e)=>(e+1)/100));function be(t,e,r){if(!window.IntersectionObserver)return;const i={should_resume:!!t.autoplay,has_user_gesture:!1,locked:!1};[c,n].forEach(t=>ne(r,t,()=>i.has_user_gesture=!0)),re(r,"play",(function(){i.locked||(i.should_resume=!0)})),re(r,"src",(function(){i.should_resume=!!t.autoplay})),re(r,y,(function(){i.locked||(i.should_resume=!1)}));const s=()=>{setTimeout(()=>{r.setState(rt,!0),r.setState("is-autoplay",!1)},100)};re(r,_,()=>{if(t.autoplay)return r.hasState(ht)&&i.should_resume?r.togglePlay(!0).catch(s):void(t.autopause||r.hasState(ht)||!i.should_resume||ne(r,"viewenter",()=>{t.autoplay&&i.should_resume&&r.togglePlay(!0).catch(s)}))});const a=new IntersectionObserver(t=>{t.forEach(t=>{setTimeout(()=>{const e=t.intersectionRatio,i=r.hasState(ht);if(r.setState(ht,e>=.2),r.emit("intersectionchange",{ratio:e}),i===r.hasState(ht))return;const n=r.hasState(ht)?"viewenter":"viewleave";r.emit(n)},0)})},{threshold:Se});a.observe(e),r.on(w,()=>a.disconnect()),re(r,"viewenter",(function(){i.should_resume&&t.autopause&&!Ae()&&r.togglePlay(!0)})),re(r,"viewleave",(function(){if(!t.autopause||Ae())return;const e=!r.paused;i.locked=!0,r.pause(),setTimeout((function(){i.should_resume=e,i.locked=!1}),0)}))}function Ae(){return e.find(t=>t.hasState("is-casting"))}function Le(t,e){if(!window.ResizeObserver)return;const r=new ResizeObserver(t=>{const r=t[t.length-1];e.emit("resize",r)});r.observe(t),e.on(w,()=>r.disconnect())}function we(t){if("number"==typeof t&&!isNaN(t))return Number(t);if("string"==typeof t){const e=t.split(":");return Number(e[1])/Number(e[0])}return t}function De(t,e,r){const i=!!t.ratio,n=document.createElement("div");n.classList.add("fp-ratio"),e.append(n);let s=we(t.ratio||.5625);n.style.paddingTop=100*s+"%";const a=[g,p];r.on(a,(function(){if(i)return;const t=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth;t&&r.setOpts({ratio:t})})),r.on(D,(function(){const e=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth,i=we((null==t?void 0:t.ratio)||e||.5625);s!==i&&(s=i,n.style.paddingTop=100*i+"%")}))}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(t,e,r){this.root=e,this.player=r,this.wireUp()}wireUp(){var t,e;this.cleanUp(),null===(t=this.player)||void 0===t||t.once(E,this.render),null===(e=this.player)||void 0===e||e.once(S,this.wireUp)}cleanUp(){var t,e,r,i;null===(e=null===(t=this._logo)||void 0===t?void 0:t.parentElement)||void 0===e||e.removeChild(this._logo),null===(r=this.player)||void 0===r||r.off(E,this.render),null===(i=this.player)||void 0===i||i.off(S,this.wireUp)}render(){var t,e,r;null===(e=null===(t=this._logo)||void 0===t?void 0:t.parentElement)||void 0===e||e.removeChild(this._logo);const i=(null===(r=this.root)||void 0===r?void 0:r.querySelector(".fp-ui"))||this.root;if(!i)return;const n=this._logo=document.createElement("a");n.href="https://explorer.flowplayer.com",n.target="_blank",Object.entries(Re).forEach(([t,e])=>{n.style.setProperty(t,e,"important")}),i.appendChild(n)}}const Re={display:"block",opacity:"1",visibility:"visible",width:"33%","padding-top":"9%",position:"absolute","z-index":"9999",bottom:"25%",left:"10%","background-size":"cover","background-image":"url(https://static.flowplayer.com/explorer/explorer.svg)"},Ie="flowplayer/"+E;function ke(t){const e=e=>{e.detail!==t&&!1===t.opt("multiplay")&&t.togglePlay(!1)};t.on(w,()=>document.removeEventListener(Ie,e)),document.addEventListener(Ie,e)}function Oe(t,e){const r=[];t.addEventListener("contextmenu",i=>{const n=i.timeStamp;for(r.push(n);r.length>3;)r.shift();r.length>=3&&r.every(t=>t-n<3e3)&&(console.debug("flowplayer/debug rendering info"),function(t,e){var r;!function(t){const e=t.querySelector(".debug-info");null==e||e.remove()}(t);const i=document.createElement("div");i.classList.add("debug-info");const n=Ce("flowplayer.version","3.7.1-rc.3");i.append(n);const s=null===(r=null==e?void 0:e.hls)||void 0===r?void 0:r.constructor;if(s&&s.version){const t=Ce("hls.version",s.version);i.append(t)}t.appendChild(i)}(t,e))})}const Ce=(t,e)=>{const r=document.createElement("div");r.classList.add("row",t);const i=document.createElement("span");i.classList.add("attr"),i.textContent=t;const n=document.createElement("span");return n.textContent=e,n.classList.add("value"),r.append(i,n),r};function Pe(t,e){const r=function(){try{return localStorage.getItem("flowplayer/debug")}catch(t){return""}}(),i=(i,...n)=>{try{const s=(null==e?void 0:e.debug)||r;s&&t.match(s)&&console.log(`flowplayer/${t} -- ${i}`,...n)}catch(t){console.warn(t)}};return i.log=i,i}function xe(t){return e=>{setTimeout((function(){if(!e.defaultPrevented)return t(e)}),0)}}const Me=Pe("core/retry");function Ne(t,e){const r={pending:void 0,count:0};t.on(i,i=>{e.retry&&void 0===r.pending&&(++r.count,r.pending=function(t,e){return setTimeout(()=>{t.hasState("is-destroyed")||(e.pending=void 0,[L,k].forEach(e=>t.emit(e)),Me("%s try",e.count))},3e3*e.count)}(t,r))}),t.on(E,()=>{r.count=0}),t.on(["src",L],()=>{r.pending&&(clearTimeout(r.pending),r.pending=void 0)}),t.on(k,xe(e=>{e.defaultPrevented||t.load()}))}const Fe=function(){const t=ce(),e=t.flowplayer?t.flowplayer:{extensions:[]};return Array.isArray(e.extensions)||(e.extensions=[]),e}();function Ue(r,i){if("function"==typeof r)return t.push(...[...arguments].filter(t=>"function"==typeof t)),Ue;"string"==typeof i&&(i={src:i}),i||(i={}),i.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(i.token=window.__FLOWPLAYER_TOKEN);const n="string"==typeof r?document.querySelector(r):r;if(!n)return console.error(new Error("Flowplayer: '"+r.toString()+"' not found"));const s=n.querySelector("video.fp-engine");if(s)return s;const a=ve(i.token);if(!a.success)return Ee({root:n,data:{reason:"token",details:a.message}});const o=new Map,l=le(i,n);l.reaper=o,l._customElements=Tt,Object.defineProperty(l,"token",{value:"string"==typeof i.token?ge.id(i.token):"",writable:!1}),l.addEventListener(w,()=>{o.clear(),l.reaper=0,delete l.root}),l.root=n,i.token&&ye.from_token(i.token).is_granted(ye.permissions.DEVELOPER_PLAN)&&t.push(ExplorerPlan),!~e.indexOf(l)&&e.push(l),oe(i,n,l),l.setAttrs(i),l.plugins=Ue.extensions.map(t=>new t(Ue,l)),_e(i,n,l),be(i,n,l),Le(n,l),De(i,n,l),ke(l),Oe(n,l),Ne(l,i),l.plugins.forEach(t=>{try{t.init(i,n,l)}catch(e){console.log("Error(plugin/%s)",t.constructor.name,e)}}),l.setOpts(i),l.opts=i,i.src&&l.setSrc(i.src);const d=l.readyState;return d>0&&l.currentSrc&&l.emit(p),d>2&&l.currentSrc&&l.emit(_),l.emit("mount"),l.on("error:fatal",(function(t){Ee({root:n,video:l,data:t.data||{}})})),setTimeout(te,0,document,"flowplayer:player:created",l),l}Object.assign(Ue,Fe),function(i){Array.isArray(i.extensions)&&i.extensions.forEach(e=>t.push(e)),i.customElements=Tt,i.defaultElements=$,i.version="3.7.1-rc.3",i.commit="b893dcb402b528cdccb5aff51fbdbd761e5c7d57",i.instances=e,i.extensions=t,i.support=r,i.events=O,i.states=pt,i.jwt=Et,i.autoplay=At,i.quality=bt}(Ue),"object"==typeof document&&setTimeout(te,0,document,"flowplayer:umd",Ue);var Be="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ge(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function He(t){var e={exports:{}};return t(e,e.exports),e.exports}var je=He((function(t,e){var r=Be&&Be.__assign||function(){return(r=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};e.__esModule=!0,e.remove=e.downcase=e.pluck=e.merge=void 0,e.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return r(r({},t),e)}),{})},e.pluck=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return Object.keys(t).filter((function(t){return~r.indexOf(t)})).reduce((function(r,i){var n;return e.merge(r,((n={})[i]=t[i],n))}),{})},e.downcase=function(t){return(t||"").toString().toLowerCase()},e.remove=function(t,e){var r=t.lastIndexOf(e);return~r&&t.splice(r,1),t}})),Ve=He((function(t,e){var r=Be&&Be.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),i=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=Be&&Be.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};e.__esModule=!0;var s=n(je),a=function(){function t(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return t.of=function(){return new t},t.is_empty=function(t){return 0==t.pending.length},t.is_high_water=function(e){return e.open.length==t.MAX_OPEN_REQUESTS},t.maybe_spawn_req=function(e){if(t.is_empty(e))return e;if(t.is_high_water(e))return e;try{var r=t.lpop(e);r&&t.request(e,r)}catch(t){}},t.increment_failures=function(e){return e.stats.failures++,e.stats.failures>t.MAX_FAILURE_COUNT&&(e.stats.ttl=Date.now()+t.REQUEST_TTL_MS),e},t.handle_error=function(e,r){t.rm(e,r),t.increment_failures(e)},t.request=function(e,r){var i=r[0],n=r[1],s=r[2];if(!(Date.now()<e.stats.ttl)){var a=new XMLHttpRequest;e.open.push(a),a.timeout=t.REQUEST_TIMEOUT_MS,a.ontimeout=function(){t.handle_error(e,a)},a.onerror=function(r){t.handle_error(e,a)},a.onreadystatechange=function(){a.readyState==XMLHttpRequest.DONE&&t.rm(e,a),Math.floor(a.status/100)},a.onload=function(){t.rm(e,a),e.stats.failures&&e.stats.failures--},a.open(n,i),a.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{a.send(JSON.stringify(s))}catch(t){}}},t.rpush=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return r.forEach((function(r){e.pending.length>=t.MAX_PENDING||(e.pending.push(r),t.maybe_spawn_req(e))})),e},t.lpop=function(t){return t.pending.shift()},t.rm=function(t,e){return s.remove(t.open,e),t},t.MAX_OPEN_REQUESTS=3,t.MAX_PENDING=5,t.REQUEST_TIMEOUT_MS=4e3,t.REQUEST_TTL_MS=5e3,t.MAX_FAILURE_COUNT=3,t}();e.default=a})),Ke=He((function(t,e){var r=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var i=r(Ve);e.default=i.default.of()})),qe=He((function(t,e){e.__esModule=!0,e.prepare_url=e.URL_PARAM=void 0,e.URL_PARAM=/:([a-zA-Z_]+)/g,e.prepare_url=function(t,r){return t.url.replace(e.URL_PARAM,(function(e){if((e=e.slice(1,e.length))in r)return r[e].toString();t.log.error(new Error("\n preparing url["+t.url+"] failed\n \n parameter["+e+"] not detected in params:\n \n "+JSON.stringify(r,null,2)+"\n "))}))}})),We=He((function(t,e){e.__esModule=!0,e.Log=void 0;var r=function(){function t(t){this.emitter=t}return t.prepare=function(t,e){var r=document.createEvent("Event");return r.initEvent(t,!1,!0),r.ns=t,r.data=e,r},t.of=function(e){return new t(e)},t.prototype.info=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.INFO,e))},t.prototype.error=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.ERROR,e))},t.prototype.warn=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.WARN,e))},t.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},t}();e.Log=r})),ze=He((function(t,e){var r;e.__esModule=!0,e.Verb=void 0,(r=e.Verb||(e.Verb={})).POST="POST",r.PUT="PUT",r.GET="GET"})),Ye=He((function(t,e){var r=Be&&Be.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),i=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=Be&&Be.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=Be&&Be.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,n++)i[n]=s[a];return i},a=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var o=a(Ke),l=a(Ve),d=n(qe),u=n(je),c=function(){function t(e,r){var i=this;void 0===r&&(r={});var n=this;if(this.emitter=e,this.url=r.url,this.log=We.Log.of(this.emitter),this.verb=r.verb,this.metadata=u.merge({},r.metadata||{}),this.rq=r.rq||o.default,this.events=r.events||[],this.required_keys=r.required_keys||[],this.optional_keys=r.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),t.assert_emitter_api(this.emitter),void 0===t.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");t.TRACKERS.push(this),n.events.forEach((function(e){t.create_listener(i,e,(function(r){void 0===r&&(r={});var s=u.merge(n.metadata,{event_type:e},r.data||r),a=d.prepare_url(n,s),o=t.pluck_valid_keys(n,s),c=t.ensure_required_keys(n,o);if(c.length)return n.log.error("Tracker.validate_metadata() failed for \n Event["+e+"]\n missing keys: "+c+"\n payload:\n "+JSON.stringify(o,null,2));l.default.rpush(i.rq,[a,i.verb,o])}))}))}return t.of=function(e,r){return new t(e,r)},t.ensure_required_keys=function(t,e){return t.required_keys.filter((function(t){return!(t in e)}))},t.pluck_valid_keys=function(t,e){return u.pluck.apply(u,s([e],t.valid_keys))},t.merge_metadata=function(e,r){return void 0===r&&(r={}),e.metadata=t.pluck_valid_keys(e,u.merge(e.metadata,r)),e},t.assert_emitter_api=function(t){if("function"!=typeof(t||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(t||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},t.create_listener=function(t,e,r){t.listeners.push([e,r]),t.emitter.addEventListener(e,r)},t.prototype.destroy=function(){var e=this;this.listeners.forEach((function(t){var r=t[0],i=t[1];return e.emitter.removeEventListener(r,i)})),delete this.rq,delete this.emitter,u.remove(t.TRACKERS,this)},t.prototype.put=function(e){return void 0===e&&(e={}),t.merge_metadata(this,e),this},t.TRACKERS=[],t.QUEUE=o.default,t.verb=ze.Verb,t}();e.default=c})),Xe=He((function(t,e){var r=Be&&Be.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),i=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=Be&&Be.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.API=e.Tracker=void 0;var a=s(Ye);e.Tracker=a.default;var o=n(qe);e.API=o})),Qe="ping",$e="display",Ze="view";const Je=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],tr=["created","position"],er=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function rr(t,e){return t.duration/1===t.duration&&Object.assign(e,function(t){const e=t/100;return{segment_duration:e,breakpoints:Array(...Array(100)).map((function(t,r){return Math.floor(r*e*1e3)/1e3}))}}(t.duration))}function ir(t,e,r){if(!e.segment_duration&&!rr(t,e))return;const i=function(t,e,r){const i=e.last_idx,n=r?99:nr(t,e);return e.last_idx=n,n<=i?[]:e.breakpoints.slice(i,99==n?100:n).map((function(t){return e.breakpoints.indexOf(t)}))}(t,e,r);0!=i.length&&t.emit(Qe,{position:i})}function nr(t,e){return Math.min(Math.floor(t.currentTime/e.segment_duration),99)}function sr(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(t){return!1}}const ar="vod",or="live",lr=[$e,Qe,Ze];function dr(t,e,r){switch(null==e?void 0:e.kind){case"live":return function(t,e){const r=Date.now();r-e.last_tracked_ts<6e4||(e.last_tracked_ts=r,++e.ticks,t.emit(Qe,{position:60*e.ticks}))}(t,e);case"vod":return ir(t,e,"boolean"==typeof r&&r)}}function ur(t){const e=t.ads;return void 0!==e&&(void 0!==e.schedule&&("function"==typeof e.hasPreroll&&(e.currentRequests?e.currentRequests:!!e.adPlaying||!(!e.hasPreroll()||0!=e.nextIndex))))}class Analytics$1{init(t,e,r){if(!ye.from_token(t.token||"").is_granted(ye.permissions.ANALYTICS))return;if(r.hasState("consent-no-tracking"))return;if(r.analytics)return;const i=r.analytics={ticker:void 0,last_media_id:"",ended:!1},n={locked:!1,ttl:6e3,task:()=>{dr(r,i.ticker)}};const s={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:t.player_id,customer_user_id:t.customer_user_id,player_version:"3.7.1-rc.3"},a=Xe.Tracker.of(r,{verb:Xe.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:lr,required_keys:Je,optional_keys:er.concat(tr).slice(0),metadata:s});r.on(w,(function(){a&&a.destroy()})),r.on(D,(function(e){if(!a)return;const n=Kt(e,"data.metadata",{});if(!n.media_id)return;const s=Kt(a,"metadata.media_id");if(s&&n.media_id==s)return;const o=Kt(t,"analytics",{});a.put(n),a.put(o);const l=Kt(t,"metadata.live_start_time",t.live)?or:ar;a.put({video_type:l,source:t.source||sr()||""}),i.ticker=t.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},i.ended=!1,r.emit($e)}));let o=0;r.on(E,(function(){if(!a)return;if(o||function(t,e){return t.metadata.media_id&&t.metadata.media_id==e.last_media_id}(a,i))return;a.put({muted:r.muted});const t=ur(r);if(t)return o=Promise.resolve(t).then((function(){i.last_media_id=a.metadata.media_id,r.emit(Ze),o=0})).catch((function(){o=0}));i.last_media_id=a.metadata.media_id,r.emit(Ze)})),r.on("timeupdate",(function(){var e;a&&(o||ur(r)||i.ended||(!t.live&&r.currentTime+.25>=r.duration&&dr(r,i.ticker,!0),(e=n).locked||(e.locked=setTimeout((function(){return e.task(),function(t){return t.locked=!1,t}(e)}),e.ttl))))})),r.on(b,(function(){a&&i.ticker&&"vod"==i.ticker.kind&&function(t,e){rr(t,e),e.last_idx=nr(t,e)}(r,i.ticker)})),r.on(S,(function(){a&&function(t,e){e.ended||(e.ended=!0,dr(t,e.ticker))}(r,i)}))}}var cr;function hr(t){switch(t){case cr.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case cr.MEDIA_ERR_NETWORK:return"a network error occurred";case cr.MEDIA_ERR_DECODE:return"unable to decode media content";case cr.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case cr.NO_INTERNET:return"no internet connection detected";case cr.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function fr(){}function pr(){return"https:"===location.protocol}function gr(t){const e=document.createElement("a");return e.href=t,e}function vr(t){try{return!!new URL(t)}catch(t){return!1}}ue(ce(),Analytics$1),"undefined"!=typeof window&&window.matchMedia&&[R,I].forEach((function(t){window.matchMedia("(orientation: "+t+")").addListener((function(r){e.length&&e.forEach((function(e){r.matches&&e.emit(t)}))}))})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",t[t.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",t[t.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",t[t.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",t[t.MIXED_CONTENT=1001]="MIXED_CONTENT",t[t.NO_INTERNET=1002]="NO_INTERNET"}(cr||(cr={}));function mr(t,e){if(e.message)return e.message;if(e.stack)return e.stack;const r=e.code||-1,i=hr(r);return t.i18n("media_errors."+r,i)}const yr=()=>!0===(navigator||{}).onLine;function Er(t,e,r){const n=r.togglePlay;r.on(i,(function(t){const e=t.data||r.error,s="Error: %s\n"+(null===(a=(new Error).stack)||void 0===a?void 0:a.split("\n").slice(2).join("\n"));var a;setTimeout((function(){const a=Ht(r,C);if(t.defaultPrevented||!a||r.root.querySelector("#qul_error"))return;if("AbortError"==e.name)return;r.setState("is-error",!0),r.togglePlay=fr;const o=function(t,e){return{code:"http:0"===e.code?_r(t):e.code,message:mr(t,e)}}(r,e);console.error(s,o.message);let l=Ht(r,"flowplayer-error");l||(l=_t(r,"flowplayer-error"),a.append(l)),te(l,i,{data:e,formatted_data:o}),r.once(m,()=>{Tr(r,n)})}))})),r.on(L,()=>Tr(r,n))}function Tr(t,e){const r=Ht(t,"flowplayer-error");t.togglePlay=e,t.opt("retry")&&t.setState(at,!0),t.setState("is-error",!1),null==r||r.remove()}function _r(t){return function(t){try{return pr()&&"http:"==gr(t).protocol}catch(t){return!1}}(t.original_src)?{code:cr.MIXED_CONTENT}:yr()?{code:cr.MEDIA_ERR_NETWORK}:yr()?{code:cr.UNKNOWN}:{code:cr.NO_INTERNET}}var Sr=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384,LOGO_ON_BOTTOM:32768});function br(t,e,r){let i=()=>document.fullscreenElement,n="fullscreenchange";if(!Element.prototype.requestFullscreen){const t=Element.prototype,e=document;t.webkitRequestFullScreen&&(t.requestFullscreen=t.webkitRequestFullScreen,e.fullscreenEnabled=!0),e.webkitCancelFullScreen&&(document.exitFullscreen=e.webkitCancelFullScreen),n="webkit"+n,i=()=>e.webkitCurrentFullScreenElement}const a=()=>r.getFullsceenTarget?r.getFullsceenTarget():e;r.toggleFullScreen=function(t,e){if(r.ios_fullscreen_disabled)return;if("boolean"!=typeof t&&(t=!r.hasState("is-fullscreen")),Ar(r)&&(t?function(t){t.getAttribute("playsinline")&&t.removeAttribute("playsinline");t.getAttribute("webkit-playsinline")&&t.removeAttribute("webkit-playsinline");t.webkitEnterFullScreen()}(r):function(t,e){t.getAttribute("playsinline")||t.setAttribute("playsinline","");t.getAttribute("webkit-playsinline")||t.setAttribute("webkit-playsinline","");e||t.webkitExitFullScreen();t.togglePlay(!1),t.hasState(ct)||t.setState(ct,!0)}(r,e)),!document.fullscreenEnabled)return;const n=a();if(t)return n.requestFullscreen();i()===n&&document.exitFullscreen()},Ar(r)&&(r.ios_fullscreen_disabled=!0,r.once("beforeplay",(function(){r.ios_fullscreen_disabled=!1})),r.on("webkitendfullscreen",(function(){r.toggleFullScreen(!1,!0)}))),setTimeout(()=>{const t=a();t.addEventListener(n,(function(){const e=i(),n=e===t||e==r;r.emit(n?h:f),r.setState("is-fullscreen",n)}))},0),!1!==t.doubleclick&&e.addEventListener(s,(function(t){var e;t.target&&(null===(e=t.target)||void 0===e?void 0:e.classList.contains("fp-ui"))&&r.toggleFullScreen()}))}function Ar(t){return r().ios&&"function"==typeof t.webkitEnterFullScreen&&"function"==typeof t.webkitExitFullScreen}function Lr(t,e){const r=t.seekable;if("object"!=typeof t.opts||0==r.length)return{head:0,tail:0};const i=Rr(t),n=e||t.live_state.dvr_window;return{head:i,tail:"number"!=typeof n||i-n<0?r.start(0):i-n}}function wr(t){return t.opt("live",!1)||t.duration>=Number.MAX_SAFE_INTEGER}function Dr(t){return isFinite(t.duration)?t.duration:0==t.seekable.length?0:Lr(t).head}function Rr(t){var e;const r=t.seekable;return r.length?t.hasState("is-chromecast-playing")||!(null===(e=t.hls)||void 0===e?void 0:e.liveSyncPosition)?r.end(r.length-1):t.hls.liveSyncPosition:0}function Ir(t,e,r){if(!r.reaper)return;const i=document.createDocumentFragment(),n=_t(r,C),s=_t(r,P);e.append(s),i.append(n),r.reaper.set("ui",n),~e.className.indexOf("use-play-")||e.classList.add("use-play-1"),function(t,e,r){const i=Vt("fp-footer");e.append(i),r.on(D,(function(t){var e,r;const n=null===(e=t.data)||void 0===e?void 0:e.description,s=null===(r=t.data)||void 0===r?void 0:r.title;if(i.innerHTML="","string"==typeof s){const t=Vt("fp-title");t.innerText=s,i.append(t)}if("string"==typeof n){const t=n.split(" "),e=Vt("fp-desc");for(e.innerText=t.join(" "),i.append(e);t.length>1&&e.scrollHeight>e.offsetHeight;)t.pop(),e.innerText=t.join(" ")+"..."}}))}(0,e,r),Er(0,0,r),e.appendChild(i),[o,l].forEach(t=>{e.addEventListener(t,(function(t){r.setState("is-hovered",t.type==o),r.setState("is-accessibility",!1)}))}),br(t,e,r),r.on("volumechange",(function(){const t=0==r.volume||r.muted;r.setState("is-muted",t),r._storage.setItem("mute",t.toString())})),"true"==r._storage.getItem("mute")&&(r.muted=!0,r.setState("is-muted",r.muted));const a=r._storage.getItem("volume");a&&!isNaN(Number(a))&&(r.volume=Number(a)),r.emit("volumechange"),r.on("dvr/window",e=>{t.live&&(r.live_state.dvr=r.seekable.length>0&&function(t,e,r){if(0==e)return!0;const i=Lr(t,r);return i.head-i.tail>=e}(r,t.seconds_to_dvr||60,e.detail),r.live_state.dvr_window=e.detail)}),r.on("live",()=>{const t=setInterval(()=>{if(r.opts.live&&!r.hasState("is-error")&&0!=r.reaper||(r.setState(st,!1),clearInterval(t)),0==r.seekable.length)return;const e=function(t){const e=t.currentTime,r=Lr(t);return{progress:Math.min(100,Math.max(0,(e-r.tail)/(r.head-r.tail)*100)),is_live:e-r.head>=-10}}(r);r.hasState(ot)==e.is_live&&r.setState(ot,!e.is_live),r.live_state.dvr&&r.emit("dvr",e.progress)},200)}),r.on(p,(function(){r.setOpts({live:wr(r)})})),r.on("durationchange",(function(t){const e=wr(r),i=e?Dr(r):t.data||r.duration;isNaN(i)||r.setOpts({live:e,duration:i})})),r.on(["playlist/advance","src"],e=>{if(r.root.classList.contains("is-livecountdown"))return kr(r,t);r.currentSrc&&("src"===e.type&&["is-playlist",ft].some(t=>r.root.classList.contains(t))||kr(r,t))}),r.on(D,(function(r){var i,n;t.seekable=void 0===(null===(i=null==r?void 0:r.data)||void 0===i?void 0:i.seekable)||r.data.seekable;const s=null===(n=r.data)||void 0===n?void 0:n.ui;if("number"!=typeof s)return;const a=e.classList;a.toggle("use-play-1",!(32&s||64&s)),a.toggle("use-play-2",(32&s)>0),a.toggle("use-play-3",(64&s)>0),a.toggle("use-thin-controlbar",(128&s)>0),a.toggle("no-title",(256&s)>0),a.toggle("no-description",(512&s)>0),a.toggle("logo-on-right",(8&s)>0),a.toggle("logo-on-bottom",(32768&s)>0),a.toggle("use-drag-handle",(16&s)>0),a.toggle("no-controls",(1024&s)>0),a.toggle("no-duration",(2048&s)>0),a.toggle("no-header",(4096&s)>0),a.toggle("no-mute",(4&s)>0),a.toggle("no-volume",(2&s)>0),a.toggle("no-fullscreen",(1&s)>0),a.toggle("no-touch-zones",(16384&s)>0)}));let c=null;[d,u].forEach(t=>n.addEventListener(t,(function(t){r.hasState("is-touch-device")&&t.type===d||("number"==typeof c&&clearTimeout(c),r.setState("is-hovered",!0),c=0==r.paused&&setTimeout((function(){r.setState("is-hovered",!1)}),2e3))})))}function kr(t,e){delete e.live_start_time,t.setOpts({live:!1}),t.live_state.dvr=void 0,t.live_state.dvr_window=void 0,delete e.live,delete e.poster,delete e.duration,delete e.title,delete e.description}function Or(t,e,r){if(ye.from_token(t.token||"").is_granted(ye.permissions.NO_METERING))return;ge.id(t.token||"")&&r.once(E,async()=>await async function t(e,r){const i=ge.id(r||"");e.once("src",()=>{e.once(E,()=>t(e,r))}),function(t,e){if(!function(t){return ye.from_token(t).is_granted(ye.permissions.WOWZA_VIDEO)}(e))return;if(function(t){try{return new URL(t).hostname.endsWith(".wowza.com")}catch(t){return!1}}(t.original_src))return;t.emit("error:fatal",{reason:"token",details:"This token only allows wowza video sources"})}(e,r);if(401==(await fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:i,factor:1,rnd:Math.random().toString(36).substring(2)})})).status)return e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})}(r,t.token||""))}var Cr={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class I18n{init(t,e,r){r.reaper&&r.reaper.set("translations",Yt(I18n,t,"en"))}}I18n.en=Cr;const Pr="health:record",xr="rebuffer";var Mr=Object.freeze({__proto__:null,RECORD:Pr,REBUFFER:xr,DISPLAY:"display"});const Nr=navigator;function Fr(t){var e,r;const i=null===(e=t.hls)||void 0===e?void 0:e.bandwidthEstimate;return i?1e-6*i:(null===(r=Nr.connection)||void 0===r?void 0:r.downlink)||-1}function Ur(t,e){return async function(t,e){try{await fetch(t,{body:e,method:"POST",mode:"no-cors"})}catch(t){}}(t,JSON.stringify({events:e}))}const Br="https://ljsp.lwcdn.com".concat("/web/public/countdown/time.json"),Gr=window,Hr=Gr._flowplayerTimekeeper||(Gr._flowplayerTimekeeper={});async function jr(){const t=Hr.cachedServerOffset;if(t)return t;const e=Hr.pendingRequest||(Hr.pendingRequest=fetch(Br)),r=await e,i=parseInt(r.headers.get("age")||"0"),n=await r.json(),s=Date.now()-n.millisUtc-1e3*i;return Hr.cachedServerOffset=s,Hr.cachedServerOffset}const Vr=t=>{switch(t){case!0:return At.ON;case!1:return At.OFF;default:return t}},Kr=[],qr="https://ihi.flowplayer.com/v1/health/events";function Wr(t){if(t.suspended)return;const e=Kr.slice(0);Kr.length=0,0!=e.length&&(t.logger.log(`:dispatch events={${e.length}}`),Ur(function(){try{return"undefined"==typeof window?qr:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:qr}catch(t){return qr}}(),e))}async function zr(t,e,r){const i=await Xr();Kr.push(Object.assign(e,i)),t.logger.log(":enqueue",e.event,e),Kr.length<10&&!r||Wr(t)}const Yr=()=>{var t,e;try{const r=window;return null===(e=null===(t=null==r?void 0:r.google)||void 0===t?void 0:t.ima)||void 0===e?void 0:e.VERSION}catch(t){return}},Xr=async()=>{const t=Date.now();try{return{adjusted_time:t-await jr(),client_time:t}}catch(e){return{client_time:t}}},Qr=(t,e)=>Object.assign(t,{detail:e}),$r=(t,{event:e,media_session_id:r,session_id:i})=>({event:e,media_session_id:r,session_id:i,device_id:t.deviceId(),version:"3.7.1-rc.3",commit:"b893dcb402b528cdccb5aff51fbdbd761e5c7d57",ima_sdk_version:Yr(),preload:t.opt("preload"),autoplay:Vr(t.opt("autoplay")),live:t.opt("live"),dvr:!!t.live_state.dvr,source:t.original_src,downlink_mbs:Fr(t),page_url:sr(),player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token,plugins:t.plugins.map(t=>t.constructor.name).sort((t,e)=>t.localeCompare(e)),current_time:t.currentTime,external_media_id:t.opt("external_media_id")}),Zr=t=>({bitrate:null==t?void 0:t.bitrate,resolution:null==t?void 0:t.attrs.RESOLUTION,frame_rate:null==t?void 0:t.attrs["FRAME-RATE"]});function Jr(t,e,r,i){const n=$r(e,t.eventInfo(r)),{before:s,after:a}=i;zr(t,((t,e,r)=>Object.assign(t,{state:{before:e,after:r}}))(n,Zr(s),Zr(a)))}const ti=(t,e)=>{let r=null;return(...i)=>{null!==r&&(clearTimeout(r),r=null),r=setTimeout(()=>e(...i),t)}},ei=Qt();class Health{constructor(t,e){this.session_id=ei,this.suspended=!1,this.logger=Pe("health",e.opts),this.media_session_id=Qt(),this.analyticsLoop=setInterval(()=>Wr(this),2e3),e.on(w,()=>clearInterval(this.analyticsLoop));const r=this;if(e.health={get media_session_id(){return r.media_session_id},set media_session_id(t){r.media_session_id=t},get session_id(){return r.session_id},set session_id(t){r.session_id=t},toggle(t){t?r.resume():r.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const e=e=>t.instances.forEach(t=>t.emit(e.type));document.addEventListener("visibilitychange",t=>{"hidden"==document.visibilityState&&e(t)}),window.addEventListener("pagehide",e)}}eventInfo(t){return{event:t,media_session_id:this.media_session_id,session_id:this.session_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>Wr(this),2e3)}init(t,e,r){!function(t){t.on(T,(function(e){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit(xr)}))}(r),r.on("display",t=>{zr(this,$r(r,this.eventInfo(t.type)),!0)}),r.on(Pr,({detail:t})=>{const e=$r(r,this.eventInfo(t.event));Object.assign(e,t.detail||{}),zr(this,e)}),[_,m,a,p,g,v,T,xr].forEach(t=>{r.on(t,t=>{zr(this,$r(r,this.eventInfo(t.type)))})}),[E,y,A,b,S,h,f].forEach(t=>{r.on(t,t=>{zr(this,$r(r,this.eventInfo(t.type)))})}),r.on("volumechange",ti(800,t=>{const e=$r(r,this.eventInfo(t.type));zr(this,Qr(e,{volume:parseFloat(r.volume.toFixed(2)),muted:r.muted}))})),r.on("resize",ti(800,t=>{const i=$r(r,this.eventInfo(t.type));zr(this,Qr(i,{height:e.clientHeight,width:e.clientWidth}))})),r.on("hls/failover",t=>{const e=$r(r,this.eventInfo(t.type)),i=t.detail,{reason:n,from:s}=i;zr(this,Qr(e,{reason:n,from:s}))}),r.on("qualitychange",({type:t,detail:e})=>{switch(e.kind){case"hls":return Jr(this,r,t,e)}});let n=Date.now()+5e3;r.on("timeupdate",t=>{if(Date.now()<n)return;n=Date.now()+5e3;const e=$r(r,this.eventInfo(t.type));var i;zr(this,Qr(e,{duration:(i=r.duration,Number.isFinite(i)?i:i===1/0?-1:void 0)}))}),r.addEventListener(i,t=>{const e=$r(r,this.eventInfo(t.type)),i=t.error||r.error;if(!i)return zr(this,e,!0);const n=i.code,s={error_message:i.message||hr(n),error_code:n,error_stack:i.stack||""};return zr(this,Qr(e,s),!0)}),r.on("src",t=>{var e;const i=null===(e=t.detail)||void 0===e?void 0:e.src;if("string"!=typeof i)return;if(!vr(r.original_src))return;if(!vr(i))return;if(i==r.original_src)return;this.media_session_id=Qt();zr(this,$r(r,this.eventInfo(t.type))),Wr(this)}),r.on("visibilitychange",t=>{zr(this,$r(r,this.eventInfo(t.type))),Wr(this)})}}Health.events=Mr,Health._UNLOAD_SUBSCRIBED=!1,ue(window,Health);class FlowplayerComponent extends HTMLElement{constructor(t){super(),this.player=t}}class FlowplayerLogo extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-logo");const e={logo:""};t.on(D,t=>{var r;const i=e.logo,n=(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.logo)||"";i!=n&&(e.logo=n,this.set_logo(n,t.detail.logo_alt_text,t.detail.logo_href))})}set_logo(t,e,r){this.innerHTML="";const i=document.createElement("img");if(!t)return;if(i.src=t,e&&(i.alt=e),!r)return this.append(i);const n=document.createElement("a");n.href=r,n.append(i),this.append(n)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-duration"),t.on(D,t=>{var e;const r=(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.duration)||NaN;this.innerText=isFinite(r)?Wt(r):""})}}const ri={name:"fp-fullscreen",translation_key:"core.fullscreen"},ii={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},ni={name:"fp-play",translation_key:"core.play"},si={name:"fp-pause",translation_key:"core.pause"},ai={translation_key:"core.mute",name:"fp-volume-mute-unmute"},oi={translation_key:"core.play",name:"fp-small-play"},li={translation_key:"core.pause",name:"fp-small-pause"},di={name:"fp-fast-forward"},ui={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(t,e){super(t),this.classList.add("fp-icon",e.name),e.title&&this.setAttribute("title",e.title),e.title&&this.setAttribute("aria-label",e.title),e.translation_key&&this.setAttribute("aria-label",t.i18n(e.translation_key)),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(n,(function(t){this.active_menu&&!t.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(t=>{var e;const r=t.root.querySelector("details[open].fp-menu-container");r&&(r.open=!1,null===(e=r.querySelector("summary"))||void 0===e||e.removeAttribute("aria-expanded"),t.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const ci={passive:!0};var hi;function fi(t,e){let r=0,i=-1,n=-1;const s=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),a=t.classList;t.id=s,a.remove(hi.GRABBING),a.remove(hi.TOUCHING);const o=e.onseek||fr,l=e.onstart||fr,h=e.onend||fr,f=e.onmouse||fr,p=e.ontouch||fr,g=e.ontouchend||fr;function v(e){!function(){const e=t.getBoundingClientRect();r=e.left,i=e.width}();let n=(function(t){return"function"==typeof window.TouchEvent&&t instanceof TouchEvent}(e)?e.changedTouches[0].pageX:e.pageX)-r;return n>i&&(n=i),n<0&&(n=0),n/i*100}function m(e){const r=v(e);r!=n&&(o(t,r),n=r)}return t.addEventListener("touchstart",(function(e){pi(t,e)&&(a.add(hi.TOUCHING),gi(t.parentElement)&&(a.add(hi.GRABBING),p(t,v(e)),l(t,v(e)),m(e)))}),ci),t.addEventListener(u,(function(e){m(e),f(t,v(e))}),ci),t.addEventListener(c,(function(e){setTimeout((function(){a.remove(hi.TOUCHING)}),500),pi(t,e)&&(a.remove(hi.GRABBING),g(t,v(e)),h(t,v(e)),i=0)}),ci),t.addEventListener("touchcancel",(function(){a.remove(hi.GRABBING,hi.TOUCHING),i=0}),ci),t.addEventListener("mousedown",(function(e){a.contains(hi.TOUCHING)||(document.addEventListener(d,m),a.add(hi.GRABBING),l(t,v(e)),e.preventDefault(),m(e))})),t.addEventListener(d,(function(e){a.contains(hi.TOUCHING)||f(t,v(e))})),document.addEventListener("mouseup",(function(e){a.contains(hi.TOUCHING)||(document.removeEventListener(d,m),a.contains(hi.GRABBING)&&(a.remove(hi.GRABBING),h(t,v(e)),i=0))})),t}function pi(t,e){const r=e.target;return!!r&&(r&&!r.closest(t.id)||!gi(t.parentElement)||!t.classList.contains(hi.TOUCHING))}function gi(t){if(!t)return!1;const e=window.getComputedStyle(t);return"0"!==e.width&&"0"!==e.height&&"0"!==e.opacity&&"none"!==e.display&&"hidden"!==e.visibility}!function(t){t.GRABBING="has-grab",t.TOUCHING="has-touch"}(hi||(hi={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(t){super(t),this.className="fp-volume";const e=t.root.classList,r=e.contains("is-tiny")?6:e.contains("is-small")?8:10,i=Array.from({length:r}).map(()=>{const t=document.createElement("i");return t.className="fp-tick",t});this.append(...i),fi(this,{onseek:(e,r)=>{r>0&&(t.muted=!1,t._storage.removeItem("mute")),t._storage.setItem("volume",(t.volume=r/100).toString()),this.adjustVolumeSlider(t.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",t.i18n("core.volume","volume")),t.on("volumechange",()=>{const e=0==t.volume||t.muted;e&&this.adjustVolumeSlider(0);const r=t.opt("ui");this.classList.contains(hi.GRABBING)||e&&"number"==typeof r&&(4&r)>0||this.adjustVolumeSlider(t.volume)})}adjustVolumeSlider(t){this.setAttribute("aria-valuenow",t.toString()),this.setAttribute("aria-valuetext",Math.round(100*t)+"%");const e=Array.from(this.querySelectorAll(".fp-tick")),r=Math.round(t*e.length);e.forEach((t,e)=>{t.classList.toggle("fp-color",e<r)})}}function vi(t,e){if(!t.parentElement)return;const r=t.clientWidth/t.parentElement.clientWidth*100/2;t.style.left=e-r+"%",t.style.display="block"}function mi(t,e){if(isNaN(t.duration))return;const r=t.buffered;r.length&&(e.style.width=Math.min(r.end(r.length-1)/t.duration*100,100)+"%")}function yi(t,e){t.style.width="0",e.style.display="none"}function Ei(t,e,r){if(!e.seekable||0==e.seekable.length)return;vi(r,t);const i=Lr(e),n=(100-Math.max(0,Math.min(t,100)))/100*(i.head-i.tail);r.innerText="-"+Wt(n)}function Ti(t){try{t.dvr_offset=0,t.currentTime=Rr(t)}catch(t){console.warn("failed to seek to now: %j",t)}}function _i(t,e){t/=100,e.currentTime=function(t,e){if(e>1||e<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;const r=Lr(t);return r.tail+e*(r.head-r.tail)}(e,t)}function Si(t,e){t.style.width="0",e.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(t){let e;super(t),this.bufferEle=Vt("fp-buffer"),this.progress=Vt("fp-progress","fp-color"),this.tooltipEle=Vt("fp-timestamp"),this.proposedSeekBar=Vt("fp-hover"),this.dragger=Vt("fp-dragger","fp-color"),this.classList.add("fp-timeline","fp-bar"),this.tooltipEle.style.display="none",this.setAttribute("role","slider"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",t.i18n("timeline","Timeline")),this.setAttribute("aria-valuenow","0"),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);const r=requestAnimationFrame;let i=void 0;const n=()=>{0==t.reaper||e.live||(!function(t,e){e.style.width=t.currentTime/t.duration*100+"%"}(t,this.progress),i=void 0,t.paused||this.classList.contains(hi.GRABBING)||i||(i=setTimeout(n,200)))},s=()=>!!this.player.opt("seekable",!0)&&!isNaN(this.player.duration);fi(this,{onseek:(r,i)=>{if(s())switch(!!e.live){case!0:Ei(i,t,this.tooltipEle);break;case!1:!function(t,e,r){const i=e.duration*(t/100);if(e.disabled&&i>e.currentTime)return!1;r.style.width=t+"%",e.currentTime=i}(i,t,this.progress),vi(this.tooltipEle,i)}},onstart:()=>{s()&&(t.emit("timeline/gesture/start"),!t.hasState("is-casting")&&t.setState(it,!0),e.live||function(t){t.style.display="block"}(this.tooltipEle))},onend:function(i,s){r(n),0!=e.seekable&&e.live&&_i(s,t)},ontouchend:()=>{e.live?Si(this.proposedSeekBar,this.tooltipEle):yi(this.proposedSeekBar,this.tooltipEle),setTimeout(()=>t.emit("timeline/gesture/end"),0)},onmouse:(r,i)=>{if(s()&&(t.emit("timeline/gesture/move",{percent:i}),!this.classList.contains(hi.GRABBING)))switch(!!e.live){case!0:!function(t,e){e.style.width=t+"%"}(i,this.proposedSeekBar),Ei(i,t,this.tooltipEle);break;case!1:!function(t,e){e.style.width=t+"%"}(i,this.proposedSeekBar),function(t,e,r){if(isNaN(t)||isNaN(e.duration))return;vi(r,t),r.innerHTML="";const i=document.createElement("span");i.innerText=Wt(t/100*e.duration),r.append(i)}(i,t,this.tooltipEle)}}}),t.on(D,(function(t){t.data&&(e=t.data)})),t.on(E,()=>r(n)),t.on(v,()=>{0==t.reaper||e.live||mi(t,this.bufferEle)}),t.on("dvr",t=>{this.progress.style.width=t.detail+"%"}),t.on("timeupdate",()=>{0!=t.reaper&&(r(n),this.setAttribute("aria-valuenow",t.currentTime+""),this.setAttribute("aria-valuetext",Math.round(t.currentTime)+t.i18n("core.sec","sec")),e.live||mi(t,this.bufferEle))}),t.on(p,()=>{0!=t.reaper&&(e.live||mi(t,this.bufferEle))}),t.on("durationchange",e=>{if(0==t.reaper)return;const r=wr(t)?Dr(t):e.data||t.duration;isNaN(r)||(this.setAttribute("aria-valuemax",r+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(l,()=>{t.emit("timeline/gesture/end"),e.live?Si(this.proposedSeekBar,this.tooltipEle):yi(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(t){super(t),this.handleChapters(t)}handleChapters(t){const e=document.createElement("div");let r;this.addEventListener("chapters:new",t=>{e.innerText="",this.querySelectorAll(".fp-chapter").forEach(t=>this.removeChild(t)),t.data&&t.data.forEach(t=>{const i=document.createElement("div");i.className="fp-chapter",i.style.left=t.left,i.style.bottom=i.style.top="0",i.style.width=t.width,i.title=t.title,i.onmouseover=()=>{e.innerText=t.title},i.onmouseleave=()=>{e.innerText=r||""},this.appendChild(i)})}),this.addEventListener("chapter:changed",i=>{var n;const s=i.data;s&&(e.parentNode||(null===(n=Ht(t,x))||void 0===n||n.insertAdjacentElement("beforebegin",e),e.classList.toggle("fp-togglable",!0),e.classList.toggle("fp-chapter-info",!0)),r=s,e.innerText=s)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-live-status");const e=Vt("fp-live-text"),r=Vt("fp-live-indicator","fp-color");e.textContent="live",this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.append(r,e),this.addEventListener(n,(function(){Ti(t)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(t){let e;super(t),this.classList.add("fp-duration"),this.setAttribute("aria-hidden","true"),t.on(D,r=>{if(0==t.reaper||!r.data)return;e=r.data;const i=wr(t)?NaN:r.data.duration||0;if(isNaN(i)||i>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Wt(i)}),t.on(p,()=>{0==t.reaper||e.live||function(t,e){t.duration&&(e.innerText=Wt(t.duration))}(t,this)})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(t){let e;super(t),this.classList.add("fp-elapsed"),this.innerText=Wt(0),this.setAttribute("aria-hidden","true"),t.on(D,t=>{t.data&&(e=t.data)}),t.on("timeupdate",()=>{0!=t.reaper&&(e.live?function(t,e){e.innerText=Wt(t.currentTime)}(t,this):function(t,e){e.innerText=Wt(t.currentTime)}(t,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-btns","fp-small-switch");const e=_t(t,q),r=_t(t,K);e.addEventListener("click",(function(){t.togglePlay(),setTimeout((function(){r.focus&&r.focus()}),100)})),r.addEventListener("click",(function(){t.togglePlay(),setTimeout((function(){e.focus&&e.focus()}),100)})),this.append(e,r)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(t,e){super(t),this.classList.add(e);const r=this.classList.contains("fp-left-zone")?-1:1,i=document.createElement("span"),n=_t(t,this.classList.contains("fp-left-zone")?Y:"flowplayer-fast-forward-icon");n.removeAttribute("tabindex"),i.classList.add("fp-zone-seconds"),this.append(i,n);t.on(b,()=>{i.innerText=""}),t.on("seek:queued",t=>{const e=t.data;if(!e)return;if("number"!=typeof e.offset)return;const r=e.offset;if(0==r)return this.reset_zone();r>0&&this.classList.contains("fp-right-zone")||r<0&&!this.classList.contains("fp-right-zone")?this.render_zone_state(r):this.reset_zone()}),t.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener(c,(function(e){isNaN(t.duration)||isNaN(t.currentTime)||16384&t.opt("ui")||t.hasState(lt)||!t.hasState("will-seek")&&!t.hasState(ct)||t.enqueueSeek(5*r)&&(e.stopPropagation(),e.preventDefault())}))}reset_zone(){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText="")}render_zone_state(t){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText=Math.abs(t)+"")}}class FlowplayerError extends FlowplayerComponent{constructor(t){super(t),this.className="fp-error",this.message=document.createElement("p"),this.message.className="error-message",this.append(this.message),this.addEventListener("error",t=>{const e=t.detail;e&&(this.message.textContent=e.formatted_data.message)})}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(t,e,...r){super(t),this.className=e;const i=t.createComponents(...r);this.append(...i),"fp-left"!==e&&i.forEach(e=>{e.addEventListener(n,()=>t.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-wait"),Array(...Array(4)).map((t,e)=>e).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-middle-zone");const e=t.createComponents(V,"flowplayer-middle-buttons");this.append(...e)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-switch"),[W,z].forEach(e=>{const r=_t(t,e);r.removeAttribute("tabindex"),this.append(r)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-volume-control");const e=_t(t,X);this.append(e),!r().ios&&this.append(_t(t,U)),e instanceof FlowplayerIcon&&e.addEventListener(n,(function(){t.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-header"),this.append(...t.createComponents("flowplayer-header-left-zone",G)),t.reaper&&t.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-controls","fp-togglable"),this.append(...t.createComponents("flowplayer-control-buttons",M,N,F,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(t,e){super(t,e),this.setAttribute("role","button")}}class FlowplayerMiddle extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-middle"),this.append(...t.createComponents("flowplayer-middle-left-zone",j,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),t.reaper&&t.reaper.set("middle",this),this.handleClick(t),this.handleTouch(t),t.once("beforeplay",()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")})}handleClick(t){[n,s].forEach(e=>this.addEventListener(e,(function(r){if(!(r.defaultPrevented||t.root.classList.contains("is-endscreen")||e===s&&t.root.classList.contains("no-fullscreen")))return r.preventDefault(),t.emit(r.type),!1}))),t.on(n,(function(e){setTimeout((function(){e.defaultPrevented||t.togglePlay()}),0)})),t.on(s,(function(e){setTimeout((function(){e.defaultPrevented||t.toggleFullScreen()}),0)}))}handleTouch(t){let e=!1;this.addEventListener(c,(function(e){e.cancelable&&!t.hasState("is-endscreen")&&(e.preventDefault(),t.emit(e.type,{source:e}))})),t.on(c,(function(r){setTimeout((function(){if(r.defaultPrevented)return;if(t.ended)return t.togglePlay(!0);const i=t.hasState(rt);e&&clearTimeout(e),(i||t.hasState(ct)||t.hasState("no-autoplay"))&&(t.hasState(ct)&&(t.setState(ct,!1),t.setState("is-hovered",!1)),t.togglePlay(),i)||(t.setState(ct,!0),t.paused||(e=setTimeout((function(){e=!1,t.setState(ct,!1),t.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(t){super(t),this.classList.add("fp-ui"),this.append(...t.createComponents(B,H,x))}}Ue.extensions.unshift.apply(Ue.extensions,[I18n,Analytics$1,Health,class Default{constructor(t){St(t,C,FlowplayerUi),St(t,"flowplayer-error",FlowplayerError),St(t,x,FlowplayerControls),St(t,M,FlowplayerLiveStatus),St(t,"flowplayer-control-duration",FlowplayerDuration),St(t,F,t.extensions.find(t=>"Chapters"===t.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),St(t,N,FlowplayerElapsedTime),St(t,U,FlowplayerVolumeBar),St(t,"flowplayer-volume-control",FlowplayerVolumeControl),St(t,"flowplayer-control-buttons",FlowplayerControlButtons),St(t,B,FlowplayerHeader),St(t,P,FlowplayerLogo),St(t,"flowplayer-header-duration",FlowplayerHeaderDuration),St(t,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(t){super(t,"fp-left","flowplayer-header-duration")}}),St(t,G,class extends FlowplayerHeaderLeftRight{constructor(t){super(t,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),St(t,H,FlowplayerMiddle),St(t,j,FlowplayerMiddleZone),St(t,V,FlowplayerMiddleWait),St(t,"flowplayer-middle-buttons",FlowplayerMiddleButtons),St(t,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(t){super(t,"fp-right-zone")}}),St(t,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(t){super(t,"fp-left-zone")}}),St(t,K,class extends FlowplayerIcon{constructor(t){super(t,oi),this.setAttribute("role","button")}}),St(t,q,class extends FlowplayerIcon{constructor(t){super(t,li),this.setAttribute("role","button")}}),St(t,W,class extends FlowplayerIcon{constructor(t){super(t,ni),this.setAttribute("role","button")}}),St(t,z,class extends FlowplayerIcon{constructor(t){super(t,si),this.setAttribute("role","button")}}),St(t,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(t){super(t,ri)}}),St(t,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(t){super(t,ii)}}),St(t,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(t){super(t,di)}}),St(t,Y,class extends FlowplayerIcon{constructor(t){super(t,ui)}}),St(t,X,class extends FlowplayerIcon{constructor(t){super(t,ai),this.classList.add("fp-volumebtn"),this.setAttribute("role","switch"),t.on("volumechange",()=>{const e=0==t.volume||t.muted;this.setAttribute("aria-label",t.i18n("core.muted","Muted")),this.setAttribute("aria-checked",e?"true":"false")})}})}init(t,e,r){Or(t,0,r),Ir(t,e,r),function(t,e,r){"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}(0,0,r)}}]);var bi=Object.assign(Ue,{ui:Sr,i18n:I18n}),Ai=Ge(He((function(t,e){var r;"undefined"!=typeof window&&(r=()=>(()=>{var t={"./src/config.ts":
2
2
  /*!***********************!*\
3
3
  !*** ./src/config.ts ***!
4
4
  \***********************/(t,e,r)=>{r.r(e),r.d(e,{enableStreamingMode:()=>L,hlsDefaultConfig:()=>b,mergeConfig:()=>A});var i=r(/*! ./controller/abr-controller */"./src/controller/abr-controller.ts"),n=r(/*! ./controller/audio-stream-controller */"./src/controller/audio-stream-controller.ts"),s=r(/*! ./controller/audio-track-controller */"./src/controller/audio-track-controller.ts"),a=r(/*! ./controller/subtitle-stream-controller */"./src/controller/subtitle-stream-controller.ts"),o=r(/*! ./controller/subtitle-track-controller */"./src/controller/subtitle-track-controller.ts"),l=r(/*! ./controller/buffer-controller */"./src/controller/buffer-controller.ts"),d=r(/*! ./controller/timeline-controller */"./src/controller/timeline-controller.ts"),u=r(/*! ./controller/cap-level-controller */"./src/controller/cap-level-controller.ts"),c=r(/*! ./controller/fps-controller */"./src/controller/fps-controller.ts"),h=r(/*! ./controller/eme-controller */"./src/controller/eme-controller.ts"),f=r(/*! ./controller/cmcd-controller */"./src/controller/cmcd-controller.ts"),p=r(/*! ./utils/xhr-loader */"./src/utils/xhr-loader.ts"),g=r(/*! ./utils/fetch-loader */"./src/utils/fetch-loader.ts"),v=r(/*! ./utils/cues */"./src/utils/cues.ts"),m=r(/*! ./utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts"),y=r(/*! ./utils/logger */"./src/utils/logger.ts");function E(){return(E=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var b=_(_({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:i.default,bufferController:l.default,capLevelController:u.default,fpsController:c.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:m.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},{cueHandler:v.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:a.SubtitleStreamController,subtitleTrackController:o.default,timelineController:d.TimelineController,audioStreamController:n.default,audioTrackController:s.default,emeController:h.default,cmcdController:f.default});function A(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return E({},t,e)}function L(t){var e=t.loader;e!==g.default&&e!==p.default?(y.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):(0,g.fetchSupported)()&&(t.loader=g.default,t.progressive=!0,t.enableSoftwareAES=!0,y.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}},"./src/controller/abr-controller.ts":
@@ -283,4 +283,4 @@
283
283
  * https://github.com/lancedikson/bowser
284
284
  * MIT License | (c) Dustin Diaz 2012-2015
285
285
  * MIT License | (c) Denis Demchenko 2015-2019
286
- */const fs=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 ns}static get ENGINE_MAP(){return os}static get OS_MAP(){return as}static get PLATFORMS_MAP(){return ss}}.parse(window.navigator.userAgent),{platform:ps,os:gs,browser:vs}=fs,ms=t=>t&&t.toLowerCase();var ys={rnd:Math.random().toString(36).substr(2,32),os:ms(gs.name+(gs.versionName?" "+gs.versionName:"")),device:ms(ps.type),browser:ms(vs.name),browser_version:(vs&&vs.version?vs.version:"unknown").split(".").shift(),plugin_version:"3.7.1-rc.2"};const Es="https://fp-eu-w1-aai.flowplayer.com/in",Ts="POST",_s=["ad-requested","ad-request-error","ad-request-completed","ad-completed","ad-started","ad-error","ad-skipped"],Ss=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],bs=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],As=Pe("ads/analytics"),Ls=RequestQueue.of(),ws=(...t)=>Object.assign({},...t);class Analytics{constructor(t,e={}){this.emitter=t,this.metadata=ws(ys,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),As(this),this.wireup()}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,r)=>Object.assign(e,{[r]:t[r]}),{}))(e,...t.valid_keys)}static mergeMetadata(t,e={}){return t.metadata=Analytics.pluck_valid_keys(t,ws(t.metadata,e,{player_version:"3.7.1-rc.2"})),t}wireup(){this.events.forEach(t=>{this.emitter.on(t,e=>{const r=e.detail,i=ws(this.metadata,{event_type:t},r),n=Analytics.pluck_valid_keys(this,i),s=Analytics.ensure_required_keys(this,n);if(As(`Event[${t}]`,{payload:n,observation:r}),s.length)return As(`Analytics.validate_metadata() failed for\n Event[${t}]\n missing keys: ${s}`,n);RequestQueue.rpush(Ls,[Es,Ts,n])})})}destroy(){this.emitter=this.metadata=this.events=this.required_keys=this.optional_keys=this.valid_keys=void 0}}const Ds=Pe("ads/controller"),Rs={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10};class AdsController extends 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 r=new CustomEvent(t,{detail:e||{}});this._bus.dispatchEvent(r)}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)}}{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({},Rs),t),this.analytics=(e=this,Analytics.of(e,{required_keys:Ss,optional_keys:bs,events:_s})),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();this.analytics=void 0,this.opts=void 0,this.adapter=void 0,this._state=void 0,this._schedule=void 0,this._lastAd=void 0,this._macros=void 0}stop(){this.adapter&&this.adapter.stop()}onContentNewSrc(){this._state.reset(),this.adapter.destroyManager(),this.adapter.contentComplete()}wireup(){const t=()=>{var t;const e=new CustomEvent("ad/playing");null===(t=this.videoTag)||void 0===t||t.dispatchEvent(e),this._state.toggleState(es.PLAYING,!0)};this.on("ad-play-requested",t),this.on("ad-started",t),this.on("ad-resumed",t);const e=()=>{var t;if(!this.adPlaying)return;const e=new CustomEvent("ad/paused");null===(t=this.videoTag)||void 0===t||t.dispatchEvent(e),this._state.toggleState(es.PLAYING,!1)};this.on("ad-break-completed",e),this.on("ad-teardown",e),this.on("ad-playback-error",e),this.on("ad-request-error",e),this.on("ad-paused",e),this.on("ad-skipped",e),this.on("ad-completed",e),this.on("ad-break-completed",()=>{requestAnimationFrame(()=>{var t;const e=new CustomEvent("ad/complete");null===(t=this.videoTag)||void 0===t||t.dispatchEvent(e),this._state.toggleState(es.BREAK_ACTIVE,!1)})}),this.on("ad-adapter-init-failed",()=>{console.error("Adapter init failed"),e(),this._state.toggleState(es.FATAL_ERROR,!0)}),this.on("reload-ad-requested",async t=>{if(Ds("Ads.on(RELOAD_AD_REQUESTED)",t),this._schedule){if(e(),t)return this._schedule.reset(this._schedule.getAds());this._state.hasAny(es.AD_AVAILABLE)&&(this._schedule.decrement(),this._state.toggleState(es.AD_AVAILABLE,!1))}})}async initialize(t,e={},r){return Ds("Ads.initialize():",t,e,r),this._state.toggleState(es.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(r),this}get videoTag(){return this.adapter.getVideoTag()}get adInfo(){return this.adapter.getAdInfo()}async setVideoTag(t){Ds("Ads.setVideoTag():",t),await this.adapter.setVideoTag(t),this.trigger("ad-videotag-attached",t),this.adapter.isReady()&&await this.adapterInitialized(),t.on("request/ad/pause",()=>this.adapter.pause()),t.on("request/ad/play",()=>this.adapter.resume()),t.on("request/ad/muteunmute",()=>t.toggleMute()),t.on("volumechange",()=>{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("ad-break-completed",()=>{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("ad-videotag-attached",e=>{this.once(En,()=>t(e))})})}async adapterInitialized(t){Ds("Ads.adapterInitialized()"),this._state.toggleState(es.INITIALIZING,!1),this._state.toggleState(es.BREAK_ACTIVE,!!this.hasPreroll()),await this.setCurrentTime(0,t),this.checkIfBreakComplete(),this.adapter.isAdPod()||t&&!this.opts.autoplay||this.trigger("ad-teardown")}async fetchNextAd(t,e=0){var r,i;if(!this._schedule)return;if(!this.adapter.isReady())return;if(e>50)throw this._state.toggleState(es.FATAL_ERROR,!0),this._state.toggleState(es.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");const n=(null===(r=this._schedule)||void 0===r?void 0:r.getNextAd())||(null===(i=this._schedule)||void 0===i?void 0:i.getPostroll());if(!n||this.adapter.canDismissNonLinear()||-1===t)if(this._schedule.waitForLoad(t,n,this.opts.preload_ads))this._state.toggleState(es.FETCHING_AD,!1);else if(n===this._schedule.getPostroll()&&this._schedule.setPostrollActive(),this._schedule.isDrained()||this._schedule.increment(),n){Ds("Ads.fetchNextAd",n),this._state.toggleState(es.FETCHING_AD,!0);try{return await this.requestAd(n),this._state.toggleState(es.AD_AVAILABLE,!0),void this._state.toggleState(es.FETCHING_AD,!1)}catch(r){if(Ds("Ads.fetchNextAd(err: %o, ad: %o)",r,n),this.setLastAd(n),n!==this._schedule.getPostroll())return await this.fetchNextAd(t,++e)}}else this._state.toggleState(es.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,r=!1){if(!this._schedule)return;if(!this.adapter.isReady())return;if(this._state.hasAny(es.FETCHING_AD))return;if(this._state.hasAny(es.PLAYING)&&this.adapter.isLinearAd())return;const i=0===t&&0===this._schedule.getNextIndex();try{if(r&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(t),this._state.hasAny(es.AD_AVAILABLE)||await this.fetchNextAd(t),!this._state.hasAny(es.AD_AVAILABLE)||!this.shallPlayAd(t)||e)return;await this.playAd(),await this.setCurrentTime(t),this.checkIfBreakComplete()}catch(t){Ds("setCurrentTime: Error(from: setCurrentTime, message: %s)",t.message)}finally{i&&this.trigger("ad-preroll-finished")}}async playAd(){var t;if(!this._state.hasAny(es.AD_AVAILABLE))return;this._state.toggleState(es.AD_AVAILABLE,!1),this._state.toggleState(es.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(es.BREAK_ACTIVE))return Ds("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());Ds("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(es.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger("ad-break-completed")}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 r;if(!this.adapter.getVideoTag())return;if(!this._state)return;if("ad-break-completed"===t&&this._state.hasAny(es.BREAK_ACTIVE)&&!this.adapter.isAdPod())return Ds("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if(null===(i=e)||"object"!=typeof i||Jn(i)!==Zn)return this.dispatch(t,e);var i;const n=Object.assign({},this.adapter.getOpts()||{},(null===(r=this._schedule)||void 0===r?void 0:r.getCurrentAd())||{},{ad_type:this.ad_type},e);return this.dispatch(t,n)}dispatch(t,e){const r=this.adapter.getVideoTag();if(r){Ds(":dispatch",t,e);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}};r.dispatchEvent(new CustomEvent(Pr,{detail:i}))}catch(t){Ds(":error",t)}te(r,t,e),this.emit(t,e)}}get ad_type(){return this._schedule&&this._schedule.getCurrentType()}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&&(Ds("Ads.finished"),!(this.adapter.isSharedVideoTag()&&this._state.hasAny(es.PLAYING)&&this.adapter.isLinearAd()))){Ds("Ads.finished: trying to play postroll");try{if(!this._schedule.getPostroll())return Ds("Ads.finished: no postroll found"),await this.adapter.contentComplete();this._state.hasAny(es.AD_AVAILABLE)||await this.fetchNextAd(-1),await this.playAd(),this.adapter.contentComplete()}catch(t){Ds("Ads.finished: postroll failed:",t)}finally{this.trigger("ad-postroll-finished"),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(es.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,r=this.opts.timeout){if(!this._state)return;Ds("Ads.requestAd(ad: %o)",{ad:t,timeout:r,idx:e});const i=await async function t(e){if("function"==typeof e)return[await $n(e)];if("string"==typeof e)return[await $n(e)];if(Array.isArray(e)){const t=e;return await Promise.all(t.map($n))}if("object"==typeof e&&e&&e.adTag)return await t(e.adTag);throw new Error(`\n unhandled ads type ${typeof e}:\n ${JSON.stringify(e)}\n can be:\n | Array<string>\n | string\n | function\n | {adTag: Array<string>|string|function}\n `)}(t);if(void 0===i[e])return Promise.reject(new Error("Ad failed, no fallbacks left"));if(!i[e])return await this.requestAd(i,e+1,r);this.trigger("ad-requested",t);const n=this._macros.compile(i[e],Xn(this.opts,this.adapter.getDimensions()));try{return void await this.adapter.initAd(n,r)}catch(t){return Ds(`Ads.requestAd(:fallback, idx: ${e}, length: ${i.length}, adTag: ${i[e]})\nError `,{adTag:i,err:t}),this.requestAd(i,e+1,r)}}resetSchedule(t){this._schedule&&this._schedule.reset(t)}get adPlaying(){return this._state&&this._state.hasAny(es.PLAYING)}get adBreak(){return this._state&&this._state.hasAny(es.BREAK_ACTIVE)}get adRequesting(){return this._state.hasAny(es.FETCHING_AD)}get adLinear(){return this.adBreak&&this.adapter.isLinearAd()}}var Is=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"}),ks=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 Os(t){return Object.assign({muted:!1,timeout:250,inline:!1},t)}function Cs(t,e){var r=t.muted,i=t.timeout,n=t.inline,s=e(),a=s.element,o=s.source,l=void 0,d=void 0,u=void 0;return a.muted=r,!0===r&&a.setAttribute("muted","muted"),!0===n&&a.setAttribute("playsinline","playsinline"),a.src=o,new Promise((function(t){l=a.play(),d=setTimeout((function(){u(!1,new Error("Timeout "+i+" ms has been reached"))}),i),u=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a.remove(),a.srcObject=null,clearTimeout(d),t({result:e,error:r})},void 0!==l?l.then((function(){return u(!0)})).catch((function(t){return u(!1,t)})):u(!0)}))}var Ps={audio:function(t){return Cs(t=Os(t),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(Is)}}))},video:function(t){return Cs(t=Os(t),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(ks)}}))}};let xs=void 0;async function Ms(t=!0){return xs||(xs=await Ps.video({timeout:500,muted:t}),xs)}const Ns=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"});var Fs=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 Us=["progress","duration","remaining"],Bs=Pe("ads/ui");class AdUI extends HTMLElement{constructor(t,e=document.createElement("div")){super(),this.player=t,this.adContainer=e,this.render(),t.addEventListener("ad/playing",t=>this.updateState(t.type)),t.addEventListener("ad/paused",t=>this.updateState(t.type)),t.addEventListener("ad/complete",t=>this.updateState(t.type)),t.on("ad-progress",t=>{const{remaining:e}=t.detail;this.setAttribute("remaining",e+"")}),t.on("ad/hide-first-frame",t=>{const{root:e}=t.detail;Bs("hideFirstFrame"),e.classList.toggle("ad-hide-first-frame",!0)}),t.on("ad/show-first-frame",t=>{const{root:e}=t.detail;Bs("showFirstFrame"),e.classList.toggle("ad-hide-first-frame",!1)}),t.on("ad/resize",t=>{const{opts:e}=t.detail,r=this.style;e.linear?e.width&&(r.width=e.width+"px"):e.width?this.adContainer.style.width=e.width+"px":r.removeProperty("width"),e.height?r.height=e.height+"px":r.removeProperty("height")}),t.on("ad/set-ui-flags",t=>{let{ui_flags:e}=t.detail;if(e=e||0,this.classList.toggle("is-ad-controls-sticky",(1&e)>0),this.classList.toggle("no-fullscreen",(2&e)>0),this.classList.toggle("no-indicator",(4&e)>0),(8&e)>0){const t=document.createElement("div");t.classList.add("ad-attribution"),t.textContent=this.player.i18n("ads.advertisement","Advertisement"),this.adContainer.append(t)}if(this.classList.toggle("no-volume-bar",0==(64&e)),(32&e)>0&&this.controls&&(this.remaining=document.createElement("div"),this.remaining.classList.add("fp-ad-remaining","fp-color-text"),this.controls.prepend(this.remaining)),(16&e)>0&&this.controls){this.classList.toggle("is-ad-choices",!0);const t=document.createElement("div");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")}),this.controls.append(t)}})}static get observedAttributes(){return Us}updateState(t){["ad/paused","ad/playing"].forEach(e=>{const r=e.replace("/","-"),i=t===e;this.player.setState(r,i),this.classList.toggle(r,i)})}attributeChangedCallback(t,e,r){switch(t){case"duration":return this.onDurationChange(parseFloat(r));case"progress":return this.onProgress(parseFloat(e),parseFloat(r));case"remaining":return this.onRemaining(r)}}onDurationChange(t){}onProgress(t,e){}onRemaining(t){this.remaining&&(this.remaining.textContent=Wt(parseFloat(t)))}render(){this.adContainer.classList.add("fp-ad-container"),this.append(this.adContainer),this.controls=_t(this.player,"flowplayer-ad-controls");const t=_t(this.player,"flowplayer-ad-countdown");this.append(this.controls,t)}}const Gs=Pe("fpads:native:outstream"),Hs={OUTSTREAM:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"};var js,Vs;!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"}(js||(js={})),function(t){t[t.None=0]="None",t[t.Booting=1]="Booting",t[t.Ready=2]="Ready",t[t.Disposed=3]="Disposed"}(Vs||(Vs={}));class Outstream{constructor({ads:t,root:e,content:r,ima:i}){this.state=Vs.None,Gs("creating Outstream instance"),this.content=r,this.ads=t,this.root=e,this.ima=i,this.aspectRatio=r.videoHeight/r.videoWidth,this.dimensions=function(t){if(t.clientWidth>0||t.clientHeight)return mn(t);const e={height:t.style.height};yn(t,"opacity",0),yn(t,"display","absolute"),yn(t,"display","inline-block"),yn(t,"height","auto");const r=mn(t);return yn(t,"height",e.height),yn(t,"opacity",1),r}(this.root),this.adUi=new AdUI(r),this.adContainer=this.adUi.adContainer,this.initialVolumeState={},e.classList.add(Hs.OUTSTREAM),e.append(this.adUi),this.hide(),this.ads.on("ad-pause-content",t=>{var e;if(this.state==Vs.Disposed)return;const r=!!(null===(e=t.detail)||void 0===e?void 0:e.linear);this.ads.resize(Object.assign(Object.assign({},this.dimensions),{linear:r}))}),r.on("resize",t=>{if(this.state==Vs.Disposed)return;const e=t.detail;e&&(this.dimensions={width:e.contentRect.width,height:e.contentRect.height},this.ads.resize(this.dimensions))}),r.on("intersectionchange",t=>{if(this.state==Vs.Disposed)return;const e=t.detail;if(e)switch(this.state){case Vs.Booting:return Gs(":boot skipping intersectionchange");case Vs.None:return this.state=Vs.Booting,this.begin_life_cycle();case Vs.Ready:if(e.ratio>=.5&&this.ads.adPlaying)return;e.ratio>=.5&&this.ads.resume(),e.ratio<.5&&this.ads.pause()}}),this.setup(),setTimeout(()=>(this.state=Vs.Booting,this.begin_life_cycle()),0)}hide(){return this}restore_aspect_ratio(){return Gs(`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.adUi.classList.add("linear","on")}async begin_life_cycle(){this.state=Vs.Ready;const{error:t,result:e}=await Ms(!1),{result:r}=await Ms(!0);this.attach_ad_listeners(),this.initialVolumeState={can_autoplay:!(!e&&!r),muted:!e},Gs("Outstream.show() :autoplay >> sound="+e),t&&this.content&&!e&&(this.content.muted=!0,this.content.volume=0),await this.ads.setVideoTag(this.content),await wn({ads:this.ads,content:this.content,adContainer:this.adContainer,ima:this.ima,state:{listening:!1},config:this.content.opts}),On({content:this.content,ads:this.ads}),this.state=Vs.Ready}attach_ad_listeners(){const t=this.ads;t.once("ad-pause-content",()=>{this.show(),this.ads.adPlaying&&this.ads.pause()}),this.ima.always_show_controls||t.on("vpaid-init",()=>this.adUi.classList.add("is-vpaid"));const e=()=>{An.forEach(t=>this.ads.removeListener(t,e));const t=new CustomEvent(js.OUTSTREAM_TEARDOWN);Gs("Outstream(:teardown)",t),this.content.dispatchEvent(t)};An.forEach(t=>this.ads.once(t,e)),this.content.once(js.OUTSTREAM_TEARDOWN,t=>{setTimeout(()=>{if(t.defaultPrevented)return this.handle_endscreen();this.dispose()},0)})}handle_endscreen(){this.reset_ui(),this.ads.reset(),In({config:this.content.opts,ui:this.adUi,ads:this.ads,adContainer:this.adContainer,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(Ns)})}setup(){this.root.classList.add(Outstream.CLASS.OUTSTREAM),this.root.classList.add(Outstream.CLASS.HIDDEN),this.empty_src()}reset_ui(){const t=this.root;t.classList.remove(Outstream.CLASS.SHOWING),t.classList.remove(Outstream.CLASS.OUTSTREAM),this.adUi.classList.remove("on")}dispose(){if(this.state==Vs.Disposed)return;const t=this.root,e=this.content;this.reset_ui(),t.classList.add(Outstream.CLASS.OUTSTREAM),t.classList.add(Outstream.CLASS.DONE);this.video=this.container=this.ads=0,this.state=Vs.Disposed,e.destroy(),t.innerHTML=""}}function Ks(t){return t&&"number"==typeof t.time}function qs(t){return t&&"number"==typeof t.percentage&&"number"!=typeof t.time}Outstream.CLASS=Hs;const Ws=Pe("ads/ima/sdk");var zs;async function Ys(t){var e;if(null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.ima)return void Ws(":noop");const r=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,r)=>{let i=document.querySelector(`script[src='${t}']`);if(i)return Xs(i,e,r);i=document.createElement("script"),i.setAttribute("state",zs.LOADING),Xs(i,e,r),i.src=t,document.head.appendChild(i)})}(r),void Ws(":loaded")}catch(t){Ws(":error "+t.message,t)}}function Xs(t,e,r){const i=t.getAttribute("state");if(i&&[zs.ERROR,zs.LOADED].includes(i))return e(void 0);t.addEventListener("load",()=>{t.setAttribute("state",zs.LOADED),e(void 0)},{once:!0}),["error","abort"].forEach(e=>{t.addEventListener(e,()=>{t.setAttribute("state",zs.ERROR),r("script failed to load")},{once:!0})})}!function(t){t.LOADING="loading",t.LOADED="loaded",t.ERROR="error"}(zs||(zs={}));const Qs=Pe("ads/index");async function $s(t,e,r){let i=t.autoplay;if(t.autoplay&&(Qs("handling initial autoplay, original_autoplay: ",i),r.autoplay=!1,t.autoplay=0,r.once(m,()=>{setTimeout(()=>{var e;if(!(null===(e=t.ima)||void 0===e?void 0:e.ads)){if(t.autoplay=i,!r.hasState(ht))return r.once("viewenter",()=>r.togglePlay(!0));r.togglePlay(!0)}},0)})),await Ys(r),!("google"in window))return console.warn("google.ima unavailable");const n=r.ads=new AdsController,s=n.analytics;let a=!1;n.resize(mn(e)),_n&&(r.on([h,f,"webkitendfullscreen"],t=>{var e;const i=t.type===h;null===(e=null==r?void 0:r.ads)||void 0===e||e.adapter.setIOSPlaysInline(!i)}),n.on("ad-postroll-finished",()=>{n.adapter.isSharedVideoTag()&&n.once("ad-break-completed",()=>{r.src=r.original_src,r.once(_,()=>{r.togglePlay(!1)}),r.webkitExitFullscreen()})})),r.on(w,(function(){n&&n.destroy()}));const o=async t=>{const o=t.ima;if(void 0===i&&t.autoplay&&(i=t.autoplay),!o)return;if(!Array.isArray(o.ads))return Qs("handling non-array ima.ads"),void(void 0!==i?t.autoplay=i:delete t.autoplay);const l=t.duration||r.duration;if(o.ads=function(t,e){return Array.isArray(t)?t.filter(t=>Ks(t)||qs(t)).reduce((t,r)=>{if(Ks(r))return t.push(r),t;if(r.lazy)return t.push(r),t;if(qs(r)){const i=Object.assign({},r),n=r.percentage?r.percentage*e:0;return isNaN(n)||(i.time=n<0||n===e?-1:n),t.push(i),t}return t},[]):(console.warn("AdSchedule was not an Array"),[])}(o.ads,l),n.setSchedule(o.ads,l),t.metadata&&Analytics.mergeMetadata(s,t.metadata),t.metadata&&n.mergeMacros(t.metadata),t.metadata&&o.parameters&&(o.parameters=Object.assign(Object.assign({},o.parameters),t.metadata)),Analytics.mergeMetadata(s,{muted:t.muted||!1,autoplay:t.autoplay||!1}),!a){if(a=!0,t.lang&&!o.Locale&&(o.Locale=t.lang),Schedule.isOutstream(o.ads))return Qs("is outstream, returning"),new Outstream({root:e,content:r,ads:n,ima:o});Ln({config:Object.assign(Object.assign({},t),{autoplay:i}),root:e,content:r,ads:n,ima:o})}};t.ima&&o(t),r.on(D,({detail:t})=>o(t))}class AdControls extends HTMLElement{constructor(t){super(),this.player=t,this.render()}render(){this.classList.add("fp-ad-controls");const t=_t(this.player,"flowplayer-ad-indicator"),e=document.createElement("div");e.classList.add("ad-playback-controls");const r=_t(this.player,K),i=_t(this.player,q);r.addEventListener("click",()=>{this.player.emit("request/ad/play"),setTimeout((function(){i.focus&&i.focus()}),100)}),i.addEventListener("click",()=>{this.player.emit("request/ad/pause"),setTimeout((function(){r.focus&&r.focus()}),100)}),e.append(r,i);const n=_t(this.player,X);n.addEventListener("click",()=>this.player.emit("request/ad/muteunmute"));const s=_t(this.player,U),a=_t(this.player,G);this.append(t,e,n,s,a)}}class AdCountdown extends HTMLElement{constructor(t){super(),this.player=t,t.on("ad-progress",t=>{const{duration:e,remaining:r}=t.detail;this.setAttribute("duration",e+""),this.setAttribute("remaining",r+"")}),t.on("ad-started",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)})}static get observedAttributes(){return["remaining"]}attributeChangedCallback(t,e,r){switch(t){case"remaining":return this.onRemaining(r)}}onRemaining(t){const e=parseFloat(this.getAttribute("duration")||"0");t||(t=e+"");const r=parseFloat(t),i=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",i),this.classList.remove("go");const n=((e-r)/e*100).toFixed(3);requestAnimationFrame(()=>{this.style.setProperty("--ad-percent-complete",n),this.classList.add("go")})}}class AdIndicator extends HTMLElement{constructor(t){super(),this.player=t,this.render(),t.on("ad-started",t=>{const{position:e,totals:r}=t.detail.ad;this.setAttribute("position",e+""),this.setAttribute("totals",r+"")})}static get observedAttributes(){return["position","totals"]}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 Zs=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:Js}=r();class Ads{constructor(t){this.umd=t,St(t,Sn,AdUI),St(t,"flowplayer-ad-controls",AdControls),St(t,"flowplayer-ad-countdown",AdCountdown),St(t,"flowplayer-ad-indicator",AdIndicator)}init(t,e,r){if(ye.from_token(t.token||"").is_granted(ye.permissions.ADS)&&!Js)return $s(t,e,r)}}return Ads.events=Tn,Ads.ui=Fs,Ads.tags=Zs,ue(window,Ads),bi.extensions.push(HLS,OVP,Ads),Object.assign(bi,{hls:HLS,ads:Ads,ovp:OVP}),bi}));
286
+ */const fs=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 ns}static get ENGINE_MAP(){return os}static get OS_MAP(){return as}static get PLATFORMS_MAP(){return ss}}.parse(window.navigator.userAgent),{platform:ps,os:gs,browser:vs}=fs,ms=t=>t&&t.toLowerCase();var ys={rnd:Math.random().toString(36).substr(2,32),os:ms(gs.name+(gs.versionName?" "+gs.versionName:"")),device:ms(ps.type),browser:ms(vs.name),browser_version:(vs&&vs.version?vs.version:"unknown").split(".").shift(),plugin_version:"3.7.1-rc.3"};const Es="https://fp-eu-w1-aai.flowplayer.com/in",Ts="POST",_s=["ad-requested","ad-request-error","ad-request-completed","ad-completed","ad-started","ad-error","ad-skipped"],Ss=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],bs=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],As=Pe("ads/analytics"),Ls=RequestQueue.of(),ws=(...t)=>Object.assign({},...t);class Analytics{constructor(t,e={}){this.emitter=t,this.metadata=ws(ys,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),As(this),this.wireup()}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,r)=>Object.assign(e,{[r]:t[r]}),{}))(e,...t.valid_keys)}static mergeMetadata(t,e={}){return t.metadata=Analytics.pluck_valid_keys(t,ws(t.metadata,e,{player_version:"3.7.1-rc.3"})),t}wireup(){this.events.forEach(t=>{this.emitter.on(t,e=>{const r=e.detail,i=ws(this.metadata,{event_type:t},r),n=Analytics.pluck_valid_keys(this,i),s=Analytics.ensure_required_keys(this,n);if(As(`Event[${t}]`,{payload:n,observation:r}),s.length)return As(`Analytics.validate_metadata() failed for\n Event[${t}]\n missing keys: ${s}`,n);RequestQueue.rpush(Ls,[Es,Ts,n])})})}destroy(){this.emitter=this.metadata=this.events=this.required_keys=this.optional_keys=this.valid_keys=void 0}}const Ds=Pe("ads/controller"),Rs={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10};class AdsController extends 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 r=new CustomEvent(t,{detail:e||{}});this._bus.dispatchEvent(r)}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)}}{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({},Rs),t),this.analytics=(e=this,Analytics.of(e,{required_keys:Ss,optional_keys:bs,events:_s})),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();this.analytics=void 0,this.opts=void 0,this.adapter=void 0,this._state=void 0,this._schedule=void 0,this._lastAd=void 0,this._macros=void 0}stop(){this.adapter&&this.adapter.stop()}onContentNewSrc(){this._state.reset(),this.adapter.destroyManager(),this.adapter.contentComplete()}wireup(){const t=()=>{var t;const e=new CustomEvent("ad/playing");null===(t=this.videoTag)||void 0===t||t.dispatchEvent(e),this._state.toggleState(es.PLAYING,!0)};this.on("ad-play-requested",t),this.on("ad-started",t),this.on("ad-resumed",t);const e=()=>{var t;if(!this.adPlaying)return;const e=new CustomEvent("ad/paused");null===(t=this.videoTag)||void 0===t||t.dispatchEvent(e),this._state.toggleState(es.PLAYING,!1)};this.on("ad-break-completed",e),this.on("ad-teardown",e),this.on("ad-playback-error",e),this.on("ad-request-error",e),this.on("ad-paused",e),this.on("ad-skipped",e),this.on("ad-completed",e),this.on("ad-break-completed",()=>{requestAnimationFrame(()=>{var t;const e=new CustomEvent("ad/complete");null===(t=this.videoTag)||void 0===t||t.dispatchEvent(e),this._state.toggleState(es.BREAK_ACTIVE,!1)})}),this.on("ad-adapter-init-failed",()=>{console.error("Adapter init failed"),e(),this._state.toggleState(es.FATAL_ERROR,!0)}),this.on("reload-ad-requested",async t=>{if(Ds("Ads.on(RELOAD_AD_REQUESTED)",t),this._schedule){if(e(),t)return this._schedule.reset(this._schedule.getAds());this._state.hasAny(es.AD_AVAILABLE)&&(this._schedule.decrement(),this._state.toggleState(es.AD_AVAILABLE,!1))}})}async initialize(t,e={},r){return Ds("Ads.initialize():",t,e,r),this._state.toggleState(es.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(r),this}get videoTag(){return this.adapter.getVideoTag()}get adInfo(){return this.adapter.getAdInfo()}async setVideoTag(t){Ds("Ads.setVideoTag():",t),await this.adapter.setVideoTag(t),this.trigger("ad-videotag-attached",t),this.adapter.isReady()&&await this.adapterInitialized(),t.on("request/ad/pause",()=>this.adapter.pause()),t.on("request/ad/play",()=>this.adapter.resume()),t.on("request/ad/muteunmute",()=>t.toggleMute()),t.on("volumechange",()=>{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("ad-break-completed",()=>{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("ad-videotag-attached",e=>{this.once(En,()=>t(e))})})}async adapterInitialized(t){Ds("Ads.adapterInitialized()"),this._state.toggleState(es.INITIALIZING,!1),this._state.toggleState(es.BREAK_ACTIVE,!!this.hasPreroll()),await this.setCurrentTime(0,t),this.checkIfBreakComplete(),this.adapter.isAdPod()||t&&!this.opts.autoplay||this.trigger("ad-teardown")}async fetchNextAd(t,e=0){var r,i;if(!this._schedule)return;if(!this.adapter.isReady())return;if(e>50)throw this._state.toggleState(es.FATAL_ERROR,!0),this._state.toggleState(es.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");const n=(null===(r=this._schedule)||void 0===r?void 0:r.getNextAd())||(null===(i=this._schedule)||void 0===i?void 0:i.getPostroll());if(!n||this.adapter.canDismissNonLinear()||-1===t)if(this._schedule.waitForLoad(t,n,this.opts.preload_ads))this._state.toggleState(es.FETCHING_AD,!1);else if(n===this._schedule.getPostroll()&&this._schedule.setPostrollActive(),this._schedule.isDrained()||this._schedule.increment(),n){Ds("Ads.fetchNextAd",n),this._state.toggleState(es.FETCHING_AD,!0);try{return await this.requestAd(n),this._state.toggleState(es.AD_AVAILABLE,!0),void this._state.toggleState(es.FETCHING_AD,!1)}catch(r){if(Ds("Ads.fetchNextAd(err: %o, ad: %o)",r,n),this.setLastAd(n),n!==this._schedule.getPostroll())return await this.fetchNextAd(t,++e)}}else this._state.toggleState(es.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,r=!1){if(!this._schedule)return;if(!this.adapter.isReady())return;if(this._state.hasAny(es.FETCHING_AD))return;if(this._state.hasAny(es.PLAYING)&&this.adapter.isLinearAd())return;const i=0===t&&0===this._schedule.getNextIndex();try{if(r&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(t),this._state.hasAny(es.AD_AVAILABLE)||await this.fetchNextAd(t),!this._state.hasAny(es.AD_AVAILABLE)||!this.shallPlayAd(t)||e)return;await this.playAd(),await this.setCurrentTime(t),this.checkIfBreakComplete()}catch(t){Ds("setCurrentTime: Error(from: setCurrentTime, message: %s)",t.message)}finally{i&&this.trigger("ad-preroll-finished")}}async playAd(){var t;if(!this._state.hasAny(es.AD_AVAILABLE))return;this._state.toggleState(es.AD_AVAILABLE,!1),this._state.toggleState(es.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(es.BREAK_ACTIVE))return Ds("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());Ds("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(es.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger("ad-break-completed")}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 r;if(!this.adapter.getVideoTag())return;if(!this._state)return;if("ad-break-completed"===t&&this._state.hasAny(es.BREAK_ACTIVE)&&!this.adapter.isAdPod())return Ds("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if(null===(i=e)||"object"!=typeof i||Jn(i)!==Zn)return this.dispatch(t,e);var i;const n=Object.assign({},this.adapter.getOpts()||{},(null===(r=this._schedule)||void 0===r?void 0:r.getCurrentAd())||{},{ad_type:this.ad_type},e);return this.dispatch(t,n)}dispatch(t,e){const r=this.adapter.getVideoTag();if(r){Ds(":dispatch",t,e);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}};r.dispatchEvent(new CustomEvent(Pr,{detail:i}))}catch(t){Ds(":error",t)}te(r,t,e),this.emit(t,e)}}get ad_type(){return this._schedule&&this._schedule.getCurrentType()}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&&(Ds("Ads.finished"),!(this.adapter.isSharedVideoTag()&&this._state.hasAny(es.PLAYING)&&this.adapter.isLinearAd()))){Ds("Ads.finished: trying to play postroll");try{if(!this._schedule.getPostroll())return Ds("Ads.finished: no postroll found"),await this.adapter.contentComplete();this._state.hasAny(es.AD_AVAILABLE)||await this.fetchNextAd(-1),await this.playAd(),this.adapter.contentComplete()}catch(t){Ds("Ads.finished: postroll failed:",t)}finally{this.trigger("ad-postroll-finished"),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(es.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,r=this.opts.timeout){if(!this._state)return;Ds("Ads.requestAd(ad: %o)",{ad:t,timeout:r,idx:e});const i=await async function t(e){if("function"==typeof e)return[await $n(e)];if("string"==typeof e)return[await $n(e)];if(Array.isArray(e)){const t=e;return await Promise.all(t.map($n))}if("object"==typeof e&&e&&e.adTag)return await t(e.adTag);throw new Error(`\n unhandled ads type ${typeof e}:\n ${JSON.stringify(e)}\n can be:\n | Array<string>\n | string\n | function\n | {adTag: Array<string>|string|function}\n `)}(t);if(void 0===i[e])return Promise.reject(new Error("Ad failed, no fallbacks left"));if(!i[e])return await this.requestAd(i,e+1,r);this.trigger("ad-requested",t);const n=this._macros.compile(i[e],Xn(this.opts,this.adapter.getDimensions()));try{return void await this.adapter.initAd(n,r)}catch(t){return Ds(`Ads.requestAd(:fallback, idx: ${e}, length: ${i.length}, adTag: ${i[e]})\nError `,{adTag:i,err:t}),this.requestAd(i,e+1,r)}}resetSchedule(t){this._schedule&&this._schedule.reset(t)}get adPlaying(){return this._state&&this._state.hasAny(es.PLAYING)}get adBreak(){return this._state&&this._state.hasAny(es.BREAK_ACTIVE)}get adRequesting(){return this._state.hasAny(es.FETCHING_AD)}get adLinear(){return this.adBreak&&this.adapter.isLinearAd()}}var Is=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"}),ks=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 Os(t){return Object.assign({muted:!1,timeout:250,inline:!1},t)}function Cs(t,e){var r=t.muted,i=t.timeout,n=t.inline,s=e(),a=s.element,o=s.source,l=void 0,d=void 0,u=void 0;return a.muted=r,!0===r&&a.setAttribute("muted","muted"),!0===n&&a.setAttribute("playsinline","playsinline"),a.src=o,new Promise((function(t){l=a.play(),d=setTimeout((function(){u(!1,new Error("Timeout "+i+" ms has been reached"))}),i),u=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a.remove(),a.srcObject=null,clearTimeout(d),t({result:e,error:r})},void 0!==l?l.then((function(){return u(!0)})).catch((function(t){return u(!1,t)})):u(!0)}))}var Ps={audio:function(t){return Cs(t=Os(t),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(Is)}}))},video:function(t){return Cs(t=Os(t),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(ks)}}))}};let xs=void 0;async function Ms(t=!0){return xs||(xs=await Ps.video({timeout:500,muted:t}),xs)}const Ns=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"});var Fs=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 Us=["progress","duration","remaining"],Bs=Pe("ads/ui");class AdUI extends HTMLElement{constructor(t,e=document.createElement("div")){super(),this.player=t,this.adContainer=e,this.render(),t.addEventListener("ad/playing",t=>this.updateState(t.type)),t.addEventListener("ad/paused",t=>this.updateState(t.type)),t.addEventListener("ad/complete",t=>this.updateState(t.type)),t.on("ad-progress",t=>{const{remaining:e}=t.detail;this.setAttribute("remaining",e+"")}),t.on("ad/hide-first-frame",t=>{const{root:e}=t.detail;Bs("hideFirstFrame"),e.classList.toggle("ad-hide-first-frame",!0)}),t.on("ad/show-first-frame",t=>{const{root:e}=t.detail;Bs("showFirstFrame"),e.classList.toggle("ad-hide-first-frame",!1)}),t.on("ad/resize",t=>{const{opts:e}=t.detail,r=this.style;e.linear?e.width&&(r.width=e.width+"px"):e.width?this.adContainer.style.width=e.width+"px":r.removeProperty("width"),e.height?r.height=e.height+"px":r.removeProperty("height")}),t.on("ad/set-ui-flags",t=>{let{ui_flags:e}=t.detail;if(e=e||0,this.classList.toggle("is-ad-controls-sticky",(1&e)>0),this.classList.toggle("no-fullscreen",(2&e)>0),this.classList.toggle("no-indicator",(4&e)>0),(8&e)>0){const t=document.createElement("div");t.classList.add("ad-attribution"),t.textContent=this.player.i18n("ads.advertisement","Advertisement"),this.adContainer.append(t)}if(this.classList.toggle("no-volume-bar",0==(64&e)),(32&e)>0&&this.controls&&(this.remaining=document.createElement("div"),this.remaining.classList.add("fp-ad-remaining","fp-color-text"),this.controls.prepend(this.remaining)),(16&e)>0&&this.controls){this.classList.toggle("is-ad-choices",!0);const t=document.createElement("div");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")}),this.controls.append(t)}})}static get observedAttributes(){return Us}updateState(t){["ad/paused","ad/playing"].forEach(e=>{const r=e.replace("/","-"),i=t===e;this.player.setState(r,i),this.classList.toggle(r,i)})}attributeChangedCallback(t,e,r){switch(t){case"duration":return this.onDurationChange(parseFloat(r));case"progress":return this.onProgress(parseFloat(e),parseFloat(r));case"remaining":return this.onRemaining(r)}}onDurationChange(t){}onProgress(t,e){}onRemaining(t){this.remaining&&(this.remaining.textContent=Wt(parseFloat(t)))}render(){this.adContainer.classList.add("fp-ad-container"),this.append(this.adContainer),this.controls=_t(this.player,"flowplayer-ad-controls");const t=_t(this.player,"flowplayer-ad-countdown");this.append(this.controls,t)}}const Gs=Pe("fpads:native:outstream"),Hs={OUTSTREAM:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"};var js,Vs;!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"}(js||(js={})),function(t){t[t.None=0]="None",t[t.Booting=1]="Booting",t[t.Ready=2]="Ready",t[t.Disposed=3]="Disposed"}(Vs||(Vs={}));class Outstream{constructor({ads:t,root:e,content:r,ima:i}){this.state=Vs.None,Gs("creating Outstream instance"),this.content=r,this.ads=t,this.root=e,this.ima=i,this.aspectRatio=r.videoHeight/r.videoWidth,this.dimensions=function(t){if(t.clientWidth>0||t.clientHeight)return mn(t);const e={height:t.style.height};yn(t,"opacity",0),yn(t,"display","absolute"),yn(t,"display","inline-block"),yn(t,"height","auto");const r=mn(t);return yn(t,"height",e.height),yn(t,"opacity",1),r}(this.root),this.adUi=new AdUI(r),this.adContainer=this.adUi.adContainer,this.initialVolumeState={},e.classList.add(Hs.OUTSTREAM),e.append(this.adUi),this.hide(),this.ads.on("ad-pause-content",t=>{var e;if(this.state==Vs.Disposed)return;const r=!!(null===(e=t.detail)||void 0===e?void 0:e.linear);this.ads.resize(Object.assign(Object.assign({},this.dimensions),{linear:r}))}),r.on("resize",t=>{if(this.state==Vs.Disposed)return;const e=t.detail;e&&(this.dimensions={width:e.contentRect.width,height:e.contentRect.height},this.ads.resize(this.dimensions))}),r.on("intersectionchange",t=>{if(this.state==Vs.Disposed)return;const e=t.detail;if(e)switch(this.state){case Vs.Booting:return Gs(":boot skipping intersectionchange");case Vs.None:return this.state=Vs.Booting,this.begin_life_cycle();case Vs.Ready:if(e.ratio>=.5&&this.ads.adPlaying)return;e.ratio>=.5&&this.ads.resume(),e.ratio<.5&&this.ads.pause()}}),this.setup(),setTimeout(()=>(this.state=Vs.Booting,this.begin_life_cycle()),0)}hide(){return this}restore_aspect_ratio(){return Gs(`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.adUi.classList.add("linear","on")}async begin_life_cycle(){this.state=Vs.Ready;const{error:t,result:e}=await Ms(!1),{result:r}=await Ms(!0);this.attach_ad_listeners(),this.initialVolumeState={can_autoplay:!(!e&&!r),muted:!e},Gs("Outstream.show() :autoplay >> sound="+e),t&&this.content&&!e&&(this.content.muted=!0,this.content.volume=0),await this.ads.setVideoTag(this.content),await wn({ads:this.ads,content:this.content,adContainer:this.adContainer,ima:this.ima,state:{listening:!1},config:this.content.opts}),On({content:this.content,ads:this.ads}),this.state=Vs.Ready}attach_ad_listeners(){const t=this.ads;t.once("ad-pause-content",()=>{this.show(),this.ads.adPlaying&&this.ads.pause()}),this.ima.always_show_controls||t.on("vpaid-init",()=>this.adUi.classList.add("is-vpaid"));const e=()=>{An.forEach(t=>this.ads.removeListener(t,e));const t=new CustomEvent(js.OUTSTREAM_TEARDOWN);Gs("Outstream(:teardown)",t),this.content.dispatchEvent(t)};An.forEach(t=>this.ads.once(t,e)),this.content.once(js.OUTSTREAM_TEARDOWN,t=>{setTimeout(()=>{if(t.defaultPrevented)return this.handle_endscreen();this.dispose()},0)})}handle_endscreen(){this.reset_ui(),this.ads.reset(),In({config:this.content.opts,ui:this.adUi,ads:this.ads,adContainer:this.adContainer,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(Ns)})}setup(){this.root.classList.add(Outstream.CLASS.OUTSTREAM),this.root.classList.add(Outstream.CLASS.HIDDEN),this.empty_src()}reset_ui(){const t=this.root;t.classList.remove(Outstream.CLASS.SHOWING),t.classList.remove(Outstream.CLASS.OUTSTREAM),this.adUi.classList.remove("on")}dispose(){if(this.state==Vs.Disposed)return;const t=this.root,e=this.content;this.reset_ui(),t.classList.add(Outstream.CLASS.OUTSTREAM),t.classList.add(Outstream.CLASS.DONE);this.video=this.container=this.ads=0,this.state=Vs.Disposed,e.destroy(),t.innerHTML=""}}function Ks(t){return t&&"number"==typeof t.time}function qs(t){return t&&"number"==typeof t.percentage&&"number"!=typeof t.time}Outstream.CLASS=Hs;const Ws=Pe("ads/ima/sdk");var zs;async function Ys(t){var e;if(null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.ima)return void Ws(":noop");const r=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,r)=>{let i=document.querySelector(`script[src='${t}']`);if(i)return Xs(i,e,r);i=document.createElement("script"),i.setAttribute("state",zs.LOADING),Xs(i,e,r),i.src=t,document.head.appendChild(i)})}(r),void Ws(":loaded")}catch(t){Ws(":error "+t.message,t)}}function Xs(t,e,r){const i=t.getAttribute("state");if(i&&[zs.ERROR,zs.LOADED].includes(i))return e(void 0);t.addEventListener("load",()=>{t.setAttribute("state",zs.LOADED),e(void 0)},{once:!0}),["error","abort"].forEach(e=>{t.addEventListener(e,()=>{t.setAttribute("state",zs.ERROR),r("script failed to load")},{once:!0})})}!function(t){t.LOADING="loading",t.LOADED="loaded",t.ERROR="error"}(zs||(zs={}));const Qs=Pe("ads/index");async function $s(t,e,r){let i=t.autoplay;if(t.autoplay&&(Qs("handling initial autoplay, original_autoplay: ",i),r.autoplay=!1,t.autoplay=0,r.once(m,()=>{setTimeout(()=>{var e;if(!(null===(e=t.ima)||void 0===e?void 0:e.ads)){if(t.autoplay=i,!r.hasState(ht))return r.once("viewenter",()=>r.togglePlay(!0));r.togglePlay(!0)}},0)})),await Ys(r),!("google"in window))return console.warn("google.ima unavailable");const n=r.ads=new AdsController,s=n.analytics;let a=!1;n.resize(mn(e)),_n&&(r.on([h,f,"webkitendfullscreen"],t=>{var e;const i=t.type===h;null===(e=null==r?void 0:r.ads)||void 0===e||e.adapter.setIOSPlaysInline(!i)}),n.on("ad-postroll-finished",()=>{n.adapter.isSharedVideoTag()&&n.once("ad-break-completed",()=>{r.src=r.original_src,r.once(_,()=>{r.togglePlay(!1)}),r.webkitExitFullscreen()})})),r.on(w,(function(){n&&n.destroy()}));const o=async t=>{const o=t.ima;if(void 0===i&&t.autoplay&&(i=t.autoplay),!o)return;if(!Array.isArray(o.ads))return Qs("handling non-array ima.ads"),void(void 0!==i?t.autoplay=i:delete t.autoplay);const l=t.duration||r.duration;if(o.ads=function(t,e){return Array.isArray(t)?t.filter(t=>Ks(t)||qs(t)).reduce((t,r)=>{if(Ks(r))return t.push(r),t;if(r.lazy)return t.push(r),t;if(qs(r)){const i=Object.assign({},r),n=r.percentage?r.percentage*e:0;return isNaN(n)||(i.time=n<0||n===e?-1:n),t.push(i),t}return t},[]):(console.warn("AdSchedule was not an Array"),[])}(o.ads,l),n.setSchedule(o.ads,l),t.metadata&&Analytics.mergeMetadata(s,t.metadata),t.metadata&&n.mergeMacros(t.metadata),t.metadata&&o.parameters&&(o.parameters=Object.assign(Object.assign({},o.parameters),t.metadata)),Analytics.mergeMetadata(s,{muted:t.muted||!1,autoplay:t.autoplay||!1}),!a){if(a=!0,t.lang&&!o.Locale&&(o.Locale=t.lang),Schedule.isOutstream(o.ads))return Qs("is outstream, returning"),new Outstream({root:e,content:r,ads:n,ima:o});Ln({config:Object.assign(Object.assign({},t),{autoplay:i}),root:e,content:r,ads:n,ima:o})}};t.ima&&o(t),r.on(D,({detail:t})=>o(t))}class AdControls extends HTMLElement{constructor(t){super(),this.player=t,this.render()}render(){this.classList.add("fp-ad-controls");const t=_t(this.player,"flowplayer-ad-indicator"),e=document.createElement("div");e.classList.add("ad-playback-controls");const r=_t(this.player,K),i=_t(this.player,q);r.addEventListener("click",()=>{this.player.emit("request/ad/play"),setTimeout((function(){i.focus&&i.focus()}),100)}),i.addEventListener("click",()=>{this.player.emit("request/ad/pause"),setTimeout((function(){r.focus&&r.focus()}),100)}),e.append(r,i);const n=_t(this.player,X);n.addEventListener("click",()=>this.player.emit("request/ad/muteunmute"));const s=_t(this.player,U),a=_t(this.player,G);this.append(t,e,n,s,a)}}class AdCountdown extends HTMLElement{constructor(t){super(),this.player=t,t.on("ad-progress",t=>{const{duration:e,remaining:r}=t.detail;this.setAttribute("duration",e+""),this.setAttribute("remaining",r+"")}),t.on("ad-started",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)})}static get observedAttributes(){return["remaining"]}attributeChangedCallback(t,e,r){switch(t){case"remaining":return this.onRemaining(r)}}onRemaining(t){const e=parseFloat(this.getAttribute("duration")||"0");t||(t=e+"");const r=parseFloat(t),i=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",i),this.classList.remove("go");const n=((e-r)/e*100).toFixed(3);requestAnimationFrame(()=>{this.style.setProperty("--ad-percent-complete",n),this.classList.add("go")})}}class AdIndicator extends HTMLElement{constructor(t){super(),this.player=t,this.render(),t.on("ad-started",t=>{const{position:e,totals:r}=t.detail.ad;this.setAttribute("position",e+""),this.setAttribute("totals",r+"")})}static get observedAttributes(){return["position","totals"]}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 Zs=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:Js}=r();class Ads{constructor(t){this.umd=t,St(t,Sn,AdUI),St(t,"flowplayer-ad-controls",AdControls),St(t,"flowplayer-ad-countdown",AdCountdown),St(t,"flowplayer-ad-indicator",AdIndicator)}init(t,e,r){if(ye.from_token(t.token||"").is_granted(ye.permissions.ADS)&&!Js)return $s(t,e,r)}}return Ads.events=Tn,Ads.ui=Fs,Ads.tags=Zs,ue(window,Ads),bi.extensions.push(HLS,OVP,Ads),Object.assign(bi,{hls:HLS,ads:Ads,ovp:OVP}),bi}));