@flowplayer/player 3.0.1-rc.2 → 3.0.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/core.js CHANGED
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function D(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function U(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function C(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const k=e=>{var{src:t}=e,n=D(e,["src"]);return[Object.assign({src:t,type:t?C("video/"+U(t)):""},n)]};function P(e){return k({src:e})}function M(e){var{src:t,type:n}=e,o=D(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},o)]:n&&!t?[Object.assign({type:n},o)]:k(Object.assign({src:t},o))}var x;function H(e,t,n,o={safari:!1}){const r=function(e){return"string"==typeof e?P(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=P(t)),"object"!=typeof t||Array.isArray(t)||(t=M(t)),e.concat(t)}),[]):M(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(r.length)).map((e,t)=>t).some(n=>{const i=r[n];if(x.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const o=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return o?(o.onload(t,e.root,e,n),x.Ok):x.Err}(e,t,i)||x.Ok==function(e,t,n,o={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return x.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!o.safari))return x.Err;"string"==typeof n.src&&(e.src=n.src);return x.Ok}(e,t,i,o))return!0;n==r.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(x||(x={}));const W=["reap","seeking","src","seek:cancel"];var j;function G(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?V(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,V(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(j.BACKWARD,t.offset<0),e.setState(j.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function V(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(j.FORWARD,!1),e.setState(j.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function F(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Y(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(j||(j={}));const K=[1e7]+""+-1e3+-4e3+-8e3+-1e11,B=()=>"undefined"==typeof crypto?"":K.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let q="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const z=["touchstart","touchmove"];function Q(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Z(e,t,n){const o=Q(t,n);return e.dispatchEvent(o),e}function X(e,t,n){const o=Q(t,n);return e.dispatchEvent(o),o}function J(e,t,n,o){Array.isArray(t)?t.forEach(t=>$(e,t,n,o)):$(e,t,n,o)}function $(e,t,n,o){if(r=t,!~z.indexOf(r))return e.addEventListener(t,n,o),e;var r;const i=Object.assign(o||{},{passive:!0});return e.addEventListener(t,n,i),e}function ee(e,t,n,o){return J(e,t,n,Object.assign(o||{},{once:!0}))}const te={preload:"none",rtl:!1,controls:!0},ne=["loop","muted","preload"];function oe(e,o,r){r.toJSON=function(){return{duration:r.duration,volume:r.volume,currentTime:r.currentTime,states:r.root.className}},r.setSrc=function(t){return H(r,e,t,n())},r.playerState=r.playerState||{},r.setState=function(e,t){if(r.playerState[e]===!!t)return r;const n=Object.assign({},r.playerState,{[e]:t});return n[g]&&(n[d]=!1),r.playerState=n,Z(r,"state",r.playerState),r},r.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>T(this,e[n]))},r.hasState=function(e){return!!r.playerState[e]},r.transitionState=function(e,t,n){!r.hasState(e)&&r.hasState(t)||(n=0),n&&r.setState("is-toggling",!0),r.setState(t,!1),r.setState(e,!0),n&&setTimeout((function(){r.setState("is-toggling",!1)}),n)},r.emit=(e,t)=>(Z(r,e,t),r),r.on=(e,t)=>(J(r,e,t),r),r.once=(e,t)=>(ee(r,e,t),r),r.off=(e,t)=>{var n,o;return n=e,o=t,r.removeEventListener(n,o),r},r.poll=(e,t)=>X(r,e,t),r.togglePlay=function(t){return L(r,e,t)},r.toggleMute=function(e){e=null==e?!r.muted:!!e,r.muted=e,r.muted||r.volume||(r.volume=1),Z(r,"volumechange")},r.toggleDisable=function(e){e=null==e?!r.disabled:!!e,r.setState("is-disabled",e),r.disabled=e},r.destroy=function(){r.pause();const e=t.indexOf(r);~e&&t.splice(e,1),setTimeout((function(){r.setSrc([]),r.reaper&&r.reaper.clear(),Z(r,"reap")}),0)},r.setAttrs=function(e){return ne.forEach(t=>{if(!(t in e))return;const n=e[t];n?r.setAttribute(t,n.toString()):r.removeAttribute(t)}),r},r.opt=function(t,n){return n=void 0===n?Y(te,t):n,Y(e,t,n)},r.i18n=function(e,t){if(!r.reaper)return"";const n=r.reaper.get("translations");return n?function e(t,n,o,r){return(r=r||0)>=t.length?o:Y(t[r],n,e(t,n,o,r+1))}(n,e,t||""):t||""},r.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&r.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&r.toggleMute(t.muted);const n=!!e.autoplay&&!r.hasState("no-autoplay");r.setState("is-autoplay",n),r.setState("is-rtl",r.opt("rtl",function(e){if(!e)return F();const t=e.getAttribute("dir");return t?"rtl"==t:F()}(o))),r.setState("is-live",!!e.live),r.setState("no-timeline",!(!e.live||e.dvr)),r.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),r.setState("is-seekable",!!e.seekable),o.style.backgroundImage=r.hasState("has-poster")?"url('"+e.poster+"')":"",Z(r,"config",e)},r.renderPlugin=function(e){X(r,"renderplugin",e).defaultPrevented||r.root.appendChild(e)};const i={offset:0,timer:0};var a,s;s=i,(a=r).on(W,(function(){V(a,s)})),r.enqueueSeek=function(e){if(0!=r.opts.seekable&&!(1==r.opts.disabled&&e>0))return G(r,i,e)},r.deviceId=function(){return function(){if(q)return q;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=B();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return q=B()}}()}}function re(e,t){const n=t.querySelector("video"),o=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return o.classList.add("fp-engine"),o.playsInline=!0,n||t.append(o),o}const ie=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function ae(e,t){return!!~ie.indexOf(e)||e.indexOf(t)===e.length-t.length}ae.check_whitelist=function(e){return!!~ie.indexOf(e)};const se="production";function le(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let o={c:"{}",exp:0};t=t||{};try{o=A(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(o.c),n.exp=o.exp,t.require_valid_token&&le.validate(n),n}function ce(e){try{return le.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var ue;function de(e){return{grant:e,is_granted:t=>(e&t)===t}}function pe(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function fe(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function Ee(e,t,o){let r=!0;t.classList.add("flowplayer"),fe(0,t),J(o,["loadstart",a],(function(){fe(0,t)})),J(o,"state",(function(){Object.entries(o.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),J(o,"timeupdate",(function(){o.setState(g,!1)})),J(o,"config",(function(){const n=o.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==o.currentTime;[f,E].forEach((function(e){o.setState(e,n)}))})),J(o,"ended",(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!o.loop&&(e.autoplay&&(e.autoplay=0,o.setState("is-autoplay",!1)),o.setState(y,!0),ee(o,"seeked",(function(){o.setState(y,!1),o.pause(),o.setState(E,!0)})),o.currentTime=0),ee(o,"timeupdate",(function(){o.setState(m,!1)})),o.transitionState(m,d,e.loop||e.rewind?0:300))}),0)})),J(o,["seeking","seeked"],(function(e){o.setState(y,"seeking"==e.type),o.setState(p,o.paused),o.setState(d,!o.paused)})),J(o,"ended",(function(){o.setState(d,!1),r=!0})),J(o,n().ios?s:l,(function(e){const t="src"!=e.type||"none"!==o.opt("preload");o.setState("is-loaded",t),o.setState(f,!t)})),J(o,["waiting","canplay","loadstart"],(function(t){if(!o.hasState(y)&&("canplay"!=t.type||e.autoplay||o.setState(g,!1),"loadstart"!=t.type||"none"!=o.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return ee(o,"playing",(function(){o.setState(g,!1)}));"waiting"==t.type&&[d,p,E].forEach((function(e){o.setState(e,!1)})),o.setState(m,!1),o.setState(g,"waiting"==t.type)}})),J(o,["playing","pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:o});document.dispatchEvent(e)},0);const n="playing"==t.type,i=o.currentTime==o.duration,a=n&&r&&e.autoplay||o.hasState(g);if(n&&(o.started=!0,r=!1),o.setState(g,!1).setState(E,!1),i||o.hasState(y))return;const s=n?d:p,l=n?p:d;o.transitionState(s,l,a?0:300),n&&o.setState("no-autoplay",!1)}))}function ye(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,o=t.height,r=t.bottom,i=o/5;return t.top<=i&&t.top+o>n-i||r-o+i>=0&&r<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,Z(e,t?"viewenter":"viewleave")),e}function me(e,n,r){ye(r);const a={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[i,o].forEach(e=>ee(r,e,()=>a.has_user_gesture=!0)),J(r,"play",(function(){a.locked||(a.should_resume=!0)})),J(r,"pause",(function(){a.locked||(a.should_resume=!1)})),J(r,"canplay",(function(n){!e.autoplay||t.filter((function(e){return!e.paused})).length&&!e.multiplay||r.in_viewport&&r.paused&&a.should_resume&&r.togglePlay(!0)})),e.autopause&&(J(r,"viewenter",(function(){a.should_resume&&r.togglePlay(!0)})),J(r,"viewleave",(function(){const e=!r.paused;a.locked=!0,r.pause(),setTimeout((function(){a.should_resume=e,a.locked=!1}),0)})))}le.validate=function(e){if("string"==typeof e&&(e=le(e)),!e||!e.raw){if(ae.check_whitelist(window.location.hostname)||"dev"===se.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=ae.bind(null,t);if("dev"!==se.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==se.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},le.id=function(e){if(e)return"string"==typeof e&&(e=le(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(ue||(ue={})),de.of=de,de.from_token=function(e){const t=le(e,{require_valid_token:!0});return de.of(t.data.acl)},de.permissions=ue,[r,a].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Z(e,a),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(ye)}));function ge(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function we(e,t,n){const o=document.createElement("div");o.classList.add("fp-ratio"),t.append(o);let r=ge(e.ratio||.5625);o.style.paddingTop=100*r+"%";const i=[l,s];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on("config",(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=ge((null==e?void 0:e.ratio)||t||.5625);r!==i&&(r=i,o.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(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once("playing",this.render),null===(t=this.player)||void 0===t||t.once("ended",this.wireUp)}cleanUp(){var e,t,n,o;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off("playing",this.render),null===(o=this.player)||void 0===o||o.off("ended",this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const o=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!o)return;const r=this._logo=document.createElement("a");r.href="https://explorer.flowplayer.com",r.target="_blank",Object.entries(he).forEach(([e,t])=>{r.style.setProperty(e,t,"important")}),o.appendChild(r)}}const he={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)"};function Se(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on("reap",()=>document.removeEventListener("flowplayer/playing",t)),document.addEventListener("flowplayer/playing",t)}const _e=function(){const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Oe(n,o){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Oe;"string"==typeof o&&(o={src:o}),o||(o={}),o.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(o.token=window.__FLOWPLAYER_TOKEN);const r="string"==typeof n?document.querySelector(n):n;if(!r)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=r.querySelector("video.fp-engine");if(i)return i;const a=ce(o.token);if(!a.success)return pe(r,null,{reason:"token",details:a.message});const l=new Map,c=re(o,r);c.reaper=l,c._customElements=N,Object.defineProperty(c,"token",{value:"string"==typeof o.token?le.id(o.token):"",writable:!1}),c.addEventListener("reap",()=>{l.clear(),c.reaper=0,delete c.root}),c.root=r,o.token&&de.from_token(o.token).is_granted(de.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(c)&&t.push(c),oe(o,r,c),c.setAttrs(o),c.plugins=Oe.extensions.map(e=>new e(Oe,c)),Ee(o,r,c),me(o,0,c),we(o,r,c),Se(c),c.plugins.forEach(e=>{try{e.init(o,r,c)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),c.setOpts(o),c.opts=o,o.src&&c.setSrc(o.src);const u=c.readyState;return u>0&&c.currentSrc&&c.emit(s),u>2&&c.currentSrc&&c.emit("canplay"),c.emit("mount"),c.on("error:fatal",(function(e){pe(r,c,e.data||{})})),c}return Object.assign(Oe,_e),function(o){Array.isArray(o.extensions)&&o.extensions.forEach(t=>e.push(t)),o.customElements=N,o.defaultElements=u,o.version="3.0.1-rc.2",o.commit="6fbb2390d6a7c662947c90924411af433b4f2927",o.instances=t,o.extensions=e,o.support=n,o.events=c,o.states=w,o.jwt=A,o.autoplay=v,o.quality=I}(Oe),"object"==typeof document&&setTimeout(Z,0,document,"flowplayer:umd",Oe),Oe}));
15
+ ***************************************************************************** */function D(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function U(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function C(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const k=e=>{var{src:t}=e,n=D(e,["src"]);return[Object.assign({src:t,type:t?C("video/"+U(t)):""},n)]};function P(e){return k({src:e})}function M(e){var{src:t,type:n}=e,o=D(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},o)]:n&&!t?[Object.assign({type:n},o)]:k(Object.assign({src:t},o))}var x;function H(e,t,n,o={safari:!1}){const r=function(e){return"string"==typeof e?P(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=P(t)),"object"!=typeof t||Array.isArray(t)||(t=M(t)),e.concat(t)}),[]):M(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(r.length)).map((e,t)=>t).some(n=>{const i=r[n];if(x.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const o=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return o?(o.onload(t,e.root,e,n),x.Ok):x.Err}(e,t,i)||x.Ok==function(e,t,n,o={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return x.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!o.safari))return x.Err;"string"==typeof n.src&&(e.src=n.src);return x.Ok}(e,t,i,o))return!0;n==r.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(x||(x={}));const W=["reap","seeking","src","seek:cancel"];var j;function G(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?V(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,V(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(j.BACKWARD,t.offset<0),e.setState(j.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function V(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(j.FORWARD,!1),e.setState(j.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function F(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Y(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(j||(j={}));const K=[1e7]+""+-1e3+-4e3+-8e3+-1e11,B=()=>"undefined"==typeof crypto?"":K.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let q="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const z=["touchstart","touchmove"];function Q(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Z(e,t,n){const o=Q(t,n);return e.dispatchEvent(o),e}function X(e,t,n){const o=Q(t,n);return e.dispatchEvent(o),o}function J(e,t,n,o){Array.isArray(t)?t.forEach(t=>$(e,t,n,o)):$(e,t,n,o)}function $(e,t,n,o){if(r=t,!~z.indexOf(r))return e.addEventListener(t,n,o),e;var r;const i=Object.assign(o||{},{passive:!0});return e.addEventListener(t,n,i),e}function ee(e,t,n,o){return J(e,t,n,Object.assign(o||{},{once:!0}))}const te={preload:"none",rtl:!1,controls:!0},ne=["loop","muted","preload"];function oe(e,o,r){r.toJSON=function(){return{duration:r.duration,volume:r.volume,currentTime:r.currentTime,states:r.root.className}},r.setSrc=function(t){return H(r,e,t,n())},r.playerState=r.playerState||{},r.setState=function(e,t){if(r.playerState[e]===!!t)return r;const n=Object.assign({},r.playerState,{[e]:t});return n[g]&&(n[d]=!1),r.playerState=n,Z(r,"state",r.playerState),r},r.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>T(this,e[n]))},r.hasState=function(e){return!!r.playerState[e]},r.transitionState=function(e,t,n){!r.hasState(e)&&r.hasState(t)||(n=0),n&&r.setState("is-toggling",!0),r.setState(t,!1),r.setState(e,!0),n&&setTimeout((function(){r.setState("is-toggling",!1)}),n)},r.emit=(e,t)=>(Z(r,e,t),r),r.on=(e,t)=>(J(r,e,t),r),r.once=(e,t)=>(ee(r,e,t),r),r.off=(e,t)=>{var n,o;return n=e,o=t,r.removeEventListener(n,o),r},r.poll=(e,t)=>X(r,e,t),r.togglePlay=function(t){return L(r,e,t)},r.toggleMute=function(e){e=null==e?!r.muted:!!e,r.muted=e,r.muted||r.volume||(r.volume=1),Z(r,"volumechange")},r.toggleDisable=function(e){e=null==e?!r.disabled:!!e,r.setState("is-disabled",e),r.disabled=e},r.destroy=function(){r.pause();const e=t.indexOf(r);~e&&t.splice(e,1),setTimeout((function(){r.setSrc([]),r.reaper&&r.reaper.clear(),Z(r,"reap")}),0)},r.setAttrs=function(e){return ne.forEach(t=>{if(!(t in e))return;const n=e[t];n?r.setAttribute(t,n.toString()):r.removeAttribute(t)}),r},r.opt=function(t,n){return n=void 0===n?Y(te,t):n,Y(e,t,n)},r.i18n=function(e,t){if(!r.reaper)return"";const n=r.reaper.get("translations");return n?function e(t,n,o,r){return(r=r||0)>=t.length?o:Y(t[r],n,e(t,n,o,r+1))}(n,e,t||""):t||""},r.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&r.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&r.toggleMute(t.muted);const n=!!e.autoplay&&!r.hasState("no-autoplay");r.setState("is-autoplay",n),r.setState("is-rtl",r.opt("rtl",function(e){if(!e)return F();const t=e.getAttribute("dir");return t?"rtl"==t:F()}(o))),r.setState("is-live",!!e.live),r.setState("no-timeline",!(!e.live||e.dvr)),r.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),r.setState("is-seekable",!!e.seekable),o.style.backgroundImage=r.hasState("has-poster")?"url('"+e.poster+"')":"",Z(r,"config",e)},r.renderPlugin=function(e){X(r,"renderplugin",e).defaultPrevented||r.root.appendChild(e)};const i={offset:0,timer:0};var a,s;s=i,(a=r).on(W,(function(){V(a,s)})),r.enqueueSeek=function(e){if(0!=r.opts.seekable&&!(1==r.opts.disabled&&e>0))return G(r,i,e)},r.deviceId=function(){return function(){if(q)return q;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=B();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return q=B()}}()}}function re(e,t){const n=t.querySelector("video"),o=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return o.classList.add("fp-engine"),o.playsInline=!0,n||t.append(o),o}const ie=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function ae(e,t){return!!~ie.indexOf(e)||e.indexOf(t)===e.length-t.length}ae.check_whitelist=function(e){return!!~ie.indexOf(e)};const se="production";function le(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let o={c:"{}",exp:0};t=t||{};try{o=A(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(o.c),n.exp=o.exp,t.require_valid_token&&le.validate(n),n}function ce(e){try{return le.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var ue;function de(e){return{grant:e,is_granted:t=>(e&t)===t}}function pe(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function fe(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function Ee(e,t,o){let r=!0;t.classList.add("flowplayer"),fe(0,t),J(o,["loadstart",a],(function(){fe(0,t)})),J(o,"state",(function(){Object.entries(o.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),J(o,"timeupdate",(function(){o.setState(g,!1)})),J(o,"config",(function(){const n=o.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==o.currentTime;[f,E].forEach((function(e){o.setState(e,n)}))})),J(o,"ended",(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!o.loop&&(e.autoplay&&(e.autoplay=0,o.setState("is-autoplay",!1)),o.setState(y,!0),ee(o,"seeked",(function(){o.setState(y,!1),o.pause(),o.setState(E,!0)})),o.currentTime=0),ee(o,"timeupdate",(function(){o.setState(m,!1)})),o.transitionState(m,d,e.loop||e.rewind?0:300))}),0)})),J(o,["seeking","seeked"],(function(e){o.setState(y,"seeking"==e.type),o.setState(p,o.paused),o.setState(d,!o.paused)})),J(o,"ended",(function(){o.setState(d,!1),r=!0})),J(o,n().ios?s:l,(function(e){const t="src"!=e.type||"none"!==o.opt("preload");o.setState("is-loaded",t),o.setState(f,!t)})),J(o,["waiting","canplay","loadstart"],(function(t){if(!o.hasState(y)&&("canplay"!=t.type||e.autoplay||o.setState(g,!1),"loadstart"!=t.type||"none"!=o.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return ee(o,"playing",(function(){o.setState(g,!1)}));"waiting"==t.type&&[d,p,E].forEach((function(e){o.setState(e,!1)})),o.setState(m,!1),o.setState(g,"waiting"==t.type)}})),J(o,["playing","pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:o});document.dispatchEvent(e)},0);const n="playing"==t.type,i=o.currentTime==o.duration,a=n&&r&&e.autoplay||o.hasState(g);if(n&&(o.started=!0,r=!1),o.setState(g,!1).setState(E,!1),i||o.hasState(y))return;const s=n?d:p,l=n?p:d;o.transitionState(s,l,a?0:300),n&&o.setState("no-autoplay",!1)}))}function ye(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,o=t.height,r=t.bottom,i=o/5;return t.top<=i&&t.top+o>n-i||r-o+i>=0&&r<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,Z(e,t?"viewenter":"viewleave")),e}function me(e,n,r){ye(r);const a={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[i,o].forEach(e=>ee(r,e,()=>a.has_user_gesture=!0)),J(r,"play",(function(){a.locked||(a.should_resume=!0)})),J(r,"pause",(function(){a.locked||(a.should_resume=!1)})),J(r,"canplay",(function(n){!e.autoplay||t.filter((function(e){return!e.paused})).length&&!e.multiplay||r.in_viewport&&r.paused&&a.should_resume&&r.togglePlay(!0)})),e.autopause&&(J(r,"viewenter",(function(){a.should_resume&&r.togglePlay(!0)})),J(r,"viewleave",(function(){const e=!r.paused;a.locked=!0,r.pause(),setTimeout((function(){a.should_resume=e,a.locked=!1}),0)})))}le.validate=function(e){if("string"==typeof e&&(e=le(e)),!e||!e.raw){if(ae.check_whitelist(window.location.hostname)||"dev"===se.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=ae.bind(null,t);if("dev"!==se.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==se.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},le.id=function(e){if(e)return"string"==typeof e&&(e=le(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(ue||(ue={})),de.of=de,de.from_token=function(e){const t=le(e,{require_valid_token:!0});return de.of(t.data.acl)},de.permissions=ue,[r,a].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Z(e,a),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(ye)}));function ge(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function we(e,t,n){const o=document.createElement("div");o.classList.add("fp-ratio"),t.append(o);let r=ge(e.ratio||.5625);o.style.paddingTop=100*r+"%";const i=[l,s];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on("config",(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=ge((null==e?void 0:e.ratio)||t||.5625);r!==i&&(r=i,o.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(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once("playing",this.render),null===(t=this.player)||void 0===t||t.once("ended",this.wireUp)}cleanUp(){var e,t,n,o;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off("playing",this.render),null===(o=this.player)||void 0===o||o.off("ended",this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const o=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!o)return;const r=this._logo=document.createElement("a");r.href="https://explorer.flowplayer.com",r.target="_blank",Object.entries(he).forEach(([e,t])=>{r.style.setProperty(e,t,"important")}),o.appendChild(r)}}const he={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)"};function Se(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on("reap",()=>document.removeEventListener("flowplayer/playing",t)),document.addEventListener("flowplayer/playing",t)}const _e=function(){const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Oe(n,o){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Oe;"string"==typeof o&&(o={src:o}),o||(o={}),o.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(o.token=window.__FLOWPLAYER_TOKEN);const r="string"==typeof n?document.querySelector(n):n;if(!r)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=r.querySelector("video.fp-engine");if(i)return i;const a=ce(o.token);if(!a.success)return pe(r,null,{reason:"token",details:a.message});const l=new Map,c=re(o,r);c.reaper=l,c._customElements=N,Object.defineProperty(c,"token",{value:"string"==typeof o.token?le.id(o.token):"",writable:!1}),c.addEventListener("reap",()=>{l.clear(),c.reaper=0,delete c.root}),c.root=r,o.token&&de.from_token(o.token).is_granted(de.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(c)&&t.push(c),oe(o,r,c),c.setAttrs(o),c.plugins=Oe.extensions.map(e=>new e(Oe,c)),Ee(o,r,c),me(o,0,c),we(o,r,c),Se(c),c.plugins.forEach(e=>{try{e.init(o,r,c)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),c.setOpts(o),c.opts=o,o.src&&c.setSrc(o.src);const u=c.readyState;return u>0&&c.currentSrc&&c.emit(s),u>2&&c.currentSrc&&c.emit("canplay"),c.emit("mount"),c.on("error:fatal",(function(e){pe(r,c,e.data||{})})),c}return Object.assign(Oe,_e),function(o){Array.isArray(o.extensions)&&o.extensions.forEach(t=>e.push(t)),o.customElements=N,o.defaultElements=u,o.version="3.0.1-rc.3",o.commit="99bc0ccc7b34661f9715474d094f159f9bdbfeac",o.instances=t,o.extensions=e,o.support=n,o.events=c,o.states=w,o.jwt=A,o.autoplay=v,o.quality=I}(Oe),"object"==typeof document&&setTimeout(Z,0,document,"flowplayer:umd",Oe),Oe}));
package/default.js CHANGED
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function pe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function fe(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function he(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const me=e=>{var{src:t}=e,n=pe(e,["src"]);return[Object.assign({src:t,type:t?he("video/"+fe(t)):""},n)]};function _e(e){return me({src:e})}function ye(e){var{src:t,type:n}=e,r=pe(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:me(Object.assign({src:t},r))}var ve;function Ee(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?_e(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=_e(t)),"object"!=typeof t||Array.isArray(t)||(t=ye(t)),e.concat(t)}),[]):ye(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(ve.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return r?(r.onload(t,e.root,e,n),ve.Ok):ve.Err}(e,t,i)||ve.Ok==function(e,t,n,r={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return ve.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return ve.Err;"string"==typeof n.src&&(e.src=n.src);return ve.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(ve||(ve={}));const ge=[S,b,"src","seek:cancel"];var we;function be(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?Se(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,Se(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(we.BACKWARD,t.offset<0),e.setState(we.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Se(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(we.FORWARD,!1),e.setState(we.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Oe(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}function Te(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Ae(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function Ne(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function ke(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function Le(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+ke(r)+":"+ke(e)):t+ke(r)+":"+ke(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(we||(we={}));const Re=navigator.languages||[navigator.language];function Ie(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return Re.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!r[t]&&(r[t]=e[t])})),Object.values(r)}const Ce=[1e7]+""+-1e3+-4e3+-8e3+-1e11,De=()=>"undefined"==typeof crypto?"":Ce.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let Me="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const xe=["touchstart","touchmove"];function Ue(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Fe(e,t,n){const r=Ue(t,n);return e.dispatchEvent(r),e}function Pe(e,t,n){const r=Ue(t,n);return e.dispatchEvent(r),r}function Be(e,t,n,r){Array.isArray(t)?t.forEach(t=>He(e,t,n,r)):He(e,t,n,r)}function He(e,t,n,r){if(o=t,!~xe.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function je(e,t,n,r){return Be(e,t,n,Object.assign(r||{},{once:!0}))}const Ge={preload:"none",rtl:!1,controls:!0},qe=["loop","muted","preload"];function We(e,r,o){o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return Ee(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return n[Q]&&(n[W]=!1),o.playerState=n,Fe(o,"state",o.playerState),o},o.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>se(this,e[n]))},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){!o.hasState(e)&&o.hasState(t)||(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.emit=(e,t)=>(Fe(o,e,t),o),o.on=(e,t)=>(Be(o,e,t),o),o.once=(e,t)=>(je(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>Pe(o,e,t),o.togglePlay=function(t){return ce(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Fe(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),Fe(o,S)}),0)},o.setAttrs=function(e){return qe.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?Ne(Ge,t):n,Ne(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:Ne(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return Te();const t=e.getAttribute("dir");return t?"rtl"==t:Te()}(r))),o.setState("is-live",!!e.live),o.setState("no-timeline",!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Fe(o,O,e)},o.renderPlugin=function(e){Pe(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var s,a;a=i,(s=o).on(ge,(function(){Se(s,a)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return be(o,i,e)},o.deviceId=function(){return function(){if(Me)return Me;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=De();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return Me=De()}}()}}function Ve(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}function ze(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}function Ke(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const Ye=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function Xe(e,t){return!!~Ye.indexOf(e)||e.indexOf(t)===e.length-t.length}Xe.check_whitelist=function(e){return!!~Ye.indexOf(e)};const Qe="production";function Ze(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=oe(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&Ze.validate(n),n}function Je(e){try{return Ze.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var $e;function et(e){return{grant:e,is_granted:t=>(e&t)===t}}function tt(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function nt(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function rt(e,t,r){let o=!0;t.classList.add("flowplayer"),nt(0,t),Be(r,[m,c],(function(){nt(0,t)})),Be(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),Be(r,"timeupdate",(function(){r.setState(Q,!1)})),Be(r,O,(function(){const n=r.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==r.currentTime;[z,K].forEach((function(e){r.setState(e,n)}))})),Be(r,g,(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!r.loop&&(e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(Y,!0),je(r,w,(function(){r.setState(Y,!1),r.pause(),r.setState(K,!0)})),r.currentTime=0),je(r,"timeupdate",(function(){r.setState(X,!1)})),r.transitionState(X,W,e.loop||e.rewind?0:300))}),0)})),Be(r,[b,w],(function(e){r.setState(Y,e.type==b),r.setState(V,r.paused),r.setState(W,!r.paused)})),Be(r,g,(function(){r.setState(W,!1),o=!0})),Be(r,n().ios?p:f,(function(e){const t="src"!=e.type||"none"!==r.opt("preload");r.setState("is-loaded",t),r.setState(z,!t)})),Be(r,[v,E,m],(function(t){if(!r.hasState(Y)&&(t.type!=E||e.autoplay||r.setState(Q,!1),t.type!=m||"none"!=r.opt("preload")||e.autoplay)){if(t.type==m&&e.autoplay)return je(r,y,(function(){r.setState(Q,!1)}));t.type==v&&[W,V,K].forEach((function(e){r.setState(e,!1)})),r.setState(X,!1),r.setState(Q,t.type==v)}})),Be(r,[y,_],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n=t.type==y,i=r.currentTime==r.duration,s=n&&o&&e.autoplay||r.hasState(Q);if(n&&(r.started=!0,o=!1),r.setState(Q,!1).setState(K,!1),i||r.hasState(Y))return;const a=n?W:V,l=n?V:W;r.transitionState(a,l,s?0:300),n&&r.setState("no-autoplay",!1)}))}function ot(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,r=t.height,o=t.bottom,i=r/5;return t.top<=i&&t.top+r>n-i||o-r+i>=0&&o<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,Fe(e,t?"viewenter":"viewleave")),e}function it(e,n,o){ot(o);const i={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[l,r].forEach(e=>je(o,e,()=>i.has_user_gesture=!0)),Be(o,"play",(function(){i.locked||(i.should_resume=!0)})),Be(o,_,(function(){i.locked||(i.should_resume=!1)})),Be(o,E,(function(n){!e.autoplay||t.filter((function(e){return!e.paused})).length&&!e.multiplay||o.in_viewport&&o.paused&&i.should_resume&&o.togglePlay(!0)})),e.autopause&&(Be(o,"viewenter",(function(){i.should_resume&&o.togglePlay(!0)})),Be(o,"viewleave",(function(){const e=!o.paused;i.locked=!0,o.pause(),setTimeout((function(){i.should_resume=e,i.locked=!1}),0)})))}Ze.validate=function(e){if("string"==typeof e&&(e=Ze(e)),!e||!e.raw){if(Xe.check_whitelist(window.location.hostname)||"dev"===Qe.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=Xe.bind(null,t);if("dev"!==Qe.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==Qe.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},Ze.id=function(e){if(e)return"string"==typeof e&&(e=Ze(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}($e||($e={})),et.of=et,et.from_token=function(e){const t=Ze(e,{require_valid_token:!0});return et.of(t.data.acl)},et.permissions=$e,[i,c].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Fe(e,c),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(ot)}));function st(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function at(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=st(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[f,p];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(O,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=st((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.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(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(y,this.render),null===(t=this.player)||void 0===t||t.once(g,this.wireUp)}cleanUp(){var e,t,n,r;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off(y,this.render),null===(r=this.player)||void 0===r||r.off(g,this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const r=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!r)return;const o=this._logo=document.createElement("a");o.href="https://explorer.flowplayer.com",o.target="_blank",Object.entries(lt).forEach(([e,t])=>{o.style.setProperty(e,t,"important")}),r.appendChild(o)}}const lt={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)"},ct="flowplayer/"+y;function ut(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on(S,()=>document.removeEventListener(ct,t)),document.addEventListener(ct,t)}const dt=function(){const e=Ke(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function pt(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),pt;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const s=Je(r.token);if(!s.success)return tt(o,null,{reason:"token",details:s.message});const a=new Map,l=Ve(r,o);l.reaper=a,l._customElements=ie,Object.defineProperty(l,"token",{value:"string"==typeof r.token?Ze.id(r.token):"",writable:!1}),l.addEventListener(S,()=>{a.clear(),l.reaper=0,delete l.root}),l.root=o,r.token&&et.from_token(r.token).is_granted(et.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),We(r,o,l),l.setAttrs(r),l.plugins=pt.extensions.map(e=>new e(pt,l)),rt(r,o,l),it(r,0,l),at(r,o,l),ut(l),l.plugins.forEach(e=>{try{e.init(r,o,l)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),l.setOpts(r),l.opts=r,r.src&&l.setSrc(r.src);const c=l.readyState;return c>0&&l.currentSrc&&l.emit(p),c>2&&l.currentSrc&&l.emit(E),l.emit("mount"),l.on("error:fatal",(function(e){tt(o,l,e.data||{})})),l}Object.assign(pt,dt),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.customElements=ie,r.defaultElements=q,r.version="3.0.1-rc.2",r.commit="6fbb2390d6a7c662947c90924411af433b4f2927",r.instances=t,r.extensions=e,r.support=n,r.events=N,r.states=J,r.jwt=oe,r.autoplay=re,r.quality=le}(pt),"object"==typeof document&&setTimeout(Fe,0,document,"flowplayer:umd",pt);var ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ht(e){var t={exports:{}};return e(t,t.exports),t.exports}var mt=ht((function(e,t){var n=ft&&ft.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return n(n({},e),t)}),{})},t.pluck=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~n.indexOf(e)})).reduce((function(n,r){var o;return t.merge(n,((o={})[r]=e[r],o))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),_t=ht((function(e,t){var n=ft&&ft.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=ft&&ft.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=ft&&ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};t.__esModule=!0;var i=o(mt),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],o=n[1],i=n[2];if(!(Date.now()<t.stats.ttl)){var s=new XMLHttpRequest;t.open.push(s),s.timeout=e.REQUEST_TIMEOUT_MS,s.ontimeout=function(){e.handle_error(t,s)},s.onerror=function(n){e.handle_error(t,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&e.rm(t,s),Math.floor(s.status/100)},s.onload=function(){e.rm(t,s),t.stats.failures&&t.stats.failures--},s.open(o,r),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(i))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return i.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=s})),yt=ht((function(e,t){var n=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(_t);t.default=r.default.of()})),vt=ht((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),Et=ht((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),gt=ht((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),wt=ht((function(e,t){var n=ft&&ft.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=ft&&ft.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=ft&&ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=ft&&ft.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},s=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=s(yt),l=s(_t),c=o(vt),u=o(mt),d=function(){function e(t,n){var r=this;void 0===n&&(n={});var o=this;if(this.emitter=t,this.url=n.url,this.log=Et.Log.of(this.emitter),this.verb=n.verb,this.metadata=u.merge({},n.metadata||{}),this.rq=n.rq||a.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.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");e.TRACKERS.push(this),o.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var i=u.merge(o.metadata,{event_type:t},n.data||n),s=c.prepare_url(o,i),a=e.pluck_valid_keys(o,i),d=e.ensure_required_keys(o,a);if(d.length)return o.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(a,null,2));l.default.rpush(r.rq,[s,r.verb,a])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return u.pluck.apply(u,i([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,u.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,u.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=a.default,e.verb=gt.Verb,e}();t.default=d})),bt=ht((function(e,t){var n=ft&&ft.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=ft&&ft.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=ft&&ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=i(wt);t.Tracker=s.default;var a=o(vt);t.API=a})),St="ping",Ot="display",Tt="view";const At=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],Nt=["created","position"],kt=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function Lt(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function Rt(e,t,n){if(!t.segment_duration&&!Lt(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:It(e,t);return t.last_idx=o,o<=r?[]:t.breakpoints.slice(r,99==o?100:o).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(St,{position:r})}function It(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const Ct="vod",Dt="live",Mt=[Ot,St,Tt];function xt(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(St,{position:60*t.ticks}))}(e,t);case"vod":return Rt(e,t,"boolean"==typeof n&&n)}}function Ut(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}function Ft(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class Analytics{init(e,t,n){if(!et.from_token(e.token||"").is_granted(et.permissions.ANALYTICS))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{xt(n,r.ticker)}};const i={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id},s=bt.Tracker.of(n,{verb:bt.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:Mt,required_keys:At,optional_keys:kt.concat(Nt).slice(0),metadata:i});n.on(S,(function(){s&&s.destroy()})),n.on(O,(function(t){if(!s)return;const o=Ne(t,"data.metadata",{});if(!o.media_id)return;const i=Ne(s,"metadata.media_id");if(i&&o.media_id==i)return;const a=Ne(e,"analytics",{});s.put(o),s.put(a);const l=Ne(e,"metadata.live_start_time",e.live)?Dt:Ct;s.put({video_type:l,source:e.source||Ft()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(Ot)}));let a=0;n.on(y,(function(){if(!s)return;if(a||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(s,r))return;s.put({muted:n.muted});const e=Ut(n);if(e)return a=Promise.resolve(e).then((function(){r.last_media_id=s.metadata.media_id,n.emit(Tt),a=0})).catch((function(){a=0}));r.last_media_id=s.metadata.media_id,n.emit(Tt)})),n.on("timeupdate",(function(){var t;s&&(a||Ut(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&xt(n,r.ticker,!0),(t=o).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),n.on(w,(function(){s&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){Lt(e,t),t.last_idx=It(e,t)}(n,r.ticker)})),n.on(g,(function(){s&&function(e,t){t.ended||(t.ended=!0,xt(e,t.ticker))}(n,r)}))}}var Pt;function Bt(e){switch(e){case Pt.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case Pt.MEDIA_ERR_NETWORK:return"a network error occurred";case Pt.MEDIA_ERR_DECODE:return"unable to decode media content";case Pt.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case Pt.NO_INTERNET:return"no internet connection detected";case Pt.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function Ht(){}function jt(e){try{return!!new URL(e)}catch(e){return!1}}ze(Ke(),Analytics),"undefined"!=typeof window&&window.matchMedia&&[T,A].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(n){t.length&&t.forEach((function(t){n.matches&&t.emit(e)}))}))})),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(Pt||(Pt={}));const Gt=()=>!0===(navigator||{}).onLine;function qt(e){try{return"https:"===location.protocol&&"http:"==function(e){const t=document.createElement("a");return t.href=e,t}(e).protocol}catch(e){return!1}}function Wt(e,t,n){n.on("error",(function(e){const t=e.data||n.error||new Error,r=e.code||t.code,o="Error: %s\n"+(null===(i=(new Error).stack)||void 0===i?void 0:i.split("\n").slice(2).join("\n"));var i;setTimeout((function(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;n.setState("is-error",!0),8===r||t.fatal||function(e){const t=e.togglePlay,n=e.root;e.togglePlay=Ht,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const r=n.querySelector(".fp-error");r&&r.remove()}))}(n);const i=function(e,t,n){switch(t){case"http:0":return function(e){return qt(e.original_src)?{code:Pt.MIXED_CONTENT}:Gt()?{code:Pt.MEDIA_ERR_NETWORK}:Gt()?{code:Pt.UNKNOWN}:{code:Pt.NO_INTERNET}}(e);case Pt.MEDIA_ERR_SRC_NOT_SUPPORTED:return e.once(m,(function(){e.emit("recover")})),n;default:return n}}(n,r,t),s=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=t.code||-1,r=Bt(n);return e.i18n("media_errors."+n,r)}(n,i);console.error(o,s);const a=n.reaper&&n.reaper.get("ui");return a&&function(e,t,n,r){if(!e)return;const o=document.createElement("div");if(o.classList.add("fp-error"),o.innerText=t,r){const t=e.querySelector("#"+r);t&&e.removeChild(t),o.id=r}if(e.append(o),n){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=n,o.append(e)}}(a,s,t.details)}))}))}var Vt=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});function zt(e,t,n){let r=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),i="webkit"+i,r=()=>t.webkitCurrentFullScreenElement}const s=()=>n.getFullsceenTarget?n.getFullsceenTarget():t;n.toggleFullScreen=function(e,t){if(n.ios_fullscreen_disabled)return;if("boolean"!=typeof e&&(e=!n.hasState("is-fullscreen")),Kt(n)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(n):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState(Z)||e.setState(Z,!0)}(n,t)),!document.fullscreenEnabled)return;const r=s();e?r.requestFullscreen():document.exitFullscreen()},Kt(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on("webkitendfullscreen",(function(){n.toggleFullScreen(!1,!0)}))),setTimeout(()=>{const e=s();e.addEventListener(i,(function(){const t=r(),o=t===e||t==n;n.emit(o?u:d),n.setState("is-fullscreen",o),n.emit(c)}))},0),!1!==e.doubleclick&&t.addEventListener(o,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&n.toggleFullScreen()}))}function Kt(e){return n().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function Yt(e){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const t=e.opt("live_dvr_window",0),n=e.seekable.end(e.seekable.length-1);return{head:n,tail:Math.max(e.seekable.start(0),n-t)}}function Xt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function Qt(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:e.seekable.end(0)}function Zt(e){return function(e){return Yt(e).head}(e)-.5}function Jt(e){try{return localStorage.getItem(e)}catch(e){return null}}function $t(e,t){try{localStorage.setItem(e,t)}catch(e){}}function en(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=se(n,k);r.appendChild(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=Ae("fp-footer");t.append(r),n.on(O,(function(e){var t,n;const o=null===(t=e.data)||void 0===t?void 0:t.description,i=null===(n=e.data)||void 0===n?void 0:n.title;if(r.innerHTML="","string"==typeof i){const e=Ae("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=Ae("fp-desc");for(t.innerText=e.join(" "),r.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,n),Wt(0,0,n),t.appendChild(r),[s,a].forEach(e=>{t.addEventListener(e,(function(e){n.setState("is-hovered",e.type==s),n.setState("is-accessibility",!1)}))}),zt(e,t,n),n.on("volumechange",(function(){const e=0==n.volume||n.muted;n.setState("is-muted",e),$t("mute",e.toString())})),"true"==Jt("mute")&&(n.muted=!0,n.setState("is-muted",n.muted));const i=Jt("volume");i&&!isNaN(Number(i))&&(n.volume=Number(i)),n.emit("volumechange"),n.on("timeupdate",(function(){var t;e.live&&(!("dvr"in(t=e))||1==t.dvr)&&function(e,t){if(0==t)return!0;const n=Yt(e);return n.head-n.tail>=t}(n,e.seconds_to_dvr||0)&&n.setOpts({dvr:n.seekable.length>0})})),n.on("live",(function(){n.setState("is-live-seeked",!1)})),n.on("seeking",(function(){if(!Xt(n))return;if(0==n.seekable.length||0==n.played.length)return;if(0==Qt(n))return;const e=Zt(n),t=n.currentTime>=e?"live":"dvr";if("live"===t)return n.emit(t);const r=Qt(n),o=n.seekable.end(0)-n.seekable.start(0),i=(r-n.currentTime)/o*100,s=Math.round(i);n.setState("is-live-seeked",s>0),n.emit(t,{offset:s})})),n.on(p,(function(){n.setOpts({live:Xt(n)})})),n.on("durationchange",(function(e){const t=Xt(n),r=t?Qt(n):e.data||n.duration;isNaN(r)||n.setOpts({live:t,duration:r})})),n.on(O,(function(n){var r,o;e.seekable=void 0===(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.seekable)||n.data.seekable;const i=null===(o=n.data)||void 0===o?void 0:o.ui;if("number"!=typeof i)return;const s=t.classList;s.toggle("use-play-1",!(32&i||64&i)),s.toggle("use-play-2",(32&i)>0),s.toggle("use-play-3",(64&i)>0),s.toggle("use-thin-controlbar",(128&i)>0),s.toggle("no-title",(256&i)>0),s.toggle("no-description",(512&i)>0),s.toggle("logo-on-right",(8&i)>0),s.toggle("use-drag-handle",(16&i)>0),s.toggle("no-controls",(1024&i)>0),s.toggle("no-duration",(2048&i)>0),s.toggle("no-header",(4096&i)>0),s.toggle("no-mute",(4&i)>0),s.toggle("no-volume",(2&i)>0),s.toggle("no-fullscreen",(1&i)>0),s.toggle("no-touch-zones",(16384&i)>0)}));let l=null;o.addEventListener("mousemove",(function(){"number"==typeof l&&clearTimeout(l),n.setState("is-hovered",!0),l=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3)}))}function tn(e,t,n){if(et.from_token(e.token||"").is_granted(et.permissions.NO_METERING))return;const r=Ze.id(e.token||"");r&&n.once(y,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(n,r))}var nn={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(e,t,n){n.reaper&&n.reaper.set("translations",Ie(I18n,e,"en"))}}I18n.en=nn;const rn="rebuffer";var on=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:rn});const sn=navigator;function an(e){var t,n;const r=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return r?1e-6*r:(null===(n=sn.connection)||void 0===n?void 0:n.downlink)||-1}function ln(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const cn=De(),un=[];function dn(e){const t=un.slice(0);un.length=0,e.logger.log(`:dispatch events={${t.length}}`),ln("https://health.flowplayer.com/v1/health/events",t)}function pn(e,t,n){un.push(t),e.logger.log(":enqueue",t.event,t),un.length<10&&!n||dn(e)}const fn=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},hn=(e,t)=>Object.assign(e,{detail:t}),mn=(e,{event:t,media_session_id:n})=>({event:t,media_session_id:n,device_id:e.deviceId(),session_id:cn,timestamp:Date.now(),version:"3.0.1-rc.2",commit:"6fbb2390d6a7c662947c90924411af433b4f2927",ima_sdk_version:fn(),preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay),source:e.original_src,downlink_mbs:an(e),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime}),_n=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function yn(e,t,n,r){const o=mn(t,{event:n,media_session_id:e.media_session_id}),{before:i,after:s}=r;pn(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,_n(i),_n(s)))}const vn=(e,t)=>{let n=null;return(...r)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...r),e)}};class Health{constructor(e,t){if(this.logger=function(e,t){return{log:(...n)=>{const r=e.opt("debug");r&&t.match(r)&&console.log(t,...n)}}}(t,"health"),this.media_session_id=De(),!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=()=>e.instances.forEach(e=>e.emit("unload"));document.addEventListener("visibilitychange",()=>{"hidden"==document.visibilityState&&t()}),window.addEventListener("pagehide",t)}}init(e,t,n){!function(e){e.on(v,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit(rn)}))}(n),n.on("health:record",({detail:e})=>{const t=mn(n,{event:e.event,media_session_id:this.media_session_id});Object.assign(t,e.detail||{}),pn(this,t)}),[E,m,i,p,f,h,v,rn].forEach(e=>{n.on(e,e=>{pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id}))})}),[y,_,b,w,g,u,d].forEach(e=>{n.on(e,e=>{pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id}))})}),n.on("volumechange",vn(800,e=>{const t=mn(n,{event:e.type,media_session_id:this.media_session_id});pn(this,hn(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on(c,vn(800,e=>{const r=mn(n,{event:e.type,media_session_id:this.media_session_id});pn(this,hn(r,{height:t.clientHeight,width:t.clientWidth}))})),n.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return yn(this,n,e,t)}}),n.addEventListener("error",e=>{const t=mn(n,{event:e.type,media_session_id:this.media_session_id}),r=e.error||n.error;if(!r)return pn(this,t,!0);const o=r.code,i={error_message:r.message||Bt(o),error_code:o,error_stack:r.stack||""};return pn(this,hn(t,i),!0)}),n.on("src",e=>{var t;const r=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof r)return;if(!jt(n.original_src))return;if(!jt(r))return;if(r==n.original_src)return;this.media_session_id=De();pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id})),dn(this)}),n.on("unload",e=>{pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id})),dn(this)})}}var En;function gn(e,t){if(function(e){return Object.values(En).includes(e)}(t=t||En.Anonymous))return"crossOrigin"in e?e.crossOrigin=t:e.setAttribute("crossorigin",t),e}function wn(e){const t=document.createElement("a");return t.href=e,t.origin}function bn(e,t){const n=document.createElement("track");n.className="fp-track renderable",n.kind=t.kind||"captions",n.id=["fp",t.lang].join("-");const r=n.track;return"string"!=typeof t.crossorigin&&function(e,t){try{return e.src.startsWith("blob:"),wn(e.src)!==wn(t)}catch(e){return console.error(e),!0}}(e,t.src)&&(gn(e),t.crossorigin=e.getAttribute("crossorigin")),"crossorigin"in t&&gn(e,t.crossorigin),Object.keys(t).forEach(e=>{n[e]=t[e]}),r.mode=t.default?"showing":t.mode||"disabled",n.onload=function(){},r.oncuechange=function(t){e.emit(t.type,{track:t.target})},e.appendChild(n),n}Health.events=on,Health._UNLOAD_SUBSCRIBED=!1,ze(window,Health),function(e){e.Anonymous="anonymous",e.UseCredentials="use-credentials",e.Empty=""}(En||(En={}));var Sn=Object.freeze({__proto__:null,CHAPTER_CHANGED:"chapter:changed",CHAPTERS_NEW:"chapters:new"});class Chapters{constructor(){this._track_added_handler=Ht,this._cue_changed_handler=Ht,this.chapters=[],this.render=this.render.bind(this)}init(e,t,n){this._root=t,this._player=n,this._timeline=Oe(n,C),this._track_added_handler=this.track_added.bind(this,n),this._cue_changed_handler=this.cue_changed.bind(this,n),n.textTracks.addEventListener("addtrack",this._track_added_handler),this.wireup(n,e),n.chapters=this,n.on(O,e=>{e.data&&this.wireup(n,e.data)}),n.on(S,()=>{this.wiredown(n),n.textTracks.removeEventListener("addtrack",this._track_added_handler),n.off("durationchange",this.render)}),n.on("durationchange",this.render)}track_added(e,t){}cue_changed(e,t){var n;this._current_chapters_track&&(this.current_cue=this._current_chapters_track.track.activeCues?this._current_chapters_track.track.activeCues[0]:void 0,this._timeline&&Fe(this._timeline,"chapter:changed",null===(n=this.current_cue)||void 0===n?void 0:n.text))}set_chapters(e){this.chapters=e,this.render()}jump(e){this._player&&this.chapters[e]&&(this._player.currentTime=this.chapters[e].start)}current(){if(this.current_cue)return this.chapters.find(e=>e.cue==this.current_cue)}render(){if(!this._root||!this._player||!this._timeline)return;const e=this._player.duration;isFinite(e)&&(Fe(this._timeline,"chapters:new",this.chapters.map(t=>({title:t.label,left:t.start/e*100+"%",width:(t.end-t.start)/e*100+"%"}))),this._root.classList.toggle("has-chapters",!!this.chapters.length))}wireup(e,t){const n=Array.isArray(t.chapters)?t.chapters[0]:t.chapters;n&&n.src!==this._current_chapters_src&&(this.wiredown(e),this._current_chapters_track=bn(e,Object.assign(Object.assign({},n),{kind:"chapters",mode:"hidden"})),this._current_chapters_track.onload=()=>{var e;(null===(e=this._current_chapters_track)||void 0===e?void 0:e.track.cues)&&this.set_chapters(Array.from(this._current_chapters_track.track.cues).filter(e=>e instanceof VTTCue).map(e=>{const t=e;return{start:e.startTime,end:e.endTime,cue:t,label:t.text}}))},this._current_chapters_src=n.src,this._current_chapters_track.addEventListener("cuechange",this._cue_changed_handler))}wiredown(e){this.set_chapters([]),this._current_chapters_track&&(this._current_chapters_track.removeEventListener("cuechange",this._cue_changed_handler),e.removeChild(this._current_chapters_track))}}Chapters.events=Sn,ze(window,Chapters);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerPrimary extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-primary");const t={logo:""};e.on(O,e=>{var n,r;const o=t.logo,i=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";o!=i&&(t.logo=i,this.set_logo(i,null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo_href))})}set_logo(e,t){if(this.innerHTML="",!e)return;const n=document.createElement("img");if(n.classList.add("fp-logo"),n.src=e,!t)return this.append(n);const r=document.createElement("a");r.href=t,r.append(n),this.append(r)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(O,e=>{var t;const n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN;this.innerText=isFinite(n)?Le(n):""})}}const On={name:"fp-fullscreen",translation_key:"core.fullscreen"},Tn={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},An={name:"fp-play",translation_key:"core.play"},Nn={name:"fp-pause",translation_key:"core.pause"},kn={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Ln={translation_key:"core.play",name:"fp-small-play"},Rn={translation_key:"core.pause",name:"fp-small-pause"},In={name:"fp-fast-forward"},Cn={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(r,(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Dn={passive:!0};var Mn;function xn(e,t){let n=0,r=-1,o=-1;const i=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=e.classList;e.id=i,s.remove(Mn.GRABBING),s.remove(Mn.TOUCHING);const a=t.onseek||Ht,c=t.onstart||Ht,u=t.onend||Ht,d=t.onmouse||Ht,p=t.ontouch||Ht,f=t.ontouchend||Ht;function h(t){!function(){const t=e.getBoundingClientRect();n=t.left,r=t.width}();let o=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-n;return o>r&&(o=r),o<0&&(o=0),o/r*100}function m(t){const n=h(t);n!=o&&(a(e,n),o=n)}return e.addEventListener("touchstart",(function(t){Un(e,t)&&(s.add(Mn.TOUCHING),Fn(e.parentElement)&&(t.preventDefault(),s.add(Mn.GRABBING),p(e,h(t)),c(e,h(t)),m(t)))}),Dn),e.addEventListener("touchmove",(function(t){t.preventDefault(),m(t),d(e,h(t))}),Dn),e.addEventListener(l,(function(t){setTimeout((function(){s.remove(Mn.TOUCHING)}),500),Un(e,t)&&(t.preventDefault(),s.remove(Mn.GRABBING),f(e,h(t)),u(e,h(t)),r=0)}),Dn),e.addEventListener("touchcancel",(function(){s.remove(Mn.GRABBING,Mn.TOUCHING),r=0}),Dn),e.addEventListener("mousedown",(function(t){s.contains(Mn.TOUCHING)||(document.addEventListener("mousemove",m),s.add(Mn.GRABBING),c(e,h(t)),t.preventDefault(),m(t))})),e.addEventListener("mousemove",(function(t){s.contains(Mn.TOUCHING)||d(e,h(t))})),document.addEventListener("mouseup",(function(t){s.contains(Mn.TOUCHING)||(document.removeEventListener("mousemove",m),s.contains(Mn.GRABBING)&&(s.remove(Mn.GRABBING),u(e,h(t)),r=0))})),e}function Un(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!Fn(e.parentElement)||!e.classList.contains(Mn.TOUCHING))}function Fn(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(Mn||(Mn={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(e){super(e),this.className="fp-volume";const t=e.root.classList,n=t.contains("is-tiny")?6:t.contains("is-small")?8:10,r=Array.from({length:n}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});this.append(...r),xn(this,{onseek:(t,n)=>{n>0&&(e.muted=!1,function(e){try{localStorage.removeItem(e)}catch(e){}}("mute")),$t("volume",(e.volume=n/100).toString()),this.adjustVolumeSlider(e.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",e.i18n("core.volume","volume")),e.on("volumechange",()=>{(0==e.volume||e.muted)&&this.adjustVolumeSlider(0),this.classList.contains(Mn.GRABBING)||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString());const t=Array.from(this.querySelectorAll(".fp-tick")),n=Math.round(e*t.length);t.forEach((e,t)=>{e.classList.toggle("fp-color",t<n)})}}function Pn(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function Bn(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function Hn(e,t){e.style.width="0",t.style.width="0",t.style.display="none"}function jn(e,t,n){if(t.seeking||!t.seekable||0==t.seekable.length)return;const r=Gn(t,e/100);Pn(n,e);const o=isFinite(t.duration)?r:t.seekable.start(0)+r;n.innerText=Le(o)}function Gn(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(e.duration))return Qt(e)*t;const n=e.seekable.start(0);return n+t*(e.seekable.end(0)-n)}function qn(e,t){e.style.width="0",t.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=Ae("fp-buffer"),this.progress=Ae("fp-progress","fp-color"),this.tooltipEle=Ae("fp-timestamp"),this.proposedSeekBar=Ae("fp-hover"),this.dragger=Ae("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",e.i18n("timeline","Timeline")),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);let n=!1;const r=requestAnimationFrame;let o=void 0;const i=()=>{var n;0==e.reaper||t.live||(n=e,this.progress.style.width=n.currentTime/n.duration*100+"%",o=void 0,e.paused||this.classList.contains(Mn.GRABBING)||o||(o=setTimeout(i,200)))},s=()=>!!this.player.opt("opts.seekable",!0)&&!isNaN(this.player.duration);xn(this,{onseek:(n,r)=>{if(s())switch(!!t.live){case!0:jn(r,e,this.tooltipEle);break;case!1:!function(e,t,n){const r=t.duration*(e/100);if(t.disabled&&r>t.currentTime)return!1;n.style.width=e+"%",t.currentTime=r}(r,e,this.progress),Pn(this.tooltipEle,r)}},onstart:()=>{s()&&(e.emit("timeline/gesture/start"),e.setState(Y,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(n,o){r(i),0!=t.seekable&&(e.setState(Y,!1),t.live&&function(e,t){e/=100,t.currentTime=Gn(t,e)}(o,e))},ontouch:function(){e.paused||(n=!0,e.pause())},ontouchend:()=>{n&&(n=!1,e.play()),t.live?qn(this.proposedSeekBar,this.tooltipEle):Hn(this.proposedSeekBar,this.tooltipEle)},onmouse:(n,r)=>{if(s()&&!this.classList.contains(Mn.GRABBING))switch(e.emit("timeline/gesture/move",{percent:r}),!!t.live){case!0:!function(e,t){t.style.width=function(e){return 100-e}(e)+"%"}(r,this.proposedSeekBar),jn(r,e,this.tooltipEle);break;case!1:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),function(e,t,n){if(isNaN(e)||isNaN(t.duration))return;Pn(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=Le(e/100*t.duration),n.append(r)}(r,e,this.tooltipEle)}}}),e.on(O,(function(e){e.data&&(t=e.data)})),e.on(y,()=>r(i)),e.on("live",()=>{this.progress.style.width="0%"}),e.on(h,()=>{0==e.reaper||t.live||Bn(e,this.bufferEle)}),e.on("dvr",e=>{e.detail&&(this.progress.style.width=e.detail.offset+"%")}),e.on("timeupdate",()=>{0!=e.reaper&&(r(i),this.setAttribute("aria-valuenow",e.currentTime+""),t.live||Bn(e,this.bufferEle))}),e.on(p,()=>{0!=e.reaper&&(t.live||Bn(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const n=Xt(e)?Qt(e):t.data||e.duration;isNaN(n)||(this.setAttribute("aria-valuemax",n+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(a,()=>{e.emit("timeline/gesture/end"),t.live?qn(this.proposedSeekBar,this.tooltipEle):Hn(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(e){super(e),this.handleChapters(e)}handleChapters(e){const t=document.createElement("div");let n;this.addEventListener("chapters:new",e=>{t.innerText="",this.querySelectorAll(".fp-chapter").forEach(e=>this.removeChild(e)),e.data&&e.data.forEach(e=>{const r=document.createElement("div");r.className="fp-chapter",r.style.left=e.left,r.style.bottom=r.style.top="0",r.style.width=e.width,r.title=e.title,r.onmouseover=()=>{t.innerText=e.title},r.onmouseleave=()=>{t.innerText=n||""},this.appendChild(r)})}),this.addEventListener("chapter:changed",r=>{var o;const i=r.data;i&&(t.parentNode||(null===(o=Oe(e,L))||void 0===o||o.insertAdjacentElement("beforebegin",t),t.classList.toggle("fp-togglable",!0),t.classList.toggle("fp-chapter-info",!0)),n=i,t.innerText=i)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=Ae("fp-live-text"),n=Ae("fp-live-indicator","fp-color");t.innerHTML="live",this.append(n,t),this.addEventListener(r,(function(){!function(e){try{if(!e.hasState("is-live-seeked"))return;e.emit("live"),e.dvr_offset=0,e.currentTime=Zt(e)}catch(e){console.warn("failed to seek to now: %j",e)}}(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),e.on(O,n=>{if(0==e.reaper||!n.data)return;t=n.data;const r=Xt(e)?NaN:n.data.duration||0;if(isNaN(r)||r>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Le(r)}),e.on(p,()=>{var n,r;0==e.reaper||t.live||(r=this,(n=e).duration&&(r.innerText=Le(n.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=Le(0),e.on(O,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var n;0!=e.reaper&&(t.live?(n=e,this.innerText=Le(n.currentTime)):function(e,t){t.innerText=Le(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=se(e,"flowplayer-small-pause-icon"),n=se(e,"flowplayer-small-play-icon");t.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){n.focus&&n.focus()}),100)})),n.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){t.focus&&t.focus()}),100)})),this.append(t,n)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add(t);const n=this.classList.contains("fp-left-zone")?-1:1,r=document.createElement("span"),o=se(e,this.classList.contains("fp-left-zone")?j:"flowplayer-fast-forward-icon");o.removeAttribute("tabindex"),r.classList.add("fp-zone-seconds"),this.append(r,o);e.on(w,()=>{r.innerText=""}),e.on("seek:queued",e=>{const t=e.data;if(!t)return;if("number"!=typeof t.offset)return;const n=t.offset;if(0==n)return this.reset_zone();n>0&&this.classList.contains("fp-right-zone")||n<0&&!this.classList.contains("fp-right-zone")?this.render_zone_state(n):this.reset_zone()}),e.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener(l,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState("no-timeline")||!e.hasState("will-seek")&&!e.hasState(Z)||e.enqueueSeek(5*n)&&(t.stopPropagation(),t.preventDefault())}))}reset_zone(){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText="")}render_zone_state(e){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText=Math.abs(e)+"")}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(e,t,...n){super(e),this.className=t;const o=e.createComponents(...n);this.append(...o),"fp-left"!==t&&o.forEach(t=>{t.addEventListener(r,()=>e.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-wait"),Array(...Array(4)).map((e,t)=>t).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle-zone");const t=e.createComponents(P,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[B,H].forEach(t=>{const n=se(e,t);n.removeAttribute("tabindex"),this.append(n)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=se(e,G);this.append(t),!n().ios&&this.append(se(e,D)),t instanceof FlowplayerIcon&&t.addEventListener(r,(function(){e.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-header"),this.append(...e.createComponents("flowplayer-header-left-zone","flowplayer-header-right-zone")),e.reaper&&e.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-controls","fp-togglable"),this.append(...e.createComponents("flowplayer-control-buttons",R,I,C,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n(t==On?"core.fullscreen":"core.fullscreen_exit"))}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",F,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n("core.play")),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),[y,w].forEach(t=>e.once(t,()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")}))}handleClick(e){[r,o].forEach(t=>this.addEventListener(t,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(r,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState(Q)||e.togglePlay()}),0)})),e.on(o,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener(l,(function(t){0!=t.cancelable&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on(l,(function(n){setTimeout((function(){if(n.defaultPrevented)return;if(e.hasState(Q))return;if(e.ended)return e.togglePlay(!0);const r=e.hasState(K);t&&clearTimeout(t),(r||e.hasState(Z)||e.hasState("no-autoplay"))&&(e.hasState(Z)&&(e.setState(Z,!1),e.setState("is-hovered",!1)),e.togglePlay(),r)||(e.setState(Z,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState(Z,!1),e.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-ui"),this.append(...e.createComponents(M,U,L))}}return pt.extensions.unshift.apply(pt.extensions,[I18n,Analytics,Health,class Default{constructor(e){ae(e,k,FlowplayerUi),ae(e,L,FlowplayerControls),ae(e,R,FlowplayerLiveStatus),ae(e,"flowplayer-control-duration",FlowplayerDuration),ae(e,C,e.extensions.find(e=>e.name===Chapters.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),ae(e,I,FlowplayerElapsedTime),ae(e,D,FlowplayerVolumeBar),ae(e,"flowplayer-volume-control",FlowplayerVolumeControl),ae(e,"flowplayer-control-buttons",FlowplayerControlButtons),ae(e,M,FlowplayerHeader),ae(e,x,FlowplayerPrimary),ae(e,"flowplayer-header-duration",FlowplayerHeaderDuration),ae(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left",x,"flowplayer-header-duration")}}),ae(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),ae(e,U,FlowplayerMiddle),ae(e,F,FlowplayerMiddleZone),ae(e,P,FlowplayerMiddleWait),ae(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),ae(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),ae(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),ae(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,Ln),this.setAttribute("role","button")}}),ae(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,Rn),this.setAttribute("role","button")}}),ae(e,B,class extends FlowplayerIcon{constructor(e){super(e,An)}}),ae(e,H,class extends FlowplayerIcon{constructor(e){super(e,Nn)}}),ae(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,On)}}),ae(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,Tn)}}),ae(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,In)}}),ae(e,j,class extends FlowplayerIcon{constructor(e){super(e,Cn)}}),ae(e,G,class extends FlowplayerIcon{constructor(e){super(e,kn),this.classList.add("fp-volumebtn"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute"))})}})}init(e,t,n){var r;tn(e,0,n),en(e,t,n),r=n,"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}}]),Object.assign(pt,{ui:Vt,i18n:I18n})}));
15
+ ***************************************************************************** */function pe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function fe(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function he(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const me=e=>{var{src:t}=e,n=pe(e,["src"]);return[Object.assign({src:t,type:t?he("video/"+fe(t)):""},n)]};function _e(e){return me({src:e})}function ye(e){var{src:t,type:n}=e,r=pe(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:me(Object.assign({src:t},r))}var ve;function Ee(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?_e(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=_e(t)),"object"!=typeof t||Array.isArray(t)||(t=ye(t)),e.concat(t)}),[]):ye(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(ve.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return r?(r.onload(t,e.root,e,n),ve.Ok):ve.Err}(e,t,i)||ve.Ok==function(e,t,n,r={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return ve.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return ve.Err;"string"==typeof n.src&&(e.src=n.src);return ve.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(ve||(ve={}));const ge=[S,b,"src","seek:cancel"];var we;function be(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?Se(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,Se(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(we.BACKWARD,t.offset<0),e.setState(we.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Se(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(we.FORWARD,!1),e.setState(we.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Oe(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}function Te(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Ae(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function Ne(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function ke(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function Le(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+ke(r)+":"+ke(e)):t+ke(r)+":"+ke(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(we||(we={}));const Re=navigator.languages||[navigator.language];function Ie(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return Re.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!r[t]&&(r[t]=e[t])})),Object.values(r)}const Ce=[1e7]+""+-1e3+-4e3+-8e3+-1e11,De=()=>"undefined"==typeof crypto?"":Ce.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let Me="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const xe=["touchstart","touchmove"];function Ue(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Fe(e,t,n){const r=Ue(t,n);return e.dispatchEvent(r),e}function Pe(e,t,n){const r=Ue(t,n);return e.dispatchEvent(r),r}function Be(e,t,n,r){Array.isArray(t)?t.forEach(t=>He(e,t,n,r)):He(e,t,n,r)}function He(e,t,n,r){if(o=t,!~xe.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function je(e,t,n,r){return Be(e,t,n,Object.assign(r||{},{once:!0}))}const Ge={preload:"none",rtl:!1,controls:!0},qe=["loop","muted","preload"];function We(e,r,o){o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return Ee(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return n[Q]&&(n[W]=!1),o.playerState=n,Fe(o,"state",o.playerState),o},o.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>se(this,e[n]))},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){!o.hasState(e)&&o.hasState(t)||(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.emit=(e,t)=>(Fe(o,e,t),o),o.on=(e,t)=>(Be(o,e,t),o),o.once=(e,t)=>(je(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>Pe(o,e,t),o.togglePlay=function(t){return ce(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Fe(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),Fe(o,S)}),0)},o.setAttrs=function(e){return qe.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?Ne(Ge,t):n,Ne(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:Ne(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return Te();const t=e.getAttribute("dir");return t?"rtl"==t:Te()}(r))),o.setState("is-live",!!e.live),o.setState("no-timeline",!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Fe(o,O,e)},o.renderPlugin=function(e){Pe(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var s,a;a=i,(s=o).on(ge,(function(){Se(s,a)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return be(o,i,e)},o.deviceId=function(){return function(){if(Me)return Me;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=De();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return Me=De()}}()}}function Ve(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}function ze(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}function Ke(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const Ye=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function Xe(e,t){return!!~Ye.indexOf(e)||e.indexOf(t)===e.length-t.length}Xe.check_whitelist=function(e){return!!~Ye.indexOf(e)};const Qe="production";function Ze(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=oe(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&Ze.validate(n),n}function Je(e){try{return Ze.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var $e;function et(e){return{grant:e,is_granted:t=>(e&t)===t}}function tt(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function nt(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function rt(e,t,r){let o=!0;t.classList.add("flowplayer"),nt(0,t),Be(r,[m,c],(function(){nt(0,t)})),Be(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),Be(r,"timeupdate",(function(){r.setState(Q,!1)})),Be(r,O,(function(){const n=r.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==r.currentTime;[z,K].forEach((function(e){r.setState(e,n)}))})),Be(r,g,(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!r.loop&&(e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(Y,!0),je(r,w,(function(){r.setState(Y,!1),r.pause(),r.setState(K,!0)})),r.currentTime=0),je(r,"timeupdate",(function(){r.setState(X,!1)})),r.transitionState(X,W,e.loop||e.rewind?0:300))}),0)})),Be(r,[b,w],(function(e){r.setState(Y,e.type==b),r.setState(V,r.paused),r.setState(W,!r.paused)})),Be(r,g,(function(){r.setState(W,!1),o=!0})),Be(r,n().ios?p:f,(function(e){const t="src"!=e.type||"none"!==r.opt("preload");r.setState("is-loaded",t),r.setState(z,!t)})),Be(r,[v,E,m],(function(t){if(!r.hasState(Y)&&(t.type!=E||e.autoplay||r.setState(Q,!1),t.type!=m||"none"!=r.opt("preload")||e.autoplay)){if(t.type==m&&e.autoplay)return je(r,y,(function(){r.setState(Q,!1)}));t.type==v&&[W,V,K].forEach((function(e){r.setState(e,!1)})),r.setState(X,!1),r.setState(Q,t.type==v)}})),Be(r,[y,_],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n=t.type==y,i=r.currentTime==r.duration,s=n&&o&&e.autoplay||r.hasState(Q);if(n&&(r.started=!0,o=!1),r.setState(Q,!1).setState(K,!1),i||r.hasState(Y))return;const a=n?W:V,l=n?V:W;r.transitionState(a,l,s?0:300),n&&r.setState("no-autoplay",!1)}))}function ot(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,r=t.height,o=t.bottom,i=r/5;return t.top<=i&&t.top+r>n-i||o-r+i>=0&&o<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,Fe(e,t?"viewenter":"viewleave")),e}function it(e,n,o){ot(o);const i={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[l,r].forEach(e=>je(o,e,()=>i.has_user_gesture=!0)),Be(o,"play",(function(){i.locked||(i.should_resume=!0)})),Be(o,_,(function(){i.locked||(i.should_resume=!1)})),Be(o,E,(function(n){!e.autoplay||t.filter((function(e){return!e.paused})).length&&!e.multiplay||o.in_viewport&&o.paused&&i.should_resume&&o.togglePlay(!0)})),e.autopause&&(Be(o,"viewenter",(function(){i.should_resume&&o.togglePlay(!0)})),Be(o,"viewleave",(function(){const e=!o.paused;i.locked=!0,o.pause(),setTimeout((function(){i.should_resume=e,i.locked=!1}),0)})))}Ze.validate=function(e){if("string"==typeof e&&(e=Ze(e)),!e||!e.raw){if(Xe.check_whitelist(window.location.hostname)||"dev"===Qe.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=Xe.bind(null,t);if("dev"!==Qe.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==Qe.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},Ze.id=function(e){if(e)return"string"==typeof e&&(e=Ze(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}($e||($e={})),et.of=et,et.from_token=function(e){const t=Ze(e,{require_valid_token:!0});return et.of(t.data.acl)},et.permissions=$e,[i,c].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Fe(e,c),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(ot)}));function st(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function at(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=st(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[f,p];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(O,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=st((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.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(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(y,this.render),null===(t=this.player)||void 0===t||t.once(g,this.wireUp)}cleanUp(){var e,t,n,r;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off(y,this.render),null===(r=this.player)||void 0===r||r.off(g,this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const r=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!r)return;const o=this._logo=document.createElement("a");o.href="https://explorer.flowplayer.com",o.target="_blank",Object.entries(lt).forEach(([e,t])=>{o.style.setProperty(e,t,"important")}),r.appendChild(o)}}const lt={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)"},ct="flowplayer/"+y;function ut(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on(S,()=>document.removeEventListener(ct,t)),document.addEventListener(ct,t)}const dt=function(){const e=Ke(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function pt(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),pt;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const s=Je(r.token);if(!s.success)return tt(o,null,{reason:"token",details:s.message});const a=new Map,l=Ve(r,o);l.reaper=a,l._customElements=ie,Object.defineProperty(l,"token",{value:"string"==typeof r.token?Ze.id(r.token):"",writable:!1}),l.addEventListener(S,()=>{a.clear(),l.reaper=0,delete l.root}),l.root=o,r.token&&et.from_token(r.token).is_granted(et.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),We(r,o,l),l.setAttrs(r),l.plugins=pt.extensions.map(e=>new e(pt,l)),rt(r,o,l),it(r,0,l),at(r,o,l),ut(l),l.plugins.forEach(e=>{try{e.init(r,o,l)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),l.setOpts(r),l.opts=r,r.src&&l.setSrc(r.src);const c=l.readyState;return c>0&&l.currentSrc&&l.emit(p),c>2&&l.currentSrc&&l.emit(E),l.emit("mount"),l.on("error:fatal",(function(e){tt(o,l,e.data||{})})),l}Object.assign(pt,dt),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.customElements=ie,r.defaultElements=q,r.version="3.0.1-rc.3",r.commit="99bc0ccc7b34661f9715474d094f159f9bdbfeac",r.instances=t,r.extensions=e,r.support=n,r.events=N,r.states=J,r.jwt=oe,r.autoplay=re,r.quality=le}(pt),"object"==typeof document&&setTimeout(Fe,0,document,"flowplayer:umd",pt);var ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ht(e){var t={exports:{}};return e(t,t.exports),t.exports}var mt=ht((function(e,t){var n=ft&&ft.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return n(n({},e),t)}),{})},t.pluck=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~n.indexOf(e)})).reduce((function(n,r){var o;return t.merge(n,((o={})[r]=e[r],o))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),_t=ht((function(e,t){var n=ft&&ft.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=ft&&ft.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=ft&&ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};t.__esModule=!0;var i=o(mt),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],o=n[1],i=n[2];if(!(Date.now()<t.stats.ttl)){var s=new XMLHttpRequest;t.open.push(s),s.timeout=e.REQUEST_TIMEOUT_MS,s.ontimeout=function(){e.handle_error(t,s)},s.onerror=function(n){e.handle_error(t,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&e.rm(t,s),Math.floor(s.status/100)},s.onload=function(){e.rm(t,s),t.stats.failures&&t.stats.failures--},s.open(o,r),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(i))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return i.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=s})),yt=ht((function(e,t){var n=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(_t);t.default=r.default.of()})),vt=ht((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),Et=ht((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),gt=ht((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),wt=ht((function(e,t){var n=ft&&ft.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=ft&&ft.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=ft&&ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=ft&&ft.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},s=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=s(yt),l=s(_t),c=o(vt),u=o(mt),d=function(){function e(t,n){var r=this;void 0===n&&(n={});var o=this;if(this.emitter=t,this.url=n.url,this.log=Et.Log.of(this.emitter),this.verb=n.verb,this.metadata=u.merge({},n.metadata||{}),this.rq=n.rq||a.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.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");e.TRACKERS.push(this),o.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var i=u.merge(o.metadata,{event_type:t},n.data||n),s=c.prepare_url(o,i),a=e.pluck_valid_keys(o,i),d=e.ensure_required_keys(o,a);if(d.length)return o.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(a,null,2));l.default.rpush(r.rq,[s,r.verb,a])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return u.pluck.apply(u,i([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,u.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,u.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=a.default,e.verb=gt.Verb,e}();t.default=d})),bt=ht((function(e,t){var n=ft&&ft.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=ft&&ft.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=ft&&ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=i(wt);t.Tracker=s.default;var a=o(vt);t.API=a})),St="ping",Ot="display",Tt="view";const At=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],Nt=["created","position"],kt=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function Lt(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function Rt(e,t,n){if(!t.segment_duration&&!Lt(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:It(e,t);return t.last_idx=o,o<=r?[]:t.breakpoints.slice(r,99==o?100:o).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(St,{position:r})}function It(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const Ct="vod",Dt="live",Mt=[Ot,St,Tt];function xt(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(St,{position:60*t.ticks}))}(e,t);case"vod":return Rt(e,t,"boolean"==typeof n&&n)}}function Ut(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}function Ft(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class Analytics{init(e,t,n){if(!et.from_token(e.token||"").is_granted(et.permissions.ANALYTICS))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{xt(n,r.ticker)}};const i={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id},s=bt.Tracker.of(n,{verb:bt.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:Mt,required_keys:At,optional_keys:kt.concat(Nt).slice(0),metadata:i});n.on(S,(function(){s&&s.destroy()})),n.on(O,(function(t){if(!s)return;const o=Ne(t,"data.metadata",{});if(!o.media_id)return;const i=Ne(s,"metadata.media_id");if(i&&o.media_id==i)return;const a=Ne(e,"analytics",{});s.put(o),s.put(a);const l=Ne(e,"metadata.live_start_time",e.live)?Dt:Ct;s.put({video_type:l,source:e.source||Ft()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(Ot)}));let a=0;n.on(y,(function(){if(!s)return;if(a||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(s,r))return;s.put({muted:n.muted});const e=Ut(n);if(e)return a=Promise.resolve(e).then((function(){r.last_media_id=s.metadata.media_id,n.emit(Tt),a=0})).catch((function(){a=0}));r.last_media_id=s.metadata.media_id,n.emit(Tt)})),n.on("timeupdate",(function(){var t;s&&(a||Ut(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&xt(n,r.ticker,!0),(t=o).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),n.on(w,(function(){s&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){Lt(e,t),t.last_idx=It(e,t)}(n,r.ticker)})),n.on(g,(function(){s&&function(e,t){t.ended||(t.ended=!0,xt(e,t.ticker))}(n,r)}))}}var Pt;function Bt(e){switch(e){case Pt.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case Pt.MEDIA_ERR_NETWORK:return"a network error occurred";case Pt.MEDIA_ERR_DECODE:return"unable to decode media content";case Pt.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case Pt.NO_INTERNET:return"no internet connection detected";case Pt.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function Ht(){}function jt(e){try{return!!new URL(e)}catch(e){return!1}}ze(Ke(),Analytics),"undefined"!=typeof window&&window.matchMedia&&[T,A].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(n){t.length&&t.forEach((function(t){n.matches&&t.emit(e)}))}))})),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(Pt||(Pt={}));const Gt=()=>!0===(navigator||{}).onLine;function qt(e){try{return"https:"===location.protocol&&"http:"==function(e){const t=document.createElement("a");return t.href=e,t}(e).protocol}catch(e){return!1}}function Wt(e,t,n){n.on("error",(function(e){const t=e.data||n.error||new Error,r=e.code||t.code,o="Error: %s\n"+(null===(i=(new Error).stack)||void 0===i?void 0:i.split("\n").slice(2).join("\n"));var i;setTimeout((function(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;n.setState("is-error",!0),8===r||t.fatal||function(e){const t=e.togglePlay,n=e.root;e.togglePlay=Ht,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const r=n.querySelector(".fp-error");r&&r.remove()}))}(n);const i=function(e,t,n){switch(t){case"http:0":return function(e){return qt(e.original_src)?{code:Pt.MIXED_CONTENT}:Gt()?{code:Pt.MEDIA_ERR_NETWORK}:Gt()?{code:Pt.UNKNOWN}:{code:Pt.NO_INTERNET}}(e);case Pt.MEDIA_ERR_SRC_NOT_SUPPORTED:return e.once(m,(function(){e.emit("recover")})),n;default:return n}}(n,r,t),s=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=t.code||-1,r=Bt(n);return e.i18n("media_errors."+n,r)}(n,i);console.error(o,s);const a=n.reaper&&n.reaper.get("ui");return a&&function(e,t,n,r){if(!e)return;const o=document.createElement("div");if(o.classList.add("fp-error"),o.innerText=t,r){const t=e.querySelector("#"+r);t&&e.removeChild(t),o.id=r}if(e.append(o),n){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=n,o.append(e)}}(a,s,t.details)}))}))}var Vt=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});function zt(e,t,n){let r=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),i="webkit"+i,r=()=>t.webkitCurrentFullScreenElement}const s=()=>n.getFullsceenTarget?n.getFullsceenTarget():t;n.toggleFullScreen=function(e,t){if(n.ios_fullscreen_disabled)return;if("boolean"!=typeof e&&(e=!n.hasState("is-fullscreen")),Kt(n)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(n):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState(Z)||e.setState(Z,!0)}(n,t)),!document.fullscreenEnabled)return;const r=s();e?r.requestFullscreen():document.exitFullscreen()},Kt(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on("webkitendfullscreen",(function(){n.toggleFullScreen(!1,!0)}))),setTimeout(()=>{const e=s();e.addEventListener(i,(function(){const t=r(),o=t===e||t==n;n.emit(o?u:d),n.setState("is-fullscreen",o),n.emit(c)}))},0),!1!==e.doubleclick&&t.addEventListener(o,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&n.toggleFullScreen()}))}function Kt(e){return n().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function Yt(e){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const t=e.opt("live_dvr_window",0),n=e.seekable.end(e.seekable.length-1);return{head:n,tail:Math.max(e.seekable.start(0),n-t)}}function Xt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function Qt(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:e.seekable.end(0)}function Zt(e){return function(e){return Yt(e).head}(e)-.5}function Jt(e){try{return localStorage.getItem(e)}catch(e){return null}}function $t(e,t){try{localStorage.setItem(e,t)}catch(e){}}function en(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=se(n,k);r.appendChild(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=Ae("fp-footer");t.append(r),n.on(O,(function(e){var t,n;const o=null===(t=e.data)||void 0===t?void 0:t.description,i=null===(n=e.data)||void 0===n?void 0:n.title;if(r.innerHTML="","string"==typeof i){const e=Ae("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=Ae("fp-desc");for(t.innerText=e.join(" "),r.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,n),Wt(0,0,n),t.appendChild(r),[s,a].forEach(e=>{t.addEventListener(e,(function(e){n.setState("is-hovered",e.type==s),n.setState("is-accessibility",!1)}))}),zt(e,t,n),n.on("volumechange",(function(){const e=0==n.volume||n.muted;n.setState("is-muted",e),$t("mute",e.toString())})),"true"==Jt("mute")&&(n.muted=!0,n.setState("is-muted",n.muted));const i=Jt("volume");i&&!isNaN(Number(i))&&(n.volume=Number(i)),n.emit("volumechange"),n.on("timeupdate",(function(){var t;e.live&&(!("dvr"in(t=e))||1==t.dvr)&&function(e,t){if(0==t)return!0;const n=Yt(e);return n.head-n.tail>=t}(n,e.seconds_to_dvr||0)&&n.setOpts({dvr:n.seekable.length>0})})),n.on("live",(function(){n.setState("is-live-seeked",!1)})),n.on("seeking",(function(){if(!Xt(n))return;if(0==n.seekable.length||0==n.played.length)return;if(0==Qt(n))return;const e=Zt(n),t=n.currentTime>=e?"live":"dvr";if("live"===t)return n.emit(t);const r=Qt(n),o=n.seekable.end(0)-n.seekable.start(0),i=(r-n.currentTime)/o*100,s=Math.round(i);n.setState("is-live-seeked",s>0),n.emit(t,{offset:s})})),n.on(p,(function(){n.setOpts({live:Xt(n)})})),n.on("durationchange",(function(e){const t=Xt(n),r=t?Qt(n):e.data||n.duration;isNaN(r)||n.setOpts({live:t,duration:r})})),n.on(O,(function(n){var r,o;e.seekable=void 0===(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.seekable)||n.data.seekable;const i=null===(o=n.data)||void 0===o?void 0:o.ui;if("number"!=typeof i)return;const s=t.classList;s.toggle("use-play-1",!(32&i||64&i)),s.toggle("use-play-2",(32&i)>0),s.toggle("use-play-3",(64&i)>0),s.toggle("use-thin-controlbar",(128&i)>0),s.toggle("no-title",(256&i)>0),s.toggle("no-description",(512&i)>0),s.toggle("logo-on-right",(8&i)>0),s.toggle("use-drag-handle",(16&i)>0),s.toggle("no-controls",(1024&i)>0),s.toggle("no-duration",(2048&i)>0),s.toggle("no-header",(4096&i)>0),s.toggle("no-mute",(4&i)>0),s.toggle("no-volume",(2&i)>0),s.toggle("no-fullscreen",(1&i)>0),s.toggle("no-touch-zones",(16384&i)>0)}));let l=null;o.addEventListener("mousemove",(function(){"number"==typeof l&&clearTimeout(l),n.setState("is-hovered",!0),l=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3)}))}function tn(e,t,n){if(et.from_token(e.token||"").is_granted(et.permissions.NO_METERING))return;const r=Ze.id(e.token||"");r&&n.once(y,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(n,r))}var nn={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(e,t,n){n.reaper&&n.reaper.set("translations",Ie(I18n,e,"en"))}}I18n.en=nn;const rn="rebuffer";var on=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:rn});const sn=navigator;function an(e){var t,n;const r=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return r?1e-6*r:(null===(n=sn.connection)||void 0===n?void 0:n.downlink)||-1}function ln(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const cn=De(),un=[];function dn(e){const t=un.slice(0);un.length=0,e.logger.log(`:dispatch events={${t.length}}`),ln("https://health.flowplayer.com/v1/health/events",t)}function pn(e,t,n){un.push(t),e.logger.log(":enqueue",t.event,t),un.length<10&&!n||dn(e)}const fn=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},hn=(e,t)=>Object.assign(e,{detail:t}),mn=(e,{event:t,media_session_id:n})=>({event:t,media_session_id:n,device_id:e.deviceId(),session_id:cn,timestamp:Date.now(),version:"3.0.1-rc.3",commit:"99bc0ccc7b34661f9715474d094f159f9bdbfeac",ima_sdk_version:fn(),preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay),source:e.original_src,downlink_mbs:an(e),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime}),_n=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function yn(e,t,n,r){const o=mn(t,{event:n,media_session_id:e.media_session_id}),{before:i,after:s}=r;pn(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,_n(i),_n(s)))}const vn=(e,t)=>{let n=null;return(...r)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...r),e)}};class Health{constructor(e,t){if(this.logger=function(e,t){return{log:(...n)=>{const r=e.opt("debug");r&&t.match(r)&&console.log(t,...n)}}}(t,"health"),this.media_session_id=De(),!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=()=>e.instances.forEach(e=>e.emit("unload"));document.addEventListener("visibilitychange",()=>{"hidden"==document.visibilityState&&t()}),window.addEventListener("pagehide",t)}}init(e,t,n){!function(e){e.on(v,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit(rn)}))}(n),n.on("health:record",({detail:e})=>{const t=mn(n,{event:e.event,media_session_id:this.media_session_id});Object.assign(t,e.detail||{}),pn(this,t)}),[E,m,i,p,f,h,v,rn].forEach(e=>{n.on(e,e=>{pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id}))})}),[y,_,b,w,g,u,d].forEach(e=>{n.on(e,e=>{pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id}))})}),n.on("volumechange",vn(800,e=>{const t=mn(n,{event:e.type,media_session_id:this.media_session_id});pn(this,hn(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on(c,vn(800,e=>{const r=mn(n,{event:e.type,media_session_id:this.media_session_id});pn(this,hn(r,{height:t.clientHeight,width:t.clientWidth}))})),n.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return yn(this,n,e,t)}}),n.addEventListener("error",e=>{const t=mn(n,{event:e.type,media_session_id:this.media_session_id}),r=e.error||n.error;if(!r)return pn(this,t,!0);const o=r.code,i={error_message:r.message||Bt(o),error_code:o,error_stack:r.stack||""};return pn(this,hn(t,i),!0)}),n.on("src",e=>{var t;const r=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof r)return;if(!jt(n.original_src))return;if(!jt(r))return;if(r==n.original_src)return;this.media_session_id=De();pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id})),dn(this)}),n.on("unload",e=>{pn(this,mn(n,{event:e.type,media_session_id:this.media_session_id})),dn(this)})}}var En;function gn(e,t){if(function(e){return Object.values(En).includes(e)}(t=t||En.Anonymous))return"crossOrigin"in e?e.crossOrigin=t:e.setAttribute("crossorigin",t),e}function wn(e){const t=document.createElement("a");return t.href=e,t.origin}function bn(e,t){const n=document.createElement("track");n.className="fp-track renderable",n.kind=t.kind||"captions",n.id=["fp",t.lang].join("-");const r=n.track;return"string"!=typeof t.crossorigin&&function(e,t){try{return e.src.startsWith("blob:"),wn(e.src)!==wn(t)}catch(e){return console.error(e),!0}}(e,t.src)&&(gn(e),t.crossorigin=e.getAttribute("crossorigin")),"crossorigin"in t&&gn(e,t.crossorigin),Object.keys(t).forEach(e=>{n[e]=t[e]}),r.mode=t.default?"showing":t.mode||"disabled",n.onload=function(){},r.oncuechange=function(t){e.emit(t.type,{track:t.target})},e.appendChild(n),n}Health.events=on,Health._UNLOAD_SUBSCRIBED=!1,ze(window,Health),function(e){e.Anonymous="anonymous",e.UseCredentials="use-credentials",e.Empty=""}(En||(En={}));var Sn=Object.freeze({__proto__:null,CHAPTER_CHANGED:"chapter:changed",CHAPTERS_NEW:"chapters:new"});class Chapters{constructor(){this._track_added_handler=Ht,this._cue_changed_handler=Ht,this.chapters=[],this.render=this.render.bind(this)}init(e,t,n){this._root=t,this._player=n,this._timeline=Oe(n,C),this._track_added_handler=this.track_added.bind(this,n),this._cue_changed_handler=this.cue_changed.bind(this,n),n.textTracks.addEventListener("addtrack",this._track_added_handler),this.wireup(n,e),n.chapters=this,n.on(O,e=>{e.data&&this.wireup(n,e.data)}),n.on(S,()=>{this.wiredown(n),n.textTracks.removeEventListener("addtrack",this._track_added_handler),n.off("durationchange",this.render)}),n.on("durationchange",this.render)}track_added(e,t){}cue_changed(e,t){var n;this._current_chapters_track&&(this.current_cue=this._current_chapters_track.track.activeCues?this._current_chapters_track.track.activeCues[0]:void 0,this._timeline&&Fe(this._timeline,"chapter:changed",null===(n=this.current_cue)||void 0===n?void 0:n.text))}set_chapters(e){this.chapters=e,this.render()}jump(e){this._player&&this.chapters[e]&&(this._player.currentTime=this.chapters[e].start)}current(){if(this.current_cue)return this.chapters.find(e=>e.cue==this.current_cue)}render(){if(!this._root||!this._player||!this._timeline)return;const e=this._player.duration;isFinite(e)&&(Fe(this._timeline,"chapters:new",this.chapters.map(t=>({title:t.label,left:t.start/e*100+"%",width:(t.end-t.start)/e*100+"%"}))),this._root.classList.toggle("has-chapters",!!this.chapters.length))}wireup(e,t){const n=Array.isArray(t.chapters)?t.chapters[0]:t.chapters;n&&n.src!==this._current_chapters_src&&(this.wiredown(e),this._current_chapters_track=bn(e,Object.assign(Object.assign({},n),{kind:"chapters",mode:"hidden"})),this._current_chapters_track.onload=()=>{var e;(null===(e=this._current_chapters_track)||void 0===e?void 0:e.track.cues)&&this.set_chapters(Array.from(this._current_chapters_track.track.cues).filter(e=>e instanceof VTTCue).map(e=>{const t=e;return{start:e.startTime,end:e.endTime,cue:t,label:t.text}}))},this._current_chapters_src=n.src,this._current_chapters_track.addEventListener("cuechange",this._cue_changed_handler))}wiredown(e){this.set_chapters([]),this._current_chapters_track&&(this._current_chapters_track.removeEventListener("cuechange",this._cue_changed_handler),e.removeChild(this._current_chapters_track))}}Chapters.events=Sn,ze(window,Chapters);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerPrimary extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-primary");const t={logo:""};e.on(O,e=>{var n,r;const o=t.logo,i=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";o!=i&&(t.logo=i,this.set_logo(i,null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo_href))})}set_logo(e,t){if(this.innerHTML="",!e)return;const n=document.createElement("img");if(n.classList.add("fp-logo"),n.src=e,!t)return this.append(n);const r=document.createElement("a");r.href=t,r.append(n),this.append(r)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(O,e=>{var t;const n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN;this.innerText=isFinite(n)?Le(n):""})}}const On={name:"fp-fullscreen",translation_key:"core.fullscreen"},Tn={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},An={name:"fp-play",translation_key:"core.play"},Nn={name:"fp-pause",translation_key:"core.pause"},kn={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Ln={translation_key:"core.play",name:"fp-small-play"},Rn={translation_key:"core.pause",name:"fp-small-pause"},In={name:"fp-fast-forward"},Cn={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(r,(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Dn={passive:!0};var Mn;function xn(e,t){let n=0,r=-1,o=-1;const i=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=e.classList;e.id=i,s.remove(Mn.GRABBING),s.remove(Mn.TOUCHING);const a=t.onseek||Ht,c=t.onstart||Ht,u=t.onend||Ht,d=t.onmouse||Ht,p=t.ontouch||Ht,f=t.ontouchend||Ht;function h(t){!function(){const t=e.getBoundingClientRect();n=t.left,r=t.width}();let o=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-n;return o>r&&(o=r),o<0&&(o=0),o/r*100}function m(t){const n=h(t);n!=o&&(a(e,n),o=n)}return e.addEventListener("touchstart",(function(t){Un(e,t)&&(s.add(Mn.TOUCHING),Fn(e.parentElement)&&(t.preventDefault(),s.add(Mn.GRABBING),p(e,h(t)),c(e,h(t)),m(t)))}),Dn),e.addEventListener("touchmove",(function(t){t.preventDefault(),m(t),d(e,h(t))}),Dn),e.addEventListener(l,(function(t){setTimeout((function(){s.remove(Mn.TOUCHING)}),500),Un(e,t)&&(t.preventDefault(),s.remove(Mn.GRABBING),f(e,h(t)),u(e,h(t)),r=0)}),Dn),e.addEventListener("touchcancel",(function(){s.remove(Mn.GRABBING,Mn.TOUCHING),r=0}),Dn),e.addEventListener("mousedown",(function(t){s.contains(Mn.TOUCHING)||(document.addEventListener("mousemove",m),s.add(Mn.GRABBING),c(e,h(t)),t.preventDefault(),m(t))})),e.addEventListener("mousemove",(function(t){s.contains(Mn.TOUCHING)||d(e,h(t))})),document.addEventListener("mouseup",(function(t){s.contains(Mn.TOUCHING)||(document.removeEventListener("mousemove",m),s.contains(Mn.GRABBING)&&(s.remove(Mn.GRABBING),u(e,h(t)),r=0))})),e}function Un(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!Fn(e.parentElement)||!e.classList.contains(Mn.TOUCHING))}function Fn(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(Mn||(Mn={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(e){super(e),this.className="fp-volume";const t=e.root.classList,n=t.contains("is-tiny")?6:t.contains("is-small")?8:10,r=Array.from({length:n}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});this.append(...r),xn(this,{onseek:(t,n)=>{n>0&&(e.muted=!1,function(e){try{localStorage.removeItem(e)}catch(e){}}("mute")),$t("volume",(e.volume=n/100).toString()),this.adjustVolumeSlider(e.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",e.i18n("core.volume","volume")),e.on("volumechange",()=>{(0==e.volume||e.muted)&&this.adjustVolumeSlider(0),this.classList.contains(Mn.GRABBING)||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString());const t=Array.from(this.querySelectorAll(".fp-tick")),n=Math.round(e*t.length);t.forEach((e,t)=>{e.classList.toggle("fp-color",t<n)})}}function Pn(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function Bn(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function Hn(e,t){e.style.width="0",t.style.width="0",t.style.display="none"}function jn(e,t,n){if(t.seeking||!t.seekable||0==t.seekable.length)return;const r=Gn(t,e/100);Pn(n,e);const o=isFinite(t.duration)?r:t.seekable.start(0)+r;n.innerText=Le(o)}function Gn(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(e.duration))return Qt(e)*t;const n=e.seekable.start(0);return n+t*(e.seekable.end(0)-n)}function qn(e,t){e.style.width="0",t.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=Ae("fp-buffer"),this.progress=Ae("fp-progress","fp-color"),this.tooltipEle=Ae("fp-timestamp"),this.proposedSeekBar=Ae("fp-hover"),this.dragger=Ae("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",e.i18n("timeline","Timeline")),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);let n=!1;const r=requestAnimationFrame;let o=void 0;const i=()=>{var n;0==e.reaper||t.live||(n=e,this.progress.style.width=n.currentTime/n.duration*100+"%",o=void 0,e.paused||this.classList.contains(Mn.GRABBING)||o||(o=setTimeout(i,200)))},s=()=>!!this.player.opt("opts.seekable",!0)&&!isNaN(this.player.duration);xn(this,{onseek:(n,r)=>{if(s())switch(!!t.live){case!0:jn(r,e,this.tooltipEle);break;case!1:!function(e,t,n){const r=t.duration*(e/100);if(t.disabled&&r>t.currentTime)return!1;n.style.width=e+"%",t.currentTime=r}(r,e,this.progress),Pn(this.tooltipEle,r)}},onstart:()=>{s()&&(e.emit("timeline/gesture/start"),e.setState(Y,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(n,o){r(i),0!=t.seekable&&(e.setState(Y,!1),t.live&&function(e,t){e/=100,t.currentTime=Gn(t,e)}(o,e))},ontouch:function(){e.paused||(n=!0,e.pause())},ontouchend:()=>{n&&(n=!1,e.play()),t.live?qn(this.proposedSeekBar,this.tooltipEle):Hn(this.proposedSeekBar,this.tooltipEle)},onmouse:(n,r)=>{if(s()&&!this.classList.contains(Mn.GRABBING))switch(e.emit("timeline/gesture/move",{percent:r}),!!t.live){case!0:!function(e,t){t.style.width=function(e){return 100-e}(e)+"%"}(r,this.proposedSeekBar),jn(r,e,this.tooltipEle);break;case!1:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),function(e,t,n){if(isNaN(e)||isNaN(t.duration))return;Pn(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=Le(e/100*t.duration),n.append(r)}(r,e,this.tooltipEle)}}}),e.on(O,(function(e){e.data&&(t=e.data)})),e.on(y,()=>r(i)),e.on("live",()=>{this.progress.style.width="0%"}),e.on(h,()=>{0==e.reaper||t.live||Bn(e,this.bufferEle)}),e.on("dvr",e=>{e.detail&&(this.progress.style.width=e.detail.offset+"%")}),e.on("timeupdate",()=>{0!=e.reaper&&(r(i),this.setAttribute("aria-valuenow",e.currentTime+""),t.live||Bn(e,this.bufferEle))}),e.on(p,()=>{0!=e.reaper&&(t.live||Bn(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const n=Xt(e)?Qt(e):t.data||e.duration;isNaN(n)||(this.setAttribute("aria-valuemax",n+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(a,()=>{e.emit("timeline/gesture/end"),t.live?qn(this.proposedSeekBar,this.tooltipEle):Hn(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(e){super(e),this.handleChapters(e)}handleChapters(e){const t=document.createElement("div");let n;this.addEventListener("chapters:new",e=>{t.innerText="",this.querySelectorAll(".fp-chapter").forEach(e=>this.removeChild(e)),e.data&&e.data.forEach(e=>{const r=document.createElement("div");r.className="fp-chapter",r.style.left=e.left,r.style.bottom=r.style.top="0",r.style.width=e.width,r.title=e.title,r.onmouseover=()=>{t.innerText=e.title},r.onmouseleave=()=>{t.innerText=n||""},this.appendChild(r)})}),this.addEventListener("chapter:changed",r=>{var o;const i=r.data;i&&(t.parentNode||(null===(o=Oe(e,L))||void 0===o||o.insertAdjacentElement("beforebegin",t),t.classList.toggle("fp-togglable",!0),t.classList.toggle("fp-chapter-info",!0)),n=i,t.innerText=i)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=Ae("fp-live-text"),n=Ae("fp-live-indicator","fp-color");t.innerHTML="live",this.append(n,t),this.addEventListener(r,(function(){!function(e){try{if(!e.hasState("is-live-seeked"))return;e.emit("live"),e.dvr_offset=0,e.currentTime=Zt(e)}catch(e){console.warn("failed to seek to now: %j",e)}}(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),e.on(O,n=>{if(0==e.reaper||!n.data)return;t=n.data;const r=Xt(e)?NaN:n.data.duration||0;if(isNaN(r)||r>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Le(r)}),e.on(p,()=>{var n,r;0==e.reaper||t.live||(r=this,(n=e).duration&&(r.innerText=Le(n.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=Le(0),e.on(O,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var n;0!=e.reaper&&(t.live?(n=e,this.innerText=Le(n.currentTime)):function(e,t){t.innerText=Le(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=se(e,"flowplayer-small-pause-icon"),n=se(e,"flowplayer-small-play-icon");t.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){n.focus&&n.focus()}),100)})),n.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){t.focus&&t.focus()}),100)})),this.append(t,n)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add(t);const n=this.classList.contains("fp-left-zone")?-1:1,r=document.createElement("span"),o=se(e,this.classList.contains("fp-left-zone")?j:"flowplayer-fast-forward-icon");o.removeAttribute("tabindex"),r.classList.add("fp-zone-seconds"),this.append(r,o);e.on(w,()=>{r.innerText=""}),e.on("seek:queued",e=>{const t=e.data;if(!t)return;if("number"!=typeof t.offset)return;const n=t.offset;if(0==n)return this.reset_zone();n>0&&this.classList.contains("fp-right-zone")||n<0&&!this.classList.contains("fp-right-zone")?this.render_zone_state(n):this.reset_zone()}),e.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener(l,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState("no-timeline")||!e.hasState("will-seek")&&!e.hasState(Z)||e.enqueueSeek(5*n)&&(t.stopPropagation(),t.preventDefault())}))}reset_zone(){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText="")}render_zone_state(e){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText=Math.abs(e)+"")}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(e,t,...n){super(e),this.className=t;const o=e.createComponents(...n);this.append(...o),"fp-left"!==t&&o.forEach(t=>{t.addEventListener(r,()=>e.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-wait"),Array(...Array(4)).map((e,t)=>t).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle-zone");const t=e.createComponents(P,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[B,H].forEach(t=>{const n=se(e,t);n.removeAttribute("tabindex"),this.append(n)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=se(e,G);this.append(t),!n().ios&&this.append(se(e,D)),t instanceof FlowplayerIcon&&t.addEventListener(r,(function(){e.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-header"),this.append(...e.createComponents("flowplayer-header-left-zone","flowplayer-header-right-zone")),e.reaper&&e.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-controls","fp-togglable"),this.append(...e.createComponents("flowplayer-control-buttons",R,I,C,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n(t==On?"core.fullscreen":"core.fullscreen_exit"))}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",F,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n("core.play")),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),[y,w].forEach(t=>e.once(t,()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")}))}handleClick(e){[r,o].forEach(t=>this.addEventListener(t,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(r,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState(Q)||e.togglePlay()}),0)})),e.on(o,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener(l,(function(t){0!=t.cancelable&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on(l,(function(n){setTimeout((function(){if(n.defaultPrevented)return;if(e.hasState(Q))return;if(e.ended)return e.togglePlay(!0);const r=e.hasState(K);t&&clearTimeout(t),(r||e.hasState(Z)||e.hasState("no-autoplay"))&&(e.hasState(Z)&&(e.setState(Z,!1),e.setState("is-hovered",!1)),e.togglePlay(),r)||(e.setState(Z,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState(Z,!1),e.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-ui"),this.append(...e.createComponents(M,U,L))}}return pt.extensions.unshift.apply(pt.extensions,[I18n,Analytics,Health,class Default{constructor(e){ae(e,k,FlowplayerUi),ae(e,L,FlowplayerControls),ae(e,R,FlowplayerLiveStatus),ae(e,"flowplayer-control-duration",FlowplayerDuration),ae(e,C,e.extensions.find(e=>e.name===Chapters.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),ae(e,I,FlowplayerElapsedTime),ae(e,D,FlowplayerVolumeBar),ae(e,"flowplayer-volume-control",FlowplayerVolumeControl),ae(e,"flowplayer-control-buttons",FlowplayerControlButtons),ae(e,M,FlowplayerHeader),ae(e,x,FlowplayerPrimary),ae(e,"flowplayer-header-duration",FlowplayerHeaderDuration),ae(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left",x,"flowplayer-header-duration")}}),ae(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),ae(e,U,FlowplayerMiddle),ae(e,F,FlowplayerMiddleZone),ae(e,P,FlowplayerMiddleWait),ae(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),ae(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),ae(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),ae(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,Ln),this.setAttribute("role","button")}}),ae(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,Rn),this.setAttribute("role","button")}}),ae(e,B,class extends FlowplayerIcon{constructor(e){super(e,An)}}),ae(e,H,class extends FlowplayerIcon{constructor(e){super(e,Nn)}}),ae(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,On)}}),ae(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,Tn)}}),ae(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,In)}}),ae(e,j,class extends FlowplayerIcon{constructor(e){super(e,Cn)}}),ae(e,G,class extends FlowplayerIcon{constructor(e){super(e,kn),this.classList.add("fp-volumebtn"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute"))})}})}init(e,t,n){var r;tn(e,0,n),en(e,t,n),r=n,"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}}]),Object.assign(pt,{ui:Vt,i18n:I18n})}));
package/embed.js CHANGED
@@ -12,7 +12,7 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function pe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function ve(e){const t=document.createElement("a");t.href=e;const r=t.pathname&&t.pathname.split(".");return r.length>1&&r[r.length-1]}function ge(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const me=e=>{var{src:t}=e,r=pe(e,["src"]);return[Object.assign({src:t,type:t?ge("video/"+ve(t)):""},r)]};function ye(e){return me({src:e})}function Ee(e){var{src:t,type:r}=e,n=pe(e,["src","type"]);return t&&r?[Object.assign({src:t,type:r},n)]:r&&!t?[Object.assign({type:r},n)]:me(Object.assign({src:t},n))}var _e;function Te(e,t,r,n={safari:!1}){const i=function(e){return"string"==typeof e?ye(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=ye(t)),"object"!=typeof t||Array.isArray(t)||(t=Ee(t)),e.concat(t)}),[]):Ee(e)}(r);return e.currentSrc&&(e.innerHTML=""),Array(...Array(i.length)).map((e,t)=>t).some(r=>{const a=i[r];if(_e.Ok==function(e,t,r){e.emit("src",r),"string"==typeof r.src&&(e.original_src=r.src);const n=function(e,t,r){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(r.src||"",r,t))}(e,t,r);return n?(n.onload(t,e.root,e,r),_e.Ok):_e.Err}(e,t,a)||_e.Ok==function(e,t,r,n={safari:!1}){/^audio\//.test(r.type||"")&&e.emit("audioonlysource");t.start_time&&(r.src=r.src+"#t="+t.start_time);if(""==e.canPlayType(r.type||""))return _e.Err;if(r.drm&&(!r.drm["com.apple.fps.1_0"]||!n.safari))return _e.Err;"string"==typeof r.src&&(e.src=r.src);return _e.Ok}(e,t,a,n))return!0;r==i.length-1&&"string"==typeof a.src&&(e.src=a.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(_e||(_e={}));const be=[S,A,"src","seek:cancel"];var Ae;function Se(e,t,r){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=r,0==t.offset?Le(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,r=0){return Math.max(Math.min(t,e),r)}(e.currentTime+t.offset,e.duration),t.timer=0,Le(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(Ae.BACKWARD,t.offset<0),e.setState(Ae.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Le(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(Ae.FORWARD,!1),e.setState(Ae.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function we(e,t){const r=e._customElements.get(t);return r&&e.root.querySelector(r)||void 0}function ke(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Re(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function De(e,t,r){const n=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;n.length;){if(null==e)return r;const t=n.shift();if("string"!=typeof t)return r;e=e[t]}return null==e?r:e}function Oe(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function Ce(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const r=Math.floor(e/3600);let n=Math.floor(e/60);return e-=60*n,r>=1?(n-=60*r,t+r+":"+Oe(n)+":"+Oe(e)):t+Oe(n)+":"+Oe(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(Ae||(Ae={}));const Ie=navigator.languages||[navigator.language];function xe(e,t,r){const n={};return r=t.lang||r,e[r]&&(n[r]=e[r]),function(){try{return Ie.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!n[t]&&(n[t]=e[t])})),Object.values(n)}const Pe=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Me=()=>"undefined"==typeof crypto?"":Pe.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let Fe="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const Ne=["touchstart","touchmove"];function Ue(e,t){const r=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(r,"data",{get:()=>t}),r}function Be(e,t,r){const n=Ue(t,r);return e.dispatchEvent(n),e}function je(e,t,r){const n=Ue(t,r);return e.dispatchEvent(n),n}function Ge(e,t,r,n){Array.isArray(t)?t.forEach(t=>He(e,t,r,n)):He(e,t,r,n)}function He(e,t,r,n){if(i=t,!~Ne.indexOf(i))return e.addEventListener(t,r,n),e;var i;const a=Object.assign(n||{},{passive:!0});return e.addEventListener(t,r,a),e}function Ke(e,t,r,n){return Ge(e,t,r,Object.assign(n||{},{once:!0}))}const Ve={preload:"none",rtl:!1,controls:!0},We=["loop","muted","preload"];function qe(e,n,i){i.toJSON=function(){return{duration:i.duration,volume:i.volume,currentTime:i.currentTime,states:i.root.className}},i.setSrc=function(t){return Te(i,e,t,r())},i.playerState=i.playerState||{},i.setState=function(e,t){if(i.playerState[e]===!!t)return i;const r=Object.assign({},i.playerState,{[e]:t});return r[J]&&(r[q]=!1),i.playerState=r,Be(i,"state",i.playerState),i},i.createComponents=function(...e){return Array.from({length:e.length}).map((t,r)=>le(this,e[r]))},i.hasState=function(e){return!!i.playerState[e]},i.transitionState=function(e,t,r){!i.hasState(e)&&i.hasState(t)||(r=0),r&&i.setState("is-toggling",!0),i.setState(t,!1),i.setState(e,!0),r&&setTimeout((function(){i.setState("is-toggling",!1)}),r)},i.emit=(e,t)=>(Be(i,e,t),i),i.on=(e,t)=>(Ge(i,e,t),i),i.once=(e,t)=>(Ke(i,e,t),i),i.off=(e,t)=>{var r,n;return r=e,n=t,i.removeEventListener(r,n),i},i.poll=(e,t)=>je(i,e,t),i.togglePlay=function(t){return de(i,e,t)},i.toggleMute=function(e){e=null==e?!i.muted:!!e,i.muted=e,i.muted||i.volume||(i.volume=1),Be(i,"volumechange")},i.toggleDisable=function(e){e=null==e?!i.disabled:!!e,i.setState("is-disabled",e),i.disabled=e},i.destroy=function(){i.pause();const e=t.indexOf(i);~e&&t.splice(e,1),setTimeout((function(){i.setSrc([]),i.reaper&&i.reaper.clear(),Be(i,S)}),0)},i.setAttrs=function(e){return We.forEach(t=>{if(!(t in e))return;const r=e[t];r?i.setAttribute(t,r.toString()):i.removeAttribute(t)}),i},i.opt=function(t,r){return r=void 0===r?De(Ve,t):r,De(e,t,r)},i.i18n=function(e,t){if(!i.reaper)return"";const r=i.reaper.get("translations");return r?function e(t,r,n,i){return(i=i||0)>=t.length?n:De(t[i],r,e(t,r,n,i+1))}(r,e,t||""):t||""},i.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&i.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&i.toggleMute(t.muted);const r=!!e.autoplay&&!i.hasState("no-autoplay");i.setState("is-autoplay",r),i.setState("is-rtl",i.opt("rtl",function(e){if(!e)return ke();const t=e.getAttribute("dir");return t?"rtl"==t:ke()}(n))),i.setState("is-live",!!e.live),i.setState("no-timeline",!(!e.live||e.dvr)),i.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),i.setState("is-seekable",!!e.seekable),n.style.backgroundImage=i.hasState("has-poster")?"url('"+e.poster+"')":"",Be(i,L,e)},i.renderPlugin=function(e){je(i,"renderplugin",e).defaultPrevented||i.root.appendChild(e)};const a={offset:0,timer:0};var s,o;o=a,(s=i).on(be,(function(){Le(s,o)})),i.enqueueSeek=function(e){if(0!=i.opts.seekable&&!(1==i.opts.disabled&&e>0))return Se(i,a,e)},i.deviceId=function(){return function(){if(Fe)return Fe;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=Me();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return Fe=Me()}}()}}function ze(e,t){const r=t.querySelector("video"),n=r||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return n.classList.add("fp-engine"),n.playsInline=!0,r||t.append(n),n}function Ye(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const r=e.flowplayer;return"function"==typeof r?(r(t),t):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(t)||r.extensions.push(t),t)}function Xe(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const Qe=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function Ze(e,t){return!!~Qe.indexOf(e)||e.indexOf(t)===e.length-t.length}Ze.check_whitelist=function(e){return!!~Qe.indexOf(e)};const Je="production";function $e(e,t){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let n={c:"{}",exp:0};t=t||{};try{n=se(e),r.valid_jwt=!0}catch(e){}return r.raw=e,r.data=JSON.parse(n.c),r.exp=n.exp,t.require_valid_token&&$e.validate(r),r}function et(e){try{return $e.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var tt;function rt(e){return{grant:e,is_granted:t=>(e&t)===t}}function nt(e,t,r){t&&t.destroy(),console.error(new Error(r.details||r.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function it(e,t){const r=t.clientWidth;t.classList.toggle("is-small",r<600),t.classList.toggle("is-tiny",r<400)}function at(e,t,n){let i=!0;t.classList.add("flowplayer"),it(0,t),Ge(n,[g,c],(function(){it(0,t)})),Ge(n,"state",(function(){Object.entries(n.playerState).forEach((function([e,r]){t.classList.toggle(e,r)}))})),Ge(n,"timeupdate",(function(){n.setState(J,!1)})),Ge(n,L,(function(){const r=n.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==n.currentTime;[Y,X].forEach((function(e){n.setState(e,r)}))})),Ge(n,T,(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!n.loop&&(e.autoplay&&(e.autoplay=0,n.setState("is-autoplay",!1)),n.setState(Q,!0),Ke(n,b,(function(){n.setState(Q,!1),n.pause(),n.setState(X,!0)})),n.currentTime=0),Ke(n,"timeupdate",(function(){n.setState(Z,!1)})),n.transitionState(Z,q,e.loop||e.rewind?0:300))}),0)})),Ge(n,[A,b],(function(e){n.setState(Q,e.type==A),n.setState(z,n.paused),n.setState(q,!n.paused)})),Ge(n,T,(function(){n.setState(q,!1),i=!0})),Ge(n,r().ios?h:p,(function(e){const t="src"!=e.type||"none"!==n.opt("preload");n.setState("is-loaded",t),n.setState(Y,!t)})),Ge(n,[E,_,g],(function(t){if(!n.hasState(Q)&&(t.type!=_||e.autoplay||n.setState(J,!1),t.type!=g||"none"!=n.opt("preload")||e.autoplay)){if(t.type==g&&e.autoplay)return Ke(n,y,(function(){n.setState(J,!1)}));t.type==E&&[q,z,X].forEach((function(e){n.setState(e,!1)})),n.setState(Z,!1),n.setState(J,t.type==E)}})),Ge(n,[y,m],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:n});document.dispatchEvent(e)},0);const r=t.type==y,a=n.currentTime==n.duration,s=r&&i&&e.autoplay||n.hasState(J);if(r&&(n.started=!0,i=!1),n.setState(J,!1).setState(X,!1),a||n.hasState(Q))return;const o=r?q:z,l=r?z:q;n.transitionState(o,l,s?0:300),r&&n.setState("no-autoplay",!1)}))}function st(e){const t=function(e){const t=e.getBoundingClientRect(),r=window.innerHeight,n=t.height,i=t.bottom,a=n/5;return t.top<=a&&t.top+n>r-a||i-n+a>=0&&i<r+a}(e.root);return e.in_viewport===t||(e.in_viewport=t,Be(e,t?"viewenter":"viewleave")),e}function ot(e,r,n){st(n);const a={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[u,i].forEach(e=>Ke(n,e,()=>a.has_user_gesture=!0)),Ge(n,"play",(function(){a.locked||(a.should_resume=!0)})),Ge(n,m,(function(){a.locked||(a.should_resume=!1)})),Ge(n,_,(function(r){!e.autoplay||t.filter((function(e){return!e.paused})).length&&!e.multiplay||n.in_viewport&&n.paused&&a.should_resume&&n.togglePlay(!0)})),e.autopause&&(Ge(n,"viewenter",(function(){a.should_resume&&n.togglePlay(!0)})),Ge(n,"viewleave",(function(){const e=!n.paused;a.locked=!0,n.pause(),setTimeout((function(){a.should_resume=e,a.locked=!1}),0)})))}$e.validate=function(e){if("string"==typeof e&&(e=$e(e)),!e||!e.raw){if(Ze.check_whitelist(window.location.hostname)||"dev"===Je.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,r=Ze.bind(null,t);if("dev"!==Je.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==Je.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},$e.id=function(e){if(e)return"string"==typeof e&&(e=$e(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(tt||(tt={})),rt.of=rt,rt.from_token=function(e){const t=$e(e,{require_valid_token:!0});return rt.of(t.data.acl)},rt.permissions=tt,[s,c].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Be(e,c),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(st)}));function lt(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function ut(e,t,r){const n=document.createElement("div");n.classList.add("fp-ratio"),t.append(n);let i=lt(e.ratio||.5625);n.style.paddingTop=100*i+"%";const a=[p,h];r.on(a,(function(){const e=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth;e&&r.setOpts({ratio:e})})),r.on(L,(function(){const t=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth,a=lt((null==e?void 0:e.ratio)||t||.5625);i!==a&&(i=a,n.style.paddingTop=100*a+"%")}))}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(e,t,r){this.root=t,this.player=r,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(y,this.render),null===(t=this.player)||void 0===t||t.once(T,this.wireUp)}cleanUp(){var e,t,r,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(r=this.player)||void 0===r||r.off(y,this.render),null===(n=this.player)||void 0===n||n.off(T,this.wireUp)}render(){var e,t,r;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const n=(null===(r=this.root)||void 0===r?void 0:r.querySelector(".fp-ui"))||this.root;if(!n)return;const i=this._logo=document.createElement("a");i.href="https://explorer.flowplayer.com",i.target="_blank",Object.entries(ct).forEach(([e,t])=>{i.style.setProperty(e,t,"important")}),n.appendChild(i)}}const ct={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)"},dt="flowplayer/"+y;function ft(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on(S,()=>document.removeEventListener(dt,t)),document.addEventListener(dt,t)}const ht=function(){const e=Xe(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function pt(r,n){if("function"==typeof r)return e.push(...[...arguments].filter(e=>"function"==typeof e)),pt;"string"==typeof n&&(n={src:n}),n||(n={}),n.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(n.token=window.__FLOWPLAYER_TOKEN);const i="string"==typeof r?document.querySelector(r):r;if(!i)return console.error(new Error("Flowplayer: '"+r.toString()+"' not found"));const a=i.querySelector("video.fp-engine");if(a)return a;const s=et(n.token);if(!s.success)return nt(i,null,{reason:"token",details:s.message});const o=new Map,l=ze(n,i);l.reaper=o,l._customElements=oe,Object.defineProperty(l,"token",{value:"string"==typeof n.token?$e.id(n.token):"",writable:!1}),l.addEventListener(S,()=>{o.clear(),l.reaper=0,delete l.root}),l.root=i,n.token&&rt.from_token(n.token).is_granted(rt.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),qe(n,i,l),l.setAttrs(n),l.plugins=pt.extensions.map(e=>new e(pt,l)),at(n,i,l),ot(n,0,l),ut(n,i,l),ft(l),l.plugins.forEach(e=>{try{e.init(n,i,l)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),l.setOpts(n),l.opts=n,n.src&&l.setSrc(n.src);const u=l.readyState;return u>0&&l.currentSrc&&l.emit(h),u>2&&l.currentSrc&&l.emit(_),l.emit("mount"),l.on("error:fatal",(function(e){nt(i,l,e.data||{})})),l}Object.assign(pt,ht),function(n){Array.isArray(n.extensions)&&n.extensions.forEach(t=>e.push(t)),n.customElements=oe,n.defaultElements=W,n.version="3.0.1-rc.2",n.commit="6fbb2390d6a7c662947c90924411af433b4f2927",n.instances=t,n.extensions=e,n.support=r,n.events=R,n.states=ee,n.jwt=se,n.autoplay=ae,n.quality=ce}(pt),"object"==typeof document&&setTimeout(Be,0,document,"flowplayer:umd",pt);var vt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mt(e){var t={exports:{}};return e(t,t.exports),t.exports}var yt=mt((function(e,t){var r=vt&&vt.__assign||function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return r(r({},e),t)}),{})},t.pluck=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return Object.keys(e).filter((function(e){return~r.indexOf(e)})).reduce((function(r,n){var i;return t.merge(r,((i={})[n]=e[n],i))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var r=e.lastIndexOf(t);return~r&&e.splice(r,1),e}})),Et=mt((function(e,t){var r=vt&&vt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=vt&&vt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=vt&&vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};t.__esModule=!0;var a=i(yt),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var r=e.lpop(t);r&&e.request(t,r)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,r){e.rm(t,r),e.increment_failures(t)},e.request=function(t,r){var n=r[0],i=r[1],a=r[2];if(!(Date.now()<t.stats.ttl)){var s=new XMLHttpRequest;t.open.push(s),s.timeout=e.REQUEST_TIMEOUT_MS,s.ontimeout=function(){e.handle_error(t,s)},s.onerror=function(r){e.handle_error(t,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&e.rm(t,s),Math.floor(s.status/100)},s.onload=function(){e.rm(t,s),t.stats.failures&&t.stats.failures--},s.open(i,n),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(a))}catch(e){}}},e.rpush=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.forEach((function(r){t.pending.length>=e.MAX_PENDING||(t.pending.push(r),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return a.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=s})),_t=mt((function(e,t){var r=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var n=r(Et);t.default=n.default.of()})),Tt=mt((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,r){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in r)return r[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(r,null,2)+"\n "))}))}})),bt=mt((function(e,t){t.__esModule=!0,t.Log=void 0;var r=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var r=document.createEvent("Event");return r.initEvent(e,!1,!0),r.ns=e,r.data=t,r},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=r})),At=mt((function(e,t){var r;t.__esModule=!0,t.Verb=void 0,(r=t.Verb||(t.Verb={})).POST="POST",r.PUT="PUT",r.GET="GET"})),St=mt((function(e,t){var r=vt&&vt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=vt&&vt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=vt&&vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},a=vt&&vt.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n},s=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=s(_t),l=s(Et),u=i(Tt),c=i(yt),d=function(){function e(t,r){var n=this;void 0===r&&(r={});var i=this;if(this.emitter=t,this.url=r.url,this.log=bt.Log.of(this.emitter),this.verb=r.verb,this.metadata=c.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),e.assert_emitter_api(this.emitter),void 0===e.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");e.TRACKERS.push(this),i.events.forEach((function(t){e.create_listener(n,t,(function(r){void 0===r&&(r={});var a=c.merge(i.metadata,{event_type:t},r.data||r),s=u.prepare_url(i,a),o=e.pluck_valid_keys(i,a),d=e.ensure_required_keys(i,o);if(d.length)return i.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(o,null,2));l.default.rpush(n.rq,[s,n.verb,o])}))}))}return e.of=function(t,r){return new e(t,r)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return c.pluck.apply(c,a([t],e.valid_keys))},e.merge_metadata=function(t,r){return void 0===r&&(r={}),t.metadata=e.pluck_valid_keys(t,c.merge(t.metadata,r)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,r){e.listeners.push([t,r]),e.emitter.addEventListener(t,r)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var r=e[0],n=e[1];return t.emitter.removeEventListener(r,n)})),delete this.rq,delete this.emitter,c.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=o.default,e.verb=At.Verb,e}();t.default=d})),Lt=mt((function(e,t){var r=vt&&vt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=vt&&vt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=vt&&vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},a=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=a(St);t.Tracker=s.default;var o=i(Tt);t.API=o})),wt="ping",kt="display",Rt="view";const Dt=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],Ot=["created","position"],Ct=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function It(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,r){return Math.floor(r*t*1e3)/1e3}))}}(e.duration))}function xt(e,t,r){if(!t.segment_duration&&!It(e,t))return;const n=function(e,t,r){const n=t.last_idx,i=r?99:Pt(e,t);return t.last_idx=i,i<=n?[]:t.breakpoints.slice(n,99==i?100:i).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,r);0!=n.length&&e.emit(wt,{position:n})}function Pt(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const Mt="vod",Ft="live",Nt=[kt,wt,Rt];function Ut(e,t,r){switch(null==t?void 0:t.kind){case"live":return function(e,t){const r=Date.now();r-t.last_tracked_ts<6e4||(t.last_tracked_ts=r,++t.ticks,e.emit(wt,{position:60*t.ticks}))}(e,t);case"vod":return xt(e,t,"boolean"==typeof r&&r)}}function Bt(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}function jt(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class Analytics{init(e,t,r){if(!rt.from_token(e.token||"").is_granted(rt.permissions.ANALYTICS))return;if(r.analytics)return;const n=r.analytics={ticker:void 0,last_media_id:"",ended:!1},i={locked:!1,ttl:6e3,task:()=>{Ut(r,n.ticker)}};const a={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:e.player_id,customer_user_id:e.customer_user_id},s=Lt.Tracker.of(r,{verb:Lt.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:Nt,required_keys:Dt,optional_keys:Ct.concat(Ot).slice(0),metadata:a});r.on(S,(function(){s&&s.destroy()})),r.on(L,(function(t){if(!s)return;const i=De(t,"data.metadata",{});if(!i.media_id)return;const a=De(s,"metadata.media_id");if(a&&i.media_id==a)return;const o=De(e,"analytics",{});s.put(i),s.put(o);const l=De(e,"metadata.live_start_time",e.live)?Ft:Mt;s.put({video_type:l,source:e.source||jt()||""}),n.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},n.ended=!1,r.emit(kt)}));let o=0;r.on(y,(function(){if(!s)return;if(o||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(s,n))return;s.put({muted:r.muted});const e=Bt(r);if(e)return o=Promise.resolve(e).then((function(){n.last_media_id=s.metadata.media_id,r.emit(Rt),o=0})).catch((function(){o=0}));n.last_media_id=s.metadata.media_id,r.emit(Rt)})),r.on("timeupdate",(function(){var t;s&&(o||Bt(r)||n.ended||(!e.live&&r.currentTime+.25>=r.duration&&Ut(r,n.ticker,!0),(t=i).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),r.on(b,(function(){s&&n.ticker&&"vod"==n.ticker.kind&&function(e,t){It(e,t),t.last_idx=Pt(e,t)}(r,n.ticker)})),r.on(T,(function(){s&&function(e,t){t.ended||(t.ended=!0,Ut(e,t.ticker))}(r,n)}))}}var Gt;function Ht(e){switch(e){case Gt.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case Gt.MEDIA_ERR_NETWORK:return"a network error occurred";case Gt.MEDIA_ERR_DECODE:return"unable to decode media content";case Gt.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case Gt.NO_INTERNET:return"no internet connection detected";case Gt.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function Kt(){}function Vt(){return"https:"===location.protocol}function Wt(e){const t=document.createElement("a");return t.href=e,t}function qt(e){try{return!!new URL(e)}catch(e){return!1}}Ye(Xe(),Analytics),"undefined"!=typeof window&&window.matchMedia&&[w,k].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(r){t.length&&t.forEach((function(t){r.matches&&t.emit(e)}))}))})),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(Gt||(Gt={}));const zt=()=>!0===(navigator||{}).onLine;function Yt(e,t,r){r.on(n,(function(e){const t=e.data||r.error||new Error,n=e.code||t.code,i="Error: %s\n"+(null===(a=(new Error).stack)||void 0===a?void 0:a.split("\n").slice(2).join("\n"));var a;setTimeout((function(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;r.setState("is-error",!0),8===n||t.fatal||function(e){const t=e.togglePlay,r=e.root;e.togglePlay=Kt,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const n=r.querySelector(".fp-error");n&&n.remove()}))}(r);const a=function(e,t,r){switch(t){case"http:0":return function(e){return function(e){try{return Vt()&&"http:"==Wt(e).protocol}catch(e){return!1}}(e.original_src)?{code:Gt.MIXED_CONTENT}:zt()?{code:Gt.MEDIA_ERR_NETWORK}:zt()?{code:Gt.UNKNOWN}:{code:Gt.NO_INTERNET}}(e);case Gt.MEDIA_ERR_SRC_NOT_SUPPORTED:return e.once(g,(function(){e.emit("recover")})),r;default:return r}}(r,n,t),s=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const r=t.code||-1,n=Ht(r);return e.i18n("media_errors."+r,n)}(r,a);console.error(i,s);const o=r.reaper&&r.reaper.get("ui");return o&&function(e,t,r,n){if(!e)return;const i=document.createElement("div");if(i.classList.add("fp-error"),i.innerText=t,n){const t=e.querySelector("#"+n);t&&e.removeChild(t),i.id=n}if(e.append(i),r){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=r,i.append(e)}}(o,s,t.details)}))}))}var Xt=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});function Qt(e,t,r){let n=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),i="webkit"+i,n=()=>t.webkitCurrentFullScreenElement}const s=()=>r.getFullsceenTarget?r.getFullsceenTarget():t;r.toggleFullScreen=function(e,t){if(r.ios_fullscreen_disabled)return;if("boolean"!=typeof e&&(e=!r.hasState("is-fullscreen")),Zt(r)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(r):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState($)||e.setState($,!0)}(r,t)),!document.fullscreenEnabled)return;const n=s();e?n.requestFullscreen():document.exitFullscreen()},Zt(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 e=s();e.addEventListener(i,(function(){const t=n(),i=t===e||t==r;r.emit(i?d:f),r.setState("is-fullscreen",i),r.emit(c)}))},0),!1!==e.doubleclick&&t.addEventListener(a,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&r.toggleFullScreen()}))}function Zt(e){return r().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function Jt(e){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const t=e.opt("live_dvr_window",0),r=e.seekable.end(e.seekable.length-1);return{head:r,tail:Math.max(e.seekable.start(0),r-t)}}function $t(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function er(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:e.seekable.end(0)}function tr(e){return function(e){return Jt(e).head}(e)-.5}function rr(e){try{return localStorage.getItem(e)}catch(e){return null}}function nr(e,t){try{localStorage.setItem(e,t)}catch(e){}}function ir(e,t,r){if(!r.reaper)return;const n=document.createDocumentFragment(),i=le(r,D);n.appendChild(i),r.reaper.set("ui",i),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,r){const n=Re("fp-footer");t.append(n),r.on(L,(function(e){var t,r;const i=null===(t=e.data)||void 0===t?void 0:t.description,a=null===(r=e.data)||void 0===r?void 0:r.title;if(n.innerHTML="","string"==typeof a){const e=Re("fp-title");e.innerText=a,n.append(e)}if("string"==typeof i){const e=i.split(" "),t=Re("fp-desc");for(t.innerText=e.join(" "),n.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,r),Yt(0,0,r),t.appendChild(n),[o,l].forEach(e=>{t.addEventListener(e,(function(e){r.setState("is-hovered",e.type==o),r.setState("is-accessibility",!1)}))}),Qt(e,t,r),r.on("volumechange",(function(){const e=0==r.volume||r.muted;r.setState("is-muted",e),nr("mute",e.toString())})),"true"==rr("mute")&&(r.muted=!0,r.setState("is-muted",r.muted));const a=rr("volume");a&&!isNaN(Number(a))&&(r.volume=Number(a)),r.emit("volumechange"),r.on("timeupdate",(function(){var t;e.live&&(!("dvr"in(t=e))||1==t.dvr)&&function(e,t){if(0==t)return!0;const r=Jt(e);return r.head-r.tail>=t}(r,e.seconds_to_dvr||0)&&r.setOpts({dvr:r.seekable.length>0})})),r.on("live",(function(){r.setState("is-live-seeked",!1)})),r.on("seeking",(function(){if(!$t(r))return;if(0==r.seekable.length||0==r.played.length)return;if(0==er(r))return;const e=tr(r),t=r.currentTime>=e?"live":"dvr";if("live"===t)return r.emit(t);const n=er(r),i=r.seekable.end(0)-r.seekable.start(0),a=(n-r.currentTime)/i*100,s=Math.round(a);r.setState("is-live-seeked",s>0),r.emit(t,{offset:s})})),r.on(h,(function(){r.setOpts({live:$t(r)})})),r.on("durationchange",(function(e){const t=$t(r),n=t?er(r):e.data||r.duration;isNaN(n)||r.setOpts({live:t,duration:n})})),r.on(L,(function(r){var n,i;e.seekable=void 0===(null===(n=null==r?void 0:r.data)||void 0===n?void 0:n.seekable)||r.data.seekable;const a=null===(i=r.data)||void 0===i?void 0:i.ui;if("number"!=typeof a)return;const s=t.classList;s.toggle("use-play-1",!(32&a||64&a)),s.toggle("use-play-2",(32&a)>0),s.toggle("use-play-3",(64&a)>0),s.toggle("use-thin-controlbar",(128&a)>0),s.toggle("no-title",(256&a)>0),s.toggle("no-description",(512&a)>0),s.toggle("logo-on-right",(8&a)>0),s.toggle("use-drag-handle",(16&a)>0),s.toggle("no-controls",(1024&a)>0),s.toggle("no-duration",(2048&a)>0),s.toggle("no-header",(4096&a)>0),s.toggle("no-mute",(4&a)>0),s.toggle("no-volume",(2&a)>0),s.toggle("no-fullscreen",(1&a)>0),s.toggle("no-touch-zones",(16384&a)>0)}));let s=null;i.addEventListener("mousemove",(function(){"number"==typeof s&&clearTimeout(s),r.setState("is-hovered",!0),s=0==r.paused&&setTimeout((function(){r.setState("is-hovered",!1)}),2e3)}))}function ar(e,t,r){if(rt.from_token(e.token||"").is_granted(rt.permissions.NO_METERING))return;const n=$e.id(e.token||"");n&&r.once(y,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(r,n))}var sr={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(e,t,r){r.reaper&&r.reaper.set("translations",xe(I18n,e,"en"))}}I18n.en=sr;const or="rebuffer";var lr=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:or});const ur=navigator;function cr(e){var t,r;const n=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return n?1e-6*n:(null===(r=ur.connection)||void 0===r?void 0:r.downlink)||-1}function dr(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const fr=Me(),hr=[];function pr(e){const t=hr.slice(0);hr.length=0,e.logger.log(`:dispatch events={${t.length}}`),dr("https://health.flowplayer.com/v1/health/events",t)}function vr(e,t,r){hr.push(t),e.logger.log(":enqueue",t.event,t),hr.length<10&&!r||pr(e)}const gr=()=>{var e,t;try{const r=window;return null===(t=null===(e=null==r?void 0:r.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},mr=(e,t)=>Object.assign(e,{detail:t}),yr=(e,{event:t,media_session_id:r})=>({event:t,media_session_id:r,device_id:e.deviceId(),session_id:fr,timestamp:Date.now(),version:"3.0.1-rc.2",commit:"6fbb2390d6a7c662947c90924411af433b4f2927",ima_sdk_version:gr(),preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay),source:e.original_src,downlink_mbs:cr(e),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime}),Er=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function _r(e,t,r,n){const i=yr(t,{event:r,media_session_id:e.media_session_id}),{before:a,after:s}=n;vr(e,((e,t,r)=>Object.assign(e,{state:{before:t,after:r}}))(i,Er(a),Er(s)))}const Tr=(e,t)=>{let r=null;return(...n)=>{null!==r&&(clearTimeout(r),r=null),r=setTimeout(()=>t(...n),e)}};class Health{constructor(e,t){if(this.logger=function(e,t){return{log:(...r)=>{const n=e.opt("debug");n&&t.match(n)&&console.log(t,...r)}}}(t,"health"),this.media_session_id=Me(),!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=()=>e.instances.forEach(e=>e.emit("unload"));document.addEventListener("visibilitychange",()=>{"hidden"==document.visibilityState&&t()}),window.addEventListener("pagehide",t)}}init(e,t,r){!function(e){e.on(E,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit(or)}))}(r),r.on("health:record",({detail:e})=>{const t=yr(r,{event:e.event,media_session_id:this.media_session_id});Object.assign(t,e.detail||{}),vr(this,t)}),[_,g,s,h,p,v,E,or].forEach(e=>{r.on(e,e=>{vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id}))})}),[y,m,A,b,T,d,f].forEach(e=>{r.on(e,e=>{vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id}))})}),r.on("volumechange",Tr(800,e=>{const t=yr(r,{event:e.type,media_session_id:this.media_session_id});vr(this,mr(t,{volume:parseFloat(r.volume.toFixed(2)),muted:r.muted}))})),r.on(c,Tr(800,e=>{const n=yr(r,{event:e.type,media_session_id:this.media_session_id});vr(this,mr(n,{height:t.clientHeight,width:t.clientWidth}))})),r.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return _r(this,r,e,t)}}),r.addEventListener(n,e=>{const t=yr(r,{event:e.type,media_session_id:this.media_session_id}),n=e.error||r.error;if(!n)return vr(this,t,!0);const i=n.code,a={error_message:n.message||Ht(i),error_code:i,error_stack:n.stack||""};return vr(this,mr(t,a),!0)}),r.on("src",e=>{var t;const n=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof n)return;if(!qt(r.original_src))return;if(!qt(n))return;if(n==r.original_src)return;this.media_session_id=Me();vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id})),pr(this)}),r.on("unload",e=>{vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id})),pr(this)})}}var br;function Ar(e,t){if(function(e){return Object.values(br).includes(e)}(t=t||br.Anonymous))return"crossOrigin"in e?e.crossOrigin=t:e.setAttribute("crossorigin",t),e}function Sr(e){const t=document.createElement("a");return t.href=e,t.origin}function Lr(e,t){const r=document.createElement("track");r.className="fp-track renderable",r.kind=t.kind||"captions",r.id=["fp",t.lang].join("-");const n=r.track;return"string"!=typeof t.crossorigin&&function(e,t){try{return e.src.startsWith("blob:"),Sr(e.src)!==Sr(t)}catch(e){return console.error(e),!0}}(e,t.src)&&(Ar(e),t.crossorigin=e.getAttribute("crossorigin")),"crossorigin"in t&&Ar(e,t.crossorigin),Object.keys(t).forEach(e=>{r[e]=t[e]}),n.mode=t.default?"showing":t.mode||"disabled",r.onload=function(){},n.oncuechange=function(t){e.emit(t.type,{track:t.target})},e.appendChild(r),r}Health.events=lr,Health._UNLOAD_SUBSCRIBED=!1,Ye(window,Health),function(e){e.Anonymous="anonymous",e.UseCredentials="use-credentials",e.Empty=""}(br||(br={}));var wr=Object.freeze({__proto__:null,CHAPTER_CHANGED:"chapter:changed",CHAPTERS_NEW:"chapters:new"});class Chapters{constructor(){this._track_added_handler=Kt,this._cue_changed_handler=Kt,this.chapters=[],this.render=this.render.bind(this)}init(e,t,r){this._root=t,this._player=r,this._timeline=we(r,x),this._track_added_handler=this.track_added.bind(this,r),this._cue_changed_handler=this.cue_changed.bind(this,r),r.textTracks.addEventListener("addtrack",this._track_added_handler),this.wireup(r,e),r.chapters=this,r.on(L,e=>{e.data&&this.wireup(r,e.data)}),r.on(S,()=>{this.wiredown(r),r.textTracks.removeEventListener("addtrack",this._track_added_handler),r.off("durationchange",this.render)}),r.on("durationchange",this.render)}track_added(e,t){}cue_changed(e,t){var r;this._current_chapters_track&&(this.current_cue=this._current_chapters_track.track.activeCues?this._current_chapters_track.track.activeCues[0]:void 0,this._timeline&&Be(this._timeline,"chapter:changed",null===(r=this.current_cue)||void 0===r?void 0:r.text))}set_chapters(e){this.chapters=e,this.render()}jump(e){this._player&&this.chapters[e]&&(this._player.currentTime=this.chapters[e].start)}current(){if(this.current_cue)return this.chapters.find(e=>e.cue==this.current_cue)}render(){if(!this._root||!this._player||!this._timeline)return;const e=this._player.duration;isFinite(e)&&(Be(this._timeline,"chapters:new",this.chapters.map(t=>({title:t.label,left:t.start/e*100+"%",width:(t.end-t.start)/e*100+"%"}))),this._root.classList.toggle("has-chapters",!!this.chapters.length))}wireup(e,t){const r=Array.isArray(t.chapters)?t.chapters[0]:t.chapters;r&&r.src!==this._current_chapters_src&&(this.wiredown(e),this._current_chapters_track=Lr(e,Object.assign(Object.assign({},r),{kind:"chapters",mode:"hidden"})),this._current_chapters_track.onload=()=>{var e;(null===(e=this._current_chapters_track)||void 0===e?void 0:e.track.cues)&&this.set_chapters(Array.from(this._current_chapters_track.track.cues).filter(e=>e instanceof VTTCue).map(e=>{const t=e;return{start:e.startTime,end:e.endTime,cue:t,label:t.text}}))},this._current_chapters_src=r.src,this._current_chapters_track.addEventListener("cuechange",this._cue_changed_handler))}wiredown(e){this.set_chapters([]),this._current_chapters_track&&(this._current_chapters_track.removeEventListener("cuechange",this._cue_changed_handler),e.removeChild(this._current_chapters_track))}}Chapters.events=wr,Ye(window,Chapters);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerPrimary extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-primary");const t={logo:""};e.on(L,e=>{var r,n;const i=t.logo,a=(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo)||"";i!=a&&(t.logo=a,this.set_logo(a,null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo_href))})}set_logo(e,t){if(this.innerHTML="",!e)return;const r=document.createElement("img");if(r.classList.add("fp-logo"),r.src=e,!t)return this.append(r);const n=document.createElement("a");n.href=t,n.append(r),this.append(n)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(L,e=>{var t;const r=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN;this.innerText=isFinite(r)?Ce(r):""})}}const kr={name:"fp-fullscreen",translation_key:"core.fullscreen"},Rr={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},Dr={name:"fp-play",translation_key:"core.play"},Or={name:"fp-pause",translation_key:"core.pause"},Cr={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Ir={translation_key:"core.play",name:"fp-small-play"},xr={translation_key:"core.pause",name:"fp-small-pause"},Pr={name:"fp-fast-forward"},Mr={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(i,(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Fr={passive:!0};var Nr;function Ur(e,t){let r=0,n=-1,i=-1;const a=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=e.classList;e.id=a,s.remove(Nr.GRABBING),s.remove(Nr.TOUCHING);const o=t.onseek||Kt,l=t.onstart||Kt,c=t.onend||Kt,d=t.onmouse||Kt,f=t.ontouch||Kt,h=t.ontouchend||Kt;function p(t){!function(){const t=e.getBoundingClientRect();r=t.left,n=t.width}();let i=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-r;return i>n&&(i=n),i<0&&(i=0),i/n*100}function v(t){const r=p(t);r!=i&&(o(e,r),i=r)}return e.addEventListener("touchstart",(function(t){Br(e,t)&&(s.add(Nr.TOUCHING),jr(e.parentElement)&&(t.preventDefault(),s.add(Nr.GRABBING),f(e,p(t)),l(e,p(t)),v(t)))}),Fr),e.addEventListener("touchmove",(function(t){t.preventDefault(),v(t),d(e,p(t))}),Fr),e.addEventListener(u,(function(t){setTimeout((function(){s.remove(Nr.TOUCHING)}),500),Br(e,t)&&(t.preventDefault(),s.remove(Nr.GRABBING),h(e,p(t)),c(e,p(t)),n=0)}),Fr),e.addEventListener("touchcancel",(function(){s.remove(Nr.GRABBING,Nr.TOUCHING),n=0}),Fr),e.addEventListener("mousedown",(function(t){s.contains(Nr.TOUCHING)||(document.addEventListener("mousemove",v),s.add(Nr.GRABBING),l(e,p(t)),t.preventDefault(),v(t))})),e.addEventListener("mousemove",(function(t){s.contains(Nr.TOUCHING)||d(e,p(t))})),document.addEventListener("mouseup",(function(t){s.contains(Nr.TOUCHING)||(document.removeEventListener("mousemove",v),s.contains(Nr.GRABBING)&&(s.remove(Nr.GRABBING),c(e,p(t)),n=0))})),e}function Br(e,t){const r=t.target;return!!r&&(r&&!r.closest(e.id)||!jr(e.parentElement)||!e.classList.contains(Nr.TOUCHING))}function jr(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(Nr||(Nr={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(e){super(e),this.className="fp-volume";const t=e.root.classList,r=t.contains("is-tiny")?6:t.contains("is-small")?8:10,n=Array.from({length:r}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});this.append(...n),Ur(this,{onseek:(t,r)=>{r>0&&(e.muted=!1,function(e){try{localStorage.removeItem(e)}catch(e){}}("mute")),nr("volume",(e.volume=r/100).toString()),this.adjustVolumeSlider(e.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",e.i18n("core.volume","volume")),e.on("volumechange",()=>{(0==e.volume||e.muted)&&this.adjustVolumeSlider(0),this.classList.contains(Nr.GRABBING)||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString());const t=Array.from(this.querySelectorAll(".fp-tick")),r=Math.round(e*t.length);t.forEach((e,t)=>{e.classList.toggle("fp-color",t<r)})}}function Gr(e,t){if(!e.parentElement)return;const r=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-r+"%",e.style.display="block"}function Hr(e,t){if(isNaN(e.duration))return;const r=e.buffered;r.length&&(t.style.width=Math.min(r.end(r.length-1)/e.duration*100,100)+"%")}function Kr(e,t){e.style.width="0",t.style.width="0",t.style.display="none"}function Vr(e,t,r){if(t.seeking||!t.seekable||0==t.seekable.length)return;const n=Wr(t,e/100);Gr(r,e);const i=isFinite(t.duration)?n:t.seekable.start(0)+n;r.innerText=Ce(i)}function Wr(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(e.duration))return er(e)*t;const r=e.seekable.start(0);return r+t*(e.seekable.end(0)-r)}function qr(e,t){e.style.width="0",t.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=Re("fp-buffer"),this.progress=Re("fp-progress","fp-color"),this.tooltipEle=Re("fp-timestamp"),this.proposedSeekBar=Re("fp-hover"),this.dragger=Re("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",e.i18n("timeline","Timeline")),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);let r=!1;const n=requestAnimationFrame;let i=void 0;const a=()=>{var r;0==e.reaper||t.live||(r=e,this.progress.style.width=r.currentTime/r.duration*100+"%",i=void 0,e.paused||this.classList.contains(Nr.GRABBING)||i||(i=setTimeout(a,200)))},s=()=>!!this.player.opt("opts.seekable",!0)&&!isNaN(this.player.duration);Ur(this,{onseek:(r,n)=>{if(s())switch(!!t.live){case!0:Vr(n,e,this.tooltipEle);break;case!1:!function(e,t,r){const n=t.duration*(e/100);if(t.disabled&&n>t.currentTime)return!1;r.style.width=e+"%",t.currentTime=n}(n,e,this.progress),Gr(this.tooltipEle,n)}},onstart:()=>{s()&&(e.emit("timeline/gesture/start"),e.setState(Q,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(r,i){n(a),0!=t.seekable&&(e.setState(Q,!1),t.live&&function(e,t){e/=100,t.currentTime=Wr(t,e)}(i,e))},ontouch:function(){e.paused||(r=!0,e.pause())},ontouchend:()=>{r&&(r=!1,e.play()),t.live?qr(this.proposedSeekBar,this.tooltipEle):Kr(this.proposedSeekBar,this.tooltipEle)},onmouse:(r,n)=>{if(s()&&!this.classList.contains(Nr.GRABBING))switch(e.emit("timeline/gesture/move",{percent:n}),!!t.live){case!0:!function(e,t){t.style.width=function(e){return 100-e}(e)+"%"}(n,this.proposedSeekBar),Vr(n,e,this.tooltipEle);break;case!1:!function(e,t){t.style.width=e+"%"}(n,this.proposedSeekBar),function(e,t,r){if(isNaN(e)||isNaN(t.duration))return;Gr(r,e),r.innerHTML="";const n=document.createElement("span");n.innerText=Ce(e/100*t.duration),r.append(n)}(n,e,this.tooltipEle)}}}),e.on(L,(function(e){e.data&&(t=e.data)})),e.on(y,()=>n(a)),e.on("live",()=>{this.progress.style.width="0%"}),e.on(v,()=>{0==e.reaper||t.live||Hr(e,this.bufferEle)}),e.on("dvr",e=>{e.detail&&(this.progress.style.width=e.detail.offset+"%")}),e.on("timeupdate",()=>{0!=e.reaper&&(n(a),this.setAttribute("aria-valuenow",e.currentTime+""),t.live||Hr(e,this.bufferEle))}),e.on(h,()=>{0!=e.reaper&&(t.live||Hr(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const r=$t(e)?er(e):t.data||e.duration;isNaN(r)||(this.setAttribute("aria-valuemax",r+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(l,()=>{e.emit("timeline/gesture/end"),t.live?qr(this.proposedSeekBar,this.tooltipEle):Kr(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(e){super(e),this.handleChapters(e)}handleChapters(e){const t=document.createElement("div");let r;this.addEventListener("chapters:new",e=>{t.innerText="",this.querySelectorAll(".fp-chapter").forEach(e=>this.removeChild(e)),e.data&&e.data.forEach(e=>{const n=document.createElement("div");n.className="fp-chapter",n.style.left=e.left,n.style.bottom=n.style.top="0",n.style.width=e.width,n.title=e.title,n.onmouseover=()=>{t.innerText=e.title},n.onmouseleave=()=>{t.innerText=r||""},this.appendChild(n)})}),this.addEventListener("chapter:changed",n=>{var i;const a=n.data;a&&(t.parentNode||(null===(i=we(e,O))||void 0===i||i.insertAdjacentElement("beforebegin",t),t.classList.toggle("fp-togglable",!0),t.classList.toggle("fp-chapter-info",!0)),r=a,t.innerText=a)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=Re("fp-live-text"),r=Re("fp-live-indicator","fp-color");t.innerHTML="live",this.append(r,t),this.addEventListener(i,(function(){!function(e){try{if(!e.hasState("is-live-seeked"))return;e.emit("live"),e.dvr_offset=0,e.currentTime=tr(e)}catch(e){console.warn("failed to seek to now: %j",e)}}(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),e.on(L,r=>{if(0==e.reaper||!r.data)return;t=r.data;const n=$t(e)?NaN:r.data.duration||0;if(isNaN(n)||n>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Ce(n)}),e.on(h,()=>{var r,n;0==e.reaper||t.live||(n=this,(r=e).duration&&(n.innerText=Ce(r.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=Ce(0),e.on(L,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var r;0!=e.reaper&&(t.live?(r=e,this.innerText=Ce(r.currentTime)):function(e,t){t.innerText=Ce(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=le(e,"flowplayer-small-pause-icon"),r=le(e,"flowplayer-small-play-icon");t.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){r.focus&&r.focus()}),100)})),r.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){t.focus&&t.focus()}),100)})),this.append(t,r)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add(t);const r=this.classList.contains("fp-left-zone")?-1:1,n=document.createElement("span"),i=le(e,this.classList.contains("fp-left-zone")?H:"flowplayer-fast-forward-icon");i.removeAttribute("tabindex"),n.classList.add("fp-zone-seconds"),this.append(n,i);e.on(b,()=>{n.innerText=""}),e.on("seek:queued",e=>{const t=e.data;if(!t)return;if("number"!=typeof t.offset)return;const r=t.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()}),e.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener(u,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState("no-timeline")||!e.hasState("will-seek")&&!e.hasState($)||e.enqueueSeek(5*r)&&(t.stopPropagation(),t.preventDefault())}))}reset_zone(){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText="")}render_zone_state(e){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText=Math.abs(e)+"")}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(e,t,...r){super(e),this.className=t;const n=e.createComponents(...r);this.append(...n),"fp-left"!==t&&n.forEach(t=>{t.addEventListener(i,()=>e.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-wait"),Array(...Array(4)).map((e,t)=>t).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle-zone");const t=e.createComponents(B,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[j,G].forEach(t=>{const r=le(e,t);r.removeAttribute("tabindex"),this.append(r)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=le(e,K);this.append(t),!r().ios&&this.append(le(e,P)),t instanceof FlowplayerIcon&&t.addEventListener(i,(function(){e.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-header"),this.append(...e.createComponents("flowplayer-header-left-zone","flowplayer-header-right-zone")),e.reaper&&e.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-controls","fp-togglable"),this.append(...e.createComponents("flowplayer-control-buttons",C,I,x,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n(t==kr?"core.fullscreen":"core.fullscreen_exit"))}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",U,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n("core.play")),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),[y,b].forEach(t=>e.once(t,()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")}))}handleClick(e){[i,a].forEach(t=>this.addEventListener(t,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(i,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState(J)||e.togglePlay()}),0)})),e.on(a,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener(u,(function(t){0!=t.cancelable&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on(u,(function(r){setTimeout((function(){if(r.defaultPrevented)return;if(e.hasState(J))return;if(e.ended)return e.togglePlay(!0);const n=e.hasState(X);t&&clearTimeout(t),(n||e.hasState($)||e.hasState("no-autoplay"))&&(e.hasState($)&&(e.setState($,!1),e.setState("is-hovered",!1)),e.togglePlay(),n)||(e.setState($,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState($,!1),e.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-ui"),this.append(...e.createComponents(M,N,O))}}pt.extensions.unshift.apply(pt.extensions,[I18n,Analytics,Health,class Default{constructor(e){ue(e,D,FlowplayerUi),ue(e,O,FlowplayerControls),ue(e,C,FlowplayerLiveStatus),ue(e,"flowplayer-control-duration",FlowplayerDuration),ue(e,x,e.extensions.find(e=>e.name===Chapters.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),ue(e,I,FlowplayerElapsedTime),ue(e,P,FlowplayerVolumeBar),ue(e,"flowplayer-volume-control",FlowplayerVolumeControl),ue(e,"flowplayer-control-buttons",FlowplayerControlButtons),ue(e,M,FlowplayerHeader),ue(e,F,FlowplayerPrimary),ue(e,"flowplayer-header-duration",FlowplayerHeaderDuration),ue(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left",F,"flowplayer-header-duration")}}),ue(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),ue(e,N,FlowplayerMiddle),ue(e,U,FlowplayerMiddleZone),ue(e,B,FlowplayerMiddleWait),ue(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),ue(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),ue(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),ue(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,Ir),this.setAttribute("role","button")}}),ue(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,xr),this.setAttribute("role","button")}}),ue(e,j,class extends FlowplayerIcon{constructor(e){super(e,Dr)}}),ue(e,G,class extends FlowplayerIcon{constructor(e){super(e,Or)}}),ue(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,kr)}}),ue(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,Rr)}}),ue(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,Pr)}}),ue(e,H,class extends FlowplayerIcon{constructor(e){super(e,Mr)}}),ue(e,K,class extends FlowplayerIcon{constructor(e){super(e,Cr),this.classList.add("fp-volumebtn"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute"))})}})}init(e,t,r){var n;ar(e,0,r),ir(e,t,r),n=r,"undefined"!=typeof window&&"ontouchstart"in window&&n.setState("is-touch-device",!0),n.setState("is-accessibility",!1)}}]);var zr=Object.assign(pt,{ui:Xt,i18n:I18n}),Yr=gt(mt((function(e,t){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
15
+ ***************************************************************************** */function pe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function ve(e){const t=document.createElement("a");t.href=e;const r=t.pathname&&t.pathname.split(".");return r.length>1&&r[r.length-1]}function ge(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const me=e=>{var{src:t}=e,r=pe(e,["src"]);return[Object.assign({src:t,type:t?ge("video/"+ve(t)):""},r)]};function ye(e){return me({src:e})}function Ee(e){var{src:t,type:r}=e,n=pe(e,["src","type"]);return t&&r?[Object.assign({src:t,type:r},n)]:r&&!t?[Object.assign({type:r},n)]:me(Object.assign({src:t},n))}var _e;function Te(e,t,r,n={safari:!1}){const i=function(e){return"string"==typeof e?ye(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=ye(t)),"object"!=typeof t||Array.isArray(t)||(t=Ee(t)),e.concat(t)}),[]):Ee(e)}(r);return e.currentSrc&&(e.innerHTML=""),Array(...Array(i.length)).map((e,t)=>t).some(r=>{const a=i[r];if(_e.Ok==function(e,t,r){e.emit("src",r),"string"==typeof r.src&&(e.original_src=r.src);const n=function(e,t,r){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(r.src||"",r,t))}(e,t,r);return n?(n.onload(t,e.root,e,r),_e.Ok):_e.Err}(e,t,a)||_e.Ok==function(e,t,r,n={safari:!1}){/^audio\//.test(r.type||"")&&e.emit("audioonlysource");t.start_time&&(r.src=r.src+"#t="+t.start_time);if(""==e.canPlayType(r.type||""))return _e.Err;if(r.drm&&(!r.drm["com.apple.fps.1_0"]||!n.safari))return _e.Err;"string"==typeof r.src&&(e.src=r.src);return _e.Ok}(e,t,a,n))return!0;r==i.length-1&&"string"==typeof a.src&&(e.src=a.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(_e||(_e={}));const be=[S,A,"src","seek:cancel"];var Ae;function Se(e,t,r){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=r,0==t.offset?Le(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,r=0){return Math.max(Math.min(t,e),r)}(e.currentTime+t.offset,e.duration),t.timer=0,Le(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(Ae.BACKWARD,t.offset<0),e.setState(Ae.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Le(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(Ae.FORWARD,!1),e.setState(Ae.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function we(e,t){const r=e._customElements.get(t);return r&&e.root.querySelector(r)||void 0}function ke(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Re(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function De(e,t,r){const n=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;n.length;){if(null==e)return r;const t=n.shift();if("string"!=typeof t)return r;e=e[t]}return null==e?r:e}function Oe(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function Ce(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const r=Math.floor(e/3600);let n=Math.floor(e/60);return e-=60*n,r>=1?(n-=60*r,t+r+":"+Oe(n)+":"+Oe(e)):t+Oe(n)+":"+Oe(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(Ae||(Ae={}));const Ie=navigator.languages||[navigator.language];function xe(e,t,r){const n={};return r=t.lang||r,e[r]&&(n[r]=e[r]),function(){try{return Ie.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!n[t]&&(n[t]=e[t])})),Object.values(n)}const Pe=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Me=()=>"undefined"==typeof crypto?"":Pe.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let Fe="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const Ne=["touchstart","touchmove"];function Ue(e,t){const r=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(r,"data",{get:()=>t}),r}function Be(e,t,r){const n=Ue(t,r);return e.dispatchEvent(n),e}function je(e,t,r){const n=Ue(t,r);return e.dispatchEvent(n),n}function Ge(e,t,r,n){Array.isArray(t)?t.forEach(t=>He(e,t,r,n)):He(e,t,r,n)}function He(e,t,r,n){if(i=t,!~Ne.indexOf(i))return e.addEventListener(t,r,n),e;var i;const a=Object.assign(n||{},{passive:!0});return e.addEventListener(t,r,a),e}function Ke(e,t,r,n){return Ge(e,t,r,Object.assign(n||{},{once:!0}))}const Ve={preload:"none",rtl:!1,controls:!0},We=["loop","muted","preload"];function qe(e,n,i){i.toJSON=function(){return{duration:i.duration,volume:i.volume,currentTime:i.currentTime,states:i.root.className}},i.setSrc=function(t){return Te(i,e,t,r())},i.playerState=i.playerState||{},i.setState=function(e,t){if(i.playerState[e]===!!t)return i;const r=Object.assign({},i.playerState,{[e]:t});return r[J]&&(r[q]=!1),i.playerState=r,Be(i,"state",i.playerState),i},i.createComponents=function(...e){return Array.from({length:e.length}).map((t,r)=>le(this,e[r]))},i.hasState=function(e){return!!i.playerState[e]},i.transitionState=function(e,t,r){!i.hasState(e)&&i.hasState(t)||(r=0),r&&i.setState("is-toggling",!0),i.setState(t,!1),i.setState(e,!0),r&&setTimeout((function(){i.setState("is-toggling",!1)}),r)},i.emit=(e,t)=>(Be(i,e,t),i),i.on=(e,t)=>(Ge(i,e,t),i),i.once=(e,t)=>(Ke(i,e,t),i),i.off=(e,t)=>{var r,n;return r=e,n=t,i.removeEventListener(r,n),i},i.poll=(e,t)=>je(i,e,t),i.togglePlay=function(t){return de(i,e,t)},i.toggleMute=function(e){e=null==e?!i.muted:!!e,i.muted=e,i.muted||i.volume||(i.volume=1),Be(i,"volumechange")},i.toggleDisable=function(e){e=null==e?!i.disabled:!!e,i.setState("is-disabled",e),i.disabled=e},i.destroy=function(){i.pause();const e=t.indexOf(i);~e&&t.splice(e,1),setTimeout((function(){i.setSrc([]),i.reaper&&i.reaper.clear(),Be(i,S)}),0)},i.setAttrs=function(e){return We.forEach(t=>{if(!(t in e))return;const r=e[t];r?i.setAttribute(t,r.toString()):i.removeAttribute(t)}),i},i.opt=function(t,r){return r=void 0===r?De(Ve,t):r,De(e,t,r)},i.i18n=function(e,t){if(!i.reaper)return"";const r=i.reaper.get("translations");return r?function e(t,r,n,i){return(i=i||0)>=t.length?n:De(t[i],r,e(t,r,n,i+1))}(r,e,t||""):t||""},i.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&i.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&i.toggleMute(t.muted);const r=!!e.autoplay&&!i.hasState("no-autoplay");i.setState("is-autoplay",r),i.setState("is-rtl",i.opt("rtl",function(e){if(!e)return ke();const t=e.getAttribute("dir");return t?"rtl"==t:ke()}(n))),i.setState("is-live",!!e.live),i.setState("no-timeline",!(!e.live||e.dvr)),i.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),i.setState("is-seekable",!!e.seekable),n.style.backgroundImage=i.hasState("has-poster")?"url('"+e.poster+"')":"",Be(i,L,e)},i.renderPlugin=function(e){je(i,"renderplugin",e).defaultPrevented||i.root.appendChild(e)};const a={offset:0,timer:0};var s,o;o=a,(s=i).on(be,(function(){Le(s,o)})),i.enqueueSeek=function(e){if(0!=i.opts.seekable&&!(1==i.opts.disabled&&e>0))return Se(i,a,e)},i.deviceId=function(){return function(){if(Fe)return Fe;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=Me();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return Fe=Me()}}()}}function ze(e,t){const r=t.querySelector("video"),n=r||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return n.classList.add("fp-engine"),n.playsInline=!0,r||t.append(n),n}function Ye(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const r=e.flowplayer;return"function"==typeof r?(r(t),t):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(t)||r.extensions.push(t),t)}function Xe(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const Qe=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function Ze(e,t){return!!~Qe.indexOf(e)||e.indexOf(t)===e.length-t.length}Ze.check_whitelist=function(e){return!!~Qe.indexOf(e)};const Je="production";function $e(e,t){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let n={c:"{}",exp:0};t=t||{};try{n=se(e),r.valid_jwt=!0}catch(e){}return r.raw=e,r.data=JSON.parse(n.c),r.exp=n.exp,t.require_valid_token&&$e.validate(r),r}function et(e){try{return $e.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var tt;function rt(e){return{grant:e,is_granted:t=>(e&t)===t}}function nt(e,t,r){t&&t.destroy(),console.error(new Error(r.details||r.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function it(e,t){const r=t.clientWidth;t.classList.toggle("is-small",r<600),t.classList.toggle("is-tiny",r<400)}function at(e,t,n){let i=!0;t.classList.add("flowplayer"),it(0,t),Ge(n,[g,c],(function(){it(0,t)})),Ge(n,"state",(function(){Object.entries(n.playerState).forEach((function([e,r]){t.classList.toggle(e,r)}))})),Ge(n,"timeupdate",(function(){n.setState(J,!1)})),Ge(n,L,(function(){const r=n.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==n.currentTime;[Y,X].forEach((function(e){n.setState(e,r)}))})),Ge(n,T,(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!n.loop&&(e.autoplay&&(e.autoplay=0,n.setState("is-autoplay",!1)),n.setState(Q,!0),Ke(n,b,(function(){n.setState(Q,!1),n.pause(),n.setState(X,!0)})),n.currentTime=0),Ke(n,"timeupdate",(function(){n.setState(Z,!1)})),n.transitionState(Z,q,e.loop||e.rewind?0:300))}),0)})),Ge(n,[A,b],(function(e){n.setState(Q,e.type==A),n.setState(z,n.paused),n.setState(q,!n.paused)})),Ge(n,T,(function(){n.setState(q,!1),i=!0})),Ge(n,r().ios?h:p,(function(e){const t="src"!=e.type||"none"!==n.opt("preload");n.setState("is-loaded",t),n.setState(Y,!t)})),Ge(n,[E,_,g],(function(t){if(!n.hasState(Q)&&(t.type!=_||e.autoplay||n.setState(J,!1),t.type!=g||"none"!=n.opt("preload")||e.autoplay)){if(t.type==g&&e.autoplay)return Ke(n,y,(function(){n.setState(J,!1)}));t.type==E&&[q,z,X].forEach((function(e){n.setState(e,!1)})),n.setState(Z,!1),n.setState(J,t.type==E)}})),Ge(n,[y,m],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:n});document.dispatchEvent(e)},0);const r=t.type==y,a=n.currentTime==n.duration,s=r&&i&&e.autoplay||n.hasState(J);if(r&&(n.started=!0,i=!1),n.setState(J,!1).setState(X,!1),a||n.hasState(Q))return;const o=r?q:z,l=r?z:q;n.transitionState(o,l,s?0:300),r&&n.setState("no-autoplay",!1)}))}function st(e){const t=function(e){const t=e.getBoundingClientRect(),r=window.innerHeight,n=t.height,i=t.bottom,a=n/5;return t.top<=a&&t.top+n>r-a||i-n+a>=0&&i<r+a}(e.root);return e.in_viewport===t||(e.in_viewport=t,Be(e,t?"viewenter":"viewleave")),e}function ot(e,r,n){st(n);const a={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[u,i].forEach(e=>Ke(n,e,()=>a.has_user_gesture=!0)),Ge(n,"play",(function(){a.locked||(a.should_resume=!0)})),Ge(n,m,(function(){a.locked||(a.should_resume=!1)})),Ge(n,_,(function(r){!e.autoplay||t.filter((function(e){return!e.paused})).length&&!e.multiplay||n.in_viewport&&n.paused&&a.should_resume&&n.togglePlay(!0)})),e.autopause&&(Ge(n,"viewenter",(function(){a.should_resume&&n.togglePlay(!0)})),Ge(n,"viewleave",(function(){const e=!n.paused;a.locked=!0,n.pause(),setTimeout((function(){a.should_resume=e,a.locked=!1}),0)})))}$e.validate=function(e){if("string"==typeof e&&(e=$e(e)),!e||!e.raw){if(Ze.check_whitelist(window.location.hostname)||"dev"===Je.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,r=Ze.bind(null,t);if("dev"!==Je.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==Je.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},$e.id=function(e){if(e)return"string"==typeof e&&(e=$e(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(tt||(tt={})),rt.of=rt,rt.from_token=function(e){const t=$e(e,{require_valid_token:!0});return rt.of(t.data.acl)},rt.permissions=tt,[s,c].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Be(e,c),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(st)}));function lt(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function ut(e,t,r){const n=document.createElement("div");n.classList.add("fp-ratio"),t.append(n);let i=lt(e.ratio||.5625);n.style.paddingTop=100*i+"%";const a=[p,h];r.on(a,(function(){const e=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth;e&&r.setOpts({ratio:e})})),r.on(L,(function(){const t=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth,a=lt((null==e?void 0:e.ratio)||t||.5625);i!==a&&(i=a,n.style.paddingTop=100*a+"%")}))}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(e,t,r){this.root=t,this.player=r,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(y,this.render),null===(t=this.player)||void 0===t||t.once(T,this.wireUp)}cleanUp(){var e,t,r,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(r=this.player)||void 0===r||r.off(y,this.render),null===(n=this.player)||void 0===n||n.off(T,this.wireUp)}render(){var e,t,r;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const n=(null===(r=this.root)||void 0===r?void 0:r.querySelector(".fp-ui"))||this.root;if(!n)return;const i=this._logo=document.createElement("a");i.href="https://explorer.flowplayer.com",i.target="_blank",Object.entries(ct).forEach(([e,t])=>{i.style.setProperty(e,t,"important")}),n.appendChild(i)}}const ct={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)"},dt="flowplayer/"+y;function ft(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on(S,()=>document.removeEventListener(dt,t)),document.addEventListener(dt,t)}const ht=function(){const e=Xe(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function pt(r,n){if("function"==typeof r)return e.push(...[...arguments].filter(e=>"function"==typeof e)),pt;"string"==typeof n&&(n={src:n}),n||(n={}),n.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(n.token=window.__FLOWPLAYER_TOKEN);const i="string"==typeof r?document.querySelector(r):r;if(!i)return console.error(new Error("Flowplayer: '"+r.toString()+"' not found"));const a=i.querySelector("video.fp-engine");if(a)return a;const s=et(n.token);if(!s.success)return nt(i,null,{reason:"token",details:s.message});const o=new Map,l=ze(n,i);l.reaper=o,l._customElements=oe,Object.defineProperty(l,"token",{value:"string"==typeof n.token?$e.id(n.token):"",writable:!1}),l.addEventListener(S,()=>{o.clear(),l.reaper=0,delete l.root}),l.root=i,n.token&&rt.from_token(n.token).is_granted(rt.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),qe(n,i,l),l.setAttrs(n),l.plugins=pt.extensions.map(e=>new e(pt,l)),at(n,i,l),ot(n,0,l),ut(n,i,l),ft(l),l.plugins.forEach(e=>{try{e.init(n,i,l)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),l.setOpts(n),l.opts=n,n.src&&l.setSrc(n.src);const u=l.readyState;return u>0&&l.currentSrc&&l.emit(h),u>2&&l.currentSrc&&l.emit(_),l.emit("mount"),l.on("error:fatal",(function(e){nt(i,l,e.data||{})})),l}Object.assign(pt,ht),function(n){Array.isArray(n.extensions)&&n.extensions.forEach(t=>e.push(t)),n.customElements=oe,n.defaultElements=W,n.version="3.0.1-rc.3",n.commit="99bc0ccc7b34661f9715474d094f159f9bdbfeac",n.instances=t,n.extensions=e,n.support=r,n.events=R,n.states=ee,n.jwt=se,n.autoplay=ae,n.quality=ce}(pt),"object"==typeof document&&setTimeout(Be,0,document,"flowplayer:umd",pt);var vt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mt(e){var t={exports:{}};return e(t,t.exports),t.exports}var yt=mt((function(e,t){var r=vt&&vt.__assign||function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return r(r({},e),t)}),{})},t.pluck=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return Object.keys(e).filter((function(e){return~r.indexOf(e)})).reduce((function(r,n){var i;return t.merge(r,((i={})[n]=e[n],i))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var r=e.lastIndexOf(t);return~r&&e.splice(r,1),e}})),Et=mt((function(e,t){var r=vt&&vt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=vt&&vt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=vt&&vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};t.__esModule=!0;var a=i(yt),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var r=e.lpop(t);r&&e.request(t,r)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,r){e.rm(t,r),e.increment_failures(t)},e.request=function(t,r){var n=r[0],i=r[1],a=r[2];if(!(Date.now()<t.stats.ttl)){var s=new XMLHttpRequest;t.open.push(s),s.timeout=e.REQUEST_TIMEOUT_MS,s.ontimeout=function(){e.handle_error(t,s)},s.onerror=function(r){e.handle_error(t,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&e.rm(t,s),Math.floor(s.status/100)},s.onload=function(){e.rm(t,s),t.stats.failures&&t.stats.failures--},s.open(i,n),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(a))}catch(e){}}},e.rpush=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.forEach((function(r){t.pending.length>=e.MAX_PENDING||(t.pending.push(r),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return a.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=s})),_t=mt((function(e,t){var r=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var n=r(Et);t.default=n.default.of()})),Tt=mt((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,r){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in r)return r[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(r,null,2)+"\n "))}))}})),bt=mt((function(e,t){t.__esModule=!0,t.Log=void 0;var r=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var r=document.createEvent("Event");return r.initEvent(e,!1,!0),r.ns=e,r.data=t,r},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=r})),At=mt((function(e,t){var r;t.__esModule=!0,t.Verb=void 0,(r=t.Verb||(t.Verb={})).POST="POST",r.PUT="PUT",r.GET="GET"})),St=mt((function(e,t){var r=vt&&vt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=vt&&vt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=vt&&vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},a=vt&&vt.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n},s=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=s(_t),l=s(Et),u=i(Tt),c=i(yt),d=function(){function e(t,r){var n=this;void 0===r&&(r={});var i=this;if(this.emitter=t,this.url=r.url,this.log=bt.Log.of(this.emitter),this.verb=r.verb,this.metadata=c.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),e.assert_emitter_api(this.emitter),void 0===e.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");e.TRACKERS.push(this),i.events.forEach((function(t){e.create_listener(n,t,(function(r){void 0===r&&(r={});var a=c.merge(i.metadata,{event_type:t},r.data||r),s=u.prepare_url(i,a),o=e.pluck_valid_keys(i,a),d=e.ensure_required_keys(i,o);if(d.length)return i.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(o,null,2));l.default.rpush(n.rq,[s,n.verb,o])}))}))}return e.of=function(t,r){return new e(t,r)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return c.pluck.apply(c,a([t],e.valid_keys))},e.merge_metadata=function(t,r){return void 0===r&&(r={}),t.metadata=e.pluck_valid_keys(t,c.merge(t.metadata,r)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,r){e.listeners.push([t,r]),e.emitter.addEventListener(t,r)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var r=e[0],n=e[1];return t.emitter.removeEventListener(r,n)})),delete this.rq,delete this.emitter,c.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=o.default,e.verb=At.Verb,e}();t.default=d})),Lt=mt((function(e,t){var r=vt&&vt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=vt&&vt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=vt&&vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},a=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=a(St);t.Tracker=s.default;var o=i(Tt);t.API=o})),wt="ping",kt="display",Rt="view";const Dt=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],Ot=["created","position"],Ct=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function It(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,r){return Math.floor(r*t*1e3)/1e3}))}}(e.duration))}function xt(e,t,r){if(!t.segment_duration&&!It(e,t))return;const n=function(e,t,r){const n=t.last_idx,i=r?99:Pt(e,t);return t.last_idx=i,i<=n?[]:t.breakpoints.slice(n,99==i?100:i).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,r);0!=n.length&&e.emit(wt,{position:n})}function Pt(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const Mt="vod",Ft="live",Nt=[kt,wt,Rt];function Ut(e,t,r){switch(null==t?void 0:t.kind){case"live":return function(e,t){const r=Date.now();r-t.last_tracked_ts<6e4||(t.last_tracked_ts=r,++t.ticks,e.emit(wt,{position:60*t.ticks}))}(e,t);case"vod":return xt(e,t,"boolean"==typeof r&&r)}}function Bt(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}function jt(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class Analytics{init(e,t,r){if(!rt.from_token(e.token||"").is_granted(rt.permissions.ANALYTICS))return;if(r.analytics)return;const n=r.analytics={ticker:void 0,last_media_id:"",ended:!1},i={locked:!1,ttl:6e3,task:()=>{Ut(r,n.ticker)}};const a={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:e.player_id,customer_user_id:e.customer_user_id},s=Lt.Tracker.of(r,{verb:Lt.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:Nt,required_keys:Dt,optional_keys:Ct.concat(Ot).slice(0),metadata:a});r.on(S,(function(){s&&s.destroy()})),r.on(L,(function(t){if(!s)return;const i=De(t,"data.metadata",{});if(!i.media_id)return;const a=De(s,"metadata.media_id");if(a&&i.media_id==a)return;const o=De(e,"analytics",{});s.put(i),s.put(o);const l=De(e,"metadata.live_start_time",e.live)?Ft:Mt;s.put({video_type:l,source:e.source||jt()||""}),n.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},n.ended=!1,r.emit(kt)}));let o=0;r.on(y,(function(){if(!s)return;if(o||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(s,n))return;s.put({muted:r.muted});const e=Bt(r);if(e)return o=Promise.resolve(e).then((function(){n.last_media_id=s.metadata.media_id,r.emit(Rt),o=0})).catch((function(){o=0}));n.last_media_id=s.metadata.media_id,r.emit(Rt)})),r.on("timeupdate",(function(){var t;s&&(o||Bt(r)||n.ended||(!e.live&&r.currentTime+.25>=r.duration&&Ut(r,n.ticker,!0),(t=i).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),r.on(b,(function(){s&&n.ticker&&"vod"==n.ticker.kind&&function(e,t){It(e,t),t.last_idx=Pt(e,t)}(r,n.ticker)})),r.on(T,(function(){s&&function(e,t){t.ended||(t.ended=!0,Ut(e,t.ticker))}(r,n)}))}}var Gt;function Ht(e){switch(e){case Gt.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case Gt.MEDIA_ERR_NETWORK:return"a network error occurred";case Gt.MEDIA_ERR_DECODE:return"unable to decode media content";case Gt.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case Gt.NO_INTERNET:return"no internet connection detected";case Gt.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function Kt(){}function Vt(){return"https:"===location.protocol}function Wt(e){const t=document.createElement("a");return t.href=e,t}function qt(e){try{return!!new URL(e)}catch(e){return!1}}Ye(Xe(),Analytics),"undefined"!=typeof window&&window.matchMedia&&[w,k].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(r){t.length&&t.forEach((function(t){r.matches&&t.emit(e)}))}))})),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(Gt||(Gt={}));const zt=()=>!0===(navigator||{}).onLine;function Yt(e,t,r){r.on(n,(function(e){const t=e.data||r.error||new Error,n=e.code||t.code,i="Error: %s\n"+(null===(a=(new Error).stack)||void 0===a?void 0:a.split("\n").slice(2).join("\n"));var a;setTimeout((function(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;r.setState("is-error",!0),8===n||t.fatal||function(e){const t=e.togglePlay,r=e.root;e.togglePlay=Kt,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const n=r.querySelector(".fp-error");n&&n.remove()}))}(r);const a=function(e,t,r){switch(t){case"http:0":return function(e){return function(e){try{return Vt()&&"http:"==Wt(e).protocol}catch(e){return!1}}(e.original_src)?{code:Gt.MIXED_CONTENT}:zt()?{code:Gt.MEDIA_ERR_NETWORK}:zt()?{code:Gt.UNKNOWN}:{code:Gt.NO_INTERNET}}(e);case Gt.MEDIA_ERR_SRC_NOT_SUPPORTED:return e.once(g,(function(){e.emit("recover")})),r;default:return r}}(r,n,t),s=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const r=t.code||-1,n=Ht(r);return e.i18n("media_errors."+r,n)}(r,a);console.error(i,s);const o=r.reaper&&r.reaper.get("ui");return o&&function(e,t,r,n){if(!e)return;const i=document.createElement("div");if(i.classList.add("fp-error"),i.innerText=t,n){const t=e.querySelector("#"+n);t&&e.removeChild(t),i.id=n}if(e.append(i),r){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=r,i.append(e)}}(o,s,t.details)}))}))}var Xt=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});function Qt(e,t,r){let n=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),i="webkit"+i,n=()=>t.webkitCurrentFullScreenElement}const s=()=>r.getFullsceenTarget?r.getFullsceenTarget():t;r.toggleFullScreen=function(e,t){if(r.ios_fullscreen_disabled)return;if("boolean"!=typeof e&&(e=!r.hasState("is-fullscreen")),Zt(r)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(r):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState($)||e.setState($,!0)}(r,t)),!document.fullscreenEnabled)return;const n=s();e?n.requestFullscreen():document.exitFullscreen()},Zt(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 e=s();e.addEventListener(i,(function(){const t=n(),i=t===e||t==r;r.emit(i?d:f),r.setState("is-fullscreen",i),r.emit(c)}))},0),!1!==e.doubleclick&&t.addEventListener(a,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&r.toggleFullScreen()}))}function Zt(e){return r().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function Jt(e){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const t=e.opt("live_dvr_window",0),r=e.seekable.end(e.seekable.length-1);return{head:r,tail:Math.max(e.seekable.start(0),r-t)}}function $t(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function er(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:e.seekable.end(0)}function tr(e){return function(e){return Jt(e).head}(e)-.5}function rr(e){try{return localStorage.getItem(e)}catch(e){return null}}function nr(e,t){try{localStorage.setItem(e,t)}catch(e){}}function ir(e,t,r){if(!r.reaper)return;const n=document.createDocumentFragment(),i=le(r,D);n.appendChild(i),r.reaper.set("ui",i),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,r){const n=Re("fp-footer");t.append(n),r.on(L,(function(e){var t,r;const i=null===(t=e.data)||void 0===t?void 0:t.description,a=null===(r=e.data)||void 0===r?void 0:r.title;if(n.innerHTML="","string"==typeof a){const e=Re("fp-title");e.innerText=a,n.append(e)}if("string"==typeof i){const e=i.split(" "),t=Re("fp-desc");for(t.innerText=e.join(" "),n.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,r),Yt(0,0,r),t.appendChild(n),[o,l].forEach(e=>{t.addEventListener(e,(function(e){r.setState("is-hovered",e.type==o),r.setState("is-accessibility",!1)}))}),Qt(e,t,r),r.on("volumechange",(function(){const e=0==r.volume||r.muted;r.setState("is-muted",e),nr("mute",e.toString())})),"true"==rr("mute")&&(r.muted=!0,r.setState("is-muted",r.muted));const a=rr("volume");a&&!isNaN(Number(a))&&(r.volume=Number(a)),r.emit("volumechange"),r.on("timeupdate",(function(){var t;e.live&&(!("dvr"in(t=e))||1==t.dvr)&&function(e,t){if(0==t)return!0;const r=Jt(e);return r.head-r.tail>=t}(r,e.seconds_to_dvr||0)&&r.setOpts({dvr:r.seekable.length>0})})),r.on("live",(function(){r.setState("is-live-seeked",!1)})),r.on("seeking",(function(){if(!$t(r))return;if(0==r.seekable.length||0==r.played.length)return;if(0==er(r))return;const e=tr(r),t=r.currentTime>=e?"live":"dvr";if("live"===t)return r.emit(t);const n=er(r),i=r.seekable.end(0)-r.seekable.start(0),a=(n-r.currentTime)/i*100,s=Math.round(a);r.setState("is-live-seeked",s>0),r.emit(t,{offset:s})})),r.on(h,(function(){r.setOpts({live:$t(r)})})),r.on("durationchange",(function(e){const t=$t(r),n=t?er(r):e.data||r.duration;isNaN(n)||r.setOpts({live:t,duration:n})})),r.on(L,(function(r){var n,i;e.seekable=void 0===(null===(n=null==r?void 0:r.data)||void 0===n?void 0:n.seekable)||r.data.seekable;const a=null===(i=r.data)||void 0===i?void 0:i.ui;if("number"!=typeof a)return;const s=t.classList;s.toggle("use-play-1",!(32&a||64&a)),s.toggle("use-play-2",(32&a)>0),s.toggle("use-play-3",(64&a)>0),s.toggle("use-thin-controlbar",(128&a)>0),s.toggle("no-title",(256&a)>0),s.toggle("no-description",(512&a)>0),s.toggle("logo-on-right",(8&a)>0),s.toggle("use-drag-handle",(16&a)>0),s.toggle("no-controls",(1024&a)>0),s.toggle("no-duration",(2048&a)>0),s.toggle("no-header",(4096&a)>0),s.toggle("no-mute",(4&a)>0),s.toggle("no-volume",(2&a)>0),s.toggle("no-fullscreen",(1&a)>0),s.toggle("no-touch-zones",(16384&a)>0)}));let s=null;i.addEventListener("mousemove",(function(){"number"==typeof s&&clearTimeout(s),r.setState("is-hovered",!0),s=0==r.paused&&setTimeout((function(){r.setState("is-hovered",!1)}),2e3)}))}function ar(e,t,r){if(rt.from_token(e.token||"").is_granted(rt.permissions.NO_METERING))return;const n=$e.id(e.token||"");n&&r.once(y,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(r,n))}var sr={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(e,t,r){r.reaper&&r.reaper.set("translations",xe(I18n,e,"en"))}}I18n.en=sr;const or="rebuffer";var lr=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:or});const ur=navigator;function cr(e){var t,r;const n=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return n?1e-6*n:(null===(r=ur.connection)||void 0===r?void 0:r.downlink)||-1}function dr(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const fr=Me(),hr=[];function pr(e){const t=hr.slice(0);hr.length=0,e.logger.log(`:dispatch events={${t.length}}`),dr("https://health.flowplayer.com/v1/health/events",t)}function vr(e,t,r){hr.push(t),e.logger.log(":enqueue",t.event,t),hr.length<10&&!r||pr(e)}const gr=()=>{var e,t;try{const r=window;return null===(t=null===(e=null==r?void 0:r.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},mr=(e,t)=>Object.assign(e,{detail:t}),yr=(e,{event:t,media_session_id:r})=>({event:t,media_session_id:r,device_id:e.deviceId(),session_id:fr,timestamp:Date.now(),version:"3.0.1-rc.3",commit:"99bc0ccc7b34661f9715474d094f159f9bdbfeac",ima_sdk_version:gr(),preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay),source:e.original_src,downlink_mbs:cr(e),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime}),Er=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function _r(e,t,r,n){const i=yr(t,{event:r,media_session_id:e.media_session_id}),{before:a,after:s}=n;vr(e,((e,t,r)=>Object.assign(e,{state:{before:t,after:r}}))(i,Er(a),Er(s)))}const Tr=(e,t)=>{let r=null;return(...n)=>{null!==r&&(clearTimeout(r),r=null),r=setTimeout(()=>t(...n),e)}};class Health{constructor(e,t){if(this.logger=function(e,t){return{log:(...r)=>{const n=e.opt("debug");n&&t.match(n)&&console.log(t,...r)}}}(t,"health"),this.media_session_id=Me(),!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=()=>e.instances.forEach(e=>e.emit("unload"));document.addEventListener("visibilitychange",()=>{"hidden"==document.visibilityState&&t()}),window.addEventListener("pagehide",t)}}init(e,t,r){!function(e){e.on(E,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit(or)}))}(r),r.on("health:record",({detail:e})=>{const t=yr(r,{event:e.event,media_session_id:this.media_session_id});Object.assign(t,e.detail||{}),vr(this,t)}),[_,g,s,h,p,v,E,or].forEach(e=>{r.on(e,e=>{vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id}))})}),[y,m,A,b,T,d,f].forEach(e=>{r.on(e,e=>{vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id}))})}),r.on("volumechange",Tr(800,e=>{const t=yr(r,{event:e.type,media_session_id:this.media_session_id});vr(this,mr(t,{volume:parseFloat(r.volume.toFixed(2)),muted:r.muted}))})),r.on(c,Tr(800,e=>{const n=yr(r,{event:e.type,media_session_id:this.media_session_id});vr(this,mr(n,{height:t.clientHeight,width:t.clientWidth}))})),r.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return _r(this,r,e,t)}}),r.addEventListener(n,e=>{const t=yr(r,{event:e.type,media_session_id:this.media_session_id}),n=e.error||r.error;if(!n)return vr(this,t,!0);const i=n.code,a={error_message:n.message||Ht(i),error_code:i,error_stack:n.stack||""};return vr(this,mr(t,a),!0)}),r.on("src",e=>{var t;const n=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof n)return;if(!qt(r.original_src))return;if(!qt(n))return;if(n==r.original_src)return;this.media_session_id=Me();vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id})),pr(this)}),r.on("unload",e=>{vr(this,yr(r,{event:e.type,media_session_id:this.media_session_id})),pr(this)})}}var br;function Ar(e,t){if(function(e){return Object.values(br).includes(e)}(t=t||br.Anonymous))return"crossOrigin"in e?e.crossOrigin=t:e.setAttribute("crossorigin",t),e}function Sr(e){const t=document.createElement("a");return t.href=e,t.origin}function Lr(e,t){const r=document.createElement("track");r.className="fp-track renderable",r.kind=t.kind||"captions",r.id=["fp",t.lang].join("-");const n=r.track;return"string"!=typeof t.crossorigin&&function(e,t){try{return e.src.startsWith("blob:"),Sr(e.src)!==Sr(t)}catch(e){return console.error(e),!0}}(e,t.src)&&(Ar(e),t.crossorigin=e.getAttribute("crossorigin")),"crossorigin"in t&&Ar(e,t.crossorigin),Object.keys(t).forEach(e=>{r[e]=t[e]}),n.mode=t.default?"showing":t.mode||"disabled",r.onload=function(){},n.oncuechange=function(t){e.emit(t.type,{track:t.target})},e.appendChild(r),r}Health.events=lr,Health._UNLOAD_SUBSCRIBED=!1,Ye(window,Health),function(e){e.Anonymous="anonymous",e.UseCredentials="use-credentials",e.Empty=""}(br||(br={}));var wr=Object.freeze({__proto__:null,CHAPTER_CHANGED:"chapter:changed",CHAPTERS_NEW:"chapters:new"});class Chapters{constructor(){this._track_added_handler=Kt,this._cue_changed_handler=Kt,this.chapters=[],this.render=this.render.bind(this)}init(e,t,r){this._root=t,this._player=r,this._timeline=we(r,x),this._track_added_handler=this.track_added.bind(this,r),this._cue_changed_handler=this.cue_changed.bind(this,r),r.textTracks.addEventListener("addtrack",this._track_added_handler),this.wireup(r,e),r.chapters=this,r.on(L,e=>{e.data&&this.wireup(r,e.data)}),r.on(S,()=>{this.wiredown(r),r.textTracks.removeEventListener("addtrack",this._track_added_handler),r.off("durationchange",this.render)}),r.on("durationchange",this.render)}track_added(e,t){}cue_changed(e,t){var r;this._current_chapters_track&&(this.current_cue=this._current_chapters_track.track.activeCues?this._current_chapters_track.track.activeCues[0]:void 0,this._timeline&&Be(this._timeline,"chapter:changed",null===(r=this.current_cue)||void 0===r?void 0:r.text))}set_chapters(e){this.chapters=e,this.render()}jump(e){this._player&&this.chapters[e]&&(this._player.currentTime=this.chapters[e].start)}current(){if(this.current_cue)return this.chapters.find(e=>e.cue==this.current_cue)}render(){if(!this._root||!this._player||!this._timeline)return;const e=this._player.duration;isFinite(e)&&(Be(this._timeline,"chapters:new",this.chapters.map(t=>({title:t.label,left:t.start/e*100+"%",width:(t.end-t.start)/e*100+"%"}))),this._root.classList.toggle("has-chapters",!!this.chapters.length))}wireup(e,t){const r=Array.isArray(t.chapters)?t.chapters[0]:t.chapters;r&&r.src!==this._current_chapters_src&&(this.wiredown(e),this._current_chapters_track=Lr(e,Object.assign(Object.assign({},r),{kind:"chapters",mode:"hidden"})),this._current_chapters_track.onload=()=>{var e;(null===(e=this._current_chapters_track)||void 0===e?void 0:e.track.cues)&&this.set_chapters(Array.from(this._current_chapters_track.track.cues).filter(e=>e instanceof VTTCue).map(e=>{const t=e;return{start:e.startTime,end:e.endTime,cue:t,label:t.text}}))},this._current_chapters_src=r.src,this._current_chapters_track.addEventListener("cuechange",this._cue_changed_handler))}wiredown(e){this.set_chapters([]),this._current_chapters_track&&(this._current_chapters_track.removeEventListener("cuechange",this._cue_changed_handler),e.removeChild(this._current_chapters_track))}}Chapters.events=wr,Ye(window,Chapters);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerPrimary extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-primary");const t={logo:""};e.on(L,e=>{var r,n;const i=t.logo,a=(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo)||"";i!=a&&(t.logo=a,this.set_logo(a,null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo_href))})}set_logo(e,t){if(this.innerHTML="",!e)return;const r=document.createElement("img");if(r.classList.add("fp-logo"),r.src=e,!t)return this.append(r);const n=document.createElement("a");n.href=t,n.append(r),this.append(n)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(L,e=>{var t;const r=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN;this.innerText=isFinite(r)?Ce(r):""})}}const kr={name:"fp-fullscreen",translation_key:"core.fullscreen"},Rr={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},Dr={name:"fp-play",translation_key:"core.play"},Or={name:"fp-pause",translation_key:"core.pause"},Cr={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Ir={translation_key:"core.play",name:"fp-small-play"},xr={translation_key:"core.pause",name:"fp-small-pause"},Pr={name:"fp-fast-forward"},Mr={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(i,(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Fr={passive:!0};var Nr;function Ur(e,t){let r=0,n=-1,i=-1;const a=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=e.classList;e.id=a,s.remove(Nr.GRABBING),s.remove(Nr.TOUCHING);const o=t.onseek||Kt,l=t.onstart||Kt,c=t.onend||Kt,d=t.onmouse||Kt,f=t.ontouch||Kt,h=t.ontouchend||Kt;function p(t){!function(){const t=e.getBoundingClientRect();r=t.left,n=t.width}();let i=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-r;return i>n&&(i=n),i<0&&(i=0),i/n*100}function v(t){const r=p(t);r!=i&&(o(e,r),i=r)}return e.addEventListener("touchstart",(function(t){Br(e,t)&&(s.add(Nr.TOUCHING),jr(e.parentElement)&&(t.preventDefault(),s.add(Nr.GRABBING),f(e,p(t)),l(e,p(t)),v(t)))}),Fr),e.addEventListener("touchmove",(function(t){t.preventDefault(),v(t),d(e,p(t))}),Fr),e.addEventListener(u,(function(t){setTimeout((function(){s.remove(Nr.TOUCHING)}),500),Br(e,t)&&(t.preventDefault(),s.remove(Nr.GRABBING),h(e,p(t)),c(e,p(t)),n=0)}),Fr),e.addEventListener("touchcancel",(function(){s.remove(Nr.GRABBING,Nr.TOUCHING),n=0}),Fr),e.addEventListener("mousedown",(function(t){s.contains(Nr.TOUCHING)||(document.addEventListener("mousemove",v),s.add(Nr.GRABBING),l(e,p(t)),t.preventDefault(),v(t))})),e.addEventListener("mousemove",(function(t){s.contains(Nr.TOUCHING)||d(e,p(t))})),document.addEventListener("mouseup",(function(t){s.contains(Nr.TOUCHING)||(document.removeEventListener("mousemove",v),s.contains(Nr.GRABBING)&&(s.remove(Nr.GRABBING),c(e,p(t)),n=0))})),e}function Br(e,t){const r=t.target;return!!r&&(r&&!r.closest(e.id)||!jr(e.parentElement)||!e.classList.contains(Nr.TOUCHING))}function jr(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(Nr||(Nr={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(e){super(e),this.className="fp-volume";const t=e.root.classList,r=t.contains("is-tiny")?6:t.contains("is-small")?8:10,n=Array.from({length:r}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});this.append(...n),Ur(this,{onseek:(t,r)=>{r>0&&(e.muted=!1,function(e){try{localStorage.removeItem(e)}catch(e){}}("mute")),nr("volume",(e.volume=r/100).toString()),this.adjustVolumeSlider(e.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",e.i18n("core.volume","volume")),e.on("volumechange",()=>{(0==e.volume||e.muted)&&this.adjustVolumeSlider(0),this.classList.contains(Nr.GRABBING)||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString());const t=Array.from(this.querySelectorAll(".fp-tick")),r=Math.round(e*t.length);t.forEach((e,t)=>{e.classList.toggle("fp-color",t<r)})}}function Gr(e,t){if(!e.parentElement)return;const r=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-r+"%",e.style.display="block"}function Hr(e,t){if(isNaN(e.duration))return;const r=e.buffered;r.length&&(t.style.width=Math.min(r.end(r.length-1)/e.duration*100,100)+"%")}function Kr(e,t){e.style.width="0",t.style.width="0",t.style.display="none"}function Vr(e,t,r){if(t.seeking||!t.seekable||0==t.seekable.length)return;const n=Wr(t,e/100);Gr(r,e);const i=isFinite(t.duration)?n:t.seekable.start(0)+n;r.innerText=Ce(i)}function Wr(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(e.duration))return er(e)*t;const r=e.seekable.start(0);return r+t*(e.seekable.end(0)-r)}function qr(e,t){e.style.width="0",t.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=Re("fp-buffer"),this.progress=Re("fp-progress","fp-color"),this.tooltipEle=Re("fp-timestamp"),this.proposedSeekBar=Re("fp-hover"),this.dragger=Re("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",e.i18n("timeline","Timeline")),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);let r=!1;const n=requestAnimationFrame;let i=void 0;const a=()=>{var r;0==e.reaper||t.live||(r=e,this.progress.style.width=r.currentTime/r.duration*100+"%",i=void 0,e.paused||this.classList.contains(Nr.GRABBING)||i||(i=setTimeout(a,200)))},s=()=>!!this.player.opt("opts.seekable",!0)&&!isNaN(this.player.duration);Ur(this,{onseek:(r,n)=>{if(s())switch(!!t.live){case!0:Vr(n,e,this.tooltipEle);break;case!1:!function(e,t,r){const n=t.duration*(e/100);if(t.disabled&&n>t.currentTime)return!1;r.style.width=e+"%",t.currentTime=n}(n,e,this.progress),Gr(this.tooltipEle,n)}},onstart:()=>{s()&&(e.emit("timeline/gesture/start"),e.setState(Q,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(r,i){n(a),0!=t.seekable&&(e.setState(Q,!1),t.live&&function(e,t){e/=100,t.currentTime=Wr(t,e)}(i,e))},ontouch:function(){e.paused||(r=!0,e.pause())},ontouchend:()=>{r&&(r=!1,e.play()),t.live?qr(this.proposedSeekBar,this.tooltipEle):Kr(this.proposedSeekBar,this.tooltipEle)},onmouse:(r,n)=>{if(s()&&!this.classList.contains(Nr.GRABBING))switch(e.emit("timeline/gesture/move",{percent:n}),!!t.live){case!0:!function(e,t){t.style.width=function(e){return 100-e}(e)+"%"}(n,this.proposedSeekBar),Vr(n,e,this.tooltipEle);break;case!1:!function(e,t){t.style.width=e+"%"}(n,this.proposedSeekBar),function(e,t,r){if(isNaN(e)||isNaN(t.duration))return;Gr(r,e),r.innerHTML="";const n=document.createElement("span");n.innerText=Ce(e/100*t.duration),r.append(n)}(n,e,this.tooltipEle)}}}),e.on(L,(function(e){e.data&&(t=e.data)})),e.on(y,()=>n(a)),e.on("live",()=>{this.progress.style.width="0%"}),e.on(v,()=>{0==e.reaper||t.live||Hr(e,this.bufferEle)}),e.on("dvr",e=>{e.detail&&(this.progress.style.width=e.detail.offset+"%")}),e.on("timeupdate",()=>{0!=e.reaper&&(n(a),this.setAttribute("aria-valuenow",e.currentTime+""),t.live||Hr(e,this.bufferEle))}),e.on(h,()=>{0!=e.reaper&&(t.live||Hr(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const r=$t(e)?er(e):t.data||e.duration;isNaN(r)||(this.setAttribute("aria-valuemax",r+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(l,()=>{e.emit("timeline/gesture/end"),t.live?qr(this.proposedSeekBar,this.tooltipEle):Kr(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(e){super(e),this.handleChapters(e)}handleChapters(e){const t=document.createElement("div");let r;this.addEventListener("chapters:new",e=>{t.innerText="",this.querySelectorAll(".fp-chapter").forEach(e=>this.removeChild(e)),e.data&&e.data.forEach(e=>{const n=document.createElement("div");n.className="fp-chapter",n.style.left=e.left,n.style.bottom=n.style.top="0",n.style.width=e.width,n.title=e.title,n.onmouseover=()=>{t.innerText=e.title},n.onmouseleave=()=>{t.innerText=r||""},this.appendChild(n)})}),this.addEventListener("chapter:changed",n=>{var i;const a=n.data;a&&(t.parentNode||(null===(i=we(e,O))||void 0===i||i.insertAdjacentElement("beforebegin",t),t.classList.toggle("fp-togglable",!0),t.classList.toggle("fp-chapter-info",!0)),r=a,t.innerText=a)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=Re("fp-live-text"),r=Re("fp-live-indicator","fp-color");t.innerHTML="live",this.append(r,t),this.addEventListener(i,(function(){!function(e){try{if(!e.hasState("is-live-seeked"))return;e.emit("live"),e.dvr_offset=0,e.currentTime=tr(e)}catch(e){console.warn("failed to seek to now: %j",e)}}(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),e.on(L,r=>{if(0==e.reaper||!r.data)return;t=r.data;const n=$t(e)?NaN:r.data.duration||0;if(isNaN(n)||n>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Ce(n)}),e.on(h,()=>{var r,n;0==e.reaper||t.live||(n=this,(r=e).duration&&(n.innerText=Ce(r.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=Ce(0),e.on(L,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var r;0!=e.reaper&&(t.live?(r=e,this.innerText=Ce(r.currentTime)):function(e,t){t.innerText=Ce(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=le(e,"flowplayer-small-pause-icon"),r=le(e,"flowplayer-small-play-icon");t.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){r.focus&&r.focus()}),100)})),r.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){t.focus&&t.focus()}),100)})),this.append(t,r)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add(t);const r=this.classList.contains("fp-left-zone")?-1:1,n=document.createElement("span"),i=le(e,this.classList.contains("fp-left-zone")?H:"flowplayer-fast-forward-icon");i.removeAttribute("tabindex"),n.classList.add("fp-zone-seconds"),this.append(n,i);e.on(b,()=>{n.innerText=""}),e.on("seek:queued",e=>{const t=e.data;if(!t)return;if("number"!=typeof t.offset)return;const r=t.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()}),e.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener(u,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState("no-timeline")||!e.hasState("will-seek")&&!e.hasState($)||e.enqueueSeek(5*r)&&(t.stopPropagation(),t.preventDefault())}))}reset_zone(){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText="")}render_zone_state(e){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText=Math.abs(e)+"")}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(e,t,...r){super(e),this.className=t;const n=e.createComponents(...r);this.append(...n),"fp-left"!==t&&n.forEach(t=>{t.addEventListener(i,()=>e.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-wait"),Array(...Array(4)).map((e,t)=>t).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle-zone");const t=e.createComponents(B,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[j,G].forEach(t=>{const r=le(e,t);r.removeAttribute("tabindex"),this.append(r)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=le(e,K);this.append(t),!r().ios&&this.append(le(e,P)),t instanceof FlowplayerIcon&&t.addEventListener(i,(function(){e.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-header"),this.append(...e.createComponents("flowplayer-header-left-zone","flowplayer-header-right-zone")),e.reaper&&e.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-controls","fp-togglable"),this.append(...e.createComponents("flowplayer-control-buttons",C,I,x,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n(t==kr?"core.fullscreen":"core.fullscreen_exit"))}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",U,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n("core.play")),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),[y,b].forEach(t=>e.once(t,()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")}))}handleClick(e){[i,a].forEach(t=>this.addEventListener(t,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(i,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState(J)||e.togglePlay()}),0)})),e.on(a,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener(u,(function(t){0!=t.cancelable&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on(u,(function(r){setTimeout((function(){if(r.defaultPrevented)return;if(e.hasState(J))return;if(e.ended)return e.togglePlay(!0);const n=e.hasState(X);t&&clearTimeout(t),(n||e.hasState($)||e.hasState("no-autoplay"))&&(e.hasState($)&&(e.setState($,!1),e.setState("is-hovered",!1)),e.togglePlay(),n)||(e.setState($,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState($,!1),e.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-ui"),this.append(...e.createComponents(M,N,O))}}pt.extensions.unshift.apply(pt.extensions,[I18n,Analytics,Health,class Default{constructor(e){ue(e,D,FlowplayerUi),ue(e,O,FlowplayerControls),ue(e,C,FlowplayerLiveStatus),ue(e,"flowplayer-control-duration",FlowplayerDuration),ue(e,x,e.extensions.find(e=>e.name===Chapters.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),ue(e,I,FlowplayerElapsedTime),ue(e,P,FlowplayerVolumeBar),ue(e,"flowplayer-volume-control",FlowplayerVolumeControl),ue(e,"flowplayer-control-buttons",FlowplayerControlButtons),ue(e,M,FlowplayerHeader),ue(e,F,FlowplayerPrimary),ue(e,"flowplayer-header-duration",FlowplayerHeaderDuration),ue(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left",F,"flowplayer-header-duration")}}),ue(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),ue(e,N,FlowplayerMiddle),ue(e,U,FlowplayerMiddleZone),ue(e,B,FlowplayerMiddleWait),ue(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),ue(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),ue(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),ue(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,Ir),this.setAttribute("role","button")}}),ue(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,xr),this.setAttribute("role","button")}}),ue(e,j,class extends FlowplayerIcon{constructor(e){super(e,Dr)}}),ue(e,G,class extends FlowplayerIcon{constructor(e){super(e,Or)}}),ue(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,kr)}}),ue(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,Rr)}}),ue(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,Pr)}}),ue(e,H,class extends FlowplayerIcon{constructor(e){super(e,Mr)}}),ue(e,K,class extends FlowplayerIcon{constructor(e){super(e,Cr),this.classList.add("fp-volumebtn"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute"))})}})}init(e,t,r){var n;ar(e,0,r),ir(e,t,r),n=r,"undefined"!=typeof window&&"ontouchstart"in window&&n.setState("is-touch-device",!0),n.setState("is-accessibility",!1)}}]);var zr=Object.assign(pt,{ui:Xt,i18n:I18n}),Yr=gt(mt((function(e,t){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
16
16
  /*!*********************************************!*\
17
17
  !*** ./node_modules/eventemitter3/index.js ***!
18
18
  \*********************************************/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowplayer/player",
3
- "version": "3.0.1-rc.2",
3
+ "version": "3.0.1-rc.3",
4
4
  "description": "video player for the future",
5
5
  "license": "https://flowplayer.com/commercial-license",
6
6
  "main": "default.js",
package/plugins/health.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.health=t())}(this,(function(){"use strict";const e="rebuffer";var t=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:e});const n="load",i="fullscreenenter",o="fullscreenexit",s="loadedmetadata",a="loadeddata",r="progress",d="loadstart",l="pause",c="playing",_="waiting",u="canplay",h="ended",f="seeked",p="seeking";function m(e){try{return!!new URL(e)}catch(e){return!1}}const E=navigator;function v(e){var t,n;const i=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return i?1e-6*i:(null===(n=E.connection)||void 0===n?void 0:n.downlink)||-1}function g(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const y=[1e7]+""+-1e3+-4e3+-8e3+-1e11,R=()=>"undefined"==typeof crypto?"":y.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),O=R(),N=[];function D(e){const t=N.slice(0);N.length=0,e.logger.log(`:dispatch events={${t.length}}`),g("https://health.flowplayer.com/v1/health/events",t)}function T(e,t,n){N.push(t),e.logger.log(":enqueue",t.event,t),N.length<10&&!n||D(e)}const A=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},w=(e,t)=>Object.assign(e,{detail:t}),I=(e,{event:t,media_session_id:n})=>({event:t,media_session_id:n,device_id:e.deviceId(),session_id:O,timestamp:Date.now(),version:"3.0.1-rc.2",commit:"6fbb2390d6a7c662947c90924411af433b4f2927",ima_sdk_version:A(),preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay),source:e.original_src,downlink_mbs:v(e),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime}),b=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function S(e,t,n,i){const o=I(t,{event:n,media_session_id:e.media_session_id}),{before:s,after:a}=i;T(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,b(s),b(a)))}var C;function M(e){switch(e){case C.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case C.MEDIA_ERR_NETWORK:return"a network error occurred";case C.MEDIA_ERR_DECODE:return"unable to decode media content";case C.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case C.NO_INTERNET:return"no internet connection detected";case C.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}!function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(C||(C={}));const k=(e,t)=>{let n=null;return(...i)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...i),e)}};class Health{constructor(e,t){if(this.logger=function(e,t){return{log:(...n)=>{const i=e.opt("debug");i&&t.match(i)&&console.log(t,...n)}}}(t,"health"),this.media_session_id=R(),!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=()=>e.instances.forEach(e=>e.emit("unload"));document.addEventListener("visibilitychange",()=>{"hidden"==document.visibilityState&&t()}),window.addEventListener("pagehide",t)}}init(t,E,v){!function(t){t.on(_,(function(n){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit(e)}))}(v),v.on("health:record",({detail:e})=>{const t=I(v,{event:e.event,media_session_id:this.media_session_id});Object.assign(t,e.detail||{}),T(this,t)}),[u,d,n,s,a,r,_,e].forEach(e=>{v.on(e,e=>{T(this,I(v,{event:e.type,media_session_id:this.media_session_id}))})}),[c,l,p,f,h,i,o].forEach(e=>{v.on(e,e=>{T(this,I(v,{event:e.type,media_session_id:this.media_session_id}))})}),v.on("volumechange",k(800,e=>{const t=I(v,{event:e.type,media_session_id:this.media_session_id});T(this,w(t,{volume:parseFloat(v.volume.toFixed(2)),muted:v.muted}))})),v.on("resize",k(800,e=>{const t=I(v,{event:e.type,media_session_id:this.media_session_id});T(this,w(t,{height:E.clientHeight,width:E.clientWidth}))})),v.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return S(this,v,e,t)}}),v.addEventListener("error",e=>{const t=I(v,{event:e.type,media_session_id:this.media_session_id}),n=e.error||v.error;if(!n)return T(this,t,!0);const i=n.code,o={error_message:n.message||M(i),error_code:i,error_stack:n.stack||""};return T(this,w(t,o),!0)}),v.on("src",e=>{var t;const n=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof n)return;if(!m(v.original_src))return;if(!m(n))return;if(n==v.original_src)return;this.media_session_id=R();T(this,I(v,{event:e.type,media_session_id:this.media_session_id})),D(this)}),v.on("unload",e=>{T(this,I(v,{event:e.type,media_session_id:this.media_session_id})),D(this)})}}return Health.events=t,Health._UNLOAD_SUBSCRIBED=!1,function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,Health),Health}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.health=t())}(this,(function(){"use strict";const e="rebuffer";var t=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:e});const n="load",i="fullscreenenter",o="fullscreenexit",s="loadedmetadata",a="loadeddata",r="progress",d="loadstart",c="pause",l="playing",_="waiting",u="canplay",h="ended",f="seeked",p="seeking";function m(e){try{return!!new URL(e)}catch(e){return!1}}const E=navigator;function v(e){var t,n;const i=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return i?1e-6*i:(null===(n=E.connection)||void 0===n?void 0:n.downlink)||-1}function g(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const y=[1e7]+""+-1e3+-4e3+-8e3+-1e11,R=()=>"undefined"==typeof crypto?"":y.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),O=R(),N=[];function D(e){const t=N.slice(0);N.length=0,e.logger.log(`:dispatch events={${t.length}}`),g("https://health.flowplayer.com/v1/health/events",t)}function T(e,t,n){N.push(t),e.logger.log(":enqueue",t.event,t),N.length<10&&!n||D(e)}const A=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},w=(e,t)=>Object.assign(e,{detail:t}),I=(e,{event:t,media_session_id:n})=>({event:t,media_session_id:n,device_id:e.deviceId(),session_id:O,timestamp:Date.now(),version:"3.0.1-rc.3",commit:"99bc0ccc7b34661f9715474d094f159f9bdbfeac",ima_sdk_version:A(),preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay),source:e.original_src,downlink_mbs:v(e),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime}),b=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function S(e,t,n,i){const o=I(t,{event:n,media_session_id:e.media_session_id}),{before:s,after:a}=i;T(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,b(s),b(a)))}var C;function M(e){switch(e){case C.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case C.MEDIA_ERR_NETWORK:return"a network error occurred";case C.MEDIA_ERR_DECODE:return"unable to decode media content";case C.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case C.NO_INTERNET:return"no internet connection detected";case C.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}!function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(C||(C={}));const k=(e,t)=>{let n=null;return(...i)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...i),e)}};class Health{constructor(e,t){if(this.logger=function(e,t){return{log:(...n)=>{const i=e.opt("debug");i&&t.match(i)&&console.log(t,...n)}}}(t,"health"),this.media_session_id=R(),!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=()=>e.instances.forEach(e=>e.emit("unload"));document.addEventListener("visibilitychange",()=>{"hidden"==document.visibilityState&&t()}),window.addEventListener("pagehide",t)}}init(t,E,v){!function(t){t.on(_,(function(n){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit(e)}))}(v),v.on("health:record",({detail:e})=>{const t=I(v,{event:e.event,media_session_id:this.media_session_id});Object.assign(t,e.detail||{}),T(this,t)}),[u,d,n,s,a,r,_,e].forEach(e=>{v.on(e,e=>{T(this,I(v,{event:e.type,media_session_id:this.media_session_id}))})}),[l,c,p,f,h,i,o].forEach(e=>{v.on(e,e=>{T(this,I(v,{event:e.type,media_session_id:this.media_session_id}))})}),v.on("volumechange",k(800,e=>{const t=I(v,{event:e.type,media_session_id:this.media_session_id});T(this,w(t,{volume:parseFloat(v.volume.toFixed(2)),muted:v.muted}))})),v.on("resize",k(800,e=>{const t=I(v,{event:e.type,media_session_id:this.media_session_id});T(this,w(t,{height:E.clientHeight,width:E.clientWidth}))})),v.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return S(this,v,e,t)}}),v.addEventListener("error",e=>{const t=I(v,{event:e.type,media_session_id:this.media_session_id}),n=e.error||v.error;if(!n)return T(this,t,!0);const i=n.code,o={error_message:n.message||M(i),error_code:i,error_stack:n.stack||""};return T(this,w(t,o),!0)}),v.on("src",e=>{var t;const n=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof n)return;if(!m(v.original_src))return;if(!m(n))return;if(n==v.original_src)return;this.media_session_id=R();T(this,I(v,{event:e.type,media_session_id:this.media_session_id})),D(this)}),v.on("unload",e=>{T(this,I(v,{event:e.type,media_session_id:this.media_session_id})),D(this)})}}return Health.events=t,Health._UNLOAD_SUBSCRIBED=!1,function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,Health),Health}));